0025. Unify the avd-remediate and avd-swarm assistants at the protocol, UX, and corpus layers
avd-remediate adopts avd-assistant's 4-stage router, modes, and brand offline-first, while avd-swarm's Guru mode indexes playbook summaries.
Context and Problem Statement
avd-remediate and avd-swarm each grew an interactive assistant with different routing rules, personas, and safety controls.
More
avd-swarm defines avd-assistant (formerly avd-buddy): a 4-stage deterministic-first PWA hosted on an Azure Container App with Entra ID Easy Auth, four interactive modes (chief_of_staff, red_team, guru, buddy), explicit opt-in before LLM synthesis, a verdict-phrase filter, and a pinned SQLite FTS5 index. avd-remediate ships a docked local Chat Assistant (aside#chat-drawer) that runs deterministic playbook matching over local --vault notes, C11/C21/C25 artifacts, and live <<<AVDREM-STATE ...>>> probes, and auto-calls a redacted BYO-LLM whenever configured. How should both assistants present one coherent experience without forcing avd-remediate to require Azure hosting or exposing unredacted --vault data to avd-swarm?
Considered Options
Three options were weighed.
- Merge into
avd-swarm: move all troubleshooting chat intoavd-assistantand remove the local assistant fromavd-remediate - Leave separate: keep two independent chat protocols, prompts, and UIs
- Protocol, UX, and corpus unification: share the 4-stage deterministic-first router, modes, guardrails, and playbook summaries while keeping
avd-remediatelocal-first and$0offline-capable
Decision Outcome
Chosen option: "Protocol, UX, and corpus unification".
More
Why: operators get one assistant experience and consistent safety guardrails across diagnosis (avd-remediate) and fleet operations (avd-swarm), while avd-remediate preserves $0 offline troubleshooting and local --vault privacy.
- 4-stage deterministic-first routing in
avd-remediate: Adoptavd-assistant's Stage 0 scope gate and Stage 2 "no retrieval, no synthesis" rule with an explicit "Synthesize with AI" button instead of auto-invoking BYO-LLM on every/api/chatrequest. Retainredact.jsscrubbing (buildRedactedLlmPrompt) before any external model call. - Shared brand, modes, and
F4verdict filter:avd-remediate's drawer adoptsavd-assistantbranding and exposesGuru(default for Steps 1–3),Red Team(Step 4 plan review with no pass state), andChief of Staff(localC11/C21/probe triage, explicitly badged asLocal Estatewhen offline). Both enforce the protected verdict-phrase filter (safe,approved,approve it,ok to approve,no issues,looks good,go ahead). - Simple
Gurucorpus sharing:avd-swarmpinsavd-remediateby commit SHA ingovernance/assistant-index.ymland indexesplaybooks/catalog.jsonsummaries and citations only—linking toavd-remediateStep 4 for executable Day-2 fix blocks soF1(catalog/snippets/) remains untouched. - Optional fail-closed connected adapter:
avd-remediate/scripts/server.mjsmay optionally forward Stage 3 synthesis or Path C (avd-swarmplan handoff) queries toavd-assistant'sPOST /api/turns, sending onlybuildRedactedLlmPrompt()output after a fail-closed leak check (no rawC11, probes, or--vaultnotes). - Local BYO-LLM transparency: When running local BYO-LLM without
avd-assistant, badge replies as unshielded local BYO-LLM (redacted) to distinguish them fromavd-assistant's Prompt Shields and kill-switch-enforced path.
Consequences
- Good, because
avd-remediatestays$0and offline-capable with zero Azure Container App or Entra Easy Auth dependency. - Good, because unredacted
--vaultnotes and host probe outputs never leave the operator's workstation. - Good, because
Gurumode inavd-swarmstays simple andF1snippet-gate guarantees stay intact. - Bad, because
avd-remediatemust maintain its own local implementation of the 4-stage router and verdict-phrase filter in JavaScript alongsideavd-swarm's Python router.
More Information
Links and rollout sequence.
More
avd-swarmassistant spec:docs/assistant-spec.md(avd-ops/avd-swarm).avd-remediateworkbench spec:docs/spec.md(avd-ops/avd-remediate).- Rollout order: (1) this ADR in
avd-ops, (2) 4-stage router, modes, andF4filter inavd-remediate, (3) pinnedplaybooks/catalog.jsonsummary indexing inavd-swarm, and (4) optional fail-closedavd-assistantadapter inavd-remediate.