Repository navigation
Measure indirect-reference decomposition with an out-of-band seeded referent - #2251
Conversation
…eferent (closes #2248) Adds scenario 13, whose referent the agent never wrote — the thing #2248 asked for and that two prior attempts could not provide. THE FINDING THOSE ATTEMPTS PRODUCED. Scenario 6 asserted a resolve-then-act chain for "the five-day one"; #2242 found the referent was a direct string match, because a create_node write is replayed into later turns as a terse fact carrying its property values AND its id inline. Scenario 12 then keyed off a COMPARATIVE over three written values; #2250's review found that fails the same way for a subtler reason — the values are all inline, so the ranking is derivable in-context without reading anything. Generalised: NO VALUE A SCORED TURN WRITES CAN BE THE REFERENT. Every scalar the agent writes is replayed, so the target is always in the prompt as literal text. A genuinely indirect reference needs a referent the agent never wrote. WHAT MAKES THAT POSSIBLE. `EvalFixture.seedGroup` establishes graph state before a group's first turn, through the CLI. `completed_writes` is built only from a turn's own tool executions, so seeded nodes leave no trace in the rendered prompt — not a title, not a property, not an id. This is not a reversal of the harness's "assert, do not own" stance, which is about DAEMON AND DATABASE LIFECYCLE: the caller starts the daemon and owns the DB, and still does. Writing nodes through the CLI is something the runner has always done for every group — `newChat` creates the chat node exactly this way. The hook names that existing capability rather than adding a new kind of power. Scenario 13 seeds three incident records, one of which Rowan was on call for, and asks to resolve "the incident Rowan was on call for". Nothing in history identifies it, so the model must look it up. Both halves proved rather than assumed, per the #2242 discipline: - `scenario_13_seeded_referent_is_absent_from_history` renders the REAL history and asserts the on-call name, all three titles, the type and the property name are all absent, with a positive assertion so it cannot pass vacuously. - `scenario_13_ideal_lookup_then_write_is_accepted` proves against a live backend that the property filter returns the one matching incident and NOT the other two, and that the write persists. `toolSequence` is live again, on 13, and honestly: this is the only scenario whose route is forced, because the id cannot be known without a read. A new invariant pins that it is asserted nowhere else — reviving it on a turn where a direct write is also correct is the mistake #2242 removed from scenario 6 and #2250 removed from 12d. Also found while proving the absence, and pinned rather than assumed away: `a_turns_own_write_leaks_its_targets_title_via_the_evidence_block`. The Fact: line for an update_node is id-and-values only, but the evidence block renders `update_node "<summary>"`, and `write_summary_arg` resolves an update's summary through content/title — so the node's title reaches the prompt. Harmless for 13 as written (single-scenario group, nothing reads that history) but a live constraint on extending it, and silent if unpinned. A second new invariant asserts no prompt anywhere names the seeded titles or type. It caught a real collision on its first run: scenario 8c's prompt already contained the name originally chosen for the on-call value, which would have put the referent in a shared chat's history. Renamed the seeded value rather than 8c's prompt, since ids are the baseline join key. test:all exits 0; quality:fix clean. Frontend baseline unchanged at 227/4794. Matrix is now 8 groups, 21 scored scenarios. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG
Code Review — PR #2251Review Type: Initial Review SummaryThis is the third attempt at #2248, and it is materially the strongest. But the central claim is stated too broadly, and the overreach is load-bearing:
The first half is true. The This is the same failure shape as 6 and 12 in its structure — a passing absence test that asserts the wrong channel — though it is less severe in consequence: what leaks is the vocabulary, not the answer. Scenario 13 still cannot be won without a read. So the scenario survives; its description does not, and one assertion ( Findings 1 and 2 should land before merge. Both are comment/test corrections plus one small design decision — no rewrite of the scenario is required, which is the good news here. Requirements Check — #2248
Findings🔴 Finding 1 — The "no trace at all" claim is false: the seeded schema (including
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
… fix two --runs defects The review found the headline claim false on one clause, and it is the third time an absence proof in this area asserted the wrong channel. Verified independently before acting. THE LEAK. `seedIncidents` creates a SCHEMA as well as three instances, and workspace context retrieves schemas semantically (SCHEMA_SIMILARITY_THRESHOLD 0.2) and interpolates them into the system prompt. So the seeded type name and its field names — including `on_call`, the property 13's reference keys off — are in front of the model on the scored turn. "Seeded nodes leave NO trace in the rendered prompt — not a title, not a property, not an id" was wrong on the property clause. SEVERITY, stated rather than softened: what leaks is the VOCABULARY, not the ANSWER. Only `"schema"`-type nodes are retrieved that way, so the three titles and the `rowan` -> `search index corruption` mapping stay out. Knowing an `incident_report` type exists with an `on_call` field tells the model how to ASK; it does not tell it which incident to update. The read is still forced and scenario 13 still measures what #2248 asked for. The description was wrong, not the measurement. Fixed by pinning the boundary rather than restating the claim: - New `scenario_13_seeded_schema_reaches_the_prompt_but_its_instances_do_not` (packages/core/src/ops/context_ops.rs) asserts the schema DOES render and instance data does NOT. Both directions, so if instance content ever starts reaching workspace context that test fails and 13's degradation is caught — which the history-side proof alone would not have noticed. - The claim in types.ts, the fixture group header, and the daemon test's own rationale all now name the channel they cover. The daemon test's `incident_report`/`on_call` assertions are kept (history is still a channel they have no business appearing in) but no longer imply the model cannot see them. - The `neverInAnyPrompt` invariant is split: titles are a real guarantee (absent from every channel); the schema names are fixture tidiness only. A future author designing against "the model has never heard of on_call" would have been designing against something this fixture cannot deliver. TWO --runs DEFECTS, both of which would have surfaced as model non-determinism and corrupted the pass^k measurement --runs exists to produce: - DUPLICATION: seedGroup runs per rep, so rep 2 had two `rowan` incidents and rep 3 three, at which point the on-call filter stops identifying one node. - NO-OP: 13's turn sets `resolved: true`, and `updatedNode` scores off the DIFF. Left as rep 1 finished it, rep 2's correct write produces no `changedNodes` entry and scores red. Found by tracing the clause rather than by running --runs. Seeding now queries by type, creates what is missing, and RESETS what is already there. Also: narrowed the "route is forced" claim in both the fixture and the invariant. A READ is forced; WHICH read is not — `resolve_query` reaches the same node. Acceptable only because `expect` is a diagnostic and not the score (#2243), and now said so explicitly rather than overstated a third time. Added `scenario_13_runs_with_no_prior_history` to pin 13's real (empty) history shape alongside the stricter non-empty case. test:all exits 0; quality:fix clean. Frontend baseline unchanged at 227/4794. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG
Addressed review —
|
Code Review — PR #2251 (Re-Review)Review Type: Re-Review — scope limited to Previous Review Summary
The 🔴 is genuinely resolved, and resolved the right way — by narrowing the claim to what is provable rather than by weakening the test until it passed. I re-executed the renderer and re-read the retrieval path to confirm the new claims independently rather than taking the comments at their word. Verification PerformedI checked every load-bearing assertion against the source rather than the prose describing it. 1. 📁 2. Reset-vs-snapshot ordering is correct. 📁 3. CLI JSON shapes match what the seeding code parses.
4. Partial-seed state is handled. The 5. Failure modes. Tests run — all green:
Requirements Check (#2248)
This closes #2248. More than that: the PR now measures the thing the issue asked for and documents the boundary that made the two prior attempts wrong, which is the more durable contribution. Findings🔴 CriticalNone. 🟡 ImportantNone. 🟢 Suggestions🟢 1. The new test's negative half is vacuous by construction — and the comment implies it is a live tripwire. 📁 This is the one place where the prose still reaches slightly past what the code can deliver, so it is worth naming precisely even though nothing here is wrong. The four negative assertions loop over instance strings and assert they are absent from The docstring says the test is "Pinned in both directions" and that "if instance CONTENT ever started reaching workspace context, [this] test fails". It would not. The type system already prevents that, and if someone widened To be clear about severity: the positive half is the valuable half, and it is sound. It is what refuted the original 🔴, and it will genuinely fail if the schema block stops rendering type or field names. The negative half is harmless and cheap. My concern is only that a future reader trusting "pinned in both directions" would believe they have a regression alarm they do not have. Suggested wording, replacing the "Pinned in both directions" paragraph:
Engineering principle: a test's docstring should describe the guarantee it actually enforces. An overstated one is worse than no test, because it suppresses the instinct to write the real check — which is the precise failure mode this PR exists to correct, applied one level up. 🟢 2. 📁 The split into
On the declined suggestion (🟢 F7,
|
| Location | Claim | Verdict |
|---|---|---|
📁 scripts/eval/types.ts:276-292 |
"absent from the rendered chat history entirely"; schema vocabulary DOES reach the prompt; instance data does not | ✅ Accurate. Correctly scopes to completed_writes and names the channel. |
📁 scripts/eval/fixtures/agent-matrix.ts:1558-1580 |
Same boundary, plus "seeding hides the answer, not the vocabulary" | ✅ Accurate and well-framed. |
📁 scripts/eval/fixtures/agent-matrix.ts:1588-1598 |
"A READ is forced… WHICH read is not" | ✅ Accurate. The resolve_query caveat is the right narrowing. |
📁 packages/daemon/src/services/local_agent_service.rs:4213-4224 |
"Absent from HISTORY… but NOT absent from the prompt overall" | ✅ Accurate, and the "do not read these two lines as proof" warning is exactly the right instinct. |
📁 scripts/eval/fixtures/agent-matrix.test.ts:839-845 |
neverReachesTheModel — "absent from chat history AND from workspace context, which retrieves only "schema"-type nodes" |
✅ Verified against 📁 packages/core/src/ops/context_ops.rs:320-327 — retrieval is scoped to node_type == "schema" and re-resolved from get_all_schemas(), so instance nodes cannot enter. |
📁 scripts/eval/fixtures/agent-matrix.test.ts:862-869 |
notInFixturePrompts — explicitly NOT a runtime guarantee |
✅ Accurate; the disclaimer is the important part and it is present. |
📁 scripts/eval/fixtures/agent-matrix.test.ts:905-917 |
toolSequence limit, expect-is-diagnostic |
✅ Accurate. |
📁 packages/core/src/ops/context_ops.rs:491-518 |
New test docstring | |
📁 packages/daemon/src/services/local_agent_service.rs:4238-4247 |
scenario_13_runs_with_no_prior_history — "Trivial by construction, and that is the point" |
✅ Accurate and self-aware about being trivial. This is the disclosure style 🟢 1 asks for, applied correctly — which is why the gap in the other docstring stands out. |
One sentence overstates, in a way that is documentation-only and cannot produce a false pass. Everything else matches.
Assessment
This revision does the thing that neither prior attempt nor the first revision did: it establishes the boundary empirically, then narrows every claim to sit inside it. The author also found a defect I missed (the updatedNode/diff interaction under --runs) and fixed it correctly, including the snapshot-ordering subtlety. Verifying the reset lands before the pre-turn snapshot is not obvious, and it is right.
The remaining finding is a docstring that promises a tripwire the type system already makes unnecessary. That is a real note — this PR's whole subject is claims outrunning their evidence — but it is one paragraph of prose in a test whose valuable half works, and it cannot cause a false pass. Net positive by a wide margin.
Recommendation: APPROVE — with 🟢 1 worth a one-paragraph edit before or after merge, author's call.
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
…it is not The re-review approved, leaving one documentation-only finding. Fixing it rather than deferring, because it is the same CLASS of error as the three defects that preceded it: a comment asserting a test guards something it does not actually check. `scenario_13_seeded_schema_reaches_the_prompt_but_its_instances_do_not` has two halves of very different strength, and the docstring described them as one: - The POSITIVE half is real. It is what refuted the original "no trace in the prompt at all" claim, and it fails if schema rendering stops including type or field names. - The NEGATIVE half is vacuous by construction. Verified: `relevant_schemas` is `Vec<SchemaNode>`, and SchemaNode carries only id, content (display name), fields and templates — no field can hold an instance title or property value, so no input to `format_for_prompt` could make those four assertions fail. Saying it was "pinned in both directions" therefore promised a tripwire that does not exist. What actually protects scenario 13 is that `semantic_search_nodes_of_type` retrieves only `"schema"`-type nodes; if that widens, instance data reaches the prompt, 13's referent becomes directly matchable, and NO test in this repo fails. That is now written down at the fixture, in types.ts, and in the test itself, naming the retrieval call as the thing to check before changing workspace context. Also split the prompt-scanning invariant into two named tests. One name was spanning a real guarantee (incident titles reach the model through no channel) and mere housekeeping (schema vocabulary is kept out of prompts for clarity, though the model sees it anyway via workspace context). A single name covering both would let the weaker claim borrow the stronger one's credibility. Declined the runNs/runCli DRY suggestion, which the re-review accepted: `runCli` is module-private in graph.ts, and exporting a scoring-module helper to save ~12 lines in a fixture widens an API surface for a consumer it was not designed for. test:all exits 0; quality:fix clean. Fixture invariants now 70 tests. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG
Addressed re-review —
|
Closes #2248 — this time for real. Follows #2250, which explicitly did not.
The finding that made this possible
Two prior attempts failed, and their failures generalise into one rule:
create_nodewrite is replayed into later turns as a terse fact carrying its property values and its id inline.max(9, 21, 4)is derivable in-context without reading anything.A genuinely indirect reference therefore needs a referent the agent never wrote.
What this adds
EvalFixture.seedGroup(env, group)— establishes graph state before a group's first turn, through the CLI.completed_writesis built only from a turn's own tool executions, so seeded nodes leave no trace in the rendered prompt: not a title, not a property, not an id.Worth being precise about the design stance, since I initially read it as a blocker:
"assert, do not own"and"never starts or seeds anything"are about daemon and database lifecycle — the caller starts the daemon and owns the DB, and still does. Writing nodes through the CLI is something the runner has always done for every group;newChatcreates the chat node exactly this way. The hook names an existing capability rather than adding a new kind of power.Scenario 13 seeds three incident records, one of which Rowan was on call for, then asks: "The incident Rowan was on call for — mark it resolved." Nothing in history identifies it. The model must look it up.
Both halves proved, per the #2242 discipline
scenario_13_seeded_referent_is_absent_from_historyscenario_13_ideal_lookup_then_write_is_acceptedsearch_nodesroutes throughQueryService, a different code path from every other scenariotoolSequenceis live again — honestly this timeScenario 13 is the only scenario whose route is genuinely forced: the id cannot be known without a read. That is the one condition under which asserting a subsequence is truthful, and a new invariant pins that it is asserted nowhere else — reviving it on a turn where a direct write is also correct is the mistake #2242 removed from scenario 6 and #2250 removed from 12d.
Two things found while building this
A title leak, pinned rather than assumed away.
a_turns_own_write_leaks_its_targets_title_via_the_evidence_block: theFact:line for anupdate_nodeis id-and-values only, but the evidence block rendersupdate_node "<summary>", andwrite_summary_argresolves an update's summary throughcontent/title— so the node's title reaches the prompt. Harmless for 13 as written (single-scenario group, nothing reads that history), but a live constraint on ever extending that group, and completely silent if unpinned.A real collision, caught by the new invariant on its first run. The invariant asserting no prompt names the seeded titles or type immediately failed: scenario 8c's prompt already contained the name I'd picked for the on-call value, which would have put the referent into a shared chat's history. I renamed the seeded value rather than 8c's prompt, since ids are the baseline join key and rewording 8c would change what it measures.
Verification
bun run test:allexits 0; all three new tests confirmed running inside itbun run quality:fixclean; full pre-push gate green🤖 Generated with Claude Code
https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG