diff --git a/.claude/hooks/pre_compact.py b/.claude/hooks/pre_compact.py index 2e2c7e40..4782cb97 100644 --- a/.claude/hooks/pre_compact.py +++ b/.claude/hooks/pre_compact.py @@ -146,8 +146,21 @@ Context just compacted. Below is your live state. Use it to continue seamlessly. if status: sections.append(f"## STATUS.local.md\n{status}") - # Recovery instructions (lean) - sections.append("""## Recovery Protocol + # Recovery instructions — different for dispatched agents vs interactive + import os + + is_dispatched = os.environ.get("AIPASS_SESSION_TYPE") == "dispatched" + + if is_dispatched: + sections.append("""## DISPATCHED AGENT — SAVE STATE NOW +Before continuing work, you MUST update your memories: +1. Update .trinity/local.json — add/update current session with work done so far +2. Update STATUS.local.md — ensure Current Work reflects what you've accomplished +3. Then continue your task from where the summary left off + +This is non-optional. Compaction just happened — if you don't save now, work history is lost.""") + else: + sections.append("""## Recovery Protocol - Continue where the summary left off — don't restart or ask generic questions - .trinity/local.json has full session history and key_learnings — read it if you need more context - STATUS.local.md has current work, known issues, and todos diff --git a/CLAUDE.md b/CLAUDE.md index b108cc14..26d2cdae 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,6 +11,7 @@ On any greeting, silently read these files from CWD and run the commands — no - Read: `.trinity/passport.json`, `.trinity/local.json`, `.trinity/observations.json`, `README.md`, `STATUS.local.md` - Check: `drone @ai_mail inbox` — process any mail, don't ask. - Run: `drone @git status` + - Refresh: If `STATUS.local.md` is stale (last updated date older than latest session in local.json), update it from your memories. Keep Current Work accurate. Use drone commands for all operations. Never raw git, gh, file access, or python -m when drone provides it. diff --git a/src/aipass/devpulse/apps/modules/watchdog.py b/src/aipass/devpulse/apps/modules/watchdog.py index 94b99a66..19a06096 100644 --- a/src/aipass/devpulse/apps/modules/watchdog.py +++ b/src/aipass/devpulse/apps/modules/watchdog.py @@ -325,6 +325,8 @@ def _handle_agent(sub_args: List[str]) -> bool: error("Usage: watchdog agent [--timeout SECONDS]") return True + error("WATCHDOG: Must be invoked via Monitor tool, never run_in_background") + timeout = _DEFAULT_AGENT_TIMEOUT positional: List[str] = [] i = 0 diff --git a/src/aipass/drone/.seedgo/bypass.json b/src/aipass/drone/.seedgo/bypass.json index 3707ef7f..61a37a6b 100644 --- a/src/aipass/drone/.seedgo/bypass.json +++ b/src/aipass/drone/.seedgo/bypass.json @@ -174,16 +174,6 @@ "standard": "architecture", "reason": "Test file — intentionally outside 3-layer structure. tests/ is a peer of apps/, not part of it." }, - { - "file": "apps/handlers/git/status_handler_gitpython.py", - "standard": "architecture", - "reason": "DPLAN-0140 Phase 1 prototype — intentionally unreferenced, awaiting Phase 2/3 FPLAN to wire into production." - }, - { - "file": "handlers/git/status_handler_gitpython.py", - "standard": "dead_code", - "reason": "DPLAN-0140 Phase 1 prototype — intentionally unreferenced, awaiting Phase 2/3 FPLAN to wire into production." - }, { "file": "CLAUDE.md", "standard": "architecture", diff --git a/src/aipass/drone/README.md b/src/aipass/drone/README.md index a0b634d7..6db1fbd3 100644 --- a/src/aipass/drone/README.md +++ b/src/aipass/drone/README.md @@ -174,7 +174,6 @@ drone/ │ │ ├── branches_handler.py # List remote branches │ │ ├── delete_branch_handler.py # Delete remote branch (main/dev protected) │ │ ├── status_handler.py # Scoped git status (subprocess) -│ │ ├── status_handler_gitpython.py # [prototype] DPLAN-0140 Phase 1, not wired in │ │ └── sync_handler.py # Safe main sync (--autostash support) │ └── plugins/ │ ├── devpulse_ops/ # Privileged git operations (auth-gated) @@ -333,7 +332,6 @@ Run tests: `cd src/aipass/drone && python -m pytest tests/ -q` ## Known Issues -- `status_handler_gitpython.py` is an unreferenced prototype (DPLAN-0140 Phase 1) — awaiting Phase 2/3 - `update_command()` and `command_exists()` in `ops.py` are tested CRUD API but unused from production - Pyright warns about `json` package name shadowing stdlib — works at runtime - Recurring sync errors when working tree is dirty — operational, not code bugs