codemap-core 0.1.0a1__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.
- codemap_core-0.1.0a1/.gitignore +43 -0
- codemap_core-0.1.0a1/CHANGELOG.md +366 -0
- codemap_core-0.1.0a1/LICENSE +21 -0
- codemap_core-0.1.0a1/PKG-INFO +488 -0
- codemap_core-0.1.0a1/README.md +421 -0
- codemap_core-0.1.0a1/docs/adr/0000-template.md +28 -0
- codemap_core-0.1.0a1/docs/adr/0001-symbol-id-format.md +43 -0
- codemap_core-0.1.0a1/docs/adr/0002-storage-backend.md +37 -0
- codemap_core-0.1.0a1/docs/adr/0003-module-boundaries.md +32 -0
- codemap_core-0.1.0a1/docs/adr/0004-indexer-bridge-plugin.md +35 -0
- codemap_core-0.1.0a1/docs/adr/0005-exit-codes.md +37 -0
- codemap_core-0.1.0a1/docs/adr/0006-schema-version.md +33 -0
- codemap_core-0.1.0a1/docs/adr/0007-diagnostic-isolation.md +33 -0
- codemap_core-0.1.0a1/docs/adr/0008-atomic-write.md +37 -0
- codemap_core-0.1.0a1/docs/adr/0009-quality-gates.md +38 -0
- codemap_core-0.1.0a1/docs/adr/0010-benchmark-regression.md +58 -0
- codemap_core-0.1.0a1/docs/adr/0011-language-neutrality.md +50 -0
- codemap_core-0.1.0a1/docs/adr/0012-first-language-cohort.md +40 -0
- codemap_core-0.1.0a1/docs/bridges/http_route.md +132 -0
- codemap_core-0.1.0a1/docs/cli.md +139 -0
- codemap_core-0.1.0a1/docs/configuration.md +105 -0
- codemap_core-0.1.0a1/docs/indexers/python.md +150 -0
- codemap_core-0.1.0a1/docs/performance.md +73 -0
- codemap_core-0.1.0a1/docs/plugin-guide.md +153 -0
- codemap_core-0.1.0a1/pyproject.toml +237 -0
- codemap_core-0.1.0a1/src/codemap/__init__.py +7 -0
- codemap_core-0.1.0a1/src/codemap/cli/__init__.py +3 -0
- codemap_core-0.1.0a1/src/codemap/cli/_common.py +90 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/__init__.py +3 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/callees.py +102 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/callers.py +107 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/config.py +78 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/diagnostics.py +142 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/doctor.py +158 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/get.py +93 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/index.py +725 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/routes.py +104 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/search.py +78 -0
- codemap_core-0.1.0a1/src/codemap/cli/commands/trace.py +179 -0
- codemap_core-0.1.0a1/src/codemap/cli/main.py +140 -0
- codemap_core-0.1.0a1/src/codemap/cli/renderers/__init__.py +3 -0
- codemap_core-0.1.0a1/src/codemap/cli/renderers/json.py +32 -0
- codemap_core-0.1.0a1/src/codemap/cli/renderers/text.py +24 -0
- codemap_core-0.1.0a1/src/codemap/config/__init__.py +31 -0
- codemap_core-0.1.0a1/src/codemap/config/loader.py +96 -0
- codemap_core-0.1.0a1/src/codemap/config/schema.py +122 -0
- codemap_core-0.1.0a1/src/codemap/core/__init__.py +7 -0
- codemap_core-0.1.0a1/src/codemap/core/bridge/__init__.py +8 -0
- codemap_core-0.1.0a1/src/codemap/core/bridge/base.py +38 -0
- codemap_core-0.1.0a1/src/codemap/core/bridge/http_route.py +374 -0
- codemap_core-0.1.0a1/src/codemap/core/bridge/python_cross_module.py +120 -0
- codemap_core-0.1.0a1/src/codemap/core/bridge/registry.py +117 -0
- codemap_core-0.1.0a1/src/codemap/core/graph.py +183 -0
- codemap_core-0.1.0a1/src/codemap/core/models.py +299 -0
- codemap_core-0.1.0a1/src/codemap/core/store.py +78 -0
- codemap_core-0.1.0a1/src/codemap/core/symbol.py +314 -0
- codemap_core-0.1.0a1/src/codemap/diagnostics/__init__.py +3 -0
- codemap_core-0.1.0a1/src/codemap/diagnostics/exit_codes.py +30 -0
- codemap_core-0.1.0a1/src/codemap/diagnostics/logging.py +65 -0
- codemap_core-0.1.0a1/src/codemap/diagnostics/progress.py +68 -0
- codemap_core-0.1.0a1/src/codemap/indexers/__init__.py +9 -0
- codemap_core-0.1.0a1/src/codemap/indexers/_example_lang.py +135 -0
- codemap_core-0.1.0a1/src/codemap/indexers/base.py +77 -0
- codemap_core-0.1.0a1/src/codemap/indexers/python.py +577 -0
- codemap_core-0.1.0a1/src/codemap/indexers/registry.py +104 -0
- codemap_core-0.1.0a1/src/codemap/io/__init__.py +8 -0
- codemap_core-0.1.0a1/src/codemap/io/atomic.py +97 -0
- codemap_core-0.1.0a1/src/codemap/io/base.py +12 -0
- codemap_core-0.1.0a1/src/codemap/io/json_store.py +433 -0
- codemap_core-0.1.0a1/src/codemap/io/lock.py +87 -0
- codemap_core-0.1.0a1/src/codemap/io/manifest.py +90 -0
- codemap_core-0.1.0a1/src/codemap/mcp/__init__.py +3 -0
- codemap_core-0.1.0a1/tests/__init__.py +0 -0
- codemap_core-0.1.0a1/tests/bench/__init__.py +0 -0
- codemap_core-0.1.0a1/tests/bench/conftest.py +41 -0
- codemap_core-0.1.0a1/tests/bench/test_index_perf.py +45 -0
- codemap_core-0.1.0a1/tests/bench/test_query_perf.py +62 -0
- codemap_core-0.1.0a1/tests/e2e/__init__.py +0 -0
- codemap_core-0.1.0a1/tests/e2e/test_cli.py +169 -0
- codemap_core-0.1.0a1/tests/e2e/test_config_integration.py +186 -0
- codemap_core-0.1.0a1/tests/e2e/test_cross_module_callers.py +79 -0
- codemap_core-0.1.0a1/tests/e2e/test_diagnostics.py +211 -0
- codemap_core-0.1.0a1/tests/e2e/test_error_experience.py +142 -0
- codemap_core-0.1.0a1/tests/e2e/test_http_pipeline.py +138 -0
- codemap_core-0.1.0a1/tests/e2e/test_incremental.py +153 -0
- codemap_core-0.1.0a1/tests/e2e/test_query_commands.py +332 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/basics/expected/symbol_ids.txt +6 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/basics/input/pkg/mod.py +18 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/imports/expected/symbol_ids.txt +2 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/imports/input/users.py +14 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/inheritance/expected/symbol_ids.txt +7 -0
- codemap_core-0.1.0a1/tests/fixtures/indexers/python/inheritance/input/shapes.py +20 -0
- codemap_core-0.1.0a1/tests/fixtures/smoke/a.example +5 -0
- codemap_core-0.1.0a1/tests/fixtures/smoke/b.example +1 -0
- codemap_core-0.1.0a1/tests/integration/__init__.py +0 -0
- codemap_core-0.1.0a1/tests/integration/test_http_route_bridge_e2e.py +102 -0
- codemap_core-0.1.0a1/tests/unit/__init__.py +0 -0
- codemap_core-0.1.0a1/tests/unit/test_config.py +191 -0
- codemap_core-0.1.0a1/tests/unit/test_graph.py +180 -0
- codemap_core-0.1.0a1/tests/unit/test_http_route_bridge.py +383 -0
- codemap_core-0.1.0a1/tests/unit/test_indexer_registry.py +169 -0
- codemap_core-0.1.0a1/tests/unit/test_io.py +418 -0
- codemap_core-0.1.0a1/tests/unit/test_models.py +254 -0
- codemap_core-0.1.0a1/tests/unit/test_python_cross_module_bridge.py +230 -0
- codemap_core-0.1.0a1/tests/unit/test_python_indexer.py +626 -0
- codemap_core-0.1.0a1/tests/unit/test_symbol.py +268 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Build artifacts
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
.eggs/
|
|
12
|
+
|
|
13
|
+
# Test / coverage
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
.coverage.*
|
|
17
|
+
htmlcov/
|
|
18
|
+
coverage.xml
|
|
19
|
+
.tox/
|
|
20
|
+
.mypy_cache/
|
|
21
|
+
.ruff_cache/
|
|
22
|
+
.benchmarks/
|
|
23
|
+
|
|
24
|
+
# Virtualenv
|
|
25
|
+
.venv/
|
|
26
|
+
venv/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# uv / pdm lockfiles (commit uv.lock once we settle)
|
|
30
|
+
# uv.lock
|
|
31
|
+
|
|
32
|
+
# IDE
|
|
33
|
+
.idea/
|
|
34
|
+
.vscode/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
|
|
38
|
+
# OS
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# CodeMap own index when dogfooding
|
|
43
|
+
.codemap/
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to CodeMap will be documented here.
|
|
4
|
+
|
|
5
|
+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
During `0.x`, MINOR may introduce breaking changes — they will be marked `BREAKING:`.
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
### Added — Bilingual `INSTALL.md` install guide (2026-05-30)
|
|
12
|
+
|
|
13
|
+
- New `INSTALL.md` (English) and `INSTALL.zh-CN.md` (Simplified
|
|
14
|
+
Chinese) walk through `pipx` / `uv tool` / `pip` installation paths
|
|
15
|
+
for the main CLI, then `pipx inject` / `uv tool inject` / `pip
|
|
16
|
+
install` for the 14 language plugins. Covers the `[watch]` extra,
|
|
17
|
+
offline wheel-bundle distribution, upgrade/uninstall, and a
|
|
18
|
+
troubleshooting matrix for the common gotchas (Python < 3.11,
|
|
19
|
+
`command not found`, plugin not discovered, slow first install,
|
|
20
|
+
`tree-sitter-*` build failures, partial plugin removal).
|
|
21
|
+
- Both files end with a verbatim **validation log** captured on a
|
|
22
|
+
fresh Python 3.12 virtualenv on 2026-05-30 against
|
|
23
|
+
[`c4cd436`](https://github.com/qxbyte/codemap/commit/c4cd436):
|
|
24
|
+
install (2 m 05 s), `doctor` on a clean install (2 indexers, 2
|
|
25
|
+
bridges), Java plugin inject (15.6 s, auto-discovered), index a
|
|
26
|
+
mixed Java + Python fixture (6 symbols, 1 route, 0 diagnostics),
|
|
27
|
+
and `--json` output for AI agents.
|
|
28
|
+
- Both `README.md` and `README.zh-CN.md` now link to the install
|
|
29
|
+
guide near the top, ahead of their own (lighter) install sections.
|
|
30
|
+
|
|
31
|
+
### Added — C / C++ / C# / Scala independent PyPI plugins (2026-05-30)
|
|
32
|
+
|
|
33
|
+
- `plugins/codemap-c/` — `tree-sitter-c` backed. Captures
|
|
34
|
+
`function_definition`, named `struct_specifier` / `union_specifier`
|
|
35
|
+
with bodies (with their `field_declaration` members), named
|
|
36
|
+
`enum_specifier` (with enumerators as fields), `type_definition`
|
|
37
|
+
(`typedef`), object and function-like `preproc_def` macros, and
|
|
38
|
+
top-level `declaration` with an initializer. Function bodies are
|
|
39
|
+
opaque so locals do not leak as script-level symbols.
|
|
40
|
+
15 unit tests. Scheme `scip-c`. Files: `*.c`, `*.h`.
|
|
41
|
+
- `plugins/codemap-cpp/` — `tree-sitter-cpp` backed. Recurses through
|
|
42
|
+
`namespace_definition` so descriptors carry the full namespace chain;
|
|
43
|
+
unwraps `template_declaration` to surface the inner function or class.
|
|
44
|
+
Captures `class_specifier` / `struct_specifier` / `union_specifier`
|
|
45
|
+
(with `extra.cpp_kind`), `enum_specifier`, top-level and in-class
|
|
46
|
+
`function_definition` (as `function` / `method`), and data-member
|
|
47
|
+
`field_declaration`. 13 unit tests. Scheme `scip-cpp`. Files: `*.cpp`,
|
|
48
|
+
`*.cc`, `*.cxx`, `*.hpp`, `*.hh`, `*.hxx`.
|
|
49
|
+
- `plugins/codemap-csharp/` — `tree-sitter-c-sharp` backed.
|
|
50
|
+
`namespace_declaration` is walked and dotted `qualified_name`
|
|
51
|
+
(`App.Core.Util`) is split into individual NAMESPACE descriptors.
|
|
52
|
+
Captures `class_declaration` / `interface_declaration` /
|
|
53
|
+
`struct_declaration` / `record_declaration` / `enum_declaration` /
|
|
54
|
+
`delegate_declaration` (all as `class` with distinguishing
|
|
55
|
+
`extra.csharp_kind`), `method_declaration`, `property_declaration`,
|
|
56
|
+
multi-declarator `field_declaration`, and `enum_member_declaration`.
|
|
57
|
+
13 unit tests. Scheme `scip-csharp`. Files: `*.cs`, `*.csx`.
|
|
58
|
+
- `plugins/codemap-scala/` — `tree-sitter-scala` backed. Leading
|
|
59
|
+
`package_clause` prefixes every symbol with NAMESPACE descriptors.
|
|
60
|
+
Captures `class_definition` (including `case class` — with its
|
|
61
|
+
`class_parameter`s emitted as fields), `object_definition`,
|
|
62
|
+
`trait_definition`, top-level `type_definition`,
|
|
63
|
+
`function_definition` / `function_declaration` (as methods), and
|
|
64
|
+
`val_definition` / `var_definition` (as fields, tagged with
|
|
65
|
+
`extra.scala_kind`). Nested members inside template bodies are
|
|
66
|
+
scoped under the enclosing type. 13 unit tests. Scheme `scip-scala`.
|
|
67
|
+
Files: `*.scala`, `*.sc`.
|
|
68
|
+
- `codemap doctor` now lists **15 indexers** (the four built-ins plus
|
|
69
|
+
ten plugin-shipped grammars).
|
|
70
|
+
|
|
71
|
+
### Fixed — CI: `astral-sh/setup-uv@v3` fails without `uv.lock` (2026-05-30)
|
|
72
|
+
|
|
73
|
+
- Both `test.yml` and `bench.yml` workflows enabled `cache: true` on
|
|
74
|
+
`setup-uv@v3`, which defaults its dependency glob to `**/uv.lock`.
|
|
75
|
+
We don't commit a lockfile yet, so the action failed with
|
|
76
|
+
*"No file in ... matched to [**/uv.lock]"* before any tests ran.
|
|
77
|
+
- Set `cache-dependency-glob: "pyproject.toml"` so the cache keys on a
|
|
78
|
+
file that actually exists. No effect on local development.
|
|
79
|
+
|
|
80
|
+
### Added — SQL (DDL) and Bash independent PyPI plugins (2026-05-30)
|
|
81
|
+
|
|
82
|
+
- `plugins/codemap-sql/` — `tree-sitter-sql` backed. DDL only: emits
|
|
83
|
+
`class` symbols for `CREATE TABLE` / `CREATE VIEW`, `variable`
|
|
84
|
+
symbols for `CREATE INDEX`, and `field` symbols for each
|
|
85
|
+
`column_definition` attached to the parent table.
|
|
86
|
+
`SELECT`/`INSERT`/`UPDATE`/`DELETE` are intentionally ignored.
|
|
87
|
+
13 unit tests. Scheme `scip-sql`. Files: `*.sql`, `*.ddl`.
|
|
88
|
+
- `plugins/codemap-bash/` — `tree-sitter-bash` backed. Captures
|
|
89
|
+
`function_definition`, top-level `variable_assignment`, and
|
|
90
|
+
`declaration_command` keywords (`readonly` / `declare` / `export` /
|
|
91
|
+
`local` / `typeset`) tagged via `extra.bash_kind`. Function-internal
|
|
92
|
+
state is deliberately not surfaced. Extensionless files with a bash
|
|
93
|
+
shebang are also accepted via `supports()`. 14 unit tests. Scheme
|
|
94
|
+
`scip-bash`. Files: `*.sh`, `*.bash`, `*.bats`.
|
|
95
|
+
- README (both languages) updated with the two new install commands,
|
|
96
|
+
the bigger doctor table, and the longer indexer reference table.
|
|
97
|
+
|
|
98
|
+
### Added — Swift, Kotlin, Ruby, PHP independent PyPI plugins (2026-05-30)
|
|
99
|
+
|
|
100
|
+
- `plugins/codemap-swift/` — `tree-sitter-swift` backed. Class / struct /
|
|
101
|
+
enum / protocol kept under `extra.swift_kind`; functions and `init`
|
|
102
|
+
inside types become methods; top-level `let`/`var` become variables.
|
|
103
|
+
14 unit tests. Scheme `scip-swift`.
|
|
104
|
+
- `plugins/codemap-kotlin/` — `tree-sitter-kotlin` backed. Class /
|
|
105
|
+
interface / object under `extra.kotlin_kind`, package header captured
|
|
106
|
+
as `extra.package`, `fun` inside type → method, top-level `val`/`var`
|
|
107
|
+
→ variable. Supports both `.kt` and `.kts`. 14 unit tests. Scheme
|
|
108
|
+
`scip-kotlin`.
|
|
109
|
+
- `plugins/codemap-ruby/` — `tree-sitter-ruby` backed. Class / module
|
|
110
|
+
under `extra.ruby_kind`, top-level `def` → function, `def` inside
|
|
111
|
+
type → method, `def self.x` → method with `extra.ruby_kind=singleton`.
|
|
112
|
+
Nested module/class produces qualified `Outer#Inner#m()` IDs. 13 unit
|
|
113
|
+
tests. Scheme `scip-ruby`.
|
|
114
|
+
- `plugins/codemap-php/` — `tree-sitter-php` backed. Class / interface /
|
|
115
|
+
trait / enum under `extra.php_kind`, `namespace_definition` captured
|
|
116
|
+
as `extra.namespace`, method / property / const declarations inside
|
|
117
|
+
types, free `function_definition` at module level, top-level `const`
|
|
118
|
+
as variable. 13 unit tests. Scheme `scip-php`.
|
|
119
|
+
- README (both languages) updated with 4 new subdirectory install
|
|
120
|
+
commands and the expanded doctor table (10 indexers total: 1
|
|
121
|
+
reference + 9 language plugins).
|
|
122
|
+
- End-to-end smoke fixture: 9 User-class files across Java / Go / Rust /
|
|
123
|
+
TypeScript / Python / Swift / Kotlin / Ruby / PHP indexed in one
|
|
124
|
+
`codemap index` pass — 24 symbols across 9 SCIP schemes, 0
|
|
125
|
+
diagnostics, both bridges executed.
|
|
126
|
+
|
|
127
|
+
### Added — Java, Go, Rust independent PyPI plugins (2026-05-30)
|
|
128
|
+
|
|
129
|
+
- `plugins/codemap-java/` — Java indexer backed by `tree-sitter-java`.
|
|
130
|
+
Captures class / interface / enum / record / method / constructor /
|
|
131
|
+
field declarations, honours `package` declarations as `extra.package`,
|
|
132
|
+
and walks nested types via a class stack. SCIP scheme `scip-java`.
|
|
133
|
+
14 unit tests.
|
|
134
|
+
- `plugins/codemap-go/` — Go indexer backed by `tree-sitter-go`.
|
|
135
|
+
Captures function / method (receiver-aware) / struct / interface /
|
|
136
|
+
type / const / var declarations. `func (u *User) Login()` produces
|
|
137
|
+
`scip-go . . . main.go/User#Login().` so both value and pointer
|
|
138
|
+
receivers feed into the same `User#…` namespace. 13 unit tests.
|
|
139
|
+
- `plugins/codemap-rust/` — Rust indexer backed by `tree-sitter-rust`.
|
|
140
|
+
Captures free functions, methods inside `impl` (both inherent and
|
|
141
|
+
`impl Trait for Type`) attached to the impl'd type, trait method
|
|
142
|
+
signatures attached to the trait, plus struct / enum / trait / const /
|
|
143
|
+
static items. SCIP scheme `scip-rust`. 13 unit tests.
|
|
144
|
+
- Each plugin ships with its own `pyproject.toml`, `README.md`,
|
|
145
|
+
`src/codemap_<lang>/`, and `tests/`, depends only on `codemap +
|
|
146
|
+
tree-sitter-<lang>`, and registers its indexer through the
|
|
147
|
+
`codemap.indexers` entry-point group — identical mechanism to the
|
|
148
|
+
built-in Python indexer and the previously shipped
|
|
149
|
+
`codemap-typescript` plugin.
|
|
150
|
+
- README (both English and Simplified Chinese) updated with subdirectory
|
|
151
|
+
install commands for all four language plugins and the updated
|
|
152
|
+
`codemap doctor` indexer table.
|
|
153
|
+
- End-to-end smoke test on a 5-language fixture (Java + Go + Rust + TS +
|
|
154
|
+
Python User class): 13 symbols emitted across 5 schemes, all bridges
|
|
155
|
+
ran successfully, 0 diagnostics.
|
|
156
|
+
|
|
157
|
+
### Added — TypeScript indexer as an independent PyPI plugin (2026-05-30)
|
|
158
|
+
|
|
159
|
+
- New `plugins/codemap-typescript/` package: a fully independent
|
|
160
|
+
Python distribution implementing the `Indexer` Protocol for
|
|
161
|
+
TypeScript / TSX. Backed by `tree-sitter-typescript`. Recognises
|
|
162
|
+
`function_declaration`, `class_declaration`, `interface_declaration`,
|
|
163
|
+
`method_definition`, module-level `lexical_declaration` (const/let),
|
|
164
|
+
and `import_statement`. SCIP scheme `scip-typescript`.
|
|
165
|
+
- The plugin lives in its own directory with its own `pyproject.toml`,
|
|
166
|
+
`README.md`, `src/codemap_typescript/`, and tests. It declares one
|
|
167
|
+
entry-point — `codemap.indexers.typescript = codemap_typescript:Type
|
|
168
|
+
ScriptIndexer` — and that single line is the only coupling to the host
|
|
169
|
+
CodeMap repo. After `pip install -e plugins/codemap-typescript/`,
|
|
170
|
+
`codemap doctor` lists `typescript` next to the built-in `python` and
|
|
171
|
+
`_example_lang` indexers on **identical terms** (ADR-004 + ADR-L001).
|
|
172
|
+
- 14 plugin-local unit tests cover the indexer's symbol generation,
|
|
173
|
+
scheme consistency, TSX support, syntax-error and invalid-UTF8
|
|
174
|
+
diagnostics, and the nested-class case.
|
|
175
|
+
- New `docs/plugin-guide.md` walks third-party authors through the
|
|
176
|
+
process step by step using the TypeScript plugin as the reference.
|
|
177
|
+
- End-to-end smoke test against a sample TS + TSX project: 9 symbols
|
|
178
|
+
emitted across function / class / interface / method / variable
|
|
179
|
+
kinds; both `.ts` and `.tsx` file patterns work.
|
|
180
|
+
|
|
181
|
+
### Added — Incremental + watch (2026-05-30)
|
|
182
|
+
|
|
183
|
+
- `codemap index --incremental` compares each file's sha256 against the
|
|
184
|
+
previous `manifest.files` entry and only re-parses changed files. Deleted
|
|
185
|
+
files are removed; new files are picked up. Bridges re-run from scratch
|
|
186
|
+
on every incremental pass via a new `JsonStore.clear_bridge_outputs()`
|
|
187
|
+
helper so cross-module aliases / routes always reflect the current state.
|
|
188
|
+
- `codemap index --watch` keeps the process alive, runs an initial
|
|
189
|
+
(incremental) pass, and re-indexes after every batch of file-system
|
|
190
|
+
events (debounced 500 ms). Requires the `watchdog` extra
|
|
191
|
+
(`pip install codemap[watch]`); the runtime check exits 69 (`EX_UNAVAILABLE`)
|
|
192
|
+
with a friendly install hint when watchdog is missing.
|
|
193
|
+
- Watch mode ignores events under `.codemap/` to avoid feedback loops on
|
|
194
|
+
its own writes.
|
|
195
|
+
- 7 e2e tests cover the no-op fast path, modified / deleted / new files,
|
|
196
|
+
bridge re-evaluation after a rename, fallback to full when no prior
|
|
197
|
+
index exists, and a real subprocess-based watch test that proves the
|
|
198
|
+
watcher reacts to a live file change.
|
|
199
|
+
|
|
200
|
+
### Added — Cross-module Python call resolution (2026-05-30)
|
|
201
|
+
|
|
202
|
+
- New `codemap.core.bridge.python_cross_module.PythonCrossModuleBridge`
|
|
203
|
+
resolves the synthetic `scip-python . . . <module>/<leaf>.` targets the
|
|
204
|
+
Python indexer emits for cross-file imports. The bridge looks for a
|
|
205
|
+
local symbol with the matching leaf name; if the file stem also matches
|
|
206
|
+
the last namespace segment of the synthetic target the alias confidence
|
|
207
|
+
is `high`, otherwise it falls back to `medium` for unambiguous single
|
|
208
|
+
candidates and bails on ambiguity.
|
|
209
|
+
- `JsonStore.callers` / `callees` now transparently expand aliases via a
|
|
210
|
+
reverse-alias index built at load time, so query commands automatically
|
|
211
|
+
see cross-module callers without the caller doing anything special.
|
|
212
|
+
- On the CodeMap repo itself, `callers SymbolID#` now finds 10 callers
|
|
213
|
+
across http_route.py / _example_lang.py / python.py / test_symbol.py
|
|
214
|
+
rather than just the 1 same-file reference visible before.
|
|
215
|
+
- 10 unit tests + 3 e2e tests cover happy paths (file-stem match,
|
|
216
|
+
single-candidate by leaf), explicit skips (no candidates, ambiguous
|
|
217
|
+
candidates, non-python scheme, non-call edges, already-resolved
|
|
218
|
+
targets, dedup), and the multi-file callers behaviour through the CLI.
|
|
219
|
+
|
|
220
|
+
### Added — Diagnostics command + error UX (2026-05-30)
|
|
221
|
+
|
|
222
|
+
- New `codemap diagnostics` command lists diagnostics recorded during the
|
|
223
|
+
last `codemap index`. Filters: `--severity` (error/warning/info),
|
|
224
|
+
`--producer` (indexer or bridge name), `--code` (e.g. `ROUTE001`),
|
|
225
|
+
`--limit`. Both human and JSON outputs.
|
|
226
|
+
- Indexer crashes mid-file now become an `INDEXER_CRASH` diagnostic
|
|
227
|
+
instead of being buried in stderr. Bridge crashes become
|
|
228
|
+
`BRIDGE_CRASH`. Unreadable source files become `IO001`. The run
|
|
229
|
+
completes either way.
|
|
230
|
+
- `codemap index --dry-run` walks the project and reports the per-indexer
|
|
231
|
+
file counts without writing `.codemap/`.
|
|
232
|
+
- Friendly CLI exception wrapper: unhandled exceptions print a short
|
|
233
|
+
marked-up "Internal error" message with the issue tracker URL and exit
|
|
234
|
+
70 (`EX_SOFTWARE`). Set `CODEMAP_FULL_TRACEBACK=1` for the full
|
|
235
|
+
traceback.
|
|
236
|
+
|
|
237
|
+
### Added — Configuration file (2026-05-30)
|
|
238
|
+
|
|
239
|
+
- `.codemap/config.yaml` now actually loads, replacing the previous empty
|
|
240
|
+
placeholder. Three layers are merged in order: built-in defaults →
|
|
241
|
+
`~/.config/codemap/config.yaml` → `<project>/.codemap/config.yaml`.
|
|
242
|
+
Recursive mapping merge means each layer only has to mention what it
|
|
243
|
+
changes.
|
|
244
|
+
- New schema (`codemap.config.schema.Config`, pydantic-backed,
|
|
245
|
+
`extra=forbid` so typos surface as errors):
|
|
246
|
+
- `storage.backend` (`json` | `sqlite`)
|
|
247
|
+
- `index.ignore` (glob patterns on both file names and project-relative
|
|
248
|
+
paths), `index.max_file_bytes`, `index.follow_symlinks`
|
|
249
|
+
- `indexers.enabled` / `indexers.disabled`
|
|
250
|
+
- `bridges.enabled` / `bridges.disabled`
|
|
251
|
+
- `codemap index` honours every field — `ignore` filters the walk,
|
|
252
|
+
`max_file_bytes` replaces the previously hard-coded limit, and
|
|
253
|
+
enabled/disabled lists shape which indexers / bridges run.
|
|
254
|
+
- New `codemap config show [--project P]` command prints the merged
|
|
255
|
+
configuration (rendered YAML + source paths or a JSON envelope) so it's
|
|
256
|
+
obvious which layer contributed which value.
|
|
257
|
+
- Validation errors surface as `EX_CONFIG` (exit 78) with the offending
|
|
258
|
+
field path, never as a stack trace.
|
|
259
|
+
- 15 unit tests + 10 e2e tests cover schema defaults, layer merging,
|
|
260
|
+
YAML errors, validation errors, ignore / max_file_bytes / disabled
|
|
261
|
+
indexers / disabled bridges in action. `docs/configuration.md`
|
|
262
|
+
documents every key.
|
|
263
|
+
|
|
264
|
+
### Added — Python HTTP recognition + benchmark gate (2026-05-30)
|
|
265
|
+
|
|
266
|
+
- **Python indexer** now produces `http_route` and `http_calls` metadata
|
|
267
|
+
for the `http_route` bridge to consume — meaning the cross-language
|
|
268
|
+
pipeline works end-to-end on real Python projects, not just synthetic
|
|
269
|
+
fixtures. Recognises FastAPI-style verb decorators (`@app.get("/x")`),
|
|
270
|
+
Flask-style `@route("/x", methods=[...])`, and `requests` / `httpx` /
|
|
271
|
+
`aiohttp` / `urllib3` client calls. URL-like heuristic (`/` or `http(s)://`)
|
|
272
|
+
filters out incidental `dict.get("key")` calls. 17 new unit tests cover
|
|
273
|
+
the matrix; 4 e2e tests prove `codemap routes` and `codemap callers`
|
|
274
|
+
surface the linked client→server graph after a single `codemap index`.
|
|
275
|
+
- **Benchmark suite** (`tests/bench/`) with `pytest-benchmark`, gated behind
|
|
276
|
+
the `bench` marker so the default `pytest` run is unaffected. Six
|
|
277
|
+
measurements: full-index throughput, callers / callees / search / walk /
|
|
278
|
+
shortest_path. Targets are documented in `docs/performance.md`.
|
|
279
|
+
- **ADR-010 (benchmark regression gate)** flipped from Proposed to
|
|
280
|
+
**Accepted**. Current baseline on the CodeMap repo: full-index 73 ms /
|
|
281
|
+
callers 4.7 µs / callees 26 µs / walk depth-10 72 µs — every target from
|
|
282
|
+
design §21 cleared by orders of magnitude. `.github/workflows/bench.yml`
|
|
283
|
+
runs the suite on every PR and fails the build on ≥ 20 % median
|
|
284
|
+
regression vs. main.
|
|
285
|
+
|
|
286
|
+
### Added — Query commands (2026-05-30)
|
|
287
|
+
|
|
288
|
+
- `codemap search QUERY` — keyword search across symbol IDs / signatures / docs.
|
|
289
|
+
- `codemap get <symbol-id>` — fetch one symbol's definition site, doc, and a
|
|
290
|
+
source-line snippet. Exits 1 if not found, 64 (`EX_USAGE`) on malformed
|
|
291
|
+
SymbolID, 66 (`EX_NOINPUT`) when `.codemap/` is missing.
|
|
292
|
+
- `codemap callers <symbol-id> [-d N]` — every edge whose target matches the
|
|
293
|
+
given id (depth-limited).
|
|
294
|
+
- `codemap callees <symbol-id> [-d N]` — every edge whose source matches.
|
|
295
|
+
- `codemap trace --from <id> [--to <id>] [-d N]` — BFS downstream walk or
|
|
296
|
+
bidirectional shortest-path between two symbols, with rich-tree text output
|
|
297
|
+
and a structured JSON envelope.
|
|
298
|
+
- `codemap routes [--method M]` — list every HTTP route the `http_route`
|
|
299
|
+
bridge has registered, with handler `file:line` references.
|
|
300
|
+
- `codemap.core.graph` — depth-limited downstream `walk_chain` and
|
|
301
|
+
bidirectional `shortest_path` (capped per-side, so `-d N` finds paths up
|
|
302
|
+
to `2N` hops).
|
|
303
|
+
- All commands accept `--project / -p`, support `--json`, and use the same
|
|
304
|
+
exit-code conventions (ADR-005). 14 graph unit tests + 19 end-to-end CLI
|
|
305
|
+
tests cover the new surface. `docs/cli.md` documents every command and its
|
|
306
|
+
JSON shape.
|
|
307
|
+
|
|
308
|
+
### Added — Sprint M-1 — HTTP route bridge (2026-05-30)
|
|
309
|
+
|
|
310
|
+
- `codemap.core.bridge.http_route.HttpRouteBridge` — first cross-language
|
|
311
|
+
Bridge. Reads `Symbol.extra["http_route"]` (server-side) and
|
|
312
|
+
`Symbol.extra["http_calls"]` (client-side) metadata and emits
|
|
313
|
+
`Route` / `Alias` / `Edge` entries pivoting on a synthetic
|
|
314
|
+
`scip-route` intermediate symbol per `(method, path)`.
|
|
315
|
+
- Path-variable matching (`/user/{id}` ↔ `/user/42`), context-path
|
|
316
|
+
prefix joining (`context_path` + `path` → `full_path`), and query-string
|
|
317
|
+
stripping on the client URL.
|
|
318
|
+
- Diagnostics: `ROUTE001` for duplicate server handlers on the same route;
|
|
319
|
+
`ROUTE002` for high-confidence client calls with no matching server
|
|
320
|
+
route. Low-confidence (dynamic) client URLs do not warn.
|
|
321
|
+
- Tests: 21 unit cases (covering empty inputs, malformed metadata,
|
|
322
|
+
path-variable matching, cross-language aggregation, etc.) plus 1
|
|
323
|
+
integration test wiring the Bridge through a real `JsonStore` round
|
|
324
|
+
trip on disk. `docs/bridges/http_route.md` documents the metadata
|
|
325
|
+
contract and known limitations.
|
|
326
|
+
- Registered via `[project.entry-points."codemap.bridges"] http_route =
|
|
327
|
+
"codemap.core.bridge.http_route:HttpRouteBridge"` — on equal footing
|
|
328
|
+
with any third-party Bridge (ADR-004).
|
|
329
|
+
|
|
330
|
+
### Added — Sprint N-1 — Python indexer (2026-05-30)
|
|
331
|
+
|
|
332
|
+
- `codemap.indexers.python.PythonIndexer` — first real-language indexer.
|
|
333
|
+
Built on the stdlib `ast` module; produces `function` / `method` /
|
|
334
|
+
`class` / `field` / `variable` symbols and `calls` / `imports` /
|
|
335
|
+
`extends` edges. Diagnostics are isolated per file (syntax errors,
|
|
336
|
+
non-UTF-8 sources do not abort a run).
|
|
337
|
+
- SymbolID scheme `scip-python`; the file path is encoded as a chain of
|
|
338
|
+
`namespace` descriptors, matching the SCIP convention.
|
|
339
|
+
- 25 unit cases + 3 golden directory fixtures under
|
|
340
|
+
`tests/fixtures/indexers/python/`. Dogfood baseline on this repository:
|
|
341
|
+
48 files / 437 symbols / 1232 edges / 0 diagnostics.
|
|
342
|
+
- `docs/indexers/python.md` documents the resolution policy, the
|
|
343
|
+
confidence ladder, and known limitations.
|
|
344
|
+
|
|
345
|
+
### Changed
|
|
346
|
+
|
|
347
|
+
- `JsonStore` integrity check now treats only missing edge **sources** as
|
|
348
|
+
corruption; missing edge **targets** are normal (external library
|
|
349
|
+
references the indexer did not cover). Design doc §6.4 updated to
|
|
350
|
+
match.
|
|
351
|
+
|
|
352
|
+
### Added — Sprint 0 — Engineering scaffolding (2026-05-30)
|
|
353
|
+
|
|
354
|
+
- Project layout following ADR-003 (`core` / `io` / `indexers` / `cli` / `mcp` separation).
|
|
355
|
+
- `pyproject.toml` (Hatch backend) with quality-gate configuration: ruff, mypy strict, pytest, coverage, import-linter.
|
|
356
|
+
- `SymbolID` (SCIP format) with parse / `to_string` round-trip — ADR-001.
|
|
357
|
+
- Pydantic data models with `schema_version` enforcement — ADR-006.
|
|
358
|
+
- `SymbolStore` Protocol + JSON backend with atomic writes and file locking — ADR-002, ADR-008.
|
|
359
|
+
- `Indexer` / `Bridge` Protocols with entry_points registry — ADR-004.
|
|
360
|
+
- Typer CLI skeleton: `--version`, `--help`, `doctor`, `index`.
|
|
361
|
+
- Diagnostics: sysexits.h exit codes, structured logging — ADR-005.
|
|
362
|
+
- CI: GitHub Actions matrix (Python 3.11/3.12/3.13 × macOS/Linux), lint + type + test + build.
|
|
363
|
+
- ADRs 0001–0012 documenting Day-1 decisions (including ADR-L001 language neutrality).
|
|
364
|
+
- Reference indexer `_example_lang` to validate end-to-end pipeline.
|
|
365
|
+
|
|
366
|
+
[Unreleased]: https://github.com/qxbyte/codemap/compare/v0.0.0...HEAD
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Xue Qiang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|