feat: major improvements — layout, cycles, integrations, usage examples, tests #1

Merged
dparmeev merged 15 commits from feature/improvements-v2 into main 2026-02-15 11:21:47 +03:00

15 Commits

Author SHA1 Message Date
a3ee003947 fix: all 4 archdoc issues — cycles, layout, integrations, usage examples
1. Module Cycles: properly format cycle paths as A → B → C → A
2. Repository layout: group by top-level directory with file counts
3. Integration detection: match patterns against import names (substring),
   add Storage and AI/ML categories to all templates and summary
4. Usage examples: extract __init__ required params for class constructors

Also fix golden test to use ends_with for module-prefixed symbol IDs.
2026-02-15 11:14:42 +03:00
c095560e13 feat: improve documentation quality with real data
- Extract file-level docstrings from Python files (module-level string expressions)
- Use __init__.py docstrings as module doc_summary
- Use file docstrings as file purpose in layout tables (instead of 'Source file')
- Populate module outbound_modules/inbound_modules from import edges (internal only)
- Make filename sanitization consistent (sanitize_for_link matches sanitize_filename)
- Clean up stale .md files from previous runs before generating
- Fill ARCHITECTURE.md template with real layout, modules index, and critical points
- Add file_docstring field to ParsedModule and file_purpose to FileDoc
2026-02-15 04:10:20 +03:00
25fdf400fa feat: use actual project data, real usage examples, dry-run/verbose flags, skip-unchanged optimization
- renderer: render_architecture_md accepts Config, uses project name and current date
- renderer: generate real Python usage examples from analyzed symbols
- writer: skip writing files when content unchanged (optimization)
- cli: add --dry-run flag to generate command (lists files without writing)
- cli: add verbose logging for file/module/symbol generation progress
2026-02-15 03:32:10 +03:00
df52f80999 docs: add CHANGELOG.md documenting all branch changes 2026-02-15 03:28:36 +03:00
73154e5865 docs: comprehensive README with badges, config reference, and command docs 2026-02-15 03:28:22 +03:00
d237650f47 test: add full pipeline integration tests
- Test config loading and validation on test-project
- Test scanning Python files from test-project
- Test cycle detection with known cyclic and acyclic graphs
- Test renderer output generation
- Test duration and file size parsing
2026-02-15 03:27:46 +03:00
40f87f4d61 feat: add config validation and dependency cycle detection
- Config::validate() checks project.root, language, scan.include,
  python.src_roots, caching.max_cache_age, and scan.max_file_size
- Add parse_duration() and parse_file_size() helper functions
- Implement DFS-based cycle detection in cycle_detector.rs
- Wire cycle detection into renderer critical points section
- Add comprehensive unit tests for all new functionality
2026-02-15 03:26:43 +03:00
9f823d2a2a refactor: decompose CLI into commands, fix clippy, improve error handling
- Decompose main.rs into commands/ modules (generate, init, check, stats)
- Fix sanitize_filename to use safe replacements
- Compute Python module paths from src_roots instead of file paths
- Add stats command, colored output, progress bar, and generation summary
- Resolve all clippy warnings (redundant closures, collapsible ifs, etc.)
- Replace last unwrap() with proper error handling
- Add target/ to .gitignore, remove target/ artifacts from git tracking
2026-02-15 03:23:01 +03:00
736909ac3d Add stats command, colored output, progress bar, and generation summary
- New 'archdoc stats' command showing project statistics without generating docs
  - Symbol breakdown by kind (class/function/method/async)
  - Top-10 by fan-in and fan-out
  - Detected integrations (HTTP/DB/Queue)
  - Basic cycle detection on module imports
- Colored terminal output using 'colored' crate
- Progress bar for file parsing using 'indicatif' crate
- Generation summary showing files/modules/symbols/edges/integrations
2026-02-15 02:57:35 +03:00
da527e6960 Improve Python analyzer: full AST traversal, signatures, docstrings, method detection 2026-02-15 02:55:29 +03:00
7ccc484ea8 Add workspace Cargo.toml for unified builds 2026-02-15 02:52:57 +03:00
f7e08aad0e feat(parser): реализован парсинг новых файлов
- Добавлена поддержка формата *.xyz, что расширило возможности анализа проектов.
- Реализована функция `parse_xyz` в файле [`archdoc-core/src/parser.rs`](archdoc-core/src/parser.rs:42) для чтения и валидации содержимого.
- Обновлены тесты в [`archdoc-core/tests/parser_tests.rs`](archdoc-core/tests/parser_tests.rs:15) для покрытия нового формата.
- Обновлена документация в `README.md` с примерами использования нового парсера.
2026-01-25 22:26:34 +03:00
b7d3e3e488 feat(renderer): implement module-level documentation generation
- Added module_md template to renderer for generating detailed module documentation
- Updated CLI to use renderer for module docs with fallback to simple template
- Generated module documentation for test project files with symbols, dependencies, and integrations
- Added proper error handling when module rendering fails

This implements the core functionality for generating detailed architectural documentation at the module level, including symbols, dependencies, and integration points.
2026-01-25 21:24:54 +03:00
3ffe5e235f Add project configuration and initial documentation files
- Introduced `archdoc.toml` configuration file for project settings, including scanning and analysis options.
- Created initial `ARCHITECTURE.md` file with project summary and structure.
- Generated documentation files for source files and modules, including placeholders for future content.
- Updated the documentation generation logic to handle new project structure and file paths.
2026-01-25 20:44:24 +03:00
df50701764 Refactor directory structure creation and enhance documentation generation
- Simplified the creation of output directory structure in `init_project` and `generate_docs` functions.
- Added a `sanitize_filename` function to ensure valid filenames for generated documentation files.
- Implemented individual documentation file creation for modules and files in the `generate_docs` function.
- Updated links in the renderer to use the new `sanitize_for_link` function for safe URL generation.
- Adjusted the `extract_docstring` method in `PythonAnalyzer` to accept the body parameter without using it, preparing for future enhancements.
2026-01-25 20:38:49 +03:00