Tier-2 edge-brain (M7) — async edge LLM remediation, OFF by default #15
No reviewers
Labels
No labels
correctness
coverage
milestone:M4
polish
security
tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/warden!15
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tier2-edge-brain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tier-2 edge-brain (M7) — async, orchestrator-dispatched, OFF by default
Relocates warden's guardrailed LLM auto-remediation to a mesh node, dispatched over a new fire-and-forget NATS brain plane. Design converged over four adversarial review rounds (SAFE-TO-SPEC); built via subagent-driven development (fresh implementer per task + spec/quality review after each + a whole-branch opus review). Spec:
docs/superpowers/specs/2026-09-17-tier2-edge-brain-design.md; plan:docs/superpowers/plans/2026-09-17-tier2-edge-brain.md.26 commits · 1057 passed / 1 skipped · ruff clean.
What ships (all inert unless enabled)
mesh/brain.pyasync wire contract (payload-capped codec, brain subjects)Grant.jti+revoked_grantsstore +/invokerevocation check (before actuation)brain_jobtracker — atomic terminal CAS + per-fingerprint lease +terminal_atper-job grace sweep;revoked_grants; agentbrain/invoke_cmdBrainRunner(edgeAutoResolverover an in-memory shim),Runbook.tier2+ drift hash_dispatch_brain(persist-before-publish, concurrency cap, edge-interpreter invoke-tools),_on_brain_result(CAS + local-only fail-closed verify — the trust anchor), durable deadline sweep + cancel/revoke, Tier-0→2→1→escalate wiring, per-fingerprint lease enforced in_run_chainbrain/invoke_cmd; fail-closed on loopback URL / missing model cred), telemetry envelope,docs/mesh.mdsection + enable runbook, end-to-end integration testSafety (verified end-to-end by the whole-branch review)
_verify_remotenever decides a brain resolveWARDEN_BRAIN_ENABLEDorchestrator +WARDEN_EDGE_BRAINnode); untrusted edge telemetry never feeds durable counters/budget/drafterEnabling (separate, gated deploy step — NOT done here)
Set the flags + a routable
WARDEN_ORCHESTRATOR_URL+WARDEN_EDGE_MODEL_CREDfile-secret +warden-natsACLs forwarden.brain.*/.result.*/.cancel.*+ the go/no-go: confirm ≥1 real check is BOTH orchestrator-locally-verifiable AND edge-remediation-routed (else enabled-for-zero-checks). Seedocs/mesh.md.Notes
_run_chain).🤖 Generated with Claude Code
https://claude.ai/code/session_01GfHTnzfxkwRhcrjcpdP5af
/invoke now checks store.is_grant_revoked(grant.jti) after grant.verify and grant_mod.allows() succeed, strictly before the target is resolved or the Invoker is called. A revoked jti now 403s with {"error": "grant_revoked"} and bumps warden_invoke_denied_total{reason="revoked"} instead of proceeding to actuation. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01GfHTnzfxkwRhcrjcpdP5afExtend the existing parametrized rejection table with a non-list invoke_cmd and a list with non-string elements, both expecting Reject("bad_invoke_cmd"). Follow-up to the Task 5 review: the branch added in parse_announce had no test exercising it. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01GfHTnzfxkwRhcrjcpdP5affingerprint_has_live_brain was dead code: nothing consulted it before Tier-0 exec, Tier-2 dispatch, or the central Tier-1 branch, so a flap (natural resolve) + re-flap of the same fingerprint while a brain job was in flight could dispatch a second brain job or fall through to central Tier-1 concurrently with it. Add a guard in Remediator._run_chain, after the auto-runbook check and before any tier actuates: a live lease for the incident's fingerprint now short-circuits the whole chain with {"outcome": "skipped", "reason": "brain_in_flight"}, covering Tier 0, Tier 2, and Tier 1 in one place. The lease's owner (_on_brain_result / sweep_brain) is unaffected since neither path goes through _run_chain. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01GfHTnzfxkwRhcrjcpdP5af