Repository navigation
Measure declaring enums on search_nodes filters: negative result, block stays for reads - #2159
Merged
Merged
Conversation
…anly core#2147's acceptance criteria required an ablation arm before any code change: copy no-schemas-block.toml, declare the type's filterable fields with enums on search_nodes's filters, and re-measure turn 1's status filter before assuming the write-side fix (#2120/#2148) transplants to reads. Two encodings measured via golden_runner --reps 5, both 5/5 consistent: - filters-enum.toml: property+value paired inside oneOf branches (mirrors declare_write_tool_fields's field_values pattern as literally as possible). Recovers the correct enum value ("in_dev") but breaks the wire format — the model echoes the schema's own oneOf-branch `properties` keyword into the instance, confirmed via the post-template prompt dump (Gemma-4's template has bespoke rendering for a real top-level properties key but renders oneOf branches as opaque literal text, including their own nested properties key). - filters-enum-flat.toml: a flat enum on `property` and a flat anyOf on `value`, avoiding oneOf/nested-properties entirely. Keeps the wire format correct but the value reverts to "dev" (wrong) — nothing in a flat schema ties value's enum branch to property being "status" specifically. Neither encoding satisfies both the acceptance criteria's correctness bar and its "wire format unchanged" requirement at once, so this does not recover the way #2120's field_values fix did for writes. Filters resist the same treatment because the wire format encodes the field name as a runtime value rather than a schema key, and JSON Schema has no flat way to condition one property's legal values on another's. No production code changed. RELEVANT NODE TYPES / EXISTING SCHEMAS remains required for reads; updated PATTERN.toml and no-schemas-block.toml's notes, which both previously recorded this as "not yet measured." Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2147
What this is
core#2147's acceptance criteria required an ablation measurement before any code change: copy
no-schemas-block.toml, declare the type's filterable fields with enums onsearch_nodes'sfilters, and re-measure turn 1's status filter — recording the result, positive or negative, rather than assuming symmetry with #2120/#2148's write-side fix.Result: negative. No production code changed in this PR — the measurement doesn't support one.
What was measured
Two encodings tested via
golden_runner --reps 5, both 5/5 consistent:packages/agent/goldens/ablation/filters-enum.toml—property+valuepaired insideoneOfbranches, mirroringdeclare_write_tool_fields'sfield_valuespattern as literally as possible:The enum VALUE is correct (
in_dev, notdev) — the information did reach the model. But the wire format is broken:property/valuearrived nested under a spurious"properties"key, and the required"type"key is missing. Confirmed via the post-template prompt dump: Gemma-4's function-declaration template has bespoke rendering for a schema's real top-levelpropertieskey, but rendersoneOfbranches as opaque literal text — including their own nestedpropertieskey, spelled out as quoted text the model then pattern-matches and reproduces literally.packages/agent/goldens/ablation/filters-enum-flat.toml— a flatenumonpropertyand a flatanyOfonvalue, avoidingoneOf/nested-propertiesentirely:Wire format is correct, but the value reverted to
dev(wrong) — nothing in a flat schema tiesvalue's enum branch topropertybeing"status"specifically, so the model took the unconstrained branch.Conclusion
Neither encoding satisfies both the acceptance criteria's correctness bar and its "wire format unchanged" requirement at once. Filters resist the write-side fix's treatment because their wire format encodes the field NAME as a runtime VALUE (
property: "status") rather than as a JSON Schema KEY the wayfield_values.statusdoes — JSON Schema has no flat way to condition one property's legal values on another's, and the one compositional construct tried (oneOf) is not safely representable through this model's structured tool-calling.RELEVANT NODE TYPES/EXISTING SCHEMASremains required for reads. Unlike the write path, where the tool-schema channel now fully substitutes for the block (#2120/#2148), the read path has no wire-format-safe schema-only substitute yet measured.Also updated
PATTERN.tomlandno-schemas-block.toml's notes, which both previously recorded this as "not yet measured" / "open and NOT run" — now recorded with the actual result.Not pursued here (future work, needs its own measurement)
if/thenJSON Schema conditionals — same nested-properties-keyword shape asoneOf, likely the same echoing risk.exec_search_nodes's existing reactivefilterable_propertieshint (currently only returned on an empty result) to fire proactively.Testing
golden_runner --check(parses, renders the intended schema).golden_runner --reps 5against the locked native model;filters-enum.toml's result additionally cross-checked against the post-template prompt viaNODESPACE_PROMPT_DUMPto confirm the root cause.cargo test -p nodespace-agent --test prompt_assembly_snapshotre-run and confirmed unaffected (5/5 pass, unchanged). Clarification on the acceptance criterion "full golden corpus re-run; no case regresses": the snapshot test above is a separate, zero-model-call mechanism (hand-built fixtures, never touchespackages/agent/goldens/) — it is not evidence about thedev-*.tomlcorpus itself. This PR did not do a livegolden_runnerpass over the full corpus, because no production code changed: nothing infind_skills,declare_write_tool_fields,stage2_tools, or any tool definition was touched, so there is no mechanical path by which an existing corpus case's behavior could have shifted. Regression risk here is inherently zero by construction, not empirically re-confirmed.bun run test:all+cargo build --bin nodespaced+bun run test:e2e+cargo test -p nodespace-app) passed locally before push.🤖 Generated with Claude Code