System Architecture¶
Overview¶
Ananke Plexus follows a core + ports + adapters hexagonal architecture. The stable center contains Ananke's governance semantics. External tooling remains fully replaceable.
flowchart TB
subgraph Entry["π€ Entrypoints"]
CLI["β¨οΈ ananke CLI"]
APMCLI["π¦ apm CLI"]
HOOKS["πͺ Git Hooks"]
MCP["π MCP Clients"]
CI["βοΈ CI/CD"]
end
subgraph Core["βοΈ Ananke Core"]
CONFIG["βοΈ Config"]
POLICY["π‘οΈ Policy Engine"]
EXEC["π€ Execution Director"]
EVENTS["π‘ Event Bus"]
TELEMETRY["π Telemetry"]
PERM["π Permissions"]
STATE["π Run State Machine"]
end
subgraph Domain["π§ Domain Subsystems"]
SPEC["π Spec / BMAD"]
CALM["ποΈ CALM Architecture"]
GRAPH["πΈοΈ Graph Intelligence"]
APM["π¦ APM"]
REGISTRY["ποΈ Skill & Agent Registry"]
GATES["π§ͺ Verification Gates"]
EVIDENCE["π§Ύ Evidence"]
end
subgraph Adapters["π Adapters"]
JIRA["Jira"]
SCM["GitHub / Bitbucket"]
GRAPHIFY["Graphifyy"]
CRG["Code Review Graph"]
COPILOT["Copilot"]
Q["Amazon Q"]
KIRO["Kiro"]
HERMES["Hermes"]
end
Entry --> Core
Core --> Domain
Domain --> Adapters
Adapters -. Results .-> Domain
Package layout¶
ananke-plexus/
βββ src/ananke/plexus/
βββ cli/ β Typer CLI entrypoints (ananke + apm)
βββ core/ β IDs, result types, path helpers, workflow audit
βββ config/ β Config models, loader, migration, secrets resolver
βββ contracts/ β BMAD compiler: behavior, model, architecture
βββ specs/ β Spec models, service, providers, lock, drift
βββ architecture/ β CALM loader, validation, delta, Mermaid rendering
βββ graph/ β Canonical graph models, providers (native/Graphifyy/CRG)
βββ policy/ β Policy engine, rule schema, builtin packs
βββ gates/ β Gate runner, adapters (ruff, mypy, pytest, semgrep...)
βββ execution/ β Plan DAG, scheduler, checkpoint, approvals, compensation
βββ backends/ β AgentBackend protocol, Copilot/Q/Kiro/Hermes/fake adapters
βββ lifecycle/ β Git service, worktrees, Jira, Bitbucket, PR evidence
βββ hooks/ β Git hook manager, stages, runner
βββ mcp/ β MCP server, tools, resources, prompts, auth
βββ apm/ β Skill manifests, registry, installer, sandbox, lockfile
βββ evidence/ β Evidence bundle, SARIF 2.1.0, hash, retention (+ registry capability snapshot)
βββ registry/ β Skill & Agent Registry: SQLite + content-addressed store, importers,
β resolver, ananke.lock, activation, docs generator, HTTP server
βββ evals/ β Enterprise evaluation harness: traces, evaluators, judges, regression
βββ testing/ β Unified test & quality harness: adapters, profiles, quality gate
βββ events/ β In-process event bus with JSONL audit log
βββ telemetry/ β OpenTelemetry adapter, noop
βββ plugins/ β Entry-point discovery, plugin metadata
Design principles¶
Local-first¶
Code, specs, graph state, verification, and evidence can remain entirely local. No hosted service is required.
Ports and adapters¶
Every external integration is isolated behind a protocol/interface:
GraphProvider β NativeGraphProvider | GraphifyyAdapter | CodeReviewGraphAdapter
AgentBackend β CopilotBackend | AmazonQBackend | KiroBackend | HermesBackend | FakeBackend
SCMPort β BitbucketAdapter | GitHubAdapter
IssuePort β JiraAdapter
ScannerPort β RuffAdapter | SemgrepAdapter | GitleaksAdapter | TrivyAdapter
Immutable, content-addressed capabilities¶
Skills and agents live in the registry: every version is an immutable, hash-verified payload; mutable state (trust, channel, lifecycle) is separate and audited. Resolution is deterministic, policy-aware and explainable, and produces a reproducible ananke.lock.
Fail closed for hard gates¶
When a configured hard gate cannot execute, the default result is BLOCKED, not "pass."
Soft gates return: PASS | WARN | SKIPPED | UNAVAILABLE
Hard gates return: PASS | BLOCKED | ERROR
Evidence before mutation¶
Every mutating step records:
- Requested intent
- Policy decision
- Preconditions
- Execution result
- Verification result
- Artifact hashes
- Audit record
Capability discovery¶
Every backend declares a BackendCapabilities model. The orchestrator asks the registry for capabilities and constructs a compatible execution plan.
Configuration precedence¶
Highest wins:
- CLI flags (
--project,--offline,--json) - Process environment variables
.ananke/config.local.toml.ananke/config.toml- User config
- Built-in defaults
Event system¶
Every subsystem emits typed domain events to an in-process event bus. Events are appended to .ananke/evidence/*.jsonl for audit trails.
Registry events (artifact.registered, artifact.promoted, artifact.yanked, artifact.quarantined, β¦) are also written to an append-only registry_events table.
Key events: RequirementCaptured, SpecCreated, SpecLocked, GateCompleted, BackendInvoked, PullRequestCreated, EvidenceFinalized, ApprovalRequested, ApprovalGranted
Exit codes¶
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | generic failure |
| 2 | invalid usage/config |
| 3 | policy blocked |
| 4 | verification failed |
| 5 | dependency/tool unavailable |
| 6 | integration failure |
| 7 | authentication/authorization |
| 8 | spec drift |
| 9 | architecture violation |
| 10 | cancelled |