setup.sh + aipass doctor: recurrence-prevention for silent hook-wiring break — setup.sh merge now drops orphaned empty hook events (the exact bug: an event left as [] fires nothing, written silently) and announces the drop; aipass doctor surfaces a wire_verify check under Services + re-verifies after --fix. Proven: orphan dropped / valid kept / user hooks preserved; doctor shows green. 629 aipass green

This commit is contained in:
AIOSAI
2026-07-09 16:25:35 -07:00
parent 5fea5bbf44
commit cdbd1dc821
4 changed files with 120 additions and 2 deletions
+9 -1
View File
@@ -712,7 +712,15 @@ for event in set(existing_hooks) | set(aipass_hooks):
entry for entry in existing_hooks.get(event, [])
if "bridges/claude.py" not in json.dumps(entry)
]
merged_hooks[event] = aipass_hooks.get(event, []) + user_entries
merged = aipass_hooks.get(event, []) + user_entries
# Never emit an empty hook event. If this event had only stale AIPass bridge
# entries (no current aipass_hooks definition AND no user-wired hooks), the
# filter above orphans it to [] — a half-wired event that fires nothing,
# written silently. Drop the key instead and say so, so the state stays honest.
if not merged:
print(f" ! dropped orphaned hook event (no live entries): {event}")
continue
merged_hooks[event] = merged
settings["hooks"] = merged_hooks
# Inject AIPASS_HOME into env block so dispatched agents find AIPass