codecortex 0.28.0__tar.gz → 0.29.3__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.
- {codecortex-0.28.0/src/codecortex.egg-info → codecortex-0.29.3}/PKG-INFO +9 -9
- {codecortex-0.28.0 → codecortex-0.29.3}/README.md +8 -8
- {codecortex-0.28.0 → codecortex-0.29.3/src/codecortex.egg-info}/PKG-INFO +9 -9
- codecortex-0.29.3/src/codeintel/__init__.py +1 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/__main__.py +5 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/index.py +10 -5
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/query.py +1 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/gateway.py +15 -3
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_answer.py +2 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_changed.py +29 -5
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_ops.py +47 -21
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/provider.py +3 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/providers/graph.py +22 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/semantic_db.py +27 -5
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/server.py +19 -5
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_qualified.py +36 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_changed_range.py +71 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cli_commands.py +16 -2
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_docs_ci_claims.py +39 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_index_failure_reason.py +44 -2
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_mcp_answer_size.py +20 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_null_reason_and_ripple.py +50 -0
- codecortex-0.28.0/src/codeintel/__init__.py +0 -1
- {codecortex-0.28.0 → codecortex-0.29.3}/LICENSE +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/pyproject.toml +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/setup.cfg +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codecortex.egg-info/SOURCES.txt +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codecortex.egg-info/dependency_links.txt +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codecortex.egg-info/entry_points.txt +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codecortex.egg-info/requires.txt +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codecortex.egg-info/top_level.txt +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/agent_prompt.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/auth.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/c4.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/c4_check.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/c4_layers.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/cache.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/changed_range.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/__init__.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/_common.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/c4.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/doctor.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/gen_token.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/graph.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/install.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/map.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/prompt.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/reset.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/serve.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/serve_http.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/setup.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/status.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/commands/uninstall.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/config.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/containment.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/doctor.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/filelock.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_backend.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_confidence.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_dispatch.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_edges.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_render.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_resolution.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/graph_targets.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/grapher.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/http_server.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/indexer.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/injector.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/installer.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/lang_config.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/loc.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/logconfig.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/mapper.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/metrics.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/onboarding.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/outcome.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/paths.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/per_thread.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/policy.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/progress.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/providers/__init__.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/providers/lsp.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/providers/none.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/providers/semantic.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/py.typed +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/qualifier_scan.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/query_ops.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/redact.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/reindexer.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/reset.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/searcher.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/source_kind.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/symbol_diff.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/term.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/verify.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/viewer/__init__.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/viewer/graph_template.html +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/src/codeintel/wire_text.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_agent_prompt.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_backend_failure_detail.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_backend_reaper.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_background_index_failure.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_corpus_typed.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_gate.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_graphify.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_oracle.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_bench_oracle_ts.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_c4.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_c4_check.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_c4_layers.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_c4_model.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_c4_output.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cache.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_chunking.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cli_help.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cli_install_dry_run.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cli_install_offer_injection.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_cold_process.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_config.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_corpus.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_could_not_ask_semantic.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_dispatch_callers.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_docs_deadcode_withdrawal.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_docs_trust_claims.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_doctor.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_e2e.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_edge_confidence.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_edge_endpoint_cap.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_engine_adoption.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_enterprise.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_gateway.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_graph_failure_population.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_graph_provider.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_graph_real.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_graph_stdin.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_grapher.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_hard_exit.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_hardening.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_http_auth.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_http_server.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_incompleteness.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_index_incompleteness.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_index_progress.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_indexer_binary.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_installer.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_integration.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_lang_config.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_loc_census.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_lsp_language_coverage.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_lsp_provider.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_lsp_real.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_mapper.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_mcp_handshake.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_mcp_server.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_missing_target.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_model_dimension.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_never_raise.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_onboarding.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_per_thread.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_qualifier_scan.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_query_budget.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_rbac.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_redaction_boundary.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_reindex_lock.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_reindexer.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_rerank.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_reset.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_semantic_provider.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_source_kind.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_staleness.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_summary_integrity.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_symbol_context.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_symbol_diff.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_term.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_treesitter.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_uninstall.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_upgrade_path.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_verify.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_verify_call.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_version_skew.py +0 -0
- {codecortex-0.28.0 → codecortex-0.29.3}/tests/test_wire_text.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecortex
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.29.3
|
|
4
4
|
Summary: Local-first, MCP-native code-intelligence server — graph, LSP, and semantic search behind one safe code.query tool for coding agents.
|
|
5
5
|
Author: Shammai Hamilton
|
|
6
6
|
License-Expression: MIT
|
|
@@ -283,7 +283,7 @@ Prefer plain text? `codeintel map` writes a **readable architecture overview** t
|
|
|
283
283
|
**What `CODE_INTEL.md` is for.** It's a *static, committable* snapshot of a codebase's shape — meant to be read (by a person or an agent) **first**, instead of reconstructing structure by grepping. It covers the cases the live `code.query` tool doesn't:
|
|
284
284
|
|
|
285
285
|
- **Agents & hosts that don't speak MCP.** Not every agent supports MCP, and the server isn't always running. `codeintel map` writes a plain file any agent can read; `codeintel map --inject` also drops a short, tool-naming pointer block into `AGENTS.md` (the cross-tool surface read by Codex, Cursor, Zed, and others — created with your consent if it doesn't exist yet) plus a one-line `@AGENTS.md` import into `CLAUDE.md`, and writes the fuller `USING_CODEINTEL.md` guide the block points to — into **your** repo, which is why there is no such file to click here — so an agent knows to reach for `code.query` before it reaches for grep, not just that a `CODE_INTEL.md` exists.
|
|
286
|
-
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline.
|
|
286
|
+
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline. Once it exists, `codeintel index` keeps it current; `index` never creates it on its own.
|
|
287
287
|
- **The load-bearing code at a glance.** Ranking symbols by caller count surfaces what most of the codebase depends on (the risky-to-change core) plus the entry points — the first things a newcomer, or an agent, should understand before touching anything. The ranking counts `CALLS` edges into **callable** nodes only (functions, methods, classes, interfaces, routes), and skips test, generated and archived files. Both constraints are load-bearing rather than tidy-up: without them a 12,638-node TypeScript repo ranked `logger` (a *folder* node) at 716 and `onClick` at 107, and a Python repo ranked YAML and JSON keys — `flow` from a `.flow.yaml`, `feature` from a `.schema.json` — as its most depended-on symbols. This repo's own map is Python-heavy and barely showed it, which is exactly why dogfooding did not catch it.
|
|
288
288
|
|
|
289
289
|
See **[docs/map-file.md](docs/map-file.md)** for the format and the `--inject` flow.
|
|
@@ -449,7 +449,7 @@ Full system docs live in [`docs/`](docs/) — start with the index:
|
|
|
449
449
|
| `codeintel install [--agent auto\|claude\|codex\|gemini\|zed\|all] [--no-verify] [--relative-command]` | Register codeintel with the agents installed on this machine (`auto`, the default), then prove it by completing a real MCP handshake against the registered command |
|
|
450
450
|
| `codeintel setup [project_root] [--all] [--index] [--warm] [--languages] [--install-uv] [--install-deps] [--json]` | Prepare backends + index this repo (`--all` = one command: do everything automatable, idempotent); ends with a health report + **Next:** steps |
|
|
451
451
|
| `codeintel prompt [project_root] [--agent auto\|claude\|codex\|gemini\|zed] [--fresh] [--deep]` | Print a paste-to-your-agent setup prompt; probes health and emits only the outstanding steps (or "just restart me" when already healthy). `--fresh` = the full sequence from `pip install`, to send a friend |
|
|
452
|
-
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph
|
|
452
|
+
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph refresh, and a refresh of `CODE_INTEL.md` if `codeintel map` already created one), with a live progress display; `--quiet` prints only the result line |
|
|
453
453
|
| `codeintel serve` | Start the MCP server (stdio transport) |
|
|
454
454
|
| `codeintel serve-http [--host HOST] [--port 8766] [--allow-remote] [--token TOKEN]` | Start the HTTP transport (loopback-only unless `--allow-remote`; `--token` requires a bearer token on every request) |
|
|
455
455
|
| `codeintel query --op OP --target TARGET [--engine auto] [--project-root DIR] [--json]` | Run a single query and print the result |
|
|
@@ -597,7 +597,7 @@ An honest picture, so you can decide what to trust this with.
|
|
|
597
597
|
|
|
598
598
|
**What's solid.** The suite is large and real — more test code than source, a coverage floor
|
|
599
599
|
enforced in CI, and fault-injection tests behind the never-raise contract. CI runs lint, `mypy`,
|
|
600
|
-
and the full suite on Python 3.11/3.12/3.13, then builds the wheel, installs it into a clean
|
|
600
|
+
and the full suite on Python 3.11/3.12/3.13/3.14, then builds the wheel, installs it into a clean
|
|
601
601
|
environment, and runs a **release canary** that registers the build with Codex and Claude Code in a
|
|
602
602
|
throwaway `HOME`, boots the server those configs name, and asserts on the answer text of a real
|
|
603
603
|
`code.query`. A release that installs into a file no host reads, or that boots and answers nothing,
|
|
@@ -629,10 +629,10 @@ skip and those engines run against hand-authored mocks rather than the real wire
|
|
|
629
629
|
jobs cover the contract itself: `graph-contract` installs the pinned `codebase-memory-mcp` and runs
|
|
630
630
|
the live graph tests — and **fails if they skipped**, because a silently-skipped contract test is
|
|
631
631
|
how a total backend outage stayed green here once — while the nightly corpus job runs that same
|
|
632
|
-
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
the
|
|
632
|
+
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
633
|
+
against the exact serena commit the provider launches (`providers/lsp.py`'s `_SERENA_REV`), and it
|
|
634
|
+
**gates**: a serena regression turns CI red, and moving to a newer serena means bumping that pin
|
|
635
|
+
with the contract job green against it. The release canary — the only check that
|
|
636
636
|
asserts on real answer text from a built wheel — still covers **the semantic engine only**.
|
|
637
637
|
|
|
638
638
|
Line coverage measures how much of the intended behavior runs, not how much of reality it has met.
|
|
@@ -697,7 +697,7 @@ git clone https://github.com/hamilton-sky/codeintel.git
|
|
|
697
697
|
cd codeintel
|
|
698
698
|
pip install -e .[dev]
|
|
699
699
|
|
|
700
|
-
pytest tests/ -q # ~
|
|
700
|
+
pytest tests/ -q # ~2,200 tests, a few minutes; fails under 83% coverage
|
|
701
701
|
ruff check src tests bench # lint
|
|
702
702
|
mypy # types (src/ only)
|
|
703
703
|
```
|
|
@@ -242,7 +242,7 @@ Prefer plain text? `codeintel map` writes a **readable architecture overview** t
|
|
|
242
242
|
**What `CODE_INTEL.md` is for.** It's a *static, committable* snapshot of a codebase's shape — meant to be read (by a person or an agent) **first**, instead of reconstructing structure by grepping. It covers the cases the live `code.query` tool doesn't:
|
|
243
243
|
|
|
244
244
|
- **Agents & hosts that don't speak MCP.** Not every agent supports MCP, and the server isn't always running. `codeintel map` writes a plain file any agent can read; `codeintel map --inject` also drops a short, tool-naming pointer block into `AGENTS.md` (the cross-tool surface read by Codex, Cursor, Zed, and others — created with your consent if it doesn't exist yet) plus a one-line `@AGENTS.md` import into `CLAUDE.md`, and writes the fuller `USING_CODEINTEL.md` guide the block points to — into **your** repo, which is why there is no such file to click here — so an agent knows to reach for `code.query` before it reaches for grep, not just that a `CODE_INTEL.md` exists.
|
|
245
|
-
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline.
|
|
245
|
+
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline. Once it exists, `codeintel index` keeps it current; `index` never creates it on its own.
|
|
246
246
|
- **The load-bearing code at a glance.** Ranking symbols by caller count surfaces what most of the codebase depends on (the risky-to-change core) plus the entry points — the first things a newcomer, or an agent, should understand before touching anything. The ranking counts `CALLS` edges into **callable** nodes only (functions, methods, classes, interfaces, routes), and skips test, generated and archived files. Both constraints are load-bearing rather than tidy-up: without them a 12,638-node TypeScript repo ranked `logger` (a *folder* node) at 716 and `onClick` at 107, and a Python repo ranked YAML and JSON keys — `flow` from a `.flow.yaml`, `feature` from a `.schema.json` — as its most depended-on symbols. This repo's own map is Python-heavy and barely showed it, which is exactly why dogfooding did not catch it.
|
|
247
247
|
|
|
248
248
|
See **[docs/map-file.md](docs/map-file.md)** for the format and the `--inject` flow.
|
|
@@ -408,7 +408,7 @@ Full system docs live in [`docs/`](docs/) — start with the index:
|
|
|
408
408
|
| `codeintel install [--agent auto\|claude\|codex\|gemini\|zed\|all] [--no-verify] [--relative-command]` | Register codeintel with the agents installed on this machine (`auto`, the default), then prove it by completing a real MCP handshake against the registered command |
|
|
409
409
|
| `codeintel setup [project_root] [--all] [--index] [--warm] [--languages] [--install-uv] [--install-deps] [--json]` | Prepare backends + index this repo (`--all` = one command: do everything automatable, idempotent); ends with a health report + **Next:** steps |
|
|
410
410
|
| `codeintel prompt [project_root] [--agent auto\|claude\|codex\|gemini\|zed] [--fresh] [--deep]` | Print a paste-to-your-agent setup prompt; probes health and emits only the outstanding steps (or "just restart me" when already healthy). `--fresh` = the full sequence from `pip install`, to send a friend |
|
|
411
|
-
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph
|
|
411
|
+
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph refresh, and a refresh of `CODE_INTEL.md` if `codeintel map` already created one), with a live progress display; `--quiet` prints only the result line |
|
|
412
412
|
| `codeintel serve` | Start the MCP server (stdio transport) |
|
|
413
413
|
| `codeintel serve-http [--host HOST] [--port 8766] [--allow-remote] [--token TOKEN]` | Start the HTTP transport (loopback-only unless `--allow-remote`; `--token` requires a bearer token on every request) |
|
|
414
414
|
| `codeintel query --op OP --target TARGET [--engine auto] [--project-root DIR] [--json]` | Run a single query and print the result |
|
|
@@ -556,7 +556,7 @@ An honest picture, so you can decide what to trust this with.
|
|
|
556
556
|
|
|
557
557
|
**What's solid.** The suite is large and real — more test code than source, a coverage floor
|
|
558
558
|
enforced in CI, and fault-injection tests behind the never-raise contract. CI runs lint, `mypy`,
|
|
559
|
-
and the full suite on Python 3.11/3.12/3.13, then builds the wheel, installs it into a clean
|
|
559
|
+
and the full suite on Python 3.11/3.12/3.13/3.14, then builds the wheel, installs it into a clean
|
|
560
560
|
environment, and runs a **release canary** that registers the build with Codex and Claude Code in a
|
|
561
561
|
throwaway `HOME`, boots the server those configs name, and asserts on the answer text of a real
|
|
562
562
|
`code.query`. A release that installs into a file no host reads, or that boots and answers nothing,
|
|
@@ -588,10 +588,10 @@ skip and those engines run against hand-authored mocks rather than the real wire
|
|
|
588
588
|
jobs cover the contract itself: `graph-contract` installs the pinned `codebase-memory-mcp` and runs
|
|
589
589
|
the live graph tests — and **fails if they skipped**, because a silently-skipped contract test is
|
|
590
590
|
how a total backend outage stayed green here once — while the nightly corpus job runs that same
|
|
591
|
-
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
the
|
|
591
|
+
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
592
|
+
against the exact serena commit the provider launches (`providers/lsp.py`'s `_SERENA_REV`), and it
|
|
593
|
+
**gates**: a serena regression turns CI red, and moving to a newer serena means bumping that pin
|
|
594
|
+
with the contract job green against it. The release canary — the only check that
|
|
595
595
|
asserts on real answer text from a built wheel — still covers **the semantic engine only**.
|
|
596
596
|
|
|
597
597
|
Line coverage measures how much of the intended behavior runs, not how much of reality it has met.
|
|
@@ -656,7 +656,7 @@ git clone https://github.com/hamilton-sky/codeintel.git
|
|
|
656
656
|
cd codeintel
|
|
657
657
|
pip install -e .[dev]
|
|
658
658
|
|
|
659
|
-
pytest tests/ -q # ~
|
|
659
|
+
pytest tests/ -q # ~2,200 tests, a few minutes; fails under 83% coverage
|
|
660
660
|
ruff check src tests bench # lint
|
|
661
661
|
mypy # types (src/ only)
|
|
662
662
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codecortex
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.29.3
|
|
4
4
|
Summary: Local-first, MCP-native code-intelligence server — graph, LSP, and semantic search behind one safe code.query tool for coding agents.
|
|
5
5
|
Author: Shammai Hamilton
|
|
6
6
|
License-Expression: MIT
|
|
@@ -283,7 +283,7 @@ Prefer plain text? `codeintel map` writes a **readable architecture overview** t
|
|
|
283
283
|
**What `CODE_INTEL.md` is for.** It's a *static, committable* snapshot of a codebase's shape — meant to be read (by a person or an agent) **first**, instead of reconstructing structure by grepping. It covers the cases the live `code.query` tool doesn't:
|
|
284
284
|
|
|
285
285
|
- **Agents & hosts that don't speak MCP.** Not every agent supports MCP, and the server isn't always running. `codeintel map` writes a plain file any agent can read; `codeintel map --inject` also drops a short, tool-naming pointer block into `AGENTS.md` (the cross-tool surface read by Codex, Cursor, Zed, and others — created with your consent if it doesn't exist yet) plus a one-line `@AGENTS.md` import into `CLAUDE.md`, and writes the fuller `USING_CODEINTEL.md` guide the block points to — into **your** repo, which is why there is no such file to click here — so an agent knows to reach for `code.query` before it reaches for grep, not just that a `CODE_INTEL.md` exists.
|
|
286
|
-
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline.
|
|
286
|
+
- **A committed, diffable overview.** It lives *in the repo* — reviewable in a PR, browsable on GitHub, available offline. Once it exists, `codeintel index` keeps it current; `index` never creates it on its own.
|
|
287
287
|
- **The load-bearing code at a glance.** Ranking symbols by caller count surfaces what most of the codebase depends on (the risky-to-change core) plus the entry points — the first things a newcomer, or an agent, should understand before touching anything. The ranking counts `CALLS` edges into **callable** nodes only (functions, methods, classes, interfaces, routes), and skips test, generated and archived files. Both constraints are load-bearing rather than tidy-up: without them a 12,638-node TypeScript repo ranked `logger` (a *folder* node) at 716 and `onClick` at 107, and a Python repo ranked YAML and JSON keys — `flow` from a `.flow.yaml`, `feature` from a `.schema.json` — as its most depended-on symbols. This repo's own map is Python-heavy and barely showed it, which is exactly why dogfooding did not catch it.
|
|
288
288
|
|
|
289
289
|
See **[docs/map-file.md](docs/map-file.md)** for the format and the `--inject` flow.
|
|
@@ -449,7 +449,7 @@ Full system docs live in [`docs/`](docs/) — start with the index:
|
|
|
449
449
|
| `codeintel install [--agent auto\|claude\|codex\|gemini\|zed\|all] [--no-verify] [--relative-command]` | Register codeintel with the agents installed on this machine (`auto`, the default), then prove it by completing a real MCP handshake against the registered command |
|
|
450
450
|
| `codeintel setup [project_root] [--all] [--index] [--warm] [--languages] [--install-uv] [--install-deps] [--json]` | Prepare backends + index this repo (`--all` = one command: do everything automatable, idempotent); ends with a health report + **Next:** steps |
|
|
451
451
|
| `codeintel prompt [project_root] [--agent auto\|claude\|codex\|gemini\|zed] [--fresh] [--deep]` | Print a paste-to-your-agent setup prompt; probes health and emits only the outstanding steps (or "just restart me" when already healthy). `--fresh` = the full sequence from `pip install`, to send a friend |
|
|
452
|
-
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph
|
|
452
|
+
| `codeintel index [project_root] [--quiet]` | Index a repo (semantic embeddings + best-effort graph refresh, and a refresh of `CODE_INTEL.md` if `codeintel map` already created one), with a live progress display; `--quiet` prints only the result line |
|
|
453
453
|
| `codeintel serve` | Start the MCP server (stdio transport) |
|
|
454
454
|
| `codeintel serve-http [--host HOST] [--port 8766] [--allow-remote] [--token TOKEN]` | Start the HTTP transport (loopback-only unless `--allow-remote`; `--token` requires a bearer token on every request) |
|
|
455
455
|
| `codeintel query --op OP --target TARGET [--engine auto] [--project-root DIR] [--json]` | Run a single query and print the result |
|
|
@@ -597,7 +597,7 @@ An honest picture, so you can decide what to trust this with.
|
|
|
597
597
|
|
|
598
598
|
**What's solid.** The suite is large and real — more test code than source, a coverage floor
|
|
599
599
|
enforced in CI, and fault-injection tests behind the never-raise contract. CI runs lint, `mypy`,
|
|
600
|
-
and the full suite on Python 3.11/3.12/3.13, then builds the wheel, installs it into a clean
|
|
600
|
+
and the full suite on Python 3.11/3.12/3.13/3.14, then builds the wheel, installs it into a clean
|
|
601
601
|
environment, and runs a **release canary** that registers the build with Codex and Claude Code in a
|
|
602
602
|
throwaway `HOME`, boots the server those configs name, and asserts on the answer text of a real
|
|
603
603
|
`code.query`. A release that installs into a file no host reads, or that boots and answers nothing,
|
|
@@ -629,10 +629,10 @@ skip and those engines run against hand-authored mocks rather than the real wire
|
|
|
629
629
|
jobs cover the contract itself: `graph-contract` installs the pinned `codebase-memory-mcp` and runs
|
|
630
630
|
the live graph tests — and **fails if they skipped**, because a silently-skipped contract test is
|
|
631
631
|
how a total backend outage stayed green here once — while the nightly corpus job runs that same
|
|
632
|
-
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
the
|
|
632
|
+
real backend against pinned third-party repositories. `lsp-contract` runs the live serena tests
|
|
633
|
+
against the exact serena commit the provider launches (`providers/lsp.py`'s `_SERENA_REV`), and it
|
|
634
|
+
**gates**: a serena regression turns CI red, and moving to a newer serena means bumping that pin
|
|
635
|
+
with the contract job green against it. The release canary — the only check that
|
|
636
636
|
asserts on real answer text from a built wheel — still covers **the semantic engine only**.
|
|
637
637
|
|
|
638
638
|
Line coverage measures how much of the intended behavior runs, not how much of reality it has met.
|
|
@@ -697,7 +697,7 @@ git clone https://github.com/hamilton-sky/codeintel.git
|
|
|
697
697
|
cd codeintel
|
|
698
698
|
pip install -e .[dev]
|
|
699
699
|
|
|
700
|
-
pytest tests/ -q # ~
|
|
700
|
+
pytest tests/ -q # ~2,200 tests, a few minutes; fails under 83% coverage
|
|
701
701
|
ruff check src tests bench # lint
|
|
702
702
|
mypy # types (src/ only)
|
|
703
703
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.29.3"
|
|
@@ -448,6 +448,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
448
448
|
"base ref (`main`, `HEAD~3`) — empty means uncommitted edits only. Ignored (and "
|
|
449
449
|
"safe to omit) by `overview`/`hotspots`.",
|
|
450
450
|
)
|
|
451
|
+
query_parser.add_argument(
|
|
452
|
+
"--offset", type=int, default=0,
|
|
453
|
+
help="For `changed` with a base ref: skip this many changed symbols (most severe first) — "
|
|
454
|
+
"the page cursor a capped answer names as `page.next_offset`. Default 0.",
|
|
455
|
+
)
|
|
451
456
|
query_parser.add_argument(
|
|
452
457
|
"--engine", choices=QUERY_ENGINES, default="auto",
|
|
453
458
|
help="Which engine answers (default: auto — picks the right engine per op)",
|
|
@@ -182,13 +182,18 @@ def run(args: Any) -> int:
|
|
|
182
182
|
|
|
183
183
|
lock.close()
|
|
184
184
|
|
|
185
|
-
# best-effort map refresh after index (fast, kept silent — not worth a checklist row)
|
|
185
|
+
# best-effort map refresh after index (fast, kept silent — not worth a checklist row). REFRESH
|
|
186
|
+
# only: `index` keeps a CODE_INTEL.md that `codeintel map` already wrote current, and never
|
|
187
|
+
# creates one. Creating it put an uncommitted file into every repo on the first `index` —
|
|
188
|
+
# including one whose index had just failed — when writing into the repo is `map`'s job, asked
|
|
189
|
+
# for by name.
|
|
186
190
|
try:
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
if os.path.isfile(os.path.join(project_root, "CODE_INTEL.md")):
|
|
192
|
+
from codeintel.mapper import MapGenerator
|
|
193
|
+
from codeintel.providers.graph import GraphProvider
|
|
189
194
|
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
gen = MapGenerator(GraphProvider())
|
|
196
|
+
gen.write(project_root, gen.generate(project_root))
|
|
192
197
|
except Exception:
|
|
193
198
|
pass
|
|
194
199
|
|
|
@@ -501,6 +501,7 @@ class Gateway:
|
|
|
501
501
|
budget,
|
|
502
502
|
project_root,
|
|
503
503
|
engine_str: str,
|
|
504
|
+
offset: int = 0,
|
|
504
505
|
) -> Result:
|
|
505
506
|
# Both arms short-circuit BEFORE `build_result`, so the provider's own unavailable-hint is
|
|
506
507
|
# never reached from here — which is exactly how the documented contract ("safe-nulls with
|
|
@@ -521,7 +522,12 @@ class Gateway:
|
|
|
521
522
|
or f"the {engine_str} engine is not available — run `codeintel doctor` for why",
|
|
522
523
|
)
|
|
523
524
|
try:
|
|
524
|
-
|
|
525
|
+
# Only `changed` pages, and only the graph engine answers it; the other providers keep
|
|
526
|
+
# the five-argument `build_result` of the `Provider` protocol.
|
|
527
|
+
paged = bool(offset) and op_str in _UNCACHED_OPS and engine_str == "graph"
|
|
528
|
+
r = (provider.build_result(op_str, target_str, [], budget or 0, project_root or "",
|
|
529
|
+
offset=offset) if paged
|
|
530
|
+
else provider.build_result(op_str, target_str, [], budget or 0, project_root or ""))
|
|
525
531
|
if r is not None:
|
|
526
532
|
return r
|
|
527
533
|
return safe_null_result(op_str, target_str, engine=engine_str, reason="no-result")
|
|
@@ -554,14 +560,18 @@ class Gateway:
|
|
|
554
560
|
role: str = "",
|
|
555
561
|
budget=None,
|
|
556
562
|
project_root=None,
|
|
563
|
+
offset: int = 0,
|
|
557
564
|
) -> Result:
|
|
558
565
|
"""Answer one question. Never raises.
|
|
559
566
|
|
|
567
|
+
`offset` is `changed <ref>`'s page cursor into its capped symbol lookup; every other op
|
|
568
|
+
ignores it.
|
|
569
|
+
|
|
560
570
|
A thin wrapper over `_query`, existing so that redaction has exactly ONE seam to cover.
|
|
561
571
|
Every leak found in the evaluation was in a field some renderer built and no one swept —
|
|
562
572
|
the scope note inside `result`, the "index it standalone with:" command inside `hint`. Both
|
|
563
573
|
are downstream of here, and so is anything added later."""
|
|
564
|
-
result = self._query(op, target, engine, role, budget, project_root)
|
|
574
|
+
result = self._query(op, target, engine, role, budget, project_root, offset)
|
|
565
575
|
try:
|
|
566
576
|
return redact(result) # type: ignore[return-value]
|
|
567
577
|
except Exception as exc:
|
|
@@ -576,6 +586,7 @@ class Gateway:
|
|
|
576
586
|
role: str = "",
|
|
577
587
|
budget=None,
|
|
578
588
|
project_root=None,
|
|
589
|
+
offset: int = 0,
|
|
579
590
|
) -> Result:
|
|
580
591
|
try:
|
|
581
592
|
op_str = str(op or "")
|
|
@@ -738,7 +749,8 @@ class Gateway:
|
|
|
738
749
|
# stale answer were the three that stayed silent about it.
|
|
739
750
|
return _mark_reindexing({**cached_result, "cached": True}, reindexing)
|
|
740
751
|
provider = self._provider_for(engine_str)
|
|
741
|
-
result = self._dispatch_single(
|
|
752
|
+
result = self._dispatch_single(
|
|
753
|
+
provider, op_str, target_str, budget, project_root, engine_str, offset)
|
|
742
754
|
|
|
743
755
|
# overview auto-fallback (F4 Story 2): when auto-routed to graph but graph can't serve
|
|
744
756
|
# it — the backend is unavailable, OR this repo simply isn't in the graph — try lsp,
|
|
@@ -308,13 +308,37 @@ class ChangedSince(AnswerRendering):
|
|
|
308
308
|
key=lambda e: (SEVERITY[e.change.change], _is_class_body(e.change),
|
|
309
309
|
self._looks_like_test(e.path, e.bare),
|
|
310
310
|
e.path, e.change.new_line or e.change.old_line or 0))
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
# One PAGE of the severity-ordered list is looked up: the cap keeps an answer one that an
|
|
312
|
+
# MCP client can take, and `offset` (D5) is how the rest is reached — a bigger cap would
|
|
313
|
+
# grow the `result` text, which is never cut, past the client's limit again.
|
|
314
|
+
cap, total = self._RANGE_SYMBOL_CAP, len(candidates)
|
|
315
|
+
start = min(self._changed_offset, total)
|
|
316
|
+
before, looked = candidates[:start], candidates[start: start + cap]
|
|
317
|
+
after = candidates[start + cap:]
|
|
318
|
+
skipped = before + after
|
|
319
|
+
next_offset = start + cap if after else None
|
|
320
|
+
self._pending_page = {"offset": start, "limit": cap, "total": total,
|
|
321
|
+
"next_offset": next_offset}
|
|
322
|
+
more = (f" — re-ask with `offset={next_offset}` for the next {min(cap, len(after))}"
|
|
323
|
+
if next_offset is not None else "")
|
|
324
|
+
if self._changed_offset >= total and self._changed_offset > 0:
|
|
325
|
+
gaps.append((
|
|
326
|
+
"symbols-truncated",
|
|
327
|
+
f"offset={self._changed_offset} is past the last of the {total} changed symbols, "
|
|
328
|
+
f"so none was looked up — pages start at 0 and step by {cap}"))
|
|
329
|
+
elif start:
|
|
330
|
+
gaps.append((
|
|
331
|
+
"symbols-truncated",
|
|
332
|
+
f"this page looked up symbols {start + 1} to {start + len(looked)} of {total} "
|
|
333
|
+
f"(offset={start}, {cap} per page, most severe first); the {len(before)} before it "
|
|
334
|
+
f"and {len(after)} after it were not looked up in this answer{more}"))
|
|
335
|
+
elif skipped:
|
|
313
336
|
gaps.append((
|
|
314
337
|
"symbols-truncated",
|
|
315
|
-
f"{len(skipped)} of {
|
|
316
|
-
f"lookup is capped at {
|
|
317
|
-
f"signature, then body), so what was dropped is the least consequential tail"
|
|
338
|
+
f"{len(skipped)} of {total} changed symbols were not looked up — the "
|
|
339
|
+
f"lookup is capped at {cap}, most severe first (removed, then "
|
|
340
|
+
f"signature, then body), so what was dropped is the least consequential tail"
|
|
341
|
+
f"{more}"))
|
|
318
342
|
|
|
319
343
|
# --------------------------------------------------------------------- look them up
|
|
320
344
|
deadline = time.monotonic() + self._RANGE_LOOKUP_BUDGET_S
|
|
@@ -44,6 +44,14 @@ from codeintel.graph_targets import _parse_symbol_target, _SymbolTarget
|
|
|
44
44
|
from codeintel.source_kind import is_code_path
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
def _is_name_guess(row: tuple[str, str, float | None, str, str]) -> bool:
|
|
48
|
+
"""A ripple row whose only support is a name match (or a score below the confidence floor on a
|
|
49
|
+
backend that reports no strategy)."""
|
|
50
|
+
_, _, conf, _, evidence = row
|
|
51
|
+
return evidence == "name-guess" or (not evidence and conf is not None
|
|
52
|
+
and conf < _EDGE_CONFIDENCE_FLOOR)
|
|
53
|
+
|
|
54
|
+
|
|
47
55
|
class GraphOps(DispatchCallers, ChangedSince):
|
|
48
56
|
"""One method per graph op. Mixed into `GraphProvider`.
|
|
49
57
|
|
|
@@ -630,6 +638,13 @@ class GraphOps(DispatchCallers, ChangedSince):
|
|
|
630
638
|
since = (target or "").strip()
|
|
631
639
|
if since:
|
|
632
640
|
return self._answer_changed_since(since, project, timeout_ms, root)
|
|
641
|
+
if self._changed_offset:
|
|
642
|
+
# Nothing here is paged: the uncommitted answer lists files and impacted symbols, not a
|
|
643
|
+
# capped symbol lookup. Saying so beats an answer that reads as "page 2".
|
|
644
|
+
self._add_gap(
|
|
645
|
+
"changed", "offset-not-applied",
|
|
646
|
+
f"offset={self._changed_offset} was ignored: only `changed` with a base ref as "
|
|
647
|
+
"`target` pages its symbol lookup; this is the uncommitted-edits answer, whole")
|
|
633
648
|
try:
|
|
634
649
|
raw = self._run("detect_changes", {"project": project}, max(timeout_ms, 15000))
|
|
635
650
|
if not isinstance(raw, dict):
|
|
@@ -689,11 +704,17 @@ class GraphOps(DispatchCallers, ChangedSince):
|
|
|
689
704
|
return ("## Changes impact\n(no source changes — the working tree's "
|
|
690
705
|
f"{dropped} uncommitted change(s) are all non-source files)")
|
|
691
706
|
return "## Changes impact\n(working tree clean — no uncommitted changes)"
|
|
692
|
-
|
|
707
|
+
everyone, ripple_truncated = self._changed_ripple(files, project, timeout_ms)
|
|
708
|
+
# A caller found only by its name is a candidate, not a finding: the headline counts the
|
|
709
|
+
# resolved ones and says how many more there are, and the name matches are listed apart.
|
|
710
|
+
# Nothing is dropped — over-reporting a risk is the safer error, hiding one is not.
|
|
711
|
+
ripple = [r for r in everyone if not _is_name_guess(r)]
|
|
712
|
+
by_name = [r for r in everyone if _is_name_guess(r)]
|
|
693
713
|
walked_hdr = any(h > 0 for _, _, h in syms)
|
|
694
714
|
parts = [f"## Changes impact ({len(files)} files → {len(syms)} "
|
|
695
715
|
+ ("symbols impacted" if walked_hdr else "symbols defined in them")
|
|
696
|
-
+ f" → {len(ripple)} callers elsewhere
|
|
716
|
+
+ f" → {len(ripple)} callers elsewhere"
|
|
717
|
+
+ (f" (+{len(by_name)} matched by name only)" if by_name else "") + ")"]
|
|
697
718
|
if files:
|
|
698
719
|
parts.append(f"### Changed files ({len(files)})")
|
|
699
720
|
parts.extend(f"- {f}" for f in files[:40])
|
|
@@ -717,11 +738,8 @@ class GraphOps(DispatchCallers, ChangedSince):
|
|
|
717
738
|
parts.append(f"- {label}{hop_s}{tail}")
|
|
718
739
|
if len(syms) > 40:
|
|
719
740
|
parts.append(f"… (+{len(syms) - 40} more)")
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
parts.append("_This is the blast radius: symbols outside the changed files whose "
|
|
723
|
-
"behaviour can move because of this edit._")
|
|
724
|
-
for label, fp, conf, kind, evidence in ripple[:40]:
|
|
741
|
+
def _ripple_lines(rows: list[tuple[str, str, float | None, str, str]]) -> None:
|
|
742
|
+
for label, fp, conf, kind, evidence in rows[:40]:
|
|
725
743
|
tail = f" ({fp})" if fp and fp != label else ""
|
|
726
744
|
# The relationship comes first: "registered" and "calls" are different things
|
|
727
745
|
# to check, and a reviewer triages on that before they weigh confidence.
|
|
@@ -738,28 +756,36 @@ class GraphOps(DispatchCallers, ChangedSince):
|
|
|
738
756
|
else:
|
|
739
757
|
mark = ""
|
|
740
758
|
parts.append(f"- {label or fp}{kind_s}{mark}{tail}")
|
|
741
|
-
if len(
|
|
742
|
-
parts.append(f"… (+{len(
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
759
|
+
if len(rows) > 40:
|
|
760
|
+
parts.append(f"… (+{len(rows) - 40} more)")
|
|
761
|
+
|
|
762
|
+
if ripple:
|
|
763
|
+
parts.append(f"### Callers elsewhere that reach into them ({len(ripple)})")
|
|
764
|
+
parts.append("_This is the blast radius: symbols outside the changed files whose "
|
|
765
|
+
"behaviour can move because of this edit._")
|
|
766
|
+
_ripple_lines(ripple)
|
|
746
767
|
indirect = sum(1 for r in ripple if r[3] != _DIRECT_KIND)
|
|
747
|
-
notes = []
|
|
748
768
|
if indirect:
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
f"code at all")
|
|
754
|
-
if notes:
|
|
755
|
-
parts.append("\n_" + "; ".join(notes) + "._")
|
|
756
|
-
elif files:
|
|
769
|
+
parts.append(f"\n_{indirect} of {len(ripple)} reach this code without calling "
|
|
770
|
+
"it (registered as a callback, or referenced) — they can still "
|
|
771
|
+
"break._")
|
|
772
|
+
elif files and not by_name:
|
|
757
773
|
# An empty ripple is a real and useful answer — but only if it cannot be confused
|
|
758
774
|
# with one that was never computed.
|
|
759
775
|
parts.append("### Callers elsewhere that reach into them (0)")
|
|
760
776
|
parts.append("_No symbol outside the changed files calls into them, by the graph's "
|
|
761
777
|
"CALLS edges. Framework dispatch and calls through a value are not "
|
|
762
778
|
"edges, so this is not proof that nothing else is affected._")
|
|
779
|
+
elif files:
|
|
780
|
+
parts.append("### Callers elsewhere that reach into them (0)")
|
|
781
|
+
parts.append("_No caller was RESOLVED to the changed code; the candidates found "
|
|
782
|
+
"only by name are below, and they are not proof either way._")
|
|
783
|
+
if by_name:
|
|
784
|
+
parts.append(f"### Matched by name only — may not reach this code ({len(by_name)})")
|
|
785
|
+
parts.append(f"_{len(by_name)} were resolved by name matching and may not reach "
|
|
786
|
+
"this code at all (a same-named symbol elsewhere is a hit). Check "
|
|
787
|
+
"before relying on or ignoring them._")
|
|
788
|
+
_ripple_lines(by_name)
|
|
763
789
|
if ripple_truncated:
|
|
764
790
|
self._add_gap(
|
|
765
791
|
"changed", "ripple-truncated",
|
|
@@ -65,6 +65,9 @@ class Result(TypedDict):
|
|
|
65
65
|
# `total > returned` and `truncated` is still true.
|
|
66
66
|
rows: NotRequired[list[dict[str, Any]]]
|
|
67
67
|
evidence: NotRequired[dict[str, Any]]
|
|
68
|
+
# `changed <ref>` only: which page of its capped, severity-ordered symbol lookup this answer
|
|
69
|
+
# covered — `{offset, limit, total, next_offset}`, `next_offset` null on the last page.
|
|
70
|
+
page: NotRequired[dict[str, Any]]
|
|
68
71
|
# What this answer can be USED for, in one word — `evidence`, `discovery` or `advisory`. The
|
|
69
72
|
# readiness doc's "distinguish discovery from proof", as a field rather than as a convention a
|
|
70
73
|
# reader has to have absorbed. Stamped on every answered envelope by `attach_confidence`.
|
|
@@ -560,6 +560,19 @@ class GraphProvider(GraphOps):
|
|
|
560
560
|
_pending_withheld: PerThread[int] = PerThread(0)
|
|
561
561
|
# The body carries `- ` lines that are not result rows, so no row summary of it can be true.
|
|
562
562
|
_pending_nonrow_lines: PerThread[bool] = PerThread(False)
|
|
563
|
+
# `changed <ref>`'s page cursor: where in the severity-ordered list of changed symbols this
|
|
564
|
+
# answer's capped lookup starts. Set from `build_result(offset=)` on every call, so it never
|
|
565
|
+
# outlives the question it came with.
|
|
566
|
+
_changed_offset: PerThread[int] = PerThread(0)
|
|
567
|
+
# The page this answer covered — `{offset, limit, total, next_offset}` — published as the
|
|
568
|
+
# envelope's `page` so a caller can ask for the next one without parsing the gap's prose.
|
|
569
|
+
_pending_page: PerThread[dict[str, Any] | None] = PerThread(None)
|
|
570
|
+
|
|
571
|
+
def _page_published(self) -> dict[str, Any] | None:
|
|
572
|
+
"""The page this answer covered, read through a call so the reset at the top of
|
|
573
|
+
`build_result` does not narrow it to `None` for the type checker."""
|
|
574
|
+
page = self._pending_page
|
|
575
|
+
return dict(page) if page is not None else None
|
|
563
576
|
|
|
564
577
|
def _clear_failure(self) -> None:
|
|
565
578
|
self._backend._clear_failure()
|
|
@@ -695,11 +708,17 @@ class GraphProvider(GraphOps):
|
|
|
695
708
|
files: Any,
|
|
696
709
|
budget: Any,
|
|
697
710
|
project_root: Any,
|
|
711
|
+
offset: Any = 0,
|
|
698
712
|
) -> Result:
|
|
699
713
|
try:
|
|
700
714
|
op_str = str(op or "")
|
|
701
715
|
target_str = str(target or "")
|
|
702
716
|
root_str = str(project_root or "")
|
|
717
|
+
try:
|
|
718
|
+
self._changed_offset = max(0, int(offset or 0))
|
|
719
|
+
except (TypeError, ValueError):
|
|
720
|
+
self._changed_offset = 0
|
|
721
|
+
self._pending_page = None
|
|
703
722
|
|
|
704
723
|
if not self.available:
|
|
705
724
|
return safe_null_result(
|
|
@@ -934,6 +953,9 @@ class GraphProvider(GraphOps):
|
|
|
934
953
|
if evidence is not None:
|
|
935
954
|
envelope["rows"] = list(self._pending_rows)
|
|
936
955
|
envelope["evidence"] = evidence
|
|
956
|
+
page = self._page_published()
|
|
957
|
+
if page is not None:
|
|
958
|
+
envelope["page"] = page
|
|
937
959
|
return attach_confidence(envelope, self._pending_gaps)
|
|
938
960
|
except Exception as exc:
|
|
939
961
|
log_swallowed("GraphProvider.build_result", exc)
|
|
@@ -114,11 +114,19 @@ def load_embedder(model_name: str):
|
|
|
114
114
|
try:
|
|
115
115
|
return TextEmbedding(model_name=model_name)
|
|
116
116
|
except ValueError as exc:
|
|
117
|
-
# fastembed
|
|
118
|
-
# list before any network call (measured: 0.000s, no
|
|
119
|
-
#
|
|
120
|
-
#
|
|
121
|
-
#
|
|
117
|
+
# fastembed raises ValueError for TWO different causes. One is a model it does not ship,
|
|
118
|
+
# raised from its own supported-model list before any network call (measured: 0.000s, no
|
|
119
|
+
# request attempted). The other is `Could not load model <name> from any source.`, raised
|
|
120
|
+
# by fastembed 0.9 after its download retries are exhausted — for a name it DOES ship.
|
|
121
|
+
# Telling the second one to check the `model` key sent a blocked download off to debug a
|
|
122
|
+
# correct config. The type cannot separate them, so ask fastembed's own list (structural,
|
|
123
|
+
# not the message text): a name it ships failed to download.
|
|
124
|
+
if _fastembed_ships(TextEmbedding, model_name) is True:
|
|
125
|
+
raise EmbeddingModelUnavailable(model_name, exc, _download_remedy()) from exc
|
|
126
|
+
# This is a CONFIGURATION error — the `model` key names something that does not exist —
|
|
127
|
+
# and the download remedy is actively misleading for it: there is no proxy to fix and no
|
|
128
|
+
# cache to pre-seed, because nothing was ever going to be fetched. Also the fallback when
|
|
129
|
+
# the list cannot be read at all.
|
|
122
130
|
raise EmbeddingModelUnavailable(
|
|
123
131
|
model_name, exc,
|
|
124
132
|
"that is not a model fastembed ships — check the `model` key in your codeintel "
|
|
@@ -149,6 +157,20 @@ def load_embedder(model_name: str):
|
|
|
149
157
|
raise EmbeddingModelUnavailable(model_name, exc, _download_remedy()) from exc
|
|
150
158
|
|
|
151
159
|
|
|
160
|
+
def _fastembed_ships(text_embedding, model_name: str) -> bool | None:
|
|
161
|
+
"""Whether fastembed's supported-model list names *model_name*; None when it cannot be read.
|
|
162
|
+
|
|
163
|
+
Only consulted on the failure path, so the listing is paid once per failed load. Never raises:
|
|
164
|
+
a classifier that throws would replace the error it exists to explain.
|
|
165
|
+
"""
|
|
166
|
+
try:
|
|
167
|
+
models = text_embedding.list_supported_models()
|
|
168
|
+
wanted = str(model_name).lower()
|
|
169
|
+
return any(str(m.get("model", "")).lower() == wanted for m in models)
|
|
170
|
+
except Exception:
|
|
171
|
+
return None
|
|
172
|
+
|
|
173
|
+
|
|
152
174
|
def release_embedder(embedder) -> None:
|
|
153
175
|
"""Release fastembed/onnxruntime native state before interpreter finalization.
|
|
154
176
|
|