This document describes how to implement an enhanced Deep Analysis Report mode for the project. The goal is to provide detailed structural and functional context of each file without exposing raw source code, so that the output can be safely used for documentation, AI model ingestion, or code reviews.
- Generate detailed, non-recoverable reports that explain the program's structure, intent, and relationships between files.
- Ensure reports remain safe for public sharing: no code bodies or sensitive content should be included.
- Allow developers to toggle depth and focus of reports.
- Support both human-readable (Markdown, HTML) and machine-readable (JSON) formats.
- Include a clear safety disclaimer to warn users these reports are not suitable for project recovery.
- Details Included:
- File path, size, timestamps.
- Programming language.
- Top-level constructs (modules, classes, functions).
- Function/class signatures only (no bodies).
- First line of docstrings.
- TODO/FIXME counts.
- Brief inferred responsibility description (via heuristics).
- Global index of public classes/functions.
- Parameter lists, return type hints.
- One-line docstring summaries (if available).
- Grouped by module.
- Per-file imports (internal vs external).
- Condensed dependency graph.
- Highlight circular dependencies or "hub" files.
- Output in JSON and optionally DOT/Mermaid for visualisation.
- Lists call targets per file (qualnames only).
- No function bodies.
- Useful to show orchestration points.
- Detect
if __name__ == "__main__"blocks. - Capture argparse/click/typer command definitions.
- Include CLI options and descriptions.
- Extract environment variable reads.
- Detect
.env, YAML, JSON, or TOML keys. - Infer data types and defaults.
- For GUI-related files (Tkinter, CTk, Pygubu):
- Windows, frames, and major widgets.
- Command/callback bindings.
- List discovered tests and their target modules.
- Include fixtures and parameterisation hints.
- Per file:
- SLOC (non-blank lines).
- Cyclomatic complexity estimate.
- Number of TODO/FIXME/XXX markers.
- Heuristic "hotspot" score (size × churn if Git is available).
- Collect all user-visible strings.
- Extract translation keys and placeholders.
- Detect licences, copyright notices, and licence mismatches.
- MIME type, dimensions (for images), duration (for media).
- No actual file content.
- Compact file "cards" for ingestion into AI models.
- Each card contains:
- Path, hash, language, signatures, imports, complexity band.
- Docstring summaries, inferred file role.
- Truncated metadata safe for tokenised input.
| Flag / Option | Description |
|---|---|
--mode=deep-outline |
Generate full per-file deep outline. |
--mode=api-index |
Generate API-only signature report. |
--mode=deps |
Generate dependency map. |
--mode=llm-bundle |
Generate machine-readable JSON bundle. |
--redact=secrets,emails |
Redact sensitive content. |
--limit-body=0 |
Ensures no code body text is included. |
--sig-doclines=1 |
Number of docstring lines to include. |
| `--graph=imports | calls` |
--formats=md,html,json |
Output in multiple formats. |
--llm-bundle-chunk=4000 |
Max characters per JSON record. |
Important: This is a non-recoverable report. It intentionally omits code bodies and raw file content. It is suitable for providing context to developers or AI systems but must not be used as a substitute for project backups.
- Use AST parsing (Python) and lightweight static analysis to extract structure.
- Heuristically label file roles: e.g., UI, Core, Config, Test.
- Automatically redact or omit minified files where reconstruction risk is high.
- Generate human-readable and machine-readable outputs in a single pass.
- Ensure all outputs are consistent across formats.
path: app/gui.py
meta:
language: Python
size: 42 KB
sloc: 1079
modified: 2025-09-28
imports:
- tkinter
- customtkinter
- app.config
classes:
- name: MainWindow
base: ctk.CTk
methods:
- __init__(...)
- build_menu(...)
- open_profile_studio(...)
functions:
- name: launch_app
signature: (argv: list[str]) -> int
doc: "Initialises theme, creates MainWindow, enters mainloop"
responsibility: "Defines the root CTk window and manages main navigation."
tests:
- tests/test_gui_smoke.py::test_mainwindow_starts
risk:
complexity: medium-high
todo_count: 3