Repository navigation
Make the create_schema eval assertions able to see a failed schema creation (#1799) - #1805
Conversation
…eation (#1799) The noExtraTypes assertion counted create_schema calls and never checked what was persisted, so a call that was rejected outright still scored as a pass. The evidence needed to see the failure was already produced and already printed — aichat.ts emits an [ERROR] marker per tool call — but runner.ts kept only the tool name and discarded the rest of the line. Carry the outcome alongside the name: - agent_loop.rs logs result_field_count, taken from the tool RESULT rather than its arguments. Args are the model's report of what it asked for; the result is what the executor persisted. A bare integer because both previews truncate at 300 chars, and a realistic create_schema payload exceeds that — a parser reading them would fail on exactly the well-formed calls it should pass. - TurnRecord gains toolCalls alongside toolsCalled rather than replacing it, so routing.ts needs no edits and recorded baselines still join in compareToBaseline. - Both the noExtraTypes and toolOnce branches now check schema soundness. Scenarios 8a/8b reach create_schema through toolOnce and had the identical count-only hole; fixing only noExtraTypes would have left two thirds of the measurement defect in place. The check catches two distinct failures. A rejected call persists nothing. A call carrying neither fields nor description SUCCEEDS and persists a type with no properties (schema/mod.rs:275-277) — invisible to any check that only asks whether the call errored. Absent fieldCount is treated as unknown, so baselines recorded before this do not read as fresh failures. Both branches verified by mutation testing: reverting either one fails exactly its own two tests and no others. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C2fwCrhS3Bfq4uDGM61iCr
Pragmatic Code Review — PR #1805Review Type: Initial Review (0 prior reviews/comments) Verdict up front: this is a measurement fix that makes a previously-invisible failure visible, and it is correct where it matters most. I verified the central risk myself — that the check might not actually catch its target bug — and it does. Two findings, both about comments/redundancy rather than behavior. Net positive; approving. Requirements Check (issue #1799)Acceptance criteria:
Work checklist items 3-5 (routing 📝 On the scope decision — I think it is correct, and I want to be explicit about why rather than just deferring to the author. The change was implemented and measured, not hand-waved: 6/12 → 3/12 under controlled conditions (purged DB, rebuilt daemon, 📝 On not recording a baseline (item 2) — also correct, and this is the more interesting judgment. The issue itself documents that three runs of identical code scored 10/12, 9/12, 8/12 with scenario 5 flipping pass/fail/pass. At n=12 with only 3 schema-exercising scenarios, a recorded number could not clear its own noise floor, and committing one would manufacture false precision that later work would over-read. The issue also explicitly de-targets the headline score. Critically, the correctness claim here does not rest on an eval score at all — it rests on mutation testing, which is a deterministic argument. Recording a noisy number would have added no evidence and some risk. Verification I performedI did not take the PR's claims on trust. Specifically: Mutation testing — claim confirmed exactly. Reverting the The decisive correctness question: does a fieldless success actually produce
The absent-vs-zero distinction holds at the tracing layer. Regex parity — Marker-position contract is sound. Error paths cannot masquerade as zero-field successes. All three error shapes (
Findings🟡 Important — the comment justifying
|
malibio
left a comment
There was a problem hiding this comment.
Recommendation: APPROVE (posted as a comment — GitHub blocks approving one's own PR).
Verified independently rather than taken on trust:
- Mutation testing confirmed exactly as claimed — reverting either call site fails precisely its own 2 tests, no cross-talk.
- The decisive risk checked:
CreateSchemaOutput.fieldshas noskip_serializing_if(unlike itsrelationships/warningssiblings), so a fieldless success serializes"fields": []→Some(0), not absent. The check genuinely fires on the bug it targets. - Regex parity:
toolsCalledderives byte-identically across all 8 emitted line shapes; optional groups sit after the name capture and cannot shorten it. Option::Noneis omitted by tracing-core, so the absent/0/N distinction is real.
Scope decisions are sound: items 3-5 were implemented, measured at 6/12 → 3/12, and dropped on evidence; declining to record a baseline the instrument cannot resolve (n=12, ~2-scenario noise floor) is better than manufacturing false precision.
One 🟡: the types.ts:38-45 comment justifies keeping toolsCalled via compareToBaseline joining on it — it does not (joins on id/passed only). The field should still be kept, but for the real reason: routing.ts consumes it from live turns at 8 sites. Right conclusion, wrong stated mechanism. Non-blocking.
Full review in the PR comment above.
Both fixes are to comments that asserted something untrue. A comment that justifies a design decision with a mechanism that does not exist is worse than no comment — it misleads the next person deciding whether the code is safe to change. - types.ts justified keeping `toolsCalled` by claiming compareToBaseline joins recorded runs on it. It does not; it reads provenance, id, and passed only. The field is still right to keep, for the real reason: the routing fixture scores turns off these names directly and never calls the matrix fixture's assertions. That also makes it a field in current use rather than a compatibility shim the greenfield rule would delete. - aichat.ts described the marker as belonging to "a schema-creating tool". It is emitted by any tool whose result carries a top-level `fields` array. Verified that update_schema is NOT one of them — it returns fields_added/fields_removed counts (SchemaUpdateOutput), so an update cannot be misread as a creation. Two suggestions skipped deliberately: - Dropping `toolCalls?` optionality: it guards deserialization of results files recorded before the field existed. Nothing in-repo exercises that path today, but removing the marker trades a free safety property for nothing. - Deduplicating extra.toolCalls against turns[].toolCalls: intentional. `extra` is the per-scenario record read to find out why a scenario failed; making a reader reconstruct it from raw turns defeats its purpose. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C2fwCrhS3Bfq4uDGM61iCr
Review addressed — 2 fixed, 2 skippedCommit ✅ Addressed🟡 🟢 ⏭️ Skipped🟢 Drop 🟢 Deduplicate Verification
Note on the prior review's verdictThe earlier review reported "Recommendation: APPROVE". GitHub rejected |
Closes #1799
What this changes
The
noExtraTypesassertion countedcreate_schemacalls and never checked what was persisted, so a call that was rejected outright scored as a pass. Scenario 3 had been a recorded false pass in every prior run.The evidence needed to catch it was already produced and already printed —
aichat.tsemits an[ERROR]marker per tool call — butrunner.tskept only the tool name and discarded the rest of the line. This carries the outcome through.agent_loop.rslogsresult_field_count, taken from the tool RESULT rather than its arguments. Args are the model's report of what it asked for; the result is what the executor persisted. A bare integer because both previews truncate at 300 chars and a realisticcreate_schemapayload exceeds that — a parser reading them would fail on exactly the well-formed calls it should pass.types.tsgainstoolCallsalongsidetoolsCalledrather than replacing it, sorouting.tsneeds no edits and recorded baselines still join incompareToBaseline.agent-matrix.tschecks schema soundness on both thenoExtraTypesandtoolOncebranches. Scenarios 8a/8b reachcreate_schemathroughtoolOnceand had the identical count-only hole; fixing onlynoExtraTypes(what the issue named) would have left most of the measurement defect in place.Two failure modes, not one
A rejected call persists nothing. But a call carrying neither
fieldsnordescriptionsucceeds and persists a type with no properties (packages/core/src/schema/mod.rs:275-277) — invisible to any check that only asks whether the call errored. The issue's framing would have missed this; 8a/8b are exactly this case.Absent
fieldCountis treated as unknown, so baselines recorded before this do not read as fresh failures.Verification
Both branches mutation-tested: reverting either one fails exactly its own two unit tests and no others.
Run against unmodified guidance — so the assertion is demonstrated failing on current code, per the issue's first acceptance criterion:
create_schema was called but REJECTED — no schema persistedcreate_schema succeeded but persisted a type with NO fieldsbun run test:allpasses (4,106 frontend / 20 browser / 29 scripts / 10 Rust suites), no new failures.Scope: assertion only
The issue's checklist items 3-5 (routing
create_schemathroughsearch_skills) are not included. That change was implemented and measured, and it makes behavior worse: 6/12 → 3/12 under identical conditions, with the model callingsearch_skillsand then stopping. Its premise also does not hold —SCHEMA_CREATION_RULESis resident every turn and already carries the rule the model broke. Detail in the issue comments; the underlying guidance defect is now the spike #1802.No baseline is recorded here.
scripts/results-e4b.jsonis deliberately untouched: every run it holds was measured through an architecture #1802 is questioning, and at n=12 with only 3 schema scenarios the matrix cannot clear its own ~2-scenario noise floor. The assertion fix stands on mutation testing, not on any eval score.Note on the branch name
Created via the worktree tool, which names branches
worktree-<name>; the CLAUDE.md convention isissue-<number>-brief-desc. Cosmetic only.🤖 Generated with Claude Code
https://claude.ai/code/session_01C2fwCrhS3Bfq4uDGM61iCr