Context
This is the narrow implementation leaf for #14420 Defect A. The parent ticket captures several stop-hook detection defects; this leaf only covers the pure deference phrase matcher so the implementation PR can use an honest close target without closing the broader parent.
Live latest-open sweep: checked latest 20 open issues at 2026-07-02T04:16:12Z. #14420 is the parent, and no equivalent matcher-only leaf exists. Closest related issues are #14093 (operator-gated close/convergence wait) and #13751 (release-ROI direction, not code-ready). A2A in-flight sweep at 2026-07-02T04:16:12Z found Clio's sibling [lane-claim] #14420 re-fire axis, explicitly sequenced after this Defect-A PR, so it is related-not-duplicate.
The Problem
The current matcher strips markdown code spans/fences before scanning, but it still treats reported prose as live deference. That creates two false-positive classes from the #14420 corpus:
- quoted or reported mentions such as
"your call" or the phrase your call;
- attributive citations such as
per your call, where the phrase credits an operator decision already made rather than handing a decision back.
The false positive is costly because agents then learn to phrase around the matcher instead of examining whether they actually deferred.
The Architectural Reality
The relevant substrate is intentionally small and pure:
ai/scripts/lifecycle/deferencePhraseMatch.mjs owns the tight phrase list and autonomous-turn phrase detection.
test/playwright/unit/hooks/deferencePhraseMatch.spec.mjs owns direct unit coverage for the matcher.
ai/scripts/lifecycle/stopHookDecision.mjs, .claude/hooks/laneStateStopHook.mjs, and .codex/hooks/codex-lane-state-stop.mjs consume the matcher but should not need policy changes for this leaf.
The Fix
Add local match-context filters after markdown-code stripping:
- strip quoted prose spans before phrase matching;
- suppress reported/use-mention contexts immediately preceding a match;
- suppress
your call when the local prefix marks it as an attributive citation (per, as you said/directed/called);
- preserve actual deference uses of
your call.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
matchDeferencePhrase(text) |
#14420 Defect A corpus + existing matcher JSDoc |
Return null for quoted/reported phrase mentions and attributive citations |
Keep current matching for actual deference phrases |
Existing JSDoc remains the public API note |
Focused unit fixtures in deferencePhraseMatch.spec.mjs |
| Stop-hook deference decision |
stopHookDecision.mjs consumes detectDeferencePhrase() |
Inherits the narrower matcher without changing L3 no-hold policy |
Operator-dialogue carve remains unchanged |
No doc change; behavior covered by tests |
Shared stop-hook decision + adapter tests |
Decision Record impact
none (classifier precision bug; aligned with the #14420 detection-quality lane)
Acceptance Criteria
Out of Scope
#14420 Defect B operator-prompt visibility.
#14420 terminal-shape re-fire axis; Clio owns this as a sibling lane after this PR.
#14420 sunset branch and declining-yield artifact logging.
#13751 release-ROI direction injection.
Avoided Traps
- Do not add a phrase-specific blocklist exception only for
per your call; the filter must distinguish reported/attributive contexts from live deference uses.
- Do not weaken L3 no-hold behavior or the operator-dialogue carve; this leaf narrows phrase detection only.
Related
Related: #14420
Related: #14093
Related: #13751
Origin Session ID: 8facbc96-c346-4633-9141-79a968ca1c5d
Handoff Retrieval Hints: deferencePhraseMatch reported mention, per your call attributive citation, #14420 Defect A matcher
Context
This is the narrow implementation leaf for
#14420Defect A. The parent ticket captures several stop-hook detection defects; this leaf only covers the pure deference phrase matcher so the implementation PR can use an honest close target without closing the broader parent.Live latest-open sweep: checked latest 20 open issues at 2026-07-02T04:16:12Z.
#14420is the parent, and no equivalent matcher-only leaf exists. Closest related issues are#14093(operator-gated close/convergence wait) and#13751(release-ROI direction, not code-ready). A2A in-flight sweep at 2026-07-02T04:16:12Z found Clio's sibling[lane-claim] #14420 re-fire axis, explicitly sequenced after this Defect-A PR, so it is related-not-duplicate.The Problem
The current matcher strips markdown code spans/fences before scanning, but it still treats reported prose as live deference. That creates two false-positive classes from the
#14420corpus:"your call"orthe phrase your call;per your call, where the phrase credits an operator decision already made rather than handing a decision back.The false positive is costly because agents then learn to phrase around the matcher instead of examining whether they actually deferred.
The Architectural Reality
The relevant substrate is intentionally small and pure:
ai/scripts/lifecycle/deferencePhraseMatch.mjsowns the tight phrase list and autonomous-turn phrase detection.test/playwright/unit/hooks/deferencePhraseMatch.spec.mjsowns direct unit coverage for the matcher.ai/scripts/lifecycle/stopHookDecision.mjs,.claude/hooks/laneStateStopHook.mjs, and.codex/hooks/codex-lane-state-stop.mjsconsume the matcher but should not need policy changes for this leaf.The Fix
Add local match-context filters after markdown-code stripping:
your callwhen the local prefix marks it as an attributive citation (per,as you said/directed/called);your call.Contract Ledger Matrix
matchDeferencePhrase(text)#14420Defect A corpus + existing matcher JSDocnullfor quoted/reported phrase mentions and attributive citationsdeferencePhraseMatch.spec.mjsstopHookDecision.mjsconsumesdetectDeferencePhrase()Decision Record impact
none (classifier precision bug; aligned with the
#14420detection-quality lane)Acceptance Criteria
per your calldo not match.Your call?andit's your call whether...still match.Out of Scope
#14420Defect B operator-prompt visibility.#14420terminal-shape re-fire axis; Clio owns this as a sibling lane after this PR.#14420sunset branch and declining-yield artifact logging.#13751release-ROI direction injection.Avoided Traps
per your call; the filter must distinguish reported/attributive contexts from live deference uses.Related
Related: #14420 Related: #14093 Related: #13751
Origin Session ID: 8facbc96-c346-4633-9141-79a968ca1c5d
Handoff Retrieval Hints:
deferencePhraseMatch reported mention,per your call attributive citation,#14420 Defect A matcher