sourcecode 0.13.0__tar.gz → 0.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sourcecode-0.13.0 → sourcecode-0.14.0}/-o +1 -1
- {sourcecode-0.13.0 → sourcecode-0.14.0}/PKG-INFO +215 -6
- {sourcecode-0.13.0 → sourcecode-0.14.0}/README.md +625 -416
- {sourcecode-0.13.0 → sourcecode-0.14.0}/docs/schema.md +894 -754
- {sourcecode-0.13.0 → sourcecode-0.14.0}/pyproject.toml +1 -1
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/__init__.py +1 -1
- sourcecode-0.14.0/src/sourcecode/architecture_analyzer.py +348 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/cli.py +87 -28
- sourcecode-0.14.0/src/sourcecode/code_notes_analyzer.py +242 -0
- sourcecode-0.14.0/src/sourcecode/env_analyzer.py +320 -0
- sourcecode-0.14.0/src/sourcecode/git_analyzer.py +241 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/schema.py +500 -335
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/serializer.py +106 -96
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/summarizer.py +137 -26
- sourcecode-0.14.0/tests/test_architecture_analyzer.py +101 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_lqn.py +226 -199
- {sourcecode-0.13.0 → sourcecode-0.14.0}/.gitignore +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/.ruff.toml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/architecture_summary.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/classifier.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/coverage_parser.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/dependency_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/__init__.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/base.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/dart.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/dotnet.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/elixir.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/go.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/heuristic.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/java.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/jvm_ext.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/nodejs.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/parsers.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/php.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/project.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/python.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/ruby.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/rust.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/systems.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/terraform.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/detectors/tooling.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/doc_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/graph_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/metrics_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/prepare_context.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/redactor.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/scanner.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/semantic_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/tree_utils.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/src/sourcecode/workspace.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/__init__.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/conftest.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/coverage.xml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/fastapi_app/pyproject.toml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/fastapi_app/src/main.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/go_service/cmd/api/main.go +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/go_service/go.mod +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/jacoco.xml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/lcov.info +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/nextjs_app/app/page.tsx +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/nextjs_app/package.json +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/nextjs_app/pnpm-lock.yaml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/pnpm_monorepo/apps/web/app/page.tsx +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/pnpm_monorepo/apps/web/package.json +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/pnpm_monorepo/packages/api/main.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/pnpm_monorepo/packages/api/pyproject.toml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/fixtures/pnpm_monorepo/pnpm-workspace.yaml +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_architecture_summary.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_classifier.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_cli.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_coverage_parser.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_dependency_analyzer_node_python.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_dependency_analyzer_polyglot.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_dependency_schema.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_go_rust_java.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_nodejs.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_php_ruby_dart.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_python.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_universal_managed.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detector_universal_systems.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_detectors_base.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_doc_analyzer_jsdom.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_doc_analyzer_python.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_graph_analyzer_polyglot.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_graph_analyzer_python_node.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_graph_schema.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_dependencies.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_detection.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_docs.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_graph_modules.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_metrics.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_multistack.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_semantics.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_integration_universal.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_metrics_analyzer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_packaging.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_real_projects.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_redactor.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_scanner.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_schema.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_semantic_analyzer_node.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_semantic_analyzer_python.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_semantic_import_resolution.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_semantic_schema.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_summarizer.py +0 -0
- {sourcecode-0.13.0 → sourcecode-0.14.0}/tests/test_workspace_analyzer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sourcecode
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Genera un mapa de contexto estructurado de proyectos de software para agentes IA
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -102,6 +102,14 @@ sourcecode --version
|
|
|
102
102
|
| `--graph-edges imports,calls,contains,extends` | none | Override the default edge kinds for the selected detail level. |
|
|
103
103
|
| `--docs` | off | Include extracted documentation: docstrings, signatures, and comments from Python and JS/TS modules and symbols. |
|
|
104
104
|
| `--docs-depth module\|symbols\|full` | `symbols` | Documentation extraction depth: module-level only, modules and top-level symbols (functions/classes), or all symbols including methods. |
|
|
105
|
+
| `--full-metrics` | off | Include code quality metrics: LOC, symbols, complexity, tests, and coverage per file. |
|
|
106
|
+
| `--semantics` | off | Include semantic call graph, cross-file symbol linking, and advanced import resolution. |
|
|
107
|
+
| `--architecture` | off | Architectural inference: groups files into functional domains, detects layer patterns (MVC, layered, hexagonal, fullstack), and infers approximate bounded contexts. Optionally uses `--graph-modules` for more precise bounded context inference. |
|
|
108
|
+
| `--git-context` / `-g` | off | Include git context: recent commits, most-changed files (hotspots), uncommitted changes, contributors, and a natural-language summary. |
|
|
109
|
+
| `--git-depth INTEGER` | `20` | Number of recent commits to include with `--git-context`. Range: 1–100. |
|
|
110
|
+
| `--git-days INTEGER` | `90` | Time window in days for hotspot detection with `--git-context`. Range: 1–3650. |
|
|
111
|
+
| `--env-map` | off | Map all environment variables referenced in source code: key name, required/optional status, inferred type (`string`, `int`, `bool`, `url`, `path`, `enum`), functional category (`database`, `auth`, `cache`, `storage`, `service`, `observability`, `feature_flag`, `server`, `general`), default value when present, and source file locations. Supplements with descriptions from `.env.example`, `.env.sample`, and similar reference files. |
|
|
112
|
+
| `--code-notes` | off | Extract inline code annotations — `TODO`, `FIXME`, `HACK`, `NOTE`, `DEPRECATED`, `WARNING`, `XXX`, `BUG`, `OPTIMIZE` — with file path, line number, annotation text, and the nearest enclosing function or class. Also detects Architecture Decision Records (ADRs) in `docs/decisions/`, `docs/adr/`, `adr/`, and similar directories, extracting title, status, and summary. |
|
|
105
113
|
| `--depth INTEGER` | `4` | Maximum file tree depth. Range: 1–20. |
|
|
106
114
|
| `--no-redact` | off | Disable secret redaction (enabled by default). |
|
|
107
115
|
| `--version` | — | Show version and exit. |
|
|
@@ -117,7 +125,7 @@ The full schema (`SourceMap`) includes the following fields:
|
|
|
117
125
|
| `metadata` | object | Schema version, timestamp, `sourcecode` version, and analyzed path. |
|
|
118
126
|
| `file_tree` | object | Repository tree where `null` represents a file and `{}` represents a directory. |
|
|
119
127
|
| `file_paths` | array | Flat list of all project paths derived from `file_tree`, with forward-slash separators. Always present; respects `--depth`. |
|
|
120
|
-
| `project_summary` | string\|null | Deterministic natural-language description of the project
|
|
128
|
+
| `project_summary` | string\|null | Deterministic natural-language description of the project. Includes: manifest/README description when available, detected architecture pattern (`layered`, `mvc`, `hexagonal`, `fullstack`), business domain names inferred from directory structure, entry points (when no domains are detected), and dependency count. Present when stacks are detected. |
|
|
121
129
|
| `architecture_summary` | string\|null | Static summary of the main execution flow, orchestrated modules, and output produced by the project. Present when enough structural evidence is available. |
|
|
122
130
|
| `stacks` | array | Stack detections with confidence, frameworks, manifests, `primary`, `root`, `workspace`, and `signals`. |
|
|
123
131
|
| `project_type` | string\|null | Overall project classification. |
|
|
@@ -145,9 +153,77 @@ The full schema (`SourceMap`) includes the following fields:
|
|
|
145
153
|
| `docs` | array | Extracted `DocRecord` objects for each documented symbol. |
|
|
146
154
|
| `doc_summary` | object | Summary with total count, languages, depth used, truncation status, and limitations. |
|
|
147
155
|
|
|
156
|
+
### With `--env-map`
|
|
157
|
+
|
|
158
|
+
| Field | Type | Description |
|
|
159
|
+
|-------|------|-------------|
|
|
160
|
+
| `env_map` | array | One `EnvVarRecord` per detected environment variable. |
|
|
161
|
+
| `env_summary` | object | Summary: total count, required vs optional counts, categories present, and example files found. Also included in `--compact` output when the flag is active. |
|
|
162
|
+
|
|
163
|
+
Each `EnvVarRecord`:
|
|
164
|
+
|
|
165
|
+
| Field | Description |
|
|
166
|
+
|-------|-------------|
|
|
167
|
+
| `key` | Environment variable name (e.g. `DATABASE_URL`). |
|
|
168
|
+
| `required` | `true` if the code reads the variable without a fallback default (`os.environ["KEY"]`, `process.env.KEY`). `false` if a default was found (`os.getenv("KEY", "default")`). |
|
|
169
|
+
| `default` | Default value detected in code, or `null` if none. |
|
|
170
|
+
| `type_hint` | Inferred type: `string`, `int`, `bool`, `url`, `path`, or `enum`. Derived from the key name (e.g. `_PORT` → `int`, `_URL` → `url`, `ENABLE_*` → `bool`). |
|
|
171
|
+
| `category` | Functional group inferred from the key name: `database`, `cache`, `storage`, `auth`, `service`, `observability`, `feature_flag`, `server`, or `general`. |
|
|
172
|
+
| `description` | Description extracted from a comment above the variable in `.env.example`, or `null`. |
|
|
173
|
+
| `files` | Up to 10 `"path:line"` references where the variable is read in source code. Empty for variables found only in `.env.example`. |
|
|
174
|
+
|
|
175
|
+
Supported languages: Python (`os.getenv`, `os.environ`), JavaScript/TypeScript (`process.env`), Go (`os.Getenv`, `os.LookupEnv`), Ruby (`ENV[]`, `ENV.fetch`), Java (`System.getenv`), PHP (`getenv`, `$_ENV`), Rust (`env::var`).
|
|
176
|
+
|
|
177
|
+
### With `--code-notes`
|
|
178
|
+
|
|
179
|
+
| Field | Type | Description |
|
|
180
|
+
|-------|------|-------------|
|
|
181
|
+
| `code_notes` | array | One `CodeNote` per annotation found in source files. |
|
|
182
|
+
| `code_adrs` | array | One `AdrRecord` per Architecture Decision Record detected. |
|
|
183
|
+
| `code_notes_summary` | object | Summary: total count, counts by kind, top files with most annotations, and ADR count. Also included in `--compact` output when the flag is active. |
|
|
184
|
+
|
|
185
|
+
Each `CodeNote`:
|
|
186
|
+
|
|
187
|
+
| Field | Description |
|
|
188
|
+
|-------|-------------|
|
|
189
|
+
| `kind` | Annotation type: `TODO`, `FIXME`, `HACK`, `NOTE`, `DEPRECATED`, `WARNING`, `XXX`, `BUG`, or `OPTIMIZE`. |
|
|
190
|
+
| `path` | File path relative to project root. |
|
|
191
|
+
| `line` | 1-based line number. |
|
|
192
|
+
| `text` | Annotation text (truncated to 200 characters). |
|
|
193
|
+
| `symbol` | Name of the nearest enclosing function or class found by scanning backward up to 25 lines. `null` at module level. |
|
|
194
|
+
|
|
195
|
+
Each `AdrRecord`:
|
|
196
|
+
|
|
197
|
+
| Field | Description |
|
|
198
|
+
|-------|-------------|
|
|
199
|
+
| `path` | File path relative to project root. |
|
|
200
|
+
| `title` | Title extracted from the first heading (`# ...`) in the file. |
|
|
201
|
+
| `status` | Normalized status: `accepted`, `proposed`, `deprecated`, or `superseded`. `null` if no status line was found. |
|
|
202
|
+
| `summary` | First paragraph of body text after the title. `null` if not parseable. |
|
|
203
|
+
|
|
204
|
+
ADR detection looks for Markdown files in `docs/decisions/`, `docs/adr/`, `adr/`, `decisions/`, and `architecture/decisions/`, and for files with names matching `ADR-*.md`, `0001-*.md`, or `DECISION-*.md` patterns.
|
|
205
|
+
|
|
206
|
+
### With `--git-context`
|
|
207
|
+
|
|
208
|
+
| Field | Type | Description |
|
|
209
|
+
|-------|------|-------------|
|
|
210
|
+
| `git_context` | object | Git context with recent commits, change hotspots, uncommitted changes, contributors, and a natural-language summary. |
|
|
211
|
+
|
|
212
|
+
`git_context` fields:
|
|
213
|
+
|
|
214
|
+
| Field | Description |
|
|
215
|
+
|-------|-------------|
|
|
216
|
+
| `branch` | Current branch name. |
|
|
217
|
+
| `recent_commits` | Up to `--git-depth` commits (default 20). Each includes `hash`, `message`, `author`, `date`, and `files_changed` (capped at 10 per commit). |
|
|
218
|
+
| `change_hotspots` | Up to 20 files sorted by commit frequency within the `--git-days` window (default 90 days). Each includes `file`, `commit_count`, and `last_changed`. |
|
|
219
|
+
| `uncommitted_changes` | Object with `staged`, `unstaged`, and `untracked` file lists from `git status`. |
|
|
220
|
+
| `contributors` | Unique author names active within the `--git-days` window. |
|
|
221
|
+
| `git_summary` | Deterministic natural-language summary: branch, pending changes, top hotspots, and last commit. |
|
|
222
|
+
| `limitations` | List of errors or degraded analysis signals (e.g. `no_git_repo`, `git_not_found`). |
|
|
223
|
+
|
|
148
224
|
## Compact Mode
|
|
149
225
|
|
|
150
|
-
`--compact` returns a reduced JSON view optimized for LLM prompts (~500-700 tokens). It excludes the full `dependencies` list, `docs`, and `module_graph`, while retaining the fields most useful for project orientation.
|
|
226
|
+
`--compact` returns a reduced JSON view optimized for LLM prompts (~500-700 tokens). It excludes the full `dependencies` list, `docs`, and `module_graph`, while retaining the fields most useful for project orientation. When optional flags are also active, their summaries are included: `dependency_summary` (with `--dependencies`), `env_summary` (with `--env-map`), and `code_notes_summary` (with `--code-notes`).
|
|
151
227
|
|
|
152
228
|
Real output from a Python FastAPI project:
|
|
153
229
|
|
|
@@ -399,10 +475,17 @@ sourcecode --docs --docs-depth full . # include methods
|
|
|
399
475
|
|
|
400
476
|
**`project_summary` field**
|
|
401
477
|
|
|
402
|
-
`project_summary` is always generated when stacks are detected. It provides instant project context without requiring the LLM to parse the full structure.
|
|
478
|
+
`project_summary` is always generated when stacks are detected. It provides instant project context without requiring the LLM to parse the full structure. The content adapts to what is detectable:
|
|
479
|
+
|
|
480
|
+
- If `pyproject.toml`, `package.json`, or the README provides a description, it leads the summary; stack, architecture pattern, and domains are appended as context.
|
|
481
|
+
- If the directory structure reveals a known architecture pattern (`layered`, `mvc`, `hexagonal`, `fullstack`), it is included.
|
|
482
|
+
- Business domain names (directories that are not architectural layers or generic utilities) replace entry points when two or more distinct domains are detected.
|
|
483
|
+
|
|
484
|
+
Example values:
|
|
403
485
|
|
|
404
|
-
- `"API en Python (FastAPI).
|
|
405
|
-
- `"
|
|
486
|
+
- `"API en Python (FastAPI) con arquitectura layered. Dominios: auth, users, billing. 12 dependencias (python)."` (structured project)
|
|
487
|
+
- `"API en Python (FastAPI). Entry points: src/main.py. 12 dependencias (python)."` (flat project, no domains detected)
|
|
488
|
+
- `"Aplicacion web en Node.js (Next.js) con arquitectura mvc. Dominios: products, orders. 24 dependencias (nodejs)."`
|
|
406
489
|
- `"Monorepo con 2 workspaces en Node.js, Python."`
|
|
407
490
|
|
|
408
491
|
**`architecture_summary` field**
|
|
@@ -413,6 +496,132 @@ sourcecode --docs --docs-depth full . # include methods
|
|
|
413
496
|
|
|
414
497
|
When `--dependencies` is active, `key_dependencies` contains the top-15 direct dependencies sorted by primary ecosystem first. Use it to understand core library choices without scanning hundreds of transitive records.
|
|
415
498
|
|
|
499
|
+
**`--git-context` — temporal project context**
|
|
500
|
+
|
|
501
|
+
Best for: understanding recent activity before touching code, debugging regressions, onboarding to an active repository.
|
|
502
|
+
|
|
503
|
+
Answers questions a static analysis cannot: what changed recently, which files are actively maintained, whether there is uncommitted work in progress, and who is driving the project.
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
sourcecode --git-context .
|
|
507
|
+
sourcecode --git-context --git-depth 10 --git-days 30 .
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
`git_summary` condenses the key signals into a single line:
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
"Rama main. 3 cambios pendientes (staged: 1, unstaged: 2, untracked: 0). Archivos más activos: src/cli.py (18 commits), src/schema.py (14 commits). Último commit: 2026-04-22 — docs(13): add gap closure plan."
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
Combine with `--compact` for fast handoffs that include both static structure and recent activity:
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
sourcecode --compact --dependencies --git-context .
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Note: `git_context` is excluded from the `--compact` token budget but is always present in full output when the flag is active.
|
|
523
|
+
|
|
524
|
+
**`--env-map` — configuration surface**
|
|
525
|
+
|
|
526
|
+
Best for: onboarding a new agent to an unfamiliar project, understanding what environment a service requires to run, reviewing configuration completeness before deployment.
|
|
527
|
+
|
|
528
|
+
Answers: what variables does this project expect, which ones are required vs optional, where are they read, and what type and category are they?
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
sourcecode --env-map .
|
|
532
|
+
sourcecode --compact --env-map . # configuration surface in ~700 tokens
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Example output (excerpt):
|
|
536
|
+
|
|
537
|
+
```json
|
|
538
|
+
{
|
|
539
|
+
"env_map": [
|
|
540
|
+
{
|
|
541
|
+
"key": "DATABASE_URL",
|
|
542
|
+
"required": true,
|
|
543
|
+
"default": null,
|
|
544
|
+
"type_hint": "url",
|
|
545
|
+
"category": "database",
|
|
546
|
+
"description": "PostgreSQL connection string",
|
|
547
|
+
"files": ["src/db.py:12", "src/config.py:5"]
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"key": "LOG_LEVEL",
|
|
551
|
+
"required": false,
|
|
552
|
+
"default": "INFO",
|
|
553
|
+
"type_hint": "enum",
|
|
554
|
+
"category": "observability",
|
|
555
|
+
"description": null,
|
|
556
|
+
"files": ["src/logger.py:3"]
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"env_summary": {
|
|
560
|
+
"requested": true,
|
|
561
|
+
"total": 14,
|
|
562
|
+
"required_count": 6,
|
|
563
|
+
"optional_count": 8,
|
|
564
|
+
"categories": ["auth", "database", "observability", "server"],
|
|
565
|
+
"example_files_found": [".env.example"]
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
**`--code-notes` — technical debt and intent**
|
|
571
|
+
|
|
572
|
+
Best for: understanding known issues before modifying code, identifying deprecated APIs, discovering design decisions embedded in comments, and locating ADRs when they exist.
|
|
573
|
+
|
|
574
|
+
Answers: what do the authors know is broken or suboptimal, what is explicitly marked for removal, what architectural decisions were recorded, and which areas carry the most annotation debt?
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
sourcecode --code-notes .
|
|
578
|
+
sourcecode --compact --code-notes . # debt overview in compact form
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
Example output (excerpt):
|
|
582
|
+
|
|
583
|
+
```json
|
|
584
|
+
{
|
|
585
|
+
"code_notes": [
|
|
586
|
+
{
|
|
587
|
+
"kind": "FIXME",
|
|
588
|
+
"path": "src/payments.py",
|
|
589
|
+
"line": 42,
|
|
590
|
+
"text": "currency conversion is broken for EUR",
|
|
591
|
+
"symbol": "process_payment"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"kind": "DEPRECATED",
|
|
595
|
+
"path": "src/auth.py",
|
|
596
|
+
"line": 18,
|
|
597
|
+
"text": "use AuthService instead",
|
|
598
|
+
"symbol": "UserService"
|
|
599
|
+
}
|
|
600
|
+
],
|
|
601
|
+
"code_adrs": [
|
|
602
|
+
{
|
|
603
|
+
"path": "docs/decisions/0001-use-postgresql.md",
|
|
604
|
+
"title": "ADR-0001: Use PostgreSQL as primary database",
|
|
605
|
+
"status": "accepted",
|
|
606
|
+
"summary": "PostgreSQL was chosen for its JSONB support and strong ACID guarantees."
|
|
607
|
+
}
|
|
608
|
+
],
|
|
609
|
+
"code_notes_summary": {
|
|
610
|
+
"requested": true,
|
|
611
|
+
"total": 23,
|
|
612
|
+
"by_kind": {"TODO": 10, "FIXME": 7, "HACK": 3, "DEPRECATED": 2, "WARNING": 1},
|
|
613
|
+
"top_files": ["src/payments.py", "src/legacy.py"],
|
|
614
|
+
"adr_count": 3
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
Combine flags for a comprehensive project handoff:
|
|
620
|
+
|
|
621
|
+
```bash
|
|
622
|
+
sourcecode --compact --env-map --code-notes --git-context .
|
|
623
|
+
```
|
|
624
|
+
|
|
416
625
|
## Development
|
|
417
626
|
|
|
418
627
|
Editable install with development dependencies:
|