Reply diet: semantics once per session, provenance scoped to the answer, grep-parity line text (zero-fallback) #557
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
h-dv/code-index#557
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the zero-fallback epic (#555). Cause 3: a reply must not cost more than the shell answer it replaces.
Observed (lead session 2026-11-09, 6 linked trees)
evidence_gapswith its fullsemanticsparagraph,index_snapshot, andanswer_provenance.indexed_treeslisting ALL linked worktrees (6 entries), even when the call targeted one project. That is roughly 1 KB of fixed envelope per reply (observed, not yet measured exactly; sub-issue 1 measures it).search_texthits carrysnippet_origin_semantics(a paragraph) per reply.find_callerscarriesconfidence.verification,graph_semanticsandsymbol_shape_excluded_semanticsparagraphs every time.grep -nanswer costs a fraction of that.Proposal: say each thing once per session, and only what changed
*_semantics/verificationparagraph ships the first time it appears in a session, after that as a short key ("semantics_ref": "evidence_gaps/v3"), resolvable via a resource (code-index://docs/..., which already exists for cursors and ref kinds). Disclosure is preserved, because the agent saw it once and can re-read it.answer_provenance.indexed_treeslists only the projects that answered, plus any tree whose state is abnormal (restarted, reconciling, wrong-root suspicion). Others are summarised as a count.evidence_gapsomitted when this reply names no partial source AND none could affect it. Keep the field when it matters (a count is a floor).search_textreturns line text for the matched lines by default (bounded), because that is whatgrep -ngives and why agents switch.Every removal keeps the honesty contract: a disclosure that changes the meaning of THIS answer is never dropped.
Acceptance
search_symbols/search_text/find_callers/read_codedrop by ≥ 40% with no lost disclosure. A registry test lists every semantics key and proves each is served once per session and resolvable.Input from worker dogfood (codex-531):
change_impact(limit=0)is documented as "count-only" for the three evidence lists, buttest_role_filesis still answered in full, which was hundreds of paths onbusy.rs/index.rsseeds. That is by the tool's own contract, but an agent asking for counts pays for a path list. Proposal for this issue:limit=0(or atest_role_files_limit) makes the reply truly count-only, with the full list one call away.The lever already exists, but no agent sees it (lead measurement 2026-11-09)
envelope: "minimal"("no prose, same fields") is implemented and works.search_symbols("detect_root", concise)returned about 2,300 chars with the default full envelope and about 1,100 chars withminimal(about −50%). It drops onlyanswer_provenance,index_snapshotand every*.semanticsparagraph. It keeps every field and state (partial_sources_in_index,index_state: reconciling) and points tocode-index://docs/envelope.server.rs~4154), and clients truncate the instructions (this session's copy ends in[truncated], see #521). Five worker sessions and the lead never used it.tool_ux_e3_e2e.rsthe_default_envelope_is_unchanged_and_a_bad_mode_is_refused(FINDING 5: "default == explicit full, byte for byte").Interim (done,
integration-1109824e65d5): CLAUDE.md and AGENTS.md tell every agent to passenvelope: "minimal"+response_format: "concise".Proposal for this issue (replaces item 1 of the body): make the session pay for prose ONCE.
minimalwithsemantics_ref.answer_provenanceships only when it changed since the last reply in this session, or is abnormal (restart, reconcile, wrong-root suspicion).envelope: "full"stays available per call. A server flag or env var can force the old default for clients that cannot keep state.envelopehint to the FIRST lines of the instructions until then.Acceptance: the FINDING 5 test is replaced by a session test (first reply full, second minimal, identical fields), and the median reply bytes on the #556 benchmark drop ≥ 40%.
Two more measured inputs for the reply diet (codex-512 dogfood, D4 and D10):
read_codecan exceed a useful output budget. Several ranges come back in full, even when the caller only needed a few lines of each.concisechanged_symbolsreply is still bulky for a cross-cutting edit. Each touched symbol repeats per-symbol detail that a per-file summary would cover.Done on branch
agy-557(877ca038, Gemini 4) and merged intointegration-1109(f9b9fa64). Nothing is pushed yet.(json_pointer, prose)pair ships in full the first time it appears in an MCP session. Later replies drop it and carrysemantics_ref: "code-index://docs/envelope"instead. Prose whose text changes ships again.answer_provenanceships only when it changed (head, uncommitted changes, root, build) or is abnormal: a daemon restart, build skew, unavailable or unmeasured tree state, a reconciling index, or a measured-absence error.symbol_shape_excluded_semantics;evidence_gaps.semanticswhen an unmeasured population, unfollowed name fallback or verdict downgrade is present;context_pack, which measures its own budget.envelope: "full"per call, orCODE_INDEX_ENVELOPE=fullfor clients that keep no state.envelope: "minimal"is unchanged. The minimal hint is now line 1 of the instructions, anddocs/envelopecovers every semantics key.search_symbolssearch_textfind_callersread_codetool_ux_e3_e2e, with session dedup and a provenance change or restart. Mutations ran red: "always minimal", "never minimal", "always omit provenance" and "omit after call 1".75c3a12c, CLAUDE.md and AGENTS.md):response_format: "concise"is now passed only where a tool offers it. The blanket rule maderead_codeandproject_overviewrefuse the first call (worker dogfood D1).codex-531 dogfood D4:
change_impactwith count-only +concisestill returnedtotal_affected: 1621plus 239 test-role file paths. A real counts-only shape is wanted: totals only, plus a resource link for the run set.Status (local
integration-1109@60368c0d, full gate run green): payload ratchets (codex-f2).Reserve::Required{64}.EXTENSION_SEMANTICSnow includes eligible walk-only extensions.Released in v0.41.48 (source PR #564). Shipped: disclosure prose once per MCP session,
semantics_refon later replies,answer_provenanceomitted when unchanged and unremarkable, andenvelope: "full"/CODE_INDEX_ENVELOPE=fullto restore the full text.🤖 Generated with Claude Code
One item tried in the v0.41.50 train was withdrawn before release: emptying
change_impact'stest_role_filesatlimit: 0. The agent task benchmark asks its which-tests questions with exactly that call and lost one hand-verified answer on each of two repositories.limit: 0behaves as in v0.41.49 and additionally reportswitness_paths_total. A diet for that list needs a different shape (for example a cap with a total, asreview_diffhas) and a benchmark plan that still gets the run-set in one call.Merged into #521.
Session prose/provenance dedup shipped in v0.41.48; tool_ux_e3_e2e.rs grades session behavior.
Remaining: Search evidence and filters; Reply budgets and disclosures, preserving one-call which-tests answers.