diff --git a/conductor/tech-stack.md b/conductor/tech-stack.md index e861442d..a241231c 100644 --- a/conductor/tech-stack.md +++ b/conductor/tech-stack.md @@ -52,7 +52,7 @@ - **Beads Tools (4):** `bd_list`, `bd_create`, `bd_update`, `bd_ready` — interface to the Beads/Dolt backend. - **src/api_hooks.py + src/api_hook_client.py:** Implements the Hook API and Python client wrapper for external automation. See [docs/guide_api_hooks.md](../docs/guide_api_hooks.md). - - **HookServer:** FastAPI/Uvicorn server on `127.0.0.1:8999`, started by `AppController` when `--enable-test-hooks` is set. Exposes 8+ REST endpoints (`/status`, `/api/gui`, `/api/ask`, `/api/mma_status`, `/api/performance`, `/api/comms`, `/api/diagnostics`). + - **HookServer:** FastAPI/Uvicorn server on `127.0.0.1:8999`, started by `AppController` when `--enable-test-hooks` is set. Exposes 8+ REST endpoints (`/status`, `/api/gui`, `/api/ask`, `/api/gui/mma_status`, `/api/performance`, `/api/comms`, `/api/diagnostics`). - **ApiHookClient:** Python client with retry logic, health-check polling, and timeout configuration. Used by all `live_gui` tests, the WorkerPool, and external scripts. - **`/api/ask` Protocol:** Non-blocking, ID-based challenge/response for synchronous HITL approvals from external contexts. - **`_predefined_callbacks` and `_gettable_fields`:** AppController-owned registries that the Hook API consumes to expose any App method as a `custom_callback` action. diff --git a/docs/Readme.md b/docs/Readme.md index ef68df1c..27bddfce 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -31,7 +31,7 @@ This documentation suite provides comprehensive technical reference for the Manu | [Testing](guide_testing.md) | 251 test files, 5 test categories (unit, integration, live_gui, perf, simulation), 7 conftest fixtures (`isolate_workspace`, `reset_paths`, `reset_ai_client`, `vlogger`, `kill_process_tree`, `mock_app`, `live_gui` session-scoped), Hook API testing pattern, Puppeteer pattern for MMA simulation, mock provider strategy, opt-in clean install test, opt-in docker test, coverage targets, anti-patterns (no arbitrary core mocking, artifact isolation to `tests/artifacts/`) | | [GUI Main](guide_gui_2.md) | `src/gui_2.py` reference: App class lifecycle, ~90 module-level render functions (UI Delegation Pattern), immgui immediate-mode rendering, Multi-Viewport docks, panel registry, command palette integration, ImGuiScope context managers, hot reload support, key bindings (Ctrl+Shift+P, Ctrl+Alt+R, Ctrl+Z/Y) | | [AI Client](guide_ai_client.md) | `src/ai_client.py` reference: multi-provider LLM singleton (5 providers: Gemini, Anthropic, DeepSeek, MiniMax, Gemini CLI), async dispatch with `asyncio.gather`, threading.local for source tier tagging, context caching (Anthropic ephemeral + Gemini explicit), system prompt assembly, error interception for Tier 4 QA | -| [API Hooks](guide_api_hooks.md) | `src/api_hooks.py` + `src/api_hook_client.py` reference: HookServer on `127.0.0.1:8999`, ApiHookClient Python wrapper, 8+ endpoints (`/status`, `/api/gui`, `/api/ask`, `/api/mma_status`, `/api/performance`, `/api/comms`, `/api/diagnostics`), Remote Confirmation Protocol via `/api/ask` (synchronous blocking HITL), `custom_callback` action for invoking any registered App method | +| [API Hooks](guide_api_hooks.md) | `src/api_hooks.py` + `src/api_hook_client.py` reference: HookServer on `127.0.0.1:8999`, ApiHookClient Python wrapper, 8+ endpoints (`/status`, `/api/gui`, `/api/ask`, `/api/gui/mma_status`, `/api/performance`, `/api/comms`, `/api/diagnostics`), Remote Confirmation Protocol via `/api/ask` (synchronous blocking HITL), `custom_callback` action for invoking any registered App method | | [MCP Client](guide_mcp_client.md) | `src/mcp_client.py` reference: 45 native tools (File I/O, Python AST, C/C++ AST, Analysis, Network, Runtime, Beads), 3-layer security model (Allowlist Construction, Path Validation, Resolution Gate), `dispatch()`/`async_dispatch()` entry points, ExternalMCPManager for external MCP servers (Stdio + SSE), JSON-RPC 2.0 engine, public API, configuration | | [App Controller](guide_app_controller.md) | `src/app_controller.py` reference: headless orchestrator owning AppState and all subsystem managers (PresetManager, PersonaManager, ContextPresetManager, ToolPresetManager, ToolBiasEngine, RAGEngine, HistoryManager, WorkspaceManager, HookServer, HotReloader, PathManager), `_predefined_callbacks` and `_gettable_fields` registries for Hook API, SyncEventQueue bridge, preset/persona/context coordination, headless mode | | [MMA Engine](guide_multi_agent_conductor.md) | `src/multi_agent_conductor.py` + `src/dag_engine.py` reference: TrackDAG with cycle detection (iterative DFS) and topological sort (Kahn's variant), ExecutionEngine with Auto-Queue / Step Mode state machine, MultiAgentConductor with WorkerPool (configurable concurrency, default 4), mma_exec.py sub-agent invocation for Token Firewall, parse_plan_md utility, Beads mode delegation | diff --git a/docs/guide_api_hooks.md b/docs/guide_api_hooks.md index 369e4544..5c7a9b11 100644 --- a/docs/guide_api_hooks.md +++ b/docs/guide_api_hooks.md @@ -27,7 +27,7 @@ Two files: ┌─────────────────────────────────────────────────┐ │ HTTP Endpoints │ │ GET /status - health │ -│ GET /api/mma_status - MMA │ +│ GET /api/gui/mma_status - MMA │ │ GET /api/gui - GUI │ │ POST /api/gui - push task │ │ POST /api/ask - blocking │ @@ -69,7 +69,7 @@ The server runs in a daemon thread. It stops when the process exits (or via `ser | Method | Path | Purpose | |---|---|---| | `GET` | `/status` | Health check. Returns JSON with `status`, `pid`, `version`, etc. | -| `GET` | `/api/mma_status` | Full MMA orchestration state (tickets, progress, ETA) | +| `GET` | `/api/gui/mma_status` | Full MMA orchestration state (tickets, progress, ETA) | | `GET` | `/api/gui` | GUI debug info (button IDs, fields, etc.) | | `POST` | `/api/gui` | Push a GUI task (click, set_value, custom_callback, etc.) | | `POST` | `/api/ask` | Synchronous HITL approval (blocking request/response) | diff --git a/docs/superpowers/plans/2026-06-02-clean-install-test.md b/docs/superpowers/plans/2026-06-02-clean-install-test.md index 83f43cb0..7880292b 100644 --- a/docs/superpowers/plans/2026-06-02-clean-install-test.md +++ b/docs/superpowers/plans/2026-06-02-clean-install-test.md @@ -167,7 +167,7 @@ def test_clean_install_runs_with_hooks(tmp_path): ) response = requests.get( - f"http://127.0.0.1:{HOOK_PORT}/api/mma_status", + f"http://127.0.0.1:{HOOK_PORT}/api/gui/mma_status", timeout=5.0, ) assert response.status_code == 200, f"mma_status returned {response.status_code}" @@ -205,7 +205,7 @@ Expected: SKIPPED (RUN_CLEAN_INSTALL_TEST not set). ```bash git -C C:\projects\manual_slop add tests/test_clean_install.py git -C C:\projects\manual_slop commit -m "test(clean-install): add opt-in clone-and-verify pytest test" -git -C C:\projects\manual_slop log -1 --format='%H' | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Clones the Gitea repo to tmp_path, runs uv sync, launches sloppy.py --enable-test-hooks, polls :8999/status until ready, then tests /api/mma_status write hook. Robust Windows/Unix process cleanup. Skipped unless RUN_CLEAN_INSTALL_TEST=1." $_ } +git -C C:\projects\manual_slop log -1 --format='%H' | ForEach-Object { git -C C:\projects\manual_slop notes add -m "Clones the Gitea repo to tmp_path, runs uv sync, launches sloppy.py --enable-test-hooks, polls :8999/status until ready, then tests /api/gui/mma_status write hook. Robust Windows/Unix process cleanup. Skipped unless RUN_CLEAN_INSTALL_TEST=1." $_ } ``` --- diff --git a/docs/superpowers/plans/2026-06-02-docker-web-frontend.md b/docs/superpowers/plans/2026-06-02-docker-web-frontend.md index 2eb18fa7..58c23d08 100644 --- a/docs/superpowers/plans/2026-06-02-docker-web-frontend.md +++ b/docs/superpowers/plans/2026-06-02-docker-web-frontend.md @@ -507,7 +507,7 @@ Agents interact with the running container via the Hook API on `:8999`. Examples curl http://:8999/status # Get MMA state -curl http://:8999/api/mma_status +curl http://:8999/api/gui/mma_status ``` See [guide_tools.md](guide_tools.md) for the full Hook API reference. diff --git a/docs/superpowers/specs/2026-06-02-clean-install-test-design.md b/docs/superpowers/specs/2026-06-02-clean-install-test-design.md index 4cb99895..5b65c209 100644 --- a/docs/superpowers/specs/2026-06-02-clean-install-test-design.md +++ b/docs/superpowers/specs/2026-06-02-clean-install-test-design.md @@ -116,7 +116,7 @@ def test_clean_install_runs_with_hooks(tmp_path): # 5. Test a write hook (any POST endpoint that should respond) response = requests.get( - "http://127.0.0.1:8999/api/mma_status", + "http://127.0.0.1:8999/api/gui/mma_status", timeout=5.0, ) assert response.status_code == 200 diff --git a/docs/superpowers/specs/2026-06-02-docker-web-frontend-design.md b/docs/superpowers/specs/2026-06-02-docker-web-frontend-design.md index ccb8b05d..aa329331 100644 --- a/docs/superpowers/specs/2026-06-02-docker-web-frontend-design.md +++ b/docs/superpowers/specs/2026-06-02-docker-web-frontend-design.md @@ -272,7 +272,7 @@ def _docker_available() -> bool: - `docker build -t manual_slop:latest .` succeeds on a clean machine - `docker compose up` starts the container, and `:8999/status` returns 200 within 60s - `curl http://localhost:8080/` returns the web client HTML -- An agent can `curl http://localhost:8999/api/mma_status` and get a valid response +- An agent can `curl http://localhost:8999/api/gui/mma_status` and get a valid response - The user can navigate to the web UI in a browser and see the ImGui panels - File operations on `/projects` persist across container restarts - Env vars for API keys are not committed to the image (use runtime env)