fix(mcp): a read says only what follows; a success adds no empty warnings (P5)

Two existing contracts the envelope broke when every result got every field:
a resource and its tool say the same (books://settings is books.settings,
checked by the_kept_resources_read), and a tool with no warnings has no
warnings key (books.add_account, defect 8). So head and next_steps are on
every tool that can change the books, next_steps is on a read only when
something follows it, guards is on a refusal, and the envelope adds no
warnings of its own (a tool's stay as they are).

The happy-path spec test now exercises books.journal_history (it fails on
a tool it never called), the demo company gets its books.start size check
(Done when 3), and the As-built block of P5 is written.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 15:48:42 -06:00
1 parent 8e683942a2
commit ad1afb478d
6 files changed
+76 -11

No files matched your search

+2 -2
View File
@@ -1564,8 +1564,8 @@ fn every_mutating_result_has_head_and_next_steps() {
};
let body = r.structured_content.expect("structured");
assert!(
body["guards"].is_array() && body["warnings"].is_array(),
"{name}"
body.get("guards").is_none() && body.get("warnings").is_none(),
"{name}: a success without them says none"
);
let ContentBlock::Text(t) = &r.content[0] else {
panic!("{name}: no text block");