Skip to content

fix(hooks): #170 — gate the post-preflight capture reminder to non-read-only prompts#535

Closed
Knapp-Kevin wants to merge 1 commit into
devfrom
fix/170-preflight-capture-reminder-gate
Closed

fix(hooks): #170 — gate the post-preflight capture reminder to non-read-only prompts#535
Knapp-Kevin wants to merge 1 commit into
devfrom
fix/170-preflight-capture-reminder-gate

Conversation

@Knapp-Kevin

Copy link
Copy Markdown
Collaborator

Closes #170.

Problem

The PostToolUse hook on bicameral_preflight fired the Step 5.6 capture-disambiguation reminder on every preflight that surfaced ≥1 decision — including read-only, compatible, and tangential prompts where no refinement exists. That spams the user with AskUserQuestions and risks spurious/hallucinated captures.

Fix — read-only-only suppression gate

suppress_capture_reminder(prompt) (in scripts/hooks/preflight_intent.py) suppresses the reminder only for unambiguously read-only/informational prompts that carry no implementation verb. The UserPromptSubmit hook hands the prompt to the PostToolUse hook via a session-scoped store (scripts/hooks/session_prompt_store.py; 24h staleness sweep + SessionEnd cleanup).

⚠️ Design decision (operator-ruled after an audit VETO) — please read

An initial recall-biased lexical gate (suppress on a 'compatible' keyword absent a contradiction keyword) was VETOed in audit: it reintroduces the exact #175 failure mode. A lexical scan cannot distinguish a truly-compatible prompt (add tests for X) from a refinement smuggled under a compatible verb (add tests for X, and expose it as a programmatic API) — suppressing the latter is silent, irreversible decision-capture loss.

Decision: the gate fails open on ANY implementation verb — only verb-free read-only prompts are ever suppressed. This structurally preserves the #175 invariant (contradiction is never decided by a lexical scan over a write prompt).

Consequence — acceptance case (b) is intentionally NOT implemented: add tests for drag-to-reorder carries add, so it fires (not suppressed). The issue's acceptance should be amended to "suppress read-only/informational prompts only." Suppressing compatible writes is not safely achievable lexically; it would require a non-lexical signal (e.g. an explicit user toggle) — out of scope here.

Tests (lock the invariant)

Governance

🤖 Authored via Qor-logic SDLC on Claude Code

…ad-only prompts

The PostToolUse capture reminder fired on every preflight that surfaced >=1
decision, asking the user to disambiguate a possible refinement even on read-only
and tangential prompts — spam, with a risk of spurious/hallucinated captures.

Gate: suppress the reminder ONLY for unambiguously read-only / informational
prompts that carry no implementation verb (`suppress_capture_reminder` in
scripts/hooks/preflight_intent.py). The UserPromptSubmit hook hands the prompt to
the PostToolUse hook via a session-scoped store (scripts/hooks/session_prompt_store.py;
24h staleness sweep + SessionEnd cleanup).

DESIGN DECISION (operator-ruled after an audit VETO) — "read-only-only" suppression:
A lexical gate cannot distinguish a truly-compatible prompt ("add tests for X")
from a refinement smuggled under a compatible verb ("add tests for X, and expose
it as a programmatic API"). Suppressing compatible-WRITE prompts would regress
#175 (silent, irreversible decision-capture loss). So the gate fails open on ANY
implementation verb — only verb-free read-only prompts are ever suppressed.
CONSEQUENCE: acceptance case (b) ("add tests for drag-to-reorder" -> suppress) is
intentionally NOT implemented; it fires, preserving #175. The issue's acceptance
should be amended to "suppress read-only / informational prompts only."

Governed via /qor-auto-dev-1: plan VETOed (the lexical-gate hole above), re-planned
to the operator's read-only-only ruling, re-audited PASS. Tests lock the invariant
(write-verb prompts — incl. the smuggled-refinement case — must fire).

META_LEDGER seal deferred to merge time: this branch and PR #534 both branch off
the same dev tip (Entry #55); sealing here would fork the Merkle chain against
#534's pending Entry #56. The entry is added (next free number, re-chained off the
dev tip) when this branch merges.

🤖 Authored via [Qor-logic SDLC](https://github.com/MythologIQ-Labs-LLC/qor-logic) on [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d6d5a8ad-ba9e-4be0-a73f-a6d0ccf11128

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/170-preflight-capture-reminder-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jinhongkuan

Copy link
Copy Markdown
Contributor

Closing during PR hygiene because this branch is stale/conflicting and predates the alpha review-routing docs. The underlying UX point is still relevant for cognitive-debt reduction: read-only prompts should not trigger write/capture pressure. Please re-cut from current dev against issue #170 and align with the alpha model where Product Owner review is implicit and reason explains routing, not reviewer assignment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants