fix(hooks): #170 — gate the post-preflight capture reminder to non-read-only prompts#535
fix(hooks): #170 — gate the post-preflight capture reminder to non-read-only prompts#535Knapp-Kevin wants to merge 1 commit into
Conversation
…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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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. |
Closes #170.
Problem
The PostToolUse hook on
bicameral_preflightfired 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 withAskUserQuestions and risks spurious/hallucinated captures.Fix — read-only-only suppression gate
suppress_capture_reminder(prompt)(inscripts/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).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-reordercarriesadd, 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)
tests/test_preflight_intent.py— incl. the feat(skill): user-disambiguation question before Step 5.6 contradiction capture #175 regression guard:add tests … expose as a programmatic API→ must fire; a non-addverb variant (locks the regex, not the literal); contradiction prompt → not suppressed; read-only → suppressed.tests/test_post_preflight_capture_reminder.py— drives the real hookmain()for the 3 acceptance fixtures + recall-bias fallback (missing prompt → fire) + store round-trip / 24h sweep / SessionEnd cleanup.Governance
ledger/schema.pychange./qor-auto-dev-1: plan → audit VETO → re-plan (operator ruling) → re-audit PASS → implement → substantiate.skills/bicameral-preflight/SKILL.mdStep 5.6 updated to document the gate (Tool/Skill-contract rule).🤖 Authored via Qor-logic SDLC on Claude Code