local-codebase-indexer 0.8.0__tar.gz → 0.9.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.
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/AGENTS.md +18 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/CHANGELOG.md +30 -0
- local_codebase_indexer-0.9.1/CLAUDE.md +5 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/CONTRIBUTING.md +2 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/MANIFEST.in +1 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/PKG-INFO +33 -2
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/README.md +30 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/README.zh-CN.md +29 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/README.zh-TW.md +29 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/TODO.md +3 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/assets/demo-output.txt +3 -1
- local_codebase_indexer-0.9.1/assets/demo-preview.png +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/assets/demo-report.json +21 -3
- local_codebase_indexer-0.9.1/assets/demo.gif +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/README.md +16 -0
- local_codebase_indexer-0.9.1/benchmarks/compare_tools.py +296 -0
- local_codebase_indexer-0.9.1/benchmarks/navigation_task.json +11 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/queries_project.json +1 -1
- local_codebase_indexer-0.9.1/benchmarks/tool-comparison-queries.jsonl +96 -0
- local_codebase_indexer-0.9.1/benchmarks/tool-comparison.json +148 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/case-study.md +2 -1
- local_codebase_indexer-0.9.1/docs/comparison-evidence.json +54 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/reference.md +4 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/reference.zh-CN.md +4 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/reference.zh-TW.md +4 -0
- local_codebase_indexer-0.9.1/docs/sql-legacy-support.md +65 -0
- local_codebase_indexer-0.9.1/docs/tool-comparison.md +108 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/__init__.py +1 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/cli.py +10 -3
- local_codebase_indexer-0.9.1/local_codebase_indexer/context.py +96 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/core.py +5 -13
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/csdata.py +70 -11
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/dataflow.py +19 -11
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/db.py +5 -5
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/evaluation.py +4 -4
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/impact.py +20 -8
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/langparse.py +43 -26
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/locking.py +4 -5
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/mcp_server.py +13 -5
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/query.py +37 -542
- local_codebase_indexer-0.9.1/local_codebase_indexer/query_common.py +17 -0
- local_codebase_indexer-0.9.1/local_codebase_indexer/relations.py +182 -0
- local_codebase_indexer-0.9.1/local_codebase_indexer/rendering.py +273 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/scanner.py +33 -13
- local_codebase_indexer-0.9.1/local_codebase_indexer/sqlaccess.py +522 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/synonyms.py +3 -1
- local_codebase_indexer-0.9.1/local_codebase_indexer/textdecode.py +42 -0
- local_codebase_indexer-0.9.1/local_codebase_indexer/vbdata.py +194 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/PKG-INFO +33 -2
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/SOURCES.txt +17 -2
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/requires.txt +2 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/pyproject.toml +12 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/scripts/render_demo.py +9 -4
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/server.json +2 -2
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_navigation_stability.py +41 -0
- local_codebase_indexer-0.9.1/tests/test_provenance_boundaries.py +220 -0
- local_codebase_indexer-0.9.1/tests/test_sql_regressions.py +295 -0
- local_codebase_indexer-0.9.1/tests/test_tool_comparison.py +69 -0
- local_codebase_indexer-0.8.0/CLAUDE.md +0 -58
- local_codebase_indexer-0.8.0/assets/demo-preview.png +0 -0
- local_codebase_indexer-0.8.0/assets/demo.gif +0 -0
- local_codebase_indexer-0.8.0/local_codebase_indexer/sqlaccess.py +0 -301
- local_codebase_indexer-0.8.0/requirements.txt +0 -10
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/.claude-plugin/marketplace.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/LICENSE +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/baseline.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Auth/LoginService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Controllers/LotController.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Controllers/ScrapController.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Data/MesDbContext.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Legacy/frmChangeLine.frm +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Models/DrillBreakEvent.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Models/Lot.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Models/ScrapRecord.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Printing/LabelPrinter.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Repositories/LotRepository.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Repositories/ScrapRepository.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Services/IScrapService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Services/InspectionService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Services/LotService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Services/ScrapService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Sql/MES_Lot.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Sql/usp_Inspection_Report.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Sql/usp_Lot_UpdateStatus.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Sql/usp_Scrap_Insert.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Utils/DateRangeHelper.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Utils/PartNumberDecoder.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Web/scrapForm.ts +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/Web.config +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/corpus/tools/export_report.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/queries_stdlib.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/queries_synthetic.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/benchmarks/run_benchmark.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/bin/indexer +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/discovery.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/launch/community.en.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/launch/community.zh-TW.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/docs/launch/directory-entry.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/index.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/llms.txt +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/__main__.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/callgraph.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/cscalls.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo.py +2 -2
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Controllers/OrdersController.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Data/OrderRepository.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Models/Order.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/README.md +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Services/IOrderService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Services/OrderService.cs +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Sql/Sales_OrderHeader.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Sql/usp_ApproveOrder.sql +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/demo_project/Views/Orders/Details.cshtml +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/embedder.py +1 -1
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer/pagination.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/dependency_links.txt +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/entry_points.txt +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/local_codebase_indexer.egg-info/top_level.txt +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/plugins/local-codebase-indexer/.claude-plugin/plugin.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/plugins/local-codebase-indexer/.mcp.json +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/scripts/release_assets.py +3 -3
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/setup.cfg +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_dataaccess.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_demo.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_evaluation.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_indexer.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_onnx_plumbing.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_release_assets.py +0 -0
- {local_codebase_indexer-0.8.0 → local_codebase_indexer-0.9.1}/tests/test_reliability.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Instructions for AI coding assistants
|
|
2
2
|
|
|
3
|
-
This repository is **local-codebase-indexer**: a local code index (SQLite, no cloud) that you can use as an MCP server or CLI to find code, callers, and SQL table/stored-procedure access with
|
|
3
|
+
This repository is **local-codebase-indexer**: a local code index (SQLite, no cloud) that you can use as an MCP server or CLI to find code, callers, and SQL table/stored-procedure access with source locations, confidence labels, and bounded context.
|
|
4
4
|
|
|
5
5
|
## Install (pick one)
|
|
6
6
|
|
|
@@ -77,3 +77,20 @@ The package is `local_codebase_indexer/`. See `docs/reference.md` for design not
|
|
|
77
77
|
## First-run demo (0.8.0)
|
|
78
78
|
|
|
79
79
|
Run `local-codebase-indexer demo` without a database or model. It uses a temporary bundled synthetic project, checks four relationships, and leaves the current project alone. `--output <new-or-empty-directory>` keeps a copy; `--json` returns evidence and timings. This is a supported-path demonstration, not a production accuracy or time-savings measurement.
|
|
80
|
+
|
|
81
|
+
## SQL and legacy-source correctness (0.9.0)
|
|
82
|
+
|
|
83
|
+
- Run `python -m ruff check local_codebase_indexer scripts benchmarks/compare_tools.py`, `python -m mypy`, and the full pytest suite before publishing. CI covers Linux and Windows on Python 3.10, 3.12, and 3.13.
|
|
84
|
+
- Dependency declarations live in `pyproject.toml`; `requirements.txt` was removed to avoid drift.
|
|
85
|
+
- Source decoding and context extraction handle BOM-tagged UTF-16/UTF-32. True binary files are excluded consistently by scanning and status.
|
|
86
|
+
- `data-access` has additive `schema_changes` entries (`access=schema`) for table/index DDL. They are not row writers. File-level SQL changes appear in impact with before/current/after labels and source evidence.
|
|
87
|
+
- VB6 `.frm`/`.bas`/`.cls` SQL strings get procedure owners. Complete SQL at known ADO/DAO receivers may be confirmed; unknown receivers or incomplete concatenation remain probable/uncertain. No VB6 call graph or runtime execution proof is implied.
|
|
88
|
+
- Explicit negations in `.ai_context/ignore` can include default source directories such as `!bin/` and `!bin/**`, overriding `.gitignore`. Include excluded parents first. `.git`, `.svn`, `.hg`, and `.ai_context` remain excluded.
|
|
89
|
+
- Keep `query.py` as the facade/search implementation; navigation, source context, and rendering live in `relations.py`, `context.py`, and `rendering.py`. Legacy public imports from `query` remain supported.
|
|
90
|
+
|
|
91
|
+
## SQL provenance and tool comparison (0.9.1)
|
|
92
|
+
|
|
93
|
+
- SQL statement/batch boundaries and lexical bindings must not manufacture confirmed access from unrelated literals or shadowed parameters. Keep regression coverage in `tests/test_provenance_boundaries.py`.
|
|
94
|
+
- SQL object definitions come only from SQL sources; application symbol navigation still includes Python/JS functions.
|
|
95
|
+
- Index format 10 invalidates older parsed edges and rebuilds them on the first update. Keep package and Registry versions synchronized when preparing a release.
|
|
96
|
+
- Tool comparisons live in `docs/tool-comparison.md`; keep language READMEs in sync, cite upstream capabilities, and distinguish a literal-search baseline from a full Claude workflow. Do not claim measured speed/token/accuracy superiority without a corresponding experiment.
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.9.1
|
|
6
|
+
|
|
7
|
+
- Bound dynamic `sp_executesql` analysis to its SQL argument and statement; preserve uncertainty for quoted procedure names and exclude unrelated literals/column names.
|
|
8
|
+
- Scope CTE exclusions to one consuming statement/batch, including omitted semicolons and UNION/INSERT SELECT and stop UPDATE/DELETE alias lookup at the next command, including commands without semicolons.
|
|
9
|
+
- Preserve comma sources following JOIN predicates that use qualified `go` columns; recognize GO only as a batch separator line.
|
|
10
|
+
- Restrict SQL object definitions/suggestions to SQL source files so application functions do not become tables/procedures or redirect SQL search routing.
|
|
11
|
+
- Respect C#/VB6 parameter and local shadowing, invalidate overwritten SQL, and avoid interpreting query parameters as SQL. Preserve earlier valid execution evidence and known ADO declarations.
|
|
12
|
+
- Add English/Traditional Chinese/Simplified Chinese tool comparisons with documented trade-offs, pinned upstream sources, and a reproducible literal-search/relation-report example.
|
|
13
|
+
- Quantify those comparisons with a reproducible ripgrep + BM25 baseline, unchanged retrieval questions, raw per-query records, file-level recall/MRR, exact character denominators, and CLI evidence coverage/latency. Show stdlib losses and tiny-file output overhead alongside MES gains in all three READMEs. Add benchmark protocol regression tests and a CI artifact smoke run.
|
|
14
|
+
- Index format 10 rebuilds stale parsing results on the first update. Package and Registry versions remain unchanged until a release is prepared.
|
|
15
|
+
|
|
16
|
+
## 0.9.0
|
|
17
|
+
|
|
18
|
+
- Fix a first-run Windows lock-file initialization race found by concurrent-process CI; serialize index ignore-file creation.
|
|
19
|
+
|
|
20
|
+
- Fix SQL aliases `a` / `an` / `the`, parameterized TOP, UPDATE table hints, old NOLOCK hints, and comma sources after JOIN predicates.
|
|
21
|
+
- Preserve bracketed/quoted identifiers and linked-server names, including spaces, backslashes, escaped delimiters, and quoted dots. Ignore keywords inside identifiers and nested block comments.
|
|
22
|
+
- Exclude cursor FETCH and scalar TRIM FROM operands from table reads; analyze literal OPENQUERY SQL as uncertain.
|
|
23
|
+
- Decode BOM-tagged UTF-16/UTF-32 before binary detection; make source context and freshness diagnostics consistent. True binary files no longer remain pending forever.
|
|
24
|
+
- Attribute constant C# SQL to each executing method without sharing same-named constants across unrelated classes.
|
|
25
|
+
- Add conservative VB6 SQL analysis for .frm/.bas/.cls, with enclosing method owners and explicit confidence levels.
|
|
26
|
+
- Track table/index schema operations separately from row writes; include file-level SQL and before/after source evidence in Git impact.
|
|
27
|
+
- Allow explicit project-ignore negations to include default build/dependency-named source directories, preserving hard exclusions for VCS and index state.
|
|
28
|
+
- Split relation, context, and rendering code out of the query facade while preserving public imports and commands.
|
|
29
|
+
- Clear the existing mypy errors; add Ruff/mypy CI and release gates; test Windows and Linux on Python 3.10, 3.12, and 3.13.
|
|
30
|
+
- Canonical assistant instructions live in AGENTS.md; CLAUDE.md points there. Remove duplicate requirements.txt dependency declarations.
|
|
31
|
+
- Index format 9 triggers one full rebuild after upgrade. See docs/sql-legacy-support.md for supported patterns and limitations.
|
|
32
|
+
|
|
3
33
|
## 0.8.0
|
|
4
34
|
|
|
5
35
|
- MIT license and SPDX package metadata.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Instructions for Claude
|
|
2
|
+
|
|
3
|
+
Read and follow [AGENTS.md](AGENTS.md) before working on this repository. It is the canonical source for development checks, all seven MCP tools (including `codebase_index_doctor`), CLI usage, confidence labels, and release validation.
|
|
4
|
+
|
|
5
|
+
Installation dependencies are declared in `pyproject.toml`. Use `python -m pip install -e ".[dev,onnx]" onnx` for development.
|
|
@@ -8,6 +8,8 @@ Use Python 3.10+ in a virtual environment:
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
python -m pip install -e ".[dev,onnx]" onnx build twine
|
|
11
|
+
python -m ruff check local_codebase_indexer scripts benchmarks/compare_tools.py
|
|
12
|
+
python -m mypy
|
|
11
13
|
python -m pytest -q
|
|
12
14
|
python -m build
|
|
13
15
|
python -m twine check dist/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: local-codebase-indexer
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.1
|
|
4
4
|
Summary: Trace SQL Server tables to C# callers and Razor pages locally. MCP server and CLI for code search and change impact.
|
|
5
5
|
Author: sfy257000
|
|
6
6
|
License-Expression: MIT
|
|
@@ -36,13 +36,15 @@ Requires-Dist: onnxruntime; extra == "onnx"
|
|
|
36
36
|
Requires-Dist: tokenizers; extra == "onnx"
|
|
37
37
|
Provides-Extra: dev
|
|
38
38
|
Requires-Dist: pytest; extra == "dev"
|
|
39
|
+
Requires-Dist: ruff>=0.9; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.14; extra == "dev"
|
|
39
41
|
Provides-Extra: media
|
|
40
42
|
Requires-Dist: Pillow>=10; extra == "media"
|
|
41
43
|
Dynamic: license-file
|
|
42
44
|
|
|
43
45
|
# Local Codebase Indexer
|
|
44
46
|
|
|
45
|
-
**English** | [繁體中文](
|
|
47
|
+
**English** | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
|
|
46
48
|
|
|
47
49
|
**Which C# code and pages reach this SQL Server table?**
|
|
48
50
|
|
|
@@ -52,6 +54,33 @@ Trace tables and stored procedures to repositories, controller actions, and Razo
|
|
|
52
54
|
|
|
53
55
|
[Case study and raw results](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/case-study.md) · [CLI reference](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/reference.md) · [PyPI](https://pypi.org/project/local-codebase-indexer/) · [MIT license](https://github.com/sfy257000/local-codebase-indexer/blob/main/LICENSE)
|
|
54
56
|
|
|
57
|
+
## How it compares with Claude's Grep and similar tools
|
|
58
|
+
|
|
59
|
+
**Measured on our MES fixtures: +9.5–10.7 percentage points in relevant-file recall versus `rg + BM25`.** For the bundled SQL → C# → page investigation, the relation report covers **5/5 required evidence files**, versus **3/5** from one literal table-name search (**+40 points**).
|
|
60
|
+
|
|
61
|
+
| Fixed retrieval suite | `rg + BM25` file Recall@5 | This project | Difference |
|
|
62
|
+
|---|---:|---:|---:|
|
|
63
|
+
| MES-style synthetic: 42 questions, 24 files | 81.0% | **91.7%** | **+10.7 pp** |
|
|
64
|
+
| Same 42 questions with distractors: 109 files | 81.0% | **90.5%** | **+9.5 pp** |
|
|
65
|
+
| Python stdlib: 12 questions, 85 real source files | **100.0%** | 79.2% | −20.8 pp |
|
|
66
|
+
|
|
67
|
+
Recall means the fraction of known relevant files retrieved, averaged over questions. The baseline runs real ripgrep with generic query-term splitting and BM25 ranking; it is not Claude's agent. This project uses default hashing and 5 result chunks; the baseline returns 5 files. Both are scored at file level. These are 54 unique, project-authored questions (96 executions including the repeated noisy suite), not a general accuracy guarantee.
|
|
68
|
+
|
|
69
|
+
**Less source to read:** on the noisy MES and stdlib suites, rendered search results contain **94.9% / 96.9% fewer characters** than reading the same selected files in full. Tiny synthetic files instead produce **2.3% more** characters. This measures output size against whole-file reading, not savings against Grep snippets or Claude tokens.
|
|
70
|
+
|
|
71
|
+
**Cost of the richer report:** the demo CLI takes **244.5 ms** warm versus **8.3 ms** for one literal `rg` call (three-run medians; first indexer call **266.1 ms** including indexing). It adds controller/page evidence, not a speed win. The controller path is `probable`, not runtime proof. No end-to-end Claude, Serena, or Claude Context measurement was made. [Protocol and reproduction](docs/tool-comparison.md) · [machine/environment and summary](benchmarks/tool-comparison.json) · [all 96 query records](benchmarks/tool-comparison-queries.jsonl).
|
|
72
|
+
|
|
73
|
+
**The extra value is an indexed SQL → C# → page relation report.** For supported patterns, one `data-access` query returns direct/procedure-mediated access, controller actions, page links, and confidence labels. Claude can also follow these links through multiple Grep searches and file reads; this tool packages that investigation into a repeatable CLI/MCP result.
|
|
74
|
+
|
|
75
|
+
| Tool / workflow | Strong fit | Trade-off and where this project helps |
|
|
76
|
+
|---|---|---|
|
|
77
|
+
| Claude + Grep / ripgrep | Exact identifiers, strings, and regex; no index setup | Keep it for direct text checks. This project's SQL/call/page relations go beyond the literal table-name matches. |
|
|
78
|
+
| [Serena](https://github.com/oraios/serena) with LSP / JetBrains | Backend-driven symbols, references, and editing/refactoring | Prefer compiler/IDE semantics for accurate renames and overloads. This project provides a focused SQL maintenance report without a language-server backend. |
|
|
79
|
+
| [Claude Context](https://github.com/zilliztech/claude-context) | Natural-language hybrid BM25 + dense-vector retrieval | Its documented setup uses an embedding provider and Milvus/Zilliz configuration; local providers are supported. This project's default needs no embedding API or vector server, but identifier-oriented hashing can miss paraphrases. |
|
|
80
|
+
| Local Codebase Indexer | SQL Server table/procedure → C# accessors → actions/pages; schema and Git impact | Approximate static analysis with visible confidence; no Roslyn overload resolution or semantic rename. |
|
|
81
|
+
|
|
82
|
+
The controller and Razor page in the demo contain no literal table name; the relation report reaches them through the stored procedure and C# calls. All **4 built-in relationship checks pass**. See [source evidence and upstream feature references](docs/tool-comparison.md).
|
|
83
|
+
|
|
55
84
|
## Try it in three steps
|
|
56
85
|
|
|
57
86
|
Python **3.10+**. Run these in a virtual environment; no SQL Server, .NET runtime, model download, or API key is needed for the demo.
|
|
@@ -127,4 +156,6 @@ Relations show callers; impact compares Git snapshots; search combines identifie
|
|
|
127
156
|
|
|
128
157
|
Found a wrong edge or missing result? Open a [reproducible issue](https://github.com/sfy257000/local-codebase-indexer/issues/new/choose). [Contributions](https://github.com/sfy257000/local-codebase-indexer/blob/main/CONTRIBUTING.md) are welcome. Licensed under [MIT](https://github.com/sfy257000/local-codebase-indexer/blob/main/LICENSE).
|
|
129
158
|
|
|
159
|
+
[SQL / Unicode / VB6 support and upgrade notes](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/sql-legacy-support.md)
|
|
160
|
+
|
|
130
161
|
<!-- mcp-name: io.github.sfy257000/local-codebase-indexer -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Local Codebase Indexer
|
|
2
2
|
|
|
3
|
-
**English** | [繁體中文](
|
|
3
|
+
**English** | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
**Which C# code and pages reach this SQL Server table?**
|
|
6
6
|
|
|
@@ -10,6 +10,33 @@ Trace tables and stored procedures to repositories, controller actions, and Razo
|
|
|
10
10
|
|
|
11
11
|
[Case study and raw results](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/case-study.md) · [CLI reference](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/reference.md) · [PyPI](https://pypi.org/project/local-codebase-indexer/) · [MIT license](https://github.com/sfy257000/local-codebase-indexer/blob/main/LICENSE)
|
|
12
12
|
|
|
13
|
+
## How it compares with Claude's Grep and similar tools
|
|
14
|
+
|
|
15
|
+
**Measured on our MES fixtures: +9.5–10.7 percentage points in relevant-file recall versus `rg + BM25`.** For the bundled SQL → C# → page investigation, the relation report covers **5/5 required evidence files**, versus **3/5** from one literal table-name search (**+40 points**).
|
|
16
|
+
|
|
17
|
+
| Fixed retrieval suite | `rg + BM25` file Recall@5 | This project | Difference |
|
|
18
|
+
|---|---:|---:|---:|
|
|
19
|
+
| MES-style synthetic: 42 questions, 24 files | 81.0% | **91.7%** | **+10.7 pp** |
|
|
20
|
+
| Same 42 questions with distractors: 109 files | 81.0% | **90.5%** | **+9.5 pp** |
|
|
21
|
+
| Python stdlib: 12 questions, 85 real source files | **100.0%** | 79.2% | −20.8 pp |
|
|
22
|
+
|
|
23
|
+
Recall means the fraction of known relevant files retrieved, averaged over questions. The baseline runs real ripgrep with generic query-term splitting and BM25 ranking; it is not Claude's agent. This project uses default hashing and 5 result chunks; the baseline returns 5 files. Both are scored at file level. These are 54 unique, project-authored questions (96 executions including the repeated noisy suite), not a general accuracy guarantee.
|
|
24
|
+
|
|
25
|
+
**Less source to read:** on the noisy MES and stdlib suites, rendered search results contain **94.9% / 96.9% fewer characters** than reading the same selected files in full. Tiny synthetic files instead produce **2.3% more** characters. This measures output size against whole-file reading, not savings against Grep snippets or Claude tokens.
|
|
26
|
+
|
|
27
|
+
**Cost of the richer report:** the demo CLI takes **244.5 ms** warm versus **8.3 ms** for one literal `rg` call (three-run medians; first indexer call **266.1 ms** including indexing). It adds controller/page evidence, not a speed win. The controller path is `probable`, not runtime proof. No end-to-end Claude, Serena, or Claude Context measurement was made. [Protocol and reproduction](docs/tool-comparison.md) · [machine/environment and summary](benchmarks/tool-comparison.json) · [all 96 query records](benchmarks/tool-comparison-queries.jsonl).
|
|
28
|
+
|
|
29
|
+
**The extra value is an indexed SQL → C# → page relation report.** For supported patterns, one `data-access` query returns direct/procedure-mediated access, controller actions, page links, and confidence labels. Claude can also follow these links through multiple Grep searches and file reads; this tool packages that investigation into a repeatable CLI/MCP result.
|
|
30
|
+
|
|
31
|
+
| Tool / workflow | Strong fit | Trade-off and where this project helps |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Claude + Grep / ripgrep | Exact identifiers, strings, and regex; no index setup | Keep it for direct text checks. This project's SQL/call/page relations go beyond the literal table-name matches. |
|
|
34
|
+
| [Serena](https://github.com/oraios/serena) with LSP / JetBrains | Backend-driven symbols, references, and editing/refactoring | Prefer compiler/IDE semantics for accurate renames and overloads. This project provides a focused SQL maintenance report without a language-server backend. |
|
|
35
|
+
| [Claude Context](https://github.com/zilliztech/claude-context) | Natural-language hybrid BM25 + dense-vector retrieval | Its documented setup uses an embedding provider and Milvus/Zilliz configuration; local providers are supported. This project's default needs no embedding API or vector server, but identifier-oriented hashing can miss paraphrases. |
|
|
36
|
+
| Local Codebase Indexer | SQL Server table/procedure → C# accessors → actions/pages; schema and Git impact | Approximate static analysis with visible confidence; no Roslyn overload resolution or semantic rename. |
|
|
37
|
+
|
|
38
|
+
The controller and Razor page in the demo contain no literal table name; the relation report reaches them through the stored procedure and C# calls. All **4 built-in relationship checks pass**. See [source evidence and upstream feature references](docs/tool-comparison.md).
|
|
39
|
+
|
|
13
40
|
## Try it in three steps
|
|
14
41
|
|
|
15
42
|
Python **3.10+**. Run these in a virtual environment; no SQL Server, .NET runtime, model download, or API key is needed for the demo.
|
|
@@ -85,4 +112,6 @@ Relations show callers; impact compares Git snapshots; search combines identifie
|
|
|
85
112
|
|
|
86
113
|
Found a wrong edge or missing result? Open a [reproducible issue](https://github.com/sfy257000/local-codebase-indexer/issues/new/choose). [Contributions](https://github.com/sfy257000/local-codebase-indexer/blob/main/CONTRIBUTING.md) are welcome. Licensed under [MIT](https://github.com/sfy257000/local-codebase-indexer/blob/main/LICENSE).
|
|
87
114
|
|
|
115
|
+
[SQL / Unicode / VB6 support and upgrade notes](https://github.com/sfy257000/local-codebase-indexer/blob/main/docs/sql-legacy-support.md)
|
|
116
|
+
|
|
88
117
|
<!-- mcp-name: io.github.sfy257000/local-codebase-indexer -->
|
|
@@ -10,6 +10,33 @@
|
|
|
10
10
|
|
|
11
11
|
[可复现案例及完整输出](docs/case-study.md) · [进阶手册](docs/reference.zh-CN.md) · [PyPI](https://pypi.org/project/local-codebase-indexer/) · [MIT 许可](LICENSE)
|
|
12
12
|
|
|
13
|
+
## 与 Claude 的 Grep 及类似工具比较
|
|
14
|
+
|
|
15
|
+
**在本项目的 MES 测试集,相关文件召回率比 `rg + BM25` 高 9.5~10.7 个百分点。** 内置 SQL → C# → 页面调查场景中,关系报告覆盖 **5/5 个必要证据文件**,单次表名字面搜索为 **3/5**,覆盖率 **60% → 100%(+40 个百分点)**。
|
|
16
|
+
|
|
17
|
+
| 固定搜索测试集 | `rg + BM25` 文件 Recall@5 | 本项目 | 差异 |
|
|
18
|
+
|---|---:|---:|---:|
|
|
19
|
+
| MES 风格合成数据:42 题、24 个文件 | 81.0% | **91.7%** | **+10.7 个百分点** |
|
|
20
|
+
| 相同 42 题加入干扰来源:109 个文件 | 81.0% | **90.5%** | **+9.5 个百分点** |
|
|
21
|
+
| Python 标准库:12 题、85 个真实源代码文件 | **100.0%** | 79.2% | −20.8 个百分点 |
|
|
22
|
+
|
|
23
|
+
召回率是每题找回的已知相关文件比例,再取平均。基准实际运行 ripgrep,以通用查询拆词及 BM25 排序,并非 Claude agent。本项目使用默认 hashing、取 5 个结果块;基准取 5 个文件,双方都按文件评分。共 54 个由本项目编写的不同题目(含重跑干扰集共 96 次),不代表通用准确率保证。
|
|
24
|
+
|
|
25
|
+
**减少需要阅读的源代码:** 在含干扰的 MES 与标准库测试集,搜索结果文本比“完整读取同一批选中文件”少 **94.9%/96.9% 字符**;极小的合成文件反而多 **2.3%**。这是相对于整文件读取的输出大小,并非相对 Grep 片段或 Claude token 的节省量。
|
|
26
|
+
|
|
27
|
+
**较完整报告的成本:** demo CLI 暖查询 **244.5 ms**,单次字面 `rg` 为 **8.3 ms**(各测量 3 次取中位数;本项目首次查询含建索引为 **266.1 ms**)。提升在于多追到 Controller/页面;速度较慢。Controller 路径标为 `probable`,不代表运行时证明。尚未测量完整 Claude、Serena 或 Claude Context 流程。[方法与重跑命令](docs/tool-comparison.md) · [机器环境与汇总数据](benchmarks/tool-comparison.json) · [全部 96 条逐题记录](benchmarks/tool-comparison-queries.jsonl)。
|
|
28
|
+
|
|
29
|
+
**这个项目多提供的是 SQL → C# → 页面的索引关系报告。** 在支持的代码模式中,一次 `data-access` 查询就能列出直接/通过存储过程的访问、Controller Action、页面与置信度标签。Claude 也能通过多轮 Grep 和读文件追踪关系;该工具将这段调查整理成可重复执行的 CLI/MCP 结果。
|
|
30
|
+
|
|
31
|
+
| 工具/流程 | 适合用途 | 取舍与本项目的用途 |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Claude+Grep/ripgrep | 精确标识符、字符串和正则表达式,无需建立索引 | 直接核对文本仍优先使用。该项目另提供字面表名以外的 SQL/调用/页面关系。 |
|
|
34
|
+
| [Serena](https://github.com/oraios/serena)+LSP/JetBrains | 后端提供的符号、引用和编辑/重构 | 精确 rename、重载解析优先使用编译器/IDE 语义。本项目聚焦 SQL 维护报告,无需配置语言服务器。 |
|
|
35
|
+
| [Claude Context](https://github.com/zilliztech/claude-context) | 自然语言的 BM25+dense vector 混合搜索 | 官方配置包含 embedding provider 和 Milvus/Zilliz,也支持本地 provider。本项目默认无需 embedding API 或向量服务器,但 hashing 仍可能遗漏自然语言改写。 |
|
|
36
|
+
| Local Codebase Indexer | SQL Server 表/存储过程 → C# 访问者 → Action/页面,以及 schema、Git impact | 带有置信度标签的近似静态分析,没有 Roslyn 重载解析或语义 rename。 |
|
|
37
|
+
|
|
38
|
+
示例的 Controller 和 Razor 页面不含该表名字符串;关系报告通过存储过程和 C# 调用追踪到它们,**4 项内置关系检查通过**。[源代码证据与上游功能资料](docs/tool-comparison.md)。
|
|
39
|
+
|
|
13
40
|
## 三步开始
|
|
14
41
|
|
|
15
42
|
需要 **Python 3.10+**,建议在虚拟环境执行。内置 demo 不需要 SQL Server、.NET 运行环境、模型下载或 API key。
|
|
@@ -84,3 +111,5 @@ local-codebase-indexer --root "/path/to/project" doctor
|
|
|
84
111
|
- 先选一张已知用途的数据表核对结果。遗漏文件时运行 `doctor --path path/to/file.cs`,检查 `.gitignore` 和 `.ai_context/ignore`。更多[限制](docs/reference.zh-CN.md)与[待办](TODO.md)可查手册。
|
|
85
112
|
|
|
86
113
|
发现错误关系或漏查,请附最小示例[提交 issue](https://github.com/sfy257000/local-codebase-indexer/issues/new/choose)。欢迎[贡献](CONTRIBUTING.md)。采用 [MIT 许可](LICENSE)。
|
|
114
|
+
|
|
115
|
+
[SQL/Unicode/VB6 支援與升級說明](docs/sql-legacy-support.md)
|
|
@@ -10,6 +10,33 @@
|
|
|
10
10
|
|
|
11
11
|
[可重現案例與完整輸出](docs/case-study.md) · [進階手冊](docs/reference.zh-TW.md) · [PyPI](https://pypi.org/project/local-codebase-indexer/) · [MIT 授權](LICENSE)
|
|
12
12
|
|
|
13
|
+
## 與 Claude 的 Grep 及類似工具比較
|
|
14
|
+
|
|
15
|
+
**在本專案的 MES 測試集,相關檔案召回率比 `rg + BM25` 高 9.5~10.7 個百分點。** 內建 SQL → C# → 頁面調查情境中,關係報告涵蓋 **5/5 個必要證據檔案**,單次表名字面搜尋為 **3/5**,涵蓋率 **60% → 100%(+40 個百分點)**。
|
|
16
|
+
|
|
17
|
+
| 固定搜尋測試集 | `rg + BM25` 檔案 Recall@5 | 本專案 | 差異 |
|
|
18
|
+
|---|---:|---:|---:|
|
|
19
|
+
| MES 風格合成資料:42 題、24 個檔案 | 81.0% | **91.7%** | **+10.7 個百分點** |
|
|
20
|
+
| 相同 42 題加入干擾來源:109 個檔案 | 81.0% | **90.5%** | **+9.5 個百分點** |
|
|
21
|
+
| Python 標準函式庫:12 題、85 個真實原始碼檔案 | **100.0%** | 79.2% | −20.8 個百分點 |
|
|
22
|
+
|
|
23
|
+
召回率是每題找回的已知相關檔案比例,再取平均。基準實際執行 ripgrep,以通用查詢拆詞及 BM25 排序,並非 Claude agent。本專案使用預設 hashing、取 5 個結果區塊;基準取 5 個檔案,雙方都以檔案計分。共 54 個由本專案編寫的不同題目(含重跑干擾集共 96 次),不代表通用準確率保證。
|
|
24
|
+
|
|
25
|
+
**減少需要閱讀的原始碼:** 在含干擾的 MES 與標準函式庫測試集,搜尋結果文字比「完整讀取同一批選中檔案」少 **94.9%/96.9% 字元**;極小的合成檔案反而多 **2.3%**。這是相對於整檔讀取的輸出大小,並非相對 Grep 摘錄或 Claude token 的節省量。
|
|
26
|
+
|
|
27
|
+
**較完整報告的成本:** demo CLI 暖查詢 **244.5 ms**,單次字面 `rg` 為 **8.3 ms**(各量測 3 次取中位數;本專案首次查詢含建索引為 **266.1 ms**)。提升在於多追到 Controller/頁面;速度較慢。Controller 路徑標為 `probable`,不代表執行期證明。尚未量測完整 Claude、Serena 或 Claude Context 流程。[方法與重跑命令](docs/tool-comparison.md) · [機器環境與彙總數據](benchmarks/tool-comparison.json) · [全部 96 筆逐題紀錄](benchmarks/tool-comparison-queries.jsonl)。
|
|
28
|
+
|
|
29
|
+
**這個專案多提供的是 SQL → C# → 頁面的索引關係報告。** 在支援的程式模式中,一次 `data-access` 查詢就能列出直接/透過預存程序的存取、Controller Action、頁面與信心標籤。Claude 也能透過多輪 Grep 與讀檔追出關係;此工具把這段調查整理成可重複執行的 CLI/MCP 結果。
|
|
30
|
+
|
|
31
|
+
| 工具/流程 | 適合用途 | 取捨與本專案的用途 |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Claude+Grep/ripgrep | 精確識別字、字串與正規表示式,不需建索引 | 直接核對文字仍優先使用。此專案另提供字面資料表名稱以外的 SQL/呼叫/頁面關係。 |
|
|
34
|
+
| [Serena](https://github.com/oraios/serena)+LSP/JetBrains | 後端提供的符號、引用與編輯/重構 | 精確 rename、多載解析優先使用編譯器/IDE 語意。本專案聚焦 SQL 維護報告,不需設定語言伺服器。 |
|
|
35
|
+
| [Claude Context](https://github.com/zilliztech/claude-context) | 自然語言的 BM25+dense vector 混合搜尋 | 官方設定含 embedding provider 與 Milvus/Zilliz,也支援本機 provider。本專案預設不需 embedding API 或向量伺服器,但 hashing 仍可能漏掉自然語言改寫。 |
|
|
36
|
+
| Local Codebase Indexer | SQL Server 表/預存程序 → C# 存取者 → Action/頁面,以及 schema、Git impact | 帶有信心標籤的近似靜態分析,沒有 Roslyn 多載解析或語意 rename。 |
|
|
37
|
+
|
|
38
|
+
範例的 Controller 與 Razor 頁面沒有該表名字串;關係報告透過預存程序與 C# 呼叫追到它們,**4 項內建關係檢查通過**。[原始碼證據與上游功能資料](docs/tool-comparison.md)。
|
|
39
|
+
|
|
13
40
|
## 三步開始
|
|
14
41
|
|
|
15
42
|
需要 **Python 3.10+**,建議在虛擬環境執行。內建 demo 不需要 SQL Server、.NET 執行環境、模型下載或 API key。
|
|
@@ -84,3 +111,5 @@ local-codebase-indexer --root "/path/to/project" doctor
|
|
|
84
111
|
- 先選一張已知用途的資料表核對結果。漏掉檔案時執行 `doctor --path path/to/file.cs`,檢查 `.gitignore` 與 `.ai_context/ignore`。更多[限制](docs/reference.zh-TW.md)與[待辦](TODO.md)可查手冊。
|
|
85
112
|
|
|
86
113
|
發現錯誤關係或漏查,請附最小範例[回報 issue](https://github.com/sfy257000/local-codebase-indexer/issues/new/choose)。歡迎[貢獻](CONTRIBUTING.md)。採用 [MIT 授權](LICENSE)。
|
|
114
|
+
|
|
115
|
+
[SQL/Unicode/VB6 支援與升級說明](docs/sql-legacy-support.md)
|
|
@@ -5,7 +5,7 @@ Priorities come from the benchmark (`benchmarks/run_benchmark.py`, baseline in `
|
|
|
5
5
|
## Next
|
|
6
6
|
|
|
7
7
|
0. **MCP Registry discovery**: the 0.8.0 release workflow publishes `server.json` after PyPI succeeds, using GitHub OIDC. Verify the live entry after each release; a local manifest alone does not establish publication. See [discovery instructions](docs/discovery.md).
|
|
8
|
-
1. **
|
|
8
|
+
1. **Remaining data-flow gaps**: non-sink SQL proc-name literals (`Run("usp_X")`), EF `this.ToTable(..)` inside `EntityTypeConfiguration<T>` (entity not taken from the base class yet), and EF updates through tracked entities when the entity was loaded in another method than the one calling `SaveChanges` (only same-method read + `SaveChanges` is listed, as uncertain).
|
|
9
9
|
2. **C# call graph gaps**: overload resolution by argument type, delegates / lambdas / extension methods, call chains longer than one level. Without Roslyn these stay approximate; edges carry `confirmed` / `probable` / `candidate`.
|
|
10
10
|
|
|
11
11
|
## Deferred (not worth doing yet)
|
|
@@ -22,6 +22,8 @@ Priorities come from the benchmark (`benchmarks/run_benchmark.py`, baseline in `
|
|
|
22
22
|
|
|
23
23
|
## Done
|
|
24
24
|
|
|
25
|
+
- 0.9.0: SQL alias/hint/TOP and quoted-name fixes; cursor/TRIM false-positive removal; nested comments and uncertain OPENQUERY analysis; comma sources after JOIN; BOM-aware Unicode source/context handling; constant SQL method attribution; VB6 SQL analysis; separate DDL/schema impact; explicit ignore overrides; modular navigation/context/rendering; lint/mypy CI and Windows Python 3.10/3.12/3.13.
|
|
26
|
+
|
|
25
27
|
- 0.7.0: revision-bound search cursors; historical target snapshots; model content identities; process coordination and crash recovery; focus-preserving context; synonym hot reload; retrieval explanations; project evaluation runner; automatic validated Release assets. Representative user-authored evaluation questions and broader semantic retrieval remain ongoing work.
|
|
26
28
|
|
|
27
29
|
- 0.6.0: complete before/after impact analysis with cached historical indexes; resilient MCP input validation; nested ignore negations; root validation; doctor diagnostics; bounded and filtered search; confidence-filtered data-access pagination with no hidden full-output caps; general paraphrases; mandatory ONNX dependencies in CI. See CHANGELOG.md for validation and limitations.
|
|
@@ -9,6 +9,8 @@ table Sales_OrderHeader
|
|
|
9
9
|
[confirmed] method Shop.Data.OrderRepository.Approve Data/OrderRepository.cs:24 update (csharp_sp) via usp_ApproveOrder
|
|
10
10
|
READ BY (1)
|
|
11
11
|
[confirmed] method Shop.Data.OrderRepository.Get Data/OrderRepository.cs:19 select (csharp_sql)
|
|
12
|
+
SCHEMA CHANGED BY (1)
|
|
13
|
+
[confirmed] file Sql/Sales_OrderHeader.sql Sql/Sales_OrderHeader.sql:1 create_table (sql)
|
|
12
14
|
USED BY PROGRAMS (1)
|
|
13
15
|
[probable] Orders read/write Controllers/OrdersController.cs (Approve, Details)
|
|
14
16
|
pages: Views/Orders/Details.cshtml
|
|
@@ -16,7 +18,7 @@ note: Static analysis: dynamic SQL is listed under 'possible' and cannot be reso
|
|
|
16
18
|
|
|
17
19
|
Verified 4/4 expected relationships: PASS
|
|
18
20
|
Exact table mentions: 3 files; controller/page reachability is computed separately.
|
|
19
|
-
Local timing: index
|
|
21
|
+
Local timing: index 17.2 ms; data-access 0.6 ms.
|
|
20
22
|
This fixture does not establish accuracy or time savings on your project.
|
|
21
23
|
|
|
22
24
|
Try your project:
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"sample_kind": "synthetic",
|
|
4
|
-
"package_version": "0.
|
|
4
|
+
"package_version": "0.9.0",
|
|
5
5
|
"scenario": "Trace Sales_OrderHeader to C# code, a controller, and a Razor page",
|
|
6
6
|
"environment": {
|
|
7
7
|
"python": "3.12.14",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"warnings": []
|
|
23
23
|
},
|
|
24
24
|
"timing_ms": {
|
|
25
|
-
"index":
|
|
26
|
-
"data_access": 0.
|
|
25
|
+
"index": 17.207,
|
|
26
|
+
"data_access": 0.579
|
|
27
27
|
},
|
|
28
28
|
"literal_reference_files": [
|
|
29
29
|
"Data/OrderRepository.cs",
|
|
@@ -100,6 +100,24 @@
|
|
|
100
100
|
],
|
|
101
101
|
"executed_by": [],
|
|
102
102
|
"mapped_by": [],
|
|
103
|
+
"schema_changes": [
|
|
104
|
+
{
|
|
105
|
+
"source": "Sql/Sales_OrderHeader.sql",
|
|
106
|
+
"source_type": "file",
|
|
107
|
+
"source_id": null,
|
|
108
|
+
"file_path": "Sql/Sales_OrderHeader.sql",
|
|
109
|
+
"line": 1,
|
|
110
|
+
"target": "Sales_OrderHeader",
|
|
111
|
+
"op": "create_table",
|
|
112
|
+
"access": "schema",
|
|
113
|
+
"via": "sql",
|
|
114
|
+
"confidence": "confirmed",
|
|
115
|
+
"evidence": "CREATE TABLE dbo.Sales_OrderHeader (",
|
|
116
|
+
"detail": "",
|
|
117
|
+
"depth": 0,
|
|
118
|
+
"via_chain": []
|
|
119
|
+
}
|
|
120
|
+
],
|
|
103
121
|
"possible": [],
|
|
104
122
|
"programs": [
|
|
105
123
|
{
|
|
Binary file
|
|
@@ -33,3 +33,19 @@ Expected answers are `file` plus an optional `symbol` suffix. A result is releva
|
|
|
33
33
|
## History
|
|
34
34
|
|
|
35
35
|
- Chinese queries in the noisy corpus: Recall@5 0.50 -> 1.00 after Chinese runs were indexed as character bigrams (SQLite FTS5 keeps a whole run of Chinese characters as one token).
|
|
36
|
+
|
|
37
|
+
## Reproducible comparison with ripgrep + BM25
|
|
38
|
+
|
|
39
|
+
The optional `compare_tools.py` runner uses the same frozen questions/corpora and an actual ripgrep candidate search with generic tokenization and BM25 ranking. Install `rg` separately; it is not a product dependency.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python -m pip install -e ".[dev]"
|
|
43
|
+
python benchmarks/compare_tools.py --repeats 3 --navigation \
|
|
44
|
+
--save /tmp/tool-comparison.json --details /tmp/tool-comparison-queries.jsonl
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use output paths suitable for your OS. Add `--suite synthetic` for a smaller run. The full run executes 42 synthetic + the same 42 noisy + 12 stdlib questions (54 unique, 96 executions). One warm-up and three measured repetitions per method are the default. `--navigation` also runs a five-evidence-file task through the real CLI, with fresh-index and warm timings. CI runs the synthetic/navigation subset and uploads raw outputs as an artifact.
|
|
48
|
+
|
|
49
|
+
Unlike the existing symbol-aware benchmark, this comparison scores **file-level** Recall@5 and MRR@5 for both methods, ignoring gold symbol suffixes. The indexer retains its default 5 chunks; the baseline returns 5 files. Output reductions use **exact Unicode characters** against whole reads of the **same indexer-selected files**, not model tokens or Grep output. In-process indexer timings and subprocess baseline timings have different boundaries; only the separate navigation task measures both CLI processes. This is not a Claude agent, Serena, or Claude Context head-to-head test.
|
|
50
|
+
|
|
51
|
+
[Recorded summary](tool-comparison.json) · [96 per-query records](tool-comparison-queries.jsonl) · [complete protocol, results, losses, and limitations](../docs/tool-comparison.md). The sample shows +10.7 / +9.5 percentage points of file recall on MES fixtures, and −20.8 points on stdlib. Corpus/source/dataset hashes and runtime versions are recorded. Keep gold answers fixed when comparing changes; do not rerun only until a favorable timing appears.
|