feat: delegation guidance as per-decision heuristic + escalating tool-cadence hook#52
Merged
Merged
Conversation
…alating hook The delegation reminder fired ~15 times per session and was reasoned past nearly every time — repetition without salience. Per the high-agency-strategy lens (Salience x Memeticity): - CLAUDE-FULL.md delegation block: MUST/SHOULD prose lists -> one per-decision question (3+ files / 10+ calls / security-sensitive?) with a routing table, an explicit NO branch, and loop-closing rules (re-ask on scope growth, one-line justification to override, no narration when delegating) - tool-cadence parallelmax branch: tracks distinct files edited as evidence, fires ONE soft nudge per streak (count or 3+ files), then ONE escalation via PostToolUse block (continueOnBlock) if the streak continues past the reminder; silent after that until an Agent call resets the streak - delegation-detector message compressed to a single high-salience line - new tests/tool-cadence.test.ts e2e suite for the parallelmax branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The delegation reminder fired ~15 times in a single session and got reasoned past nearly every time — repetition without salience, which trains the agent to tune out all hooks. This reworks delegation from a repeated nag into one per-decision question the agent answers before each unit of work, backed by a hook that now fires at most twice per streak: one evidence-based nudge, then one escalation it can't easily skim past.
First (and scoping) PR for #44 — the delegation worked example from the Salience × Memeticity audit. Closes #44; if the same pass should run over the remaining rule set, that's a fresh issue once we've measured adherence on this one.
Summary
CLAUDE-FULL.md: MUST/SHOULD prose lists → one question (3+ files, 10+ calls, or security-sensitive?) with a routing table, an explicit NO branch, and loop-closing rules (re-ask when scope grows; overriding a YES requires a stated one-line reason)src/hooks/tool-cadence.ts(parallelmax branch): now tracks distinct files edited as evidence; one soft nudge per streak (12 calls or 3+ files), then one escalation via PostToolUse block if the streak continues past the reminder — silent after that until an Agent call resets. Was: same paragraph every 12 calls, foreverconfig/40-hooks.json:continueOnBlock: trueon tool-cadence so the escalation surfaces as a block signal without aborting the turn (already modeled in the zod schema)src/hooks/delegation-detector.ts: message compressed to one line, consistent with the heuristicdocs/hooks-reference.mdrows updated (also fixes the stale "N=8" threshold doc)Test Plan
bun test— 515 pass, incl. newtests/tool-cadence.test.tse2e suite (nudge-once, escalate-once-then-silent, 3-file trigger, Agent reset, old-shape state migration)bun run typecheck/bun run lint/bun run compose