Skip to content

Stop hook: terminal PR-readiness claim relayed from a subagent report, or phrased outside the guard's vocabulary #3472

Description

@d-morrison

Summary

A session dispatched sidecar subagents to open PRs, then relayed each subagent's terminal-readiness claim to the user verbatim, without running scripts/check-pr-fully-clean.py itself. Both claims were false when measured:

Why the existing guard missed both

hooks/no-incomplete-check-enumeration.py already blocks a terminal clean claim backed only by a partial CI reading (gh pr checks, statusCheckRollup). It missed both cases here:

(a) Vocabulary: "green, awaiting your merge" asserts the same terminal fact as "ready to merge" but used none of RX_DECLARE's phrases, so it tripped nothing.

(b) Evidence source: a dispatched subagent's own report is a claim, not an instrument reading, and is stale by construction (the agent stops, then reviews/checks keep landing). The original guard required a partial CI reading to even fire; relaying a subagent's report with no reading at all by the conducting session tripped nothing.

Fix

Extended hooks/no-incomplete-check-enumeration.py (rather than adding a sibling -- see PR) to:

  • add RX_DECLARE_MERGE_READY for the broader vocabulary, and
  • track the most recent point a dispatched Agent/Task call's report landed in the transcript (last_subagent, via tool_use_id correlation, the same technique remind-brief-premises.py uses), requiring a complete check-pr-fully-clean.py read after that point too, not just after the last push.

Both new conditions WARN (systemMessage) rather than BLOCK; the original narrow condition (original vocabulary + partial CI reading + no subagent involved) keeps blocking exactly as before.

Per README's activation gate, the hook stays registered-but-inert until this PR merges.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions