AAnvio
Reference ArchivePlans

Hermes vNext — Master Engineering Backlog

**Status:** Plan of record. Execute stories in dependency order; one story ≈ one PR. **Date:** 2026-07-10 **Baseline:** [implementation-blueprint-vnext.md](implementation-blueprint-vnext.md) (frozen).

38 min read

This is a migrated reference document from the original Anvio source repo. Content is preserved as-is; canonical documentation lives in the sections above in the sidebar.

Original path: docs/plans/engineering-backlog-vnext.md

Status: Plan of record. Execute stories in dependency order; one story ≈ one PR. Date: 2026-07-10 Baseline: implementation-blueprint-vnext.md (frozen). Any story that cannot be built as specified triggers a blueprint ADR, not an ad-hoc deviation.


0. Backlog Conventions (apply to every story — stated once, not repeated)

Story ID format: E<epic>.F<feature>.S<n> (e.g. E1.F2.S3). Phase-1 stories use P1.Sn (they land on the current repo).

Universal Definition of Done (every story): compiles via pnpm build; pnpm lint + pnpm typecheck clean; unit tests written and green; contract tests green where a port is touched; no new silent catch \{\} (lint-enforced from P1.S2); public interfaces zod-validated at boundaries; docs touched if behavior/config changed; CHANGELOG entry; PR ≤ ~600 changed LOC target (split if larger); reviewed by package owner.

Universal Testing Requirements: colocated *.spec.ts; fake-gateway fixtures from kernel/testing (built in E0.F1); integration test added to the weekly train when a story crosses package boundaries; golden replay run for any story tagged [GOLDEN].

Universal Rollback Strategy: every behavior-changing story ships behind a config flag defaulting to old behavior until its milestone's acceptance gate; schema migrations are forward-only but additive (rollback = ignore new tables/columns); stories tagged [FLAG:<name>] name their flag. Pure-additive stories (new package, new port) need no flag.

Universal Documentation Requirements: port/interface stories update docs/ reference page for the package; config stories update the config reference; user-visible stories update the relevant guide.

Risk levels: L (isolated/additive), M (touches shared contracts or hot path), H (cutover, data migration, or security-sensitive).

Estimated Engineering Days (d): ideal senior days incl. tests. XS≤0.5, S≈1, M≈2–3, L≈4–5, XL split before execution.

Business value / technical rationale: stated at Feature level; stories inherit unless noted. Per-story rows list: ID · Title · Description & Acceptance Criteria (AC) · Deps · Size · d · Risk.


1. Repository Mapping (target packages)

