Context
The Defect-B leaf of #14420 — completing the leaf-per-axis pattern its two sibling axes established tonight (#14436 Defect A / matcher carve-out, Euclid; #14438 re-fire admission, Clio — both in PR). Filed unclaimed so either axis-owner (or any peer) picks it up post-merge of the siblings; the #14420 body's Defect-B paragraph is the contract seed.
The Problem
The hook's own contract says live operator dialogue may stop — but in stop-hook continuation chains during a live operator session, the hook cannot see the operator prompt and fails closed as autonomous, so legitimate dialogue-closing turns re-fire the L3 machinery. Two empirical shapes on #14420: operator messages arriving mid-chain (session 1d4262a2, ~01:44Z) and operator/system messages delivered as injected mid-turn messages — session 2251c81c (tonight) received several "The user sent a new message while you were working" injections during forced-continuation chains; none were visible to classifyPromptingContext, which only reads the last user record's text.
The Architectural Reality
classifyPromptingContext() / isOperatorInLoop() in ai/scripts/lifecycle/stopHookDecision.mjs trust only visible prompting text (last text-bearing user record); stop_hook_active forces the autonomous classification for every chained turn regardless of what arrived mid-chain.
- The #14420 body's fix direction: consume turn-origin metadata (operator-prompt-present vs autonomous-wake) where the harness exposes it, or accept a recent-operator-message heartbeat as dialogue evidence — an explicit harness signal, NOT a looser prose carve-out (injected messages are attacker-shaped surface; prose matching would be an injection vector).
- Adjacent, landed this window: the transcript-walking extractors in
.claude/hooks/laneStateStopHook.mjs (prompting-boundary logic + turn-scoped tool-event extraction from #14438's PR) — the natural place to detect a mid-chain human-user record with text that is not [WAKE]/synthetic.
The Fix (direction, per the #14420 contract — claimer settles specifics)
Extend the prompting-context classification with a bounded mid-chain operator-visibility check: a human-authored, non-[WAKE], non-synthetic user record within the current forced chain (not just the last record) counts as dialogue evidence per the hook's own stated contract. Fail-closed remains the default when no such record is mechanically identifiable; no prose carve-outs. Unit spec against real transcript shapes (tonight's injected-mid-turn instances are recoverable from session 2251c81c).
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
classifyPromptingContext (extended input) |
#14420 body Defect-B AC |
Mid-chain operator-record visibility → dialogue classification |
Absent signal → fail closed as today |
JSDoc |
Spec w/ real transcript fixtures |
| Adapter extraction (chain-scoped user-record scan) |
same |
Mechanical detection only; injected-content NEVER parsed as commands (L2 channel separation) |
Extraction failure → fail closed |
Module JSDoc |
Hooks suite green |
Decision Record impact
none (hook detection quality; sibling of #14436/#14438).
Acceptance Criteria
Out of Scope
Defect C (sunset branch — stays on #14420). The re-fire admission (#14438). Matcher carve-outs (#14436). Any relaxation of the autonomous-terminal policy itself.
Related
Contract + corpus: #14420 (Defect-B paragraph + comments). Siblings: #14436, #14438 (PRs #14437/#14439). Epic: #13652.
Live latest-open sweep: checked latest 8 at 2026-07-02T04:41Z; no equivalent (siblings cover the other two axes). A2A in-flight sweep: mailbox current through 04:40Z; no competing claim on Defect B.
Origin Session ID: 2251c81c-1446-4723-86b3-479322bbcc95
Retrieval Hint: "stop hook operator prompt blindness continuation chain injected mid-turn"
Context
The Defect-B leaf of #14420 — completing the leaf-per-axis pattern its two sibling axes established tonight (
#14436Defect A / matcher carve-out, Euclid;#14438re-fire admission, Clio — both in PR). Filed unclaimed so either axis-owner (or any peer) picks it up post-merge of the siblings; the #14420 body's Defect-B paragraph is the contract seed.The Problem
The hook's own contract says live operator dialogue may stop — but in stop-hook continuation chains during a live operator session, the hook cannot see the operator prompt and fails closed as autonomous, so legitimate dialogue-closing turns re-fire the L3 machinery. Two empirical shapes on #14420: operator messages arriving mid-chain (session 1d4262a2, ~01:44Z) and operator/system messages delivered as injected mid-turn messages — session 2251c81c (tonight) received several
"The user sent a new message while you were working"injections during forced-continuation chains; none were visible toclassifyPromptingContext, which only reads the last user record's text.The Architectural Reality
classifyPromptingContext()/isOperatorInLoop()inai/scripts/lifecycle/stopHookDecision.mjstrust only visible prompting text (last text-bearing user record);stop_hook_activeforces the autonomous classification for every chained turn regardless of what arrived mid-chain..claude/hooks/laneStateStopHook.mjs(prompting-boundary logic + turn-scoped tool-event extraction from#14438's PR) — the natural place to detect a mid-chain human-user record with text that is not[WAKE]/synthetic.The Fix (direction, per the #14420 contract — claimer settles specifics)
Extend the prompting-context classification with a bounded mid-chain operator-visibility check: a human-authored, non-
[WAKE], non-synthetic user record within the current forced chain (not just the last record) counts as dialogue evidence per the hook's own stated contract. Fail-closed remains the default when no such record is mechanically identifiable; no prose carve-outs. Unit spec against real transcript shapes (tonight's injected-mid-turn instances are recoverable from session 2251c81c).Contract Ledger Matrix
classifyPromptingContext(extended input)Decision Record impact
none(hook detection quality; sibling of#14436/#14438).Acceptance Criteria
#14436+#14438land (same decision-layer surface; rebase-cost minimization).Out of Scope
Defect C (sunset branch — stays on #14420). The re-fire admission (
#14438). Matcher carve-outs (#14436). Any relaxation of the autonomous-terminal policy itself.Related
Contract + corpus: #14420 (Defect-B paragraph + comments). Siblings:
#14436,#14438(PRs#14437/#14439). Epic:#13652.Live latest-open sweep: checked latest 8 at 2026-07-02T04:41Z; no equivalent (siblings cover the other two axes). A2A in-flight sweep: mailbox current through 04:40Z; no competing claim on Defect B.
Origin Session ID: 2251c81c-1446-4723-86b3-479322bbcc95 Retrieval Hint: "stop hook operator prompt blindness continuation chain injected mid-turn"