codecortex 0.27.0__tar.gz → 0.29.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codecortex-0.27.0/src/codecortex.egg-info → codecortex-0.29.0}/PKG-INFO +8 -8
- {codecortex-0.27.0 → codecortex-0.29.0}/README.md +7 -7
- {codecortex-0.27.0 → codecortex-0.29.0/src/codecortex.egg-info}/PKG-INFO +8 -8
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codecortex.egg-info/SOURCES.txt +1 -0
- codecortex-0.29.0/src/codeintel/__init__.py +1 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/__main__.py +5 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/query.py +1 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/gateway.py +15 -3
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_answer.py +2 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_changed.py +37 -7
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_ops.py +47 -21
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/provider.py +3 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/providers/graph.py +22 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/server.py +97 -20
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/symbol_diff.py +182 -10
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_qualified.py +36 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_changed_range.py +171 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_docs_ci_claims.py +39 -0
- codecortex-0.29.0/tests/test_mcp_answer_size.py +114 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_null_reason_and_ripple.py +50 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_summary_integrity.py +56 -2
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_symbol_diff.py +108 -0
- codecortex-0.27.0/src/codeintel/__init__.py +0 -1
- {codecortex-0.27.0 → codecortex-0.29.0}/LICENSE +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/pyproject.toml +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/setup.cfg +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codecortex.egg-info/dependency_links.txt +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codecortex.egg-info/entry_points.txt +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codecortex.egg-info/requires.txt +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codecortex.egg-info/top_level.txt +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/agent_prompt.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/auth.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/c4.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/c4_check.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/c4_layers.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/cache.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/changed_range.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/__init__.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/_common.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/c4.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/doctor.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/gen_token.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/graph.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/index.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/install.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/map.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/prompt.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/reset.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/serve.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/serve_http.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/setup.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/status.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/commands/uninstall.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/config.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/containment.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/doctor.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/filelock.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_backend.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_confidence.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_dispatch.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_edges.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_render.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_resolution.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/graph_targets.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/grapher.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/http_server.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/indexer.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/injector.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/installer.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/lang_config.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/loc.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/logconfig.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/mapper.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/metrics.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/onboarding.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/outcome.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/paths.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/per_thread.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/policy.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/progress.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/providers/__init__.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/providers/lsp.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/providers/none.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/providers/semantic.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/py.typed +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/qualifier_scan.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/query_ops.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/redact.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/reindexer.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/reset.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/searcher.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/semantic_db.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/source_kind.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/term.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/verify.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/viewer/__init__.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/viewer/graph_template.html +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/src/codeintel/wire_text.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_agent_prompt.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_backend_failure_detail.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_backend_reaper.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_background_index_failure.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_corpus_typed.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_gate.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_graphify.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_oracle.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_bench_oracle_ts.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_c4.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_c4_check.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_c4_layers.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_c4_model.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_c4_output.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cache.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_chunking.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cli_commands.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cli_help.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cli_install_dry_run.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cli_install_offer_injection.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_cold_process.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_config.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_corpus.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_could_not_ask_semantic.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_dispatch_callers.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_docs_deadcode_withdrawal.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_docs_trust_claims.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_doctor.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_e2e.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_edge_confidence.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_edge_endpoint_cap.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_engine_adoption.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_enterprise.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_gateway.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_graph_failure_population.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_graph_provider.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_graph_real.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_graph_stdin.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_grapher.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_hard_exit.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_hardening.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_http_auth.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_http_server.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_incompleteness.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_index_failure_reason.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_index_incompleteness.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_index_progress.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_indexer_binary.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_installer.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_integration.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_lang_config.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_loc_census.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_lsp_language_coverage.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_lsp_provider.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_lsp_real.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_mapper.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_mcp_handshake.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_mcp_server.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_missing_target.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_model_dimension.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_never_raise.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_onboarding.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_per_thread.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_qualifier_scan.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_query_budget.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_rbac.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_redaction_boundary.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_reindex_lock.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_reindexer.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_rerank.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_reset.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_semantic_provider.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_source_kind.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_staleness.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_symbol_context.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_term.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_treesitter.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_uninstall.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_upgrade_path.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_verify.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_verify_call.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/tests/test_version_skew.py +0 -0
- {codecortex-0.27.0 → codecortex-0.29.0}/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.0
|
|
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
|
|
@@ -540,7 +540,7 @@ Register codeintel as an MCP server (`codeintel install`) and the agent gets fou
|
|
|
540
540
|
| MCP tool | HTTP equivalent | Purpose |
|
|
541
541
|
|---|---|---|
|
|
542
542
|
| `code.query` | `POST /code/query` | The main call — search, trace, understand (the `op` table above) |
|
|
543
|
-
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
543
|
+
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `indexed` (true when graph or semantic has indexed this repo; `indexed_by` names which) and `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
544
544
|
| `code.doctor` | `POST /code/doctor` | Per-engine health + repo index status, with a fix for each gap |
|
|
545
545
|
| `code.map` | — | Generate/refresh `CODE_INTEL.md`, a static orientation file for hosts without MCP |
|
|
546
546
|
|
|
@@ -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
|
```
|
|
@@ -499,7 +499,7 @@ Register codeintel as an MCP server (`codeintel install`) and the agent gets fou
|
|
|
499
499
|
| MCP tool | HTTP equivalent | Purpose |
|
|
500
500
|
|---|---|---|
|
|
501
501
|
| `code.query` | `POST /code/query` | The main call — search, trace, understand (the `op` table above) |
|
|
502
|
-
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
502
|
+
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `indexed` (true when graph or semantic has indexed this repo; `indexed_by` names which) and `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
503
503
|
| `code.doctor` | `POST /code/doctor` | Per-engine health + repo index status, with a fix for each gap |
|
|
504
504
|
| `code.map` | — | Generate/refresh `CODE_INTEL.md`, a static orientation file for hosts without MCP |
|
|
505
505
|
|
|
@@ -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.0
|
|
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
|
|
@@ -540,7 +540,7 @@ Register codeintel as an MCP server (`codeintel install`) and the agent gets fou
|
|
|
540
540
|
| MCP tool | HTTP equivalent | Purpose |
|
|
541
541
|
|---|---|---|
|
|
542
542
|
| `code.query` | `POST /code/query` | The main call — search, trace, understand (the `op` table above) |
|
|
543
|
-
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
543
|
+
| `code.status` | `GET /code/status` | Per-engine `installed` / `runnable` / `repo_indexed` (plus `model_cached` for semantic), probed against the live engines a query actually hits, plus `indexed` (true when graph or semantic has indexed this repo; `indexed_by` names which) and `degraded`: engines that are installed but not working — see [docs/doctor.md](docs/doctor.md) |
|
|
544
544
|
| `code.doctor` | `POST /code/doctor` | Per-engine health + repo index status, with a fix for each gap |
|
|
545
545
|
| `code.map` | — | Generate/refresh `CODE_INTEL.md`, a static orientation file for hosts without MCP |
|
|
546
546
|
|
|
@@ -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.0"
|
|
@@ -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)",
|
|
@@ -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,
|
|
@@ -292,7 +292,11 @@ class ChangedSince(AnswerRendering):
|
|
|
292
292
|
touched: dict[str, set[str]] = {}
|
|
293
293
|
for e in entries:
|
|
294
294
|
if e.change.change != REMOVED:
|
|
295
|
-
touched
|
|
295
|
+
# A closure the diff rewrote is a caller the diff touched: the graph files it as a
|
|
296
|
+
# caller of its own, under its enclosing function's name or directly under its
|
|
297
|
+
# module, and only its parent is a key of the diff.
|
|
298
|
+
touched.setdefault(e.path, set()).update(
|
|
299
|
+
(e.qn, *e.change.nested_changed, *e.change.nested_bare))
|
|
296
300
|
files_in_diff = {c.path for c, _ in diffs}
|
|
297
301
|
added_at: dict[str, list[str]] = {}
|
|
298
302
|
for e in entries:
|
|
@@ -304,13 +308,37 @@ class ChangedSince(AnswerRendering):
|
|
|
304
308
|
key=lambda e: (SEVERITY[e.change.change], _is_class_body(e.change),
|
|
305
309
|
self._looks_like_test(e.path, e.bare),
|
|
306
310
|
e.path, e.change.new_line or e.change.old_line or 0))
|
|
307
|
-
|
|
308
|
-
|
|
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:
|
|
309
336
|
gaps.append((
|
|
310
337
|
"symbols-truncated",
|
|
311
|
-
f"{len(skipped)} of {
|
|
312
|
-
f"lookup is capped at {
|
|
313
|
-
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}"))
|
|
314
342
|
|
|
315
343
|
# --------------------------------------------------------------------- look them up
|
|
316
344
|
deadline = time.monotonic() + self._RANGE_LOOKUP_BUDGET_S
|
|
@@ -468,7 +496,9 @@ class ChangedSince(AnswerRendering):
|
|
|
468
496
|
|
|
469
497
|
@staticmethod
|
|
470
498
|
def _caller_is_changed(row: dict, touched: dict[str, set[str]]) -> bool:
|
|
471
|
-
"""Whether a caller is itself a definition this diff added, rewrote or re-signed
|
|
499
|
+
"""Whether a caller is itself a definition this diff added, rewrote or re-signed — or a
|
|
500
|
+
function nested in one whose OWN text the diff changed (`SymbolChange.nested_changed`); a
|
|
501
|
+
sibling closure the diff left alone stays untouched.
|
|
472
502
|
|
|
473
503
|
A MODULE-SCOPE caller is never counted: the diff is compared definition by definition, so
|
|
474
504
|
whether a file's top-level statements changed is not something it knows. It is left on the
|
|
@@ -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)
|