Repository navigation
Gate no-op update_node calls and act on the persisted-field signal (closes #1937) - #1938
Conversation
…ed-field signal (#1937) A state-change request reached update_node carrying the node's own unchanged title as content and no properties. The tool returned {"updated": true, "property_count": 0}, and the model reported the write as done with a fabricated date. Nothing persisted. The model's omission is sampling, but everything downstream was deterministic: the both-absent guard cannot fire on a content-only call, `updated: true` is hardcoded next to a computed zero, the anti-fabrication guard keys on zero tool calls so a successful-but-empty call passes, and result_field_count was computed and only logged. - Reject an update_node whose content is byte-identical to stored content and which supplies no properties. Checked against the store, so only provably inert calls are refused; a genuine content edit still goes through. - Never return `updated: true` beside `property_count: 0`. A content-only edit now reports updated_content_only plus a note that state is unchanged. - Gate on the persisted-field signal instead of only logging it: an action claim backed solely by writes that persisted nothing becomes a confirmation request. Fires only when every write in the turn was empty; non-write tools are ignored. - Close a phrase-list gap found while checking the "guard may be inverted" hypothesis: the live "Fact: node ... was updated." claim had zero tool calls and still passed, because the list carried "has been updated" but no bare passive "was updated". - Add matrix scenario 9 (direct property-set on an existing node) with minProperties: 1, plus DB-backed tests asserting the property is readable from storage afterwards rather than that the call returned success. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Drives the real production surface — all_tool_definitions() and a real GraphToolExecutor over a real SqliteStore — rather than the hand-authored tool schemas the golden_scenario6_* tests use. Asserts on what the store holds after the turn, never on the tool's return value: the whole defect was a call that returned success while persisting nothing, and modifiedAt was bumped by that no-op write so it is not a usable signal either. 3 reps, since single-run results on this stack are not decision-grade. Also restores bun.lock to main's contents — a stray desktop-app version bump picked up by bun install, unrelated to this change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`get_node` on a schema node returns that schema's own `fields` array, which is shape-identical to `create_schema`'s report of the fields it just wrote. Reading a schema that defines zero fields would therefore have been counted as a write that persisted nothing, tripping the no-op guard on a read-only turn. Restrict the signal to the three tools that actually report what they persisted. `update_task_status` is a genuine write but reports neither signal, so it stays uncounted rather than being read as an empty write. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
) Two false positives found while scrutinizing the guard's firing condition, both of which would have made it a UX regression rather than a safety net. 1. A write that persisted zero properties is only evidence of dropped particulars if properties were supplied in the first place. A plain `text` note has no schema fields, so create_node stores it with property_count 0 — a complete success. The guard would have converted a truthful "I've added that note" into a spurious confirmation request. Both writes now flag the zero-of-zero case (`content_only`, `updated_content_only`) and the signal reports None for it, so only zero-out-of-something-expected can suppress a confirmation. 2. The bare passive phrases over-fired badly. Measured, not assumed — with the phrases matched unconditionally, all of these returned true: "Nothing was updated because the value already matched." (a negation) "Do you know when it was updated?" (a question) "The record shows it was marked returned on the 12th." (a report) The earlier test only covered "I can update..." and "Would you like...", which contain none of the passive forms, so it proved nothing here. Passive claims are now matched only outside questions, negations, and reports. Also rewords update_node's content-only note so it does not itself contain a phrase the guard keys on: the guard reads only the model's response, never a tool result, but models routinely echo result wording into their final text, and this note is returned on exactly the turn the guard watches. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review TypeInitial review — full review of all changes in PR #1938 (no prior reviews or comments). Important scope note: the PR on GitHub is at Verification performed: Requirements Check
Code Review Findings🔴 Critical1. 📁 Uncommitted-to-remote 5th commit contains leftover debugging scaffolding
The commit additionally fails These must be deleted before push. A test that cannot fail is not a test — it is noise that future readers must re-derive intent from, and it inverts the value of the surrounding well-written suite. 2. 📁 This is the answer to scrutiny area #4, and it cuts the opposite way from expected. The over-firing concern was real and
Every one of the first nine is a genuine fabricated-write claim that the guard now waives. This matters because Concrete failure scenario: the exact #1937 turn recurs, the model emits "The due date was set to 2026-08-06. Let me know if there's anything else!" — no Suggested fix — scope the qualifiers to the sentence containing the passive phrase rather than the whole text: lower
.split(|c| c == '.' || c == '!' || c == '?' || c == '\n')
.zip(/* keep the terminator to detect '?' */)
.any(|sentence| PASSIVE_CLAIMS.iter().any(|p| sentence.contains(p))
&& !is_question(sentence) && !is_negated(sentence) && !is_reporting(sentence))At minimum, drop Please add the nine strings above as regression assertions — the current test 🟡 Improvements3. 📁 Scenario 9's stated purpose is that Two independent causes:
Net effect: the scenario passes whether or not the model does the right thing, so it cannot detect a regression of #1937 — which is the one thing it was added to do. Suggest making 4. 📁 Scenario 9 lives in the group whose comment reads "Single-custom-type CRUD chain (scenarios 3-7) shares one chat node", and runs after scenario 7. Its prompt ("The laser cutter is due back on the 20th") targets the same laser-cutter node scenario 6 set to
5. 📁 Answering scrutiny area #3. On cost: this is a local SQLite read on a path that only runs when On TOCTOU: real but benign here. Between the gate's read and the write, another writer could change the content, making a call the gate passed actually inert (or vice versa). The consequence is a missed/spurious diagnostic, never data corruption — the ops layer's version check still guards the write itself. Worth a one-line comment noting the check is advisory and deliberately not serialized, so a future reader does not mistake it for an atomicity guarantee. A cheaper structure would be to pass the already-fetched node down, or to have the ops layer report "no effective change" — but that is a larger refactor and YAGNI at this size. Current shape is acceptable. 6. 📁 Answering scrutiny area #5. The pairing is defensible: The caveat is the coupling introduced in 7. 📁 Answering scrutiny areas #1 and #2 on the firing condition itself: What is missing is a test at the loop level. Every new test targets 🟢 Nitpicks8. Nit: 📁 9. Nit: 📁 10. Nit: 📁 11. Nit: the comments throughout this PR are unusually good — they explain why (with the observed failure that motivated each) rather than what. SummaryThe core of this change is right, and the engineering instinct behind it is exactly right: a runtime/structural gate rather than more prose, per ADR-064; results that name what actually landed; and tests that assert against the store rather than the tool's return value. Criteria 1, 2, 4 and 6 are solidly met, and the live test against the locked model is the correct level of rigor for a defect that prose guidance already failed to fix once. Two things hold it back. The passive-phrase qualifiers added in the unpushed 5th commit over-corrected — measured, nine ordinary multi-sentence responses carrying a genuine fabricated claim now evade a guard that also protects the pre-existing anti-fabrication path, so this narrows shipped coverage, not just new coverage. And matrix scenario 9, whose entire stated purpose is to score this defect red, currently scores green on both realistic post-fix outcomes — so criterion 5's regression protection is not actually in place yet. Both are fixable without redesign. The leftover probe functions must come out before push, and the branch needs RecommendationREQUEST CHANGES — blocking on Finding 1 (leftover debug scaffolding + fmt, must not be pushed) and Finding 2 (the guard is evadable by ordinary phrasing, in the fail-open direction). Finding 3 should be fixed in this PR too, since without it the acceptance criterion for regression coverage is nominal rather than real. Findings 4-11 are non-blocking. |
malibio
left a comment
There was a problem hiding this comment.
Initial pragmatic code review posted above: REQUEST CHANGES (advisory — leaving the formal decision to the human reviewer).
Blocking: leftover debug scaffolding + fmt failures in the unpushed 5th commit, and the passive-claim qualifiers being evadable by ordinary multi-sentence phrasing in the fail-open direction. Matrix scenario 9 also does not currently score the defect red. Full detail and measurements in the comment.
…io 9 score (#1937) 🔴 Finding 1 — leftover debug scaffolding. Deleted three probe_* functions that asserted nothing and only println!'d; one embedded the pre-fix `note` wording the same commit had deliberately reworded. Replaced with four real loop-level tests (also Finding 7), which is what that scaffolding should have been. 🔴 Finding 2 — the passive-claim qualifiers were whole-text, so any qualifier anywhere waived detection for the entire response. This inverted the fail-safe direction on a guard that also gates the pre-existing zero-tool-call anti-fabrication path. Measured, nine genuine fabricated claims were waived, including "The node was updated. Anything else?" and "The task was updated. I cannot see the old value." ("not " matching inside "cannot"). Qualifiers are now evaluated per sentence against the clause carrying the phrase; sentences keep their terminator so a real question is still recognised; "n't " is dropped. Added the nine strings as regression assertions — the previous test only covered the over-fire direction, leaving under-fire entirely unasserted. 🟡 Finding 3 — scenario 9 scored green on both realistic post-fix outcomes: a gate-rejected call arrived as isError and was skipped, and a content-only write reports no field count so it was skipped too. It could not detect the very regression it was added for. Errored calls to the target tool now fail (mirroring schemaCallsAreSound), and a new content-only marker is scraped through aichat.ts -> runner.ts -> ToolCallRecord so "nothing to persist" is distinguishable from "stale baseline". Five scoring tests pin both directions. 🟡 Findings 4, 5, 6 — corrected the stale group comment; documented that the gate's read is advisory and deliberately not serialized (missed diagnostic, never corruption, since the ops version check still guards the write); added a back-pointer from PASSIVE_CLAIMS to the tool-side note constraint. Rust 455 passed, scripts 87 passed, cargo fmt --check clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Address-review summaryAll three blocking/important findings addressed, plus the three non-blocking ones. Commit 🔴 Finding 1 — leftover debug scaffoldingDeleted Rather than just delete them, I turned their scaffolding into the four loop-level tests Finding 7 asked for — which is what they should have been. 🔴 Finding 2 — the guard was evadable (fail-open)Confirmed and fixed. This was the most serious finding: my over-fire fix over-corrected into under-firing, on a predicate that gates both the new no-op guard and the pre-existing zero-tool-call anti-fabrication guard. I had narrowed a guard that was already shipping and working. Qualifiers are now evaluated per sentence, against the clause carrying the passive phrase. Sentences keep their terminator (splitting on All nine strings from the review are now regression assertions. The gap the review identified was exactly right, and is the same gap my own commit message had criticised in the previous test: the over-fire test used phrasings containing none of the passive forms, so it proved nothing about them. 🟡 Finding 3 — scenario 9 did not score the defectConfirmed: both realistic post-fix outcomes scored green. A gate-rejected call arrived as
Five new scoring tests pin both directions (87 scripts tests pass). 🟡 Findings 4, 5, 6
VerificationRust 455 passed, scripts 87 passed, Matrix statusThe clean serial run scored 12/13 on rep 1 (up from 10/13), but that predates these fixes and scenario 9's scoring semantics just changed — so it is superseded and I am re-running it rather than quoting it as evidence. Also correcting the record on two earlier process errors of mine: the previous run's reps 2-3 were invalid due to a GPU OOM I caused by running the eval concurrently with a |
Review TypeRe-review of PR #1938, covering Verification performed on Previous Review Summary
3 blocking/major addressed, 0 not addressed, 1 new non-blocking observation (A), 1 new note (B). Finding 1 — verified
On fmt: Finding 2 — verified, and the fix holds in both directionsThis was the critical one, and the fix is real. All nine strings I measured as silently waived now fire: Critically, the over-fire direction did not regress — this is where the previous attempt over-corrected, so I probed it hard. All 14 strings still correctly return Both directions now pass simultaneously, which is the property that was missing before. Dropping Unicode safety confirmed — no panic, no mis-slice. The hand-rolled The The nine strings are now pinned as assertions in Finding 3 — verified, including the round-trip and the blast radiusMeasured against the real Marker round-trip verified end to end. The emitter at Blast radius of the isError-is-a-failure change is narrower than I flagged. I measured it rather than reasoning about it:
Scenario 6 is the only affected case, and I think red is the defensible verdict there — the scenario asserts a clean two-call sequence, and a retry after a rejected write is a materially worse outcome worth surfacing. Flagging it so the change is a known one rather than a surprise on the next matrix run. Findings 4, 5, 6 — accurate, not merely presentI checked these for correctness rather than existence:
Requirements Check (issue #1937)
Criteria 3 and 5 move from Findings🟢 A. 📁
|
malibio
left a comment
There was a problem hiding this comment.
Review Type
Re-review of PR #1938, covering e2e7f715..7187d523. My previous review was REQUEST CHANGES on Findings 1 and 2 (blocking) plus Finding 3.
Verification performed on 7187d523: cargo test -p nodespace-agent --lib (455 passed, 0 failed), bun run test:scripts (87 passed, up from 82), cargo clippy -p nodespace-agent --all-targets -- -D warnings (clean). Per the instruction not to take the claims on trust, I re-measured both predicates empirically with throwaway probes against the real functions — 66 strings through contains_action_claim and 8 fixture shapes through the real assertExpectation. All scaffolding removed; worktree and primary checkout both clean.
Previous Review Summary
| Finding | Status |
|---|---|
| 🔴 1 — leftover probe scaffolding + fmt | ✅ Addressed |
| 🔴 2 — passive-claim qualifiers fail open | ✅ Addressed (residual edge cases, non-blocking — see Finding A) |
| 🟡 3 — scenario 9 scores green on both post-fix outcomes | ✅ Addressed |
| 🟡 4 — stale group comment | ✅ Addressed |
| 🟡 5 — advisory/non-atomic gate read | ✅ Addressed |
🟡 6 — back-pointer from PASSIVE_CLAIMS |
✅ Addressed |
| 🟡 7 — no loop-level test for the no-op guard | ✅ Addressed (folded into Finding 1's fix) |
3 blocking/major addressed, 0 not addressed, 1 new non-blocking observation (A), 1 new note (B).
Finding 1 — verified
grep -n "probe_" over agent_loop.rs returns nothing; all three probe functions are gone, and with them the stale pre-fix note literal. They were replaced by four genuine loop-level tests driving the real run_turn through a FixedResultExecutor (agent_loop.rs:5298, :5316, :5331, :5350) — covering fires / real-write / content-only-edit / plain-note. That is exactly the interaction coverage Finding 7 asked for, and it is the right level: it exercises persisted_field_count × contains_action_claim × all_tool_executions together rather than in isolation.
On fmt: cargo fmt -p nodespace-agent -- --check does report diffs, but all three are in packages/agent/tests/golden_scenario6_sequence.rs, which git diff main...HEAD shows is untouched by this PR. I confirmed the identical failure on the clean primary checkout at main (35f0154d). This is pre-existing breakage on main, not this PR's — my previous fmt call-out was correct at the time (it named agent_loop.rs:686 and :5154, both now clean) and is resolved here.
Finding 2 — verified, and the fix holds in both directions
This was the critical one, and the fix is real. All nine strings I measured as silently waived now fire:
true The due date was set to 2026-08-06. I did not change anything else.
true The task was updated. I cannot see the old value.
true The due date was set to the 6th. It will be visible on the task page.
true The node was updated; there isn't anything else to change.
true The node was updated. Anything else?
true The task was updated. The page now shows the new date.
true The node was updated. There is no node named X.
true The due date was set to the 6th. It was never set before.
true The node was updated. That should be all.
Critically, the over-fire direction did not regress — this is where the previous attempt over-corrected, so I probed it hard. All 14 strings still correctly return false, including every one the original qualifiers existed for:
false Nothing was updated because the value already matched.
false Do you know when it was updated?
false The record shows it was marked returned.
false It appears the task was marked returned last week.
false According to the record, the due date was set to the 1st.
false The status would be set to returned if you confirm.
false When was it updated? / Which node was updated? / That was never updated.
Both directions now pass simultaneously, which is the property that was missing before. Dropping "n't " did not reopen any over-fire — "isn't"/"didn't" cases are caught by the per-sentence scoping instead, which is the more precise mechanism.
Unicode safety confirmed — no panic, no mis-slice. The hand-rolled char_indices + len_utf8 splitter is the kind of code that panics on a byte-boundary slice, so I fed it CJK, accented Latin, em-dashes, emoji, NBSP, empty string, bare ".", and runs of consecutive terminators. All returned cleanly:
true 任务was updated。完成 true ééé was updated… done
true was set to 📅 true ;;;was updated;;;
true \n\n\nwas updated\n\n false "" false "."
The start < lower.len() tail guard correctly handles both the terminated and unterminated cases, and an unterminated claim ("The node was updated", no period) still fires — a gap worth checking since the loop only pushes on a terminator.
The nine strings are now pinned as assertions in passive_action_claim_still_fires_when_a_qualifier_appears_elsewhere_in_the_text (agent_loop.rs:5006), so the under-fire direction is asserted for the first time. Good — that was the structural gap, not just the specific bug.
Finding 3 — verified, including the round-trip and the blast radius
Measured against the real assertExpectation, scenario 9 now scores correctly in all four directions (previously green on the first two):
gate-rejected no-op -> {"passed":false, "...was rejected, so the requested change never reached storage"}
content-only update -> {"passed":false, "...changed only content and persisted no property values"}
real success (f=1) -> {"passed":true}
stale baseline -> {"passed":true} <- correctly still tolerated
Marker round-trip verified end to end. The emitter at scripts/aichat.ts:248 produces `[tool] ${tool}${err}${fieldPart}${contentOnly} ${args}` and the regex at scripts/eval/runner.ts:117 is /^\[tool\] ([a-z_]+)( \[ERROR\])?( \[fields=(\d+)\])?( \[content-only\])?/gm — marker order matches exactly, and args stays last as required. I also checked the one thing that could silently break it: result_preview is truncated to 300 chars at agent_loop.rs:1803. Serializing the real content-only update_node result (the larger of the two, because of the note) gives 276 chars with "updated_content_only":true at index 76 — comfortably inside the window. create_node's content_only result is far smaller. The marker survives.
Blast radius of the isError-is-a-failure change is narrower than I flagged. I measured it rather than reasoning about it:
- Scenarios 4 and 8c (
toolOnce,create_node): an error-then-successful-retry already fails on the count check (Expected 'create_node' exactly once, got 2) beforecallPersistedPropertiesis ever reached. No behavior change. - Scenario 6 (
toolSequence): this is the one genuine change. An erroredupdate_nodefollowed by a successful retry now scores red where it previously passed. A non-target error (resolve_queryfailing) is correctly still tolerated, and the clean path still passes.
Scenario 6 is the only affected case, and I think red is the defensible verdict there — the scenario asserts a clean two-call sequence, and a retry after a rejected write is a materially worse outcome worth surfacing. Flagging it so the change is a known one rather than a surprise on the next matrix run.
Findings 4, 5, 6 — accurate, not merely present
I checked these for correctness rather than existence:
- 4 —
agent-matrix.ts:318now reads "scenarios 3-7, then 9" and explains why 9 is last (it needs scenario 4's laser cutter, and name-matching keeps its resolution direct rather than duplicating scenario 6's indirect-reference test). Accurate and it answers the isolation question I raised. - 5 —
tools.rs:2016correctly scopes the claim: advisory, not serialized, consequence is a missed/spurious diagnostic only, with the reason it is safe (the ops layer's version check still guards the write). Technically correct. - 6 —
agent_loop.rs:649names the constraint, the direction of the hazard (the model echoing tool wording back), and the test that pins it. The pointer now runs both ways.
Requirements Check (issue #1937)
| # | Acceptance criterion | Status |
|---|---|---|
| 1 | No-op update_node rejected, not reported as success |
✅ Met — tools.rs:2016+ |
| 2 | No result returns updated: true with property_count: 0 |
✅ Met — tools.rs:2074-2091 |
| 3 | Action claim with nothing persisted → confirmation request | ✅ Now met — guard holds in both directions; four loop-level tests |
| 4 | Regression test: due-date set persists or fails loudly | ✅ Met — asserts against a real SqliteStore |
| 5 | Matrix scenario for property-set-on-existing-node | ✅ Now met — scenario 9 scores red on both failure shapes |
| 6 | Verified against the locked model on the native path | ✅ Met — live_update_node_noop_gate.rs |
Criteria 3 and 5 move from
Findings
🟢 A. 📁 packages/agent/src/local_agent/agent_loop.rs:718-745 — residual same-clause evasions, bounded and acceptable
The split is on .!?\n; only, so a qualifier in a comma-joined clause of the same sentence still waives the claim. Measured:
false The task was updated — the due date now shows 2026-08-06.
false The task was updated, but nothing was deleted.
false The node was updated, nothing else changed.
false The due date was set to the 6th, which shows on the page.
false The node was updated, not deleted.
false The due date was set to the 6th - anything else?
Each has a period-separated twin that fires correctly, so this is purely the clause-splitting granularity. I am not treating this as blocking, for three reasons that are worth stating rather than assuming:
- The realistic phrasings are covered. I probed 14 natural post-write LLM sign-offs; 11 fire, and the misses are the em-dash and comma-
butforms specifically. The high-frequency ones —"Let me know if there's anything else!","Done! The due date was set to the 6th.","The node was updated successfully."— all fire. - Splitting on commas would reintroduce the over-fire.
"According to the record, the due date was set to the 1st."and"No node was found, so nothing was created."both put the qualifier in a different comma clause from the phrase. Comma-splitting breaks them. The current boundary is a deliberate trade, and the safer of the two. - This is a defense-in-depth layer, not the fix. The primary remedy for #1937 is the tool-boundary gate (criteria 1 and 2), which is structural and unevadable. This predicate is a secondary net over a prose signal; a prose heuristic will always have a boundary.
The em-dash case ("The task was updated — the due date now shows 2026-08-06.") is the one I would actually consider, since — functions as sentence-terminal punctuation in LLM output and is common. Adding '—' (and possibly '–') to the terminator set is a one-character-class change that costs nothing and does not touch the comma trade-off. Worth a follow-up, not a blocker on this PR.
🟢 B. 📁 scripts/eval/fixtures/agent-matrix.ts:172 — contentOnly failure message asserts an assumption worth keeping honest
The message says "the prompt supplied a value to store". That is true of every scenario carrying minProperties today (4, 6, 8c, 9), and the comment correctly scopes the claim to that. It is a fixture-level invariant rather than an enforced one, so a future minProperties scenario whose prompt does not supply a value would get a misleading failure string. The doc comment already flags the scoping, so this is a note for whoever adds the next one rather than a change request.
🟢 C. Nit: pre-existing cargo fmt breakage on main
packages/agent/tests/golden_scenario6_sequence.rs fails cargo fmt --check on main (verified on the clean primary checkout), so the pre-push gate will flag it on this branch through no fault of this PR. Worth a one-line fix on main — or folding into this PR if the gate blocks the push — so the next author does not spend time bisecting it. Not this PR's defect.
Summary
All three findings I blocked on are genuinely fixed, and — importantly — fixed in the way that was asked rather than papered over. I re-measured rather than trusted, and the two things I most expected to find wrong are right: the passive-claim predicate now satisfies both directions simultaneously (the previous attempt traded one for the other), and the unicode splitter that looked panic-prone is sound across CJK, emoji, NBSP, empty input, and consecutive terminators.
The quality of the response is high. The nine strings I measured were not just fixed but pinned as assertions, closing the structural gap that let the under-fire direction go unasserted in the first place. The probe functions were replaced with four real loop-level tests rather than merely deleted — addressing Finding 7 in the same stroke. And the comments explain the reasoning behind each trade (why per-sentence and not per-comma, why the gate read is advisory, why scenario 9 sits last in the chain), which is what makes this maintainable by the next person.
The residual items are all 🟢: a bounded clause-splitting edge case whose realistic phrasings are covered and whose obvious "fix" would reintroduce the over-fire, one fixture-invariant note, and a pre-existing fmt failure on main that this PR did not cause.
Recommendation
APPROVE. Criteria 1-6 are all met. Findings A-C are non-blocking; the only one I would actively suggest is adding — to the sentence terminators, and that is a fine follow-up rather than a reason to hold this. Ship it.
Re-review: APPROVE — plus two corrections to my earlier claimsThe re-review verified the fixes by re-measuring rather than trusting the address-review summary (66 strings through the real Two things I got wrong earlier, corrected: 1. The 2. Finding 3's blast radius was narrower than I flagged. I said making The Finding 3 fix is doing its job on live dataRep 1 of the final matrix run, scenario 8c: That is the new Pre-push gatePassed clean (exit 0), including Final 3-rep matrix results to follow. |
Final 3-rep matrix: 10/13, 10/13, 10/13 — deterministic, no regressionCross-checked against the reference harness in This branch: same 10 passes, identical failures every rep — 6, 8c, and 9. Scenario 9 is the one this PR adds. So the baseline is unchanged and the delta is one new scenario that legitimately fails. Scenario 9 catches the exact #1937 defectReps 2 and 3: The model encoded the date into content prose instead of Rep 1 failed differently (no Correcting my earlier 7/13 reportsThose were my harness bug, not a regression: reps 2-3 ran against rep 1's leftover database, so every The reference also confirms this PR's Finding 3 fix was necessaryIts trap 4 — "an assertion can be silently inert" — names the same fail-open branch this PR had to close a second time:
My Merge readiness
|
The first version asked the model to set a DUE DATE on an Equipment Item.
That type is built by scenario 3 from a prompt mentioning only returned-ness
and replacement cost, so it has exactly two fields — isReturned and
replacementCost — and nowhere to put a date. The scenario was therefore
unwinnable: `minProperties: 1` demanded the value reach `properties` when no
property could hold it.
Worse, it scored red on REASONABLE behavior. The model folded the date into
the node's text and reported that honestly ("updated with a note indicating it
is due back on the 20th") — about the best available response to an impossible
request. A scenario that reds out correct behavior measures the fixture, not
the model. Same trap as the album/artist case in #1846.
"The 20th" was also underdetermined — no month, no year — so the scenario
conflated relative-date resolution with property persistence and would have
attributed a failure in the former to the latter.
Now asks for a replacement-cost correction: the field exists, 1800 is
unambiguous, and the referent is a direct string match, so a red isolates
cleanly to "the value did not reach properties". replacementCost over
isReturned because scenario 6 already owns the returned-ness transition.
Placed last in the chain, after 6 ("the 2400 one") and 7 ("worth 90000") have
read the old value, so neither is disturbed.
Verified 3 reps, fresh purged DB each: 10/13 every rep, failures 6/9/8c
identical — matching the reference harness baseline (6 and 8c fail there too)
plus this one new scenario. Scenario 9 still fails, but now for a real reason:
rep 1: {"content":"Laser Cutter Checkout Log Entry (Updated)","id":"..."}
rep 2: {"content":"Laser Cutter Checkout Log Entry Updated Title for
Correction on Replacement Cost.","id":"..."}
1800 appears in neither, and properties is untouched in both — rep 2 writes a
title *about* correcting the cost without recording the corrected cost. That
is a genuine model failure of the same class as 6 and 8c, and the scenario now
surfaces it instead of scoring it green.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Scenario 9 retargeted — the first version was not a fair eval
The flaw. It asked the model to set a due date on an It was worse than merely unwinnable: it scored red on reasonable behavior. The model folded the date into the node's text and reported that accurately —
— which is about the best available response to an impossible request, and is notably not a fabrication (contrast the original #1937 failure, which claimed a due date had been set). A scenario that reds out correct behavior measures the fixture, not the model. Same trap as the album/artist case in #1846. "The 20th" was also underdetermined (no month, no year), so the scenario conflated relative-date resolution with property persistence. I had cited that red as evidence the fix worked. That was wrong, and I've corrected it here. The fix. Retargeted to a replacement-cost correction: the field exists, Result: 10/13 across 3 reps, deterministic, failures Scenario 9 still fails, but now for a real reason:
Gate: passed clean, incl. |
…ltered (closes #1939) (#1941) * Surface a node type's schema fields on get_node and empty searches A schema field that is defined but currently unset was invisible to the model from every direction: get_node returns only populated properties, and the RELEVANT ENTITY TYPES block excludes core types by construction. So for task/text there was no path — prompt block or tool call — by which due_date could be discovered. Following "use the node's own existing property keys" literally, the model correctly declined and asked the user to name a field the schema had defined all along. Deliver the field list on the tool result rather than the routing prompt, per ADR-064 rule 4. That leaves routing.rs's deliberate is_core exclusion untouched: RELEVANT ENTITY TYPES answers "which user-defined types are relevant to this message", a retrieval question over an unbounded set, whereas core types are a small fixed set that must be *always known* when the model is looking at a node of that type, not *found*. - get_node gains available_properties: every field the type defines, with its type, allowed values, and a `set` flag. That flag is load-bearing — without it "defined but unset" and "does not exist" read identically. - search_nodes attaches filterable_properties when a type-scoped search returns zero results, the one outcome where count:0 and "bad field name" are indistinguishable. Scoped to the empty case so successful turns get no schema block they never needed. - update_node guidance and the #1938 no-op rejection now name unset schema fields as legitimate targets and point at get_node, without reopening "invent a key from the user's wording". Field names are flat on both sides — reads flatten the stored namespace and writes re-namespace flat keys — so a name taken from the list passes straight back to update_node. A test asserts that round-trip against the store rather than assuming it. ADR-063 is re-verified for the new channel rather than assumed: the list can only echo keys the schema already defines, so it opens no path to writing a new bare key onto a core type. Refs #1939 Co-Authored-By: Claude <[email protected]> * Add agent-matrix scenarios for core-type schema fields Every existing group builds a CUSTOM type first, which is why this gap went unmeasured: a custom type's fields reach the model through RELEVANT ENTITY TYPES, and that block excludes core types by construction. No scenario ever acted on task/text, so the field list never being delivered for them scored green. 10a creates a task with the fields under test deliberately unset, 10b sets due_date without the prompt naming the key (minProperties makes a turn that persists nothing score red), 10c filters on the status enum — the read-side half of the same root cause. Refs #1939 Co-Authored-By: Claude <[email protected]> * Move the empty-search guidance out of the tool result (ADR-064 rule 4) The first draft returned a `no_matches_hint` prose string beside the field list. Rule 4 is explicit that a tool result owns resolved state and "does not return a plan for the model to carry out" — and that is measured, not stylistic: instructions delivered as a tool result dropped continuation from 100% to 44% in this codebase's own testing. filterable_properties is a fact and stays. What to DO about it moves to search_nodes' description, the channel rule 2 gives tool-selection prose. A test now pins the result to facts only, so the next helpful-sounding string has to justify itself against the doctrine. Also covers two edge cases: a type that defines no fields omits the key entirely rather than claiming an empty field set, and get_node on a schema node does not describe it using its own instance fields. Refs #1939 Co-Authored-By: Claude <[email protected]> * Verify the read path live and scope its assertion to what this fix owns The read-path live test measures the field list in isolation, 3 reps each, identical except for the empty-result payload: {count, nodes} only → 0/3 retried; "I do not have enough information to continue. Could you please clarify what you would like me to do?" + filterable_properties → 3/3 retried, filtering on `status` So the field list is what moves the model off interrogating the user, which is the reported defect. All 3 retries then serialize their arguments malformed — keys with embedded quotes, a value spliced into a neighbouring field — and are rejected before running. That malformation is not caused by this change and is not this issue's to fix: the originating report records the same defect (a filter emitted with "type": "task") and explicitly scopes it out as a model slip, and the sibling no-op-gate suite already carries an unparseable-args branch. The test therefore asserts the model went back to the graph against the named field, executes the retry for visibility, and does not assert it succeeds — tying a schema-visibility fix to an unrelated serialization bug would make it fail for something it does not own. Strengthening the fixture is what surfaced this: with only the in_progress task, "there are no open tasks" was the CORRECT answer, so giving up scored the same as recovering. An open task now exists, making the right answer reachable only by retrying. Live tests drop to n_ctx=16384 (production's enforced floor). At 32768 the KV cache plus compute buffers OOM the GPU whenever a nodespaced daemon is resident with its own model — the normal state of a dev machine — and a behavioral assertion that fails for a memory reason reads as a regression. Write path remains 3/3 at the production floor. Refs #1939 Co-Authored-By: Claude <[email protected]> * Address review: close the eval scenario's blind spot and tighten assertions Review finding 1 was a real bug in my own test. Scenario 10c's comment claimed it catches "the search never firing at all", but bare `noRetry` provably cannot: its run-length loop never executes over zero calls, so `assertExpectation({kind:"noRetry",...}, [])` returns passed. The scenario scored GREEN on the exact production behavior it was added to catch — the model stopping to interrogate the user instead of searching. A scenario that cannot fail on its target behavior is worse than none: it converts an unmeasured gap into a falsely-measured one. Added an opt-in `minCalls` and set it on 10c only, rather than making the zero-call guard unconditional. Scenario 7 also uses `noRetry`, and re-scoring an existing baseline scenario is not something single-run matrix numbers can absorb silently. Six tests now pin the behavior, including one documenting the default's blind spot so the reason `minCalls` exists is recorded rather than implied. Also from review: - get_node's description no longer promises `properties` and `available_properties` unconditionally; the markdown branch returns neither, and a model-facing description is a contract. - Recorded that `SchemaNode` emits no `nodeType` and so skips the attach block by construction. That is load-bearing — it is what stops the task SCHEMA node being described with task's instance fields — and a future `nodeType` on `SchemaNode` would silently break it. - Two tests wrapped assertions in `if let Some(...)`, opting out of failing where the state is deterministic. Both now assert absence directly, which is the real invariant and catches regressions the conditional form would pass over. Skipped the `set`-stripping refactor (marked nit): the current form is tested and commented, and reshaping an API signature for aesthetics is churn this PR does not need. Refs #1939 Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Closes #1937.
A state-change request ("set the deadline to 6-August-2026") reached
update_nodecarrying the node's own unchanged title ascontentand no properties. The tool returned{"updated": true, "property_count": 0}, the model reported the write as done with a fabricated date, and nothing persisted. The user only found out by re-querying a minute later.Prompt bug or deterministic bug?
Both layers, but only one is fixable here. The model's omission is sampling — the tool description already states the requirement plainly and #1931 verified that guidance 3/3 in isolation; it still failed live. Everything downstream is deterministic and always produced silent data loss given that call:
contentandpropertiesare absent, so content-only always passes.updated: trueis hardcoded next to a computedproperty_count: 0.result_field_countwas already computed — and only logged.Per ADR-064 the fix belongs in runtime code, not another prose rewording.
Changes
tools.rs): reject anupdate_nodewhosecontentis byte-identical to stored content and which supplies no properties. Compared against the store, so only provably-inert calls are refused; genuine content edits pass.updated: truebesideproperty_count: 0. A content-only edit reportsupdated_content_onlyplus a note that state is unchanged.agent_loop.rs): an action claim backed solely by writes that persisted nothing becomes a confirmation request. Fires only when every write in the turn was empty. Keyed by tool name, not result shape —get_nodeon a schema node returns afieldsarray indistinguishable fromcreate_schema's, which would otherwise trip the guard on a read-only turn."Fact: node ... was updated."claim had zero tool calls and still passed, because the list carried"has been updated"but no bare passive"was updated". Added the passive forms.minProperties: 1.Two hypotheses from the issue, checked first
"Fact: node ... was updated."is the model's own generation atinference round completed, before any guard runs — notCONFIRMATION_REQUEST. The guard was absent, not emitting false success.flatten_properties_for_api(read) andnormalize_flat_properties_to_namespace(write) are symmetric, so the flat shape the model is shown is exactly whatupdate_nodeaccepts. This removed "surface the real shape" as a candidate fix.Verification
mod update_node_noop_gate), two of which fail against pre-fix code; 4 new helper tests. Agent lib: 439 → 445, all green.bun run test:all: frontend 4108/4108 matching baseline, browser 24/24, 42 Rust binaries, 0 failures.quality:fixclean (0 eslint, 0 svelte-check, clippy-D warnings).live_update_node_noop_gate.rs, realall_tool_definitions()+ realGraphToolExecutor+ real store): 3/3 reps persisted the property. Asserts against the store, never the return value —modifiedAtis unusable here since the no-op write bumped it.create_nodepersisted 0 properties while the model claimed the album was added — that false confirmation is now suppressed).Scenario 9 also surfaced a second model failure mode: encoding the state change into content prose instead of
properties. That call is not provably inert, so the gate correctly does not fire — but the result now saysupdated_content_only, and scenario 9 scores it red. Previously it was invisible.🤖 Generated with Claude Code