audit(token_audit): count naming the shortcut, and typing the fix command - #385
Conversation
|
This pull request is part of a Mergify stack:
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e37bedbb-23a6-4755-98f3-4a91bd38efcd) |
54530d6 to
41708da
Compare
e8454f8 to
9e1b549
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ce859959-1e3a-4f4c-9afc-5742617a75de) |
…mand
The same-type intervention detector matched only told-you, accusation, and
agent-blame, so a session where the user twice named the shortcut the agent
took, and typed /automate-me and /reflect, scored zero and reported that no
automate-me was owed.
Two kinds join the set: cheap-way-out ("cheap way out", "why would you",
"straight up", "that's weird") and explicit-invocation (a typed
/automate-me, /reflect, or /thrash). Reaching for the fix-the-process
command is itself the intervention. Product blame and plain questions still
score zero, with fixtures both ways.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ
Change-Id: Ifbb2b9797be1017833d9f5e2a45b3bd06ffdad61
9e1b549 to
0d53f86
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d7e45ac9-b31a-4fea-932a-5a7336830c0d) |
|
Queued — the merge queue status continues in this comment ↓. |
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 5 minutes 16 seconds in the queue, including 4 minutes 28 seconds running CI. Required conditions to merge
|
Summary
The same-type intervention detector matched only told-you, accusation, agent-blame, restated-ask, and proof-challenge.
So a session where the user twice named the shortcut the agent had taken, and typed the fix-the-process command, scored zero and reported that no automate-me was owed. The audit said no while the user was asking for exactly that.
Two kinds join the set. One catches naming the shortcut ("cheap way out", "why would you", "straight up", "that's weird"), the other catches a typed
/automate-me,/reflect, or/thrash.Reaching for the fix-the-process command is itself the intervention.
Before and After
A two-message session where the user says "cheap way out", then "why would you ... straight up ... thats wierd", and types
/reflect, run throughpython3 engine/skills/reflect/scripts/token_audit.py codex session.jsonlon the base (54530d6) and on this PR (e8454f8):Review Claim
Naming the shortcut twice, or typing the fix-the-process command, counts toward the same-type intervention that makes automate-me mandatory.
Review Lane
behavior
Review Unit
tooling-policy
Safety Invariant
Two entries are appended to the pattern list and two names to the kind set; nothing existing is edited, so every previously flagged session flags the same way. Product blame and plain questions still score zero, asserted by a negative fixture alongside the positive one.
Slice Rationale
The detector change is separable from the skill prose in the slice below it, and either can be reverted alone.
Non-goals
Does not change what the flag causes to happen, only when it fires. Does not touch the frustration score itself or the cost audit.
Test Plan
Test Plan
python3 -m unittest discover -s engine/skills/reflect/scripts/tests— 172 tests, OK (2 new: the real shape fires, product blame and a plain question stay silent)intervention-must-automate: yes (count=3)where it previously readno (count=0)python3 scripts/check_no_new_comments.py --base origin/main— okRevert Plan
Revert Plan
git revert <sha>🤖 Generated with Claude Code
https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ
Note
Medium Risk
Changes live PreToolUse/Stop routing for subagent publishing and how CAT-UNVERIFIED tags behave; mis-tuned command parsing or liveness caching could block or allow the wrong path, but tests and fail-open/UNCHECKED branches are documented.
Overview
Replaces
agent-routing-guard(PreToolUse on Agent prompt regex) withpublish-act-guard, which blocks actual publishing shell commands (git push,gh pr create|merge|ready, mutatinggh apion pulls,mergify stack push,create-pr.mjs,safe-stack-push.mjs --execute) only when the caller is a subagent andinvoker-cli query capacitysays a live owner is reachable. Liveness failures are UNCHECKED and allow the command with a named reason; install merges the new hook and strips the retired Agent hook entry.Adds
unverified-tag-ledger: Stop records well-formed{{CAT-UNVERIFIED: …}}tags, refuses a turn that tags without running a verification tool (unlessstop_hook_active), and UserPromptSubmit reminds on outstanding claims; it opts out of SubagentStop inheritance.pr-schema-gateno longer treats validator exit 0 as clean when output says UNCHECKED/SKIPPED/not installed.Policy and reflect: cat-mode and
named-constraintsadd hook/classifier block is a stop, not a puzzle;CLAUDE.core.mdtightens evidence for cache/offline reads and stale readings after restarts. reflect step 5 requiresfanout_complete.py(complete / incomplete / unchecked exit codes) before applying Accepted findings.token_auditcounts cheap way out / why would you and typed/reflect|automate-me|thrashtoward intervention-must-automate.Reviewed by Cursor Bugbot for commit 0d53f86. Bugbot is set up for automated code reviews on this repo. Configure here.