Skip to content

Say in create_node's description that an undeclared key is refused - #4351

Merged
mstomar125 merged 1 commit into
mainfrom
issue-4343-create-node-desc
Nov 25, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-4343-create-node-desc

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

What

create_node's tool description told the model that a key the type does not list "is carried under a key named after the user's own wording rather than dropped", and its example passed depends_on. Types are closed (ADR-112): the write is refused, naming the key and the type. A model following the description invited the refusal.

  • The description now says an undeclared key is refused, the refusal names the key and the type, and the model reports the refused value and offers to add the field as a separate request; it never adds the field itself and never drops the value silently.
  • The example's user message and call no longer carry an undeclared key.
  • goldens/ablation/fidelity-k1.toml: the Node Creation guidance, the create_node tool description and the field_values parameter description no longer tell the model to use a custom: prefix or to store extra keys; they match the current rule.
  • proto/node_service.proto: the UpdateTaskNodeRequest comment no longer mentions custom: extension fields.
  • stage2_tool_surface.golden regenerated: the only change is the create_node description.

Agent-lane change (packages/agent): the owner signed off agent-lane work for this batch.

Tests

  • New create_node_description_says_an_undeclared_key_is_refused (tools.rs). Mutation check: changing "is refused" to "is kept" and the lead sentence in the description makes it fail; restored, it passes.
  • cargo test -p nodespace-agent (lib 1379 passed, it 173 passed, live-model tests ignored), cargo clippy -p nodespace-agent --all-targets -D warnings, cargo fmt --check: green. No live-model or eval runs.
  • Other ablation goldens (fidelity-rank1-*, production-baseline, ...) are frozen experiment records that carry the same old text; only the file named in the issue was changed.

Closes #4343

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE (static review, head 0b95488)

  • The new create_node description matches the code: crud.rs:3723 reject_undeclared_keys refuses with "'{key}' is not a field of the type '{scope}' ... Tell the user which value was refused and offer to add '{key}' to the type as a separate request ... do not add it yourself", and undeclared_refusal_backstop (agent_loop.rs:2806) replaces the reply with a message that offers the field as a separate request.
  • stage2_tool_surface golden diff is the single create_node description line and equals the tools.rs text; the field_values parameter description is rewritten consistently.
  • grep of packages/agent/src and packages/proto for custom: guidance finds none left; remaining hits are the old wording only in frozen goldens/ablation experiments (fidelity-k1.toml, edited here, is the one live-ish arm and is consistent) and unrelated Rust identifiers named custom.
  • Ran: the new unit test create_node_description_says_an_undeclared_key_is_refused plus the lib filters local_agent::tools / prompt_assembly: 248 passed, 0 failed.
  • NOT run by me: the tests/it prompt_assembly golden test (the merge gate will run it), a revert mutation of the new test (by reading, the old text contains depends_on and lacks "is refused", so it would fail), bun run test:changed, clippy.
  • Nit: "nothing is created" relies on the refusal being atomic on the create path; I did not trace it.

The description told the model a key the type does not list is kept under the
user's wording, and its example passed one. A type is closed: the write is
refused, naming the key and the type. The description now says so, tells the
model to report the refused value and offer the field as a separate request
without adding it itself, and the example passes only declared keys. The
fidelity-k1 ablation golden and the UpdateTaskNodeRequest proto comment no
longer describe custom: prefixed extension fields.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-4343-create-node-desc branch from 0b95488 to 309d275 Compare November 25, 2026 08:52
@mstomar125
mstomar125 merged commit c9d3030 into main Nov 25, 2026
@mstomar125
mstomar125 deleted the issue-4343-create-node-desc branch November 25, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create_node tool description says an unlisted key is kept under the user's wording; the write is now refused

1 participant