From e5a65bd3ad401ffd3cb2cfa634896cd1f4bd2939 Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Sat, 9 May 2026 22:08:20 -0700 Subject: [PATCH] feat(system): Fix doctor_wire hook format: use matcher+hooks wrapper for Claude Code compatibility Co-Authored-By: @devpulse --- Dockerfile.test | 8 ++++++-- src/aipass/aipass/apps/modules/doctor_wire.py | 14 ++++++++------ src/aipass/devpulse/.aipass/aipass_local_prompt.md | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Dockerfile.test b/Dockerfile.test index 092cd937..445e0847 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -26,7 +26,11 @@ ENV PATH="/home/testuser/.local/bin:$PATH" RUN python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || true USER testuser -RUN mkdir -p /home/testuser/workspace /home/testuser/.claude -WORKDIR /home/testuser +RUN mkdir -p /home/testuser/Projects /home/testuser/.claude +WORKDIR /home/testuser/Projects +ENV HOME=/home/testuser ENV PATH="/home/testuser/.local/bin:$PATH" + +RUN echo 'export HOME=/home/testuser' >> /home/testuser/.bashrc && \ + echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/testuser/.bashrc diff --git a/src/aipass/aipass/apps/modules/doctor_wire.py b/src/aipass/aipass/apps/modules/doctor_wire.py index c8e61ed8..fd91c0ec 100644 --- a/src/aipass/aipass/apps/modules/doctor_wire.py +++ b/src/aipass/aipass/apps/modules/doctor_wire.py @@ -158,7 +158,7 @@ def _auto_wire_provider(manifest_path: Path, interactive: bool = True) -> List[s settings["hooks"][event] = event_hooks already_wired = any( - isinstance(h, dict) and script in h.get("command", "") + isinstance(h, dict) and script in json.dumps(h) for h in event_hooks ) if not already_wired: @@ -166,15 +166,17 @@ def _auto_wire_provider(manifest_path: Path, interactive: bool = True) -> List[s hook_path = f"~/.claude/hooks/{script}" else: hook_path = f".claude/hooks/{script}" - entry: Dict[str, object] = { + cmd_entry: Dict[str, object] = { "type": "command", "command": f"{sys.executable} {hook_path}", } - if hook.get("matcher"): - entry["matcher"] = hook["matcher"] if hook.get("timeout"): - entry["timeout"] = hook["timeout"] - event_hooks.append(entry) + cmd_entry["timeout"] = hook["timeout"] + wrapper: Dict[str, object] = { + "matcher": hook.get("matcher", ""), + "hooks": [cmd_entry], + } + event_hooks.append(wrapper) actions.append(f"Wired hook {script} -> {event}") # Env vars diff --git a/src/aipass/devpulse/.aipass/aipass_local_prompt.md b/src/aipass/devpulse/.aipass/aipass_local_prompt.md index ab5e118c..b2c34144 100644 --- a/src/aipass/devpulse/.aipass/aipass_local_prompt.md +++ b/src/aipass/devpulse/.aipass/aipass_local_prompt.md @@ -98,6 +98,8 @@ drone, seedgo, prax, cli, ai_mail, api, flow, spawn, trigger, memory, devpulse ( - **Know what to build vs delegate.** Things you own (watchdog, feedback, your DPLANs/FPLANs, memories, prompts, small fixes across the codebase) → build directly. Multi-file new features or heavy refactors → delegate to a sub-agent so your context stays clean. - **CWD is identity.** You move in and out of branches all day. Always know which branch you're standing in — the CWD determines everything (drone routing, git operations, mailbox, passport lookups). Never cd into another branch and forget to come back. Visit, don't move in. - **Git awareness as a natural habit.** After completing a feature or wrapping up a chunk of work, run `git status`. If changes look coherent (upgrade, fix cycle, config update), suggest a commit or PR. Don't force it every turn, but don't let files pile up silently either. +- **Never `docker cp` into test containers.** It dirties the git tree and blocks future pulls. Test flow: merge PR → `git pull` in container → test. If code isn't merged yet, it's not ready to test in Docker. +- **Sub-agents build, managers PR.** Sub-agents never create PRs. They build code and run tests. The manager reviews the work, then creates the PR. ## Watchdog — Directed Wake (devpulse module) Watchdog is a real devpulse module now (not a bash one-liner). After dispatching, arm it as a background task — it polls the dispatch lock file and exits when the agent process finishes (success, silent-finish, OR crash). The exit wakes you.