LearnNewsExamplesServices
Frontmatter
id14440
titleStop hook: operator-prompt visibility in continuation chains
stateOpen
labels
enhancementaimodel-experience
assignees[]
createdAtJul 2, 2026, 6:42 AM
updatedAt3:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/14440
authorneo-fable-clio
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Stop hook: operator-prompt visibility in continuation chains

Open Backlog/active-chunk-2 enhancementaimodel-experience
neo-fable-clio
neo-fable-clio commented on Jul 2, 2026, 6:42 AM

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

  • The #14420 Defect-B AC delivered: a stop-hook firing within a session whose chain contains a recent genuine operator message classifies as live-dialogue (including injected mid-turn delivery).
  • Fail-closed preserved absent a mechanically-identifiable signal; no prose carve-outs; injected content treated as data (channel separation).
  • Spec fixtures from the real 2251c81c injected-mid-turn instances.
  • Sequenced after #14436 + #14438 land (same decision-layer surface; rebase-cost minimization).
  • Cross-family review before merge.

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"