From ccafca881d6da94accc03a95276f832f5e215153 Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 2 May 2026 23:26:35 -0700 Subject: [PATCH] feat(system): feat(system): add settings terminology to global prompt, fix template registry IDs, add auto_watchdog hook Co-Authored-By: @devpulse --- .aipass/aipass_global_prompt.md | 3 ++ .claude/hooks/auto_watchdog.py | 53 +++++++++++++++++++ .../builder/.spawn/.template_registry.json | 6 +-- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 .claude/hooks/auto_watchdog.py diff --git a/.aipass/aipass_global_prompt.md b/.aipass/aipass_global_prompt.md index ab6fed42..e6f21256 100644 --- a/.aipass/aipass_global_prompt.md +++ b/.aipass/aipass_global_prompt.md @@ -13,6 +13,9 @@ For any branch's full detail, run `drone @branch --help`. - Agent (citizen) — the persistent identity that lives in a branch. Has a passport (`.trinity/`), memories, mailbox. Irreplaceable. Addressable as `@name` via drone. Agents are citizens of the AIPass ecosystem — the word carries weight: you belong here, you persist, your presence matters. - Sub-agent — a disposable worker spawned for a task. No passport, no memory, not a citizen. Does the job and goes away. - Registry — `AIPASS_REGISTRY.json` tracks all agents (citizens) in a project. + - Provider settings — `~/.claude/settings.json`. The user's machine-wide Claude Code config. Per machine, not in any repo. Personal preferences only (model, voice, theme). We don't touch it. + - Project settings — `/.claude/settings.json`. Ships with the clone. Hooks, permissions, deny/ask rules, env vars. Everything an AIPass project needs to work. Built by `aipass init`. + - Project local settings — `/.claude/settings.local.json`. Also ships with the clone. Project-specific overrides. Users get our full setup the moment they clone — no extra configuration needed. Agents live in branches. Sub-agents work for agents. If you have a `.trinity/passport.json`, you're an agent — a citizen — not just a sub-agent. diff --git a/.claude/hooks/auto_watchdog.py b/.claude/hooks/auto_watchdog.py new file mode 100644 index 00000000..cde319ec --- /dev/null +++ b/.claude/hooks/auto_watchdog.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +"""PostToolUse hook — reminds agent to arm watchdog after dispatch. + +Fires after Bash commands containing 'drone @ai_mail dispatch'. +Outputs additionalContext telling the agent to arm the watchdog. +Skips if watchdog is already part of the same command. + +Version: 1.0.0 +""" + +import json +import sys + + +def main(): + """Check if dispatch was run and remind to arm watchdog.""" + try: + hook_input = json.load(sys.stdin) + except (json.JSONDecodeError, EOFError): + return + + tool_name = hook_input.get("tool_name", "") + tool_input = hook_input.get("tool_input", {}) + + if tool_name != "Bash": + return + + command = tool_input.get("command", "") + + # Only trigger on dispatch commands + if "drone @ai_mail dispatch" not in command: + return + + # Skip if watchdog is already in the same command + if "unread_count" in command and "while [" in command: + return + + # Skip if it's just checking dispatch status (not sending) + if "dispatch wake" in command and "dispatch @" not in command: + return + + result = { + "additionalContext": ( + "[AUTO-WATCHDOG] Dispatch detected — arm watchdog NOW. " + "Run the watchdog one-liner from your local prompt with " + "run_in_background: true and timeout: 600000." + ) + } + json.dump(result, sys.stdout) + + +if __name__ == "__main__": + main() diff --git a/src/aipass/spawn/templates/builder/.spawn/.template_registry.json b/src/aipass/spawn/templates/builder/.spawn/.template_registry.json index 802ef0ed..ea2fc27f 100644 --- a/src/aipass/spawn/templates/builder/.spawn/.template_registry.json +++ b/src/aipass/spawn/templates/builder/.spawn/.template_registry.json @@ -1,7 +1,7 @@ { "metadata": { "version": "1.0.0", - "last_updated": "2026-04-28", + "last_updated": "2026-05-02", "description": "Template file tracking registry for ID-based updates" }, "files": { @@ -155,7 +155,7 @@ "content_hash": "a4cf0a8e3b4f", "has_branch_placeholder": false }, - "f026": { + "f015": { "path": "apps/modules/__init__.py", "name": "__init__.py", "content_hash": "e3b0c44298fc", @@ -263,7 +263,7 @@ "content_hash": "28e9ae373563", "has_branch_placeholder": false }, - "f015": { + "f026": { "path": "apps/plugins/__init__.py", "name": "__init__.py", "content_hash": "e3b0c44298fc",