ai-memory v0.8.0

v0.7.0 Ship-Readiness — Architecture Decision Records

Companion to the v0.7.0 review synthesis and the per-cluster fix PRs (#761-#777). The synthesis enumerated seven “operator decision points” that no single fix cluster could resolve autonomously. This document closes each as a named ADR with rationale, alternatives considered, and consequences.

Status: ACCEPTED, v0.7.0 ship-readiness wave (issue #767). Date: 2026-05-15. Author: AI NHI dev team session (Claude Opus 4.7 1M context). Reviewer: operator (justin@alpha-one.mobi).

ADR-1 — QW-4 disposition: docs-only (no code feature)

Context. The v0.7.0 grand-slam release notes and CHANGELOG enumerate “4 QW items shipped” (QW-1 file-backed reflection export, QW-2 persona, QW-3 context-offload, QW-4 Tencent competitive positioning). The API-UX review (synthesis finding API-12 HIGH; review doc lives in the review-api-ux worktree and is summarised in v070-review-synthesis.md) and the feature inventory open question #9 both flagged that QW-4 has no corresponding code path — it is the docs/positioning.md

Decision. QW-4 is a docs + competitive-positioning deliverable, not a code feature. The audit’s original classification stands. The fix is to make the public framing honest:

Alternatives considered.

Consequences.

ADR-2 — Cluster H net-new doc scope: 6 shipped, 12-20h deferred as accepted debt

Context. Synthesis Cluster H (DOC-16) called for MVP docs for six v0.7.0 subsystems (Hook pipeline, Federation hardening, K8 quotas, K10 SSE approvals, Sidechain transcripts, Signed-events V-4 chain). The synthesis estimated 12-20 hours of net-new doc writing alongside the broader Cluster H stale-doc sweep. The operator decision point was: split into H-1 (stale-fix, ship-blocker) + H-2 (net-new MVP docs, defer to v0.7.0.1 doc-only release) OR block tag-cut on the full sweep.

Decision. Ship the 6 net-new docs in v0.7.0 (Cluster H landed docs/hook-pipeline.md, docs/federation.md, docs/k8-quotas.md, docs/k10-sse-approvals.md, docs/sidechain-transcripts.md, and docs/signed-events-v4.md as MVPs of 200-500 lines each per the synthesis spec, merged via PR #768). The additional 12-20 hours of long-form expansion (operator tutorials, production tuning runbooks, full troubleshooting decision trees) is accepted debt scheduled for v0.7.x patch releases as the relevant subsystems collect operator feedback in production.

Alternatives considered.

Consequences.

ADR-3 — Skills CLI + HTTP + MCP parity: shipped at three-surface symmetry

Context. Synthesis API-2 HIGH flagged that the L1-5 Agent Skills substrate exposed 7 MCP tools but had no CLI subcommands and no HTTP routes, breaking the project’s three-surface parity contract (everything reachable from MCP is also reachable from CLI and HTTP). Operator decision point: confirm whether CLI / HTTP parity is wanted, or accept MCP-only as the design.

Decision. Ship three-surface parity for all 7 Skills tools. Cluster E (PR #772) landed ai-memory skill {register|list|get|export| promote|compose|resource} CLI subcommands AND POST /api/v1/skill/{register,list,get,export,promote,compose,resource} HTTP routes. The handlers already existed in src/mcp/tools/skill_*.rs; Cluster E promoted them to pub and wired the CLI dispatcher + Axum router. 7 + 7 = 14 net-new surfaces.

Alternatives considered.

Consequences.

ADR-4 — PERF-5 Synchronous-mode max_retries default

Context. Performance review PERF-5 HIGH observed that the synchronous-atomise hot path inherits curator_max_retries = 3 from the deferred-mode default. On a Synchronous-mode store, three malformed-JSON LLM retries inside the write transaction is up to ~30-60 seconds of held-mutex latency at the substrate’s single SQLite writer. Operator decision point: reduce the default for the Synchronous path while leaving Deferred at 3.

Decision. Reduce default curator_max_retries to 1 for the Synchronous code path; leave Deferred at 3; expose a per-namespace policy override curator_max_retries: Option<u32> so operators can restore the legacy posture per namespace. Cluster F is the landing PR for the substrate change; this ADR pins the design so F’s implementer doesn’t re-litigate.

Alternatives considered.

Consequences.

ADR-5 — Error-code naming convention: UPPER_SNAKE going forward, lowercase.dotted as legacy

Context. API review API-5 MEDIUM observed that v0.7.0 introduces error tokens in two distinct styles:

The mix is real (it appears on the wire) and forces SDK consumers to match against two regex patterns. The operator decision is which becomes the project standard.

Decision. UPPER_SNAKE is the canonical error-code convention. All net-new error tokens MUST use UPPER_SNAKE. Existing lowercase.dotted tokens are preserved verbatim for backwards compat (no wire-rename) and documented as legacy in docs/API_REFERENCE.md §”Error code conventions” with a static alias table. A best-effort CI grep gate (scripts/lint-error-codes.sh) flags new lowercase.dotted tokens in PR diffs.

Alternatives considered.

Consequences.

ADR-6 — API-6 /api/v1/memory_load_family path alias

Context. API review API-6 MEDIUM observed that the v0.7.0 loaders surface uses POST /api/v1/memory_load_family and POST /api/v1/memory_smart_load, while the rest of the /api/v1/ surface follows the /api/v1/<noun>/<verb> shape (e.g., /api/v1/skill/register, /api/v1/quota/status). The flat memory_load_family path is the legacy MCP-tool-name straight-port and breaks the noun/verb convention.

Decision. Keep the current POST /api/v1/memory_load_family and POST /api/v1/memory_smart_load paths for backwards compatibility; add aliases POST /api/v1/family/load and POST /api/v1/family/smart_load as the preferred form going forward. Both forms route to the same handler. The current paths are documented as legacy in docs/API_REFERENCE.md; the alias forms are listed first as the recommended shape. No Deprecation header is set in v0.7.0 (additive only); a header may follow in v0.8.0 after an external-consumer audit.

Alternatives considered.

Consequences.

ADR-7 — LOE > 2-session clusters: actual execution fit within the envelope

Context. The synthesis flagged Cluster H (~3 sessions) and Cluster F (potentially ~2 sessions if PERF-5 needs a deprecation cycle) as the only clusters with LOE > 2 sessions. The operator decision point asked whether to split these into sub-clusters and defer.

Decision. No split needed — actual execution of all shipped clusters fit within ~1.5 sessions each. Cluster H came closest to the upper bound (~1.5 sessions) due to the 6 net-new MVP docs + broad stale-fix sweep; even that landed inside one campaign-day. No cluster H-2 or F-2 sub-split was required.

Alternatives considered.

Consequences.

Cross-cutting notes

— Cold mountain.