sourcecode 1.0.0__tar.gz → 1.1.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-1.1.0/.github/workflows/build-windows.yml +40 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/PKG-INFO +99 -307
- sourcecode-1.1.0/README.md +142 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/pyproject.toml +1 -1
- sourcecode-1.1.0/run_cli.py +4 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/__init__.py +1 -1
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/architecture_analyzer.py +81 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/architecture_summary.py +12 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/java.py +31 -5
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/env_analyzer.py +81 -1
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/file_classifier.py +47 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/prepare_context.py +46 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/schema.py +5 -1
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/serializer.py +22 -2
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/pom.xml +33 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/ausente/application/service/FindAusenteService.java +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/ausente/domain/entities/Ausente.java +5 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/ausente/infrastructure/rest/AusenteRestController.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/autocoberturas/application/service/FindAutocoberturasService.java +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/autocoberturas/domain/entities/Autocoberturas.java +5 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/autocoberturas/infrastructure/rest/AutocoberturasRestController.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/calendarioTrabajador/application/service/FindCalendarioTrabajadorService.java +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/calendarioTrabajador/domain/entities/CalendarioTrabajador.java +5 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/calendarioTrabajador/infrastructure/rest/CalendarioTrabajadorRestController.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/departamento/application/service/FindDepartamentoService.java +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/departamento/domain/entities/Departamento.java +5 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/departamento/infrastructure/rest/DepartamentoRestController.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/empleado/application/service/FindEmpleadoService.java +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/empleado/domain/entities/Empleado.java +5 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/ddd/empleado/infrastructure/rest/EmpleadoRestController.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/DemoApplication.java +11 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/domain/Health.java +11 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/mapper/HealthMapper.java +10 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/repository/HealthRepository.java +8 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/service/HealthService.java +12 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/java/com/example/demo/web/HealthRestController.java +15 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/resources/application-dev.yml +4 -0
- sourcecode-1.1.0/tests/fixtures/spring_boot_minimal/src/main/resources/application.yml +20 -0
- sourcecode-1.1.0/tests/test_java_spring_integration.py +318 -0
- sourcecode-1.0.0/README.md +0 -350
- {sourcecode-1.0.0 → sourcecode-1.1.0}/.agents/skills/source-command-gsd-join-discord/SKILL.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/.agents/skills/source-command-gsd-review-backlog/SKILL.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/.agents/skills/source-command-gsd-workstreams/SKILL.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/.gitignore +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/.ruff.toml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/CONTRIBUTING.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/LICENSE +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/SECURITY.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/docs/privacy.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/docs/schema.md +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/raw +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/adaptive_scanner.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/ast_extractor.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/classifier.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/cli.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/code_notes_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/confidence_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/context_scorer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/context_summarizer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/contract_model.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/contract_pipeline.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/coverage_parser.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/dependency_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/__init__.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/base.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/csproj_parser.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/dart.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/dotnet.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/elixir.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/go.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/heuristic.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/hybrid.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/jvm_ext.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/nodejs.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/parsers.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/php.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/project.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/python.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/ruby.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/rust.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/systems.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/terraform.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/detectors/tooling.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/doc_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/entrypoint_classifier.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/git_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/graph_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/metrics_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/ranking_engine.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/redactor.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/relevance_scorer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/repo_classifier.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/runtime_classifier.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/scanner.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/semantic_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/summarizer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/__init__.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/config.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/consent.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/events.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/filters.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/telemetry/transport.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/tree_utils.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/src/sourcecode/workspace.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/__init__.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/conftest.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/coverage.xml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/fastapi_app/pyproject.toml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/fastapi_app/src/main.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/go_service/cmd/api/main.go +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/go_service/go.mod +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/jacoco.xml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/lcov.info +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/nextjs_app/app/page.tsx +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/nextjs_app/package.json +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/nextjs_app/pnpm-lock.yaml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/pnpm_monorepo/apps/web/app/page.tsx +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/pnpm_monorepo/apps/web/package.json +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/pnpm_monorepo/packages/api/main.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/pnpm_monorepo/packages/api/pyproject.toml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/fixtures/pnpm_monorepo/pnpm-workspace.yaml +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_architecture_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_architecture_summary.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_ast_extractor.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_block1_reliability.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_block2_coverage.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_block5_quality.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_classifier.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_cli.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_code_notes_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_context_scorer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_contract_pipeline.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_coverage_parser.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_cross_consistency.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_dependency_analyzer_node_python.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_dependency_analyzer_polyglot.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_dependency_schema.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_dotnet.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_go_rust_java.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_nodejs.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_php_ruby_dart.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_python.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_universal_managed.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detector_universal_systems.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_detectors_base.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_doc_analyzer_jsdom.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_doc_analyzer_python.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_graph_analyzer_polyglot.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_graph_analyzer_python_node.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_graph_schema.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_hybrid_inference.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_dependencies.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_detection.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_docs.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_graph_modules.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_lqn.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_metrics.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_multistack.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_semantics.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_integration_universal.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_metrics_analyzer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_packaging.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_phase1_improvements.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_pipeline_integrity.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_real_projects.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_redactor.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_scanner.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_schema.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_schema_normalization.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_semantic_analyzer_node.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_semantic_analyzer_python.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_semantic_import_resolution.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_semantic_schema.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_signal_hierarchy.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_summarizer.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_telemetry.py +0 -0
- {sourcecode-1.0.0 → sourcecode-1.1.0}/tests/test_workspace_analyzer.py +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Build Windows EXE
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
build-windows:
|
|
8
|
+
runs-on: windows-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout repository
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Setup Python
|
|
15
|
+
uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.11"
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install --upgrade pip
|
|
22
|
+
pip install nuitka
|
|
23
|
+
pip install .
|
|
24
|
+
|
|
25
|
+
- name: Build EXE
|
|
26
|
+
run: |
|
|
27
|
+
python -m nuitka ^
|
|
28
|
+
--onefile ^
|
|
29
|
+
--standalone ^
|
|
30
|
+
--follow-imports ^
|
|
31
|
+
--assume-yes-for-downloads ^
|
|
32
|
+
--output-dir=build ^
|
|
33
|
+
run_cli.py
|
|
34
|
+
shell: cmd
|
|
35
|
+
|
|
36
|
+
- name: Upload artifact
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: sourcecode-windows
|
|
40
|
+
path: build/**/*.exe
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sourcecode
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Deterministic codebase context for AI coding agents
|
|
5
5
|
License: Apache License
|
|
6
6
|
Version 2.0, January 2004
|
|
@@ -221,349 +221,141 @@ Description-Content-Type: text/markdown
|
|
|
221
221
|
|
|
222
222
|
**Deterministic codebase context for AI coding agents.**
|
|
223
223
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
[](https://github.com/sourcecode-ai/sourcecode/actions)
|
|
228
|
-
|
|
229
|
-
Turn any repository into structured, reproducible context optimized for AI coding agents — in one command.
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
pip install sourcecode
|
|
233
|
-
sourcecode . --agent
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
```json
|
|
237
|
-
{
|
|
238
|
-
"project": {
|
|
239
|
-
"type": "api",
|
|
240
|
-
"summary": "Python REST API built with FastAPI and SQLAlchemy. Layered architecture with domain, service, and infrastructure layers.",
|
|
241
|
-
"primary_stack": "python",
|
|
242
|
-
"frameworks": ["FastAPI", "SQLAlchemy"]
|
|
243
|
-
},
|
|
244
|
-
"entry_points": [
|
|
245
|
-
{ "path": "src/app/main.py", "kind": "server", "confidence": "high" }
|
|
246
|
-
],
|
|
247
|
-
"architecture": "FastAPI application. Clean Architecture with domain, application, and infrastructure layers. Hub modules: schema.py, models.py.",
|
|
248
|
-
"key_dependencies": [
|
|
249
|
-
{ "name": "fastapi", "declared_version": ">=0.100", "role": "runtime" },
|
|
250
|
-
{ "name": "sqlalchemy", "declared_version": "^2.0", "role": "runtime" },
|
|
251
|
-
{ "name": "pydantic", "declared_version": "^2.0", "role": "runtime" }
|
|
252
|
-
],
|
|
253
|
-
"confidence_summary": { "overall": "high" }
|
|
254
|
-
}
|
|
255
|
-
```
|
|
224
|
+

|
|
225
|
+

|
|
226
|
+

|
|
256
227
|
|
|
257
228
|
---
|
|
258
229
|
|
|
259
|
-
##
|
|
230
|
+
## What is it?
|
|
260
231
|
|
|
261
|
-
AI
|
|
262
|
-
|
|
263
|
-
- **Agents start blind.** Without repo structure, they hallucinate imports, file paths, and architecture decisions.
|
|
264
|
-
- **Context is noisy.** Raw file trees contain benchmark dirs, generated files, tooling configs, and docs that consume tokens without helping.
|
|
265
|
-
- **Architecture is invisible.** LLMs see files, not systems. They miss layers, plugin systems, entry points, and runtime topology.
|
|
266
|
-
- **Context decays.** What you paste today is stale tomorrow. There's no reproducible baseline.
|
|
267
|
-
- **Manual context doesn't scale.** Handcrafting prompts per project is engineering debt that grows with every new agent, team, and task.
|
|
232
|
+
`sourcecode` analyzes a repository and produces a structured context map (JSON or YAML) designed to be consumed by AI agents or language models. It solves the "stuff the whole repo into the prompt" problem by instead producing a deterministic extract: entry points, dependencies, stacks, inline annotations, environment variables, and git activity. It is an MVP tool under active evolution — the semantic analysis and module graph features work but have known limitations that are explicitly documented below.
|
|
268
233
|
|
|
269
234
|
---
|
|
270
235
|
|
|
271
|
-
##
|
|
272
|
-
|
|
273
|
-
`sourcecode` analyzes your repository and produces a structured, reproducible context package — ready to inject into any AI coding agent.
|
|
274
|
-
|
|
275
|
-
**What it does:**
|
|
276
|
-
- Detects stacks, frameworks, entry points, and project type across 10+ languages
|
|
277
|
-
- Infers runtime topology: which packages are core, which are plugins, which are noise
|
|
278
|
-
- Ranks files by operational relevance for agents: git churn + runtime proximity + bootstrap signal
|
|
279
|
-
- Suppresses non-runtime noise: benchmarks, docs, tooling, generated files
|
|
280
|
-
- Produces structured JSON/YAML that agents can reason over, not raw file trees
|
|
281
|
-
- Runs deterministically — same repo, same output, every time
|
|
282
|
-
|
|
283
|
-
**What it outputs:**
|
|
284
|
-
- `project_summary` — one-sentence natural language description
|
|
285
|
-
- `architecture_summary` — runtime topology: layers, plugin systems, entry flows
|
|
286
|
-
- `entry_points` — where execution actually starts (production, not benchmarks)
|
|
287
|
-
- `key_dependencies` — runtime dependencies with role classification
|
|
288
|
-
- `relevant_files` — ranked by usefulness for coding tasks, not folder position
|
|
289
|
-
- `confidence_summary` — detection quality and analysis gaps
|
|
290
|
-
|
|
291
|
-
All fields are stable, machine-readable, and designed for LLM consumption.
|
|
292
|
-
|
|
293
|
-
---
|
|
236
|
+
## Installation
|
|
294
237
|
|
|
295
|
-
|
|
238
|
+
**Prerequisites:** Python 3.10+
|
|
296
239
|
|
|
297
240
|
```bash
|
|
298
241
|
pip install sourcecode
|
|
242
|
+
# or with pipx for isolation:
|
|
243
|
+
pipx install sourcecode
|
|
299
244
|
```
|
|
300
245
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Quickstart
|
|
306
|
-
|
|
307
|
-
**Basic analysis:**
|
|
308
|
-
```bash
|
|
309
|
-
sourcecode .
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
**Agent-optimized output** (structured, noise-free, gap-aware):
|
|
313
|
-
```bash
|
|
314
|
-
sourcecode . --agent
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
**Task-specific context for coding agents:**
|
|
318
|
-
```bash
|
|
319
|
-
# Explain the project architecture
|
|
320
|
-
sourcecode . prepare-context explain
|
|
321
|
-
|
|
322
|
-
# Find likely bug locations
|
|
323
|
-
sourcecode . prepare-context fix-bug
|
|
324
|
-
|
|
325
|
-
# Onboard a new agent to the codebase
|
|
326
|
-
sourcecode . prepare-context onboard
|
|
327
|
-
|
|
328
|
-
# Ranked context for a specific task
|
|
329
|
-
sourcecode . prepare-context refactor
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
**Pipe directly into Claude Code or any agent:**
|
|
333
|
-
```bash
|
|
334
|
-
sourcecode . --agent | claude -p "Review the architecture and suggest improvements"
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
**Write to file for session injection:**
|
|
338
|
-
```bash
|
|
339
|
-
sourcecode . --agent --output context.json
|
|
340
|
-
```
|
|
246
|
+
Verify installation:
|
|
341
247
|
|
|
342
|
-
**Include git activity signals:**
|
|
343
248
|
```bash
|
|
344
|
-
sourcecode
|
|
249
|
+
sourcecode version
|
|
250
|
+
# sourcecode 1.0.0
|
|
345
251
|
```
|
|
346
252
|
|
|
347
253
|
---
|
|
348
254
|
|
|
349
|
-
##
|
|
350
|
-
|
|
351
|
-
### Claude Code
|
|
352
|
-
```bash
|
|
353
|
-
# Start every session with full context
|
|
354
|
-
sourcecode . --agent > .claude/context.json
|
|
355
|
-
|
|
356
|
-
# Use with CLAUDE.md for persistent context
|
|
357
|
-
echo "$(sourcecode . --agent --compact)" >> CLAUDE.md
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### Cursor / Windsurf / Copilot
|
|
361
|
-
```bash
|
|
362
|
-
# Generate context snapshot before starting a feature
|
|
363
|
-
sourcecode . --agent --git-context --output .cursor/context.json
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### OpenAI / Anthropic API
|
|
367
|
-
```python
|
|
368
|
-
import json, subprocess
|
|
369
|
-
|
|
370
|
-
context = json.loads(
|
|
371
|
-
subprocess.check_output(["sourcecode", ".", "--agent"])
|
|
372
|
-
)
|
|
373
|
-
|
|
374
|
-
system_prompt = f"""
|
|
375
|
-
You are working on: {context['project']['summary']}
|
|
376
|
-
Architecture: {context['architecture']}
|
|
377
|
-
Entry points: {[ep['path'] for ep in context['entry_points']]}
|
|
378
|
-
"""
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### CI / CD pipelines
|
|
382
|
-
```yaml
|
|
383
|
-
# .github/workflows/context.yml
|
|
384
|
-
- name: Generate codebase context
|
|
385
|
-
run: sourcecode . --agent --output context.json
|
|
386
|
-
|
|
387
|
-
- name: AI-assisted code review
|
|
388
|
-
run: |
|
|
389
|
-
CONTEXT=$(cat context.json)
|
|
390
|
-
# Inject into your preferred AI review step
|
|
391
|
-
```
|
|
255
|
+
## Quickstart
|
|
392
256
|
|
|
393
|
-
|
|
394
|
-
```bash
|
|
395
|
-
# Generate human-readable architecture summary
|
|
396
|
-
sourcecode . prepare-context onboard --llm-prompt
|
|
397
|
-
```
|
|
257
|
+
The most useful command for integrating `sourcecode` into an AI agent:
|
|
398
258
|
|
|
399
|
-
### Architecture audits
|
|
400
259
|
```bash
|
|
401
|
-
sourcecode
|
|
260
|
+
sourcecode --agent
|
|
402
261
|
```
|
|
403
262
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
## How it works
|
|
407
|
-
|
|
408
|
-
`sourcecode` runs a local, static analysis pipeline on your repository:
|
|
263
|
+
It produces a structured JSON with the essential sections (no noise, no file tree), ready to paste into an LLM context:
|
|
409
264
|
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"project": {
|
|
268
|
+
"type": "fullstack",
|
|
269
|
+
"summary": "Full-stack project in Nodejs, mvc, 4075 source files. Domains: atlas-client, atlas-server, atlas-hub, atlas-reports. 3300 dependencies (java, nodejs).",
|
|
270
|
+
"primary_stack": "nodejs",
|
|
271
|
+
"secondary_stacks": ["java"]
|
|
272
|
+
},
|
|
273
|
+
"entry_points": [
|
|
274
|
+
{
|
|
275
|
+
"path": "atlas-server/src/main/java/com/example/atlas/AtlasServerApplication.java",
|
|
276
|
+
"stack": "java",
|
|
277
|
+
"kind": "application",
|
|
278
|
+
"confidence": "high"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"path": "atlas-client/src/main.ts",
|
|
282
|
+
"stack": "nodejs",
|
|
283
|
+
"kind": "entrypoint",
|
|
284
|
+
"confidence": "high"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"runtime_packages": [ ... ],
|
|
288
|
+
"dependencies": { ... },
|
|
289
|
+
"env_map": { ... },
|
|
290
|
+
"code_notes": [ ... ]
|
|
291
|
+
}
|
|
410
292
|
```
|
|
411
|
-
Repository
|
|
412
|
-
│
|
|
413
|
-
├── Scanner # File tree, manifests, workspace detection
|
|
414
|
-
├── Stack Detectors # Language, framework, package manager detection
|
|
415
|
-
├── Entry Points # Production entry points (not benchmarks/docs)
|
|
416
|
-
├── Git Analyzer # Churn hotspots, uncommitted changes
|
|
417
|
-
├── Relevance Scorer # Runtime proximity × git churn × bootstrap signal
|
|
418
|
-
└── Serializer # Structured JSON/YAML output
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
No LLM calls. No network requests. No sampling. Fully deterministic.
|
|
422
|
-
|
|
423
|
-
The same repository produces the same output on every run — which means agents can cache it, diff it, and rely on it.
|
|
424
|
-
|
|
425
|
-
---
|
|
426
|
-
|
|
427
|
-
## Output modes
|
|
428
|
-
|
|
429
|
-
| Mode | Use case | Size |
|
|
430
|
-
|------|----------|------|
|
|
431
|
-
| `sourcecode .` | Full analysis | Full |
|
|
432
|
-
| `sourcecode . --agent` | AI agent injection | ~600–1000 tokens |
|
|
433
|
-
| `sourcecode . --compact` | Prompts, handoffs | ~500–700 tokens |
|
|
434
|
-
| `sourcecode . prepare-context <task>` | Task-specific context | ~800–1200 tokens |
|
|
435
|
-
|
|
436
|
-
### Available flags
|
|
437
|
-
|
|
438
|
-
| Flag | Description |
|
|
439
|
-
|------|-------------|
|
|
440
|
-
| `--agent` | Structured, noise-free output for AI agents. Auto-enables `--dependencies`, `--env-map`, `--code-notes`. |
|
|
441
|
-
| `--dependencies` | Direct dependencies with versions and role classification. |
|
|
442
|
-
| `--git-context` | Recent commits, change hotspots, uncommitted files. |
|
|
443
|
-
| `--architecture` | Layer inference: MVC, layered, hexagonal, domain-based. |
|
|
444
|
-
| `--graph-modules` | Module import graph and call relationships. |
|
|
445
|
-
| `--semantics` | Cross-file symbol resolution and call graph. |
|
|
446
|
-
| `--env-map` | All environment variables referenced in source. |
|
|
447
|
-
| `--code-notes` | TODOs, FIXMEs, HACKs, and Architecture Decision Records. |
|
|
448
|
-
| `--compact` | Minimal output for token-constrained prompts. |
|
|
449
|
-
| `--format yaml` | YAML instead of JSON. |
|
|
450
|
-
| `--output PATH` | Write to file instead of stdout. |
|
|
451
|
-
|
|
452
|
-
Full reference: `sourcecode --help`
|
|
453
|
-
|
|
454
|
-
### Prepare-context tasks
|
|
455
|
-
|
|
456
|
-
| Task | What it produces |
|
|
457
|
-
|------|-----------------|
|
|
458
|
-
| `explain` | Architecture + entry points + key dependencies |
|
|
459
|
-
| `fix-bug` | Risk-ranked files + suspected areas + code annotations |
|
|
460
|
-
| `refactor` | Structural issues + improvement opportunities |
|
|
461
|
-
| `generate-tests` | Untested source files + test gap analysis |
|
|
462
|
-
| `onboard` | Full project understanding for new agents/developers |
|
|
463
|
-
| `review-pr` | Changed files + architectural impact |
|
|
464
|
-
| `delta` | Git-changed files only — incremental context |
|
|
465
|
-
|
|
466
|
-
---
|
|
467
|
-
|
|
468
|
-
## Philosophy
|
|
469
|
-
|
|
470
|
-
**Determinism over approximation.** Every run on the same repository produces the same output. Agents, pipelines, and teams can depend on that.
|
|
471
293
|
|
|
472
|
-
|
|
294
|
+
For large repositories where context matters, use `--compact` to reduce to ~600-800 tokens:
|
|
473
295
|
|
|
474
|
-
**Noise suppression by default.** Benchmark dirs, generated files, tooling configs, and docs are suppressed unless explicitly requested. Agents get signal, not inventory.
|
|
475
|
-
|
|
476
|
-
**Local-first, privacy-respecting.** No code leaves your machine. No API keys required. Analysis is fully offline.
|
|
477
|
-
|
|
478
|
-
**Composable, not monolithic.** Output is structured data. Pipe it, transform it, inject it, cache it. It's infrastructure, not a magic black box.
|
|
479
|
-
|
|
480
|
-
**Confidence-aware.** Every analysis includes a confidence summary and gap list. Agents know what they don't know.
|
|
481
|
-
|
|
482
|
-
---
|
|
483
|
-
|
|
484
|
-
## Supported languages and stacks
|
|
485
|
-
|
|
486
|
-
| Language | Package detection | Entry points | Frameworks |
|
|
487
|
-
|----------|-------------------|--------------|------------|
|
|
488
|
-
| Python | `pyproject.toml`, `requirements.txt`, `setup.py` | CLI, scripts, `__main__` | FastAPI, Django, Flask, Typer, Click |
|
|
489
|
-
| Node.js | `package.json`, lock files | `main`, `bin`, scripts | Express, Next.js, Fastify, NestJS, React, Vue |
|
|
490
|
-
| Go | `go.mod` | `main.go`, `cmd/` | Standard library, Gin, Echo |
|
|
491
|
-
| Rust | `Cargo.toml` | `main.rs`, `lib.rs` | Tokio, Actix, Axum |
|
|
492
|
-
| Java | `pom.xml`, `build.gradle` | Spring Boot, Quarkus, Micronaut | Spring, Quarkus |
|
|
493
|
-
| Kotlin | `build.gradle.kts` | Spring Boot, Ktor | Spring, Ktor |
|
|
494
|
-
| .NET / C# | `.csproj`, `.sln` | `Program.cs` | ASP.NET, Blazor |
|
|
495
|
-
| PHP | `composer.json` | `index.php` | Laravel, Symfony |
|
|
496
|
-
| Ruby | `Gemfile` | `config.ru` | Rails, Sinatra |
|
|
497
|
-
| Dart | `pubspec.yaml` | `main.dart` | Flutter |
|
|
498
|
-
|
|
499
|
-
Monorepos with mixed stacks are fully supported.
|
|
500
|
-
|
|
501
|
-
---
|
|
502
|
-
|
|
503
|
-
## Roadmap
|
|
504
|
-
|
|
505
|
-
**Now — Core stability**
|
|
506
|
-
- Ranking improvements (git churn, runtime proximity)
|
|
507
|
-
- Better architecture inference
|
|
508
|
-
- Broader language coverage
|
|
509
|
-
|
|
510
|
-
**Next — Agent integrations**
|
|
511
|
-
- MCP server for native Claude Code integration
|
|
512
|
-
- VS Code extension
|
|
513
|
-
- Context diffing (compare before/after changes)
|
|
514
|
-
- Incremental updates (delta mode improvements)
|
|
515
|
-
|
|
516
|
-
**Later — Team features**
|
|
517
|
-
- Shared context snapshots
|
|
518
|
-
- Architecture drift detection
|
|
519
|
-
- CI integration templates
|
|
520
|
-
- Governance and compliance context
|
|
521
|
-
|
|
522
|
-
> Focus is on adoption and utility. No monetization until the core is genuinely useful to the community.
|
|
523
|
-
|
|
524
|
-
---
|
|
525
|
-
|
|
526
|
-
## Contributing
|
|
527
|
-
|
|
528
|
-
We welcome contributions. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, testing, and guidelines.
|
|
529
|
-
|
|
530
|
-
**Quick start for contributors:**
|
|
531
296
|
```bash
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
pip install -e ".[dev]"
|
|
535
|
-
pytest tests/
|
|
297
|
+
sourcecode --compact --copy
|
|
298
|
+
# Copies the summary to the clipboard. Ready to paste.
|
|
536
299
|
```
|
|
537
300
|
|
|
538
301
|
---
|
|
539
302
|
|
|
540
|
-
##
|
|
541
|
-
|
|
542
|
-
|
|
303
|
+
## Flags reference
|
|
304
|
+
|
|
305
|
+
### Global options
|
|
306
|
+
|
|
307
|
+
| Flag | Alias | Type | Default | Description | Status |
|
|
308
|
+
|------|-------|------|---------|-------------|--------|
|
|
309
|
+
| `--format` | `-f` | `json\|yaml` | `json` | Output format. YAML is more readable, JSON preferred in pipelines. | ✅ CORE |
|
|
310
|
+
| `--output` | `-o` | `PATH` | stdout | Writes output to a file instead of stdout. | ✅ CORE |
|
|
311
|
+
| `--compact` | | flag | off | ~600-800 token output: stacks, entry points, deps, gaps. No file tree. | ✅ CORE |
|
|
312
|
+
| `--agent` | | flag | off | JSON optimized for agents. Automatically enables `--dependencies`, `--env-map`, `--code-notes`. | ✅ CORE |
|
|
313
|
+
| `--dependencies` | | flag | off | Analyzes direct and transitive deps from manifests and lockfiles. | ✅ CORE |
|
|
314
|
+
| `--git-context` | `-g` | flag | off | Includes recent commits, change hotspots, uncommitted changes, contributors. | ✅ CORE |
|
|
315
|
+
| `--git-depth` | | `INT [1–100]` | `20` | Number of recent commits with `--git-context`. | ✅ CORE |
|
|
316
|
+
| `--git-days` | | `INT [1–3650]` | `90` | Window in days to detect hotspots with `--git-context`. | ✅ CORE |
|
|
317
|
+
| `--env-map` | | flag | off | Maps environment variables: key, type, category, files that reference them. | ✅ CORE |
|
|
318
|
+
| `--code-notes` | | flag | off | Extracts inline annotations: TODO, FIXME, HACK, BUG, DEPRECATED, NOTE, etc. | ✅ CORE |
|
|
319
|
+
| `--copy` | `-c` | flag | off | Copies output to the clipboard after successful execution. | ✅ CORE |
|
|
320
|
+
| `--depth` | | `INT [1–20]` | `4` | Maximum file tree traversal depth. Java/Maven requires ≥8. | ✅ CORE |
|
|
321
|
+
| `--mode` | | `contract\|standard\|raw` | `contract` | `contract`: minimal contracts per file. `standard`: full detail. `raw`: project level only. | ✅ CORE |
|
|
322
|
+
| `--tree` | | flag | off | Includes full `file_tree` and `file_paths` in the output. Increases size significantly. | ✅ CORE |
|
|
323
|
+
| `--changed-only` | | flag | off | Contract mode: only files modified in git (staged, unstaged, untracked). | ✅ CORE |
|
|
324
|
+
| `--rank-by` | | `relevance\|centrality\|git-churn` | `relevance` | File ranking strategy in contract mode. | ✅ CORE |
|
|
325
|
+
| `--semantics` | | flag | off | Cross-file symbol resolution, call graph with confidence levels, fan-in/fan-out hotspots. Slower. | 🧪 EXP |
|
|
326
|
+
| `--architecture` | | flag | off | Architectural layer inference (MVC/hexagonal/bounded contexts). Low confidence without `--semantics`. | 🧪 EXP |
|
|
327
|
+
| `--graph-modules` | | flag | off | Structural module graph: nodes (files/symbols) and edges (imports, calls, contains). | 🧪 EXP |
|
|
328
|
+
| `--graph-detail` | | `high\|medium\|full` | `high` | Module graph detail level. | 🧪 EXP |
|
|
329
|
+
| `--max-nodes` | | `INT [≥1]` | — | Maximum nodes in `--graph-modules`. Prevents huge graphs in large repos. | 🧪 EXP |
|
|
330
|
+
| `--graph-edges` | | `TEXT` | all | Edge types for `--graph-modules`, comma-separated: `imports,calls,contains`. | 🧪 EXP |
|
|
331
|
+
| `--docs` | | flag | off | Extracts docstrings, function signatures, and module comments. | 🧪 EXP |
|
|
332
|
+
| `--docs-depth` | | `module\|symbols\|full` | `symbols` | Docs extraction depth. `full` includes private symbols. | 🧪 EXP |
|
|
333
|
+
| `--symbol` | | `TEXT` | — | Contract mode: localized context for a specific symbol. Python, TS, JS only. **Does not support Java.** | 🧪 EXP |
|
|
334
|
+
| `--max-importers` | | `INT [1–10000]` | `50` | Limit on importer files returned by `--symbol`. | 🧪 EXP |
|
|
335
|
+
| `--full-metrics` | | flag | off | Per-file technical metrics: LOC, cyclomatic complexity, coverage. Aimed at CI, not at agents. | 🧪 EXP |
|
|
336
|
+
| `--emit-graph` | | flag | off | Contract mode: includes a compact dependency graph (nodes + edges) in the output. | 🚧 WIP |
|
|
337
|
+
| `--entrypoints-only` | | flag | off | Contract mode: only files with exports or entry points. Note: includes *all* files with exports. | 🚧 WIP |
|
|
338
|
+
| `--max-symbols` | | `INT [≥1]` | — | Limits total exported symbols in contract mode. Discards lower-ranked files. | 🚧 WIP |
|
|
339
|
+
| `--no-redact` | | flag | off | Disables automatic secret redaction. Output may contain sensitive values. | 🚧 WIP |
|
|
340
|
+
| `--trace-pipeline` | | flag | off | Diagnostic mode: includes a trace of each candidate and filtering decision. Debugging only. | 🚧 WIP |
|
|
341
|
+
| `--version` | `-v` | flag | — | Shows version and exits. | ✅ CORE |
|
|
543
342
|
|
|
544
343
|
---
|
|
545
344
|
|
|
546
|
-
##
|
|
345
|
+
## Subcommands
|
|
547
346
|
|
|
548
|
-
|
|
347
|
+
### `prepare-context TASK [PATH]`
|
|
549
348
|
|
|
550
|
-
|
|
551
|
-
sourcecode telemetry status # check current setting
|
|
552
|
-
sourcecode telemetry enable # opt in
|
|
553
|
-
sourcecode telemetry disable # opt out
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
---
|
|
349
|
+
Generates task-specific context for AI agents.
|
|
557
350
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
351
|
+
| Task | Description | Status |
|
|
352
|
+
|------|-------------|--------|
|
|
353
|
+
| `explain` | Architecture, entry points, key dependencies | ✅ CORE |
|
|
354
|
+
| `fix-bug` | Files prioritized by risk, inline annotations | ✅ CORE |
|
|
355
|
+
| `onboard` | Full context for new agents or developers | ✅ CORE |
|
|
356
|
+
| `delta` | Incremental context: only files changed in git | ✅ CORE |
|
|
357
|
+
| `refactor` | Structural problems, improvement opportunities | 🧪 EXP |
|
|
358
|
+
| `generate-tests` | Files without tests, coverage gap analysis | 🧪 EXP |
|
|
359
|
+
| `review-pr` | Changed files + architectural impact | 🧪 EXP |
|
|
563
360
|
|
|
564
|
-
|
|
565
|
-
Built for the age of AI coding agents.<br>
|
|
566
|
-
<a href="https://github.com/sourcecode-ai/sourcecode">GitHub</a> ·
|
|
567
|
-
<a href="https://pypi.org/project/sourcecode/">PyPI</a> ·
|
|
568
|
-
<a href="docs/getting-started.md">Documentation</a>
|
|
569
|
-
</p>
|
|
361
|
+
...
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# sourcecode
|
|
2
|
+
|
|
3
|
+
**Deterministic codebase context for AI coding agents.**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What is it?
|
|
12
|
+
|
|
13
|
+
`sourcecode` analyzes a repository and produces a structured context map (JSON or YAML) designed to be consumed by AI agents or language models. It solves the "stuff the whole repo into the prompt" problem by instead producing a deterministic extract: entry points, dependencies, stacks, inline annotations, environment variables, and git activity. It is an MVP tool under active evolution — the semantic analysis and module graph features work but have known limitations that are explicitly documented below.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
**Prerequisites:** Python 3.10+
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install sourcecode
|
|
23
|
+
# or with pipx for isolation:
|
|
24
|
+
pipx install sourcecode
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Verify installation:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sourcecode version
|
|
31
|
+
# sourcecode 1.0.0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
The most useful command for integrating `sourcecode` into an AI agent:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sourcecode --agent
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
It produces a structured JSON with the essential sections (no noise, no file tree), ready to paste into an LLM context:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"project": {
|
|
49
|
+
"type": "fullstack",
|
|
50
|
+
"summary": "Full-stack project in Nodejs, mvc, 4075 source files. Domains: atlas-client, atlas-server, atlas-hub, atlas-reports. 3300 dependencies (java, nodejs).",
|
|
51
|
+
"primary_stack": "nodejs",
|
|
52
|
+
"secondary_stacks": ["java"]
|
|
53
|
+
},
|
|
54
|
+
"entry_points": [
|
|
55
|
+
{
|
|
56
|
+
"path": "atlas-server/src/main/java/com/example/atlas/AtlasServerApplication.java",
|
|
57
|
+
"stack": "java",
|
|
58
|
+
"kind": "application",
|
|
59
|
+
"confidence": "high"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"path": "atlas-client/src/main.ts",
|
|
63
|
+
"stack": "nodejs",
|
|
64
|
+
"kind": "entrypoint",
|
|
65
|
+
"confidence": "high"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"runtime_packages": [ ... ],
|
|
69
|
+
"dependencies": { ... },
|
|
70
|
+
"env_map": { ... },
|
|
71
|
+
"code_notes": [ ... ]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For large repositories where context matters, use `--compact` to reduce to ~600-800 tokens:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
sourcecode --compact --copy
|
|
79
|
+
# Copies the summary to the clipboard. Ready to paste.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Flags reference
|
|
85
|
+
|
|
86
|
+
### Global options
|
|
87
|
+
|
|
88
|
+
| Flag | Alias | Type | Default | Description | Status |
|
|
89
|
+
|------|-------|------|---------|-------------|--------|
|
|
90
|
+
| `--format` | `-f` | `json\|yaml` | `json` | Output format. YAML is more readable, JSON preferred in pipelines. | ✅ CORE |
|
|
91
|
+
| `--output` | `-o` | `PATH` | stdout | Writes output to a file instead of stdout. | ✅ CORE |
|
|
92
|
+
| `--compact` | | flag | off | ~600-800 token output: stacks, entry points, deps, gaps. No file tree. | ✅ CORE |
|
|
93
|
+
| `--agent` | | flag | off | JSON optimized for agents. Automatically enables `--dependencies`, `--env-map`, `--code-notes`. | ✅ CORE |
|
|
94
|
+
| `--dependencies` | | flag | off | Analyzes direct and transitive deps from manifests and lockfiles. | ✅ CORE |
|
|
95
|
+
| `--git-context` | `-g` | flag | off | Includes recent commits, change hotspots, uncommitted changes, contributors. | ✅ CORE |
|
|
96
|
+
| `--git-depth` | | `INT [1–100]` | `20` | Number of recent commits with `--git-context`. | ✅ CORE |
|
|
97
|
+
| `--git-days` | | `INT [1–3650]` | `90` | Window in days to detect hotspots with `--git-context`. | ✅ CORE |
|
|
98
|
+
| `--env-map` | | flag | off | Maps environment variables: key, type, category, files that reference them. | ✅ CORE |
|
|
99
|
+
| `--code-notes` | | flag | off | Extracts inline annotations: TODO, FIXME, HACK, BUG, DEPRECATED, NOTE, etc. | ✅ CORE |
|
|
100
|
+
| `--copy` | `-c` | flag | off | Copies output to the clipboard after successful execution. | ✅ CORE |
|
|
101
|
+
| `--depth` | | `INT [1–20]` | `4` | Maximum file tree traversal depth. Java/Maven requires ≥8. | ✅ CORE |
|
|
102
|
+
| `--mode` | | `contract\|standard\|raw` | `contract` | `contract`: minimal contracts per file. `standard`: full detail. `raw`: project level only. | ✅ CORE |
|
|
103
|
+
| `--tree` | | flag | off | Includes full `file_tree` and `file_paths` in the output. Increases size significantly. | ✅ CORE |
|
|
104
|
+
| `--changed-only` | | flag | off | Contract mode: only files modified in git (staged, unstaged, untracked). | ✅ CORE |
|
|
105
|
+
| `--rank-by` | | `relevance\|centrality\|git-churn` | `relevance` | File ranking strategy in contract mode. | ✅ CORE |
|
|
106
|
+
| `--semantics` | | flag | off | Cross-file symbol resolution, call graph with confidence levels, fan-in/fan-out hotspots. Slower. | 🧪 EXP |
|
|
107
|
+
| `--architecture` | | flag | off | Architectural layer inference (MVC/hexagonal/bounded contexts). Low confidence without `--semantics`. | 🧪 EXP |
|
|
108
|
+
| `--graph-modules` | | flag | off | Structural module graph: nodes (files/symbols) and edges (imports, calls, contains). | 🧪 EXP |
|
|
109
|
+
| `--graph-detail` | | `high\|medium\|full` | `high` | Module graph detail level. | 🧪 EXP |
|
|
110
|
+
| `--max-nodes` | | `INT [≥1]` | — | Maximum nodes in `--graph-modules`. Prevents huge graphs in large repos. | 🧪 EXP |
|
|
111
|
+
| `--graph-edges` | | `TEXT` | all | Edge types for `--graph-modules`, comma-separated: `imports,calls,contains`. | 🧪 EXP |
|
|
112
|
+
| `--docs` | | flag | off | Extracts docstrings, function signatures, and module comments. | 🧪 EXP |
|
|
113
|
+
| `--docs-depth` | | `module\|symbols\|full` | `symbols` | Docs extraction depth. `full` includes private symbols. | 🧪 EXP |
|
|
114
|
+
| `--symbol` | | `TEXT` | — | Contract mode: localized context for a specific symbol. Python, TS, JS only. **Does not support Java.** | 🧪 EXP |
|
|
115
|
+
| `--max-importers` | | `INT [1–10000]` | `50` | Limit on importer files returned by `--symbol`. | 🧪 EXP |
|
|
116
|
+
| `--full-metrics` | | flag | off | Per-file technical metrics: LOC, cyclomatic complexity, coverage. Aimed at CI, not at agents. | 🧪 EXP |
|
|
117
|
+
| `--emit-graph` | | flag | off | Contract mode: includes a compact dependency graph (nodes + edges) in the output. | 🚧 WIP |
|
|
118
|
+
| `--entrypoints-only` | | flag | off | Contract mode: only files with exports or entry points. Note: includes *all* files with exports. | 🚧 WIP |
|
|
119
|
+
| `--max-symbols` | | `INT [≥1]` | — | Limits total exported symbols in contract mode. Discards lower-ranked files. | 🚧 WIP |
|
|
120
|
+
| `--no-redact` | | flag | off | Disables automatic secret redaction. Output may contain sensitive values. | 🚧 WIP |
|
|
121
|
+
| `--trace-pipeline` | | flag | off | Diagnostic mode: includes a trace of each candidate and filtering decision. Debugging only. | 🚧 WIP |
|
|
122
|
+
| `--version` | `-v` | flag | — | Shows version and exits. | ✅ CORE |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Subcommands
|
|
127
|
+
|
|
128
|
+
### `prepare-context TASK [PATH]`
|
|
129
|
+
|
|
130
|
+
Generates task-specific context for AI agents.
|
|
131
|
+
|
|
132
|
+
| Task | Description | Status |
|
|
133
|
+
|------|-------------|--------|
|
|
134
|
+
| `explain` | Architecture, entry points, key dependencies | ✅ CORE |
|
|
135
|
+
| `fix-bug` | Files prioritized by risk, inline annotations | ✅ CORE |
|
|
136
|
+
| `onboard` | Full context for new agents or developers | ✅ CORE |
|
|
137
|
+
| `delta` | Incremental context: only files changed in git | ✅ CORE |
|
|
138
|
+
| `refactor` | Structural problems, improvement opportunities | 🧪 EXP |
|
|
139
|
+
| `generate-tests` | Files without tests, coverage gap analysis | 🧪 EXP |
|
|
140
|
+
| `review-pr` | Changed files + architectural impact | 🧪 EXP |
|
|
141
|
+
|
|
142
|
+
...
|