PackageOwner roleResponsibilitiesKey exportsInternal modulesAllowed depsProhibited deps
packages/contractsKernel senior Aschemas, ports, canonical models, event envelopeall ports, zod schemas, RunEvent, ContextManifestschemas/, ports/, events/none (leaf)everything
packages/substrateKernel senior Astate/blob/queue/event/secrets impls (SQLite-WAL, Postgres, CAS, NATS)StateStore, BlobStore(CAS), Queue, EventBus, Secrets factoriessqlite/, postgres/, cas/, queue/, events/, secrets/, migrate/contractsruntime, gateways, surfaces
packages/model-gatewayKernel senior Bprovider adapters, routing, fallback, caching breakpoints, metering, key poolsModelGateway, ModelDescriptor, Routeradapters/, router/, cache/, meter/, keys/contracts, substrate, telemetryruntime, toolbus
packages/toolbusTools midregistry, policy gate, executor, output governor, selection, audit, builtins, mcp/ToolBus, ToolProvider, ToolPolicy, McpAdminregistry/, policy/, exec/, govern/, select/, audit/, builtins/, mcp/contracts, substrate, telemetry, (sandbox port)model-gateway, runtime
packages/runtimeKernel senior A+Bgraph executor, nodes, checkpoints, workers, compiler/, memory/, planner/RunService, GraphNode, ContextCompiler, PromptRegistry, MemoryManager, Workflowsgraph/, state/, lifecycle/, workers/, standard-graph/, compiler/, memory/, planner/contracts, substrate, model-gateway, toolbus, knowledge (port), telemetrysurfaces, control-plane, dashboard
packages/knowledgeRetrieval seniorconnectors, sync, chunk, enrich, index, retrieve, rag-evalKnowledge, Connector, KbAdminregistry/, connectors/, sync/, chunk/, enrich/, index/, retrieve/, eval/contracts, substrate, model-gateway, telemetryruntime, toolbus
packages/control-planeFloating seniorregistry, scheduler, policy, approvals, tenancy, eval/, readmodels/Registry, Scheduler, PolicyService, Eval, insight query APIregistry/, sched/, policy/, approvals/, tenancy/, eval/, readmodels/contracts, substrate, runtime (RunService port), telemetrysurfaces internals
packages/telemetryKernel senior BOTel setup, logger, metrics registry, cost attributionTelemetry, Logger, metric helpersotel/, log/, metrics/, cost/contractsall domain packages
packages/testingFloating seniorfakes (gateways, stores, MCP server), golden harness, chaos helpersfixture factories, ReplayHarness clientfakes/, goldens/, chaos/contractsproduction code paths
surfaces/cli surfaces/api surfaces/web surfaces/acpFrontend/DXprotocol translation only——sdk (cli), control-plane APIdirect domain imports
sdk/*Frontend/DXper blueprint E10——API surface onlykernel internals
plugins/*Per pluginchannels, souls, kanban, goals, voice, connectors, guardrailsplugin manifests—plugin-kit APIkernel internals

Layer rule machine-enforced by dependency-cruiser config (P2 story E0.F1.S3). Any story importing against this table = architecture violation, reject in review.


2. Master Engineering Backlog

Phase 1 stories (current repo — packages/* of v1)

Feature value: immediate cost cut + measurement + golden capture that gates the whole program.

IDTitleDescription & ACDepsSizedRisk
P1.S1 ✅ v1.25.0Anthropic prompt cachingcache_control breakpoints on system prompt + last tool def in anthropic.provider.ts. AC: cache-read tokens visible in usage; hit ratio >60% on ≥3-turn sessions; no output diff on goldens. [FLAG:models.promptCache]—S1M
P1.S2 ✅ v1.26.0Structured logging + ban silent catchpino logger injected via createLogger in @anvio/observability; ESLint no-empty with allowEmptyCatch: false; audit confirms 0 empty catches across 46 catch blocks.—M2L
P1.S3 ✅ v1.26.0Token/cost/latency metrics per model callwithCallMetrics + recordStreamMetrics in all 3 adapters emit anvio_tokens_input/output/total, anvio_tokens_cache_\{read,creation\}_total, anvio_model_calls_total, anvio_model_call_latency_ms histogram.P1.S2S1L
P1.S4 ✅ v1.25.0Sliding window + summarize-on-overflowADR-0010 L1 in FilesystemMemoryProvider; config memory.maxShortTermMessages (default 0 = unlimited) + summarizeOnOverflow. Platform wires SessionSummarizer.P1.S3M3M
P1.S5 ⚠️ partial v1.25.0Tool-output clipping + artifact offloadClip shipped (ANVIO_MAX_TOOL_OUTPUT_CHARS=8000 default). Artifact offload for full payload still pending.—M2M
P1.S6 ⚠️ infra v1.25.1Golden trajectory captureapps/cli/scripts/capture-goldens.ts + evals/goldens/v1-seed/ scaffolded; actual 50-session capture pending live workspace usage.P1.S3M2L
P1.S7 ⏳ pendingAgent tool-loop unit tests (v1)tests for runtime.ts: iteration loop, native vs parsed paths, checkpoint build/read, stop, approval suspend. AC: ≥85% line coverage on agents package.—L4L
P1.S8 ✅ v1.27.0Skill-trigger index cacheSkillTriggerCache re-parses YAML only when file mtime changes; wired into DefaultAgentRuntime. Two successive matchAll calls perform 0 file reads on unchanged catalog.—S1L

Epic 0 — Foundations (new repo layout; Phase 2 start)

F1 Scaffolding & guardrails — value: architecture integrity is enforced, not hoped.

IDTitleDescription & ACDepsSizedRisk
E0.F1.S1Kernel package scaffoldingcreate packages/\{contracts,substrate,telemetry,testing\} skeletons + turbo wiring per §1. AC: builds, empty exports.P1 doneS1L
E0.F1.S2Contracts v0: core schemas + portsport v1 core schemas worth keeping; add RunEvent, port interfaces stubs (StateStore, BlobStore, Queue, EventBus, Secrets, ModelGateway, ToolBus, Knowledge, MemoryManager). AC: zod schemas + TS ports compile; contract-test skeletons.S1L4M
E0.F1.S3dependency-cruiser layer enforcementCI fails on prohibited imports per §1 table. AC: violation in fixture branch fails CI.S1S1L
E0.F1.S4telemetry packageOTel init, pino wrapper, metrics registry, cost-attribution helper. AC: span/log/metric from a sample app visible in console + OTLP exporters.S1M2L
E0.F1.S5testing package: fakes v0fake ModelGateway (scripted responses), fake stores, fake EventBus. AC: used by ≥1 test in each kernel package.S2M2L

F2 Substrate — value: one storage story for both tiers; kills JSON-rewrite races.

IDTitleDescription & ACDepsSizedRisk
E0.F2.S1Migration framework (dual dialect)schema-once, SQLite/Postgres generated; hermes migrate. AC: same logical schema on both engines in CI matrix.E0.F1.S2M3M
E0.F2.S2StateStore: SQLite WAL implsessions/runs/checkpoints tables + CRUD. AC: contract suite green; concurrent-writer test green (v1 race regression test).S1M3M
E0.F2.S3StateStore: Postgres impl + RLS scaffoldingsame contract; tenant_id RLS policies (enforced later). AC: contract suite green on PG.S2M2M
E0.F2.S4BlobStore: filesystem CASsha256-addressed put/get/link; GC by refcount. AC: contract suite; dedup verified.S1M2L
E0.F2.S5BlobStore: S3 implAC: contract suite vs MinIO in CI.S4S1L
E0.F2.S6Queue: SQLite-backed + NATS implslease/ack/retry semantics, per-tenant fairness keys. AC: contract suite both; lease-expiry chaos test.S2L4M
E0.F2.S7EventBus: in-process + NATS, CloudEvents envelopeat-least-once, idempotency keys. AC: contract suite; duplicate-delivery consumer test.S1M2M
E0.F2.S8Secrets: age-file + KMS portencrypt at rest; redaction filter registered into logger. AC: secret never appears in logs (test greps).E0.F1.S4M2H
E0.F2.S9v1 data importer: sessions/memory → substratechecksummed import of sessions/*.jsonl, memory JSON. AC: round-trip count+hash verification; idempotent re-run.S2,S4M3H

Epic 12 (Design) — Model Gateway (scheduled in Phase 2; numbered E12 to match Design §12)

F1 Canonical model + adapters — value: one choke point; provider swap without domain change.

IDTitleDescription & ACDepsSizedRisk
E12.F1.S1 ⚠️ partial v1.27.0Canonical request/response + ModelDescriptorChatRequest/ChatResponse live in @anvio/core/ports; ModelDescriptor registry shipped with 9 seed entries + estimateModelCostUsd. Canonical extraction into packages/contracts deferred to Epic 0. See ADR-0013.E0.F1.S2M3M
E12.F1.S2 ✅ pre-vNextAnthropic adapterShipped in packages/models/src/providers/anthropic.provider.ts with cache_control breakpoints (ADR-0010 L2) and native tool_use.S1M3M
E12.F1.S3 ✅ pre-vNextOpenAI-compatible adapteropenai-compatible.provider.ts covers openai/openrouter/deepseek/groq/mistral/together/xai/fireworks/moonshot/cerebras/sambanova/perplexity/cohere/huggingface/ollama + custom.S1M3M
E12.F1.S4 ✅ v1.25.0Gemini adapterNative functionDeclarations shipped v1.25.0; supportsNativeTools = true.S1M2M
E12.F1.S5 ✅ v1.26.0AbortSignal propagationChatRequest.signal wired into all 3 adapters (Anthropic SDK + fetch(OpenAI, Gemini)).S2–S4S1L

F2 Routing, fallback, metering — value: keeps v1's best subsystem, adds health + budgets.

IDTitleDescription & ACDepsSizedRisk
E12.F2.S1 ✅ pre-vNextRouter: route tiers + task classifier portclassifyTask + strategyForRoute + ModelRouter shipped in packages/models.E12.F1.S1M2L
E12.F2.S2 ✅ v1.27.0Fallback chains + circuit breaker per providerwalkFallbackChain + ProviderCircuitBreaker (closed→open→half-open); attempts record skipped:'circuit-open'.S1M3M
E12.F2.S3 ✅ v1.27.0Usage metering + spend limitsSpendBudgetLedger + hard MODEL_SPEND_BUDGET_EXCEEDED (HTTP 402); wired in ModelRouter.chargeBudget().E0.F1.S4M2M
E12.F2.S4 ⚠️ partial pre-vNextKey pools (encrypted, rotating)packages/credentials shipped; RouteTarget.pool consumed. Rotation test coverage still light.E0.F2.S8M2H
E12.F2.S5 ❌ N/Av1 adapter shim (gateway.model: legacy|vnext)Not needed — packages/models IS the vnext gateway per ADR-0013 D2. No greenfield rewrite.S1–S4M3H

Epic 5 — Tool Bus (core in Phase 2, rest Phase 4)

F1 Registry + policy + execution — value: governance replaces boolean flags; schema-token cut.

IDTitleDescription & ACDepsSizedRisk
E5.F1.S1 ⚠️ partial v1.26.0ToolRegistry + ToolPolicy schema + layered resolution@anvio/tool-bus ships ToolPolicy schema, mergeToolPolicies (default→tenant→project→agent), decideToolCall; 11 decision-table tests. ToolRegistry + runtime enforcement wiring still pending.E0.F1.S2M2M
E5.F1.S2PolicyGatescope/approval/rate/tainted-turn verdicts. AC: exhaustive decision-table tests; deny → synthetic tool error shape.S1M3H
E5.F1.S3Executor: timeout, retry, parallel independent callsper-policy timeout race; bounded parallelism. AC: fault-injection matrix (hang/throw/slow).S1M3M
E5.F1.S4OutputGovernor + read_artifact tooltoken-budget clip, CAS offload, reference format. AC: property test — result never exceeds budget, artifact always retrievable.E0.F2.S4M2M
E5.F1.S5ToolAuditorimmutable audit row per call (hashes, verdicts, latency). AC: invariant test — execute count == audit count.S3S1M
E5.F1.S6Builtins port wave 1 (safe pack)file_read, glob, grep, list_dir, http, json, datetime, memory_recall etc. onto ToolProvider. AC: v1 tool spec tests carried over.S3L4M
E5.F1.S7Builtins port wave 2 (gated pack)shell, edit/patch, browser family, execute_code — sandbox-tier tagged, approval defaults. AC: policy defaults verified; v1 tests pass.S6, E5.F2.S1L4H
E5.F1.S8v1 gateway YAML → policy converterboolean → policy objects. AC: converter round-trip on v1 default YAML; deprecation warning path.S1S1L

F2 Sandbox + selection + streaming (Phase 4)

IDTitleDescription & ACDepsSizedRisk
E5.F2.S1Sandbox tiers: none/process/container dispatchprocess isolation (rlimits, scoped FS view); container via Docker port. AC: escape-attempt test suite; FS scope test.E5.F1.S3L5H
E5.F2.S2SelectionService + tool_search meta-tooldeclared ∪ route-matched ∪ recent; miss-rate metric. AC: schema tokens per turn reduced ≥60% on fixture agents; search finds long tail.E5.F1.S1M3M
E5.F2.S3Circuit breaker per tool + health withdrawalAC: breaker opens on threshold, tool leaves offered set, advisory event emitted.E5.F1.S3M2L
E5.F2.S4Streaming/long-running toolsprogress events to run stream; heartbeat; detach → event-wait. AC: long-tool fixture streams + survives run suspend.E1.F2.S3M3M

Epic 1 — Runtime Engine (Phase 3)

F1 Executor + state — value: durability, testability; unblocks compiler/planner/eval.

IDTitleDescription & ACDepsSizedRisk
E1.F1.S1GraphNode contract + NodeContext (RFC-1)typed node port, capability-scoped context, NodeOutcome. AC: RFC merged; fake node kit in testing pkg.E0.F1.S2M3H
E1.F1.S2Checkpoint codec (RFC-2)zod-validated, delta-encoded, CAS refs for large payloads. AC: encode/decode property tests; corrupt-checkpoint rejection (kills v1 as unknown as hole).E0.F2.S2,S4M3M
E1.F1.S3GraphExecutor corenode walk, ckpt-after-node, status machine, resume-from-ckpt. AC: crash-at-every-node property test → resume equivalence.S1,S2L5H
E1.F1.S4RunService + RunEventPublisherstart/resume/cancel; run.<id>.* topics; RunHandle event iterator. AC: SSE-shaped consumer test; status transitions exhaustive.S3, E0.F2.S7M3M
E1.F1.S5CancellationControllersignal tree run→node→gateway. AC: mid-stream cancel test end-to-end (with E12.F1.S5).S3S1L

F2 Standard graph + nodes

IDTitleDescription & ACDepsSizedRisk
E1.F2.S1Nodes: intake + finalize + modelintake provenance/guardrail hook; model node streams via gateway. AC: node unit tests with fakes.F1.S3, E12M3M
E1.F2.S2Nodes: route + tool-execparallel calls via ToolBus; loop edge. AC: multi-tool turn test; wall-clock parallelism asserted.S1, E5.F1M3M
E1.F2.S3ApprovalCoordinator + approval-wait nodesuspend/resume protocol, expiry timers, tainted-turn integration. AC: suspend→decide→resume across process restart.S2M3H
E1.F2.S4Standard graph assembly + config surfaceReAct+ graph, runtime.maxIterations=24, per-agent params. AC: graph golden shape test.S1–S3S1L
E1.F2.S5Learn node (async hook)post-run event emission; proposal envelope (consumed by E3). AC: fires off critical path; failure isolated.S4S1L

F3 Workers + cutover

IDTitleDescription & ACDepsSizedRisk
E1.F3.S1WorkerPool: lease, heartbeat, orphan recoveryper-tenant concurrency fairness. AC: kill-worker chaos → run recovered ≤ lease TTL.F1.S3, E0.F2.S6L4H
E1.F3.S2Golden replay harness (E8.F1.S2 pulled early) + parity gatereplay v1 seed goldens through standard graph via fakes. AC: ≥98% trajectory equivalence; diffs triaged. [GOLDEN]F2.S4, P1.S6L4H
E1.F3.S3Runtime cutover flag + v1 checkpoint importerruntime.engine: legacy|graph; approval-ckpt conversion. AC: v1 suspended sessions resumable on graph engine. [FLAG]S2M3H

Epic 2 — Prompt Engine (Phase 3)

F1 Registry + manifest — value: reproducibility; eval attribution.

IDTitleDescription & ACDepsSizedRisk
E2.F1.S1PromptRegistry (CAS-backed, lineage)put/get/lineage; kinds: persona/skill/header/template. AC: hash stability tests; lineage query.E0.F2.S4M2L
E2.F1.S2ContextManifest schema (RFC-3) + persistence in checkpointsAC: manifest recorded per model call; run inspector can list segments.S1, E1.F1.S2M2M

F2 Compiler

IDTitleDescription & ACDepsSizedRisk
E2.F2.S1Segment model + SegmentProvider port + TemplateEnginelogic-less interpolation; provenance framing applied here. AC: framing test — untrusted segment always wrapped.E2.F1.S1M3M
E2.F2.S2TokenBudgetManager + degradation ladderdescriptor-derived budget; drop/summarize priority order; prompt.budget.degraded event. AC: property tests — never exceed window; ladder order stable.S1, E12.F1.S1M3M
E2.F2.S3HistoryWindower + rolling summarywindow + cheap-route summary; raw log untouched. AC: long-session fixture — coherence eval ≥ baseline; bounded output.S2M3M
E2.F2.S4Cache-aware ordering + breakpoint placementstable-first ordering; breakpoints via gateway hints. AC: cache-hit ratio ≥ target on multi-turn fixture (with E12.F1.S2).S2M2M
E2.F2.S5compile-context node integrationreplaces v1 assembleSystemPrompt semantics; parity snapshot vs v1 output for same inputs. AC: golden replay unaffected. [GOLDEN]S1–S4, E1.F2.S4M3H
E2.F2.S6PromptValidator + prompt tests in CIceilings, must-contain, forbidden content; registry gate hook. AC: failing prompt test blocks CI on fixture.E2.F1.S1M2L

Epic 3 — Memory Engine (Phase 3–4)

F1 Lanes + recall — value: recall quality per token; GDPR path.

IDTitleDescription & ACDepsSizedRisk
E3.F1.S1LaneStore port + SQLite impl (FTS5+sqlite-vec)episodic/semantic tables per §blueprint. AC: contract suite; hybrid query works.E0.F2.S2L4M
E3.F1.S2MemoryManager: propose/recall/forgetwrite-policy gate (Learn node + user command only); ranked recall (relevance×recency×type×confidence). AC: ranking golden sets; forget removes + tombstones.S1M3M
E3.F1.S3Recall → compiler segment providerbudget-capped, provenance-tagged injection. AC: injected tokens ≤ budget; provenance visible in manifest.S2, E2.F2.S1S1L
E3.F1.S4Distiller (episodic + semantic writers)Learn-node consumer; cheap-route summarize/fact-extract; dedupe + supersession. AC: schema-valid proposals; contradiction test — supersede not delete.S2, E1.F2.S5L4M
E3.F1.S5ExpiryService + TTL configsweep workflow; compaction. AC: expiry honors per-lane TTL; lineage kept.S1, E7.F1.S3M2L
E3.F1.S6Postgres lane impl + PII hook + v1 memory importerpgvector; PII detect policy block/redact/allow; distill v1 blobs batch job. AC: contract suite PG; importer idempotent; PII test corpus.S1,S4, E0.F2.S9L4H

Epic 4 — Knowledge Engine (Phase 4)

F1 Ingest pipeline — value: real RAG replaces stub; incremental cost.

IDTitleDescription & ACDepsSizedRisk
E4.F1.S1Canonical doc model + KnowledgeRegistrydocs/versions/ACL schema; KB version = snapshot set. AC: schema review; registry CRUD tests.E0.F1.S2M3M
E4.F1.S2Connectors: file + gitlist/fetch/changed-since; provenance. AC: connector contract suite on fixture corpora.S1M3L
E4.F1.S3SyncEngine: hash-diff incremental, resumable batchesqueue-backed; only changed docs flow. AC: 2nd sync of unchanged corpus processes 0 docs; kill-mid-sync resume test.S2, E0.F2.S6L4M
E4.F1.S4Chunker: structure-aware + parent-childheadings (md/docs), AST symbols (code). AC: golden chunk snapshots per fixture type.S1L4M
E4.F1.S5Indexer: FTS generation build + atomic swaptwo-phase; generation bookkeeping. AC: swap atomicity test (query during build sees old gen).S3,S4M3M
E4.F1.S6Embedding pipeline + vector index + embedding-version stampingbatch-lane embeds; never mix spaces. AC: re-embed generation test on model change.S5, E12.F2.S1L4M
E4.F1.S7Enricher: contextual headers (batch LLM)per-chunk doc-context prepend. AC: enriched vs plain retrieval A/B on eval set shows gain (gate: keep only if measured).S6, E8.F2.S1M3M
E4.F1.S8Connectors: web crawler + Confluencerate-limited, ACL-importing (Confluence). AC: contract suite; ACL mapped to doc ACL.S2L5M

F2 Retrieval + permissions

IDTitleDescription & ACDepsSizedRisk
E4.F2.S1Hybrid retriever: BM25+vector, RRF, metadata filtersBM25-only fallback path (Level-1). AC: recall@k ≥ BM25 baseline on labeled sets.F1.S5,S6L4M
E4.F2.S2Parent expansion + dedup + budget compressionAC: passage set fits budget; parent expansion capped.S1, E2.F2.S2M2L
E4.F2.S3ACL-in-retrieval enforcementfilter inside query, never post-hoc. AC: adversarial test — unauthorized doc never in results regardless of budget/rerank.S1, F1.S1M2H
E4.F2.S4Knowledge → compiler segment provider + KB version pinningAC: agent pinned to KB@vN retrieves only vN docs.S2S1L
E4.F2.S5Reranker plugin slot + reference imploptional cross-encoder. AC: pluggable; eval shows when it pays.S1, E8.F2.S1M2L
E4.F2.S6v1 knowledge importerknowledge/raw → file connector KBs; wiki copies dropped. AC: idempotent; manifest converted.F1.S2S1L

Epic 6 — MCP Gateway (Phase 4)

F1 Client fleet — value: reliability + security on fastest-growing tool surface.

IDTitleDescription & ACDepsSizedRisk
E6.F1.S1McpRegistry + trust tiers + config conversionv1 integration configs auto-convert; trust→policy defaults mapping. AC: converter tests; tier defaults verified.E5.F1.S1M2M
E6.F1.S2ClientManager: transports, pool, stdio supervisionlazy connect, backoff, zombie kill. AC: fault matrix vs fixture server (hang/disconnect/malformed).S1L4M
E6.F1.S3CatalogService → ToolRegistry + description sanitizernormalized descriptors; description-injection defense. AC: hostile-description corpus neutralized; catalog TTL + invalidate-on-error.S2M3H
E6.F1.S4AuthBroker: OAuth via control plane, token refreshencrypted storage; per-user vs workspace identity. AC: refresh race test; token never logged.S2, E0.F2.S8L4H
E6.F1.S5HealthMonitor + CompatLayerprobes, withdrawal, version negotiation + graceful degradation. AC: unhealthy server's tools leave selection; old-protocol fixture degrades not crashes.S3M3M
E6.F1.S6Hermes-as-MCP-server facadeexpose agents/memory.recall/knowledge.query. AC: external MCP client (fixture) drives an agent end-to-end.E1.F1.S4M3M

Epic 7 — Planner Engine (Phase 4)

F1 Workflows — value: consolidates 4 v1 packages; durable scheduled agents.

IDTitleDescription & ACDepsSizedRisk
E7.F1.S1Workflow YAML schema (RFC-4) + WorkflowRegistryhash-versioned defs. AC: RFC merged; schema validation corpus.E1.F2.S4M2M
E7.F1.S2WorkflowCompiler → executor graphsstep types: agent-run, tool, human-gate, timer, event-wait, sub-workflow, bounded map/fan-out. AC: YAML→graph golden shape tests; loop-bounding enforced.S1L5H
E7.F1.S3TriggerService: cron + event + webhookabsorbs v1 automation; missed-schedule recovery. AC: v1 cron specs migrate; zero missed schedules in restart chaos test.S2, E0.F2.S6M3M
E7.F1.S4SubRunManager: typed spawn/await, fan-out caps, permission intersectionAC: contract-violation test (child result schema); no-escalation test.S2, E1.F1.S4M3H
E7.F1.S5Human-gate durable suspend + workflow templatesfan-out/verify, judge-panel, pipeline, supervisor templates. AC: suspend across restart; templates in workflows/ run green.S4, E1.F2.S3M3M

F2 Planning + reflection

IDTitleDescription & ACDepsSizedRisk
E7.F2.S1Decomposer (goal → plan in working memory)revisable plan state; route by size. AC: plan schema tests; replaces v1 task-planner cases.E1.F2.S4M3M
E7.F2.S2ReflectionPolicy + reflect nodetriggers (error streak, guardrail, cadence), bounded attempts, budget-capped. AC: simulation on recorded failures — success lift measured, cap never exceeded.S1, E8.F1M3M
E7.F2.S3Critic + Evaluator nodes in NodeKitrubric critique; checker scoring; reusable in workflows. AC: node unit tests; used by judge-panel template.S2M2L

Epic 8 — Evaluation Framework (Phase 3 start, Phase 4 complete)

F1 Goldens + replay + gate — value: makes every other epic's claims falsifiable; gates cutover.

IDTitleDescription & ACDepsSizedRisk
E8.F1.S1GoldenStore + golden review workflowCAS-versioned trajectories/sets; code-review process for goldens. AC: v1 seed imported; provenance recorded.P1.S6, E0.F2.S4M2L
E8.F1.S2ReplayHarness (deterministic, fake gateways)(delivered early as E1.F3.S2 — this story: generalize + benchmark live mode). AC: same golden replays identically twice.E1.F3.S2M2M
E8.F1.S3Scorers v1: structural checkers + trajectory comparatorAC: labeled agreement ≥ target on fixture sets.S2M3M
E8.F1.S4CI gate: hash-change → affected suites → score diffregistry integration; gate policy per artifact kind. AC: fixture persona regression blocks CI.S3, E2.F1.S1M2M

F2 Judge, bench, experiments

IDTitleDescription & ACDepsSizedRisk
E8.F2.S1Retrieval eval harness + labeled setsrecall@k, faithfulness sampler. AC: baselines published for E4 gates.E4.F2.S1M3M
E8.F2.S2LLM-judge scorer (pinned judge, structured output, injection-hardened)agreement audit vs human labels. AC: audit ≥ threshold; judge version locked in config.F1.S3M3H
E8.F2.S3BenchService: cost/latency/token per model+prompt-versionmodel comparison matrix. AC: bench run produces matrix consumed by dashboard.E12.F2.S3M2L
E8.F2.S4ScoreLedger read model + drift samplingscores → per-hash series; nightly sampled live scoring. AC: ledger query API; drift alert fires on fixture regression.S2, E9.F1.S1M3M
E8.F2.S5ExperimentService: A/B split + guarded rolloutprompt-version traffic split; auto-rollback on score drop. AC: rollback fires in simulated regression.S4L4H

Epic 9 — Dashboard (Phase 4–5)

F1 Read models + core views

IDTitleDescription & ACDepsSizedRisk
E9.F1.S1Read-model projection framework (RFC-7)idempotent projectors from event log; rebuildable rm_* tables; staleness indicator. AC: replay determinism test.E0.F2.S7L4M
E9.F1.S2System/Health + Runtime views + live run streamAC: SSE live view; v1 overview endpoints aliased.S1, E1.F1.S4L4L
E9.F1.S3Approval inbox (actionable)list/decide/expiry; RBAC. AC: decide → run resumes end-to-end.S2, E1.F2.S3M3M
E9.F1.S4Run inspector (checkpoints + manifests replay view)AC: any run browsable node-by-node with segment/token detail.S2, E2.F1.S2L4M
E9.F1.S5Token/Cost + Model viewsspend by dims, cache savings, budget forecasts, fallback/latency panels. AC: numbers reconcile with metering ledger (test).S1, E12.F2.S3M3L

F2 Quality + governance views (Phase 5)

IDTitleDescription & ACDepsSizedRisk
E9.F2.S1Prompt + Evaluation viewslineage, score series, gates, experiments. AC: deep-links to versions/runs.E8.F2.S4M3L
E9.F2.S2Memory + Knowledge viewslane sizes, recall precision, sync/freshness, index gens. AC: stale-doc alert visible.E3,E4M3L
E9.F2.S3Workflow view + Audit search + trace viewer link-outAC: audit query over control-plane mutations/approvals/tool calls.E7, E5.F1.S5M3M
E9.F2.S4Dashboard RBAC + PII-redacted projectionsfinance sees cost not transcripts; transcript access audited. AC: RBAC matrix tests.F1 allM3H

Epic 10 — SDK (Phase 5)

IDTitleDescription & ACDepsSizedRisk
E10.F1.S1OpenAPI spec generated from contractssingle source; CI drift check. AC: spec validates; breaking-change detector wired.E0.F1.S2, APIM3M
E10.F1.S2TS SDK L1–L2 (chat, sessions/runs/events/approvals, memory/knowledge query)AC: integration suite vs ephemeral kernel; streaming iterator ergonomics reviewed.S1L5M
E10.F1.S3CLI refactor onto SDKcompleteness proof; command surface preserved with aliases. AC: CLI e2e suite green; no direct kernel imports (dep-cruiser).S2L5H
E10.F1.S4TS SDK L3: custom tools/nodes/graphsAC: example custom node runs in standard graph slot.S2, E1.F1.S1M3M
E10.F2.S1Plugin-kit + manifest/permission grammar (RFC-6) + scaffolderlocal test harness with fakes. AC: fixture plugin passes harness; capability grants enforced.E10.F1.S4L5H
E10.F2.S2First-party plugin extraction: channelsv1 channels → plugins on plugin-kit. AC: Slack/Discord adapters pass v1 channel tests as plugins.S1L5H
E10.F2.S3Plugin extraction: souls, kanban, goals, voiceAC: feature parity smoke suites; kernel no longer imports them.S2L5M
E10.F3.S1Python client + toolkit (MCP-based tools)generated client + hand ergonomics; toolkit typed helpers. AC: example Python tool served + called by agent.E10.F1.S1, E6.F1.S6L4M
E10.F3.S2Go client + toolkitAC: same as Python at client tier.E10.F1.S1M3L
E10.F3.S3Examples repo + quickstart timing gate + API reference10 recipes run in CI; quickstart ≤15 min measured. AC: timing test in release checklist.F1–F3M3L

Control plane & tenancy stories (Phase 5, from Design §16–17 — grouped as Epic CP)

IDTitleDescription & ACDepsSizedRisk
CP.S1Registry: agent/skill/workflow versioning + activation gatescontent-hash versions, lineage, session pinning, eval-gate hook. AC: pinning test; gate blocks activation on fixture.E2.F1.S1, E8.F1.S4L4M
CP.S2PolicyService: subjects/grants/intersectionagent-for-user = intersected permissions. AC: policy decision tests incl. escalation attempts.E0.F1.S2L4H
CP.S3Tenancy: RLS enforcement + per-tenant keys + queue fairnessAC: adversarial cross-tenant suite; external pentest scheduled.E0.F2.S3, CP.S2L5H
CP.S4Rate limiting + spend budgets at surfaces/gatewayAC: limit breach → 429/typed error; budget → degradation ladder engages.E12.F2.S3M3M
CP.S5SSO/OIDC + scoped API keysAC: OIDC login e2e; key scopes enforced per capability.CP.S2L4H
CP.S6Audit trail completion + retentionimmutable events for all control-plane mutations. AC: audit completeness invariant tests.E0.F2.S7M2M

Backlog totals: ~118 stories · ~330 engineering days ≈ 66 ew — consistent with blueprint's ~61 ew + integration overhead.


3. Dependency Graph

P1.S1..S8 (v1, parallel) ──► P1.S6 goldens ─────────────────────────┐
                                                                    │
E0.F1.S1─►S2─►(S3,S4,S5)                                            │
        └─►E0.F2.S1─►S2─►(S3,S6)  S1─►(S4─►S5, S7, S8)  S2+S4─►S9   │
                                                                    │
E0.F1.S2 ─► E12.F1.S1 ─► (S2,S3,S4) ─► S5 ─► E12.F2.S1─►S2         │
                                        E12.F2.S3, S4 ─► S5(shim)   │
E0.F1.S2 ─► E5.F1.S1─►(S2,S3)─►(S4,S5,S6)─►S7   S1─►S8             │
                                                                    ▼
E1.F1.S1─►S2─►S3─►(S4,S5) ─► E1.F2.S1─►S2─►S3─►S4─►S5 ─► E1.F3.S1
                                              E1.F3.S2 ◄── goldens ─┘
                                              E1.F3.S3 (CUTOVER GATE)
E2.F1.S1─►S2   E2.F2.S1─►S2─►(S3,S4)─►S5─►S6
E3.F1.S1─►S2─►(S3,S4)─►(S5,S6)
E4.F1.S1─►S2─►S3─►S5   S1─►S4─►S5─►S6─►S7   S2─►S8
E4.F2: F1.S5+S6─►S1─►(S2,S3,S5)─►S4   F1.S2─►S6
E6.F1.S1─►S2─►(S3,S4,S5)─►S6
E7.F1.S1─►S2─►(S3,S4)─►S5   E7.F2.S1─►S2─►S3
E8.F1.S1─►S2─►S3─►S4   E8.F2.S1..S5 (after E4.F2.S1, E12.F2.S3)
E9.F1.S1─►(S2..S5)─►E9.F2.*
E10.F1.S1─►S2─►(S3,S4)─►F2.S1─►(F2.S2,F2.S3)   F1.S1─►F3.*
CP.S2─►(S3,S5)   CP.S1 after E8.F1.S4

Critical path: P1.S6 → E0.F1.S2 → E0.F2.S2 → E12.F1.S1→S2 → E1.F1.S1→S2→S3 → E1.F2.S1→S2→S3→S4 → E1.F3.S2 (golden parity) → E1.F3.S3 (cutover) → E2.F2.S5 → E7.F1.S2 → E10.F2.S1 → plugin extraction. ≈ 45 days of serialized work — everything else parallelizes around it.

Parallel lanes (post-E0): Lane A executor (E1) · Lane B compiler/registry (E2) · Lane C toolbus+builtins (E5) · Lane D gateway adapters (E12) · Lane E memory (E3) · then Phase 4: knowledge (E4) ∥ MCP (E6) ∥ planner (E7) ∥ eval (E8) ∥ dashboard (E9).

Architectural milestones: ◆A substrate contract suites green (E0.F2) · ◆B v1-on-gateways (E12.F2.S5) · ◆C golden parity (E1.F3.S2) · ◆D cutover (E1.F3.S3) · ◆E manifests everywhere (E2.F2.S5) · ◆F RAG eval baseline (E8.F2.S1) · ◆G workflows durable (E7.F1.S5) · ◆H tenancy pentest pass (CP.S3) · ◆I plugin API v1 (E10.F2.S1).


4. Pull Request Roadmap

One story = one PR by default; below, multi-story PRs are only where stories are inseparable. PR numbers are sequence, not GitHub IDs. All PRs: must compile, tests green, backward compatible unless tagged [BREAKING-PLANNED], no refactor+feature mixing (refactor PRs tagged [REFACTOR]).

PRObjectiveStoriesSizePackagesMigration notesTest focus
1–8Phase 1 on v1 repoP1.S1–S8 (one each)S–Mv1 models/memory/tools/agents/observabilityall flag-guardedgoldens, cache metrics
9kernel scaffolding + layer CIE0.F1.S1,S3Snew pkgs, CInonedep-cruiser fixture
10contracts v0E0.F1.S2Lcontractsnoneschema tests
11telemetry + testing fakesE0.F1.S4,S5Mtelemetry, testingnoneexporter smoke
12–17substrate impls (one PR per port-pair)E0.F2.S1–S8M–Lsubstratemigrations additivecontract suites both engines
18v1 data importerE0.F2.S9Msubstrate, toolschecksummed, idempotentround-trip
19–23gateway: canonical model; adapters ×3; abortE12.F1.S1–S5Mmodel-gatewaynoneadapter contract fixtures
24–26router, breaker/fallback, metering+keysE12.F2.S1–S4Mmodel-gatewaykey pool migrate from v1 credentialsfault injection
27v1-on-gateway shim ◆BE12.F2.S5Mv1 platform + gatewaygateway.model flagfull v1 integration suite
28–33toolbus core + builtins waves + converterE5.F1.S1–S8M–LtoolbusYAML converter, deprecation warndecision tables, v1 tool tests
34–38executor: node contract, codec, core, runservice, cancelE1.F1.S1–S5M–Lruntimenonecrash-resume property
39–43standard-graph nodesE1.F2.S1–S5Mruntimenonenode units, approval restart
44worker poolE1.F3.S1Lruntimenonechaos kill
45golden parity harness ◆CE1.F3.S2, E8.F1.S1,S2Lruntime, control-plane/eval, testinggoldens imported≥98% equivalence
46runtime cutover flag ◆D [BREAKING-PLANNED next minor]E1.F3.S3Mruntime, platform gluev1 ckpt importersuspended-session resume
47–48prompt registry + manifestE2.F1.S1,S2Mruntime/compilernonehash stability
49–53compiler: segments, budget, window, cache-order, node swap ◆EE2.F2.S1–S5Mruntime/compilerparity snapshot vs v1budget properties, goldens
54prompt validator + CI gateE2.F2.S6, E8.F1.S4 partialMcompiler, eval, CIgate advisory first releasefixture regression blocks
55–59memory lanes, manager, segment, distiller, expiryE3.F1.S1–S5M–Lruntime/memorynoneranking goldens
60memory PG + PII + importerE3.F1.S6Lmemory, substratebatch distill jobPII corpus
61–68knowledge ingest chain (one PR per story)E4.F1.S1–S8M–Lknowledgev1 knowledge importer in 68sync idempotence, swap atomicity
69–74retrieval + ACL + pinning + reranker slotE4.F2.S1–S6M–Lknowledge, compilernoneACL adversarial, recall@k
75–80MCP fleet + server facadeE6.F1.S1–S6M–Ltoolbus/mcpv1 config converterfault matrix, hostile descriptions
81–85workflows: schema, compiler, triggers, subruns, gatesE7.F1.S1–S5M–Lruntime/plannerv1 DAG/cron convertersdurable suspend chaos
86–88decomposer, reflection, critic nodesE7.F2.S1–S3Mruntime/plannertask-planner retiredreflection simulation
89–92eval: scorers, judge, bench, ledger+driftE8.F1.S3, F2.S1–S4Mcontrol-plane/evaljudge pinned in configagreement audits
93experiments + guarded rolloutE8.F2.S5Leval, gatewaytraffic-split flagauto-rollback sim
94–98dashboard: framework, core views, inbox, inspector, costE9.F1.S1–S5M–Lcontrol-plane/readmodels, webv1 endpoints aliasedprojector replay
99–102dashboard quality views + RBACE9.F2.S1–S4Mreadmodels, web—RBAC matrix
103–105sandbox tiers, selection, breaker, streaming toolsE5.F2.S1–S4M–Ltoolbus—escape suite
106–111control plane: registry, policy, tenancy, limits, SSO, auditCP.S1–S6Lcontrol-plane, substrateRLS enable = migration + verifycross-tenant adversarial
112–115SDK: OpenAPI, TS L1–L2, CLI refactor [REFACTOR], L3E10.F1.S1–S4Lsdk, cliCLI aliases preservede2e suites
116–118plugin-kit + channel extraction + remaining extractionE10.F2.S1–S3Lsdk, pluginskernel drops plugin importsparity smoke
119–121Python/Go clients+toolkits, examples+quickstartE10.F3.S1–S3M–Lsdk—recipes in CI

5. Sprint, Milestone, Release Plans

2-week sprints, 5–6 eng. Sprint allocation (indicative — re-plan at phase gates):

SprintFocusExit criteria
1PRs 1–8 (Phase 1)Phase-1 acceptance (cache >60%, goldens captured)
2–3PRs 9–18 (foundations, substrate) ◆Acontract suites green both engines
4–5PRs 19–27 (gateway) ◆B ∥ PRs 28–33 (toolbus)v1 integration suite via shim
6–8PRs 34–46 (executor→cutover) ◆C ◆D ∥ 47–48golden parity ≥98%; cutover flag live
9–10PRs 49–60 (compiler ◆E, memory)long-session token ↓≥50% vs baseline
11–14PRs 61–93 four parallel lanes (knowledge ◆F, MCP, planner ◆G, eval) + 94–98Phase-4 acceptance per blueprint
15–16PRs 99–111 (dashboard done, control plane, tenancy ◆H)pentest pass; RBAC green
17–19PRs 112–121 (SDK, plugins ◆I, DX)quickstart ≤15 min; plugins pass harness
20hardening, docs, releasev2.0.0 checklist

Version tags: v1.25.x Phase-1 items on current line (maintenance continues until cutover) · v2.0.0-alpha = ◆D (sprint ~8) · v2.0.0-beta = Phase-4 exit (sprint ~14) · v2.0.0-rc = ◆H + ◆I (sprint ~19) · v2.0.0 = sprint 20 · v2.1 = plugin-ecosystem release (post-GA backlog).


6. Risk Register

#RiskProbImpactOwnerMitigation / trigger
R1Golden parity <98% at ◆CMprogram delayKernel Atriage protocol: classify diffs (bug vs acceptable drift); acceptable drift re-goldens with review; hard bugs block cutover
R2Checkpoint overhead >15ms p95Mlatency regressionKernel Adelta encoding tuning; ckpt batching per node group; gate at E1.F1.S3
R3Summary/window degrades long-session qualityMuser-visibleKernel Braw log retained; long-session eval set; flag rollback
R4Parallel Phase-4 lanes driftHintegration painTPMweekly integration train mandatory; lane PRs rebase on train
R5Tenancy isolation flawLsevereFloating senioradversarial suite + external pentest before rc; RLS default-deny
R6Judge scorer unreliableMfalse gatesFloating seniorstructural checkers primary; judge advisory until agreement audit passes
R7Plugin extraction breaks channel usersMchurnDXfirst-party plugins are compat suite; parity smoke per channel
R8MCP spec change mid-programMreworkTools midCompatLayer isolates; pin supported versions
R9Team size below 5Mtimeline +40%TPMcritical path protected first; Phase-4 lanes serialized as fallback
R10Scope creep via "small additions"Hdrift from blueprintAllrule: not in backlog → needs ADR; TPM enforces

7. Architecture Compliance Checklist (apply per PR review)

  • Imports comply with §1 package table (dep-cruiser green — automated)
  • New behavior behind flag if it changes existing behavior
  • Ports defined in contracts, impls in owning package; no cross-package concrete imports
  • Untrusted content (tool/MCP/retrieved/channel) provenance-tagged before context entry
  • Any model call goes through Model Gateway (no direct SDK usage — lint rule)
  • Any tool execution goes through Tool Bus (incl. MCP)
  • Context construction only via Context Compiler; no string-concat prompts outside it
  • State mutations produce events; consumers idempotent
  • Checkpoint-affecting changes preserve resume compatibility or version the codec
  • Prompt/workflow/KB artifacts content-hashed and registered
  • Memory writes only via MemoryManager.propose (Learn node / user command)
  • Secrets never in context, logs, or checkpoints (redaction test present)
  • Metrics + spans added for new operations
  • No empty catch; errors logged or rethrown typed

Violation scan of this backlog: none found. Two watch-items flagged: (1) E1.F3.S2 pulls an Epic-8 story early — acceptable, harness lives in eval package from day one; (2) E5.F1.S7 gated builtins depend on sandbox (E5.F2.S1) — ordering enforced in dependency graph; do not ship shell/exec builtins before sandbox lands.


Stop point. Backlog complete, implementation-ready. Next instruction can name a story (E0.F1.S1) or PR (#9) and execution proceeds without redesign.

Edit on GitHub

Last updated on

On this page