You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose MCP freshness and provenance evidence for client trust decisions #786
MCP clients currently receive code intelligence results without enough machine-readable evidence to decide whether those results are fresh, stale, partial, directly resolved, or inferred. This makes it hard for clients to know when to trust a response, when to prompt for re-indexing, or when to verify an answer directly against source code.
This is especially important for responses such as index_status, trace_path, and trace_call_path, where clients need compatibility-safe metadata about index freshness, repository state, coverage, and relationship provenance without breaking existing consumers.
Proposed solution
Add backward-compatible, additive response fields that expose freshness and provenance evidence:
Extend index_status with an evidence object containing index snapshot metadata, current Git HEAD comparison, tracked working-tree state, freshness status, coverage counters, and known limitations.
Extend trace_path and trace_call_path with optional edge_evidence for traversed relationships, including resolution strategy, confidence, candidate count, and evidence status where available.
Preserve existing response fields so current clients can ignore the new metadata safely.
Document the added fields clearly for client compatibility.
Add focused tests covering freshness/provenance behavior and safe handling of repository paths used in shell-backed Git checks.
Alternatives considered
No response
Confirmations
I searched existing issues and this is not a duplicate.
Thanks for the proposal. Triage: this fits the MCP/editor-client trust track (#395) and overlaps with the existing provenance/freshness direction in #559.
The useful constraint is backward-compatible evidence: clients should be able to tell fresh/stale/partial/resolved/inferred without existing consumers losing their current response fields. We should review this as additive metadata, with tests that strict MCP clients continue to accept the schemas.
We needed clients to know when graph output is untrustworthy for measurement without abandoning CBM for discovery. Shipped in willow-2.0 sap/cbm_facade.py:
Every cbm_* response can carry a limitations map (F-001..F-008) — e.g. "fan-in may be collapsed", "verify aliased imports with grep"
cbm_verify_callers returns graph count vs grep count side-by-side with graph_only / grep_only deltas
cbm_status surfaces project slug, index freshness, and guardrail list at boot
This is additive client-side provenance, not server freshness — but it matches your "backward-compatible evidence" constraint: consumers that ignore the extra fields still work; agents that read them can down-rank stale or ambiguous graph claims.
Adding a related use case that would benefit from this evidence.
Client-side use case: agents (Claude Code, Codex CLI, etc.) currently query the graph without any built-in check on whether the returned data reflects the current HEAD. In practice this means an agent can answer "who calls X" or "where does Y live" from a graph that is days old and never surface the caveat, because there is no default policy that says "if stale, warn or refuse".
Proposal (complementary to what #786 already covers): on top of the additive evidence fields already proposed here, add an opt-in server-side policy so read tools (search_graph, query_graph, trace_path, get_code_snippet, get_architecture) can:
Refuse to answer when freshness.status == "stale" with a well-defined error the client MCP layer can catch, OR
Prefix the payload with a machine-readable warning.stale = true block that agent frameworks can promote to a user-visible caveat.
Config surface idea:
stale_policy = "off" | "warn" | "refuse" # default: "warn"
stale_threshold_files = 5 # or:
stale_threshold_paths = ["src/critical/**"] # any change under these triggers stale
Why this on top of #786: the evidence fields in #786 give the client the data to make a trust call. But every client would need to independently implement the same "if stale then X" logic, and in practice most agent contexts will not do that consistently -- I have seen this exact failure mode in a real session where the graph was anchored to a commit from three days back and the agent answered structural questions without disclaimer.
Having the server enforce a default policy (with an opt-out flag) turns this from "hopefully the client does the right thing" into "the tool tells you it can't answer honestly", which is the safer default for automation.
Happy to iterate on the config shape or send a PR if the direction fits the roadmap. Not a blocker for #786; this is a follow-up feature that leverages the evidence fields.
Hey guys, my name is Kamden, I created Higgs AI. I have a small controlled example that may help with the additive evidence discussed here and in #1734.
AI disclosure: Codex is posting this on my behalf with my authorization. Claude executed the experiment; Codex inspected the saved records and pinned source. This comment was prepared with both assistants. It is not an independent execution replication.
At commit 0f52d30c2964a5a538149f8b39846ba52517a020, built with scripts/build.sh on macOS arm64, a synthetic Python/C fixture produced these saved results through one-shot CLI calls:
Fixture state
Ordinary inbound trace_path, depth 1
Qualification available separately
A00: target with no caller anywhere in the fixture
0 callers, eq
Project contains an excluded directory
A02: target called only from that excluded directory
0 callers, eq
Exactly the same exclusion notice
A04a: caller appended to an indexed file after indexing
0 callers before explicit reindex; 1 afterward
Path coverage reports metadata_changed before reindex
A04b: caller added in a new file after indexing
0 callers before explicit reindex; 1 afterward
Path coverage reports not_tracked before reindex
The useful distinction is narrow: the caller response does not carry the available scope qualification. eq is correct: it describes an untruncated graph traversal, not completeness of source extraction. The exclusion notice cannot distinguish A00 from A02 or establish that the excluded subtree contains a caller.
Small supporting excerpts from the existing fixture and saved output
The full run also retained a direct-call positive control, which returned the correct caller. These are selected excerpts from the original fixture, not a separately executed reduced reproduction. The original fixture, commands and saved outputs are available if useful.
An existing workaround is index_status for recorded exclusions/parse gaps, then check_index_coverage for relevant paths. detect_changes can suggest paths from a Git diff, but it does not certify freshness. A freshness check of the target's file alone would not establish freshness of its callers elsewhere.
Would a short additive scope qualification on trace_path, identifying the indexed graph and pointing to recorded project coverage limitations, fit the direction here? It should not imply every project gap affects this symbol or that an absence of recorded gaps proves completeness. Alternatively, would you prefer a documentation change pointing users to the existing tools?
Limits: the commands used temporary shared-daemon sessions; persistent watcher behaviour was not established. Dynamic calls can remain invisible without a recorded gap. No agent-accuracy benefit was measured, and this does not reproduce the TypeScript defect in #1682. No wrapper or CBM patch was implemented.
Thank you for the newer controlled examples and for separating complete traversal from complete source coverage. The distinction between additive evidence and a server refusal policy is clear. Choosing the response contract versus a documentation-only step still needs a maintainer decision; no new API is being approved in this follow-up.
Thank you for your patience. Sorry for the delay. The response-evidence contract versus documentation-only approach is still awaiting a maintainer decision. I’ll follow up soon.
Thank you for your patience. Sorry for the delay. The response-evidence contract versus documentation-only approach is still awaiting a maintainer decision. I’ll follow up soon.
Activity
DeusData commentedon Jul 3, 2026
Thanks for the proposal. Triage: this fits the MCP/editor-client trust track (#395) and overlaps with the existing provenance/freshness direction in #559.
The useful constraint is backward-compatible evidence: clients should be able to tell fresh/stale/partial/resolved/inferred without existing consumers losing their current response fields. We should review this as additive metadata, with tests that strict MCP clients continue to accept the schemas.
rudi193-cmd commentedon Jul 5, 2026
Downstream trust metadata pattern — Willow
cbm_*facadeWe needed clients to know when graph output is untrustworthy for measurement without abandoning CBM for discovery. Shipped in willow-2.0
sap/cbm_facade.py:cbm_*response can carry alimitationsmap (F-001..F-008) — e.g. "fan-in may be collapsed", "verify aliased imports with grep"cbm_verify_callersreturns graph count vs grep count side-by-side withgraph_only/grep_onlydeltascbm_statussurfaces project slug, index freshness, and guardrail list at bootThis is additive client-side provenance, not server freshness — but it matches your "backward-compatible evidence" constraint: consumers that ignore the extra fields still work; agents that read them can down-rank stale or ambiguous graph claims.
Audit write-up:
docs/audits/CODEBASE_MEMORY_MCP_TOOL_EVAL_ADDENDUM_2026-07-05.mdpsanchez-mwb commentedon Jul 21, 2026
Adding a related use case that would benefit from this evidence.
Client-side use case: agents (Claude Code, Codex CLI, etc.) currently query the graph without any built-in check on whether the returned data reflects the current HEAD. In practice this means an agent can answer "who calls X" or "where does Y live" from a graph that is days old and never surface the caveat, because there is no default policy that says "if stale, warn or refuse".
Proposal (complementary to what #786 already covers): on top of the additive evidence fields already proposed here, add an opt-in server-side policy so read tools (
search_graph,query_graph,trace_path,get_code_snippet,get_architecture) can:freshness.status == "stale"with a well-defined error the client MCP layer can catch, ORwarning.stale = trueblock that agent frameworks can promote to a user-visible caveat.Config surface idea:
Why this on top of #786: the evidence fields in #786 give the client the data to make a trust call. But every client would need to independently implement the same "if stale then X" logic, and in practice most agent contexts will not do that consistently -- I have seen this exact failure mode in a real session where the graph was anchored to a commit from three days back and the agent answered structural questions without disclaimer.
Having the server enforce a default policy (with an opt-out flag) turns this from "hopefully the client does the right thing" into "the tool tells you it can't answer honestly", which is the safer default for automation.
Happy to iterate on the config shape or send a PR if the direction fits the roadmap. Not a blocker for #786; this is a follow-up feature that leverages the evidence fields.
docs(claude): add working notes pointer and code discovery policy (#33)
KamHiggs commentedon Oct 1, 2026
Hey guys, my name is Kamden, I created Higgs AI. I have a small controlled example that may help with the additive evidence discussed here and in #1734.
AI disclosure: Codex is posting this on my behalf with my authorization. Claude executed the experiment; Codex inspected the saved records and pinned source. This comment was prepared with both assistants. It is not an independent execution replication.
At commit
0f52d30c2964a5a538149f8b39846ba52517a020, built withscripts/build.shon macOS arm64, a synthetic Python/C fixture produced these saved results through one-shot CLI calls:trace_path, depth 1eqeqmetadata_changedbefore reindexnot_trackedbefore reindexThe useful distinction is narrow: the caller response does not carry the available scope qualification.
eqis correct: it describes an untruncated graph traversal, not completeness of source extraction. The exclusion notice cannot distinguish A00 from A02 or establish that the excluded subtree contains a caller.Small supporting excerpts from the existing fixture and saved output
Exact
.cbmignorecontents:Excerpt from
shop/targets.py:Complete
excluded/legacy_caller.py:Executed CLI arguments, supplied to the pinned binary by the recorded environment launcher:
Saved response text (records 008 and 018; trailing blank lines omitted):
The full run also retained a direct-call positive control, which returned the correct caller. These are selected excerpts from the original fixture, not a separately executed reduced reproduction. The original fixture, commands and saved outputs are available if useful.
An existing workaround is
index_statusfor recorded exclusions/parse gaps, thencheck_index_coveragefor relevant paths.detect_changescan suggest paths from a Git diff, but it does not certify freshness. A freshness check of the target's file alone would not establish freshness of its callers elsewhere.Would a short additive scope qualification on
trace_path, identifying the indexed graph and pointing to recorded project coverage limitations, fit the direction here? It should not imply every project gap affects this symbol or that an absence of recorded gaps proves completeness. Alternatively, would you prefer a documentation change pointing users to the existing tools?Limits: the commands used temporary shared-daemon sessions; persistent watcher behaviour was not established. Dynamic calls can remain invisible without a recorded gap. No agent-accuracy benefit was measured, and this does not reproduce the TypeScript defect in #1682. No wrapper or CBM patch was implemented.
DeusData commentedon Oct 19, 2026
Thank you for the newer controlled examples and for separating complete traversal from complete source coverage. The distinction between additive evidence and a server refusal policy is clear. Choosing the response contract versus a documentation-only step still needs a maintainer decision; no new API is being approved in this follow-up.
DeusData commentedon Oct 25, 2026
Thank you for your patience. Sorry for the delay. The response-evidence contract versus documentation-only approach is still awaiting a maintainer decision. I’ll follow up soon.
DeusData commentedon Dec 3, 2026
Thank you for your patience. Sorry for the delay. The response-evidence contract versus documentation-only approach is still awaiting a maintainer decision. I’ll follow up soon.