aboutsummaryrefslogtreecommitdiff
path: root/.ai/protocols.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-19 21:04:43 -0500
committerCraig Jennings <c@cjennings.net>2026-07-19 21:04:43 -0500
commit94e54f69453dea0feda4722347ba3c60c9822c2b (patch)
tree33ecdef82afc8819dd8ef1dc1b587de046719550 /.ai/protocols.org
parent33c6d7b8f497ba103d3a949e7f3cadc3d2e100ae (diff)
downloadrulesets-94e54f69453dea0feda4722347ba3c60c9822c2b.tar.gz
rulesets-94e54f69453dea0feda4722347ba3c60c9822c2b.zip
feat(hooks): soft-nudge pending inbox handoffs at task boundaries
The "check inbox/ at every task boundary" rule was prose-only in protocols.org, so it held only as well as the agent remembered it and a handoff could pass a turn unseen. inbox-boundary-check.sh is a Stop hook that backs the rule: when inbox-status -q reports pending items it blocks the yield once and injects the count, so the agent processes them before returning. It soft-nudges rather than hard-blocks. On the harness re-entry (stop_hook_active: true) the hook steps aside and lets the turn end, so a mid-task pause to ask a question, or an item the agent genuinely can't process, never wedges the session. A hard block would instead push inbox processing ahead of that clarifying question. The hook self-skips where it doesn't apply: no inbox/ dir, no inbox-status, or a clean inbox each exit 0 silently, so one global hook covers every project with no config. It prefers the project-local .ai/scripts/inbox-status and falls back to one on PATH. It's wired into the Stop array ahead of ai-wrap-teardown in both the tracked settings.json (which the live ~/.claude/settings.json symlinks to) and the documented snippet. bats covers pending, clean, the re-entry step-aside, no-inbox, and the absent-status degrade.
Diffstat (limited to '.ai/protocols.org')
-rw-r--r--.ai/protocols.org2
1 files changed, 2 insertions, 0 deletions
diff --git a/.ai/protocols.org b/.ai/protocols.org
index 5cd69d4..2297026 100644
--- a/.ai/protocols.org
+++ b/.ai/protocols.org
@@ -205,6 +205,8 @@ Check =inbox/= at every task boundary (after finishing a unit of work, before re
Exit 1 means handoffs are pending — process them per =inbox.org= process mode. For each accepted handoff, the act-vs-file rule: *act now* when it's clear, bounded, low-risk, in-scope, and cheaper than deferring — just do it, no asking; *file* otherwise — ask first, with filing as option 1 and "do it now" as option 2; *ask* if unsure. Exception: a proposal to change a shared asset (template workflow, rule, skill, synced script) or a substantive convention never silently acts now — it goes through the inbox engine's skeptical review and its approval (or park) step. Always reply to a handoff's sender (confirm on accept, the why on reject). Full process, the reply discipline, and the opt-in background-monitor =/loop= recipe live in =inbox.org= monitor mode.
+A machine-global =Stop= hook (=inbox-boundary-check.sh=) backs this rule so it isn't prose-only. When handoffs are pending it blocks the turn once and injects the count, so a task boundary can't pass with items unseen. It soft-nudges rather than hard-blocks: on the harness re-entry it steps aside, so a mid-task pause to ask "what's next" is never hijacked into inbox processing. The rule above still governs what to do with the items; the hook only makes sure you look.
+
** Recursive Reads — Honor =.aiignore=
Before a naive recursive read or glob of a project tree (file inventories, "what's in this repo", broad greps), skip the noise: dependency trees (=node_modules/=, =.venv/=), build output (=dist/=, =build/=, =coverage/=), language caches (=__pycache__/=, =.pytest_cache/=, =*.pyc=), editor/OS cruft, and generated token/OAuth artifacts. These waste tokens and skew project summaries even when gitignored — a recursive read sees the disk, not git.