From 6b0dcdccef146c0ae99f9b06a25322e551a5e33a Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Thu, 16 Jul 2026 21:31:10 -0700 Subject: [PATCH] =?UTF-8?q?fix(memory):=20governance=20module=20ate=20all?= =?UTF-8?q?=20@memory=20commands=20=E2=80=94=20standard=20handle=5Fcommand?= =?UTF-8?q?=20signature,=20declines=20non-governance=20commands=20(Track?= =?UTF-8?q?=202=20follow-up).=20Search=20verified=20live,=201011=20green?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 12 ++++++++++++ src/aipass/memory/apps/modules/governance.py | 11 +++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf841a53..e2e9d85c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,18 @@ PyPI version — not the changelog header. auto-trigger swept a pre-existing backlog file on its first run. 730 flow + 878 drone tests green, seedgo 100%. +### Fixed + +- **@memory command routing eaten by the new governance module.** The + governance module shipped in Track 2 had the wrong `handle_command` + signature (`args: list` instead of `command: str, args: list`) and always + returned True, so auto-discovery routed EVERY @memory command through it + first — `drone @memory search` answered "governance: unknown command 's'". + Fixed to the standard signature returning False for commands not its own; + search verified live (135 results). Library modules must decline commands + they don't own or they silently hijack the whole CLI. 1011 memory tests + green, seedgo 31/31. + ## [2026-07-15] ### Fixed diff --git a/src/aipass/memory/apps/modules/governance.py b/src/aipass/memory/apps/modules/governance.py index ee78a7c5..2eab3790 100644 --- a/src/aipass/memory/apps/modules/governance.py +++ b/src/aipass/memory/apps/modules/governance.py @@ -189,18 +189,21 @@ def print_introspection() -> None: console.print("[dim]Library module — import from: aipass.memory.apps.modules.governance[/dim]") -def handle_command(args: list, _remaining: list | None = None) -> bool: +def handle_command(command: str, args: list) -> bool: """Entry point for drone module discovery — governance has no CLI surface.""" + if command != "governance": + return False + if not args: print_introspection() return True - from aipass.cli.apps.modules import warning - if args[0] in ("--help", "-h", "help"): print_introspection() return True - warning(f"governance: unknown command '{args[0]}'") + from aipass.cli.apps.modules import warning + + warning(f"governance: unknown subcommand '{args[0]}'") print_introspection() return True