codemap-core 0.3.0__tar.gz → 0.3.1__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.
Files changed (130) hide show
  1. {codemap_core-0.3.0 → codemap_core-0.3.1}/CHANGELOG.md +44 -0
  2. {codemap_core-0.3.0 → codemap_core-0.3.1}/PKG-INFO +110 -3
  3. {codemap_core-0.3.0 → codemap_core-0.3.1}/README.md +109 -2
  4. {codemap_core-0.3.0 → codemap_core-0.3.1}/pyproject.toml +1 -1
  5. {codemap_core-0.3.0 → codemap_core-0.3.1}/.gitignore +0 -0
  6. {codemap_core-0.3.0 → codemap_core-0.3.1}/LICENSE +0 -0
  7. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0000-template.md +0 -0
  8. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0001-symbol-id-format.md +0 -0
  9. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0002-storage-backend.md +0 -0
  10. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0003-module-boundaries.md +0 -0
  11. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0004-indexer-bridge-plugin.md +0 -0
  12. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0005-exit-codes.md +0 -0
  13. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0006-schema-version.md +0 -0
  14. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0007-diagnostic-isolation.md +0 -0
  15. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0008-atomic-write.md +0 -0
  16. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0009-quality-gates.md +0 -0
  17. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0010-benchmark-regression.md +0 -0
  18. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0011-language-neutrality.md +0 -0
  19. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0012-first-language-cohort.md +0 -0
  20. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/adr/0013-java-engine-tree-sitter-over-scip-java.md +0 -0
  21. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/bridges/http_route.md +0 -0
  22. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/cli.md +0 -0
  23. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/configuration.md +0 -0
  24. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/indexers/python.md +0 -0
  25. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/performance.md +0 -0
  26. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/plugin-guide.md +0 -0
  27. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/spikes/2026-06-23-scip-java-findings.md +0 -0
  28. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/spikes/2026-06-24-codemap-refactor-execution-readiness.md +0 -0
  29. {codemap_core-0.3.0 → codemap_core-0.3.1}/docs/spikes/2026-06-24-l1-refactor-next-steps.md +0 -0
  30. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/__init__.py +0 -0
  31. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/__init__.py +0 -0
  32. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/_common.py +0 -0
  33. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/__init__.py +0 -0
  34. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/callees.py +0 -0
  35. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/callers.py +0 -0
  36. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/config.py +0 -0
  37. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/diagnostics.py +0 -0
  38. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/doctor.py +0 -0
  39. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/get.py +0 -0
  40. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/index.py +0 -0
  41. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/routes.py +0 -0
  42. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/search.py +0 -0
  43. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/commands/trace.py +0 -0
  44. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/main.py +0 -0
  45. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/renderers/__init__.py +0 -0
  46. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/renderers/json.py +0 -0
  47. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/cli/renderers/text.py +0 -0
  48. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/config/__init__.py +0 -0
  49. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/config/loader.py +0 -0
  50. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/config/schema.py +0 -0
  51. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/__init__.py +0 -0
  52. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/bridge/__init__.py +0 -0
  53. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/bridge/base.py +0 -0
  54. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/bridge/http_route.py +0 -0
  55. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/bridge/python_cross_module.py +0 -0
  56. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/bridge/registry.py +0 -0
  57. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/git_hotspots.py +0 -0
  58. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/graph.py +0 -0
  59. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/models.py +0 -0
  60. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/store.py +0 -0
  61. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/core/symbol.py +0 -0
  62. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/diagnostics/__init__.py +0 -0
  63. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/diagnostics/exit_codes.py +0 -0
  64. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/diagnostics/logging.py +0 -0
  65. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/diagnostics/progress.py +0 -0
  66. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/emitters/__init__.py +0 -0
  67. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/emitters/base.py +0 -0
  68. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/emitters/registry.py +0 -0
  69. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/__init__.py +0 -0
  70. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/_example_lang.py +0 -0
  71. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/base.py +0 -0
  72. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/project_base.py +0 -0
  73. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/project_registry.py +0 -0
  74. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/python.py +0 -0
  75. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/indexers/registry.py +0 -0
  76. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/__init__.py +0 -0
  77. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/atomic.py +0 -0
  78. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/base.py +0 -0
  79. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/json_store.py +0 -0
  80. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/lock.py +0 -0
  81. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/io/manifest.py +0 -0
  82. {codemap_core-0.3.0 → codemap_core-0.3.1}/src/codemap/mcp/__init__.py +0 -0
  83. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/__init__.py +0 -0
  84. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/bench/__init__.py +0 -0
  85. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/bench/conftest.py +0 -0
  86. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/bench/test_index_perf.py +0 -0
  87. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/bench/test_query_perf.py +0 -0
  88. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/__init__.py +0 -0
  89. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_cli.py +0 -0
  90. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_config_integration.py +0 -0
  91. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_cross_module_callers.py +0 -0
  92. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_diagnostics.py +0 -0
  93. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_error_experience.py +0 -0
  94. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_golden_precision.py +0 -0
  95. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_http_pipeline.py +0 -0
  96. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_incremental.py +0 -0
  97. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/e2e/test_query_commands.py +0 -0
  98. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/basics/expected/symbol_ids.txt +0 -0
  99. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/basics/input/pkg/mod.py +0 -0
  100. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/imports/expected/symbol_ids.txt +0 -0
  101. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/imports/input/users.py +0 -0
  102. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/inheritance/expected/symbol_ids.txt +0 -0
  103. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/indexers/python/inheritance/input/shapes.py +0 -0
  104. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/.gitignore +0 -0
  105. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/pom.xml +0 -0
  106. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/settings.xml +0 -0
  107. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/src/main/java/com/example/hellospring/controller/OrderController.java +0 -0
  108. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/src/main/java/com/example/hellospring/mapper/CouponMapper.java +0 -0
  109. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/src/main/java/com/example/hellospring/service/OrderService.java +0 -0
  110. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/src/main/resources/mapper/CouponMapper.xml +0 -0
  111. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/scip-samples/HelloSpring/web/OrderList.vue +0 -0
  112. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/smoke/a.example +0 -0
  113. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/fixtures/smoke/b.example +0 -0
  114. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/integration/__init__.py +0 -0
  115. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/integration/test_http_route_bridge_e2e.py +0 -0
  116. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/__init__.py +0 -0
  117. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_config.py +0 -0
  118. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_emitter_registry.py +0 -0
  119. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_git_hotspots.py +0 -0
  120. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_graph.py +0 -0
  121. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_http_route_bridge.py +0 -0
  122. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_indexer_registry.py +0 -0
  123. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_io.py +0 -0
  124. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_models.py +0 -0
  125. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_models_kinds.py +0 -0
  126. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_orchestration_phases.py +0 -0
  127. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_project_indexer_registry.py +0 -0
  128. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_python_cross_module_bridge.py +0 -0
  129. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_python_indexer.py +0 -0
  130. {codemap_core-0.3.0 → codemap_core-0.3.1}/tests/unit/test_symbol.py +0 -0
