Commit Graph
1 Commits
Author SHA1 Message Date
David F GliddenandClaude Opus 5 cfbaded580 [FIX] The wrap seam: Stop + systemMessage, and a detector that fired on its own authoring
SessionEnd had no delivery. `Stop` does — the binary documents it: "Stop hook that
displays message to user: Command must output JSON with `systemMessage` field". But Stop
fires every turn, and a fool who speaks every turn is a chatbot, so it needs a real wrap
signal. It uses the most direct one: the transcript records the steward's command
invocations, so a wrap is DETECTED rather than inferred from a file mtime, which is the
proxy shape this record has twice logged as the thing that fails.

⚠ THE FIRST VERSION FIRED ON A SESSION THAT NEVER WRAPPED, and the cause is the third
and worst self-reference of the day. The marker was held as a literal; the transcript
records EVERYTHING, including the act of writing this detector; so authoring the literal
planted it in the corpus the detector searches. All three matches were `tool_use` inputs
— the executor writing the thing that then found itself.

Fixed twice over, because one fix is not the class. STRUCTURALLY: only a `type="user"`
record with a STRING content counts, measured against how a real invocation is actually
recorded, which is what separates the steward doing it from the executor writing about
it. TEXTUALLY: the marker is assembled from parts so the literal never exists in source.
Both have controls, including the exact negative that would have caught the first
version — an assistant tool_use carrying the marker must not read as a wrap.

Idempotence is by session id and CONSUMED BEFORE GENERATING, so a failed generation
falls silent rather than retrying on every subsequent turn.

The prompt guards the drift this seam specifically invites, which is not summary but
CLOSURE — a wrap already has a record and he is not it.

21/21 controls.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J6hZXNYSxEfZseBGTni4sf
2026-08-25 16:56:32 +02:00