Repository navigation
Score the agent matrix on graph outcome instead of tool trajectory - #2245
Conversation
The matrix asserted on trajectory — which tool fired, how many times, in
what order — which disagreed with the product in three measured ways:
- A correct result scored as a failure. A model reaching the right end
state by a shorter path (update_node with no preceding resolve_query)
lost a point for the path rather than the result.
- Self-correction scored as a failure. A create_node rejected for a
missing node_type, corrected and persisted on the second call, red-
lined on an exactly-once rule — punishing the recovery we want.
- Severity was flat. Two search_nodes calls (nothing persisted) scored
identically to two create_schema calls (a spurious type the user has
to clean up).
Assert on the graph's end state instead, per tau-bench's design. Each
scenario gains an `end` clause that is now THE score; severity falls out
of it for free rather than needing a severity table.
Scenarios sharing a chat node also cascade, so a setup turn's failure was
counted as its own observation plus its successors'. 11a/11b are now
`setup: true`: run, asserted and warned about, but not scored.
`expect` is kept on every scenario and still evaluated, recorded beside
the score as a diagnostic — it answers how the model got there, which
outcome grading cannot, and a disagreement between the two is the signal
worth reading after a run.
Closes #2243
Co-Authored-By: Claude <[email protected]>
Measured against the live test daemon, a full edge walk cost 11.1s per snapshot on a 120-node database — two snapshots per scored turn would have added minutes to every run. Walking only the nodes a group created brings that to 778ms while still discovering the edge 11c asserts, verified end-to-end against the daemon. The obvious alternative — walk only what changed — is wrong and was caught by probing rather than by reading: create_relationship leaves BOTH endpoints byte-identical (same version, same modified_at), so that rule finds no edges at all and scores 11c, the one scenario measuring linking, as a false pass. Co-Authored-By: Claude <[email protected]>
Code Review SummaryVerdict: APPROVE WITH COMMENTS. This is a net-positive change that does what #2243 asked, and it is unusually well-reasoned for a measurement instrument. The three motivating defects are each closed by construction rather than by special-casing: path-agnosticism falls out of diffing, self-correction passes because only the end state is read, and severity falls out of I verified the PR's three stated claims against the code, and all three hold:
I also traced the winnability constraint the fixture sets for itself. Every
The soundness question I most expected to find a hole in — "if a model writes a node of a type not enumerated, does The fixture invariant tests in FindingsCritical IssuesNone. Nothing here would produce a false pass on the scenarios as written. Suggested Improvements1. [Improvement] The reviewer's question is whether a node of an unenumerated type escapes the snapshot and lets
So the set of types a model can create is exactly the set of schemas, and the snapshot enumerates all of them. That is the load-bearing argument for the clause being sound, and it is worth stating in the docstring, because it is the property a future change could silently break — the day A consequence worth noting: 2. [Improvement] The measurement that motivated the restriction is sound, and the But the two walk predicates differ in a way that is not merely a cost optimization: // before
edgesFor: (n) => groupNodeIds.has(n.id)
// after
edgesFor: (n) => groupNodeIds.has(n.id) || !before?.nodes.some((p) => p.id === n.id)The Concretely: if Two options, either is fine:
3. [Improvement] if (typeof expected === "number") {
const n = typeof actual === "number" ? actual : Number(actual);
return !Number.isNaN(n) && n === expected;
}
const n = typeof actual === "number" ? actual : typeof actual === "string" ? Number(actual) : NaN;This also makes the number branch consistent with the string branch, which already rejects non-string/non-number actuals explicitly. Low impact today (only scenario 9 uses a numeric 4. [Improvement] The reviewer flagged this and it is a genuine asymmetry worth naming. The node-query Trace the failure the reviewer asks about: if the daemon dies partway through edge enumeration, every subsequent The fix is small and matches the module's own stated principle: let the relationship-read failure propagate to the outer catch, or record it into 5. [Nit-adjacent Improvement]
Nitpicks
On the specific questions raisedSetup exclusion (11a/11b) delivers what the issue asked. No backward-compat shims that are unjustified. The two tolerances I checked are both legitimate: the optional Test quality is high. 48 new tests, and the ones that matter test the disagreement with the old scorer rather than agreement — the test file docstring states this explicitly and the tests deliver it. The gaps: nothing tests the asymmetric edge walk in None of the above blocks merge. Improvements 2 and 4 are the two I would want addressed before this instrument's numbers get quoted in a decision, since both are paths where an environment fault or a daemon-materialized edge could be read as a model verdict — the exact failure class this PR exists to eliminate. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE WITH COMMENTS (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
…rdict The two findings worth fixing before this instrument's numbers get quoted, both paths where something other than model behavior could score a scenario: - graph.ts: the relationship-walk catch could mask a dying daemon as "no edges", scoring 11c as "no 'mentions' edge was recorded" with no captureError set. Verified against a live daemon that `relationship get` exits 0 even for an undeclared relation AND a nonexistent node id, so there is no legitimate failure to tolerate — the catch could only ever hide a real fault. Now propagates to the outer catch. - runner.ts / end-state.ts: the edge walk is asymmetric (a node new since `before` had no edges walked there), so every edge on a newly-created node reports as added. An unpinned `createdEdge` would pass on any turn that created a node. A fixture invariant now requires a named relation, and the asymmetry is documented rather than left implied. Also: - valueMatches no longer coerces arrays: Number([8]) === 8 meant [8] satisfied hasPropertyValue: 8. - diffSnapshots compares properties key-order-independently; a daemon reserialization would otherwise red out the five expectNoWrites reads. - types: ["task","text","note"] -> []. Verified identical coverage (118 nodes, 18 schemas): schema enumeration already covers it, and the daemon refuses to create a node whose type has no schema — which is the unstated invariant expectNoWrites rests on, now documented. - markerFor() shared by both render sites, which disagreed on precedence. - ScenarioResult.graphDiff typed GraphDiff rather than unknown. Skipped: trimming daemon-managed core types from enumeration. Measured at 106ms for the whole node pass, so the round-trips cost nothing worth the coupling to which types the daemon happens to seed. Co-Authored-By: Claude <[email protected]>
Review addressed — commit b6393f4All five improvements and all three nits addressed; one trimming suggestion skipped with reasoning. Verdict was APPROVE WITH COMMENTS with no critical issues, and the two findings called out as "worth addressing before this instrument's numbers get quoted" are both closed. The two that mattered#4 — relationship-walk catch masking a dying daemon. Fixed, and the review's reasoning turned out to be stronger than stated. I probed the live daemon: #2 — asymmetric edge walk. Took option 1, as recommended. Others
Skipped (1)Trimming daemon-managed core types from enumeration. The review flagged this as "worth measuring before acting" — I measured: the entire node-enumeration pass is 106ms, not a meaningful share of a run whose turns take seconds. Trimming would couple the snapshot to which types the daemon happens to seed, in exchange for saving nothing. Revisit if the schema list grows enough to show up in a run's wall clock. Testing
|
Review Type: Re-ReviewPrevious Review Summary — comment 5382610688, APPROVE WITH COMMENTS, no critical issues.
Scope: Verdict: APPROVE. Both headline findings are closed at the right layer, and the fixes are better-reasoned than the review that asked for them — #4 in particular came back with a live-daemon probe that strengthens the argument rather than merely satisfying it. The two new findings below are cosmetic; neither affects a measurement. Part 1 — Verification of prior recommendations#4 (headline) — relationship-walk catch masking a dying daemon: CLOSED, and better than asked forThe review asked for one of "propagate, or narrow the catch to the legitimate failure and say so". The author did the strictly stronger thing: probed the live daemon, found I verified the abort path the re-review brief asks about, and it is safe by design, on this path, for real:
The one thing worth naming explicitly, since it is load-bearing and nobody has written it down: Net: the reported failure mode is gone. A mid-walk daemon death now surfaces as #2 (headline) — asymmetric edge walk / unpinned
|
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.
…omain
Both findings from the re-review, documentation-only:
- runner.ts: markerFor was inserted between partitionExcluded's docstring
and its declaration, leaving two stacked doc comments with the first
attached to the wrong symbol. Reordered. Its precedence comment also
implied an observable divergence — a result cannot carry both flags,
since excludedAsSetup is only assigned after the empty-generation
branch continues — so it now says the ordering is defensive.
- graph.ts: stableStringify is the only comparator behind changedNodes,
which expectNoWrites reads, so it is one of the few places a false PASS
could originate. Its safety rests on values always coming from
JSON.parse of CLI stdout; that guarantee is now stated, along with the
two unreachable collapses (undefined/null, Date -> {}) it permits.
Also notes on partitionExcluded that a failed capture scores as `failed`
rather than forming a third exclusion bucket — deliberate, so an
environment fault is loud rather than quietly shrinking the denominator.
Co-Authored-By: Claude <[email protected]>
Re-review addressed — commit 258aa95Both new nits taken. Documentation-only; no logic changed, tests remain 185 pass / 0 fail.
Thanks for the verification work on the abort path and the invariant — confirming |
Heads-up: conflicts with #2246, which just merged (
|
Three sibling PRs landed on main touching the same files. They compose rather than conflict, but the seams needed real resolution: #2247 (--runs / pass^k) restructured the runner around reps: the flat `summary`/`results` on EvalResults became `aggregate`/`reps`, and the scenario loop moved into a per-rep function. My per-run counts moved to RepSummary, and the report sums them across reps rather than quoting the first. The seam that actually mattered: `aggregateReps` filtered only `excludedAsEmptyGeneration`, so setup scenarios would have counted toward pass^k — putting the cascade back one level up, where a flaky setup turn reads as an unreliable SCENARIO rather than as its successors' reps not being comparable. ScenarioReliability now carries `setup`, the aggregate excludes it, and the reliability table renders it as ⊙ setup rather than as a degenerate empty generation (both have scoredReps === 0). Four tests pin it; verified they fail if the filter is reverted. #2246 (scenario audit) added scenario 11c2, which had no `end` clause — caught by my own fixture invariant rather than by the merge. It asserts both halves (the note exists AND the edge reaches it), because it is the create-and-link-in-one-turn shape: asserting only the edge would pass on a turn that linked the wrong node, and only the node would pass on the prose-instead-of-an-edge failure 11c exists to catch. It is also the shape the asymmetric `after` walk was built to see. Notably #2246 reached the same conclusion for scenario 6 independently — assert the outcome, not the route — and relaxed its trajectory expectation for the reason this PR exists. test:all green: 227 frontend files / 4794 tests, 214 scripts, 24 skill, 53 Rust binaries including #2246's new winnability suite. Co-Authored-By: Claude <[email protected]>
Merged main — commit 9100ea9Three sibling PRs landed while this was in review (#2244, #2246, #2247), all touching the same files. They compose with outcome grading rather than contradicting it, but two seams needed real resolution rather than textual conflict-picking. #2247 (
|
* Restore indirect-reference decomposition coverage with a comparative referent (closes #2248) Scenario 6 was the matrix's only test of multi-step indirect-reference decomposition. #2242 removed its `[resolve_query, update_node]` assertion for a good reason — the referent turned out to be recoverable from history by string match — which left the capability unmeasured and `toolSequence` used by zero live scenarios. Adds scenario 12 (12a-12d) as its own group, keying the reference off a COMPARATIVE ("whichever is the biggest job") over an estimate spread across three separate create_node facts. Each fact still renders its value and id inline, which is unavoidable; what no fact states is the ORDERING across them. That is the indirection scenario 6 lost. Both halves of the #2242 winnability discipline are proved before the scenario is trusted, rather than assumed: - `scenario_12_history_does_not_resolve_its_comparative_reference` renders the REAL history and asserts the three instances and their estimates are present while the ordering words are absent. Asserted in both directions so it cannot pass vacuously on an empty render — verified by deliberately breaking it. - `scenario_12_ideal_comparative_chain_is_accepted_and_the_read_carries_the_values` proves against a live backend that the read surfaces all three instances WITH their estimates and that the write on the winner persists. 12d scores on the end state (`updatedNode` pinned to the 21-day instance) and keeps `toolSequence` as the trajectory diagnostic, per the model #2245 landed. `contentMatches` on the correct target is the whole assertion: a model that resolves the comparison wrongly still calls update_node and still persists a property, so a clause that only counted properties would score that green. `minProperties: 2` rather than 1 because the node already carries its estimate from 12b — 1 would pass on a turn that resolved correctly and then wrote nothing. Also surfaced by the audit, and NOT fixed here (filed separately): `run_node_query` silently drops `sorting` when `filters` is empty, because that branch calls `node_ops::query_nodes`, which is never passed it. A model asking for "the biggest" via sorting+limit gets the first row back with no error. `filterless_search_silently_ignores_sorting` pins the current wrong behavior so the fix is detected; the sorted-route winnability test carries a compensating filter with a comment explaining why. Scenario 12 stays winnable regardless — enumerate-then-compare works, and that is the route its diagnostic names. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG * Cross-reference the sorting bug (#2249) from the tests that work around it The winnability audit for scenario 12 surfaced that search_nodes silently drops `sorting` when `filters` is empty. Now that it has an issue number, point at it from the three places a reader lands: the test that pins the current wrong behavior, the sorted-route test carrying the compensating filter, and 12d's own diagnostic comment — where a red should be checked against the trajectory before being read as a decomposition failure. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG * Address review: rescope scenario 12 to what it actually measures The review dumped the real rendered history and refuted this PR's central claim. All three estimates and all three ids are rendered adjacent, uniform, inline — max(9, 21, 4) is an in-context comparison, so a model can go straight to update_node with the right id and never read anything, and that is a CORRECT answer. The absence proof showed the ordering is not lexically STATED; the comments treated that as showing it is not DERIVABLE. Those are different, and derivability is what makes a reference indirect. That is a subtler repeat of the scenario 6 defect #2242 found, and it survived an absence proof precisely because the proof asserted the wrong property. Every scalar a scored turn writes is replayed inline by terse_write_fact, so no value this chain writes can be made underivable by wording alone. Closing #2248 properly needs a referent the agent never wrote, which needs out-of-band seeding the runner deliberately does not support. Rather than ship a weaker scenario under the stronger banner, this rescopes the claim: - Group renamed "Comparative reference resolution"; header now shows the actual rendered history and states plainly what it does and does not establish. - Scenario 6's comment reverted to saying the decomposition gap is STILL OPEN (#2248 stays open); 12 is named as nearest cover, not a replacement. - Daemon test renamed scenario_12_history_states_the_values_but_not_the_ordering with a docstring scoping what it proves. The negative assertion is kept: it would catch terse_write_fact starting to emit a superlative, which would decay 12d into the string match that cost 6 its indirection. Also addressed, from the same review: - 12a-12c marked `setup: true` (were not, against the group doctrine at agent-matrix.ts:66-78). Without it one 12a defect counts four times in the denominator — the cascade bug #2242 fixed for 11a/11b. Invariant test updated from ["11a","11b"] to the full set. Denominator is now 20 scored, not 25. - 12b split into 12b + 12b2, one instance each. The two-node prompt carried `toolOnce create_node`, which requires EXACTLY one call: correct behavior (two calls, or create_nodes_from_markdown) scored red, and creating only one node scored green. Splitting also lets each turn carry noUnexpectedNodes, which a two-instance turn cannot state. - 12d's `toolSequence [search_nodes, update_node]` replaced with `noRetry update_node, minCalls: 1`. The subsequence pinned one of four legitimate read spellings and reds out the shortest correct route. Scenario 11c documents the same reasoning. Consequence, stated rather than buried: toolSequence is again used by no live scenario. Reviving it needs a scenario whose route is genuinely forced, which is the same thing #2248 needs — so it stays dead rather than being revived by asserting something untrue. 12d's minProperties: 2 is kept, with its residual weakness now documented: it asserts a second property became populated, not that it holds the right value, because the clause vocabulary cannot express "some property equals boolean true" (hasPropertyValue intercepts `true` as "any present value" at end-state.ts:161, and its string branch rejects booleans at :177). test:all exits 0; quality:fix clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012A1ryuphm1PidSY1KTvcKG --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Closes #2243.
The matrix asserted on trajectory — which tool fired, how many times, in what order. This moves it to outcome: what the user's graph looks like when the turn ends, with trajectory retained as a diagnostic.
The three disagreements this fixes
Each is a live observation from the runs on the issue, and each scored the wrong way:
resolve_querysearch_nodesvs twocreate_schemaSeverity now falls out of the model for free rather than needing a severity table: a repeated read persists nothing and passes, while a repeated schema creation leaves an extra type in the user's graph and fails
createdSchemas.What's here
scripts/eval/graph.ts— snapshot capture and diffing, read through the samenodespaceCLI every eval turn already goes through. No Rust changes.scripts/eval/end-state.ts— the clause model (createdNode,updatedNode,createdSchemas,createdEdge,expectNoWrites,noUnexpectedNodes) and its scorer, pure over a diff.graphcapability onEvalFixture— opt-in, so the routing eval (which writes nothing) pays nothing.setup: true: run, asserted, and warned about if they fail, but excluded from the denominator. Groups share a chat node, so one ambiguous verb in 11a previously cost three points; it now costs only the successors it genuinely invalidates.Two things found by probing rather than reading
Both were verified against the live test daemon, not inferred:
create_relationshipleaves both endpoints byte-identical — sameversion, samemodified_at. The natural optimization ("walk edges only for nodes that changed") therefore finds no edges at all and would have scored 11c — the one scenario that measures linking — as a false pass.Winnability
createdSchemasis a count, not a name, and scenario 9 asserts a value viahasPropertyValuewithout naming the key — the model chooses type identifiers and property keys, so pinning either would measure this fixture's vocabulary guess rather than the model's behavior (the #1846 trap).Testing
bun run test:all— 227 frontend files / 4794 tests, 177 scripts tests, 24 skill tests, 52 Rust binaries. All green, no regressions vs baseline.endclauses (verified to actually bite by breaking a scenario and watching one fail).🤖 Generated with Claude Code
https://claude.ai/code/session_01C8zV17aUG2B1NPPe84fHAx