@@ -8,6 +8,50 @@ During `0.x`, MINOR may introduce breaking changes — they will be marked `BREA
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.3.1] — 2026-06-25
12
+
13
+ Quick follow-up to 0.3.0. Lockstep version-only bump across all **20
14
+ packages** to keep the family in sync; the only source change is in
15
+ `codemap-aimemory`.
16
+
17
+ ### `codemap-aimemory` — LLM CLI configuration
18
+
19
+ * New subcommand group **`codemap llm config`** (registered through the
20
+ `codemap.cli_commands` entry-point group introduced in 0.3.0):
21
+ * `codemap llm config set api-key <key>` — persist to
22
+ `~/.config/codemap/llm.yaml` (or `$XDG_CONFIG_HOME/codemap/llm.yaml`),
23
+ written `chmod 600` because it carries a credential.
24
+ * `codemap llm config set base-url <url>` / `model` / `backend`.
25
+ * `codemap llm config unset <key>` — clear one field; the on-disk
26
+ file only contains non-`None` values.
27
+ * `codemap llm config show` — print the effective config with one of
28
+ `[env]` / `[file]` / `[default]` annotated per field; API keys are
29
+ masked.
30
+ * `codemap llm config path` — print the config file location.
31
+ * `codemap enrich` resolution order is now (first non-empty wins):
32
+ CLI flag → env var → file config (new in 0.3.1) → built-in defaults.
33
+ * Behavioural reminder: **API key is the LLM on/off switch.**
34
+ `codemap index` never calls any LLM; `codemap enrich` without a key
35
+ errors out cleanly, never silently. No background LLM traffic.
36
+
37
+ ### Documentation
38
+
39
+ * README + README.zh-CN: new "Output formats" section documenting every
40
+ file under `.codemap/` and `.ai-memory/` (kind, shape, who consumes it).
41
+ * README + README.zh-CN: new "LLM configuration" section with the
42
+ three-source resolution order and a Chinese / open-source LLM endpoint
43
+ cheatsheet (DeepSeek, GLM, MiniMax, Kimi, Qwen, MiMo, Ollama, native
44
+ Anthropic) — all use `--backend openai` with their own `base-url`.
45
+ * INSTALL: bump heading and mention the new CLI.
46
+
47
+ ### Plugin tests
48
+
49
+ 19 new unit tests in `codemap-aimemory` covering: XDG path resolution,
50
+ load / save / unset round-trip, `chmod 600` on save, corrupt-YAML
51
+ graceful fallback, dash-vs-underscore key aliasing, CLI set / show /
52
+ unset / path, source-annotation correctness in `show`. Plugin test
53
+ total: 38 → 57. Other plugins unchanged.
54
+
11
55
  ## [0.3.0] — 2026-06-25
12
56
 
13
57
  The four-layer-memory-model L1 release. The plugin family grows from
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codemap-core
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Language-neutral code index for AI agents
5
5
  Project-URL: Homepage, https://github.com/qxbyte/codemap
6
6
  Project-URL: Repository, https://github.com/qxbyte/codemap
@@ -78,8 +78,10 @@ mappings, and cross-file relationships without grepping the entire
78
78
  project. Indexing is static, fast, and reproducible — no LLM in the
79
79
  index path.
80
80
 
81
- **Status**: 0.2.0 stable. Installable from PyPI as `codemap-core`
82
- plus 17 `codemap-<lang>` plugins.
81
+ **Status**: 0.3.1 stable. Installable from PyPI as `codemap-core`
82
+ plus 17 `codemap-<lang>` plugins + 2 framework / output plugins
83
+ (`codemap-mybatis`, `codemap-aimemory`, added in 0.3.0; 0.3.1
84
+ adds the `codemap llm config` CLI).
83
85
 
84
86
  > 👉 **In a hurry?** The [`INSTALL.md`](./INSTALL.md) guide is the
85
87
  > definitive walkthrough — it covers `pipx` / `uv tool` / `pip`,
@@ -315,6 +317,14 @@ codemap routes # HTTP routes from the http_route bridge
315
317
 
316
318
  # Machine-readable output: all commands take --json
317
319
  codemap --json callers '<symbol-id>'
320
+
321
+ # Optional LLM enrichment (codemap-aimemory plugin, 0.3.0+)
322
+ codemap llm config set api-key sk-xxx # persist to ~/.config/codemap/llm.yaml
323
+ codemap llm config set base-url https://api.deepseek.com/v1
324
+ codemap llm config set model deepseek-chat
325
+ codemap llm config show # masked-key view + value source
326
+ codemap enrich . # fills .ai-memory/enrichment/*.yml
327
+ codemap enrich . --dry-run # count fn/method symbols, no API call
318
328
  ```
319
329
 
320
330
  Exit codes follow `sysexits.h` (ADR-005); see
@@ -322,6 +332,103 @@ Exit codes follow `sysexits.h` (ADR-005); see
322
332
 
323
333
  ---
324
334
 
335
+ ## Output formats
336
+
337
+ `codemap index` produces two parallel directories at the project root:
338
+
339
+ ```
340
+ <project>/
341
+ ├── .codemap/ ← deterministic, machine-friendly index (queried by `codemap …`)
342
+ └── .ai-memory/ ← four-layer-memory-model L1 layout (consumed by AI agents)
343
+ ```
344
+
345
+ ### `.codemap/` — deterministic index (JSON, 7 files)
346
+
347
+ | File | Contents |
348
+ |---|---|
349
+ | `symbols.json` | All symbols keyed by `SymbolID`. Each entry: `kind`, `language`, `file`, `range`, `signature`, `annotations`, `confidence`, `extra` (per-language metadata: `pending_calls`, `http_route`, `supertypes`, `imports`, `params`, `return_type`, `change_count_90d`, …). |
350
+ | `edges.json` | Directed relations: `calls` / `extends` / `implements` / `overrides` / `references` / `routes_to` / `maps_to` / `imports` / `accesses_table`. Each carries `confidence` ∈ {`high`, `medium`, `low`}. |
351
+ | `routes.json` | HTTP routes minted by the `http_route` bridge from `extra["http_route"]`. |
352
+ | `aliases.json` | Synthetic intermediate ↔ real symbol links (e.g. route → handler). |
353
+ | `manifest.json` | Project root, `codemap_version`, registered indexers + bridges + their versions, per-file sha256 / mtime / language. |
354
+ | `diagnostics.json` | Indexer / bridge warnings collected during the run (severity + code + message + producer). |
355
+ | `.lock` | Cross-process write lock; do not edit. |
356
+
357
+ ### `.ai-memory/` — four-layer memory L1 (YAML, 6 files)
358
+
359
+ Generated by `codemap-aimemory` when installed. AI agents read this
360
+ tree directly. Stable `entity_id` slugs are derived from the SCIP
361
+ `SymbolID` (e.g. `fn-calcPrice` / `cls-OrderService` / `tbl-sf_coupon`).
362
+
363
+ ```
364
+ .ai-memory/
365
+ ├── entities/
366
+ │ ├── functions.yml fn-* / cls-* with calls / called_by /
367
+ │ │ related_tables / signature / line_range /
368
+ │ │ confidence / change_count_90d / business_meaning
369
+ │ ├── tables.yml tbl-* table entities
370
+ │ └── files.yml file-* file entries
371
+ ├── relations/
372
+ │ ├── call-graph.yml `{from, to, type=calls, confidence}`
373
+ │ ├── table-relations.yml `{from, to, type=accesses_table, confidence}`
374
+ │ └── rule-constraints.yml empty placeholder (L2 owns)
375
+ └── enrichment/ OPTIONAL: LLM-generated explanations
376
+ └── <sha1[:12]>.yml `{symbol_id, business_meaning,
377
+ related_rules, confidence:"llm",
378
+ source_model, generated_at}`
379
+ ```
380
+
381
+ Two-hop fan-out: when a Java method `maps_to` a `sql_mapping` that
382
+ `accesses_table` T, T automatically lands on the method's
383
+ `related_tables`. So `fn-selectByUser.related_tables = [tbl-sf_coupon]`
384
+ without the agent needing to follow the chain itself.
385
+
386
+ ---
387
+
388
+ ## LLM configuration (optional)
389
+
390
+ The core index is **always LLM-free** — `codemap index` never calls any
391
+ LLM. Only the optional `codemap enrich` command in `codemap-aimemory`
392
+ writes the `enrichment/` overlay, and only when **you** invoke it. The
393
+ existence of an API key is the on/off switch: without one, `codemap
394
+ enrich` exits with a clear error and no network call is made.
395
+
396
+ Three configuration sources, **first non-empty wins**:
397
+
398
+ 1. **CLI flag** — `--api-key`, `--base-url`, `--model`, `--backend`
399
+ 2. **Environment variable** — `CODEMAP_LLM_API_KEY` (also
400
+ `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`); `CODEMAP_LLM_BASE_URL`
401
+ (also `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL`);
402
+ `CODEMAP_LLM_MODEL`; `CODEMAP_LLM_BACKEND`
403
+ 3. **Persistent file config** — `~/.config/codemap/llm.yaml` (managed
404
+ by `codemap llm config set/unset/show`; written `chmod 600`)
405
+ 4. Built-in defaults — backend `openai`, model `gpt-4o-mini`
406
+
407
+ ### Common provider endpoints (OpenAI-compatible — `--backend openai`)
408
+
409
+ | Provider | Model example | Base URL |
410
+ |---|---|---|
411
+ | OpenAI | `gpt-4o-mini` | `https://api.openai.com/v1` *(default)* |
412
+ | DeepSeek | `deepseek-chat` | `https://api.deepseek.com/v1` |
413
+ | 智谱 GLM | `glm-4-flash` | `https://open.bigmodel.cn/api/paas/v4/` |
414
+ | MiniMax | `abab6.5s-chat` | `https://api.minimax.chat/v1` |
415
+ | 月之暗面 Kimi | `moonshot-v1-8k` | `https://api.moonshot.cn/v1` |
416
+ | 阿里通义 | `qwen-plus` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
417
+ | 小米 MiMo | `mimo-large` | *(per vendor docs; OpenAI-compatible)* |
418
+ | Ollama (local) | `llama3` | `http://localhost:11434/v1` — use `--backend ollama` (key not needed) |
419
+ | Anthropic native | `claude-sonnet-4-5` | *(use `--backend anthropic`; requires `anthropic` SDK via `pip install codemap-aimemory[llm]`)* |
420
+
421
+ Example with DeepSeek:
422
+
423
+ ```bash
424
+ codemap llm config set base-url https://api.deepseek.com/v1
425
+ codemap llm config set api-key sk-xxx
426
+ codemap llm config set model deepseek-chat
427
+ codemap enrich .
428
+ ```
429
+
430
+ ---
431
+
325
432
  ## Configuration
326
433
 
327
434
  Project-level configuration lives at `.codemap/config.yaml` (committed
@@ -11,8 +11,10 @@ mappings, and cross-file relationships without grepping the entire
11
11
  project. Indexing is static, fast, and reproducible — no LLM in the
12
12
  index path.
13
13
 
14
- **Status**: 0.2.0 stable. Installable from PyPI as `codemap-core`
15
- plus 17 `codemap-<lang>` plugins.
14
+ **Status**: 0.3.1 stable. Installable from PyPI as `codemap-core`
15
+ plus 17 `codemap-<lang>` plugins + 2 framework / output plugins
16
+ (`codemap-mybatis`, `codemap-aimemory`, added in 0.3.0; 0.3.1
17
+ adds the `codemap llm config` CLI).
16
18
 
17
19
  > 👉 **In a hurry?** The [`INSTALL.md`](./INSTALL.md) guide is the
18
20
  > definitive walkthrough — it covers `pipx` / `uv tool` / `pip`,
@@ -248,6 +250,14 @@ codemap routes # HTTP routes from the http_route bridge
248
250
 
249
251
  # Machine-readable output: all commands take --json
250
252
  codemap --json callers '<symbol-id>'
253
+
254
+ # Optional LLM enrichment (codemap-aimemory plugin, 0.3.0+)
255
+ codemap llm config set api-key sk-xxx # persist to ~/.config/codemap/llm.yaml
256
+ codemap llm config set base-url https://api.deepseek.com/v1
257
+ codemap llm config set model deepseek-chat
258
+ codemap llm config show # masked-key view + value source
259
+ codemap enrich . # fills .ai-memory/enrichment/*.yml
260
+ codemap enrich . --dry-run # count fn/method symbols, no API call
251
261
  ```
252
262
 
253
263
  Exit codes follow `sysexits.h` (ADR-005); see
@@ -255,6 +265,103 @@ Exit codes follow `sysexits.h` (ADR-005); see
255
265
 
256
266
  ---
257
267
 
268
+ ## Output formats
269
+
270
+ `codemap index` produces two parallel directories at the project root:
271
+
272
+ ```
273
+ <project>/
274
+ ├── .codemap/ ← deterministic, machine-friendly index (queried by `codemap …`)
275
+ └── .ai-memory/ ← four-layer-memory-model L1 layout (consumed by AI agents)
276
+ ```
277
+
278
+ ### `.codemap/` — deterministic index (JSON, 7 files)
279
+
280
+ | File | Contents |
281
+ |---|---|
282
+ | `symbols.json` | All symbols keyed by `SymbolID`. Each entry: `kind`, `language`, `file`, `range`, `signature`, `annotations`, `confidence`, `extra` (per-language metadata: `pending_calls`, `http_route`, `supertypes`, `imports`, `params`, `return_type`, `change_count_90d`, …). |
283
+ | `edges.json` | Directed relations: `calls` / `extends` / `implements` / `overrides` / `references` / `routes_to` / `maps_to` / `imports` / `accesses_table`. Each carries `confidence` ∈ {`high`, `medium`, `low`}. |
284
+ | `routes.json` | HTTP routes minted by the `http_route` bridge from `extra["http_route"]`. |
285
+ | `aliases.json` | Synthetic intermediate ↔ real symbol links (e.g. route → handler). |
286
+ | `manifest.json` | Project root, `codemap_version`, registered indexers + bridges + their versions, per-file sha256 / mtime / language. |
287
+ | `diagnostics.json` | Indexer / bridge warnings collected during the run (severity + code + message + producer). |
288
+ | `.lock` | Cross-process write lock; do not edit. |
289
+
290
+ ### `.ai-memory/` — four-layer memory L1 (YAML, 6 files)
291
+
292
+ Generated by `codemap-aimemory` when installed. AI agents read this
293
+ tree directly. Stable `entity_id` slugs are derived from the SCIP
294
+ `SymbolID` (e.g. `fn-calcPrice` / `cls-OrderService` / `tbl-sf_coupon`).
295
+
296
+ ```
297
+ .ai-memory/
298
+ ├── entities/
299
+ │ ├── functions.yml fn-* / cls-* with calls / called_by /
300
+ │ │ related_tables / signature / line_range /
301
+ │ │ confidence / change_count_90d / business_meaning
302
+ │ ├── tables.yml tbl-* table entities
303
+ │ └── files.yml file-* file entries
304
+ ├── relations/
305
+ │ ├── call-graph.yml `{from, to, type=calls, confidence}`
306
+ │ ├── table-relations.yml `{from, to, type=accesses_table, confidence}`
307
+ │ └── rule-constraints.yml empty placeholder (L2 owns)
308
+ └── enrichment/ OPTIONAL: LLM-generated explanations
309
+ └── <sha1[:12]>.yml `{symbol_id, business_meaning,
310
+ related_rules, confidence:"llm",
311
+ source_model, generated_at}`
312
+ ```
313
+
314
+ Two-hop fan-out: when a Java method `maps_to` a `sql_mapping` that
315
+ `accesses_table` T, T automatically lands on the method's
316
+ `related_tables`. So `fn-selectByUser.related_tables = [tbl-sf_coupon]`
317
+ without the agent needing to follow the chain itself.
318
+
319
+ ---
320
+
321
+ ## LLM configuration (optional)
322
+
323
+ The core index is **always LLM-free** — `codemap index` never calls any
324
+ LLM. Only the optional `codemap enrich` command in `codemap-aimemory`
325
+ writes the `enrichment/` overlay, and only when **you** invoke it. The
326
+ existence of an API key is the on/off switch: without one, `codemap
327
+ enrich` exits with a clear error and no network call is made.
328
+
329
+ Three configuration sources, **first non-empty wins**:
330
+
331
+ 1. **CLI flag** — `--api-key`, `--base-url`, `--model`, `--backend`
332
+ 2. **Environment variable** — `CODEMAP_LLM_API_KEY` (also
333
+ `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`); `CODEMAP_LLM_BASE_URL`
334
+ (also `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL`);
335
+ `CODEMAP_LLM_MODEL`; `CODEMAP_LLM_BACKEND`
336
+ 3. **Persistent file config** — `~/.config/codemap/llm.yaml` (managed
337
+ by `codemap llm config set/unset/show`; written `chmod 600`)
338
+ 4. Built-in defaults — backend `openai`, model `gpt-4o-mini`
339
+
340
+ ### Common provider endpoints (OpenAI-compatible — `--backend openai`)
341
+
342
+ | Provider | Model example | Base URL |
343
+ |---|---|---|
344
+ | OpenAI | `gpt-4o-mini` | `https://api.openai.com/v1` *(default)* |
345
+ | DeepSeek | `deepseek-chat` | `https://api.deepseek.com/v1` |
346
+ | 智谱 GLM | `glm-4-flash` | `https://open.bigmodel.cn/api/paas/v4/` |
347
+ | MiniMax | `abab6.5s-chat` | `https://api.minimax.chat/v1` |
348
+ | 月之暗面 Kimi | `moonshot-v1-8k` | `https://api.moonshot.cn/v1` |
349
+ | 阿里通义 | `qwen-plus` | `https://dashscope.aliyuncs.com/compatible-mode/v1` |
350
+ | 小米 MiMo | `mimo-large` | *(per vendor docs; OpenAI-compatible)* |
351
+ | Ollama (local) | `llama3` | `http://localhost:11434/v1` — use `--backend ollama` (key not needed) |
352
+ | Anthropic native | `claude-sonnet-4-5` | *(use `--backend anthropic`; requires `anthropic` SDK via `pip install codemap-aimemory[llm]`)* |
353
+
354
+ Example with DeepSeek:
355
+
356
+ ```bash
357
+ codemap llm config set base-url https://api.deepseek.com/v1
358
+ codemap llm config set api-key sk-xxx
359
+ codemap llm config set model deepseek-chat
360
+ codemap enrich .
361
+ ```
362
+
363
+ ---
364
+
258
365
  ## Configuration
259
366
 
260
367
  Project-level configuration lives at `.codemap/config.yaml` (committed
@@ -12,7 +12,7 @@ build-backend = "hatchling.build"
12
12
  # (`codemap-java`, `codemap-go`, …) — this is the engine; the others
13
13
  # are language adapters.
14
14
  name = "codemap-core"
15
- version = "0.3.0"
15
+ version = "0.3.1"
16
16
  description = "Language-neutral code index for AI agents"
17
17
  readme = "README.md"
18
18
  license = { file = "LICENSE" }
File without changes
File without changes
File without changes