Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mnemra-core

mnemra-core is the core context layer for Mnemra — an MCP-native system for persistent, structured memory that integrates with AI development workflows.

This documentation covers the internal architecture, design decisions, and developer guides for mnemra-core contributors and integrators.

About This Site

This docs site is built with mdBook and includes:

  • Architecture Decision Records (ADRs) — the reasoning behind key design choices
  • Developer Guides — how to build, extend, and contribute

Repository

Source code lives at: https://github.com/mnemra/mnemra-core

For a project overview and quick-start instructions, see the README in the repository root.

Product Brief: Mnemra Core

Date: 2026-05-20 · Status: locked (intake-exit gate confirmed) · Altitude: product

Format note: this is a living document. Its structure is a forward-contract with the structured-delta tooling that will own its evolution (add idea · promote tier · retire feature · adjust scope, applied as labeled ADDED / MODIFIED / REMOVED deltas). Don’t restructure it ad hoc. Layer 1 (product-level intent) is stable and changes rarely. Layer 2 (the feature register) grows continuously. A new thought defaults to a Layer-2 register entry at the idea tier, a captured direction with no design work behind it yet. It escalates to a Layer-1 revision only when it shifts the product’s fundamental job-to-be-done or scope.

Register-model note: the feature register uses a five-tier lifecycle (idea → proposed → designed → committed → live) whose tiers are validated by pipeline artifacts, not by prose judgement. Each tier’s validator asks whether a specific artifact exists: proposed means a locked intake, designed means a locked frame plus a locked spec, committed adds a release-bound plan, and live means built and verified. This brief is the forcing instance for a pending amendment to the canonical register model (the prior model was four-tier and ordered committed before designed). The amendment is tracked separately, which is why the structure here leads its canonical adoption.

Scope boundary: this brief is mnemra-core’s product intent and capability roadmap. Sibling components in the mnemra umbrella (a dispatch CLI, a spec-delta/merge tool, a markdown review/annotation tool) live in their own repositories with their own forthcoming briefs and their own independent versions. They’re referenced as external components, not absorbed into this brief’s register.

Mnemra-as-a-whole does not carry a unified version. Components version independently. A release-manifest concept may pin specific component versions for a coordinated public release; that’s distinct from a version.

Commercial validation thresholds, pricing, and go-to-market strategy are maintained as a separate internal commercial record and are deliberately not inlined here. Where a roadmap entry has a commercial dimension, only its product shape is recorded; its commercial gating is referenced, not described.

Brief-home: this artifact lives in the mnemra-core repository at docs/src/intent/mnemra-core.md (relocated 2026-05-20). The brief travels with the component it scopes, following the per-repo-first default (keep an artifact with its component rather than in a shared home). The general multi-repo product-brief-home convention question stays in APPARATUS-1’s scope, for future multi-repo briefs in other components.

Product-level intent (layer 1, stable)

JTBD

Engineering teams that run coding agents (Claude Code, Cursor, Copilot) need their agents, and the humans working alongside them, to have persistent, structured, queryable context of the team’s codebase, decisions, tickets, docs, and prior agent sessions. That context has to be available every session without re-explanation, so it stops being a per-session tax that drifts and doesn’t scale.

Stated as the need rather than the solution: an agent preparing to act on a task sits inside a graph. Parent spec, related decisions, sibling tasks, prior reviews, recent adjacent commits. Today that graph has to be hand-loaded every session by the orchestrating agent, which drifts and doesn’t scale. Mnemra’s job is to make that context a durable, agent-addressable substrate.

Non-goals

Each item is a concrete not-this:

  • Not a retrieval-augmented-generation (RAG) chatbot, and not “a second brain for small businesses.”
  • Not a Notion replacement, knowledge wiki, or general-purpose vector-database wrapper.
  • Not a horizontal “AI for every department” tool; not sales/marketing/HR enablement.
  • Not an attempt to match an enterprise knowledge-search incumbent’s breadth.
  • Does not host a generative language model. All generative work (query rewrite, chunk-context, tag generation, synthesis) calls out to an external model at V0. Local non-generative inference (embedding, reranking, using small encoder models behind the host-fn seam) is permitted host-side. (MODIFIED 2026-07-02 per RC-1, retrieval-cluster intake (locked 2026-07-02); was: “Does not run a language model. Embeddings and summaries call out to an external model; the system never hosts one.”)
  • Not RAG-as-a-service.
  • The open-source core does not pursue multi-tenant isolation as a product goal; tenancy is a structural column-shape at V0 with policy enforcement deferred. The boundary between OSS-core single-tenant and a future managed multi-tenant offering is commercial, and out of scope for this brief.
  • Not a general autonomous-agent framework. The product could generalize toward one with work; single-use-case focus (a context layer for coding agents) is a deliberate quality choice. The generalization is declined, not absent. It’s recorded here so the rejected option stays visible.

Success criteria

Each is an observable outcome a downstream check could verify. V0 and V0.1 are marketing-tier labels denoting product-promise milestones, distinct from Semantic Versioning (SemVer) release identifiers:

Marketing tierSemVer corollaryWhat it delivers
V01.0.0 (dogfood-cutover / MVP)the maintainer’s workspace surface, replicated on mnemra-core without regression
V0.11.1.0+ (first post-MVP minor sequence)the core product promise activates: net-new value-add beyond workspace fidelity
  • V0 (internal-dogfood gate; SemVer 1.0.0): the maintainer’s own agent-orchestration workspace runs on mnemra-core with no functional regression versus its prior command-line-and-filesystem tooling, AND the agent-facing surface contract and storage substrate contract that later versions depend on are locked. Verifiable: a scripted representative-day fixture completes end-to-end against mnemra-core with zero fallback to the prior tooling.
  • Core product promise (activates V0.1; SemVer 1.1.0): a Model-Context-Protocol (MCP) client coding agent can retrieve persistent, typed, cross-session context for a given artifact in one call, rather than reconstructing it by hand each session.
  • Self-hostable: a team can run the full core on its own infrastructure with data never leaving that boundary.
  • Durable across restart: stored context survives a host stop and restart, including a hard kill. Every write acknowledged to a caller before the host stops is readable, with the same content, after the host next starts, whether the stop was a clean shutdown, a hard kill of the host process, or a hard kill of the embedded storage engine. This is what “persistent” means wherever this brief says it of context. “Persisted” in the Hard constraints below names a storage shape, not this criterion. Verifiable: a restart acceptance test writes through the agent-facing surface, stops the host each of the three ways, starts it again against the same data location, and reads back equal content. (ADDED 2026-09-15, maintainer ruling 2026-09-15: the brief promised persistence without defining it, the Frame (the constraint-locking stage of the pipeline) never weighed durability, and the V0 substrate spec narrowed “persist” to storage shape, so the promise had no checker. This criterion is the anchor the checker hangs from.) (Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800): “a hard kill of the embedded storage engine” → the storage engine is now a separate PostgreSQL instance the operator runs (P-0010 §Amendment 2026-10-19, where P-0010 is the project-scoped architecture decision record for the storage substrate engine). The criterion’s first two stop shapes are the host’s to verify (spec R-0121-a/-c; R-codes are stable requirement identifiers defined in the spec). Survival across a crash of the instance itself is PostgreSQL’s guarantee, under durability settings the host verifies as requirements on every start (R-0117-d) and names as its reliance (R-0121-b). The persistence defect this criterion was written against was mnemra’s own .temporary(true), not a property of embedding (maintainer, 2026-10-18). Its removal is a correction, not a benefit of the move.)
  • Commercial validation thresholds exist but live in the separate internal commercial record; they aren’t product success criteria and aren’t inlined here.

Hard constraints

Locked technical and integration boundaries (RFC 2119 keywords like SHALL, MUST, and MUST NOT, used where the requirement is observable):

  • The agent-facing surface SHALL be MCP-native (MCP specification 2025-06-18). Transport is stdio at V0; streamable-HTTP is a later-version activation. (Amended 2026-10-25, #4249, approved 2026-10-29 (#4249 activity 9183): the target revision is MCP specification 2025-11-25. The host serves exactly the released revisions 2025-06-18 and 2025-11-25, and it answers any other revision requested at initialize (the request that opens the MCP handshake) with 2025-11-25. The host enforces that set itself. Tests pin it at initialize and before the handshake; the pin after the handshake is #4326 (open). P-0012 §Amendment 2026-10-25 (MCP protocol revision), where P-0012 is the project ADR for the plugin runtime and MCP SDK.)
  • An MCP server is a V0 deliverable. To be clear about intent: the MCP-native constraint is satisfied by a running MCP server inside V0 scope, not by a future protocol posture alone.
  • The substrate SHALL be a single-process Postgres instance with the pgvector extension present. (Amended 2026-10-19, #4018: unchanged in substance, but sharpened. The instance is separate, vanilla, installed and run by the operator, with pgvector installed by the operator, and the host verifies both before serving (spec R-0117-a/-b). The host embeds no engine. P-0010 §Amendment 2026-10-19.) TimescaleDB is demoted off the V0 stack (P-0010 decision D8). It’s absent by decision, not oversight. At V0 only content and state are persisted in in-app Postgres shapes; the former timeseries and log shapes are observability emission surfaces, not in-app storage (telemetry is emitted, not stored, per the architecture-overview observability baseline). So the time-series engine has no V0 store to back. TimescaleDB is held behind a named latency/storage trip-wire for a later version.
  • Plugins SHALL be WebAssembly Component Model modules hosted in-process via Wasmtime; plugin core logic MUST be IO-free; all plugin IO MUST be mediated by host-provided functions. Plugins are leaves: no direct sideways linkage, and cross-plugin calls are host-mediated.
  • Deployment posture SHALL be self-hosted-first, single-binary. The system MUST NOT host a generative LLM (large language model); all generative work calls out to an external model at V0. Local non-generative inference (embedding, reranking) is permitted host-side. (MODIFIED 2026-07-02 per RC-1, retrieval-cluster intake (locked 2026-07-02); was: “The system MUST NOT host a language model; it calls out to an external one.”)
  • “Single-binary” constrains the server, not the deployment packaging. It means one process, not a microservice mesh. An immutable image or appliance is a valid packaging shape for that single binary and doesn’t violate this constraint.
  • Data lives outside the executable and its image, at a location the operator configures. A bare binary defaults to the operating system’s per-user application-data location and accepts an override. In a container, the operator mounts a volume at the configured location, and the host can be told to require that mount and refuse to start without it. (MODIFIED 2026-09-17, maintainer ruling 2026-09-17; was: “a container image declares a mount point and the operator mounts a volume there”. No claim is made about what an image declares: an image-declared volume isn’t durable under docker run --rm, and the image contract is parked until an image exists.) Stored context SHALL NOT live in a temporary directory, in the executable’s own directory, or in a container’s writable layer. Whether the location is local or network-backed is the operator’s choice. (ADDED 2026-09-15, maintainer ruling 2026-09-15, verbatim: “mnemra has to run as a container in many cases not just an executable. The data should not be stored with the executable.” An earlier ruling’s “persisted on the local filesystem” wording is superseded: it meant “not a deleted temp dir”, and “local” is not a constraint.) (Amended 2026-10-19, #4018: the data this constraint is about now lives in the operator’s PostgreSQL instance. So “outside the executable and its image, at a location the operator configures” binds the instance’s data directory, a named operator obligation the host can’t verify and emits as such (spec R-0117-j item 1). The host-side mount requirement and the per-user default have no object. What the host configures is the connection (spec R-0119), which survives restart as environment and a 0600 file.)
  • Tenancy invariant: the tenant scoping key (workspace_id) is structural from V0: NOT NULL, indexed, explicitly passed, and forward-compatible without migration. This is what makes deferring tenant-hierarchy/policy enforcement safe. The scoping key ships now; hierarchy and enforcement build on top later without a substrate migration.
  • Tooling SHALL default to Rust; non-Rust paths are adopted only where no viable in-stack path exists (the landing site is an accepted exception).
  • License: Apache-2.0 with a future-relicense clause (locked 2026-05-20). The mnemra-core repository’s current LICENSE/README (MIT) is corrected in a separate follow-up task; this brief’s Hard constraints lock the direction.
  • Architecture MUST NOT be schedule-pressured. Dates appearing in marketing or landing material are not architectural inputs and don’t weight tradeoff analysis.
  • Accessibility is a standing product requirement, binding on every human-facing UI and documentation surface the product ships, current and future: the docs site, any dashboard or console, human-readable CLI output. Each such surface’s design gate reviews it. Machine-facing MCP and agent surfaces are outside this requirement’s scope; derivative human views inherit it. (ADDED 2026-07-02, retrieval-cluster frame pre-gate walk item 13 (locked 2026-07-02): routed here as a product-level standing requirement rather than faked into an MCP-verb feature cluster.)

Evidence

This brief exists because product intent that lived only in conversation wasn’t an agent-addressable source. Across multiple research-lifecycle reviews, research and discovery work silently anchored scope to mnemra-core-as-exists-live, the only available ground truth, because no durable product-intent or roadmap artifact existed. The gap recurred at least three separate times before it was remediated. This document is that remediation. It’s the agent-addressable product-intent source that future research, discovery, and architecture evaluate scope against, so “the intended product” is a readable artifact rather than an inferred or imagined one.

Corroborating anchors: a locked V0 architecture discovery and a locked V0 architecture-constraints record (both high-stakes, reviewed to a zero-new-finding stopping rule); a structural architecture overview (eight named subsystems); and an internal commercial hypothesis, a set of testable claims maintained separately.

Consumer

The primary consumer is agents: MCP-client coding agents and orchestration tooling that load this as the agent-addressable product-intent source during research, discovery, and architecture work. That’s consistent with the project’s agent-primary source-artifact stance. The secondary consumer is the maintainer and future contributors evaluating scope. Human-readable rendered views, when needed, are derivative and generated on demand. This source is never the rendered view.

Risk profile

This artifact is documentation. It touches no trust boundary itself. The product it describes carries trust boundaries (multi-tenancy, authentication, plugin sandbox, telemetry non-leak). Those are owned by the mnemra-core component architecture record (the threat-modeling trigger is already met there) and are referenced by the register, not re-assessed here. Required risk assessment for any implementing work is deferred to the component-level frame, where the mechanism is known.

Feature register (layer 2, grows; each entry has a lifecycle tier)

Each entry carries exactly one tier. Tiers are validated by pipeline artifacts, not by prose judgement. The validator for each tier asks one yes/no question: does this artifact exist? That keeps the register mechanically checkable and consistent with the intent → frame → spec pipeline that produces it. (That pipeline has three stages: Intake locks structured intent, Frame derives the operating constraints, and Spec produces the testable contract verification consumes.)

TierMechanical validatorDurability
ideaa captured thought, optionally a provenance pointer to a locked decisionn/a
proposeda locked intake: the feature has been through intent capturepermanent
designeda locked frame + locked spec: the permanent “what to build” is completepermanent (kept)
committeddesigned plus a plan (the task list to action the build); release-boundplan is ephemeral (not kept)
livebuilt and verified in current code/canonn/a

The designed / committed boundary is the permanent/ephemeral artifact line. Once every permanent design artifact is done, the entry is designed; adding the disposable actioning plan makes it committed. The plan’s ephemerality is why it marks commitment. A throwaway task list only gets generated once the work is being actioned against a release. designed precedes committed because release-fit can’t be judged until the design (culminating in the spec) is complete. The work generates the commitment, not the reverse.

Structural fence (unchanged): no tier is a build authorization, not even committed. A tier is a readiness and commitment signal. The only build trigger is an explicit feature-altitude pass on the entry. The tiers track how far a feature’s pipeline has progressed; they don’t widen the build trigger.

Provenance pointers reference decisions by name and lock-date. In a multi-repo project, much of the locked provenance lives in a maintainer-internal architecture record that a public repository artifact can’t cite by path. So pointers name the decision and its lock-date rather than an internal path (see Open Decision PRV-1).

Idea

Captured directions. Either unvalidated, or decision-locked but not yet through their own pipeline. A provenance pointer, where one exists, records that a decision was taken; it does not promote the tier. Only a dedicated intake does that. This tier is the scope-anchor surface: research and discovery read idea-and-up so an intended direction is never silently dropped to what-exists-live.

  • Search + indexing activation (full-text + vector) [D1]. Promoted to proposed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; this pointer stays so the D1 reference remains resolvable. Provenance: V0 discovery, Deferred section (locked 2026-05-02).
  • First-class graph edges + traversal [D2]. Promoted to proposed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the D2 reference remains resolvable. Provenance: as D1.
  • get_context_for(artifact_id), the agent-context bundle composer [D3]. Promoted to proposed @ V0.1 / 1.1.0 (2026-05-20). See Designed §V0.1 for the live entry; this pointer stays so the D3 reference remains resolvable.
  • Bidirectional issue↔code via commit-ref convention [D4]. Provenance: as D1.
  • New first-class artifact types beyond the migrated set [D5]. Provenance: as D1.
  • Row-level-security policy enforcement [D6]. Provenance: as D1.
  • External-authorization-server integration [D7]. Provenance: as D1.
  • Internal-workspace absorption (orchestration skills, roles, memory, and inboxes migrate or become projections) [D8]. Provenance: as D1.
  • Multi-orchestrator-per-project topology [D9]. Provenance: as D1.
  • Third-party plugin install [D11], gated on a documented ABI (application binary interface) evolution policy. Provenance: as D1.
  • Host-fn ABI 1.0 stabilization [D12]. Provenance: as D1.
  • Cross-artifact authoritativeness + provenance/use-policy substrate fields (G2/G3). Promoted to proposed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the G2/G3 reference remains resolvable. Provenance: knowledge-object survey dogfooding-lens amendment (2026-05-15), reclassified to a substrate concern there. The retrieval cluster is the pipeline run it rides.
  • Knowledge-object substrate shape (a frontmatter shape, not a new artifact type; an OCC (optimistic concurrency control) version field; extensible typed audit events). Provenance: as G2/G3.
  • Knowledge-object family schemas + judge-extender + review-queue + memory-inspector + memory-write-back discipline (F1/F3/F4/F5/F7). Provenance: as G2/G3 (forward-context, no consumer yet).
  • Multi-language plugin authoring (Rust-first now; JS/TS, Python, TinyGo; later C#). Provenance: architecture overview V0/V1 boundary.
  • microVM appliance posture for self-host. Conditional; the trip-wire is streamable-HTTP becoming the active transport (a named-capability condition, not release-gated). The substrate shortlist is recorded in the hosting research. Provenance: microVM hosting research (2026-05-18).
  • Per-tenant microVM isolation (managed tier). Conditional on a multi-tenant managed audience existing; Firecracker is the substrate; it pairs with row-level security rather than replacing it. Provenance: as above (Lens B).
  • Tenant hierarchy (org and higher layers above the workspace=tenant boundary) for full multi-tenancy. Deferred, and safe to defer because the tenant scoping key is structural from V0 (see the Tenancy invariant). Provenance: knowledge-object-survey scope sketch (visibility: …|workspace|org).
  • A dispatch CLI (external component, separate brief forthcoming). A sibling component in the mnemra umbrella with its own repository, its own brief, and its own independent version. It’s operationally required before mnemra-core V0 build begins: mechanical tasks heavily consume the premium model tier, and this CLI routes them and drives that cost down. Built using the completed intent → frame → spec pipeline, it later runs as a mnemra plugin (a workspace-era CLI and a mnemra-era WASM plugin sharing an IO-free core). Provenance: maintainer sequencing decision 2026-05-18. Referenced here as a build-time dependency, not absorbed into this brief’s register.
  • A spec-delta/merge tool (external component, separate brief forthcoming). A sibling component with its own repository, brief, and version. It’s operationally required before mnemra-core V0 build begins: it’s the structured-delta consumer this brief’s format forward-contracts with, needed for living-document updates. Built using the completed intent → frame → spec pipeline, it later runs as a mnemra plugin. Provenance: as above. Referenced as a build-time dependency, not absorbed.
  • A markdown review/annotation tool, hosted under the mnemra umbrella when published. A sibling product; tentative. Provenance: maintainer note 2026-05-18.
  • Context-intelligence plugin. Project-aware code understanding for reviewers (a decisions + language-server composite, sidecar). Conditional on such a plugin surface existing. Provenance: an external algorithms-research review.
  • Byte-level provenance-tracing reference. A provenance-deficit (not correctness) hallucination check. It’s a reimplementation reference for a future verification plugin, keyed on the G2/G3 provenance direction; reimplement, don’t port. Provenance: an external algorithms-research review (reimplementation-feasibility follow-up pending).
  • Managed/Cloud tier and Enterprise tier. Product expansion beyond the OSS core; commercial gating lives in a separate internal record, not here.
  • Connectors/ingestion beyond the dev-adjacent wedge. Opinionated and demand-driven; which ones, and when, are unvalidated.
  • External context/memory vocabulary adoption. Shape convergence is evidenced; the label lock is deferred until a second consumer joins.
  • Dashboard interface. A maintainer-side console product surface (a review/annotation tool may host here).
  • End-user CLI/TUI distinct from the admin control CLI; plugin registry/marketplace + signing/distribution as a product surface; hosted web console; onboarding/docs-as-product; agent-framework-specific integrations beyond generic MCP. All valid under the product umbrella, all unvalidated.
  • A newsfeed capability (working name). Pure thought, no provenance.
  • A permissions model. Pure thought; it explicitly needs research into the approach (see Open Decision OD-B).
  • Per-user identity machinery. Owner-columns-as-identity, caller identity in the request context, real owner==caller checks. It activates per-user visibility: owner-only serving semantics (at V0 owner-only serves no one; the fail-closed enforcement is the V0 semantics) and is the first write/label-capability surface that fires the deferred write-side policy-dimension design. The retrieval cluster’s new tables carry owner/created_by columns from day one, so this lands as a feature rather than an excavation. Provenance: retrieval-cluster frame pre-gate walk item 9 (locked 2026-07-02). (ADDED 2026-07-02.)
  • External Postgres server as the substrate engine. An operator-provisioned Postgres reached over a connection string in place of the embedded engine, behind the same engine-agnostic Storage trait (P-0010 D5). When supported, durability of stored context is that server’s responsibility, not the host’s; the “Durable across restart” success criterion then binds the connection configuration surviving restart, not a host-owned data directory. Not V0: it moves the durability problem to the Postgres server rather than solving it. Provenance: maintainer ruling 2026-09-15 (durability amendment; external Postgres is a future engine, not V0). (ADDED 2026-09-17, maintainer ruling 2026-09-17 at the durability amendment’s gate: the thought takes a Layer-2 idea entry per this brief’s format note, rather than living only in the V0 substrate spec’s Out of Scope section.) (Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800): this entry becomes the V0 engine. Two maintainer rulings set it, 2026-10-16 (“Operator; mnemra connects”) and 2026-10-18 (“we are moving to a separate normal postgres instance”). The engine is a separate, vanilla PostgreSQL instance the operator installs and runs, with pgvector installed by the operator, reached by connection configuration (P-0010 §Amendment 2026-10-19, spec R-0117 through R-0121). The 2026-09-15 reason (“moves the durability problem … rather than solving it”) is superseded on new evidence. The durability problem was mnemra’s own .temporary(true), and under the amendment the delegated durability settings are requirements the host verifies, failing closed, with the unverifiable remainder named (R-0117-d/-j). Tier at the gate: this entry moves from idea to designed (the designed-tier artifacts, which are the amended P-0010, the Frame and the spec, were approved 2026-10-19, #4018 activity 7800). No tier authorizes a build.)

Proposed

Has a locked intake (through intent capture). Not yet frame+spec complete, and not release-bound.

V0 is delivered as a staged increment sequence, not a monolithic release, and the register extends beyond V0 into the V0.1 (post-1.0.0) immediate roadmap. “V0” denotes the dogfood-replacement milestone; “V0.1” denotes the very-next-update phase (see Success criteria for the marketing-tier vs SemVer mapping). Each increment below is its own register entry carrying its own tier. The intake here is by retrofit: a locked, high-stakes, reviewed-to-zero-findings V0 discovery (locked 2026-05-02) scopes the V0 contents, and the V0.1 entries lock at this brief’s altitude per maintainer ruling 2026-05-20. The increment decomposition was captured in the 2026-05-18 product-intake refine and extended 2026-05-20. Every increment is therefore proposed. None is designed (no per-increment frame+spec exists) or committed (no plan, no release-bound date). The honest empty designed/committed tiers below are preserved, not papered over.

Versioning scheme (resolves INCR-1): Semantic Versioning 2.0.0, applied without abuse:

  • Each increment delivers backward-compatible functionality, so each is a minor bump within initial development: 0.1.0 (host core) → 0.2.0 → … (SemVer §7; §4: 0.y.z is initial development, where the API isn’t yet stable, which is exactly the V0 build period).
  • Backward-compatible fixes within an increment are patch bumps (0.N.1, 0.N.2; §6).
  • The commit identifier is build metadata appended with + (0.2.0+a1b2c3d), ignored in precedence (§10, §11). It is not a - pre-release identifier. Pre-release has lower precedence than the release (§11.3, 1.0.0-alpha < 1.0.0), which would misrepresent a delivered increment. Trunk commits advance the +sha; the version number bumps only when an increment’s functionality is realized.
  • 1.0.0 is the dogfood-cutover / MVP. SemVer §5: 1.0.0 defines the public API, which is precisely the V0 success criterion (the agent-facing surface and storage-substrate contracts are locked, and the maintainer’s workspace runs fully on mnemra-core). The road to 1.0.0 is the 0.y.z increment sequence below.

The sequence is builtin-substrate-first, then one capability family per increment, ordered by dogfood value and dependency, with the maintainer’s stated priority (tasks first after substrate). A one-clause ordering rationale accompanies each entry, so the sequence can be reordered cheaply at the intake-exit gate without restructuring entries.

  • 0.1.0: Builtin substrate + host core. Single-process Postgres (pgvector); the content and state storage-shape partitions persisted in-app, with the former timeseries and log shapes emitted to the observability minimum rather than stored (P-0010 D8); the pre-1.0 host-fn ABI; an MCP server skeleton (stdio) onto which each capability increment adds its verbs; the admin/destructive control CLI; an observability minimum; an LLM-API-key configuration surface (mnemra-core calls out to an external model for generative work; embeddings and reranking run host-side on local non-generative encoder models per RC-1; the key is configured per deployment, never hard-coded, and never used to host a model) (MODIFIED 2026-07-02 per RC-1; was: “calls out to an external model for embeddings per the architecture-overview ELT subsystem”); and the builtin tenancy/identity core: workspace (the tenant boundary; solo collapses to default), users, agents (tied to user-workspace pairs), authentication (a workspace claim in every token; per-deployment OIDC (OpenID Connect) via RFC 9728; a static dev-token first-run bootstrap), agent sessions, per-plugin permissions, projects. Projects and agents are builtin, not plugins: plugins are scoped per project, so a project can’t itself be a plugin (a host-bootstrap chicken-and-egg). Order: nothing runs without the spine, and every capability family is scoped within workspace + project. Tier: proposed. Provenance: V0 discovery (locked 2026-05-02) + architecture-alignment record (2026-04-27, tenant/substrate rounds); decomposition from the 2026-05-18 product-intake refine.
  • 0.2.0: Task management. Task CRUD, subtasks/parent-id, status lifecycle, project + priority; migration of the prior structured task data. Order: the maintainer-stated first priority after substrate; the operational spine the workspace dogfoods earliest; its project and agent references are satisfied by the builtin substrate. Tier: proposed. Provenance: as 0.1.0.
  • 0.3.0: Dispatch metrics & lifecycle. Dispatch start/event/record/finalize; per-dispatch tokens/duration/cost/tool-uses; the dispatch-event stream; the scope envelope. Order: the maintainer-stated next priority; core to the orchestration workflow. Tier: proposed. Provenance: as 0.1.0.
  • 0.4.0: Skill-run measurement. Tracks runs of a skill (a named, reusable agent capability: a specific dispatch shape, a structured review protocol, or an elicitation loop). Each run is measured: start/end timestamps, per-run consultations / review-rounds / flags tallies, knowledge-extraction capture, and a structured retro. The retro is the formal “review-after” capture in a trust-then-review workflow, where after a run the operator selectively reviews what the agent decided, flags divergences, and records what was learned; the structure makes findings aggregable across runs. Skill-run measurement operates at the substrate level and doesn’t depend on a separate decision to migrate workspace skill definitions into mnemra-core (D8). The measurement substrate works whether skill definitions live in mnemra-core or stay as external files. Order: sibling of dispatch metrics, the same measurement family. Tier: proposed. Provenance: as 0.1.0.
  • 0.5.0: Activity / audit log. The append-only actor/action/target/summary stream. Order: low-complexity, high-value; underpins traceability across every later capability. Tier: proposed. Provenance: as 0.1.0.
  • 0.6.0: Collaboration session friction tracking. A collaboration session is the operator-with-team conversation container (distinct from 0.1.0’s per-MCP-connection agent session, which is the technical auth/state primitive, MCP-protocol-defined). One collaboration session may span many per-MCP-connection agent sessions as the orchestrator dispatches to sibling agents. Friction events surface within a collaboration session along two axes:
    • Event type (the friction kind): clarification (operator needed to ask before acting), revision (operator changed something after delivery), course-correction (operator redirected the approach mid-task).
    • Dimension (the friction axis): scope, Acceptance Criteria (AC), context, routing, priority. Each event row records the (event-type × dimension) tuple plus context. Aggregated over time, the rows surface friction patterns per collaboration session and across sessions, which is the measurement substrate for trust-then-review iteration. Order: completes the measurement/audit triad with dispatch + skill-run + activity. Tier: proposed. Provenance: as 0.1.0.
  • 0.7.0: Repo registry. Repos per project (path / visibility / default-branch / remote). Order: rides on builtin projects; pairs with the structural families. Tier: proposed. Provenance: as 0.1.0.
  • 0.8.0: Relationships / edges. Typed edges (parent / blocks / depends-on / supersedes / dispatched-by). Order: the cross-cutting graph; valuable once tasks and projects exist to link. Tier: proposed. Provenance: as 0.1.0.
  • 0.9.0: Tags / taggings. Cross-cutting taxonomy. Order: light; rides on the entities above. Tier: proposed. Provenance: as 0.1.0.
  • 0.10.0: Dependency-approval state. The approved-package register (the green/yellow/red license-tiering state). Order: self-contained governance state. Tier: proposed. Provenance: as 0.1.0.
  • 0.11.0: Scope-violation log. The append-only scope-denial stream. Order: self-contained, low-complexity. Tier: proposed. Provenance: as 0.1.0.
  • 0.12.0: A further artifact family. Order: a distinct domain, lower coupling to the orchestration core. Tier: proposed. Provenance: as 0.1.0.
  • 0.13.0: An additional capability family. Order: smallest and most isolated of the capability families. Tier: proposed. Provenance: as 0.1.0.
  • 0.14.0: Content-corpus migration. The prior markdown content corpus (the maintained knowledge subdirectories) → stored as files with frontmatter metadata, limited indexing (no full-text/vector; that’s idea D1). Order: placed after the structured-capability families per the maintainer’s tasks/metrics-first priority; flagged as a reorder candidate at the intake-exit gate, since for a context-layer product a fair argument puts the corpus early as core value. Tier: proposed. Provenance: V0 discovery §Migration scope (locked 2026-05-02); decomposition from the 2026-05-18 refine.
  • 1.0.0: Dogfood cutover (public API defined). The maintainer’s workspace runs fully on mnemra-core with zero fallback to the prior tooling, and the agent-facing + storage-substrate contracts are locked. SemVer §5: this is where the public API is defined, the V0/MVP milestone. Order: last in V0 by definition; it’s the milestone gate. Tier: proposed. Provenance: as 0.1.0.

V0.1 (post-1.0.0 immediate roadmap)

The very-next-update phase after MVP cutover: net-new value beyond V0 workspace-fidelity. Each V0.1 entry starts proposed at this product altitude (this brief’s intake locks the phase placement); each entry’s own feature-altitude intake locks its frame+spec before build, promoting it to designed (see Designed §V0.1 for the entries that have reached it: the retrieval cluster’s four plus the extensible reporting engine). Maintainer ruling 2026-05-20: V0 means workspace-replacement (no regression); V0.1 means the core product promise activates, plus operational follow-ups V0 deliberately didn’t promise.

  • 1.1.0: get_context_for(artifact_id) retrieval verb (core product promise). Promoted to designed @ V0.1 / 1.1.0 (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the 1.1.0 reference remains resolvable. Provenance: retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02).

  • Search + indexing activation [D1] (retrieval cluster). Promoted to designed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the D1 reference remains resolvable. Provenance: retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02).

  • First-class graph edges + traversal [D2] (retrieval cluster). Promoted to designed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the D2 reference remains resolvable. Provenance: retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02).

  • Cross-artifact authoritativeness + provenance/use-policy substrate fields [G2/G3] (retrieval cluster). Promoted to designed @ V0.1, retrieval cluster (2026-07-02). See Designed §V0.1 for the live entry; the pointer stays so the G2/G3 reference remains resolvable. Provenance: retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02).

  • 1.2.0: Ongoing ingest pipeline. Watchers, scheduled polls, or webhooks that auto-detect and ingest new content arriving in the brain corpus after V0’s one-shot batch migration (0.14.0). It’s distinct from 0.14.0: 0.14.0 is a one-shot move of the existing corpus; 1.2.0 is a continuous-arrival pipeline. Order: operational follow-up to V0.1’s headline; V0 covers batch only, V0.1 adds continuous ingest. Tier: proposed. Provenance: architecture-overview ELT subsystem (ADR-16, an architecture decision record) + product-intake refine 2026-05-20 (OD-A resolved: distinct from 0.14.0, deferred to V0.1).

  • 1.3.0+ (candidate): Extensible reporting engine. Promoted to designed @ V0.1 / 1.3.0+ (candidate) (2026-07-04). See Designed §V0.1 for the live entry; the pointer stays so the 1.3.0+ reporting-engine reference remains resolvable. Provenance: reporting-engine spec (docs/specs/2026-07-03-reporting-engine.md, locked 2026-07-04; verify verdict passed_with_concerns).

Future V0.1 increments (1.3.0+) land here as the “very-next-update” trigger fires for new capabilities.

Build prerequisites (sequence, unchanged): the V0 increment sequence’s build is gated on three external predecessors: the intent → frame → spec pipeline being complete (it’s being exercised and amended now), then the spec-delta/merge tool and the dispatch CLI being operational. Both prerequisite tools are external components with their own forthcoming briefs and their own independent versions (see the Idea section pointers). This brief references them as build-time dependencies; it doesn’t absorb them into its register. 0.1.0 work begins only after those exist. The prerequisites gate the V0 sequence’s start, not its contents.

Designed

A locked frame + locked spec exists. There’s also a maintainer-ratified exception the designed tier admits on a locked Frame alone: the Frame-park, in two kinds. Spec-deferred is a Frame-park whose Stage-3 spec is a later maintainer pickup; the coordination wedge was admitted this way and has since discharged its deferral, its spec now locked, so it stands as a completed pickup rather than a live example of the kind. Spec-terminal is the strangler migration program, where no Stage-3 spec will ever follow because the per-function bundles carry the code-destined specs (see the V0 subsection below).

There are five tenants. The retrieval cluster: its spec (docs/specs/2026-07-02-retrieval-cluster.md) locked 2026-07-02, promoting its four constituent entries below from proposed. The extensible reporting engine: its spec (docs/specs/2026-07-03-reporting-engine.md) locked 2026-07-04, promoting the 1.3.0+ (candidate) entry below from proposed. The coordination wedge cluster: its Frame (docs/intent/coordination-wedge-frame.md) locked 2026-07-07 and its spec (docs/specs/2026-07-06-coordination-wedge.md) locked 2026-07-07 (companion ADR P-0022 accepted), a completed Frame-park pickup where the deferred Stage-3 spec has landed, so it’s now a full spec-locked designed tenant rather than a Frame-park. The plugin-distribution layer: its spec (docs/specs/2026-07-07-plugin-distribution.md) locked 2026-07-11 (companion ADR P-0023 accepted), born net-new at designed. And the strangler migration program: its Frame (docs/intent/strangler-program-frame.md) locked 2026-07-07 as a terminal Frame-park designed-tier artifact of record, with no spec and none to follow. Stated explicitly: the register doesn’t infer design completion beyond what a locked spec actually covers, or, for a ratified Frame-park entry, beyond what a locked Frame covers.

V0 (pre-1.0.0 cutover substrate)

  • Coordination wedge cluster: actors + claims-as-leases + messaging (the workspace’s first live workload). The coordination plane inside the mnemra-core host. Durable actor identity: each role-instance is one durable actors row at the P-0018 grain (the core-entity manifest); sessions are ephemeral attachments that resolve-or-create the row at start, never minting a duplicate. Mutual-exclusion claims on the duration line as first-class leases: holder, structured resource identifier, TTL (time to live), and stale/takeover/release semantics; acquisition is substrate-enforced atomic, so exactly one live lease per resource can exist and the loser gets a structured refusal. And addressed messaging as rows with queue semantics and a closed disposition state machine (delivered → acknowledged → dispositioned, immutable after send, every consumption recorded). Two agent-visible MCP tools carry the surface, claim and message (actions as closed-enum parameters), inside the single-digit verb budget. The founding message type is merge-request (the merger-lane input contract rendered as schema fields), with a minimal generic handoff (subject + body + artifact refs) as a second type. Residence is the core host subsystem (the P-0002 core-vs-plugin walk); observability is one unified target-tagged tracing stream, with the privileged subset also emitting to the P-0018 audit surface; the availability contract is fail-closed (no local write queue, no split-brain). It runs over zero migrated content by design: the system’s first live workload, defining what “the workspace starts using mnemra” means. Order: migration step 1 (ratified 2026-07-06), sequenced ahead of all content bundles; the first usage. Tier: designed (full spec-locked: a locked Frame and a locked Stage-3 spec; the Frame-park deferral that admitted this entry on a locked Frame alone is now discharged, per the Designed preamble’s completed-pickup framing). Provenance: coordination-wedge intake (docs/intent/coordination-wedge.md, locked 2026-07-06, blob a4931ef85789639f4a5e451a945f43901be17343) + coordination-wedge Frame (docs/intent/coordination-wedge-frame.md, locked 2026-07-07, blob 4d1a8c211b11b984406249beef9e1156c0d7773d) + coordination-wedge spec (docs/specs/2026-07-06-coordination-wedge.md, locked 2026-07-07, blob 81dc71953c9bb0de2b269b4da15ab394aed20f9c), with companion ADR P-0022 (docs/src/adrs/P-0022-coordination-cluster.md, accepted). The Stage-3 spec landing discharges the Frame-park deferral, so the entry now satisfies the full designed validator (a locked frame plus a locked spec). Born net-new at designed: the intake deferred the whole register entry to Frame-merge (open-item 4), so it was never at proposed. No Proposed pointer-stub is retained (nothing references it there, and it’s not a SemVer increment), and no Idea-section pointer is retargeted (it wasn’t promoted from a Deferred D-item). (ADDED 2026-07-07; spec-promoted 2026-07-07.)

  • Strangler migration program: the standing mechanics governing every brain→mnemra cutover (the coordination wedge is migration step 1). The program scopes the multi-year migration of the workspace’s knowledge substrate (the brain/ tree + the puck.db task database) into mnemra as a standing, function-by-function strangler, so each per-function cutover runs as routine small-batch mechanics that reference this program rather than re-litigating sequencing, acceptance, rollback, and availability from scratch. Here’s what it fixes. One migration spine: a dependency partial order (a DAG, a directed acyclic graph) whose every step’s position derives from a named dependency, pinning the one-sentence rule that core/plugin classification governs where a function lives (residence), never when it migrates (sequence). So memory is core yet migrates late, because its dependency chain (render bridge + compaction) gates it; “core first” as a sequence rule is dead. A reusable cutover ritual: statement (explicit, dated; authority transfers here and the old substrate freezes, so there’s no dual-authority window) → migrate + live-row verify → backup (a snapshot with demonstrated restorability, undeletable until the standing daily backup has captured the function) → remove (one home, no stale shadow). Its preconditions are mechanically fail-closed gates (G-verify / G-backup / G-standing-backup: an unconfirmed check is treated as not-satisfied and removal is blocked), and its removal step carries a standing authorization: agent-executed deletion of the old copy without a per-instance human gate, safe precisely because it’s structurally gated on the fail-closed checks rather than merely conditioned on them. The availability ladder the per-cutover hosting hardening (task #1056) gates against: the availability bar rises as each function reaches sole-home, any coordination/content write failure is an immediate observable stop, and there’s no local write queue ever (a queue is split-brain by construction). The complete work-list: all 60 + 1-adjacent census functions dispositioned from a closed six-member set (migrate-with-dependency / build-new / dissolve-into-substrate / retire-with-ritual / dissolves-with-substrate-at-decommission / out-of-scope), the flag-union of 17 rows reconciled against the census’s literal cells and each ruled or routed, the four structural findings each ruled fix-now vs fix-at-cutover. The program constraints every per-function bundle inherits (small-increments operating mode; forward-only, no dual-run; no dual-authority window; drain-then-flip; operator-only-live flips; mechanize-the-removal-gate). And the progress axis: brain-shrinkage (the count of functions at sole-home in mnemra), made queryable rather than narrated via an in-repo statements register (docs/intent/strangler-program-statements.md, its shape locked in the Frame, the file created at the first cutover). Two dispositions were ruled at the Frame-exit gate (2026-07-07). The metrics cluster is plugin (dispatch/skill-run measurement is workflow-primitive data, named in the negative space of the P-0018 core-entity manifest: a fan-out consumer shape, not the fan-in a core promotion needs). And projects is the core fan-in root that every dependent hard-FKs to (a required foreign-key reference), so it precedes tasks (plugin); tasks are the first plugin-shaped migration step and so the honest forcing function for the P-0013 Bucket A component-host build. Order: the program owns the mechanics for migration step 1 (the coordination wedge cluster, above) and every cutover after it; it sequences nothing on its own beyond the spine’s dependency edges. Tier: designed (Frame-park, TERMINAL: unlike a feature cluster whose Stage-3 spec is a later pickup, this program’s Frame-park is terminal. The per-function bundles carry the code-destined specs, and the program never authors one; this Frame is the durable designed-tier artifact of record for the migration program’s mechanics, per the Designed preamble’s exception). Provenance: strangler-program intake (docs/intent/strangler-program.md, locked 2026-07-07, blob 6d58cd29b7e80e595e4492ab396975cbdf7f1de0) + strangler-program Frame (docs/intent/strangler-program-frame.md, locked 2026-07-07, blob 805756411db1bca920c0a87889ec5ce8edf6eb3e); NO spec (Frame-park, terminal: no Stage-3 will ever follow). Born net-new at designed: the intake deferred the register entry to Frame-merge (intake open-item 3), so it was never at proposed. No Proposed pointer-stub is retained (nothing references it there, and it’s not a SemVer increment), and no Idea-section pointer is retargeted (it wasn’t promoted from a Deferred D-item). No program ADR slot (Frame §12: a terminal Frame-park mints none, because there’s no downstream spec-authoring step to fill a program slot, and the Frame is itself the reference every per-function bundle cites; the ADR-slot ledger is left untouched). (ADDED 2026-07-07.)

  • Plugin distribution + package signing: the distribution layer (W2-1). The layer that makes a plugin a distributable unit whose whole-bundle provenance and integrity are established before unpacking. Every plugin ships as one uniform multi-artifact OCI (Open Container Initiative) bundle (N≥1 digest-addressed blobs, the component .wasm always artifact #1, the signed inner TOML manifest as the config descriptor, uncompressed-only at V0). The package signature is the P-0005 Ed25519 root over the domain-separated outer-manifest digest, attached as an OCI 1.1 referrer and verified on fetch under signer-key-pinning (never trust-on-first-use, no unsigned fall-through). Two transports satisfy R-NoExternalHost: an OCI image-layout filesystem for true air-gap, and a self-hosted distribution-API registry for restricted-egress LAN (local area network), both behind one store contract with digest-pinned resolution recomputed over received bytes. The bounds-first verified-fetch pipeline (fetch-within-bounds → verify-package-signature → verify-blob-digests → unpack-within-bounds, fail-closed at every stage) sits behind the locked PackageVerifier seam (the TUF (The Update Framework) adapter’s slot, fires at R-0005-e). The inner [[artifacts]] N≥1 binding complete-mediates every blob at the provenance anchor (P-0003 §Amendment 2026-07-07, strictly superseding the single [component] hash). A hard cutover retires the bare load path with no legacy accept window. And install is a working-state → working-state transition: no failure, crash, or kill point leaves the host’s serving or load-eligible state indeterminate, and residue from a failed attempt is inert (R-0092, the maintainer’s 2026-07-11 spec-exit-gate ruling; update is forward-bound by the same invariant, its flow deferred). Single-root custody exposure is recorded, never silent (accepted risks R-0008 rollback residual / R-0009 single-root / R-0010 build-time dependency confusion; all tripwired). Order: Wave-2 design-lane bundle W2-1 (board order); implementation is a committed-tier pickup, gated by base-pin freshness. Tier: designed (full spec-locked). Provenance: plugin-distribution intake (docs/intent/plugin-distribution.md, locked 2026-07-07, blob 9c8e1577ed345cbcef546ba51d252a0df4db1144) + plugin-distribution Frame (docs/intent/plugin-distribution-frame.md, locked 2026-07-08Z, blob 60c437c5e569eacbf00329e92cae2e7c42cebba6) + plugin-distribution spec (docs/specs/2026-07-07-plugin-distribution.md, locked 2026-07-11, blob 10554ccdd6ae91731086b6fa6cba3de281a4fd49, R-0078 through R-0092 with the R-0082 tombstone), with companion ADR P-0023 (docs/src/adrs/P-0023-plugin-distribution.md, accepted) + the P-0003 [[artifacts]] amendment + the P-0019 DEF-2 disposition (that deferral was pulled deliberately ahead of its third-party tripwire, at single-publisher core: true scope). Born net-new at designed: no Proposed pointer-stub is retained and no Idea-section pointer is retargeted. The Idea-tier “plugin registry/marketplace + signing/distribution as a product surface” umbrella is a distinct, unvalidated product surface and stays where it is; this layer is substrate infrastructure at single-publisher scope, not that product. (ADDED 2026-07-11.)

V0.1 (post-1.0.0 immediate roadmap)

  • 1.1.0: get_context_for(artifact_id) retrieval verb (core product promise). A one-call MCP retrieval of persistent, typed, cross-session context for a given artifact, rather than reconstructing it by hand each session. The headline V0.1 capability: the first net-new value-add over V0’s workspace-fidelity baseline. Order: V0.1’s headline promise; first net-new value over V0. Tier: designed. Provenance: V0 discovery (D3, locked 2026-05-02) + product-intake refine 2026-05-20 (scheduled at V0.1 / 1.1.0) + retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02). Promoted 2026-07-02 (MODIFIED): covered by the retrieval-cluster feature-altitude intake (locked 2026-07-02) as one clustered feature with D1, D2, and G2/G3 below, a single intake/frame/spec pipeline; the frame locked 2026-07-02 and the spec locked 2026-07-02, satisfying the designed validator (a locked frame plus a locked spec).
  • Search + indexing activation [D1] (retrieval cluster). Batch indexing pipeline over the corpus the substrate already holds (per-shape chunking, authored-tree summary nodes, local embeddings, full-text search) plus the agent-facing search verb: hybrid FTS (full-text search) and dense retrieval fused by Reciprocal Rank Fusion with local rerank, budget-shaped. Part of the retrieval cluster (one clustered feature with 1.1.0, D2, G2/G3). Order: rides with 1.1.0; the headline verb needs the index. Tier: designed. Provenance: V0 discovery D1 (locked 2026-05-02); retrieval-cluster intake (locked 2026-07-02), whose lock performed the idea → proposed promotion; retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02) performed the proposed → designed promotion. (ADDED 2026-07-02.)
  • First-class graph edges + traversal [D2] (retrieval cluster). Typed, traversable edges extracted from the authored-but-latent sources (frontmatter relation lists, free-text citations) with provenance discrimination; the 0.8.0 edge-table substrate is what this traversal activates: one superset vocabulary, one traversal path (recursive CTEs, common table expressions, per the storage-substrate decision). Part of the retrieval cluster. Order: as D1. Tier: designed. Provenance: V0 discovery D2 (locked 2026-05-02); retrieval-cluster intake (locked 2026-07-02), whose lock performed the idea → proposed promotion; retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02) performed the proposed → designed promotion. (ADDED 2026-07-02.)
  • Cross-artifact authoritativeness + provenance/use-policy substrate fields [G2/G3] (retrieval cluster). The substrate fields the retrieval envelope reads and serves: trust provenance (authoritative/outdated/background), the policy permissions record (dont-use, model-egress, visibility, tenant-share), freshness handles + decay classes, and decision axes. Part of the retrieval cluster. Order: as D1; the envelope’s substrate. Tier: designed. Provenance: knowledge-object survey (2026-05-15); retrieval-cluster intake (locked 2026-07-02), whose lock performed the idea → proposed promotion; retrieval-cluster spec (docs/specs/2026-07-02-retrieval-cluster.md, locked 2026-07-02) performed the proposed → designed promotion. (ADDED 2026-07-02.)
  • 1.3.0+ (candidate): Extensible reporting engine. One report surface backed by a registry: canonical built-in reports (which ride their V0 capability-family increments as workspace-fidelity content) plus declarative, runtime-added, read-only user reports invoked via MCP (admin-CLI convenience is secondary). Read-only execution is the identity invariant (defense-in-depth, re-derived for the Postgres substrate). Because report queries are user-authored, the guard graduates from operator-mistake to adversary: workspace isolation, the role matrix, and the provenance/policy-envelope predicates must hold on a caller-written query, which is the Frame threat model’s headline boundary. It’s deliberately sequenced after 1.1.0, because the policy-envelope enforcement machinery this surface must honor lands with the retrieval feature. Order: value activates once the measurement families hold data and the envelope machinery exists. Tier: designed. Provenance: reporting-engine intake (locked 2026-07-03) placed the entry at proposed; reporting-engine spec (docs/specs/2026-07-03-reporting-engine.md, locked 2026-07-04) performed the proposed → designed promotion (verify verdict passed_with_concerns). (ADDED 2026-07-04.)

Committed

designed plus a plan, release-bound. Empty. The retrieval cluster and the extensible reporting engine are now designed, but no feature has yet moved designed → committed (no committed-tier plan exists, and no release has a committed date). That’s consistent with the product’s stated posture that a phase commits a date only when work is far enough along. Stated explicitly: the register doesn’t over-claim commitment. An empty committed tier early in a project is the register working, not a gap.

Live

Built and verified in current code/canon.

  • mnemra-core pre-0.1.0 substrate spike. A host instantiates a WebAssembly Component Model plugin over a typed contract, with host-fn round-trips and host-side state persisting across invocations on the wasm32-wasip2 toolchain. Verifiable: the mnemra-core repository (host crate, first plugin crate, contract package; spike commit on main).
  • Landing site. mnemra.dev, Astro on Cloudflare Pages; deployed.
  • GitHub organization. github.com/mnemra, README published.
  • Email waitlist + social presence.
  • Developer-docs scaffolding. mdBook site with an ADR section and template.

Open Decisions (resolve at the intake-exit gate)

Surfaced for the decomposer; not resolved in this draft. Source conflicts, unknowns, and unsettled scope are named, not papered over.

  • APPARATUS-1: confirmed (tracked separately as a register-model amendment task). The canonical product-brief register model (previously four-tier, committed before designed) is mis-ordered and missing proposed for release-commitment semantics. The amendment is: five tiers idea → proposed → designed → committed → live, each validated by a pipeline artifact, with the permanent/ephemeral boundary at designed|committed; plus the spec-is-permanent / plan-is-ephemeral distinction promoted to general workspace canon; plus the multi-repo product-brief-home gap (DEFER-1). Do it now while the structured-delta consumer doesn’t yet exist (zero forward-contract migration; deferring means a contract break later). Tracked as a separate amendment task/ADR, not a mid-run edit.
  • INCR-1: resolved. V0 decomposed into a builtin-substrate-first, one-capability-per-increment staged sequence. Versioning is Semantic Versioning 2.0.0 applied without abuse: each feature increment is a minor bump within 0.y.z initial development (0.1.0 host core → 0.14.0), backward-compatible fixes are patch, the commit is pinned as +build metadata (not a lower-precedence -pre-release), and 1.0.0 is the dogfood-cutover/MVP where the public API is defined (SemVer §5). Applied this round; see the Proposed section, where the per-entry ordering rationale supports cheap reordering at this gate. The {projects, agents}-as-core-plugins question is resolved upstream (builtin substrate; per-project plugin chicken-and-egg). The stale architecture-alignment-record framing is flagged in the maintainer-internal intake record for a separate downstream amendment, not corrected here. The apparatus-relevant residue (the canonical register model expressing staged/incremental delivery) folds into APPARATUS-1, and is no longer an open question for this brief.
  • LIC-1: resolved. Apache-2.0 + future-relicense clause locked 2026-05-20. The mnemra-core repository’s current LICENSE/README (MIT) is corrected in a separate follow-up task. Stronger contributor IP grant; the future-relicense clause preserves the future commercial-managed-tier option.
  • BIPT-1: resolved. Split into two: the committed provenance direction (G2/G3) is an idea-with-provenance entry, and the byte-level provenance-tracing technique is an idea reimplementation-reference entry. No longer an open tiering question.
  • PRV-1: resolved. Decision-name + lock-date confirmed as the provenance-pointer convention (locked 2026-05-20). The pattern is already in use throughout the brief; a public- repo artifact can cite internal-record decisions by name and date without exposing internal paths.
  • DEFER-1: resolved (relocated). Brief moved from the landing-site repository to the mnemra-core repository at docs/src/intent/mnemra-core.md (2026-05-20). The brief lives with the component it scopes (per-repo-first). APPARATUS-1’s broader multi-repo product-brief-home convention question still applies for future multi-repo briefs in other components.
  • AMEND-1: confirmed routed to retrospective. Both drift items in the mnemra-core project context file, (a) the “bare mnemra = mnemra-core” shorthand being wrong at product altitude and (b) the landing-site framework migration listed as “not started” though it shipped, batch into a retrospective doc for corrective action (locked 2026-05-20).
  • T-5: resolved (split). (a) Categorization-via-LLM-API: idea tier, because V0 is workspace-replacement (no auto-categorization today); a net-new value-add candidate for V0.1+ once the use-case shape solidifies. (b) LLM-API-key configuration surface: V0, folded into the 0.1.0 substrate description (mnemra-core calls an LLM for embeddings at V0 per the architecture-overview ELT subsystem; the config surface is required from substrate onward). Locked 2026-05-20.
  • OD-A: resolved. Content-import / ongoing ingest pipeline is distinct from 0.14.0’s one-shot batch migration. Deferred to V0.1 (placed at 1.2.0; see Proposed §V0.1) per maintainer ruling 2026-05-20. V0 covers batch migration only.
  • OD-B: resolved. Permissions model: a separate scoped research dispatch is queued for after intake-exit (non-blocking on this gate). The capability stays idea until research informs its shape; the result feeds the future permissions-model intake. Locked 2026-05-20.
  • T-7: resolved. “Team” == workspace/tenant (aligned; one self-hosted instance per tenant). “Team” is an informal user-grouping inside a workspace, not a distinct layer. The deferred hierarchy is 1-layer (org above the workspace=tenant boundary, when multi-tenancy lands). Locked 2026-05-20.
  • µVM-OQ1..4: confirmed parked. libkrun copyleft-tier acceptance; the GPL process-boundary stance for an appliance; the appliance trip-wire wording; the managed-tier Postgres shape (per-tenant VM ≠ per-tenant Postgres). All deferred-until-trip-wire (streamable-HTTP becoming the active MCP transport), non-blocking. Locked 2026-05-20.
  • Most earlier per-item tier-ambiguities dissolved under the v4 model: items without their own pipeline run are uniformly idea-with-provenance, so no per-item tiering ruling is needed. The model removing those decisions is a model-quality signal.

Changelog

  • 2026-10-16: Disclosure-wording erratum (#3377). Register: MODIFIED the 0.12.0 and 0.13.0 entries to generic capability-family wording under the standing public-surface disclosure ruling. Tier, order rationale and provenance are unchanged. It’s a wording erratum, not a design change.
  • 2026-09-17: Durability amendment approved at the maintainer’s gate (ruling 2026-09-17). Register: ADDED the idea-tier entry for an external Postgres server as the substrate engine. The entry the 2026-09-15 changelog carried as a draft is now a real register entry by this ruling. Hard constraints: MODIFIED the data-location constraint’s container clause. The operator mounts a volume at the configured location and the host can require it; the former “a container image declares a mount point” wording is withdrawn (an image-declared volume isn’t durable, and the image contract is parked in the V0 substrate spec until an image exists). Also ruled at the gate and recorded in the spec rather than here: socket-only peer-authenticated cluster access ratified; the replace-the-executable survival check locked in its bare-binary form; network-backed data directories stay allowed, with the failover residual recorded as accepted.
  • 2026-09-15: Durability amendment (labeled deltas; authored with the V0 substrate spec’s R-0116 and the overview’s Reliability / durability axis, riding the same docs change). Success criteria: ADDED “Durable across restart”: stored context survives a host stop and restart including a hard kill, which is the first place this brief defines what “persistent” means. Hard constraints: ADDED “Data lives outside the executable and its image”: an OS app-data default for a bare binary, a mounted volume for a container, never a temporary directory or a container’s writable layer; an earlier “persisted on the local filesystem” wording is superseded. Register (DRAFT, O2): an idea-tier entry for an external Postgres server as the substrate engine, flagged for the maintainer’s gate rather than locked. Register tiers otherwise unchanged.
  • 2026-07-11: Plugin-distribution Stage-3 spec locked (docs/specs/2026-07-07-plugin-distribution.md, blob 10554ccdd6ae91731086b6fa6cba3de281a4fd49; spec-exit gate accepted 2026-07-11) over the locked Frame (docs/intent/plugin-distribution-frame.md, blob 60c437c5e569eacbf00329e92cae2e7c42cebba6, locked 2026-07-08Z) and intake (docs/intent/plugin-distribution.md, blob 9c8e1577ed345cbcef546ba51d252a0df4db1144, locked 2026-07-07), with companion ADR P-0023 (docs/src/adrs/P-0023-plugin-distribution.md) status accepted, the P-0003 [[artifacts]] §Amendment 2026-07-07, and the P-0019 DEF-2 disposition. Register: a new V0 tenant added, born net-new at designed (full spec-locked: locked frame + locked spec + accepted companion ADR): the plugin-distribution layer (uniform multi-artifact OCI bundle; keyed-in-tree package signature verified on fetch; two R-NoExternalHost transports behind one store contract; the bounds-first PackageVerifier pipeline; the [[artifacts]] complete-mediation binding; hard cutover retiring the bare load path; install atomicity R-0092 per the maintainer’s 2026-07-11 gate ruling, with update forward-bound). Designed preamble updated four → five tenants. No Proposed pointer-stub and no Idea retarget (the registry/marketplace product-surface idea is distinct and unmoved).
  • 2026-07-07: Coordination-wedge Stage-3 spec locked (docs/specs/2026-07-06-coordination-wedge.md, blob 81dc71953c9bb0de2b269b4da15ab394aed20f9c; spec-exit gate accepted 2026-07-07) over the locked Frame (docs/intent/coordination-wedge-frame.md, blob 4d1a8c211b11b984406249beef9e1156c0d7773d, locked 2026-07-07), with companion ADR P-0022 (docs/src/adrs/P-0022-coordination-cluster.md) status accepted. Register: Frame-park deferral discharged. The coordination-wedge V0 tenant, admitted at designed on a locked Frame alone with its Stage-3 spec deliberately deferred to a later maintainer pickup, now carries the spec that deferral promised, so it satisfies the full designed validator (locked frame plus locked spec) and reads as a completed Frame-park pickup, no longer a Frame-park. The V0 tenant entry is rewritten from the Frame-park framing (“NO spec, Stage-3 deferred”) to the full spec-locked record (spec path
    • blob, companion ADR P-0022 accepted; the intake + Frame chain retained), and its trailing marker records the spec-promotion. The Designed preamble is reworded so the two-kinds Frame-park taxonomy (spec-deferred / spec-terminal) is unchanged, the strangler migration program stays the sole live Frame-park exemplar (terminal), and the coordination wedge reads as a completed pickup of the spec-deferred kind rather than its live example, with no third category introduced. In-place within-tier promotion: no new register entry, no Proposed pointer-stub or Idea-section retarget (there were none, since the entry was born net-new at designed), and the tier stays designed. The Layer-2 tier validator (“locked frame + locked spec”) is untouched: the entry now meets it directly, so the named-instance Frame-park exception no longer applies to the wedge.
  • 2026-07-07: Strangler-program Frame locked (docs/intent/strangler-program-frame.md, blob 805756411db1bca920c0a87889ec5ce8edf6eb3e; Frame-exit gate accepted 2026-07-07) over the locked intake (docs/intent/strangler-program.md, blob 6d58cd29b7e80e595e4492ab396975cbdf7f1de0, locked 2026-07-07). Register: net-new designed-tier entry for the strangler migration program, the standing mechanics governing every brain→mnemra cutover (one dependency-derived migration spine with the core≠order rule; the fail-closed cutover ritual with a standing removal authorization; the availability ladder; the complete 60 + 1 work-list dispositioned from a closed six-member set; the program constraints every bundle inherits; the brain-shrinkage progress axis via an in-repo statements register). It’s appended to Designed §V0 (pre-1.0.0 cutover substrate) after the coordination-wedge entry (migration step 1), the tier’s fourth tenant. Frame-park promotion, TERMINAL: the entry lands at designed on a locked Frame alone, and, unlike the coordination wedge’s spec-deferred Frame-park, no Stage-3 spec will ever follow: the per-function bundles carry the code-destined specs, and the program never authors one. The Designed preamble is broadened to name the two kinds of Frame-park exception (spec-deferred/temporary vs spec-terminal). Two dispositions ruled at the Frame-exit gate: the metrics cluster is plugin (P-0018 D-BOUNDARY: dispatch/skill-run measurement is workflow-primitive, named in the core-entity manifest’s negative space; fan-out, not the fan-in a core promotion needs), and the standing removal authorization stands as a locked Frame direction (no governance ADR minted; re-opens on a second program-shaped standing authorization). Born net-new at designed (the intake deferred the whole register entry to Frame-merge per open-item 3, so it was never at proposed): no Proposed pointer-stub is retained and no Idea-section pointer is retargeted. Register-promotion performed at Frame-merge time per the register-promotion convention (the wedge’s precedent; Frame §15), riding the docs PR orchestrator-side. No program ADR slot (Frame §12): a terminal Frame-park mints none, because per-function bundles carry the specs, so no downstream spec-authoring step fills a program slot, and the Frame is itself the reference every per-function bundle cites; the ADR-slot ledger (docs/src/adrs/placeholder-resolution.md) is left untouched. The Layer-2 tier validator (“locked frame + locked spec”) is left unamended: a named instance exception, not a register-model change (the model-level question is APPARATUS-1’s).
  • 2026-07-07: Coordination-wedge Frame locked (docs/intent/coordination-wedge-frame.md, blob 4d1a8c211b11b984406249beef9e1156c0d7773d; Frame-exit gate accepted 2026-07-07) over the locked intake (docs/intent/coordination-wedge.md, blob a4931ef85789639f4a5e451a945f43901be17343, locked 2026-07-06). Register: net-new designed-tier entry for the coordination wedge cluster (durable actor identity, claims-as-leases with TTL/takeover, addressed messaging with a closed disposition state machine, two agent-visible MCP tools, the merge-request founding type; the workspace’s first live workload over zero migrated content, migration step 1 ahead of all content bundles). It’s added under a new Designed §V0 (pre-1.0.0 cutover substrate) subsection, the tier’s third tenant after the retrieval cluster and the reporting engine. Frame-park promotion: the entry lands at designed on a locked Frame alone, its Stage-3 spec deliberately deferred to a later maintainer pickup: a maintainer-ratified exception to the designed validator’s “locked frame + locked spec”, named in the Designed preamble and the entry’s provenance rather than papered over. Born net-new at designed (the intake deferred the whole register entry to Frame-merge per open-item 4, so it was never at proposed): no Proposed pointer-stub is retained (nothing in Proposed references it and it’s not a SemVer increment) and no Idea-section pointer is retargeted (not promoted from a Deferred D-item). Register-promotion performed at Frame-merge time per the register-promotion convention (intake open-item 4; Frame §14.7), riding the docs PR orchestrator-side. The Layer-2 tier validator (“locked frame + locked spec”) is left unamended: this is a named instance exception, not a register-model change (the model-level question is APPARATUS-1’s).
  • 2026-07-04: Reporting-engine spec locked (docs/specs/2026-07-03-reporting-engine.md; verify verdict passed_with_concerns). Register: proposed → designed promotion for the 1.3.0+ (candidate) extensible reporting engine, moved from Proposed §V0.1 into Designed §V0.1 (the tier’s second tenant, after the retrieval cluster), with a pointer-stub retained in Proposed §V0.1. No Idea-section pointer is retargeted: the entry was born at proposed via the 2026-07-03 intake (not promoted from a Deferred D-item), so it never had one. Register-promotion deferred to merge per the f0f570d direct+stubs convention (the design branch’s base predated main’s post-retrieval-cluster register state).
  • 2026-07-02: Retrieval-cluster spec locked (docs/specs/2026-07-02-retrieval-cluster.md). Register: proposed → designed promotion for the four clustered entries: 1.1.0 (get_context_for retrieval verb), D1 (search + indexing), D2 (graph edges + traversal), and G2/G3 (authoritativeness + provenance/use-policy substrate fields). All four moved from Proposed §V0.1 into a new Designed §V0.1 subsection (the tier’s first tenant), each with a pointer-stub retained in Proposed §V0.1 and the corresponding Idea-section pointers (D1, D2, D3, G2/G3) retargeted from “See Proposed §V0.1” to “See Designed §V0.1.”
  • 2026-07-02: Retrieval-cluster riders (labeled deltas; authored with the retrieval-cluster Stage-3 spec, riding that cluster’s docs change). RC-1 model-hosting amendment (retrieval-cluster intake, locked 2026-07-02): every falsified canonical copy reconciled in the same change (single-source discipline). MODIFIED the Non-goals model clause (“never hosts one” → MUST NOT host a generative LLM; local non-generative inference (embedding, reranking) permitted host-side); MODIFIED the Hard-constraints model-hosting clause to match; MODIFIED the 0.1.0 substrate entry’s external-embedding framing (embeddings/reranking now local non-generative; the LLM-API-key surface serves the generative call-outs). The architecture-overview ELT external-embedding framing is the named lagging copy, reconciled in the same change. Register: idea → proposed promotions performed by the retrieval-cluster intake lock for D1 (search + indexing), D2 (graph edges + traversal, noting the 0.8.0 edge-table substrate as what its traversal activates), and G2/G3 (authoritativeness + provenance/use-policy substrate fields), all added as live Proposed §V0.1 entries with idea-tier pointers retained; 1.1.0 re-confirmed as the cluster’s headline entry (tier stays proposed until the spec locks). ADDED idea-tier entry: per-user identity machinery (frame pre-gate walk item 9). Hard constraints: ADDED accessibility as a standing product requirement binding on human-facing UI/docs surfaces (frame pre-gate walk item 13: routed here, not faked into the MCP-verb cluster).
  • 2026-05-20: Intake-exit gate confirmed (Stage 1 lock). All open decisions resolved: LIC-1 (Apache-2.0 + future-relicense locked; mnemra-core repo LICENSE/README correction is a follow-up task); T-5 split (categorization-via-LLM-API → idea; LLM-API-key config surface → V0 substrate, folded into 0.1.0); T-7 (team == workspace/tenant; 1-layer deferred hierarchy); OD-B (permissions-model research queued for separate dispatch, non-blocking); PRV-1 (decision-name + lock-date provenance form confirmed); AMEND-1 (project-context-file drift routed to retrospective); DEFER-1 (brief-home trip-wire wording confirmed); µVM-OQ1..4 (all confirmed parked until streamable-HTTP active); APPARATUS-1 (confirmed tracked separately, no mid-brief absorption); alignment-doc framing flag confirmed as a separate downstream amendment candidate. Brief relocated from mnemra.dev/docs/intent/mnemra.md to mnemra-core/docs/src/intent/mnemra-core.md. The brief travels with the component it scopes (per-repo-first); DEFER-1 resolves to relocation rather than parking. Hard constraints updated for the license lock; 0.1.0 substrate updated for the LLM-API-key config surface. Two suppressed-r2 tweaks applied (provenance line “scheduled at” instead of “committed to”; changelog vocabulary tightened). Intake-exit gate (Stage 1d, human touchpoint 1) is closed; brief enters lock state. Stage 2 (Frame) is the next pipeline stage when re-engaged.
  • 2026-05-20: Intake review pass reconciled (external review-mode pass, six findings, all resolved). Brief retitled “Mnemra Core”, a focus correction: this brief is mnemra-core’s product intent and roadmap; sibling components (dispatch CLI, spec-delta/merge tool, markdown review/annotation tool) are external with their own forthcoming briefs and their own independent versions. No-meta-version decision recorded for mnemra-as-a-whole. F1 resolved: V0/V0.1 made explicit as marketing-tier labels with 1.0.0/1.1.0+ SemVer corollaries; D3 (get_context_for) promoted from idea to proposed @ 1.1.0; new Proposed §V0.1 (post-1.0.0 immediate roadmap) added with 1.1.0 retrieval verb and 1.2.0 ongoing-ingest entries. F2: retro defined at intent level (the “review-after” capture in a trust-then-review workflow). F3a: 0.6.0 renamed to “Collaboration session friction tracking”, which disambiguates the operator-with-team layer from 0.1.0’s per-MCP-connection agent session (MCP-protocol-defined); intent-level definitions added for event-type 3-tuple and dimension 5-tuple. F3b: “AC” expanded to “Acceptance Criteria (AC)” on first use. F4: 0.4.0 “skill” defined at intent level + clarified that skill-run measurement does not depend on D8 migration. F5: pre-resolution V0.01 label retired (Live tier entry renamed to “pre-0.1.0 substrate spike”). F6 / OD-A resolved: ongoing-ingest pipeline distinct from 0.14.0, placed at V0.1 / 1.2.0. dispatch CLI + spec-delta/merge tool Idea entries reframed: external components (operationally required before mnemra-core V0 build, but live in their own repositories / briefs / versions), not items in this brief’s register. Build prerequisites paragraph updated accordingly.
  • 2026-05-18: V0 remodeled from a single monolithic proposed entry into a builtin-substrate-first, one-capability-per-increment staged sequence (0.1.0 host core → 0.14.0, then 1.0.0 cutover), each increment its own proposed entry. Versioning resolved to Semantic Versioning 2.0.0 applied without abuse (feature = minor within 0.y.z; fix = patch; commit = +build metadata, not -pre-release; 1.0.0 = public API defined = the dogfood-cutover/MVP, SemVer §5). Substrate boundary corrected against the architecture-alignment record: workspace/users/auth/session/perms/projects/agents are builtin (projects/agents are not plugins, a per-project plugin chicken-and-egg). Resolves INCR-1. Empty designed/committed tiers preserved. Canonical-model residue folded into APPARATUS-1; the stale alignment-record core-plugin framing flagged in the maintainer-internal intake record for separate amendment.
  • 2026-05-18: Re-tiered to the v4 five-tier model (idea → proposed → designed → committed → live, pipeline-artifact validators, permanent/ephemeral boundary) across six refine rounds with the decomposer. This brief is the forcing instance for the canonical register-model amendment (APPARATUS-1). Honest state recorded: committed and designed are empty (no locked spec for any feature; no committed release date). The register declining to over-claim is the mirror of the under-capture gap it remediates. Elicited in-head intent folded in (the prior-tooling capability families, MCP-server-as- V0-deliverable, deliberate single-use-case focus, tenant-hierarchy deferral + invariant, sibling-tool-as-plugin entries, microVM hosting posture). Scope: whole-product intent + roadmap; commercial and go-to-market strategy held in a separate internal record by deliberate seam.
  • 2026-05-18: Initial draft. Stage 1 (Intake) of a product-altitude structured product-intent authoring pass. Home and scope set by the decomposer across the intake conversation. (Superseded by the re-tier above; retained per decision-space preservation.)

Frame — Mnemra Core

Date: 2026-05-22 · Status: draft (Stage 2 of /brief) · Altitude: component

Format note: this is the Stage 2 (Frame) output of the /brief pipeline. It sits between the locked product brief (Stage 1, Intent) and the per-feature specs (Stage 3). The Frame’s job is to translate the product intent’s purpose and hard constraints into an architectural shape: system boundary, component map, the key cross-cutting decisions, and the open ADR-shaped questions the spec stage will need to lock. The Frame refines the brief; it doesn’t contradict it. Where a tension surfaces between Frame and brief, the Frame body records the tension explicitly and flags it for resolution rather than silently choosing.

Source-of-truth artifacts (this Frame, the architecture overview, and ADRs) are agent-primary per the workspace-wide agent-primary-source-artifacts decision (locked 2026-05-11). Human views are derivative.

Provenance

ArtifactReference
Locked product brief (Stage 1, intake-exit gated)Product Brief: Mnemra Core, locked 2026-05-20
V0 architecture discovery (high-stakes, zero-new-finding stopping rule)“V0 discovery” decision record, locked 2026-05-02
V0 architecture constraints (high-stakes; constraint inventory, QA tree, DFD, threat scaffold)“V0 constraints” decision record, draft 2026-05-03, partially superseded by INCR-1 resolution in the brief (see Framing corrections below)
Architecture alignment mental model (round-6)“Architecture alignment R6” decision record, agreed 2026-04-27
Substrate shape exploration (pre-discovery, background only)“Substrate shape exploration” exploration note, 2026-05-02
Architecture overview portArchitecture overview, a companion artifact, ports constraint inventory + QA utility tree + DFD + threat scaffold
Project defaults (G-* baseline)Project Defaults

This Frame reconciles every architectural claim against the locked brief’s Hard constraints and the staged-increment sequence (0.1.0 host core through 1.0.0 dogfood cutover) it locked at intake-exit (2026-05-20).

Stage 2a — Elicitation input record

This section records the maintainer’s architectural directions that anchored Stage 2b synthesis. Stage 2a was run retroactively against this Frame on 2026-05-23. The Frame-exit gate ran on the 2026-05-22 synthesized output (the result of the original lock under the warm-start two-touchpoint shape), returned a Revise verdict, and the four architectural directions below were locked through a Stage 2a-shaped walkthrough against the Warden Stage 2 code-and-security review’s findings. The directions feed every revision in this Frame. Later Spec-stage ADRs anchor on these slot descriptions, not on the original Warden findings.

Origin: 2026-05-23 G-0028 cold-start amendment (calibration phase, N=5 Frame-exit-cohort trip-wire). Mnemra-core is the first cold-start exercise of the new shape.

DirectionWarden finding addressedOne-liner
Split {{P-SigningKeyCustody}} into Tier-A [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (V0 build-host-on-disk for dogfood + multi-deployment trip-wire) and Tier-C {{P-SigningKeyCustodyHardening}} (HSM, runtime-fetch, never-on-node)H1V0 ships signed core: true plugins under a stated-and-tripwire’d custody decision rather than under a deferred one. Per P-Defer (defer mechanism choice until evidence forces it).
Add Tier-A [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md) with typed WorkspaceCtx parameter binding at the host-fn boundary as the conservative lead, with storage-layer query rewriter and per-host-fn workspace_id parameter validation as open variantsH2The V0 enforcement layer for workspace isolation is named at Frame altitude; RLS at V0.1+ is the substrate-layer hardening of an enforcement that is already load-bearing at V0. Per P-SecurityLayered (each layer is independently load-bearing).
Rename Tier-C {{P-PluginPoolMemory}} to [P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) and promote to Tier A; V0 turns on Wasmtime fuel + epoch-interruption + memory ceiling + table/instance limitsM3The plugin-sandbox DoS-containment outcomes the Frame commits to (kill-and-replace on infinite-loop, no single-process-wide DoS via plugin) require the mechanism named at Frame altitude. Per P-StackDiscipline (use the stack’s own knobs rather than building new ones).
Split {{P-RLSAdminToken}} into Tier-A [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) (opaque-vs-claim-carrying token structure + workspace-claim binding mechanism) and Tier-A [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (role model + permission shape, downstream of [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md))M4Token shape gates security architecture and belongs at Frame altitude; role + permission is mechanism downstream of shape.

The four directions above anchored revisions H1, H2, M3, and M4. Three additional Warden Mediums (M1 trust-boundary reconciliation, M2 DFD-builtin coverage, M5 core-plugin partition forward-reference) were absorbed as mechanical revisions without further maintainer input. Their fixes are scoped tightly to Warden’s spec.

Framing corrections

The Frame inherits work from artifacts that predate the brief’s intake-exit lock. Three framings the older inputs carried are stale and corrected here. Each correction cites the brief section that authorizes it.

Correction 1 — projects and agents are builtin, not plugins

Older framing. The constraints strawman draft (2026-05-03) drew the data-flow diagram with P-core-plugin-projects and P-core-plugin-agents as subgraph nodes inside the WASM TB-plugin-sandbox trust boundary, and the alignment record (2026-04-27, round 2) framed core identity as core: true plugins.

Corrected framing. The brief’s 0.1.0 substrate description (Proposed tier, locked 2026-05-20) makes projects and agents builtin components of the host, not plugins:

Projects and agents are builtin, not plugins: plugins are scoped per project, so a project cannot itself be a plugin (a host bootstrap chicken-and-egg).

The plugin model (also locked in Hard constraints) is this. WebAssembly Component Model modules hosted in-process via Wasmtime, with IO-free plugin core logic; all plugin IO MUST be mediated by host-provided functions; plugins are leaves with no sideways linkage; cross-plugin calls are host-mediated. That model doesn’t accommodate identity-bearing components. By construction they sit above the plugin boundary.

Why the change. Per-project plugin scoping makes “projects” a plugin a chicken-and-egg bootstrap problem. The brief’s INCR-1 resolution (locked 2026-05-20) records the upstream resolution: builtin substrate first. The Frame surfaces the consequence on the system boundary. The DFD nodes for projects and agents move out of the plugin sandbox into the host.

Correction 2 — “stdio MCP wrappers around external CLIs” is not the plugin shape

Older framing. A class of MCP-server tooling models plugins as stdio wrappers spawning external CLI processes (an external-process-per-tool pattern that the project context describes as the framing to reject).

Corrected framing. Plugins are WebAssembly Component Model modules loaded in-process by Wasmtime, communicating with the host via WIT-defined host functions. This shapes downstream decisions:

  • Core logic is IO-free. Plugin Rust crates declare no std::fs, no std::process, no stdin/stdout. Inputs and outputs are structs over the WIT contract.
  • IO is host-provided. A plugin declares what IO categories it needs (file reads, network, clock, state); the host implements them.
  • A native CLI binary is a separate frontend. A tool can ship both a native CLI (workspace-era ergonomics) and a WASM plugin (mnemra-era), sharing an IO-free core crate. The CLI wires native IO; the plugin wires host-fn IO.

The “stdio-wrapper” shape doesn’t port to mnemra. The Frame designs for IO-free core plus thin host-fn adapters from day one.

Correction 3 — V0 is a staged increment sequence, not a monolithic release

Older framing. The constraints strawman draft (2026-05-03) treated V0 as a single monolithic deliverable; some constraint phrasing assumed a one-shot cutover.

Corrected framing. The brief’s INCR-1 resolution (locked 2026-05-20) decomposes V0 into a builtin-substrate-first, one-capability-per-increment staged sequence:

SemVerCapability familyBrief reference
0.1.0Builtin substrate + host core (Postgres + extensions; host-fn ABI; MCP server skeleton; admin CLI; observability minimum; LLM-API-key config; tenancy/identity core)Proposed tier
0.2.0Task managementProposed tier
0.3.0Dispatch metrics & lifecycleProposed tier
0.4.0Skill-run measurementProposed tier
0.5.0Activity / audit logProposed tier
0.6.0Collaboration session friction trackingProposed tier
0.7.0Repo registryProposed tier
0.8.0Relationships / edgesProposed tier
0.9.0Tags / taggingsProposed tier
0.10.0Dependency-approval stateProposed tier
0.11.0Scope-violation logProposed tier
0.12.0A further artifact familyProposed tier
0.13.0An additional capability familyProposed tier
0.14.0Content-corpus migrationProposed tier
1.0.0Dogfood cutover (public API defined), the V0 milestoneProposed tier

The Frame’s component map (below) reconciles to this sequence. Capability families that land in distinct increments share the substrate 0.1.0 provides; each downstream increment adds verbs to the MCP server skeleton without changing the host-fn ABI’s shape (the ABI is pre-1.0 within the 0.y.z band per SemVer §4: backward-compatible additions are minor bumps, breaking changes accumulated for 1.0.0).

System boundary

What is in mnemra-core

Mnemra-core is the single-process server binary that ships the substrate, the host, the plugin runtime, and the builtin components. Per the brief’s Hard constraints:

  • The agent-facing surface is MCP-native (MCP specification 2025-06-18). Transport is stdio at V0; streamable-HTTP is a later-version activation. (Amended 2026-10-25, #4249, approved 2026-10-29 (#4249 activity 9183): the target revision is MCP specification 2025-11-25, and the host serves exactly the released 2025-06-18 and 2025-11-25. See “MCP transport” below.)
  • The substrate is a single-process Postgres instance with pgvector (bundled with the embedded engine); TimescaleDB is demoted off the V0 stack (P-0010 D8).
  • Plugins are WebAssembly Component Model modules hosted in-process via Wasmtime.
  • Deployment posture is self-hosted-first, single-binary. The system MUST NOT host a language model; it calls out to an external one.

The “single-binary” constraint binds the server, not the deployment packaging. An immutable image or appliance is a valid packaging shape (per brief Hard constraints). Native compile-time asset embedding isn’t used (project default G-0002: assets are served at runtime, with a packaging-time copy into the deployment image).

What is adjacent to mnemra-core (referenced, not absorbed)

The brief explicitly carves out four adjacent components that the Frame must name but not absorb into mnemra-core’s component map:

Adjacent componentRelationship to mnemra-core
The dispatch CLI (external component, sibling repository)Build-time dependency: gates the start of the 0.1.0 build sequence (consumes the intent → frame → spec pipeline output); later runs as a mnemra plugin (a native CLI and a WASM plugin sharing an IO-free core)
The spec-delta/merge tool (external component, sibling repository)Build-time dependency: the structured-delta consumer this brief’s living-document format forward-contracts with; later runs as a mnemra plugin
The markdown review/annotation tool (sibling product, tentative)Hosted under the mnemra umbrella when published; relationship to mnemra-core is downstream, not absorbed
The landing site (mnemra.dev)Separate repository; not a runtime component of mnemra-core. Marketing-tier dates appearing on the landing MUST NOT weight architectural tradeoff analysis (brief Hard constraints)

The workspace tooling that mnemra-core’s 1.0.0 cutover replaces (the prior structured task store plus the prior markdown content corpus) is the migration source for the 0.2.0 through 0.14.0 increments. It isn’t a runtime adjacency of the running mnemra-core server; it’s one-shot import scope.

Trust boundaries

The Frame inherits eight steady-state trust boundaries from the constraints draft (corrected per Framing correction 1; the predecessor’s TB-fs-source and TB-fs-backup are present in the architecture overview’s data-flow diagram but are migration-and- backup-scoped and not part of the steady-state trust topology):

BoundaryWhat it containsWhat crosses it
TB-agent-runtimeMCP-client agents (separate processes hosting MCP clients)The MCP transport (stdio at V0; streamable-HTTP V0.1+)
TB-humanThe operator invoking the admin CLIThe admin CLI’s local IPC to the running mnemra-core server, or a direct admin token over MCP
TB-mnemra-hostThe mnemra-core server process itselfCrosses MCP transport, admin CLI IPC, Postgres connection, filesystem secrets reads
TB-plugin-sandboxThe Wasmtime sandbox running plugin codeAll cross-boundary calls are host-fn-mediated; plugin core is IO-free
TB-postgresThe Postgres process (Amended 2026-10-19 r2, #4018: retyped in place as the operator-run PostgreSQL instance, the operator’s zone, which may hold other principals; P-0010 §Amendment 2026-10-19)SQL connection from mnemra-core host; no agent or plugin code reaches Postgres directly (r2: two credentials. The serving role covers host-fns, the instance check and check-db; the owner role covers mnemra init only. Both connect over peer-authenticated sockets with a peer-uid check, or over verify-full TLS. The operator’s own setup-SQL DDL crosses inbound. The overview’s TB table is canonical.)
TB-fs-secretsFilesystem-stored secrets (mode 600)Admin token and (per the open ADR slot for signing-key custody) plugin-signing key material; read by host code only
TB-build-pipelineConceptual, the signing authority at build timeSigned plugin artifacts are what crosses into runtime; runtime sees signatures, not the key
TB-external-llmThe external LLM provider hosting embeddings (out-of-deployment)Per-embedding-batch HTTPS call from host functions; the LLM-API-key configuration surface (0.1.0) and a hostname allowlist gate the egress

The host trust boundary (TB-mnemra-host) is where policy enforcement happens. Plugins execute inside TB-plugin-sandbox and can’t reach Postgres, the network, or the filesystem directly; every IO call traverses a host function.

Canonical TB enumeration. The architecture overview (overview) is the canonical source for the trust-boundary set, because the data-flow diagram lives there and the TB table sits adjacent to it. This Frame’s table is the steady-state subset used in Frame-altitude prose; the overview’s nine-row TB table additionally carries the two migration-and-backup-scoped boundaries (TB-fs-source, TB-fs-backup) plus the steady-state set above. When the two tables disagree, the overview wins.

Component map

The six responsibility buckets are (1) memory substrate, (2) inbound protocol surfaces, (3) plugin runtime, (4) plugin-facing host functions, (5) outbound integrations, and (6) cross-cutting. They map naturally onto the brief’s 0.1.0 substrate description. Each bucket is a module surface inside the host process, not a microservice.

1. Memory substrate

The content and projection layer the host owns directly.

  • Storage substrate. PostgreSQL ratified on merits, behind an engine-agnostic swappable Storage trait (one implementation), per P-0010 D1 + D5. V0 engine: embedded Postgres (postgresql_embedded + bundled pgvector for V0.1+ vector retrieval), shipping with the single binary. (Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800): the V0 engine becomes a separate, operator-run PostgreSQL instance reached by connection configuration, per P-0010 §Amendment 2026-10-19. The host verifies its requirements on the instance before serving (spec requirements R-0117 through R-0121; see R-codes).) TimescaleDB is demoted off the V0 stack (D8); the V0 timeseries shape is plain timestamped Postgres tables, with TimescaleDB held behind a latency/storage trip-wire. The storage-shape model is the alignment-doc round-4 four-shape model: content / timeseries / log / state-config. It was re-derived 2026-06-09 (E1 dispositioned = re-derive now): only content and state-config are persisted in-app Postgres shapes; the former timeseries and log shapes are observability emission surfaces, not in-app storage at V0 (telemetry is emitted, not stored; see the observability baseline).
  • Projections. Materialized read-side derivatives over content. Refresh strategy and dependency tracking is a Frame-level open slot; see the open ADR list below.
  • Indexing pipelines. Content arrives, projections update reactively. The detailed refresh-graph is a per-ADR concern.
  • Ingest. V0 covers one-shot batch migration of the prior content corpus (brief 0.14.0); ongoing-ingest (watchers, scheduled polls, webhooks) is brief V0.1 scope (1.2.0).

2. Inbound protocol surfaces

  • MCP server. Single MCP server with namespaced plugin verbs (each plugin extends the catalog under a namespace prefix; plugins aren’t separate MCP servers). Stdio transport at V0; streamable-HTTP transport is a V0.1+ activation.
  • Admin CLI. Schema-driven dynamic subcommands generated from plugin manifests at startup. Per the brief, the admin CLI handles destructive and control-plane operations only; agent-facing CRUD is on MCP. An MCP server is a V0 deliverable (brief intent-clarity).

3. Plugin runtime

Wasmtime-hosted WebAssembly Component Model modules.

  • Lifecycle. Plugin pool per plugin; instances stateless with respect to tenant (every call carries the workspace-scoping key); failure containment via host-managed restart.
  • Sandbox config. Plugins receive only the host-fn surface their manifest declares; no ambient network or filesystem authority. Wasmtime fuel and epoch-interruption are ON at V0; ceiling values (fuel budget, epoch-interruption deadline, per-instance memory ceiling, table/instance limits) are slotted in [P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) (Tier A).
  • Manifest validation. Plugin manifests declare content_types (host-owned tables the plugin writes into via host-fns), state_scopes (small KV state the plugin owns), and the host-fn surface the plugin needs. core: true plugins ship signed by the mnemra root authority and uninstall is structurally blocked. The manifest schema and the host-fn ABI surface are open ADR slots (see below). The capability-family increments 0.2.0 through 0.14.0 are partitioned between additional builtins and core: true plugins; [P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md) (Tier A) determines the partition. The signed-and-non- uninstallable invariant binds whichever increments are partitioned as plugins.
  • Signing. Plugin signature verification; the V0 custody decision lives at [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (Tier A), the minimum-viable build-host-on-disk for dogfood, with a multi-deployment trip-wire to {{P-SigningKeyCustodyHardening}} (Tier C).

4. Plugin-facing host functions

The host-fn ABI is the contract plugins write against. The following surface was established during the architectural alignment walk and is enumerated here for self-containment:

  • LLM handoff (MCP sampling: the plugin asks; the agent’s MCP client runs the completion).
  • Content emit and query (universal artifact CRUD at V0; aspect-aware verbs are an open evolution path, see open ADR slot for storage layout).
  • Projection registration / read.
  • Secrets / keyring access (per-plugin permissions).
  • HTTP fetch (declared per-plugin; subject to manifest-declared permission).
  • Logging and metrics emission.

The ABI is pre-1.0 within 0.y.z; per-host-fn stability marks (@stable / @unstable) are the discipline mechanism.

5. Outbound integrations

  • External LLM provider. mnemra-core calls out to an external model for embeddings via the embedding-batch pathway (the Extract-Load-Transform pipeline that routes artifact content through host functions to the external provider and writes resulting vectors into the projection substrate). The LLM-API-key configuration surface for this pathway is folded into 0.1.0 per the brief’s T-5 resolution. The detailed pipeline shape (batching strategy, retry, provider-level hostname allowlist) is a Spec-stage concern; the Frame names only the pathway’s existence and its trust-boundary crossing (DF-embed-call to TB-external-llm in the companion overview). The system MUST NOT host a language model (brief Hard constraints).
  • Federated MCP servers. Mnemra-as-MCP-client to upstream MCP servers (re-exposing their tools under the mnemra namespace) is forward-context, not V0 scope.
  • Filesystem and HTTP. Host-fn-mediated; plugins can’t reach these directly.

6. Cross-cutting

  • Security / permissions / auth. Mnemra is Resource Server only (no authorization-server role at V0). Per-deployment OIDC AS via RFC 9728 protected-resource-metadata; a static admin token bootstrap path for first-run and solo deployments (token shape at [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md), Tier A). The workspace claim is structural in every token; the V0 enforcement mechanism for workspace isolation while RLS policy enforcement is deferred lives at [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md) (Tier A).
  • Observability / metrics. Per-verb metrics, structured logs, a health endpoint, all emitted (stdout structured logs + OTel metrics/events + health-endpoint-first), storage-independently from the bare shell. Re-derived 2026-06-09 (E1 dispositioned) and re-altituded out of the project-ADR layer: observability is a theory trait plus chassis mechanism, not a per-project ADR. The generation decisions live in the observability baseline in the companion overview, and the original observability ADR P-0004 is deprecated (no successor ADR). The observability storage backend is deferred behind the generation⊥storage separation (option set plus named tripwire); there’s no in-app observability store at V0. Observability ships from 0.1.0, per the workspace-wide observability principle: ship instrumented before first user-touch.
  • Configuration. Per-deployment configuration surface; runtime configuration via state-shape storage.
  • Agent sessions. Per-MCP-connection technical primitive (MCP-protocol-defined), distinct from the brief’s collaboration-session concept at 0.6.0.
  • Saga coordination. Not V0; designed-for as a host-service shape when a first real cross-plugin atomicity need lands. Plugins are leaves; the day-1 contract is “no cross-plugin atomicity, ever; design for partial failure.”

Builtin components inside the host

Per Framing correction 1, the following are builtin to the host process (not plugins):

  • Workspace (tenant boundary; solo collapses to default)
  • Users and Agents (agents tied to user-workspace pairs)
  • Authentication (workspace claim in every token; per-deployment OIDC; static dev-token first-run bootstrap)
  • Agent sessions (per-MCP-connection)
  • Per-plugin permissions
  • Projects

These compose with the MCP server, the plugin runtime, and the host functions to provide the substrate every capability-family increment (0.2.0 onward) rides on. They aren’t absorbed into the “plugins” surface; per the brief, plugins are scoped per project, so projects-as-plugins is a circular bootstrap.

Key cross-cutting decisions

The Frame inherits these decisions from the locked brief and from the alignment record’s already-locked agreements. Each is a constraint the Spec stage operates within.

Authentication and authorization

  • Mnemra is Resource Server only. No authorization-server role at V0.
  • OIDC per deployment. Each self-hosted deployment configures its own OIDC AS; mnemra-core advertises the configured AS via RFC 9728 protected-resource-metadata.
  • Static admin token at V0. Bootstrap path for first-run and solo deployments; held in ~/.config/mnemra/token mode 600 (per the constraints draft’s filesystem secrets posture). The token’s structure (opaque-with-server-side-lookup versus claim-carrying signed) is the Frame-altitude decision at [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) (Tier A); the role-and-permission shape downstream of that decision sits at [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (Tier A).
  • Workspace claim is structural. Every token carries a workspace claim; the host scopes storage by it. How the workspace claim is bound to the token (host-side lookup against a server-side mapping table, or a claim-carrying cryptographic signature) is the [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) decision.
  • External authorization server integration (federated authorization) is brief V0.1+ scope.

Multi-tenancy

  • Tenancy invariant. The workspace_id scoping key is structural from V0: NOT NULL on every artifact table, indexed, explicitly passed, forward-compatible without migration (brief Hard constraints).
  • RLS column-shape at V0. Postgres Row-Level Security column infrastructure ships at V0; policy enforcement activation is brief V0.1+ scope (the brief’s open idea entry for row-level-security policy enforcement). The V0 enforcement mechanism is named at [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md) (Tier A). RLS at V0.1+ is the substrate-layer hardening of an enforcement that is already load-bearing at V0 via an application-layer mechanism (per P-SecurityLayered, each layer is independently load-bearing).
  • Tenant unit is workspace. Solo dogfooding collapses to one default workspace.
  • Tenant hierarchy (org and layers above the workspace=tenant boundary) is brief idea-tier deferred; safe to defer because the scoping key is structural.

Plugin runtime

  • WASM Component Model + Wasmtime + WIT-defined host functions (brief Hard constraints; Framing correction 2).
  • Plugins are leaves. No sideways linkage between plugins; cross-plugin calls are host-mediated.
  • Plugin instance pool from V0. A single mutex breaks under multi-tenant load; pool size 3 to 5 per plugin at V0, adaptive sizing is V0.1+ work.
  • core: true plugins signed by mnemra root and structurally non-uninstallable. Distribution at V0 is build-time-embedded. V0 custody decision at [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (Tier A); hardening decision at {{P-SigningKeyCustodyHardening}} (Tier C). The set of 0.2.0 through 0.14.0 capability families that are core: true plugins (versus additional builtins) is named at [P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md) (Tier A).

Storage shape

Reframed 2026-06-08 (substrate re-opened on merits, P-0010-storage-substrate-engine). The original Frame treated the storage substrate as a hard-locked brief carry-forward with no substrate ADR slot. A storage-engine evaluation (ratified 2026-06-07) re-opened it on merits: PostgreSQL is ratified on merits (the only license-clean, capable, and mature contender after a license gate), behind an engine-agnostic, swappable Storage trait with Postgres as the only implementation. This reverses the prior “Postgres-natural / no-swap” treatment. The substrate is now a decided artifact (P-0010), not an unexamined constraint. The points below are updated to that decision; the four-shape model and the layout fork are unchanged in substance.

  • PostgreSQL ratified on merits as the storage substrate, behind an engine-agnostic swappable Storage trait (one implementation), per P-0010 D1 + D5. The V0 engine is embedded Postgres (postgresql_embedded + bundled pgvector), shipping with the single self-hosted binary, not an operator-provisioned external Postgres server. (Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800). SUPERSEDED: the V0 engine is a separate, vanilla PostgreSQL instance the operator installs and runs, with pgvector installed by the operator and verified by the host, reached by connection configuration (P-0010 §Amendment 2026-10-19, DE1). The host owns no cluster. It does no download, runs no initdb/pg_ctl, holds no data directory and issues no CREATE EXTENSION. The 2026-09-15 ruling that kept the external server a future engine is superseded on new evidence and recorded in P-0010 as the rejected alternative, with the reason it lost.)
  • V0 stack is A1-clean (P-0010 D2): pgvector HNSW + native FTS + recursive CTEs + JSONB. Extensions beyond pgvector are adopted only on named trip-wires (keyword/BM25-fidelity → D3; graph/AGE → D4; time-series/TimescaleDB → D8).
  • Storage shapes at V0: content + state-config (persisted); observability is emitted, not stored in-app. The content shape is pgvector-ready tables and state-config is state KV tables, the two persisted Postgres shapes. The former timeseries and log shapes are observability emission surfaces (the observability baseline, re-derived 2026-06-09; E1 dispositioned = re-derive now): the server emits structured logs to stdout and OTel metrics/events; where telemetry lands is the operator’s choice behind the generation⊥storage separation, deferred and not in the binary at V0. The content-substrate’s own time-series tables (if any beyond observability) are plain timestamped Postgres tables (P-0010 D8 demotes TimescaleDB off the V0 stack to a latency/storage trip-wire).
  • Content-first with CQRS-real projections. Mutations write content; projections rebuild reactively from content; reads hit projections.
  • Durable across restart, at an operator-configured data location. Stored content survives a host stop and restart, including a hard kill of the host or of the embedded engine (brief Success criteria “Durable across restart”). The embedded engine’s data directory lives outside the executable and its image: the OS per-user app-data location by default for a bare binary, overridable; for a container, a volume the operator mounts at the configured location, which the host can be told to require. Never a temporary directory (brief Hard constraints “Data lives outside the executable and its image”). The quality-attribute scenarios sit on the companion overview’s Reliability / durability axis; the requirement is the V0 substrate spec’s R-0116, which also carries socket-only peer-authenticated cluster access with no stored secret, the engine major-version guard, exclusive ownership of the directory across restarts and machines, and the restart acceptance. An operator-provisioned external Postgres server isn’t a V0 engine (durability would then be that server’s responsibility); the V0 engine remains embedded Postgres per P-0010. (Amended 2026-10-19, #4018, pending the maintainer’s gate. This bullet is re-derived against the operator-run instance. What stays: stored content survives a host stop and restart, clean or hard kill (spec R-0121-a), verified by an out-of-process restart acceptance (R-0121-c). What moves: the data directory, its placement, locking and version guard were the host’s and are now the instance’s. Placement on persistent storage is a named operator obligation (R-0117-j), and the durable-commit settings the embedded design wrote are now requirements the host verifies on every start and retry, failing closed (R-0117-d). What is dropped, with reason: the “hard kill of the storage engine” scenario. The host can’t kill an instance it doesn’t own; crash recovery is PostgreSQL’s under the verified settings (R-0121-b). Correction, not benefit: the persistence defect (#3565) was mnemra’s own .temporary(true), not a property of embedding (maintainer, 2026-10-18). The move removes the site of the defect. It doesn’t solve durability; the requirement does. The no-stored-secret socket design (R-0116-e) is replaced by R-0119: no password in the URL or environment; a descriptor-checked file when one is needed; peer authentication over a socket (after a peer-uid check) recommended for a bare host; verify-full TLS required on every TCP connection, loopback included; and a password only ever sent over such a connection (r2, after the security review). Quality-attribute scenarios: the companion overview’s Reliability / durability axis, re-derived in the same amendment.)
  • Startup check, readiness and liveness are three contracts (Amended 2026-10-19, #4018). The host verifies its requirements on the instance (one check, spec R-0118-a). It exposes readiness on GET /ready with machine-readable reasons, exposes liveness on GET /health with no dependency on the instance, and runs the same check out-of-process as mnemra check-db. An unmet hard requirement never exits the process. The host stays up and serves nothing: every MCP call answers host_not_ready with the reasons, while initialize and tools/list still succeed. It retries with backoff (1 s → 30 s cap, unbounded) and on SIGHUP. Maintainer ruling 2026-10-19, verbatim: “k8s keeps trying to restart wihch is dumb. better answer is the health check indicates it can’t run and why with a way to ensure it occasionally trys again or is forced to try again.” The three-way split is his stated view (“i think they are different things”), RULED 2026-10-19 (P-0010 §Amendment AE1, activity 7787; ready ⇒ alive, never the reverse). No soft class exists at V0 (ruling 7771). The shared-service HTTPS transport the maintainer ruled the same day (one host for every session) is the next amendment, #4127, and amends R-0010-a/-e and the daemon model. Probe mapping: liveness → /health, readiness → /ready, startup → /health or none, pre-flight → check-db. Exec probes are used at V0 while the listener is loopback-only. (Amended 2026-10-29, #4412, ruling 9279: the listener is now an owner-only unix socket; spec R-0004-g as amended.) Anchors: V-Reliability (graceful degradation over crash-restart), P-ReliabilityTarget (readiness read from the consumer’s side), P-CheckCoversTheClaim (liveness checks liveness).
  • The detailed layout of a single logical artifact across the four shapes (whether a task lives in one row, in multiple tables in the content substrate, or fans across content + state + log substrates) is the central architectural fork at the Spec stage. This is resolved in [P-0001-storage-layout](../adrs/P-0001-storage-layout.md) (Tier A) as the Postgres implementation under P-0010’s substrate decision; see the Tier A table below for context.

MCP transport

  • Stdio at V0. Streamable-HTTP is a V0.1+ activation, conditional on the microVM-appliance trip-wire (a named-capability condition, not release-gated).
  • MCP specification version 2025-06-18 (brief Hard constraints). (Amended 2026-10-25, #4249, approved 2026-10-29 (#4249 activity 9183): the target is MCP specification 2025-11-25. The host serves exactly the released revisions 2025-06-18 and 2025-11-25, and it answers any other revision requested at initialize with 2025-11-25. The host enforces that set itself. Tests pin it at initialize and before the handshake; the pin after the handshake is #4326 (open). P-0012 §Amendment 2026-10-25 (MCP protocol revision).)

Observability

  • Ship instrumented from V0. Metrics, structured logs, and traces in place at first user-touch; per-verb metrics on every MCP call, all emitted (stdout + OTel) storage-independently from the bare shell (a workspace-wide observability discipline). The observability storage backend is deferred behind the generation⊥storage separation, not in the binary at V0 (the observability baseline, re-derived 2026-06-09; re-altituded out of the project-ADR layer; P-0004 deprecated, no successor ADR).
  • Health endpoint shape. Structured-detail body identifying which dependency failed (Postgres reachable / pgvector loaded / workspace=default exists). The listener binds loopback-only at V0, so loopback IS the gate on the detail body (named tripwire: if the listener ever binds non-loopback, admin-token gating becomes required). (Amended 2026-10-29, #4412, ruling 9279: the listener is now an owner-only unix socket; spec R-0004-g as amended.)

Migration discipline

  • Migration scope at V0. The prior structured task store’s table set and a fixed subset of the prior content corpus subdirectories (brief locks the scope; workspace- level operational tooling such as skills, team profiles, and inbox surfaces is V0.1+ scope per the brief’s idea-tier entry for internal-workspace absorption).
  • R6.4 / R6.4a / R6.4b idempotency and resumability. Migration must support resume-from-mid-failure with a per-record progress manifest.
  • R2.7 round-trip equivalence. Source-frontmatter round-trip MUST be byte-equal modulo system-generated migration metadata fields.
  • R6.3 system-field separation. System-generated fields (e.g., migrated_from, migrated_at, frontmatter_version) MUST NOT overwrite source frontmatter.

Testing and review discipline

  • Test-Driven Development pairs on non-trivial work (workspace-wide principle: TDD pairs). A separate red-phase test task precedes the implementation task on security boundaries, public APIs, parsers, validators.
  • Worktrees mandatory. All code work in worktrees; main is protected.
  • Heterogeneous reviewers. A code-and-security reviewer on every change; specialists join when their surface is touched.

Open ADR slots

The Spec stage will need locked decisions on the following. Each is named with a candidate identifier ({{P-XXX}} placeholder shape; final IDs are assigned at Spec stage). The triage tiering follows the constraints strawman’s Tier A / B / C ordering, adapted for the brief’s INCR-1 staged-increment shape. Tier A unblocks the 0.1.0 substrate; Tier B unblocks the migration increments; Tier C unblocks operational hardening.

Placeholder-to-ADR resolution mechanism. At Spec stage, the implementing developer authors the actual ADR files using MADR format with the P- prefix, stored at docs/src/adrs/P-NNNN-<slug>.md (e.g., {{P-StorageLayout}} resolves to P-0001-storage-layout.md). Each {{P-XXX}} placeholder in this Frame and in the companion overview is back-updated to cite the resolved ADR file at that point. The resolution mapping is recorded in a placeholder-resolution table authored at Spec stage as part of the first ADR dispatch, so the Frame and overview don’t carry orphaned placeholders beyond the Spec authoring window.

Tier A — unblock 0.1.0 substrate

Candidate IDDecisionNotes
[P-0010-storage-substrate-engine](../adrs/P-0010-storage-substrate-engine.md)The storage substrate and engine: which engine (Postgres-on-merits vs unified vs polyglot), the V0 engine shape (embedded vs external), the V0 extension stack, and whether storage sits behind an engine-agnostic swap trait or a Postgres-shaped oneFold-added slot (2026-06-08). The original Frame had no substrate slot; the substrate was treated as a hard-locked brief carry-forward. A storage-engine evaluation (ratified 2026-06-07, after the substrate spec lock) re-opened it on merits. Resolved: PostgreSQL ratified on merits behind an engine-agnostic swappable Storage trait (D5, one implementation); V0 embedded Postgres; A1-clean V0 stack (D2); keyword/graph/time-series on named trip-wires (D3/D4/D8); D6 method-borrows deferred to the retrieval ADR; D7 managed-tier skipped. P-0001 (layout) sits under this decision. Escalation E1 (D8 vs the observability hypertables) dispositioned 2026-06-09 (re-derive now) → re-altituded out of the ADR layer to the observability baseline; P-0004 deprecated, no successor ADR. Amended 2026-10-19 (#4018, approved 2026-10-19 (#4018 activity 7800)): the V0-engine half is amended in place (P-0010 §Amendment 2026-10-19) to a separate, operator-run PostgreSQL instance; D1/D2/D5/D8 unchanged.
[P-0001-storage-layout](../adrs/P-0001-storage-layout.md)The detailed layout of a single logical artifact across the four storage shapes (single-document vs composite-typed-slots vs multi-substrate-with-joins)Central architectural fork. Resolved 2026-05-24: C1 single-document layout. Whole artifact in one row; JSONB frontmatter + body + system fields; non-breaking C2 evolution path designed into the projection layer. Sits under [P-0010-storage-substrate-engine](../adrs/P-0010-storage-substrate-engine.md) (the Postgres implementation under the swap trait).
[P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md)Cohesion criterion for the V0 core plugin set; partitions the capability-family increments 0.2.0 through 0.14.0 between additional builtins and core: true pluginsDepends-on [P-0001-storage-layout](../adrs/P-0001-storage-layout.md). Resolved 2026-05-24: 4 core: true plugins (tasks / repos / two further artifact-family plugins) + 7 builtins. Verb-on-content discriminator.
[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md)Plugin manifest schema + host-fn ABI surfaceDepends-on [P-0001-storage-layout](../adrs/P-0001-storage-layout.md) and [P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md). Resolved 2026-05-24: Universal content.emit verb shape; schema_version: 1; typed host-fn allowlist compiled per-instance from signed manifest.
{{P-ObservabilityShape}} → re-altituded out of the ADR layer to the observability baseline (a theory-trait baseline in the companion overview, not an ADR); P-0004 deprecated, no successor ADRObservability shape re-derived around generation⊥storage separation: the server EMITS telemetry (stdout structured logs + OTel metrics/events + health-endpoint-first) storage-independently; the storage backend is deferred behind the separation (option set + named tripwire), not locked. The maintainer ruled observability a theory trait plus chassis mechanism, not a per-project ADR, so this Frame ADR-slot resolves to a non-ADR baseline (the altitude re-disposition is marked explicitly). P-0004 (TimescaleDB hypertables + retention + continuous aggregate in the app’s own Postgres) is the deprecated historical record; its storage core was falsified by P-0010 D8.Originally drafted as P-0004 in parallel with the Tier A core; re-derived 2026-06-09 (E1 disposition) and re-altituded out of the ADR layer to the overview observability baseline.
[P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md)Minimum-viable custody decision that lets V0 ship signed core: true plugins. V0 mechanism: the build host has the key on disk for dogfood. Trip-wire: the moment mnemra-core is deployed beyond the maintainer’s single dogfood instance, the trip-wire fires and {{P-SigningKeyCustodyHardening}} (Tier C) is authored.Anchored in P-Defer (Open/Deferred mechanism named with a stated trip-wire). Split out of the originally-Tier-C {{P-SigningKeyCustody}} because the 0.1.0 build pipeline can’t ship signed artifacts under a deferred custody decision; V0 needs a custody story even if the hardened story comes later.
[P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md)V0 application-layer enforcement mechanism for workspace isolation while RLS policy enforcement is deferred to V0.1+. Conservative pick: typed WorkspaceCtx parameter binding at the host-fn boundary, where every host-fn signature requires a WorkspaceCtx argument that the host populates from the validated request token; queries that don’t take it can’t be authored. Open variants: (a) typed parameter binding (lead), (b) storage-layer query rewriter, (c) per-host-fn explicit workspace_id parameter validation.Anchored in P-SecurityLayered (“each layer is independently load-bearing; losing any layer weakens the whole”). The V0 enforcement layer is named here so RLS at V0.1+ is the substrate-layer hardening of an enforcement that is already load-bearing at V0 via an application-layer mechanism.
[P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md)Plugin sandbox resource limits per Wasmtime instance: fuel (CPU-time ceiling) + epoch-interruption (deadline-based preemption) + memory ceiling + table/instance limits. V0 turns on fuel and epoch; values specified in this ADR.Anchored in P-StackDiscipline (Wasmtime’s resource knobs are stack-aligned and already present in the library; this is a config decision, not a build decision). Promoted from Tier C {{P-PluginPoolMemory}} (renamed) because the sandbox security posture commitments in this Frame depend on these limits being live at V0.
[P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md)Static admin token structure: opaque-with-server-side-lookup vs claim-carrying signed (JWT/PASETO/etc.). The choice gates security architecture (loss of the token-file means different things in each shape) and the binding mechanism for the workspace claim every token carries.Split out of the originally-Tier-A {{P-RLSAdminToken}}. Upstream of role/permission shape; the role model lives downstream at [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) and presupposes this decision.
[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md)RLS role model + admin token permission shapeDepends-on [P-0001-storage-layout](../adrs/P-0001-storage-layout.md) (determines policy-surface count) and [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) (determines whether destructive ops bind on a claim-carrying or opaque-lookup token). Resolved 2026-05-24: binary admin/read-observer role enum; permission matrix per role; V0 app-layer enforcement; V0.1+ RLS policy hardening path.

Tier B — unblock migration increments (0.2.0–0.14.0)

Candidate IDDecision
{{P-MigrationID}}Migration ID derivation strategy for the prior task store + content corpus → mnemra-core ULID identity
{{P-FKPreservation}}Foreign-key preservation across the migration and inside the content substrate; legacy task-store disposition policy
{{P-BackupRestore}}Backup and restore atomicity + role separation; round-trip verify before destructive operations
{{P-CutoverDualWrite}}Cutover dual-write gate (during the 1.0.0 cutover window, what guarantees prevent the prior tooling and mnemra-core from diverging)

Tier C — operational + concurrency hardening

Candidate IDDecision
{{P-PostgresExtDeploy}}Postgres + extensions deployment shape (which extensions ship in the appliance, how they upgrade) (Amended 2026-10-19, #4018: the “which extensions, at what version” half is answered by P-0010 §Amendment 2026-10-19 and spec R-0117-a/-b. The answer is pgvector, installed by the operator and floor-verified by the host; nothing “ships in the appliance”. The “how Postgres, pgvector and the host reach the operator” half is #4019’s design item, which may resolve this slot or retire it.)
{{P-MCPWriteSemantics}}MCP write semantics, covering concurrent-write conflict resolution, deletion semantics and idempotency keys
{{P-SigningKeyCustodyHardening}}Production-grade signing key custody (HSM-backed / runtime-fetch / never-on-deployment-node). Activated by the multi-deployment trip-wire on [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md).

Cross-tier

Candidate IDDecisionNotes
{{P-ProjectionRebuild}}Projection rebuild semantics, covering per-substrate source-of-truth declarations, cross-substrate rebuild ordering and refresh-queue dependency trackingSurfaces under any non-trivial storage layout. The 2026-05-03 strawman called this out as a likely standalone ADR.

Forward-context (V0.1+; not Frame-time)

The brief’s V0.1 (post-1.0.0) immediate roadmap names two committed-to-the-phase increments: 1.1.0 (get_context_for(artifact_id) retrieval verb) and 1.2.0 (ongoing-ingest pipeline). Neither is in V0 Frame scope. Per the brief, V0.1 entries lock their own frame plus spec when they’re build-actioned.

Reconciliation to the locked brief

The Frame’s reconciliation discipline is direct citation: every claim above is either (a) directly stated in the locked brief, (b) directly stated in a locked predecessor decision (the V0 discovery, the architecture alignment record, the project defaults), or (c) an inference whose chain the Frame body makes explicit. No tensions surfaced that contradict the brief. The Frame-level refinements (Frame is narrower than the brief, but consistent) are:

RefinementWhere the brief permits it
The four-shape storage model (content / timeseries / log / state-config), re-derived 2026-06-09 to two persisted shapes (content / state-config) plus observability emission surfaces (former timeseries / log)Brief Hard constraints fix the substrate (pgvector) but do not enumerate the four shapes; the alignment record’s round-4 mental model does, and the brief’s 0.1.0 substrate description (“content/timeseries/log/state storage-shape partitions”) cites it. The substrate is re-opened on merits by P-0010-storage-substrate-engine (TimescaleDB demoted off the V0 stack, D8); the former timeseries/log shapes are observability emission surfaces, not in-app storage at V0 (telemetry is emitted, not stored; see the observability baseline).
Plugin instance pool size 3 to 5 at V0Brief Hard constraints require multi-tenancy structure; the alignment record’s round-5 pool decision operationalizes it.
RLS column-shape at V0, policy enforcement at V0.1+, application-layer enforcement load-bearing at V0Brief Tenancy invariant locks “workspace_id structural from V0”; the brief’s idea-tier entry for row-level-security policy enforcement defers activation. The V0 enforcement mechanism for workspace isolation is named at [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md) (Tier A). Per P-SecurityLayered, the application layer is independently load-bearing at V0; RLS at V0.1+ is the substrate-layer hardening.
core: true plugins ship signed at V0 under a Tier-A V0 custody decisionBrief Hard constraints commit to signed core: true plugins; this Frame names [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (Tier A) as the V0 custody decision (build-host-on-disk for dogfood) with the multi-deployment trip-wire to {{P-SigningKeyCustodyHardening}} (Tier C). Per P-Defer, the Open/Deferred mechanism names the V0 mechanism AND its trip-wire.
Wasmtime fuel + epoch-interruption ON at V0Brief and predecessor specs commit to the plugin-sandbox security outcomes (“an infinite-loop plugin is killed and replaced from the pool”); this Frame names the mechanism (fuel, epoch-interruption, memory ceiling, table/instance limits) and slots ceiling values at [P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) (Tier A, renamed/promoted from the prior Tier-C {{P-PluginPoolMemory}}). Per P-StackDiscipline, Wasmtime’s resource knobs are stack-aligned.
Static admin token shape is a Frame-altitude decisionBrief Hard constraints commit to the static admin token with a structural workspace claim; the token structure (opaque-with-server-side-lookup versus claim-carrying signed) and the workspace-claim binding mechanism gate downstream security architecture, so the choice lives at Frame altitude as [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) (Tier A). The role-and-permission shape downstream sits at [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (Tier A).
core: true plugins partition of 0.2.0 through 0.14.0 is namedBrief enumerates the capability-family increments but does not partition them between additional builtins and core: true plugins. [P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md) (Tier A) determines the partition; the signed-and-non-uninstallable invariant binds whichever increments are partitioned as plugins.

Out of Frame scope

The following are explicitly not Frame-stage decisions and are recorded here so the boundary is unambiguous:

  • Detailed ADR authoring. Spec stage owns this. Frame names candidate ADRs and surfaces the relationships between them, but doesn’t lock decisions.
  • Threat-modeling output (STRIDE-per-element, risk-register entries, accepted-risks list). The architecture overview port contains a threat-scaffold placeholder; the terminal-review threat-modeling pass populates it at Stage 2 fire (security-mode review with the threat-modeling skill loaded).
  • Test-suite design. Test discipline is named (TDD pairs, heterogeneous reviewers); test-fixture authoring is Spec-stage and Stage-3 implementation work.
  • Plan / sequencing within the staged-increment sequence. The brief locks ordering rationale per-entry; per-increment plans are ephemeral, generated when each increment is build-actioned.
  • Commercial gating. The brief explicitly carves commercial validation thresholds, pricing, and go-to-market to a separate internal record; Frame doesn’t absorb them.

Pointers

  • For the constraint inventory, the 7-axis quality-attribute utility tree, the data-flow diagram, and the threat-scaffold placeholder, see the companion artifact: Architecture overview.
  • For the workspace-wide project defaults (G-* ADR baseline projected at project creation), see Project Defaults.
  • For glossary entries (ADR, MADR format, the two-tier G-/P- ADR system), see Glossary.

Changelog

  • 2026-10-16: Disclosure-wording erratum (#3377). The increment-sequence table rows for 0.12.0 and 0.13.0 and the Tier-A P-0002 slot note are rewritten to generic capability-family wording under the standing public-surface disclosure ruling. No direction, slot or reconciliation changed. It’s a wording erratum, not a design change.
  • 2026-06-09: Observability re-derivation (E1 dispositioned = re-derive now), re-altituded out of the project-ADR layer. The maintainer dispositioned escalation E1 by separating observability generation from storage: the server EMITS telemetry (stdout structured logs + OTel metrics/events + health-endpoint-first) storage-independently from the bare shell; the observability storage backend is deferred behind the separation (option set {Prometheus, InfluxDB, TimescaleDB, plain Postgres tables}, named tripwire), not locked; the standalone binary survives (observability storage is external operator infra). The maintainer further ruled observability a theory trait + chassis mechanism, not a per-project ADR: the generation decisions land in the observability baseline in the companion overview (a theory-trait baseline, not an ADR), and the original observability ADR [P-0004-observability-shape](../adrs/P-0004-observability-shape.md) is deprecated (its storage core falsified by P-0010 D8; no successor ADR). The intermediate observability ADR (P-0011) drafted earlier this day is dissolved, because it over-built the altitude (re-asserting at project-ADR altitude a thing that is a theory baseline plus chassis wiring). Reframed the Frame’s two Observability sections, the storage-shape model (the former timeseries/log shapes are emission surfaces, not in-app storage), and the Tier-A slot table (the {{P-ObservabilityShape}} slot is marked re-altituded out of the ADR layer to the overview baseline; P-0010’s E1 tail re-targeted). The /health detail body is gated by the loopback-only listener bind (loopback IS the gate at V0; named tripwire if it ever binds non-loopback). (Amended 2026-10-29, #4412, ruling 9279: the listener is now an owner-only unix socket; spec R-0004-g as amended.) The host capability-manifest is a settled invariant (generated from WIT, never hand-maintained; generation mechanism routes to the chassis). Non-observability Frame content unchanged.
  • 2026-06-08: Storage-substrate fold. A storage-engine evaluation (ratified 2026-06-07, after the 2026-05-24 substrate spec lock) re-opened the storage substrate on merits and was folded into the WS-E-2 designed tier before merge. The Frame’s storage treatment is reframed from “hard-locked brief constraint, no substrate slot” to “PostgreSQL ratified on merits, behind an engine-agnostic swappable Storage trait” (new [P-0010-storage-substrate-engine](../adrs/P-0010-storage-substrate-engine.md), added to the Tier-A slot table). Reframed: the Storage-shape cross-cutting block, the Memory-substrate component bullet, and the four-shape model’s timeseries shape (plain timestamped Postgres tables at V0; TimescaleDB demoted off the V0 stack to a trip-wire, D8). The V0 engine is embedded Postgres (not an external server). Carried escalation E1 (D8 vs the then-accepted [P-0004-observability-shape](../adrs/P-0004-observability-shape.md) hypertables, a maintainer scope/sequencing call, pending at fold time), dispositioned 2026-06-09 (re-derive now); see the 2026-06-09 entry above. Non-storage Frame content is unchanged.
  • 2026-05-23: Frame revision per Frame-exit gate Revise verdict. Frame-exit gate ran retroactively on the 2026-05-22 synthesized Frame after the 2026-05-23 G-0028 cold-start amendment landed (Stage 2 split into 2a elicitation + 2b synthesis + Frame-exit gate). Warden’s Stage 2 code-and-security review (target_commit 0fafbf39c2a5412bc99de0ecf499cebc7524ec63, dispatch_id 652, dated 2026-05-22) returned Approve-with-conditions; the gate read that as Revise. Four architectural directions were locked via Stage 2a-shaped walkthrough (recorded at the new Stage 2a section above): (H1) split {{P-SigningKeyCustody}} → Tier-A [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) + Tier-C {{P-SigningKeyCustodyHardening}}; (H2) add Tier-A [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md) application-layer enforcement backstop; (M3) rename {{P-PluginPoolMemory}} → [P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) and promote to Tier A; (M4) split {{P-RLSAdminToken}} → Tier-A [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md) + Tier-A [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (narrowed). Three Mediums absorbed mechanically: (M1) TB-external-llm row added to Frame TB table, overview designated canonical TB enumeration; (M2) overview DFD extended with P-builtin-users, P-builtin-sessions, P-builtin-permissions; (M5) inline forward- reference to [P-0002-core-plugin-partition](../adrs/P-0002-core-plugin-partition.md) for the 0.2.0 through 0.14.0 partition. L1, L2, N1 deferred (housekeeping). Net ADR-slot change: +3 Tier A slots ([P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md), [P-0006-v0-tenant-enforcement](../adrs/P-0006-v0-tenant-enforcement.md), [P-0008-admin-token-shape](../adrs/P-0008-admin-token-shape.md)), +1 promoted Tier A slot ([P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md), renamed from {{P-PluginPoolMemory}}), Tier C gains {{P-SigningKeyCustodyHardening}}, Tier C loses {{P-PluginPoolMemory}} and {{P-SigningKeyCustody}}. Final tally: Tier A 9 (was 5), Tier B 4 (unchanged), Tier C 3 (was 4), Cross-tier 1 (unchanged).
  • 2026-05-23 (Stage 3 entry housekeeping): Resolved three deferred housekeeping items from the Stage 2 code-and-security review (d652/d655). (L1) ELT subsystem forward reference resolved: removed the undefined “ELT subsystem” term and replaced it with an inline description of the embedding-batch pathway (Extract-Load-Transform pipeline routing artifact content through host functions to external provider; Spec-stage detail deferred with explicit callout to DF-embed-call/TB-external-llm). (L2) Workspace-internal citation resolved: “Round-6 of the alignment record” citations removed from component map intro and host-fn surface intro; six bucket names inlined directly; host-fn surface enumeration already present inline so only the citation header changed. (N1) Placeholder resolution mechanism added: an explicit paragraph inserted at the open-ADR-slots section (before Tier A table) specifying that the implementing developer at Spec stage authors P-NNNN-<slug>.md ADR files in MADR format; each placeholder resolves to a numbered filename; resolution recorded in a placeholder-resolution table at Spec stage. No architectural content changes; Frame remains locked at acc511f baseline. Companion overview updated in the same commit for slot citation routing and R-0004 rewrite.
  • 2026-05-22: Frame doc initial draft. Stage 2 of /brief for mnemra-core; first real Stage-2 → Stage-3 dogfood of the new agent-first workflow shape. Reconciles to the locked brief (intake-exit 2026-05-20). Applies three framing corrections from predecessor artifacts: (1) projects and agents are builtin not plugins; (2) plugin shape is WASM Component Model loaded in-process, not stdio MCP wrappers around external CLIs; (3) V0 is a staged increment sequence (0.1.0 → 1.0.0), not a monolithic release. Companion artifact: architecture/overview.md. Open ADR slots named with {{P-XXX}} placeholders for Spec-stage authorship.

Architecture Overview — Mnemra Core

Date: 2026-05-22 · Status: draft (companion to Stage 2 Frame) · Altitude: component

This document carries four things forward from the V0 architecture constraints record (draft 2026-05-03): the constraint inventory, the quality-attribute utility tree, the data-flow diagram, and the threat-modeling scaffold. Each is reconciled against the locked product brief (its intake stage closed 2026-05-20, the first human sign-off point in the work-shaping pipeline) and against the companion Frame document. Frame is the pipeline stage that walks constraints out from validated intent. Where the older framing had gone stale, this port carries the corrected version. The companion Frame section “Framing corrections” holds the full provenance.

This overview is agent-primary, meaning it’s structured for machines to parse and address rather than for narrative reading. That follows the workspace-wide decision to treat source artifacts as agent-primary (locked 2026-05-11).

Provenance

ArtifactReference
Companion Frame doc (Stage 2 of /brief)Frame: Mnemra Core, draft 2026-05-22
Locked product brief (Stage 1, intake-exit gated)Product Brief: Mnemra Core, locked 2026-05-20
V0 architecture discovery“V0 discovery” decision record, locked 2026-05-02
V0 architecture constraints (port source)“V0 constraints” decision record, draft 2026-05-03
Architecture alignment mental model (round-6)“Architecture alignment R6” decision record, agreed 2026-04-27

Threat-modeling trigger

Mnemra-core V0 trips all four of the design-time triggers that the workspace’s layered-security principle uses to decide when a threat model is required. Each one applies here.

  • Authentication. Each deployment runs its own OIDC authorization server, discovered through RFC 9728 protected-resource metadata. V0 uses a static admin token.
  • Data adjacent to personally-identifiable information. Workspace artifact content includes operational data and dispatch metadata.
  • Network surface. The MCP transport runs over stdio at V0, with streamable-HTTP arriving at V0.1 and later.
  • Multi-tenancy. workspace_id is structural from V0. The Row-Level Security column shape ships at V0; policy enforcement comes at V0.1 and later.

The threat model runs at the Stage 2 terminal review, dispatched to a reviewer in security mode with the threat-modeling skill loaded. Its callouts annotate the data-flow diagram below, and its mitigations turn into ADR proposals at the Spec stage. An ADR is an Architecture Decision Record, a Markdown record of one decision and the options it was chosen against; Spec is the pipeline stage that produces the testable, locked specification. The threats-by-element and trust-boundaries sections further down start as placeholders that this terminal-review pass fills in.

Constraint inventory

Hard-locked

These constraints are locked by three sources: the product brief’s Hard constraints section, the locked V0 discovery record, and the workspace architecture canon. They feed into the Spec stage as fixed inputs. They aren’t being re-derived here. Several rows carry a dated amendment (2026-10-19, #4018) that supersedes an earlier row in place; both stay in the table so the earlier decision remains visible.

ConstraintSource
PostgreSQL substrate ratified on merits, behind an engine-agnostic swappable Storage trait (Postgres the only implementation); V0 engine is embedded Postgres (postgresql_embedded + bundled pgvector); V0 stack is A1-clean (pgvector HNSW + native FTS + recursive CTEs + JSONB), TimescaleDB demoted off the V0 stack to a trip-wireP-0010-storage-substrate-engine (folds the 2026-06-07 storage-engine evaluation, ratified after the spec lock); supersedes the prior “single-process Postgres + pgvector + timescaledb extensions present” hard-lock framing (brief Hard constraints; architecture alignment R4)
(Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800) — supersedes the engine clause of the row above.) V0 engine is a separate, vanilla PostgreSQL 16 instance the operator installs and runs, with pgvector installed by the operator; the host reaches it by connection configuration, owns no cluster (no download, initdb, pg_ctl, data directory or CREATE EXTENSION), and verifies its requirements on the instance before serving, failing closed — server major and minor floor, pgvector floor, serving role not superuser / no BYPASSRLS / no CREATEROLE / no CREATEDB / no REPLICATION, FORCE ROW LEVEL SECURITY on tenant-scoped tables, fsync / full_page_writes / synchronous_commit / data_sync_retry safe on the sessions writers use, verify-full TLS on every TCP connection (loopback included) with a password only ever sent over it, peer authentication with a peer-uid check on sockets, scram-sha-256 password hashing, server-side parameter logging off, UTF8, minor-version floor, schema version, reachability (r2: two roles — owner for init, serving for the host; the serving role owns nothing and is a member of nothing); what it cannot verify (data on persistent storage, backups, install supply chain, max_connections, the ident map) it names in a list the host emits and the deployment document carries verbatim (Amended 2026-10-29, #4291: “PostgreSQL 16 instance” now reads as a PostgreSQL instance, 16 or later, on a major the host supports, of which there are at most two. The supported majors, their floors and the pgvector floor are one constant in the host’s code, and the host refuses a major nobody has tested; see V0 substrate spec R-0117-a and R-0117-b as amended.)P-0010 §Amendment 2026-10-19 (DE1, DE2); V0 substrate spec R-0117, R-0119; maintainer rulings 2026-10-16/18 (#4018)
WebAssembly Component Model plugin runtime via Wasmtime; plugin core logic IO-free; all plugin IO host-mediated; plugins are leaves (no sideways linkage)Brief Hard constraints; architecture alignment R2 + R4
One MCP server with namespaced plugin verbs; stdio at V0; MCP specification 2025-06-18; streamable-HTTP a V0.1+ activationBrief Hard constraints; architecture alignment R1
Mnemra is Resource Server only; per-deployment OIDC AS via RFC 9728 protected-resource-metadataArchitecture alignment R5 + R6
Static admin token at V0 (filesystem-stored, mode 600)V0 discovery; architecture alignment R6
core: true plugins signed by mnemra root and structurally non-uninstallableArchitecture alignment R2 + R4
Four storage shapes (content / timeseries / log / state-config); content-first with CQRS-real projectionsArchitecture alignment R3 + R4
Multi-tenancy structural; workspace_id NOT NULL on every artifact table; RLS column-shape at V0 with policy enforcement V0.1+Brief Hard constraints; architecture alignment R5
Admin CLI is destructive / control-plane only; agent-facing CRUD on MCPV0 discovery
Schema-driven dynamic admin CLI subcommands generated from plugin manifestsArchitecture alignment R1
License: Apache-2.0 with future-relicense clauseBrief Hard constraints (license lock 2026-05-20)
Self-hosted-first single-binary deployment posture; immutable image is valid packagingBrief Hard constraints; architecture alignment R6
Stored context survives a host stop and restart, including a hard kill of the host or of the embedded engine; data lives outside the executable and its image at an operator-configured location (OS per-user app-data default for a bare binary, overridable; for a container, a volume the operator mounts at the configured location, which the host can be told to require), never a temporary directory or a container’s writable layer; whether the location is local or network-backed is the operator’s choice; the host reaches the cluster only over a private unix socket by peer authentication, so no cluster credential is held at restBrief Success criteria “Durable across restart” + Hard constraints “Data lives outside the executable and its image” (maintainer ruling 2026-09-15); V0 substrate spec R-0116; the Reliability / durability axis below
(Amended 2026-10-19, #4018, approved 2026-10-19 (#4018 activity 7800) — supersedes the row above.) Stored context survives a host stop and restart, clean or hard kill (spec R-0121-a, verified out-of-process, R-0121-c); the instance’s data directory, placement, locking and version are the operator’s and PostgreSQL’s — placement on persistent storage (never a container’s writable layer or a temporary directory) is a named operator obligation (R-0117-j item 1), and the durable-commit settings are requirements the host verifies on every start and retry (R-0117-d). Survival across a crash of the instance itself is PostgreSQL’s WAL guarantee under those settings; the host names the reliance and does not test it (R-0121-b). The persistence fix is a correction of mnemra’s own .temporary(true) (maintainer 2026-10-18), not a benefit of the move. The credential at rest, where one exists, is a 0600 file under the host uid, never the URL or environment; peer authentication over a socket is the recommended local shape (R-0119)P-0010 §Amendment 2026-10-19 (DE5, DE7); V0 substrate spec R-0117-d/-j, R-0119, R-0121; maintainer ruling 2026-10-18 (#4018 activity 7472)
Startup check, readiness and liveness are three contracts on three surfaces (Amended 2026-10-19, #4018). An unmet hard requirement on the instance never exits the process: the host stays up, serves nothing, reports why on GET /ready, retries with backoff (1 s → 30 s cap) and on SIGHUP; GET /health reports only process liveness and never depends on the instance; mnemra check-db runs the check out-of-process. Probe mapping: liveness → /health, readiness → /ready, startup → /health or noneP-0010 §Amendment 2026-10-19 (DE3, DE4); spec R-0118; maintainer ruling 2026-10-19 (#4018 activity 7749); the three-contract split RULED 2026-10-19 (activity 7787; ready ⇒ alive, never the reverse — AE1); no soft class at V0 (ruling 7771)
Workspace cutover from the prior tooling at V0; the prior task-store binary remains available as a rollback pathV0 discovery
Rust-default toolchain; ecosystem-aligned tooling (non-Rust adopted only when no viable in-stack path exists)Brief Hard constraints; workspace stack-discipline principle
Test-Driven Development pairs on non-trivial work; worktrees mandatory; main is protectedWorkspace test/worktree/main-protection principles
Migration scope: the prior structured task-store tables (content / timeseries / log / state partitions) and a fixed subset of prior content-corpus subdirectoriesV0 discovery (Migration scope)
Workspace-level operational tooling (skill files, team profiles, internal memory store, inboxes, scratch, agent-harness state) is V0.1+ scope (the brief’s idea-tier internal-workspace-absorption entry)V0 discovery (Migration scope); brief idea-tier
Architecture MUST NOT be schedule-pressured; marketing-tier dates are not architectural inputsBrief Hard constraints
The system MUST NOT host a generative LLM; generative work (query rewrite, chunk-context, tag generation, synthesis) calls out to an external model at V0; local non-generative inference (embedding, reranking — encoder models behind the host-fn seam) is permitted host-side (MODIFIED 2026-07-02 per RC-1, retrieval-cluster intake; was: “MUST NOT host a language model; embeddings call out to an external model”)Brief Hard constraints + Non-goals, as amended 2026-07-02 (RC-1)

Reframed 2026-06-08 — storage substrate re-opened on merits

The storage substrate started as a hard-locked carry-forward that nobody had re-examined. A storage-engine evaluation, ratified 2026-06-07 after the substrate spec locked on 2026-05-24, re-opened it on the merits. That result is folded in here. PostgreSQL is ratified on the merits, sitting behind an engine-agnostic, swappable Storage trait with one implementation. V0 runs embedded Postgres. The V0 stack is A1-clean. TimescaleDB is demoted off the V0 stack down to a latency-and-storage trip-wire, so the V0 time-series storage shape is plain timestamped Postgres tables. The substrate row in the table above reflects this, and the full decision lives in P-0010-storage-substrate-engine, a project-scoped ADR. The P prefix marks a decision that applies to this project rather than workspace-wide.

Observability, re-derived 2026-06-09. The TimescaleDB demote (change D8) reached the observability metrics and events surfaces, which P-0004 had committed to TimescaleDB hypertables inside the app’s own Postgres. That’s a collision. The maintainer resolved it (escalation E1 in P-0010) by splitting observability generation from storage. The server emits telemetry from the bare shell, storage-independently: structured logs on stdout, OTel metrics and events, and a health endpoint that comes up first. It does not own where that telemetry lands. The storage backend for observability is deferred behind the split, not locked. The option set is Prometheus, InfluxDB, TimescaleDB, or plain Postgres tables, with a named tripwire. The standalone binary still runs, because observability storage is external operator infrastructure. This decision was re-altituded out of the project-ADR layer. Observability is a theory trait (the host emits its event stream for infrastructure and never owns the service’s own observability store) plus chassis mechanics, so it isn’t a per-project ADR. It now lives as the observability baseline in this overview, a theory-trait baseline. The original observability ADR P-0004 is deprecated: change D8 falsified its storage core, and there’s no successor ADR. Below, three things are re-derived around emission rather than storage: the data-flow diagram (the former DS-ts-* and DS-pg-logs nodes become a single telemetry-egress sink), the quality-attribute observability scenarios, and the observability threat rows. There is no in-app observability store at V0.

Reframed since 2026-05-03

The 2026-05-03 constraints draft carried a separate “External” block: pre-announce target dates, an alpha invite-only target date, time-budget figures, a $0 budget figure, and a kill criterion. None of it is in the constraint inventory here. Two reasons. First, the brief’s Hard constraints say plainly that the architecture MUST NOT be schedule-pressured, and that any date on marketing or landing material isn’t an architectural input. Second, the kill criterion and the time budget are commercial inputs. The brief keeps commercial validation thresholds in a separate internal record and deliberately doesn’t inline them. If any of these come back as real architectural inputs at the Spec stage, say as a trip-wire, they return with that trip-wire named explicitly, which is how the workspace handles deferral trip-wires.

Negotiable

The part of the constraint surface still being worked out at the Spec stage lives in the Frame’s “Open ADR slots” section. Every candidate ADR there is a {{P-XXX}} placeholder. The Spec stage writes them in tiers: substrate-unblocking first, then migration mechanics, then operational hardening.

Quality-attribute utility tree

Seven axes. Four are workspace core values. One, Reliability, is a workspace supporting value, and it’s scored as its own axis now that the brief defines what “persistent” means (the “Durable across restart” success criterion, plus the maintainer ruling of 2026-09-15). Two are mnemra-specific non-functional requirements that turned out to be load-bearing in V0 discovery. Reversibility isn’t scored as its own axis; it folds into conflict-resolution discipline, since the cutover rollback path is preserved per V0 discovery WC.x.

Security (load-bearing — multi-tenancy is structural)

RefinementScenario
Tenant isolationA workspace-A token issuing task.list returns zero workspace-B rows even when query construction is buggy.
Plugin sandboxA plugin attempting a direct Postgres connection is denied by the host; a plugin that panics does not crash the core; an infinite-loop plugin is killed and replaced from the pool.
Telemetry non-leakAn audit script over a dogfood-day’s logs, traces, dispatch events, and session events finds zero artifact-body matches against the known-content corpus.
Signed pluginsA core: true plugin with a missing or invalid signature fails to load with a structured error naming the plugin.
Authentication-failure shapeAn invalid-token JSON-RPC error code is distinguishable from “verb not found” and “parameter invalid”, even with external-authorization-server integration deferred.

Simplicity

RefinementScenario
Migration parsimonyA smoke test creates a pgvector index against existing artifacts without a table rebuild.
Single-binary deploymentmnemra init against a fresh Postgres bootstraps a working deployment in one command; mnemra workspace list returns [default].
Plugin contractA projects plugin manifest declares content_types, state_scopes, and the host-fn surface it requires; the plugin ships zero SQL and no DB schema.

Quality (production-grade — no personal-project discount)

RefinementScenario
Migration safetymnemra restore --verify <snapshot> round-trips identity-clean before any destructive operation runs.
Idempotency and resumabilitySIGKILL mid-migration; rerun consults a per-record progress manifest; completed records are skipped, in-progress records resumed; output IDs match the prior partial run.
Round-trip equivalenceRead source frontmatter → write artifact → read artifact → byte-compare equal modulo system-generated fields (migrated_from, migrated_at, frontmatter_version).
Foreign-key preservationPost-migration, task artifacts reference valid migrated project artifacts across the content and state-config partitions. (Re-derived 2026-06-09 per the observability baseline: the former timeseries/log partitions are observability emission surfaces, not in-app storage; dispatch metrics/events are emitted, not stored as FK-bearing in-app rows.)

Observability

Observability baseline (a theory trait, re-altituded 2026-06-09). Observability is a base-platform theory trait plus chassis mechanics, not a per-project ADR. The host emits its event stream for infrastructure (structured logs on stdout, OTel metrics and events, a health endpoint), storage-independently from the bare shell, and never owns the service’s own observability store. Generation is kept separate from storage. The server emits; where that telemetry lands is the operator’s choice behind the split. The option set is Prometheus, InfluxDB, TimescaleDB, or plain Postgres tables, with a named tripwire, deferred and absent from the binary at V0. This baseline is where the V0 observability generation decisions live. The original observability ADR P-0004 is deprecated, with no successor, because change D8 falsified its storage core. The scenarios below are all generation-side, so they hold no matter which sink the operator picks, or none.

Storage-backend tripwire (a named instrument, P-Defer DF1). P-Defer is the principle of holding off on a mechanism until evidence forces the choice. A persistent observability store gets adopted only when persistent storage becomes load-bearing for a real operator deployment, meaning telemetry has to survive a process restart or be queried historically beyond what stdout retention and the scrape target already give you. Until that point the bare shell carries none. The generation mechanism (the emission call sites, the metric/event/log floor) moves to the chassis when chassis new lands. Until then it’s a documented invariant on the build.

Capability-manifest invariant (settled: generated from WIT, never hand-maintained). The host’s capability manifest is the machine-readable surface that describes the host functions and verbs the host exposes. It’s generated from the WIT interface definitions and never hand-maintained, so it can’t drift from the actual ABI. This is settled at V0, not a live fork. Its generation mechanism, the build-time step that turns WIT into the manifest, routes to the chassis with a named tripwire: once chassis new exists, the manifest-generation step lands there. Until then it’s a documented invariant on the build. Don’t confuse this with the per-plugin signed manifest at P-0003-plugin-manifest. That one is a plugin declaring the surface it needs. This one is the host’s generated description of the surface it offers.

The 2026-10-19 amendment (#4018) splits the single health route into separate liveness and readiness routes. The rows it supersedes stay in the table with an amendment note, and the last row records the measured code the split corrects.

RefinementScenario
Per-verb metrics (emitted)After a dogfood session, the per-verb metric records emitted to the OTel/stdout surface carry workspace_id, verb, outcome, duration_ms; p50 / p95 / p99 per verb are derivable from the emitted duration_ms values (computed at the operator-chosen sink — there is no in-app metrics hypertable).
Storage-independent emissionWith no persistent observability backend configured, N MCP verb calls produce N observable metric emissions on the OTel/stdout surface; \d+ shows no metrics/events hypertable and \dx does not list timescaledb.
Generation at the bare shellA structured log line appears on stdout and GET /health returns a response before the embedded Postgres is initialized (health endpoint is the first API). (Amended 2026-10-19, #4018: “before the embedded Postgres is initialized” → “before the first connection to the operator’s instance is attempted, and regardless of whether that instance is reachable”.)
Health-endpoint shapeA request to /health returns a structured detail body identifying which dependency failed (Postgres reachable / pgvector loaded / workspace=default exists), e.g. 503 when a dependency is down. The listener binds loopback-only (127.0.0.1) at V0, so loopback IS the gate — every caller is necessarily on loopback and receives the detail body; there is no admin-token gating at V0. (Named tripwire: if the /health listener ever binds non-loopback, admin-token gating on the detail body becomes required.) (Amended 2026-10-19, #4018 — superseded by the two rows below; the loopback gate and its tripwire carry to both routes.) (Amended 2026-10-29, #4412, ruling 9279: the listener is now an owner-only unix socket. The gate is the host’s uid, not the loopback bind, and the tripwire is spec R-0004-g’s HS-6.)
Liveness is independent of the instance (Amended 2026-10-19)Stimulus: the operator’s Postgres is stopped for ten minutes while an orchestrator probes GET /health every 10 s. Environment: the host running under a liveness probe with a restart threshold of three failures. Response: every probe returns 200 { "alive": true }; the handler issues no SQL. Measure: zero restarts over the ten minutes; GET /ready returns 503 with reasons[0].reason = "unreachable" throughout. (Spec R-0118-e/-f.)
Readiness carries the reason and recovers without a restart (Amended 2026-10-19)Stimulus: the instance is started after the host. Environment: a host that came up against a stopped instance, with an MCP client already connected over stdio that received host_not_ready on its first call. Response: the host’s scheduled check succeeds, readiness flips to 200, the same client succeeds on its next call. Measure: the host pid is unchanged; the gap between instance start and ready: true is ≤ the current backoff interval (≤ 30 s) plus one check duration; a SIGHUP closes it within 1 s. (Spec R-0118-b/-c/-d/-h.)
Measured 2026-10-19 at 57cfeca: one route serves all three questionslibs/mnemra-host/health.rs:623-639 answers 503 {"ready": false} until mark_ready, then serves schema::init::health_snapshot (schema/init.rs:757), which runs SELECT 1 and reports overall: "down" on an unreachable instance — and returns HTTP 200 for it (health.rs:627-629). A liveness probe on this route restarts the process on a database outage. Recorded as the measured starting point the amendment’s split corrects.

Reliability / durability (workspace supporting value — restart survival)

The product-tier inputs are the brief’s “Durable across restart” success criterion and its “Data lives outside the executable and its image” hard constraint (maintainer ruling 2026-09-15). The requirement that carries them is R-0116 in the V0 substrate spec. That’s a spec-requirement identifier, not one of the accepted-risk IDs further down this page; an R-code is a stable handle, but it only means what the spec that defines it says. Scenarios on this axis are written as [stimulus, environment, response, measure].

The axis states a reliability target. The indicator is the fraction of writes acknowledged to a caller before a stop that read back with identical content after the next start, as read from the caller’s side over the MCP surface. The objective is 100% on every restart. No window applies, because the property is per-restart rather than a rate. On a breach, the restart acceptance gate (verify-smoke) fails and blocks merge. In operation, a start that can’t honor the invariant refuses to serve (version mismatch, data directory in use) rather than serving a partial or empty store. No availability target (uptime) is stated for the host at V0, and that absence is recorded here as a decision rather than a blank.

RefinementScenario
Clean stop, then restartStimulus: SIGTERM to a host holding N acknowledged artifact writes. Environment: the production binary against an operator-configured data directory (MNEMRA_DATA_DIR), not a temporary one. Response: the host drains, stops the embedded postmaster, exits; a new host process starts against the same directory without re-initializing the cluster. Measure: every one of the N artifacts reads back via artifact.get with frontmatter and body equal to the pre-stop read, and the cluster’s system_identifier is unchanged across the two starts.
Hard kill of the hostStimulus: SIGKILL to the host process. Environment: as above; the embedded postmaster, daemonized by pg_ctl, survives the host and holds postmaster.pid against the data directory. Response: the next host start reclaims ownership from the dead same-boot holder recorded in host.lock, identifies the orphan as a live postmaster only on a full match (host uid, -D <data_dir>/pg in argv, start time matching the pidfile), stops it cleanly, and starts its own; a pid that fails the match is never signalled and the start refuses instead. Measure: every acknowledged pre-kill write reads back equal; exactly one postmaster runs against the directory afterwards; the second start does not re-initialize; an unrelated process holding a reused pid survives.
Hard kill of the storage engineStimulus: SIGKILL to the embedded postmaster, leaving a stale postmaster.pid (dead PID) and unflushed OS buffers. Environment: Postgres durability defaults intact (fsync, synchronous_commit, full_page_writes all on). Response: the next host start runs WAL crash recovery and serves. Measure: every write acknowledged before the kill reads back equal; no write acknowledged is missing.
Engine major-version mismatchStimulus: a host whose pinned engine major differs from the PG_VERSION of an existing data directory. Environment: an operator upgrading the binary in place. Response: the host refuses to start before any postmaster start, with a structured error naming the directory, the found major and the engine major, and touches nothing under the directory. Measure: the refusal is the host’s own error, the directory’s bytes are unchanged, and no second (empty) cluster is initialized beside the old one.
Two hosts, one directoryStimulus: a second host started against a data directory a live host already owns — on the same machine, or on another machine sharing a network mount. Environment: any deployment shape; on a network mount the lock semantics may be local-only, so the lock alone is not the fence. Response: the second host exits with a structured data_dir_in_use error — on the same machine because the lock is held, on another machine because the host.lock holder record carries a foreign hostname and boot id, which is refused without any liveness test; the first host and its postmaster are undisturbed. Measure: the first host’s writes continue to read back; exactly one postmaster runs against the directory; the holder record is unchanged.
Replace the executableStimulus: between the stop and the start, the executable is replaced — minimally, the same binary run from a different filesystem path. Environment: a bare-binary deployment; the container form (recreate from a different image, same volume) is parked with the image contract in the spec’s Out of Scope until an image exists. Response: the new host starts against the same data location. Measure: every acknowledged pre-stop write reads back equal (spec R-0116-j, locked in the bare-binary form by maintainer ruling 2026-09-17).

Amended 2026-10-19 (#4018, approved 2026-10-19 in #4018 activity 7800): re-derived against the operator-run instance. The reliability target above still stands, with one change to its breach clause. In operation, a host that can’t honour the invariant refuses to serve and reports why on GET /ready, rather than refusing to start. The six scenarios above fare differently under the amendment. “Clean stop, then restart” and “Hard kill of the host” carry over, with their responses rewritten in the table below. “Hard kill of the storage engine” is dropped, with a reason: the host can’t kill an instance it doesn’t own, and the guarantee is PostgreSQL’s, under settings the host verifies (spec R-0121-b). “Engine major-version mismatch”, “Two hosts, one directory” and “Replace the executable” no longer have an object, because there’s no host-owned directory. The version guard becomes R-0117-a/-h. Two hosts on one database is superseded by the shared-service HTTPS ruling (the next amendment, #4127) and is unsupported until then (P-0010 §Amendment AE9). The rows above stay as the record of the embedded-engine design.

Refinement (Amended 2026-10-19)Scenario
Clean stop, then restartStimulus: SIGTERM (or stdin EOF) to a host holding N acknowledged artifact writes. Environment: the production binary against the operator’s instance, MNEMRA_DATABASE_URL pointing at one database. Response: readiness goes 503 { "draining" }, the host drains and exits; a new host starts against the same URL, its instance check reports every hard requirement met and no migration pending, and it serves. Measure: every one of the N artifacts reads back via artifact.get with frontmatter semantically equal and body byte-equal to the pre-stop read (spec R-0121-a/-c).
Hard kill of the hostStimulus: SIGKILL to the host process. Environment: as above. Response: the next host start connects, checks, and serves; nothing on the instance needed reconciling, because the host owned no process there. Measure: every acknowledged pre-kill write reads back equal; an unacknowledged in-flight write may be absent (R-0121-a).
Durability setting drifts while servingStimulus: an operator (or a role-level default) sets synchronous_commit = off for the host’s role. Environment: a serving host with the 30 s drift re-check. Response: within one interval the check reports durability_off, readiness goes 503 naming the setting and value, every MCP call answers host_not_ready; after the setting is restored and SIGHUP is sent, the host serves again. Measure: no write is acknowledged under the weakened setting for longer than 30 s plus one check duration; the host pid is unchanged throughout (R-0117-d, R-0118-c/-d).
Over-privileged role or unforced RLSStimulus: the configured role is a superuser, holds BYPASSRLS, or a tenant-scoped table has NO FORCE ROW LEVEL SECURITY. Environment: any start or retry. Response: not ready with role_overprivileged { attribute } or rls_not_forced { table }; nothing is served. Measure: zero MCP verbs execute while the condition holds; mnemra check-db exits 1 naming the clause (R-0117-c/-e; #3591’s RLS precondition, verified rather than assumed).
Unverifiable is unmetStimulus: the role’s SHOW fsync is denied. Environment: an instance whose GUC visibility has been restricted. Response: the clause reports unverifiable, which the host treats as unmet; not ready, reason names the setting and the error. Measure: the host never serves on an assumed value; a unit test over injected facts shows one failing case per clause (R-0118-a).

The next refinements cover ABI stability. They become load-bearing once third-party plugin install turns on at V0.1 and later. The V0 work that hardens them is one discipline: mark each host function with a stability tier.

RefinementScenario
Pre-1.0 freedomAn ABI-change PR causes all core: true plugins to recompile against the new ABI and pass their tests.
Stability-tier mark (WIT pattern)A plugin calling an @unstable host function emits a deprecation warning to the log; a plugin calling a @deprecated host function gets a structured error.

Dogfood-cycle correctness (mnemra-NFR — V0 success criterion)

RefinementScenario
Functional parityA workspace-cutover audit cross-reference table shows zero remaining invocations of the prior task-store binary in operational tooling (skill files, slash commands, hook scripts, utility scripts) post-cutover.
Canonical-day fixtureA scripted day’s worth of dispatches, task CRUD, skill-run lifecycle, and daily-log generation runs end-to-end against V0 mnemra-core; every verb succeeds; no fallback to the prior tooling.

Data-flow diagram

The diagram below is written in D2, the project’s chosen graph format. The mdBook, D2, and Mermaid wiring is fixed in G-0026, a workspace-wide (global) architecture decision that all projects inherit. Every typed element ID is addressable so the terminal-review threat-modeling pass can annotate it with STRIDE per element: TB-* for a trust boundary, EE-* for an external entity, P-* for a process inside the host, DS-* for a data store, and DF-* for the edge labels. The comments marked “Amended 2026-10-19 r2” record the operator-run-instance retype described under the trust boundaries below.

TB-agent-runtime(MCP client host process)TB-humanTB-build-pipeline (conceptual)TB-mnemra-host (single-process server)TB-plugin-sandbox (WASM, per plugin)TB-postgres (operator-run PostgreSQL instance; the operator's zone)TB-obs-sink (external, operator-chosen; deferred — obs baseline)TB-fs-secrets (mode 600)TB-fs-source (read-only at migration)TB-fs-backupTB-external-llmEE-orchestrator-agentEE-specialist-agentEE-operatorEE-mnemra-root(signing authority)P-mcp-handler (stdio)P-cli-handlerP-host-fnsP-migration-handlerP-backup-handlerP-liveness-handler(GET /health; non-runtime thread; never touches the DB)P-readiness-handler(GET /ready; reads the last completed check)P-metrics-handler(GET /metrics; renders the snapshot /ready reads; no DB)P-instance-check(facts probe + decision; serving role; bounded, supervised)P-cli-check-db(mnemra check-db; second credential-holding client)P-plugin-runtime(Wasmtime)P-builtin-projects(host-builtin, not plugin)P-builtin-agents(host-builtin, not plugin)P-builtin-workspaces(tenant boundary)P-builtin-auth(OIDC RS + admin token)P-builtin-users(host-builtin, not plugin)P-builtin-sessions(per-MCP-connection)P-builtin-permissions(per-plugin permissions)P-plugin-instance(WIT host-fn-only IO)DS-pg-contentDS-pg-stateDS-pg-projectionsEE-other-principals(other roles, apps or tenants on a shared or managed instance)EE-stdout-otel(stdout logs + OTel metrics/events egress)DS-admin-tokenDS-mnemra-root-key(custody: open ADR slot)DS-db-password-serving(MNEMRA_DATABASE_PASSWORD_FILE)DS-db-password-owner(MNEMRA_DATABASE_OWNER_PASSWORD_FILE; init only)DS-source-taskdb(prior task store, SQLite)DS-source-corpus(prior content corpus, markdown)DS-fs-backupEE-llm-provider(embeddings endpoint)  DF-mcp-stdioDF-mcp-stdioDF-cli-invokeDF-auth-checkDF-builtin-callDF-builtin-callDF-builtin-callDF-verb-dispatchDF-plugin-invokeDF-host-fn-callDF-host-fn-callDF-host-fn-callDF-host-fn-callDF-host-fn-callDF-host-fn-callDF-host-fn-callDF-substrate-rwDF-substrate-rwDF-projection-rebuildDF-telemetry-emitDF-embed-callDF-sampling-upDF-token-readDF-migration-triggerDF-backup-triggerDF-migration-readDF-migration-readDF-migration-writeDF-migration-writeDF-telemetry-emitDF-backup-readDF-backup-writeDF-signing-attest  DF-key-custody(open ADR slot)DF-signature-verifyDF-health-probeDF-ready-read(last completed result; no DB)DF-db-password-readDF-db-password-readDF-sighup(forced retry; password reload)DF-cli-invokeDF-health-probeDF-db-password-readDF-setup-sql(roles, grants, CREATE EXTENSION; operator's privilege)DF-db-password-read















































Notes on the diagram

  • There’s no REST surface, on purpose. V0 exposes none. Admin operations go through the admin CLI’s local IPC; agent operations go through MCP. The plugin-defined REST routes from the earlier alignment record (deferred in round 1) and any admin REST from predecessor specs aren’t present at V0. A REST surface arrives at V0.1 or later, if and when the streamable-HTTP MCP transport turns on. That’s the microVM-appliance trip-wire.
  • No external authorization server at V0. The V0 dogfood run uses the static admin token at the filesystem secrets boundary. OIDC authorization-server integration is V0.1 and later. It’s an idea-tier entry in the brief, meaning a captured direction with no pipeline artifact behind it yet, the earliest tier in the feature register.
  • The builtin components run inside the host process, not in the plugin sandbox. The seven P-builtin-* nodes (P-builtin-projects, P-builtin-agents, P-builtin-workspaces, P-builtin-auth, P-builtin-users, P-builtin-sessions, P-builtin-permissions) execute as host code. This fixes the predecessor framing, which drew projects and agents as plugins inside TB-plugin-sandbox. The corrected version matches the locked brief’s 0.1.0 substrate description and the Frame’s list of builtins: Workspace, Users, Agents, Authentication, Agent sessions, Per-plugin permissions, Projects.
  • The persisted storage shapes are visible; observability is emitted, not stored in-app. The content (DS-pg-content) and state (DS-pg-state) substrates are ordinary Postgres tables. Those are the two persisted shapes at V0. (Re-derived 2026-06-09 per the observability baseline: the former timeseries shapes (DS-ts-metrics, DS-ts-events) and the log shape (DS-pg-logs) are observability emission surfaces now. The host emits structured logs to stdout and OTel metrics and events to a configurable export, drawn here as the external TB-obs-sink telemetry-egress node. None of that is in-app Postgres storage. The storage backend is the operator’s choice, sitting behind the separation of generation from storage, deferred and absent from the binary at V0.)
  • The TB-build-pipeline trust boundary is conceptual. The signing authority runs at build time, and the runtime sees the signature, not the key. Where the actual key material lives (on the deployment node, in an HSM, fetched at runtime, or never on the node at all) is the open ADR slot {{P-SigningKeyCustodyHardening}}. That’s Tier C, activated by the multi-deployment trip-wire in P-0005-v0-signing-chain.
  • The external LLM is for generative work only; embeddings and reranking stay local (modified 2026-07-02 under RC-1, the retrieval-cluster intake’s model-hosting amendment). This bullet is the named lagging copy of the brief’s external-embedding framing, reconciled here. Under the amended Hard constraints, mnemra-core MUST NOT host a generative LLM. Local non-generative inference runs host-side and never leaves the host: BGE-M3 for embedding and BGE-reranker for reranking, both encoder models behind the host-function seam. What does call out to the external provider are the retrieval cluster’s four generative placements: chunk-context and tag generation at index time, HyDE rewrite and optional synthesis at query time. Each is policy-gated at the model-egress gate, can be turned off on its own, and is bounded. Turning all four off is a supported V0 configuration with zero egress. The API-key configuration surface stays folded into 0.1.0 (the brief’s T-5 resolution) and now serves those generative call-outs. The drawn diagram below still shows the pre-RC-1 DF-embed-call flow and the EE-llm-provider “(embeddings endpoint)” label. The retyped retrieval-cluster elements (the four DF-egress-4.x flows crossing TB-external-llm, the EE-model-artifact-source entity, and the new retrieval processes and stores) are recorded in P-0014’s typed-DFD extension. The diagram and the threat tables get re-drawn against it when that cluster’s pre-implementation security review updates this overview. That’s the named follow-up; the prose in this file is already reconciled. One more path: MCP sampling (DF-sampling-up) is how a plugin asks the connected agent’s MCP client to run an LLM completion, and the provider that completion uses is external to mnemra-core.

Threats by data-flow element

The Stage 2 terminal security review filled this in on 2026-05-22, following the workspace threat-modeling skill. Each row keys on one of the typed DFD element IDs above and applies STRIDE per element. The element-type relevance bar is applied: categories that don’t apply to an element type are skipped, not padded out.

Element typeApplicable STRIDE
External entities (EE-*)S, R
Processes (P-*)S, T, R, I, D, E
Data stores (DS-*)T, R, I, D
Data flows (DF-*)T, I, D

The table below adds two columns to the placeholder set, Severity and Confidence (0 to 100), per the workspace threat-modeling discipline. Severity is one of Critical, High, Medium, or Low. The Mitigation column points at the Frame’s Open ADR Slot IDs ({{P-XXX}}) when a slot already covers the control class. New slots are flagged {{P-XXX — new}} so they surface as Spec-stage follow-ups. Three rows added by the 2026-10-19 amendment retarget the two P-health-handler rows onto the split liveness and readiness handlers and add the instance check.

Element IDSTRIDEThreatSeverityConfidenceMitigation candidate
EE-orchestrator-agentSAn MCP client process forges an orchestrator identity by presenting a valid token leaked from another agent’s keystore or shell history; the host has no way to bind tokens to a specific process.High75[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (token-scoping + per-agent token discipline); workspace-claim-in-token enforcement at P-builtin-auth
EE-orchestrator-agentRAn orchestrator dispatches a destructive verb (e.g., bulk delete) and later denies the action; without per-token attribution on every write, the audit trail names the workspace but not the issuing agent.High80[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) + activity-log capability (0.5.0) carrying (workspace_id, agent_id, session_id) tuple on every write
EE-specialist-agentSA specialist runs under a delegated session and is impersonated by another specialist sharing the same workspace token; sub-agent identity is not distinguishable from the orchestrator’s identity at the host.Medium70[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (per-agent token derivation); designed-for at session model
EE-specialist-agentRA specialist’s destructive write is not attributable beyond “agent inside workspace X” because the MCP session does not name the specific specialist.Medium70Same as EE-orchestrator-agent/R
EE-operatorSA second user on the deployment host reads the admin token file (file-mode regression, backup-tooling leak, accidental world-readable mode after restore) and impersonates the operator.Critical80[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (token rotation, file-mode invariant check at startup); [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) informs the V0 secrets-management posture; {{P-SigningKeyCustodyHardening}} for production-grade secrets posture
EE-operatorRAn operator runs a destructive admin operation (drop-workspace, force-restore-overwrite) and denies it; the operator’s identity is the local UNIX user — no second factor, no audit trail beyond OS audit.High75[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (admin-action audit log; tie destructive ops to a distinct audit event); accepted-risk R-0006 if deferred
EE-mnemra-rootSA compromised CI environment forges a “mnemra-root-signed” plugin artifact, and the runtime accepts it because signature verification uses a key the attacker controls.Critical70{{P-SigningKeyCustodyHardening}} (key isolation; ceremony; offline-root pattern); separate from runtime entirely
EE-mnemra-rootRA signing event is non-repudiable only if signing is logged; absent a transparency log of signed plugins, a malicious “core: true” plugin could be denied as ever having been signed.Medium60{{P-SigningKeyCustodyHardening}} (transparency log; sigsum or rekor-style append-only signing log)
EE-llm-providerSThe host fetches embeddings from a TLS endpoint that an attacker has positioned as the configured provider (DNS rebind, typo-squatted hostname, untrusted CA injection); embeddings are tampered or harvested for content-corpus reconstruction.High70[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) + outbound HTTPS pinning policy (cert pin or trusted-CA bundle declared in config); LLM-API-key surface in 0.1.0 ships hostname allowlist
EE-llm-providerRThe provider could later deny logging request metadata (artifact bodies / fragments / dispatch traces inferable from embed inputs); the deployment has no independent receipt.Low60Accepted-risk R-0005 (telemetry no-leak is dogfood AC, not policy-enforced)
P-mcp-handlerSA bogus MCP client presents a forged token; the handler accepts because it does not bind the token to an authenticated session and does not consult P-builtin-auth on every request.Critical85[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (mandatory DF-auth-check on every request; per-request token verification with replay defense)
P-mcp-handlerTA stdin-fed MCP request injects oversized or malformed JSON-RPC that breaks the parser into a non-conforming state; subsequent requests on the same stream are routed incorrectly.High70{{P-MCPWriteSemantics}} (input-size cap, framing-error fail-shut, structured parse_error JSON-RPC code); explicit MCP 2025-06-18 input validation (Amended 2026-10-29, #4249, ruling #4249 activity 9183: a line that is not valid JSON is answered with JSON-RPC -32700, id null, and the session stays open, so a framing error does not fail shut; only a line over the input-size cap ends the session. The host does not send that reply yet; #4323 adds it. P-0012 §Amendment 2026-10-25 (MCP protocol revision).) (Refined 2026-10-29, #4249 activities 9244 and 9258: read “a framing error” in the note before this one as “a malformed line”, meaning a line that is not valid JSON. A line over the input-size cap is a framing fault too, and it does fail shut. An empty line is not a message and gets no reply.)
P-mcp-handlerIA correctly-authenticated workspace-A token issues a verb whose handler’s query was malformed; without RLS policy enforcement at V0, workspace-B rows surface in the response.Critical85[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (RLS policy enforcement at V0.1+; column-shape at V0); pre-mitigation: a workspace-scope-on-every-query lint and integration test in the host-fn surface
P-mcp-handlerDAn adversarial client floods stdio with verbs that exercise the most-expensive code path (vector search, projection rebuild) — single connection, no rate limit.High75{{P-MCPWriteSemantics}} (per-session rate limit; cost-aware queueing); observability ships from 0.1.0 so the floor is detectability
P-mcp-handlerEAn MCP verb invokes a host function that was meant for control-plane only (e.g., a debug-only “dump tokens” verb left exposed by a builtin’s manifest mis-declaration); the agent gains operator-level capability.High65[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (verb-to-capability allowlist; control-plane verbs not exposed via MCP); compile-time enforcement preferred
P-cli-handlerSA second process on the host invokes the CLI as the operator user; OS-level checks alone (the UID match) accept it.Medium70[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (admin token mandatory for destructive ops; OS-uid alone is insufficient gate)
P-cli-handlerTA CLI argv injection arises when a subcommand interpolates a parameter into a Postgres role-management call (role-grant, workspace-create) without escaping.High70{{P-MCPWriteSemantics}} covers MCP write semantics; CLI surface needs its own parameter-binding discipline — surface as {{P-AdminCLIDiscipline — new}}
P-cli-handlerEA schema-driven dynamic subcommand generated from a malicious or mis-declared plugin manifest exposes a destructive op (migrate-overwrite) at the operator CLI without intent.High70[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (manifest validation; capability tier on subcommands; destructive ops behind an explicit confirmation gate); core: true only for the V0 dogfood path
P-host-fnsTA host-fn writes content with caller-supplied workspace_id rather than deriving it from the session — a plugin (or builtin) supplies an attacker-chosen value and writes into a foreign workspace.Critical90[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) + [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (host derives workspace_id from the session/token; ABI MUST NOT accept workspace_id as a parameter on write paths); structural invariant
P-host-fnsIA read-side host-fn returns rows that pass workspace-scope but include columns the plugin has no manifest declaration for; cross-content-type leak inside one workspace.High70[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (per-plugin column projection; manifest declares readable columns; host-fn enforces)
P-host-fnsEA host-fn intended for a core: true plugin (e.g., mnemra.workspace.add_user) is callable from a non-core plugin because the ABI does not key on plugin identity.Critical80[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (per-plugin host-fn allowlist keyed on signed manifest; non-core plugin’s allowlist is a strict subset)
P-host-fnsREmbedding-call (DF-embed-call) traffic carrying artifact-derived inputs lacks a structured trail tying which workspace’s content was sent to which external request.Medium65observability baseline (per-egress audit event emitted with (workspace_id, artifact_id, provider_hostname) — generation-side, lands in the operator-chosen sink)
P-migration-handlerTMigration writes to substrate tables (DS-pg-content, DS-pg-state) using a privileged DB role; if migration is re-runnable, an attacker who can trigger it could mass-corrupt content under cover of “resume from checkpoint.” (Re-derived 2026-06-09: the former DS-ts-*/DS-pg-logs in-app stores are gone — migration emits progress/audit telemetry via the egress path per the observability baseline, not in-app storage writes.)High65{{P-MigrationID}} + {{P-CutoverDualWrite}} (migration gated on admin-token capability; idempotency keyed on per-record manifest, not “rerun whole import”)
P-migration-handlerIMigration reads source frontmatter that may contain credentials, private-note content, or secrets embedded in markdown; if the migration log captures source content (for debugging), the log becomes a sink for sensitive data.High70{{P-MigrationID}} + observability baseline (migration log emits IDs and per-record outcome only, never content; redaction at the emission boundary; policy named in the migration spec)
P-migration-handlerDA SIGKILL mid-migration leaves the substrate in a partial state; a re-run that did not consult the per-record progress manifest could re-process records and exhaust connection-pool / disk-space budgets.Medium75{{P-MigrationID}} (per-record progress manifest mandatory; resume reads manifest first)
P-backup-handlerIThe backup stream contains every row of every substrate (including tokens, secrets-stored-as-content, dispatch artifacts) — the backup file is a higher-value compromise target than the live DB.Critical85{{P-BackupRestore}} (backup encryption-at-rest mandatory; key separate from DS-admin-token); access-control on DS-fs-backup path
P-backup-handlerTAn attacker with write access to DS-fs-backup poisons a backup that a future restore consumes (introducing a malicious admin token, a forged workspace, or rewritten core: true plugin metadata).Critical80{{P-BackupRestore}} (backup signed at write; restore verifies signature; round-trip-verify before destructive operations)
P-backup-handlerDAn adversary triggers continuous backups (CLI-exposed or scheduled-job-exposed) to exhaust disk space, taking the substrate read-only and the host degraded.Low60{{P-BackupRestore}} (backup-trigger rate-limit; disk-space precondition check)
P-health-handlerIA health-endpoint detail body leaks substrate state to an unauthenticated probe (extension list, table presence, workspace count).Medium70observability baseline (health response shape: the listener binds loopback-only at V0, so loopback IS the gate — no non-loopback caller can reach the detail body; named tripwire: if the listener ever binds non-loopback, admin-token gating on the detail body becomes required)
P-health-handlerSThe health endpoint is unauthenticated and shares a transport with MCP; a load-balancer probe could be fabricated and used as an oracle for substrate state.Low55observability baseline (separate handler binding for /health, the first API on a dedicated loopback-only listener; not on MCP transport at V0 since transport is stdio)
(Amended 2026-10-19 r3, #4018 — the two P-health-handler rows above are retargeted, not orphaned: the element is split (see the r2 retype subsection).) P-readiness-handlerIThe same leak as the first row, now on GET /ready’s checks body (clause statuses, reasons, guidance).Medium70Loopback-only bind is still the gate; the MCP surface gets only the coarse host_not_ready (spec R-0118-h); the non-loopback tripwire carries (R-0004-g) (Amended 2026-10-29, #4412, ruling 9279: the gate is now the host’s uid, not the loopback bind. The listener is a 0600 unix socket in a 0700 per-uid directory, with a peer-uid check (spec R-0004-g as amended, HS-1 to HS-4), and the tripwire is HS-6.)
P-liveness-handler, P-readiness-handlerSThe same fabricated-probe oracle as the second row, now on two routes.Low55Loopback-only listener; /health carries no substrate state at all (R-0118-e), so the oracle value of a fabricated liveness probe is nil (Amended 2026-10-29, #4412, ruling 9279: the listener is the owner-only socket, so a fabricated probe can only come from the host’s own uid.)
(Amended 2026-10-29, #4412: extends the r3 P-readiness-handler I row above for connection_target, spec R-0118-f as amended 2026-10-29; Warden, #4412 activity 9265.) P-readiness-handlerIGET /ready now carries connection_target (the host or socket directory, the port, the database, sslmode, and the server and pgvector versions). Its credential_file_rejected reason already carries the password file’s path (R-0119-b). A same-host process under another uid reads both from the unauthenticated loopback listener, and so learns the target for the local-transport spoofing row of the operator-instance retype below (a process that binds the port or pre-creates the socket).Medium72OPEN, for the maintainer. (a) Accept: amend this row and add an accepted-risk line naming the single-user-host assumption, that no process under another uid runs on the host. (b) Mitigate: move the /health + /ready + /metrics listener to a 0600 unix socket under the per-user runtime directory, which amends R-0004-g and retires MNEMRA_HEALTH_PORT. Mnemra is planned to go multi-user, so (a)’s premise is time-limited. No option is recommended here; the choice is the maintainer’s. RULED 2026-10-29 (#4412 activity 9279, “Owner-only socket”): closed by the 0600 owner-only socket. The listener is a unix-domain socket at 0600 in a 0700 per-uid directory, and a connection whose peer uid isn’t the host’s is closed without a byte (spec R-0004-g as amended, HS-1 to HS-4). So a process under another uid reads neither connection_target nor the path. Not chosen: (a), whose premise expires when mnemra goes multi-user; and dropping connection_target, which reverses part of SG-4 (ruling 9187). New residual, Low, awaiting the maintainer’s sign-off with this amendment: on a shared Linux host without XDG_RUNTIME_DIR, another uid can pre-create /tmp/mnemra-<uid>. The host then exits naming the owner check (HS-1). That’s loud and costs availability only, and the remedy the deployment document names is XDG_RUNTIME_DIR or MNEMRA_HEALTH_SOCKET. (Amended 2026-10-29, #4412, round 2 (Bolt F2; maintainer ruling 2026-10-29, #4412 activity 9343 item (3)): “closed by the socket” held only for the /ready body, because the readiness INFO lines also carried connection_target to stderr and whatever collects it. Those lines no longer carry it (spec R-0118-j as amended), so the row is closed for both. The residual named above is now its own D row below, signed off at 9343 (2).)
(Added 2026-10-29, #4412; Warden, #4412 activity 9265.) P-metrics-handlerIAn unauthenticated scrape reads host_ready{clause}, instance_check_total, instance_check_duration_seconds and seconds_since_last_ok. That tells the reader whether the host is serving, its first failing clause, and the check history.Low75Loopback-only bind (R-0004-g); label values from closed sets compiled into the binary, never from a request, the configuration or connection_target, with \, " and newline escaped (R-0118-j as amended 2026-10-29); the non-loopback tripwire names /metrics, and behind it an unauthenticated caller gets 401 with an empty body (R-0004-g as amended 2026-10-29) (Amended 2026-10-29, #4412, ruling 9279: the scrape is now same-uid only. The owner-only socket with a peer-uid check replaces the loopback bind (R-0004-g as amended, HS-1 to HS-4), and HS-6 replaces the non-loopback tripwire. A separate scraper needs a proxy running as the host’s uid (R-0118-j as amended), which then carries this exposure to whatever reaches the proxy.)
P-metrics-handlerDThe listener accepts one connection at a time, each bounded by the 10 s CONNECTION_DEADLINE and the 8 KiB request cap (libs/mnemra-host/health.rs). A same-host client that holds a connection open stalls /metrics, and /health and /ready with it, so an exec probe with its 2 s client timeout exits 2 (R-0118-d).Low80Each route renders from a snapshot of the last completed check and never blocks the async runtime or the check. The stall ends at the 10 s deadline. Residual, Warden’s proposed disposition: accepted (head-of-line blocking by a same-host client), subject to the maintainer’s sign-off with this amendment (Amended 2026-10-29, #4412, ruling 9279: only a client under the host’s uid can now hold a connection open, so the stall needs a same-uid process. A connection from another uid is closed at accept, without a read (HS-4).)
(Added 2026-10-29, #4412, round 2; maintainer ruling 2026-10-29, #4412 activity 9343 item (2), signed off as availability-only.) The health listener’s directory (P-liveness-handler, P-readiness-handler, P-metrics-handler)DOn a shared host without XDG_RUNTIME_DIR, another uid creates /tmp/mnemra-<uid> before the host’s first run. The host refuses the directory and exits on every start. In a sticky /tmp the squat survives restarts until a reboot or a /tmp cleanup. It discloses nothing and grants nothing.Low80The host checks the directory’s owner and mode and its parent’s owner and sticky bit, and exits with a line naming the squatter’s uid (spec R-0004-g HS-1, as revised). The deployment document names the squat and its remedy, MNEMRA_HEALTH_SOCKET. Residual accepted by the maintainer at 9343 (2) as availability-only
P-instance-checkIThe check’s instance_check log record carries clause statuses and guidance to the structured-log sink.Low60Never carries credentials or the URL’s secrets (R-0117-i detail rule, R-0119-a logging rule); the sink is the operator’s (R-0004-d)
P-plugin-runtimeTA WASM module exploits a Wasmtime sandbox-escape primitive (rare, but the load-bearing assumption — sandbox integrity — is exactly what plugin-IO-free buys); host invariants violated.High50[P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) + [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (Wasmtime version pinning under SBOM; core: true only at V0; supply-chain review on Wasmtime upgrades); see also {{P-SigningKeyCustodyHardening}} for production-grade supply-chain hardening
P-plugin-runtimeEA plugin whose signature verification was skipped under a load-time error path (e.g., “key not loaded yet, defer to background”) gets executed before verification completes.Critical70[P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (verification is synchronous on plugin load; load fails closed; no “verify-async” path)
P-plugin-runtimeDA plugin infinite-loops or allocates without bound; absent kill-and-replace from the pool, the host hangs the verb.Medium70[P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) (per-instance fuel/memory budget; pool kill-and-replace; per-verb timeout)
P-plugin-runtimeRA plugin failure (panic, sandbox abort) is not durably attributed to a specific plugin+version+sig — operator cannot tell which artifact misbehaved across deployments.Medium60[P-0007-plugin-resource-limits](../adrs/P-0007-plugin-resource-limits.md) + observability baseline (per-plugin-instance event stream emitted with signed-artifact identity — generation-side; durability is the operator-chosen sink’s)
P-plugin-instanceEA plugin requests a host-fn (DF-host-fn-call) outside its manifest’s declared surface; if the host’s permission check is at call-time and the plugin’s manifest was loaded laxly, the plugin gains a capability it did not declare.Critical80[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (manifest-declared host-fn surface compiled into the per-instance allowlist; calls outside the allowlist fail at the WIT boundary, not at the host-fn body)
P-plugin-instanceTA plugin returns crafted bytes intended to defeat host-side parsing of plugin output (e.g., NUL bytes that desynchronize a downstream JSON serializer, oversized fields that DoS a projection rebuilder).High65[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (host validates plugin output against the WIT-declared schema; size caps per field; parser is fail-shut on schema mismatch)
P-plugin-instanceIA plugin uses DF-sampling-up (MCP sampling: plugin → host → MCP client’s LLM) to exfiltrate content from one workspace into a prompt the connected agent’s LLM provider sees, even though the plugin had no outbound network.High75[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (manifest declares sampling: allowed/denied; if allowed, content fields the plugin can put in prompts are typed-restricted); at V0.1+ with third-party plugins this becomes Critical
P-builtin-authSThe auth builtin accepts a token whose signature is valid against a previously-trusted key whose rotation was incomplete; old-key tokens are still accepted past the rotation.High70[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (per-deployment OIDC AS via RFC 9728; key rotation discipline with explicit cutover; old keys removed, not coexistent)
P-builtin-authEA bug in workspace-claim extraction defaults to default workspace when the claim is absent, granting access to the dogfood workspace from any authenticated token.Critical80[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (workspace claim is mandatory; absence is a hard auth failure, not a default; structural invariant)
P-builtin-workspacesEA workspace-create / workspace-delete verb is exposed to non-admin tokens because the builtin authorizes on workspace-claim presence rather than on a distinct admin scope.Critical75[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (workspace lifecycle ops require admin scope; admin-scope tokens are a strict superset, distinguished by claim)
P-builtin-projectsIProject metadata (project names, repo paths, dispatch-time references) is queryable cross-tenant before RLS policy enforcement; the structural workspace_id column is present but reads are not policy-filtered.High75[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (RLS policy enforcement is V0.1+; pre-mitigation at V0 = manual host-side scope check on every read path, lint coverage on absence)
P-builtin-agentsRAn agent registration recorded the wrong principal (mis-mapped from token) and later actions are attributed to the wrong agent identity; the audit log records the action but not the discrepancy.Medium60[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (agent identity derivation is canonical at registration; mismatch surfaces a structured error rather than silent registration)
DS-pg-contentTA SQL-injection-style write through a host-fn that interpolates a content field into a query body — content-typed columns are not the obvious vector; metadata-typed (e.g., tag-name) columns are.Critical70[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) + [P-0001-storage-layout](../adrs/P-0001-storage-layout.md) (parameterized queries only; metadata fields normalized + length-capped; type-tightening at host-fn boundary)
DS-pg-contentIDirect DB access from a process other than P-host-fns (a misconfigured backup tool with read-anywhere role, an operator with full Postgres credentials, a future read-replica without RLS) returns cross-workspace rows.High75[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (RLS column-shape ships V0; policy enforcement at V0.1+); deployment-side: separate DB role per host process, least-privilege
DS-pg-contentRContent deletions or modifications are not recorded with prior-value snapshots; an operator-issued destructive op is repudiable as “the agent did it.”Medium65[P-0001-storage-layout](../adrs/P-0001-storage-layout.md) + {{P-FKPreservation}} (immutable activity log per write; prior-value capture for destructive ops; ties to 0.5.0 activity log)
DS-pg-contentDA pathological projection rebuild triggered by a content write storms the substrate, blocking reads on DS-pg-projections (and indirectly DS-pg-content via FK consistency checks).Medium65{{P-ProjectionRebuild}} (rebuild queueing; backpressure; out-of-band rebuild path)
DS-pg-stateTState writes from a builtin (e.g., agent-session state) interleave with concurrent CLI writes (e.g., admin token rotation), producing torn state that no constraint catches.Medium65{{P-MCPWriteSemantics}} (OCC or transactional discipline on state shape; constraint-checked writes only)
DS-pg-projectionsIA projection contains denormalized content from cross-tenant sources (a vector index over content not partitioned by workspace) — a query inadvertently reaches it.High70{{P-ProjectionRebuild}} + [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (projections partitioned by workspace; vector indexes keyed on (workspace_id, vector))
DS-ts-metrics (emitted metric records)IEmitted metric records include verb names, argument shapes (low-card sketches), and per-tenant counts; a sink that mixes tenants leaks usage patterns cross-tenant.Medium65observability baseline (workspace_id on every emitted metric record — the tenant dimension is emission-side, so the operator’s sink can partition; no in-app hypertable to cross-query); [P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (admin-tier visibility distinct)
DS-ts-events (emitted event records)TEvent-shape evolution is uncontrolled (new event-types from new capability families) and downstream consumers misread old events when types are reused.Medium60observability baseline (versioned event schema; event_version field — an emission-side invariant; backward-compatible additions only without explicit migration)
DS-ts-events (emitted event records)IDispatch events capture content fragments in their description / payload (the dogfood telemetry-no-leak AC is a check, not a structural barrier).Medium70Accepted-risk R-0005 at V0 (dogfood AC); observability baseline (typed event payload, content-IDs only, never bodies — emission-side, holds whatever the sink)
DS-pg-logs (emitted stdout logs)IEmitted logs include token fragments, query strings with PII content, or stack traces with workspace identifiers; a log-tail-as-debugging affordance leaks across tenants if logs are not workspace-scoped.Medium70observability baseline (workspace_id on every tenant-scoped emitted log record; redaction at the emission/log-write boundary for high-entropy strings — emission-side, regardless of sink)
DS-admin-tokenIThe admin token file is read by a backup process whose role has read-everywhere and writes the token into the backup stream in clear; the backup file then carries the admin secret.Critical80{{P-BackupRestore}} (secrets excluded from backups by path policy; or backups encrypted with a separate key, not the admin token)
DS-admin-tokenTA second process on the host overwrites the admin token file (e.g., a misbehaving config tool); the host accepts the new token because it is read on-demand.High70[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (token-file inode pinning at startup; modification fail-shut, with explicit rotation operation)
DS-admin-tokenROperator-side rotation of the admin token is not logged structurally; rotation events cannot be audited after the fact.Low60[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (rotation is a CLI verb that emits a structured rotation event — destination per the observability baseline — and writes the activity log)
DS-mnemra-root-keyIThe signing key material lives on the deployment node (the V0 dogfood position); a host-read primitive recovers the key, and an attacker thereafter signs forged core: true plugins.Critical85[P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (V0: build-host-on-disk for dogfood only; multi-deployment trip-wire fires {{P-SigningKeyCustodyHardening}}); {{P-SigningKeyCustodyHardening}} (key NOT on deployment node — offline-root + per-release certificate; or HSM-backed)
DS-mnemra-root-keyTEven if custody is offline, a transitively-trusted intermediate signing key (sub-CA pattern) on the build pipeline could be tampered if the pipeline is compromised.High60{{P-SigningKeyCustodyHardening}} (build-pipeline integrity invariants; signed pipeline configuration; signing-environment attestation)
DS-source-taskdbTThe migration source is read-only by intent; if migration writes-back (e.g., to mark records “migrated”), an attacker who can modify the source taskdb during migration can replay or rewrite migrated records.High70{{P-MigrationID}} (source is strictly read-only; migration manifest is mnemra-side; source-side “migrated” markers are out-of-band, not source-side state)
DS-source-corpusISource markdown frontmatter contains arbitrary content; if migration logs verbatim source paths and titles, log readers may see internal-project codenames or sensitive identifiers that were never meant to surface in operational telemetry.Medium65{{P-MigrationID}} + observability baseline (migration log emits derived IDs only; source paths hashed in emitted log lines if needed for resume)
DS-fs-backupIBackup contents include the full substrate (tokens, secrets, content); same compromise surface as the live DB plus offline-accessibility.Critical85{{P-BackupRestore}} (encryption-at-rest mandatory; key custody separate from substrate; backup file ACLs explicit)
DS-fs-backupTAn adversary swaps in a poisoned backup; restore consumes it without integrity verification.Critical80{{P-BackupRestore}} (backup-manifest hash verified before restore; signed manifest if backup-key custody allows)
DF-mcp-stdioTStdio framing is non-self-describing; a man-in-the-stream (e.g., a wrapping process the agent invoked) modifies request/response bytes after the handshake.Medium60{{P-MCPWriteSemantics}} (transport hardening — stdio at V0 trusts the spawning process; streamable-HTTP V0.1+ ships TLS)
DF-mcp-stdioIThe same wrapper observes content responses; at V0 stdio there is no transport-level confidentiality.Medium60Accepted-risk R-0003 (stdio-only at V0; transport confidentiality lands with {{P-MCPWriteSemantics}} and V0.1+ streamable-HTTP)
DF-host-fn-callTHost-fn arguments are passed as raw bytes the host trusts to be well-typed; a plugin crafts a struct-shape that exploits a host-side deserializer (e.g., an enum with an unexpected discriminant).High65[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (WIT-defined types only; codegen-generated bindings on both sides; size-bounded fields)
DF-host-fn-callIA host-fn returns content (e.g., search results) whose row set was filtered by workspace_id after database read rather than as a WHERE-clause condition — a query plan change or bug surfaces foreign rows the filter then drops; an interposed metric on row-count leaks cross-workspace counts.High65[P-0009-rls-admin-token](../adrs/P-0009-rls-admin-token.md) (workspace filter is WHERE-clause-mandatory; lint enforces; metric exports redact row-counts to per-workspace buckets)
DF-sampling-upTA plugin shapes prompt content that, when the connected agent’s MCP client runs the LLM completion, induces the LLM to emit a destructive verb the orchestrator then executes. (Prompt-injection through the plugin surface.)High70[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (sampling-allowed plugins are an explicit manifest capability; at V0 all plugins are core: true so the surface is contained; V0.1+ third-party plugins escalate this to Critical)
DF-sampling-upIThe plugin can include arbitrary content in the sampling prompt, including content from other workspace artifacts the plugin is read-authorized for, which then traverses the agent’s MCP client and reaches the agent’s LLM provider — content leaves the deployment trust boundary by design.High75[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (sampling-prompt fields typed; content-IDs only, not bodies, for cross-artifact references; LLM-provider hostname allowlist)
DF-embed-callIArtifact bodies are sent to an external LLM provider for embedding; the provider has full content access by design.High90Accepted-risk R-0005 (external-LLM embed-call is the brief’s explicit non-goal carve-out; LLM-API-key surface is in 0.1.0 and a hostname allowlist applies); compensating: BYO-provider deployment posture
DF-embed-callTA man-in-the-middle on the embed path could rewrite embedding vectors, poisoning the vector index.Medium55[P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) (cert pinning on the embed provider; TLS verification mandatory; out-of-band vector-index integrity verification on rebuild)
DF-signing-attestTThe signing-attestation flow trusts the build pipeline’s identity assertion; a compromised pipeline forges an attestation.High60{{P-SigningKeyCustodyHardening}} (attestation is signed by the offline root; pipeline-identity claims are inputs to attestation, not the attestation itself)
DF-migration-writeTMigration writes interleave with concurrent CLI / MCP writes during cutover — the brief’s cutover dual-write window — and content diverges between source and substrate.Critical70{{P-CutoverDualWrite}} (cutover is single-writer; migration window holds an exclusive lock or operates pre-cutover; explicit “no concurrent writes” gate)
DF-key-custodyIIf key material flows from the build pipeline to the deployment node at any point, the network transit and the storage at rest are both leak surfaces.High70{{P-SigningKeyCustodyHardening}} (key NEVER flows to deployment; runtime sees signature only; or HSM-backed where applicable)

Trust boundaries

The Stage 2 terminal security review filled this in on 2026-05-22. The placeholder columns get one addition, Threats at crossing, which holds element-ID plus STRIDE references that key into the threats-by-element table. Where the trust assumption changes at a crossing, that change is named under Authentication and Authorization.

This table is canonical for the trust-boundary set. The DFD lives in this document and the trust-boundary table sits right next to it, so this artifact owns the enumeration, not the Frame. The Frame doc carries a steady-state subset of eight boundaries for its own altitude of prose. This overview adds the two boundaries scoped to migration and backup (TB-fs-source, TB-fs-backup), which brings it to the core nine-row set. A tenth row, TB-obs-sink, was added 2026-06-09 under the observability baseline. It’s deferred and egress-only. At V0 the host emits telemetry to stdout and OTel, and there’s no in-app observability store, so the external sink is operator-chosen and deferred behind the separation of generation from storage. It’s modeled as the telemetry-egress surface, the point where emission leaves the host, not as a storage dependency that V0 actually has. The binary runs without a sink. So the V0 storage-dependency set stays at the nine core boundaries, and TB-obs-sink becomes a real dependency only once the operator wires a sink up. That’s the L4 tripwire. An eleventh row, TB-plugin-store, was added 2026-07-07 by the plugin-distribution extension (P-0023; the dated subsection after the boundary notes covers it). It’s the bundle-store zone between TB-build-pipeline and TB-mnemra-host, untrusted by design, with both crossings acting as verification surfaces. If the Frame’s TB table and this one ever disagree, this one wins. The TB-mnemra-host ↔ TB-postgres crossing appears twice below: the original row, and the 2026-10-19 amendment that retypes it in place.

Trust boundaryCrossesDirectionAuthenticationAuthorizationThreats at crossing
TB-agent-runtime ↔ TB-mnemra-hostDF-mcp-stdio (MCP stdio transport)bidirectional (request/response)Bearer-token presented per MCP session; P-builtin-auth verifies against OIDC AS or static admin token. V0: static admin token suffices; OIDC verification is V0.1+.Workspace claim in token scopes every operation; per-verb capability check at P-mcp-handler against the plugin manifest. Admin scope distinct from user scope.EE-orchestrator-agent/S,R; EE-specialist-agent/S,R; P-mcp-handler/S,T,I,D,E; DF-mcp-stdio/T,I
TB-human ↔ TB-mnemra-hostDF-cli-invoke (admin CLI local IPC); DF-token-read (token-file read by CLI handler)bidirectional (CLI invocation; structured responses)UNIX UID match for CLI invocation; admin token mandatory for destructive operations.Admin scope only — agent-facing CRUD does not route through the CLI. Schema-driven dynamic subcommands generated from plugin manifests; core: true plugins shipped at V0.EE-operator/S,R; P-cli-handler/S,T,E; DS-admin-token/I,T,R
TB-mnemra-host ↔ TB-plugin-sandboxDF-plugin-invoke (host → plugin); DF-host-fn-call (plugin → host)host-mediated; cross-plugin calls always traverse the hostPlugin identity is the signed-manifest identity (signature verified at load); host derives session context at invocation. Plugin core is IO-free; ambient capability is the empty set.Per-plugin host-fn allowlist compiled into the per-instance binding from the signed manifest; workspace_id is host-derived from the calling session, NEVER a plugin parameter on write paths; sampling, network, and filesystem are manifest-declared.P-plugin-instance/E,T,I; DF-host-fn-call/T,I; DF-sampling-up/T,I; P-plugin-runtime/T,E,D,R
TB-mnemra-host ↔ TB-postgresDF-substrate-rw, DF-projection-rebuild, DF-migration-write, DF-backup-read, DF-health-probebidirectional (host issues queries; receives result sets)Host-process DB user; ideally role-separated per host process (host-fns role, migration role, backup role, health-probe role) with least-privilege grants.RLS column-shape ships V0 (workspace_id NOT NULL, indexed); RLS policy enforcement is V0.1+ — at V0 the host-side WHERE-clause discipline is the structural barrier (lint-enforced).P-host-fns/T,I,E; DS-pg-content/T,I,R,D; DS-pg-state/T; DS-pg-projections/I; DF-host-fn-call/I
(Amended 2026-10-19 r2, #4018 — retypes the row above in place; TB-postgres is now the operator’s zone.) TB-mnemra-host ↔ TB-postgresthe same five flows, now issued by two credentials: DF-substrate-rw, DF-projection-rebuild, DF-health-probe (serving role: P-host-fns, P-instance-check, P-cli-check-db); DF-migration-write (owner role: mnemra init only); DF-backup-read (no object — backup is the operator’s, spec R-0117-j item 2)bidirectional; plus DF-setup-sql inbound from EE-operator (operator-privileged DDL) and DF-sighup from EE-operator to P-instance-checkServing role: peer authentication over a unix socket after a peer-uid and socket-directory check, or SCRAM over verify-full TLS (loopback included) with the password from DS-db-password-serving; owner role: the same two shapes with DS-db-password-owner, held only by init. Options built from a closed allowlist; PG* and ~/.pgpass inert; cleartext/MD5 auth requests refused (implementation-time mechanism, named). Spec R-0117-f, R-0119.Serving role: DML only, owns nothing, member of nothing, none of SUPERUSER/BYPASSRLS/CREATEROLE/CREATEDB/REPLICATION — verified on every check, transitively (R-0117-c); owner role owns the schema and runs migrations under an advisory lock (R-0117-h). RLS is in V0 (#3591 ruling 7262; policy template per 7289) with FORCE ROW LEVEL SECURITY verified against the manifest and the catalog (R-0117-e). EE-other-principals are bounded by the instance’s own grants, not by the host (accepted risk AR-0013).P-host-fns/T,I,E; DS-pg-content/T,I,R,D; DS-pg-state/T; DS-pg-projections/I; DF-host-fn-call/I; DF-health-probe/S (local transports), DS-db-password-serving/I, DS-db-password-owner/I, P-instance-check/D, DF-setup-sql/T, EE-other-principals/I,E — see the r2 typed-elements subsection
TB-mnemra-host → TB-obs-sinkDF-telemetry-emit (stdout structured logs + OTel metrics/events egress)outbound from host (emission only; no read-back)None at the egress itself; the external sink is operator-chosen and operator-secured. The host’s emission boundary enforces redaction + no-content.Emission carries workspace_id on every tenant-scoped record and never artifact bodies; the operator’s sink partitions/retains. (Re-derived 2026-06-09 — generation⊥storage, per the observability baseline: telemetry is emitted, not stored in-app; the former DS-ts-*/DS-pg-logs in-app storage threats are now emission-surface threats — DS-ts-metrics/I, DS-ts-events/T,I, DS-pg-logs/I — carried in the threats-by-element table.)P-host-fns/I (no-leak at emission); DF-telemetry-emit/I
TB-mnemra-host ↔ TB-fs-secretsDF-token-read (CLI handler reads admin token); DF-signature-verify (plugin-runtime reads signing key/cert)inbound to host (filesystem reads)Filesystem ACLs (mode 600) + OS-uid match. No second factor at V0.The host is the sole reader. Secrets are read lazily on-demand; file-mode invariant check at startup; modification fail-shut.DS-admin-token/I,T,R; DS-mnemra-root-key/I,T; P-plugin-runtime/E (verify-async path)
TB-mnemra-host ↔ TB-fs-sourceDF-migration-read (one-shot read of prior tooling state)inbound to host (read-only by intent)OS-side: read-as-host-process-uid; logical: migration handler is invoked from CLI under admin token.Migration handler is the sole reader; source is never written-back; migration manifest is mnemra-side.DS-source-taskdb/T; DS-source-corpus/I; P-migration-handler/T,I,D
TB-mnemra-host ↔ TB-fs-backupDF-backup-write (host → backup); restore consumes inboundoutbound from host (write); inbound at restoreOS-side: write-as-backup-process-uid; logical: backup handler is invoked from CLI under admin token.Backup handler is the sole writer; restore is admin-gated. Backup contents are higher-value than the live DB by virtue of offline accessibility.P-backup-handler/I,T,D; DS-fs-backup/I,T
TB-mnemra-host ↔ TB-external-llmDF-embed-call (HTTPS to embedding provider)outbound from hostTLS server identity check; hostname allowlist at config; provider API key as a separate secret.Per-deployment LLM-API-key configuration ships in 0.1.0; no in-host LLM hosting (Hard constraint). Hostnames pinned via config; cert validation mandatory.EE-llm-provider/S,R; DF-embed-call/I,T
TB-build-pipeline ↔ TB-mnemra-hostDF-signing-attest (build-time signing); DF-signature-verify (runtime verification reads only the signature)inbound to host (signature only at runtime)Runtime: signed-artifact signature verified against the mnemra root cert/key (V0 custody per [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md); production-grade hardening per {{P-SigningKeyCustodyHardening}}); build-pipeline identity is a pre-runtime concern.Only core: true plugins at V0 — runtime accepts artifacts whose signature chains to the mnemra root; non-core plugin install is V0.1+ scope and requires a separate trust decision.EE-mnemra-root/S,R; DF-signing-attest/T; DF-key-custody/I; P-plugin-runtime/E

Notes on the boundary set. Two boundaries are fragile enough to flag inline.

  • TB-mnemra-host ↔ TB-postgres is the structural multi-tenancy fence. The RLS column shape ships at V0, but policy enforcement is V0.1+. At V0 the only enforcement is WHERE-clause discipline at the host-function layer. A lint or test that checks every read path for a workspace filter is a Spec-stage mitigation, and it belongs in P-0009-rls-admin-token. (Amended 2026-10-19 r2, #4018: “policy enforcement is V0.1+” is superseded. RLS is in V0 under #3591 ruling 7262 (2026-10-16), and the fence is now the two-role model plus forced RLS, both verified on every instance check (spec R-0117-c/-e) rather than assumed. The #3591 batch rewrites this note in full; this parenthetical only keeps it from reading as current.)
  • TB-build-pipeline ↔ TB-mnemra-host is conceptual, since the build pipeline isn’t adjacent at runtime. Still, the key-custody choice decides whether the boundary’s asymmetry favors the attacker or the defender: P-0005-v0-signing-chain for the V0 dogfood, {{P-SigningKeyCustodyHardening}} for a production-grade posture. The V0 decision is locked at Tier A (P-0005). The production hardening is Tier C ({{P-SigningKeyCustodyHardening}}), activated by the multi-deployment trip-wire.

Distribution extension (2026-07-07 — plugin distribution, P-0023)

The plugin-distribution design (P-0023, spec 2026-07-07-plugin-distribution.md) adds a store zone and the crossings around it. Here’s the TB-plugin-store boundary row.

Trust boundaryCrossesDirectionAuthenticationAuthorizationThreats at crossing
TB-build-pipeline / TB-mnemra-host ↔ TB-plugin-storeDF-publish (builder → store); DF-fetch + DF-referrers (store → host fetch-verify pipeline)outbound at publish; inbound at fetchNone at the store — the store is untrusted by design. Trust derives entirely from the package signature (P-0005 root, signer-key-pinned, domain-separated) and content-address digests recomputed over received bytes; store-supplied metadata (headers, declared sizes, tags) is never trusted.Fetch-side: the bounds-first pipeline (fetch-within-bounds → verify-package-signature → verify-blob-digests → unpack-within-bounds, fail-closed — P-0023 D4) is the sole path to load-eligibility; digest-pinned resolution only. Publish-side: signing occurs on the build host only (key custody unchanged, P-0005).New typed elements below; STRIDE-per-element rows land at this cluster’s pre-implementation security review (the P-0014 typed-DFD-extension precedent)

The extension also adds these typed elements. P-0023’s threat references consume them, and the drawn DFD and per-element threat rows re-draw against them at the cluster’s pre-implementation security review. It’s the same follow-up shape as the retrieval cluster’s P-0014 extension.

IDTypeElement
EE-plugin-storeexternal entity / zonethe store (self-hosted registry or removable-media oci-layout) — untrusted by design; trust derives from signatures + digests, never from the store
P-bundle-builderprocessbuild-host assemble/sign/publish tool (spec R-0090); inside TB-build-pipeline
P-fetch-verifyprocessthe bounds-first fetch-verify pipeline behind the PackageVerifier seam (spec R-0083); inside TB-mnemra-host
DS-oci-storedata storebundle content (outer manifest, blobs, signature referrer) at rest in the store zone
DS-bundle-cachedata storethe local fetched-layout cache the load path reads (load-path invariant #5’s re-validation surface)
DF-publishdata flowbuilder → store (crosses TB-build-pipeline → TB-plugin-store)
DF-fetchdata flowstore → host pipeline (crosses TB-plugin-store → TB-mnemra-host; the bounds-first surface)
DF-referrersdata flowsignature-referrer enumeration (count- and size-bounded, spec R-0084)

Operator-instance retype (Amended 2026-10-19 r2, #4018, approved 2026-10-19 (#4018 activity 7800) — P-0010 §Amendment 2026-10-19)

TB-postgres is retyped in place (review finding Warden B1; Warden is the project’s security reviewer). It used to be “the single-process cluster the host owns, reached over a host-owned socket by peer authentication”. Now it’s the operator-run PostgreSQL instance, the operator’s zone, which the host reaches as a client holding two credentials. No second boundary is added. The canonical TB set keeps its count, and the TB-postgres row above carries the r2 retype. The five typed flows into the zone stay: DF-substrate-rw, DF-projection-rebuild, DF-migration-write, DF-backup-read and DF-health-probe. DF-health-probe is now issued by P-instance-check and P-cli-check-db, and never by the liveness handler. The Frame’s steady-state TB table row is updated to match. The new typed elements follow, in the same style as the distribution extension above.

IDTypeElement
TB-postgres (retyped)trust boundary / zonethe operator-run instance; the operator holds superuser authority inside it; the host holds two non-superuser roles
EE-other-principalsexternal entity (inside TB-postgres)other roles, applications or tenants on a shared or managed instance; bounded by the instance’s grants, not by the host (accepted risk AR-0013)
P-instance-checkprocess (inside TB-mnemra-host)the facts probe plus decision (spec R-0118-a): serving role, pool-identical options, 10 s deadline, supervised task, coalesced SIGHUP; the only health-related process that touches the database
P-liveness-handlerprocessGET /health on a non-runtime thread with a 1 s in-process ping; never touches the database or the check results (R-0118-e)
P-readiness-handlerprocessGET /ready; reads the last completed check result and its age; 503 on any unmet hard clause, staleness (> 70 s), or drain (R-0118-f)
P-metrics-handler (added 2026-10-29, #4412)processGET /metrics; renders the R-0118-j metrics from the same last-completed-check snapshot P-readiness-handler reads; never touches the database; 200 whatever the readiness
P-cli-check-dbprocess (a separate mnemra invocation)the operator’s pre-flight: a second credential-holding client running the same check out-of-process; never a probe body (R-0118-d/-g)
DS-db-password-servingdata store (inside TB-fs-secrets)MNEMRA_DATABASE_PASSWORD_FILE: O_NOFOLLOW + fstat on every read; host-owned 0600 or root-owned group-readable Secret mount; failure is not-ready, never an exit (R-0119-b, ruling 7762)
DS-db-password-ownerdata store (inside TB-fs-secrets)MNEMRA_DATABASE_OWNER_PASSWORD_FILE: read by mnemra init only; the serving host never reads it (R-0119-g)
DF-sighupdata flowEE-operator → P-instance-check: forced retry, password-file reload, pool rebuild; OS-signal authority only (R-0118-d)
DF-setup-sqldata flowEE-operator → TB-postgres: the one-time, operator-privileged DDL printed by check-db --setup-sql (two roles, grants, CREATE EXTENSION); no password literal (R-0118-d)
DF-db-password-readdata flowhost processes → the credential files; descriptor-checked reads
DF-ready-readdata flowP-readiness-handler → P-instance-check: in-process read of the last completed result; no database

Threats at the retyped crossing. These are STRIDE per element, recorded at design time under P-SecurityLayered (the principle that security controls compose in independent layers, so no single gate carries the whole posture). A threat-modeling pass over this retype by Warden is required before the gate. It wasn’t run in the authoring session.

ElementSTRIDEThreatSeverityMitigation
DF-health-probe, DF-substrate-rw over a local transportSNeither loopback TCP nor a unix socket authenticates the server; a same-host process that binds the port or pre-creates the socket receives the host’s password or traffic; the client library answers cleartext/MD5 password requests and uses no SCRAM channel binding (Warden, MEASURED sqlx-postgres 0.9.0 sasl.rs:14, establish.rs:74-98)HighMitigated, not accepted (ruling 7771): a password only ever travels over verify-full TLS, loopback included; a socket is used only with peer authentication after a peer-uid check (uid = socket-directory owner; no group or other write bit on the directory, no sticky exception) — the same-connection-before-first-byte form and the cleartext/MD5 refusal are both implementation-time mechanisms (sqlx 0.9 writes the startup packet with no hook), each pinned as a named expected failure visible in the gate (spec R-0120-h) — spec R-0117-f, R-0119-c/-d (Amended 2026-10-29, #4412, ruling 9279: the health listener that exposed this row’s target through connection_target can now be reached only by the host’s own uid (spec R-0004-g as amended), so a process under another uid no longer learns the target from it. This row’s threat and mitigation are otherwise unchanged.)
the same over remote TCPS, T, Ispoofed or intercepted instanceHighverify-full against the operator’s CA; pg_stat_ssl verified after connect (R-0117-f)
DS-db-password-serving, DS-db-password-ownerIcredential disclosure through a world-readable mount, a symlink swap, the environment, argv, SQL history or logsHighdescriptor-based fstat on every read, O_NOFOLLOW, no world read; never in the URL or PG* (scrubbed), never in --setup-sql output (\password), never logged; the owner file is read by init only (R-0119-a/-b/-g)
the serving role (P-host-fns, P-instance-check)Ean over-privileged, owning or over-membered role turns a host query bug into a cross-tenant read or a schema changeCriticalattributes, ownership and transitive membership verified on every check against an empty allowlist; forced RLS reconciled against the catalog; the serving role cannot alter tables it does not own (R-0117-c/-e); the first draft’s NO FORCE residual is dissolved by the two-role model
P-instance-checkDa wedged, panicked or silently stopped checker leaves a stale met in place, or a slow instance stalls the checkMediumper-check deadline, supervised task with a synthetic unverifiable on restart, staleness withdraws readiness at 70 s, seconds_since_last_ok metric (R-0118-a/-f/-j)
TB-postgres as a dependencyDinstance unavailable at boot or mid-serveMediumnot ready without a restart loop; bounded backoff; storage_unavailable with a 5 s acquire bound; out-of-cycle check on error (R-0118-b/-c/-m)
DF-setup-sqlTthe operator’s DDL grants more than the printed SQL (a BYPASSRLS here, a membership there)Highthe host verifies the result rather than trusting the step (R-0117-c); the printed SQL is the documented, CI-exercised path (R-0120-g)
EE-other-principalsI, Eanother principal on a shared or managed instance reads or alters the host’s databaseHighout of model — accepted risk AR-0013 (ruling 7771); the host’s own grants are least-authority (R-0117-c) and the deployment document names the exposure obligations (R-0117-j items 6, 8)
EE-operatorRoperator actions on the instanceMediumthe operator’s own audit (EE-operator/R, unchanged)

One case is out of model, and signed off as such (ruling 7771): a hostile operator. The operator owns the data by construction (AR-0013). For this amendment the accepted-risk register below gains AR-0011 through AR-0013 (Warden B2). The rest of the register’s sweep (the R-0003, R-0007 and R-0010 triggers) stays inside the #3591 batched amendment (maintainer ruling 2026-10-16, #3591 activity 7321). The operator obligations the host can’t verify are a named delegation (spec R-0117-j). Items 1 to 3 of that delegation are the accepted risk AR-0011.

Test substrate (Amended 2026-10-22, #4119 — threat-modeled test substrate, spec R-0120)

Why it is here. The test substrate’s typed DFD sits in this file, next to the operator-instance retype, for two reasons. First, TB-test-postgres is the same kind of zone as the retyped TB-postgres: a server mnemra doesn’t run, in this case holding a throwaway population. Second, the tier-2 CI Frame (docs/intent/ci-flake-tier2-shared-engine-frame.md) carries a banner saying nothing below it is edited, so this file is where later reviews can annotate one diagram. TB-test-postgres is a separate boundary from TB-postgres, so test-only roles never appear inside the production zone.

Source. The diagram comes from the #4119 threat model (Warden, 2026-10-22, finding F-1). Its IDs follow that model’s finding F-3, which keeps them namespace-disjoint from the TB-* and DF-* names above. It’s drawn here for the design as amended by spec R-0120 (docs/specs/2026-05-24-mnemra-core-v0-substrate.md) on 2026-10-22. That amendment changes the threat model’s draft in three places:

  • the production-store scan cache and its read flow are gone, because the store guard is a name allowlist (R-0120-a(8));
  • the superuser location is named (R-0120-a(1));
  • the fresh-machine job is a second instance of TB-ci-job, with its own container and no test binary (R-0120-g).

Elements. Each element is created by the spec clause named beside it. Unless a row names a tier-2 spec, its R-IDs are those of docs/specs/2026-05-24-mnemra-core-v0-substrate.md.

IDTypeWhat it isSource
P-just-ciprocessthe ci recipe: preflight, run-id export, the chain, the EXIT trap (leftover check, teardown, GATE leaked-objects)R-0120-a(5), R-0120-c(1)
P-cargo-buildprocesscargo, rustc, build scripts and proc-macros, inheriting the just ci environmentR-0120-a(1)
P-teardown-executorprocessthe teardown executor: built by P-cargo-build after the preflight, spawned by P-just-ci’s EXIT trap, connecting as the harness role (the fixture’s equivalent flow is DF-08)R-0120-a(5)
P-test-binary / P-shared-fixtureprocess / in-processeach Postgres test binary and its one fixture entry pointtier-2 R-0026; R-0120-a(2)–(9)
P-gated-su-recipe, P-gated-su-cellprocessthe instance_check_privileged recipe and binary: the accessor and the superuser poolR-0120-a(1); tier-2 R-0033 (4)
P-spawned-hostprocessthe production binary spawned by smoke_e2e or by the gated cellR-0120-e(1), R-0120-a(1)
P-ci-stepsprocessthe job steps that start the container and set it upR-0120-c(1)
DS-su-locationdata store~/.config/mnemra/test-superuser/ (url, password), 0700R-0120-a(1), R-0120-c(1), R-0120-d
DS-run-dir, DS-pw-filesdata storesthe per-run directory and the run-scoped role password files (no scan cache)R-0120-a(2), (5), (8)
DS-run-dir-recorddata storethe record the locator reads the per-run directory’s location from, present only if task #4164 chooses that branch of R-0120-a(5); owner-only and opened without following a link; drawn outside every boundary because where it lives is task #4164’sR-0120-a(2), (5)
DS-pg-instance, DS-pg-server-logdata storesthe catalog and databases; the server logR-0120-a; R-0120-a(2) (SCRAM verifiers)
DS-ci-logs, DS-github-env, DS-tls-material, DS-procfsdata storespublic job logs; GITHUB_ENV/GITHUB_OUTPUT; the CA, server certificate and key; /proc/<pid>/environ and cmdlineR-0120-c(1), R-0120-d, R-0120-e(1)
EE-pg-server, EE-container-image, EE-other-laneexternal entitiesthe server (PostgreSQL 16 or later), the digest-pinned image, a concurrent run on the same server (Amended 2026-10-28, #4363, a draft until the maintainer’s exit approval of #4363: (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.) since ruling #4363 activity 9016, this entity is a concurrent run of the same lane, on that lane’s own server. The identifier is kept because the #4119 threat model record cites it six times, and a rename would leave those references pointing at nothing.)R-0120-a(9), R-0120-c(1), R-0120-a
EE-third-party-actions, EE-github-runnerexternal entitiesmarketplace actions (tag-pinned, task #4153) and the hosted runner.github/workflows/ci.yml
EE-contributor, EE-other-local-user, EE-pr-authorexternal entitieswho runs just ci; another uid on a multi-user host; code under test in a pull requestR-0120-d; R-0120-a(2)

Trust boundaries. Each row gives the boundary’s trust direction and the numbered flows that cross it, then says where its control or its accepted risk sits.

BoundaryTrust directionCrossing flowsWhere the control or the acceptance sits
TB-github-platformthe job writes and the world reads; masking is the only filterDF-15, DF-16, DF-27SCRAM verifiers keep plaintext out of DF-15 (R-0120-a(2)); DF-27 carries parsed fields only, never URL text (R-0120-a(2), (5)); residual AR-0019; masking controls are task #4163
TB-ci-jobevery step trusts every other stepDF-12, DF-13, DF-14, DF-17accepted risk AR-0014; SHA-pinning is task #4153
TB-ci-containertrusts any docker exec; TCP gated by pg_hba onlyDF-12, DF-17, DF-22digest pin and drift job (R-0120-c); AR-0014
TB-contributor-treethe tree trusts what the shell exportedDF-01, DF-02, DF-03, DF-19, DF-23, DF-24, DF-28, DF-29, DF-30PG* refused, harness URL parsed in harness mode (R-0120-a(7)), by the executor as by the fixture; the preflight runs before the executor’s build (R-0120-a(5)); the trap decides on DF-28 by its closed outcome set (R-0120-a(5))
TB-gated-cellenvironment-inheritance boundary onlyDF-04, DF-05, DF-11holder confinement (R-0120-a(1)); same-uid reads accepted, AR-0015
TB-host-under-testthe host trusts only its explicit variable listDF-09, DF-10env_clear() (R-0120-a(1)); the spawn-site detector is task #4165
TB-shared-tmpthe fixture trusts a directory it createdDF-06, DF-18, DF-26no cache under the name allowlist (R-0120-a(8)); the executor finds the directory through the fixture’s locator and checks its identity before removing it, and a location record (DS-run-dir-record, drawn outside every boundary until task #4164 places it) is owner-only and opened without following a link (R-0120-a(5)); directory ownership, O_NOFOLLOW controls, the locator’s mechanism and the identity check’s mechanism and seeds are task #4164
TB-test-postgrestrusted after verify-full, the role-authority allowlist and the store guard; between runs and lanes, by parse plus datdba under a privilege floorDF-08, DF-10, DF-11, DF-20, DF-25R-0120-a(3), (6), (8), (9), and for DF-25 the same checks run by the executor (R-0120-a(5)); the shared harness role across lanes is accepted, AR-0016 (Amended 2026-10-28, #4363, a draft until the maintainer’s exit approval of #4363: (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.) “between runs and lanes” reads “between runs of one lane”, and “the shared harness role across lanes is accepted” reads “the harness role shared by one lane’s runs is accepted”. Lanes no longer share a server, because of the lane claim of spec R-0120-i(a), maintainer ruling #4363 activity 9016.)

Threat rows for the executor flows (INFERRED). INFERRED marks a reading reasoned from the design rather than observed. The #4119 threat model (Warden, 2026-10-22) predates the teardown executor, so it has no rows for DF-23 to DF-30 or for DS-run-dir-record. Each of those inherits the rows of the fixture flow or store it duplicates, because R-0120-a(5) has the executor run the fixture’s own checks through the fixture’s own functions:

  • DF-23 inherits DF-02’s rows (T4119-01).
  • DF-24 inherits DF-01’s and DF-03’s (T4119-01, T4119-16, T4119-29).
  • DF-25 inherits DF-08’s on the connection and the drops (T4119-19, T4119-21, T4119-23), but not T4119-41, the clone lock, which R-0120-a(5) doesn’t give the executor.
  • DF-26 inherits DS-run-dir’s (T4119-27). DF-29, DF-30 and DS-run-dir-record inherit DS-run-dir‘s and DS-pw-files’ (T4119-27, T4119-28) until task #4164 places the record.
  • DF-27 inherits DF-16’s and DS-ci-logs’ (T4119-10).
  • DF-28 inherits P-just-ci’s (T4119-38, T4119-42).

No threat-model pass has drawn rows for these flows on their own. The mapping is the design’s reading, not a finding.

Accepted risks

The Stage 2 terminal security review filled this in on 2026-05-22. Each entry is a risk the V0 architecture accepts, on the basis of the V0-dogfood-versus-commercial-tier carve-out that the locked product brief authorizes. Entries are numbered R-NNNN. Following the workspace threat-modeling skill’s convention, every entry carries a trip-wire that names the condition under which the deferred mitigation has to be revisited. At V0 the owner is the maintainer; ownership passes to a named role when the project moves to a commercial tier. (Amended 2026-10-19 r3, #4018: for now the register mixes two prefixes on purpose. The original rows keep R-0001 through R-0010, which collide with the specs’ requirement series (CLAUDE.md, #2126). The entries this amendment adds use the register’s own disjoint prefix, AR-. Renaming or confirming the old rows belongs to the #3591 batch’s register sweep (ruling 7321), not to this amendment.)

The placeholder columns get one addition, a Rationale column, so the basis for each deferral is legible without chasing an external reference. Every entry maps back to one or more threat rows above by its Risk ID. Rows AR-0014 through AR-0019 come from the 2026-10-22 test-substrate amendment (#4119) and use the same AR- prefix; their threat IDs (T4119-*) point into the #4119 threat model behind the test-substrate DFD above.

Risk IDDescriptionOwnerTrip-wireRationale
R-0001RLS policy enforcement deferred to V0.1+; only the column-shape ships at V0. Cross-tenant disclosure on P-mcp-handler/I, P-builtin-projects/I, DS-pg-content/I, DF-host-fn-call/I depends on the host-side WHERE-clause discipline rather than database-enforced policy. (Amended 2026-10-19 r2, #4018 — SUPERSEDED by #3591 ruling 7262, 2026-10-16: RLS is IN V0. Kept as the rejected alternative with the reasons it lost: its trip-wire was human-noticed and never labelled parked; the host-side lint covers a fraction of the SQL files (#3575); retrofitting later means migrations on operator-held data and query paths that fail as silent empty results. The #3591 batch rewrites this row; this note only stops it reading as current.)maintainerFirst deployment serving more than one workspace (production multi-tenant traffic), OR the column-shape’s lint coverage drops below 100% on read paths, OR a third-party plugin is loaded at runtime.The brief locks tenant scoping key as structural from V0 precisely so policy enforcement can land later without substrate migration. V0 is single-workspace dogfood; the structural barrier is the WHERE-clause discipline, not policy enforcement. Defer-with-trip-wire matches P-Defer.
R-0002External-authorization-server integration deferred to V0.1+. P-builtin-auth at V0 accepts a static admin token; per-deployment OIDC AS via RFC 9728 is in 0.1.0 substrate but federation/SSO is not. Operator-impersonation risk (EE-operator/S, EE-orchestrator-agent/S) hinges on token file ACLs and rotation discipline.maintainerFirst deployment integrating with an existing identity provider for the operator, OR shared-workstation use of the deployment node, OR external onboarding of agents beyond the maintainer’s.Brief Hard constraints scope mnemra as Resource Server only at V0; AS integration is brief idea-tier (D7). The static admin token bootstrap is the V0 dogfood pattern.
R-0003MCP transport at V0 is stdio. Transport confidentiality is process-spawning trust — a wrapping process the agent invokes can observe request/response bytes (DF-mcp-stdio/I, T).maintainer{{P-MCPWriteSemantics}} resolution OR streamable-HTTP transport activates (the microVM-appliance trip-wire from the brief), whichever lands first.Brief Hard constraints fix stdio at V0; streamable-HTTP is V0.1+ activation gated on the microVM-appliance trip-wire. Stdio confidentiality is “the agent’s host process is the trust unit.”
R-0004Plugin signing-key custody at V0 is dogfood-scoped to the maintainer’s single deployment under [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md) (Tier A) — build-host-on-disk, single-instance, maintainer-controlled. DS-mnemra-root-key/I and EE-mnemra-root/S are Critical-severity threats whose production-grade mitigation depends on {{P-SigningKeyCustodyHardening}}. The V0 commitment is made; the hardening is deferred to Tier C.maintainerMulti-deployment trip-wire fires — [P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md)’s stated condition: the moment mnemra-core is deployed beyond the maintainer’s single dogfood instance. {{P-SigningKeyCustodyHardening}} (Tier C) must lock before that point. The risk register entry retires when {{P-SigningKeyCustodyHardening}} locks.V0 dogfood scoped to single-operator single-deployment; key-on-build-host is a named and trip-wired V0 decision, not a gap. Production-grade custody (offline-root, HSM, never-on-node) is deferred under P-Defer with the multi-deployment trip-wire as the mandatory activation condition.
R-0005External-LLM embedding calls (DF-embed-call/I) and the brief’s “no in-host LLM” Hard constraint together mean artifact bodies leave the deployment trust boundary at every embedding call. Telemetry no-leak is a dogfood acceptance criterion (audit script against a known-content corpus), not a structural barrier.maintainerFirst deployment that is not single-operator-only (any deployment with telemetry-sensitive content beyond the maintainer’s), OR Bring-Your-Own-Model (BYOM) is not configured and a hosted provider sees production content.The brief explicitly carves “no in-host LLM” and “calls out to an external model” as Hard constraints. The compensating control is BYOM deployment posture — the LLM-API-key configuration surface is in 0.1.0. The risk is acknowledged, structurally bounded by deployment posture, not mitigated by code.
R-0006Operator-action repudiation at V0 is partially mitigated. CLI destructive ops (drop-workspace, force-restore-overwrite) tie to the OS UID; there is no second factor and no admin-action audit log that survives a substrate restore. Repudiation threats on EE-operator/R, DS-admin-token/R rely on OS-side audit.maintainerFirst deployment with more than one operator on the host, OR the activity-log capability (0.5.0) lands and admin actions can be tied to a durable audit event independent of the substrate.Solo dogfood: the maintainer is sole operator; repudiation is not a meaningful threat in that topology. Activity log lands at 0.5.0, after the substrate; the dependency is correct, the trip-wire fires on multi-operator topology, not on time.
R-0007Plugin sampling (DF-sampling-up) at V0 is unrestricted because all plugins at V0 are core: true and signed by the mnemra root. The plugin-to-orchestrator prompt-injection surface (DF-sampling-up/T, P-plugin-instance/I) is High at V0 and becomes Critical at V0.1+ when third-party plugin install activates (brief idea-tier D11).maintainerThird-party plugin install activates (brief D11), OR [P-0003-plugin-manifest](../adrs/P-0003-plugin-manifest.md) locks the sampling capability shape without typed-prompt restrictions.At V0 the plugin set is trusted by build provenance; signed artifacts are the only execution surface. The mitigation cost is high relative to V0 value; the trip-wire is structural (third-party install), not temporal.
R-0008Rollback/downgrade on the distribution surface (EE-plugin-store, DF-fetch): OCI + the keyed package signature cannot prevent the store (or a MITM on the LAN path) from serving an older, validly-signed bundle. High severity on the distribution surface; no freshness/monotonicity mechanism exists at this tier — deliberately, per [P-0023](../adrs/P-0023-plugin-distribution.md) (a bespoke version-monotonicity check is explicitly not built; TUF is the designed answer).maintainer[P-0005-v0-signing-chain](../adrs/P-0005-v0-signing-chain.md)’s R-0005-e condition fires (deployment beyond the single dogfood instance, or third-party publishers) — the TUF adapter (timestamp/snapshot freshness) lands behind the locked PackageVerifier seam, co-requiring the Tier-C offline root for its rotation half. Entry retires when the TUF layer locks.Single-publisher single-deployment dogfood: the operator controls both store and host, so a stale-serve requires compromising infrastructure the operator owns. The seam is pre-positioned so the mitigation arrives as an adapter, not rework (P-Defer, decision content in the Frame’s deferral table).
R-0009Single-root compromise-independence (DS-mnemra-root-key/I reach, extended by distribution): the package signature (distribution anchor) and the inner manifest signature (provenance anchor) are both made by the one P-0005 root at this tier ([P-0023](../adrs/P-0023-plugin-distribution.md) D6, maintainer-ratified Q5 2026-07-07) — the layers are scope-independent, not compromise-independent; one root theft forges both, and detecting a stolen-key forgery needs a transparency-log/TUF witness that is deferred. Critical severity under key theft (as R-0004).maintainerThe same R-0005-e condition — split to a distinct distribution key (or TUF delegated roles), restoring compromise-independence; the anchor-independence of the dual load-time checks becomes fully load-bearing at the split. Entry retires when the distribution key splits.One custody story at single-publisher core: true scope (Security ↔ Simplicity, maintainer-resolved); the exposure is recorded in the ADR and here rather than silently accepted. Compensating: the R-0004 custody posture (key never on the deployment node) bounds the theft surface to the build host.
R-0010Build-time dependency confusion (P-bundle-builder reach): wkg-pulled WIT/component dependencies are composed into the component before signing, so a malicious same-named dependency resolved at build time changes the component bytes and every downstream gate then faithfully binds the poisoned artifact (bytes-run == bytes-signed — integrity, not provenance-of-inputs).maintainerReproducible wasm32-wasip2 builds land (the reproducible-builds work item, #1942) — SLSA provenance attestations attached as OCI referrers become assertable and are the designed answer. Interim: the lockfile-hash-pin weighing is a named spec-gate item on the distribution spec. Entry retires when provenance attestations land.The residual is upstream of every signing gate by construction — no load-path mechanism can close it (the gates bind what was built). Named honestly rather than over-claimed; the distribution design neither widens nor narrows it.
AR-0011 (Amended 2026-10-19 r2, #4018; signed off by the maintainer 2026-10-19, #4018 activity 7771)The operator owns the Postgres and pgvector supply chain and the persistent storage the data lives on. The host verifies nothing about the binaries it talks to and cannot see the instance’s data directory: the embedded design’s hash-pinning of the engine binaries (KNOWN_GOOD_HASHES) is lost, not replaced — a loss, labelled as such (P-0010 §Amendment DE9). Spec R-0117-j items 1–3, emitted by mnemra check-db --obligations under “Not verified by mnemra”.maintainerRetires only if a packaging shape under #4019 lets the host verify what it talks to (a host-verified image digest, for example) — none is designed; otherwise standing. Re-examined at the #4019 gate.The operator model (ruling 7470) places the instance outside the host’s authority by construction; a host that cannot install or run the binaries cannot pin them. Named in the obligations list and the deployment document rather than implied. Rejected: keeping a host-side pin table for an install the host does not perform — it would check a path it never runs.
AR-0012 (Amended 2026-10-19 r2, #4018; signed off 2026-10-19, activity 7771)Up to one drift interval of writes acknowledged under a weakened durability setting. An operator- or role-level change to fsync / full_page_writes / synchronous_commit / data_sync_retry is observed by the next instance check (30 s cadence plus one check duration, spec R-0118-c); writes acknowledged in that window may be lost on an instance crash. Spec R-0117-d, R-0121-b.maintainerMechanical trip-wire (r3): the window only ever opens on a durability_off transition, and every such transition is counted (instance_check_total{clause="R-0117-d",status="unmet"}, spec R-0118-j) and alerted (host_ready == 0); the trip-wire is the first such transition observed on a production instance, which re-opens this entry — a lost write itself is not detectable, so the detector is keyed on the event that creates the window, not on the loss. The window shrinks if the drift interval shrinks (AE4, ruled fixed at 30 s on 2026-10-19, activity 7787) and closes only if every writer session re-checked the settings per transaction, a per-call cost this amendment does not take.The settings are the operator’s instance’s; the host verifies them on the sessions writers use and rebuilds the pool after a drift, which is the structural mitigation. The residual is the interval, stated as a number rather than hidden.
AR-0013 (Amended 2026-10-19 r2, #4018; signed off 2026-10-19, activity 7771)A hostile operator, or other principals on a shared or managed instance, are out of model. The operator holds superuser authority inside TB-postgres; EE-other-principals are bounded by the instance’s grants, not by the host. EE-other-principals/I,E.maintainerA managed or shared-instance offering (the brief’s idea-tier managed/appliance entries) — self-announcing through the register: that entry’s design is where the model is re-drawn.The operator owns the data by construction (the brief’s self-hostable success criterion); modelling the owner as an adversary would make every control a control against the deployment’s own principal. The host’s side is least-authority (R-0117-c) and the exposure obligations are named (R-0117-j items 6, 8). Not accepted alongside this: local server spoofing, which is mitigated (spec R-0117-f, R-0119-c/-d).
AR-0014 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; threat model candidate AC4119-1)The CI job is one trust zone. In the job that runs the Postgres tests (spec R-0120-c(1)), every step can read the superuser location, docker exec into the server and hold the harness URL. That includes tag-pinned third-party actions and the pull request’s own test code. Threats T4119-01, -02, -44, -45, -47, -49 (the #4119 threat model; zone TB-ci-job in the test-substrate DFD above). Cost, as stated in the threat model: in CI, the superuser “confinement” defends against accidental inheritance only, and a moved action tag can falsify the gate’s own verdict. That was already true before #4119; #4119 adds a server and credentials to the zone.maintainerPARKED — human-noticed: revisited at each change to .github/workflows/ci.yml (the review of that change re-reads this row), and at task #4153 (SHA-pin the third-party actions with an update mechanism), whose landing narrows the entry to the pull-request-code half.The credentials are throwaway: generated per job, for a container that dies with the job, with no repository secret in the job by design and a pull_request trigger, so nothing beyond the job is reachable. The alternative is SHA-pinning plus local all all reject in the container’s pg_hba (threat model D4), at a maintenance cost on every action release; it is filed as #4153 rather than taken in #4119.
AR-0015 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; candidate AC4119-2)Same-uid processes on a development machine can read every test credential: the gated cell’s environment through /proc/<pid>/environ, and the 0600 superuser and run-scoped password files. Threat T4119-07. Cost: any same-uid malware gets superuser on the developer’s test server. This matches R-0119-a’s own premise for host credentials. The delivered property is “not inherited through any environment” (spec R-0120-a(1); P-0031 §Amendment 2026-10-22), not “held by that process alone”.maintainerPARKED — human-noticed: revisited at each change to the deployment document’s local-test section (spec R-0120-d), which is where a supported multi-user development host would first be described.No cheaper alternative exists: the uid is the boundary the operating system gives a single user’s processes. The test server is dedicated to tests (R-0120-a(8)), so the superuser reached is a throwaway one.
AR-0016 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; candidate AC4119-3, decision D2) (Amended 2026-10-28, #4363; maintainer ruling 2026-10-28, #4363 activity 9016; the amendment’s text is a draft until the maintainer’s exit approval of #4363) (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.)Lanes sharing one server and one harness role are mutually trusted. Between runs and lanes, protection is code (the parse-and-datdba rule of spec R-0120-a(3)), not privilege. The harness holds ADMIN on every role it created, and SET and INHERIT on every run role it self-granted (R-0120-a(9)). The 24-hour age sweep assumes synchronised clocks. Threats T4119-18 (cross-lane part) and -40. Cost: a buggy, stalled or clock-skewed lane can drop the other lane’s live objects, and detection is the other lane’s red run. Amended 2026-10-28 (#4363; maintainer ruling 2026-10-28, #4363 activity 9016, “Separate server per lane”): the acceptance of lanes sharing one server and one harness role is retired. Each lane now has its own server and harness role, enforced by the lane claim of spec R-0120-i(a). What stays accepted is the same arrangement for concurrent runs within one lane, which share that lane’s server and harness role. Between those runs, protection is still code (R-0120-a(3)), not privilege, and the age sweep still assumes synchronised clocks. Cost, within a lane: a buggy, stalled or clock-skewed run can drop a concurrent run’s live objects in the same lane, and that run’s red is how it’s detected. The original acceptance above is kept as the record. Draft until the maintainer’s exit approval of #4363. (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.) The ruling, as recorded (#4363 activity 9016, Puck’s record of his selection; the option wording was Puck’s): he selected only “Separate server per lane (Recommended): each lane gets its own Postgres server and port, so lanes cannot interfere”. He didn’t select “one harness role per lane (D2), keep sharing and patch in round 3, cut scope and park”. Why the 2026-10-22 acceptance lost: the maintainer stated no reason of his own. The record says he was told that sharing had been chosen on 2026-10-22 for a reason Puck didn’t know, and the option he selected gives its reason as “so lanes cannot interfere”. The shared-server class had drawn new findings in two review rounds in a row (#4363 activity 8988). The lane’s identity is a declared lane name (#4363 activity 9037). Amended again 2026-10-28 (#4363; maintainer ruling 2026-10-28, #4363 activity 9046, O2: “Age sweep skips same-host runs” and “Old run refuses to continue”; Puck’s record, and the option wording was Puck’s; a draft until the maintainer’s exit approval of #4363): (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.) within a lane, the age sweep no longer removes a same-host run, because liveness alone decides a same-host name. And a run more than 22 h old refuses to acquire (spec R-0120-i(j)). The Cost within a lane now reads: a buggy run, or a run whose liveness is misread as dead, can drop a concurrent run’s live objects, and that run’s red is how it’s detected. A clock-skewed fixture can age out another host’s names early, or refuse its own run early. A suspended run is no longer removed by its own lane’s age sweep.maintainerPARKED — human-noticed: revisited on the first red run attributed to a cross-lane drop, and at task #4166 (bounded clone lock and the run-lifecycle hardening), which narrows the window. The fallback is D2: one harness role per lane. Amended 2026-10-28: the cadence now reads “revisited on the first red run attributed to a cross-run drop within a lane, and at task #4166”. The D2 fallback is no longer the next step, since one server per lane supersedes it. Amended again 2026-10-28 (ruling 9046; a draft until the maintainer’s exit approval of #4363): (Note added 2026-10-29, #4412: approved. The maintainer approved PR #17 as a whole, #4363 activity 9124, so this text is no longer a draft.) the cadence is unchanged. Spec R-0120-i(j) narrows the stalled-run trigger it covered.The server holds nothing of value: it is dedicated to tests and its contents are recreated per run. The privilege floor still holds: the harness can drop only databases owned by roles it holds SET on, and R-0120-a(6) admits only run-grammar roles, so even a parse bug cannot reach a non-test database. The alternative (D2) costs one more setup step per lane, plus its documentation.
AR-0017 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; candidate AC4119-4)A local run proves less than CI. The /proc/<child>/environ assertion of spec R-0120-e(1) compiles on Linux only, so a macOS just ci does not prove that a spawned host’s environment holds no MNEMRA_TEST_* variable. Threat T4119-36. Cost: the required check is the only authority for env_clear and for the superuser negative cases. The gated cell itself runs locally (ruling 8067 item 3), so only the environ assertion is CI-only.maintainerPARKED — human-noticed, with a detector for its platform half: revisited at each change to .github/workflows/ci.yml (the review of that change re-reads this row). The platform half is detected: the required “CI gates” job fails unless its output holds the Linux-only marker line of smoke_e2e and of the gated binary (spec R-0120-e(4) as amended), so moving the required check off Linux turns it red whatever CI is set to. Deleting that step from ci.yml is the residual, and the cadence above covers it. The local half stays parked: a macOS just ci proves less than CI, and no detector changes that.A platform limit; no alternative exists short of a Linux-only local workflow.
AR-0018 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; candidate AC4119-5)Nothing listens on loopback port 1. The red-phase sentinel pools of spec R-0120-f(ii) target 127.0.0.1:1; that nothing listens there is INFERRED, and on macOS an unprivileged bind may be possible. Threat T4119-26. Cost: a local listener makes red-phase tests flake; only dummy credentials are exposed.maintainerSelf-announcing: a listener on port 1 turns the sentinel tests’ refusal assertions red (libs/mnemra-host/tests/coordination_failclosed.rs:292-325 asserts a refused connection), which is a loud red.The alternative is to measure it (threat model I-17).
AR-0019 (Amended 2026-10-22, #4119; accepted by Peter 2026-10-22, #4119 activity 8067; candidate AC4119-6)A SCRAM verifier of a 32-byte random secret may appear in a public log on a red run. Run-scoped passwords are set as client-computed SCRAM-SHA-256 verifiers (spec R-0120-a(2)), so a failing role statement logs the verifier and never the plaintext (MEASURED on PostgreSQL 16.4, #4119 activity 8064, I-18), and docker logs publishes the server log on a red CI run. Residual of threat T4119-03. Cost: offline recovery is infeasible (INFERRED); the role dies with the container.maintainerPARKED — human-noticed: revisited at each change to .github/workflows/ci.yml (the review of that change re-reads this row). The exposure depends on a throwaway CI container, and a change that makes the CI server persistent is a change to R-0120-c(1)’s container steps in that file.A verifier does not let anyone log in under SCRAM without the plaintext (INFERRED), and brute force against a 256-bit random secret (32 bytes) is infeasible.

Cross-reference. Each accepted risk maps to one or more threat rows in the threats-by-element table. A future risk-register file holds the long-form record per entry, with review dates. Workspace canon calls that storage shape RISK-REGISTER.md, but the durable register lives with the project itself, following P-PerRepoFirst (keep things per-repo first, and extract a shared abstraction only once you’ve seen the same need a third time). This table is the per-Frame snapshot that the Spec stage works against.

Consultations

Mid-Frame expert dispatches that change the architectural shape land here. The section grows as the Frame matures.

DateAgentQuestionOutcomeAffects ADR slot
(none yet — port pass is reconciliation against locked predecessors)

Feedback to product brief

This fills in only if Frame work surfaces something that would change the locked product brief. Each entry would name the brief section, the tension, and the proposed amendment for the human decomposer to resolve. It’s empty at port-time, because Frame work didn’t surface any brief-level tension.

Brief sectionTensionProposed amendment
(none surfaced)

Session log

  • 2026-07-07. Plugin-distribution extension, riding on the W2-1 Stage-3 docs change (P-0023 plus spec 2026-07-07-plugin-distribution.md). This added the TB-plugin-store boundary row and the eleventh-row note in the canonical TB enumeration, the distribution extension’s typed elements (EE-plugin-store, P-bundle-builder, P-fetch-verify, DS-oci-store, DS-bundle-cache, DF-publish, DF-fetch, DF-referrers), and three accepted risks: R-0008 (rollback/downgrade residual, retires at R-0005-e via TUF), R-0009 (single-root compromise-independence, retires at the R-0005-e distribution-key split), and R-0010 (build-time dependency confusion, retires at reproducible-builds and SLSA). The drawn DFD and the STRIDE-per-element rows re-draw against the typed extension at the cluster’s pre-implementation security review. That follows the P-0014 precedent and is a named follow-up.
  • 2026-07-02. RC-1 reconciliation, riding on the retrieval-cluster Stage-3 docs change. This overview’s external-embedding framing was the named lagging copy of the brief’s model-hosting amendment. The hard-locked constraint-inventory model-hosting row and the DFD-notes “External LLM” bullet were updated to the RC-1 posture: mnemra-core MUST NOT host a generative LLM; local non-generative inference (embedding, reranking) runs host-side and never egresses; the external provider serves the retrieval cluster’s four policy-gated, individually-disable-able generative placements; and zero-egress is a supported V0 configuration. The drawn DFD’s DF-embed-call flow and the EE-llm-provider “(embeddings endpoint)” label are now pre-RC-1 renderings. The retyped retrieval-cluster elements (four DF-egress-4.x flows, EE-model-artifact-source, new processes and stores) are recorded in P-0014’s typed-DFD extension. The diagram and the per-element threat rows re-draw against it at that cluster’s pre-implementation security review, a named follow-up with its own firing event. The prose here is reconciled now.
  • 2026-06-09. Observability re-derivation, re-altituded out of the project-ADR layer. The maintainer resolved escalation E1 (change D8 versus the accepted observability ADR) by separating observability generation from storage, and ruled that observability is a theory trait plus chassis mechanism, not a per-project ADR. The generation decisions land in the observability baseline in this overview. The original observability ADR P-0004 is deprecated, with no successor, because change D8 falsified its storage core. This re-derived the observability surfaces the overview had left frozen on 2026-06-08. The “Reframed 2026-06-08” subsection’s frozen-pending-E1 marker is replaced with the resolved separation. The DFD’s DS-ts-* and DS-pg-logs in-app storage nodes are replaced with an external TB-obs-sink telemetry-egress node: the host emits stdout logs and OTel metrics and events via DF-telemetry-emit, and the in-app DF-timeseries-write and DF-log-write edges and the migration-to-ts-store edges are removed. The QA observability scenarios are generation-side (emitted metrics, with p50/p95/p99 derivable at the sink and no in-app hypertable). The observability threat rows are re-derived to emission surfaces and re-pointed to the observability baseline. The /health detail body is gated by the loopback-only listener bind, so loopback is the gate at V0, with a named tripwire if the listener ever binds non-loopback. The host capability manifest is a settled invariant, generated from WIT and never hand-maintained, and its generation mechanism routes to the chassis. The observability storage backend is deferred behind the separation, with an option set and a named tripwire, and the standalone binary survives. There is no in-app observability store at V0.
  • 2026-06-08. Storage-substrate fold. Reclassified the storage substrate from the prior hard-lock framing (“single-process Postgres + pgvector + timescaledb extensions present”) to “PostgreSQL ratified on merits, behind an engine-agnostic swappable Storage trait,” per the new P-0010-storage-substrate-engine (folding the 2026-06-07 storage-engine evaluation, ratified after the spec lock). Updated the hard-locked constraint-inventory substrate row and added a “Reframed 2026-06-08” subsection. TimescaleDB was demoted off the V0 stack (change D8), and the V0 time-series storage shape is plain timestamped tables. The DFD’s DS-ts-* hypertable nodes, the QA “Per-verb metrics” and “Retention discipline” scenarios, and the TimescaleDB threat rows were left frozen pending escalation E1 (D8 versus P-0004), which the 2026-06-09 entry above has since re-derived.
  • 2026-05-23 (Stage 3 entry housekeeping). Slot citation routing pass and R-0004 rewrite. All 13 stale signing-key-custody citations and 3 stale plugin-pool-memory citations across the threats-by-element, trust-boundary, and accepted-risks tables, the DFD notes, and the TB-notes prose were routed per row: V0-scoped rows to P-0005-v0-signing-chain; production-posture rows to {{P-SigningKeyCustodyHardening}}; rows that span both to both, with a cross-reference. All plugin-pool-memory citations went to P-0007-plugin-resource-limits uniformly. The R-0004 risk-register entry was rewritten, shifting from “open ADR slot” framing to “V0 commitment plus trip-wire to hardening”: the description now reflects P-0005-v0-signing-chain (Tier A, single-deployment dogfood decision made) and {{P-SigningKeyCustodyHardening}} (Tier C, activated by the multi-deployment trip-wire). The stale “(Tier C in the Frame’s Open ADR Slots)” parenthetical was removed as part of the rewrite. The ELT subsystem description in the DFD notes was updated to use an inline mechanism description, consistent with the companion Frame’s L1 fix.
  • 2026-05-23. Frame-exit gate revision. The companion Frame doc returned a Revise verdict at Frame-exit (G-0028 cold-start amendment, 2026-05-23). Two overview revisions followed. (M1) The trust-boundaries table above is designated canonical for the mnemra-core TB set, with the Frame’s eight-row steady-state table as a subset. (M2) The DFD’s builtin component set was extended from four (P-builtin-projects, P-builtin-agents, P-builtin-workspaces, P-builtin-auth) to seven, adding P-builtin-users, P-builtin-sessions, and P-builtin-permissions, with the uniform host-fn edge pattern. The threats-by-element, trust-boundary-crossings, and accepted-risks tables from the 2026-05-22 terminal security review are preserved unchanged. Cross-reference: the Frame doc’s Changelog 2026-05-23 entry for the full revision tally, and the Warden Stage 2 code-and-security review of 2026-05-22 for the original findings.
  • 2026-05-22. Stage 2 terminal security review, a reviewer pass in security mode with the threat-modeling skill loaded. The three threat-scaffold tables (threats by data-flow element, trust boundaries, accepted risks) were populated by a STRIDE-per-element walk of the DFD. The element-type relevance bar was applied: S and R for external entities, full STRIDE for processes, T/R/I/D for data stores, T/I/D for data flows. The pass recorded 72 threat rows across 35 DFD elements, annotated 9 trust boundaries with crossings, trust direction, authentication, authorization, and threats-at-crossing references, and recorded 7 accepted risks with rationale and named trip-wires. Severity distribution: 18 Critical, 29 High, 21 Medium, 4 Low. Mitigation candidates map to the Frame’s 14 Open ADR Slots wherever the control class fits, and one new candidate slot surfaced ({{P-AdminCLIDiscipline — new}}, CLI parameter-binding hygiene, distinct from {{P-MCPWriteSemantics}}). Material risks that name themselves at the architectural layer: signing-key custody (R-0004), RLS policy-enforcement deferral (R-0001), plugin sampling under V0.1+ third-party install (R-0007), and the workspace-id-supplied-by-plugin host-fn shape (P-host-fns/T, Critical). Follow-ups: the 14 {{P-XXX}} slots’ Spec-stage authorship is the mitigation surface this pass produced; the new {{P-AdminCLIDiscipline}} candidate joins the Tier-C operational hardening set; and the V0 dogfood scope underwrites every accepted risk and its trip-wire.
  • 2026-05-22. Port of the 2026-05-03 constraints draft into the project repo’s agent-primary architecture overview. Reconciliation to the locked product brief (intake-exit 2026-05-20) was applied:
    • The constraint inventory was updated to the brief’s Hard constraints (Apache-2.0 with future-relicense clause, license-lock 2026-05-20) and the 0.1.0 substrate description (LLM-API-key configuration surface folded into the substrate; builtin tenancy and identity core).
    • The external-constraints rows from the 2026-05-03 draft were removed (pre-announce dates, alpha invite-only target date, time budget, kill criterion), because the brief de-anchors architecture from marketing-tier dates and carves commercial inputs to a separate internal record.
    • The DFD was redrawn in D2 (project default G-0026) with P-builtin-projects, P-builtin-agents, P-builtin-workspaces, and P-builtin-auth moved out of TB-plugin-sandbox and into TB-mnemra-host (Frame correction 1: builtins, not plugins).
    • The DFD typed-element-ID convention (TB-* / EE-* / P-* / DS-* / DF-*) was preserved so the security-mode reviewer’s STRIDE-per-element annotation at the Stage 2 terminal review can target each element directly.
    • The threats-by-element, trust-boundaries, and accepted-risks tables are present as placeholders the terminal-review pass populates.
  • 2026-05-03 (port source). Original constraints draft, authored as an orchestrator-direct elicitation session against the V0 discovery and the architecture alignment R6 mental model. It produced the constraint inventory, the 6-axis QA tree, a 35-domain-question triage, and a DFD draft. A storage-layout strawman was forked off this draft by a researcher dispatch (it recommended a single-document storage layout for V0, kept open here as the Spec-stage ADR slot P-0001-storage-layout).

Specifications

This section contains canonical architecture specifications — locked frame + spec deliverables produced by the /brief workflow on real features. These are the primary architectural reading for outside integrators and reviewers.

A “spec” in this section is:

  • A living, locked deliverable. Living: updated as architecture evolves. Locked: no changes without explicit re-approval.
  • An agent-primary artifact (per G-0027). Outside-human reading lands on translated views generated at publish time (per G-0029).

Implementation-history specs (dated snapshots of completed setup or infra work) live elsewhere on disk and are excluded from mdBook navigation. They contribute to the agent-readable llms-full.txt surface only.

This section is currently empty — the first canonical spec lands as features progress through /brief Stage 3.

Architecture Decision Records

This section tracks the architectural decisions made in mnemra-core using the MADR (Markdown Architectural Decision Records) format.

What is an ADR?

An Architecture Decision Record (ADR) captures a single architectural decision along with its context and rationale. An accepted ADR changes by a dated, in-place ## Amendment YYYY-MM-DD section appended to the record (maintainer ruling 2026-10-19, #4018 activity 7793, confirming the practice of P-0003 “Amendment 2026-06-30” and “Amendment 2026-07-07” and P-0010 “Amendment 2026-10-19”): the original decision text is never rewritten, the amendment states what it supersedes and why, and the superseded text stays in the file as the record. The supersedes / superseded_by frontmatter and the superseded status remain available for a decision that is wholly replaced by a new record. Rejected alternative, kept with its reason: “ADRs are immutable once accepted — superseded by newer ADRs, never edited” (this file’s earlier rule). It lost because practice had already amended in place twice, a per-amendment successor file splits one decision’s lineage across records a reader must reassemble, and the in-place section keeps the decision and its history in one place — the same amend-don’t-erase discipline, applied inside the record.

ADR Lifecycle

Each ADR moves through the following statuses:

StatusMeaning
proposedUnder discussion; not yet accepted
rejectedDiscussed and explicitly declined
acceptedThe current decision in effect
deprecatedWas accepted; no longer applies (context changed)
supersededWholly replaced by a newer ADR; see superseded_by field. A partial change is an in-place dated amendment section, not a new status

G/P Prefix Projection Pattern

ADRs in this project use a two-tier identifier convention that reflects where a decision originates and how it propagates.

  • G-NNNN (general) — workspace-wide architecture decisions. These do not live as individual files in this directory. Instead, they are projected once into DEFAULTS.md — a one-time snapshot recording each general standard as a concise entry, without the full rationale chain. DEFAULTS.md is frozen at projection time; upstream changes to a G-* decision do not auto-sync into this file.
  • P-NNNN (project) — project-specific architecture decisions, stored as individual P-NNNN-*.md files in this directory. Two sub-categories:
    • Project-specific: a decision with no workspace-wide analog — a constraint or tradeoff unique to mnemra-core.
    • Override: a deviation from a DEFAULTS.md baseline entry. An override P-ADR names the default it overrides explicitly in its Status field (e.g., Status: accepted, Overrides G-0017).

The default is the starting point; any deviation is a new P-ADR.

Using the Template

To record a new project ADR, copy template.md to a numbered file (e.g., adrs/P-0001-topic.md), fill in all frontmatter fields, and write the body sections. If the decision overrides a DEFAULTS.md entry, state that explicitly in the Status section.

Current ADRs

Nine Tier-A ADRs authored in WS-E-2 Stage 3, plus the storage substrate/engine ADR (P-0010) folded in 2026-06-08 from a post-spec-lock storage-engine evaluation, plus the logging-facade ADR (P-0011) recording the tracing facade-from-binary choice merged 2026-06-17, plus the plugin-runtime + MCP-SDK ADR (P-0012) recording the raw-Wasmtime-over-Extism runtime choice (retroactive; shipped Tasks 20–22) and the official-rmcp-SDK-over-hand-rolled-MCP protocol choice (forward; implemented by Task 23) — correcting the two halves of the never-ratified adr-001-plugin-runtime research proposal, which the build reversed on both halves without an ADR. The 2026-06-09 observability re-derivation (P-0010 D8’s E1 disposition — generation⊥storage separation) was re-altituded out of the project-ADR layer: observability shape is a theory trait + chassis mechanism, not a per-project ADR, so its decisions live in the observability baseline and the original observability ADR P-0004 is deprecated (no successor ADR). P-0011 is not an observability-shape ADR — it is a dependency-selection + crate-topology decision (P-0010-shaped: a concrete library choice behind a locked contract), and is the plumbing foundation under that baseline. All Tier-A placeholder slots resolved (see placeholder-resolution.md for full status). The three retrieval-cluster ADRs (P-0014/P-0015/P-0016, authored 2026-07-02 at the retrieval-cluster Stage 3) resolve that cluster’s Frame slots; they are accepted (2026-07-02, at the retrieval-cluster spec-exit gate). The two reporting-engine ADRs (P-0020/P-0021, authored 2026-07-04 at the reporting-engine Stage 3) resolve that cluster’s Frame slots; they are accepted (2026-07-04, at the reporting-engine spec-exit gate). The single coordination-cluster ADR (P-0022, authored 2026-07-07 at the coordination-wedge Stage 3) resolves that cluster’s one Frame slot ({{P-CoordinationCluster}} — a single slot, not a split); it is accepted (2026-07-07, at the coordination-wedge spec-exit gate, as part of the Stage-3 package the gate reviewed alongside the cluster spec). The distribution ADR (P-0023, authored 2026-07-07 at the plugin-distribution Stage 3) resolves that Frame’s {{P-PluginDistribution}} slot; it is accepted (2026-07-11, at the plugin-distribution spec-exit gate, as part of the Stage-3 package the gate reviewed alongside the cluster spec).

ADRSummary
P-0001-storage-layoutC1 single-document layout: whole artifact in one row, JSONB frontmatter + body + system fields, per-artifact-type tables; non-breaking C2 evolution path via the projection layer. Sits under P-0010 (the Postgres implementation under the swap trait).
P-0002-core-plugin-partitionVerb-on-content cohesion criterion: 4 core: true plugins (tasks / repos / two further artifact-family plugins) covering 0.2.0–0.13.0; 7 builtins covering foundational substrate; 0.14.0 migration as builtin handler.
P-0003-plugin-manifestV0 manifest schema: universal content.emit verb shape, schema_version: 1, typed host-fn allowlist compiled per-instance from signed manifest; workspace_id structurally excluded from write-path ABI.
P-0004-observability-shapedeprecated — no successor ADR. (Historical.) Per-verb metrics surface, TimescaleDB retention policies (90d/365d/30d), health-endpoint detail body, and 1-hour continuous-aggregate window — conflated observability storage (TimescaleDB hypertables) into the app’s own Postgres substrate. Its storage core was falsified by P-0010 D8; the generation-side decisions were re-altituded to the observability baseline (a theory-trait baseline, not an ADR).
P-0005-v0-signing-chainV0 minimum-viable signing-key custody: build-host-on-disk at mode 600, synchronous fail-closed plugin load verification, multi-deployment trip-wire to {{P-SigningKeyCustodyHardening}} (Tier C).
P-0006-v0-tenant-enforcementTyped WorkspaceCtx parameter binding at the host-fn boundary as the V0 application-layer workspace isolation mechanism; WHERE-clause-mandatory discipline; upstream of RLS policy enforcement (V0.1+).
P-0007-plugin-resource-limitsWasmtime per-instance resource limits: fuel (10B ticks), epoch-interruption (5s), memory ceiling (64 MiB), table/instance limits at Wasmtime defaults; both fuel and epoch ON at V0.
P-0008-admin-token-shapeStatic admin token: opaque 32-byte random value, BLAKE3-hashed in DB, workspace claim from server-side lookup row; trivial revocation, no second signing key at V0.
P-0009-rls-admin-tokenBinary admin/read-observer role enum; permission matrix per role for MCP verb categories and CLI control-plane ops; WorkspaceCtx carries token_id for write attribution; V0 app-layer enforcement with V0.1+ RLS policy hardening path.
P-0010-storage-substrate-enginePostgreSQL ratified on merits behind an engine-agnostic swappable Storage trait (one implementation); V0 engine a separate, operator-run PostgreSQL instance (Amendment 2026-10-19, approved; was embedded Postgres); A1-clean V0 stack (pgvector HNSW + native FTS + recursive CTEs + JSONB); keyword/graph/time-series on named trip-wires (D3/D4/D8 — TimescaleDB demoted); D6 method-borrows deferred to the retrieval ADR; D7 managed-tier skipped. Reframes P-0001/Frame/overview. Escalation E1 (D8 vs observability hypertables) dispositioned 2026-06-09 → re-altituded out of the ADR layer to the observability baseline; P-0004 deprecated, no successor ADR.
P-0011-logging-facadetracing + tracing-subscriber (Green/MIT) as the logging facade, wired facade-from-binary: the binary (cmd/mnemra) owns the one global subscriber (JSON → stdout + EnvFilter); library crates use tracing macros only and never depend on tracing-subscriber. Macros = locked contract, subscriber = binary-owned implementation. Foundation + crate-topology only (impl-crate-only); the full emission layer (semantics, per-verb metrics, OTel export, redaction) is deferred to Task 25 / R-0004. A dependency/topology choice (P-0010-shaped), not an observability shape decision (which the 2026-06-09 E1 disposition keeps in the observability baseline).
P-0012-plugin-runtime-and-mcp-sdkTwo orthogonal substrate-layer choices the never-ratified adr-001-plugin-runtime proposal had bundled, and the build reversed on both halves without an ADR. Decision A (retroactive; shipped Tasks 20–22): host plugins on raw Wasmtime, not Extism — P-0007’s resource-limit mechanism (fuel + epoch + ResourceLimiter) needs direct Wasmtime Config/Store control an Extism abstraction would mediate. Decision B (forward; implemented by Task 23): adopt the official MCP Rust SDK rmcp v1.7.0 (Apache-2.0/Green) (Amendment 2026-10-25: the SDK, not a release of it; no crate version is a design value) for the single stdio MCP server rather than hand-rolling MCP/JSON-RPC — R-0010-a mandates MCP-2025-06-18 conformance (Amendment 2026-10-25, MCP protocol revision, approved 2026-10-29 (#4249 activity 9183): target MCP 2025-11-25; the host never speaks a draft revision, serves exactly the released 2025-06-18 and 2025-11-25, and answers any other revision requested at initialize with 2025-11-25. The host enforces that set itself; tests pin it at initialize and before the handshake, and the pin after the handshake is #4326 (open). Conformance also requires a -32700 reply with id null to a line that is not valid JSON, with the session kept open; #4323 adds it.) (Refined 2026-10-29, #4249 activities 9258 and 9311: an empty line gets no reply, and each malformed line, and each line of valid JSON that is not a well-formed message, is logged by its byte length only, rate-limited per session.) and the MCP server is the auth+dispatch trust boundary, the worst place to hand-roll a mandated external wire contract; mnemra’s R-0010 handler logic rides on top as the rmcp ServerHandler, unchanged (Amendment 2026-10-25, MCP protocol revision: the host also carries an initialize gate, a line-capped reader and an initialize override at that boundary, beside its ServerHandler). Dependency-selection decisions (P-0010/P-0011-shaped), anchored to P-StackDiscipline applied per-layer.
P-0013-plugin-invocation-modelTyped per-verb content exports (create/get/list/update/delete) invoked per authenticated verb; the universal run(input: string) -> string string-dispatch export is RETIRED; symmetric typing both directions, no string verb-resolution on the V0 surface. Fills the export/invocation-side gap P-0012 scoped out; accepted-on-landing (maintainer lock 2026-06-20).
P-0014-retrieval-architectureRetrieval topology for the retrieval cluster: per-shape chunking + one collapsed-tree multi-resolution index behind a TreeBuilder seam (authored-first under a named eval); hybrid FTS+dense fused by application-side RRF with local cross-encoder rerank; three host-served MCP verbs with disclosure-budget mechanics; degraded-mode matrix (zero-egress a supported configuration; model artifacts deploy-time-provisioned, never runtime-fetched); instrumentation shape; model pin+verify (TB-5) + encoder footprint disclosure. P-0010 D6’s four method-borrows land here (deferral closed).
P-0015-provenance-envelope-source-rolesThe two-axis envelope contract: a policy permissions record (dont_use / model_egress / visibility / tenant_share — mechanical validators, permissive not-set DDL defaults, named enforcement points, undecidable-only fail-closed poles) under the eight ratified mechanics and a single PARC-shaped decision port with per-channel serving-predicate placement + differential conformance; a trust axis (outdated/authoritative/background, origin-weighted supersession); freshness schema (handle kinds, decay classes, structural overrides); the closed three-kind displacement-event registry; citation form + per-dimension citation dispositions (dont_use stub vs visibility not-found); the V0 write-authorization invariant. sensitive dissolves into model_egress: deny + visibility: admin-only.
P-0016-edge-schemaOne superset edge table extending the 0.8.0 substrate: closed eight-type vocabulary; edge_class + origin discriminating columns with the supersedes classing rule; one-logical-edge uniqueness with origin-authority upgrade (system > declared > extracted); the superseded-by forward pointer defined as the directional view of the origin-weighted supersedes edge (no second field); extraction contract (source-span provenance, idempotent re-extraction, per-run measured coverage); recursive-CTE traversal contract carrying workspace + policy predicates at every recursion level with the D4 instrument field set; dual-writer manifest ownership.
P-0017-storage-cluster-modelRefines P-0001: per-artifact-type tables classified by a closed four-shape data-shape taxonomy (state-bearing / narrative / reference / associative), with cluster membership — not the table — carrying the shared index/RLS/retention/projection/promotion policy. Locks the source-of-truth principle (content row authoritative; derived surfaces rebuildable; cross-plugin refs are soft, only core entities are hard FK targets) and the column-promotion policy (JSONB default; additive/non-destructive; physical extraction forbidden at V0). Carves out P-0001’s tasks_history trigger-shadow, superseded by host-fn audit emission.
P-0018-core-entity-manifestThe core opinionated entity set every plugin may reference: projects, actors (single table, actor_type ∈ {human, agent, system}), tags, attachments as the four hard-FK-target core entities, plus audit-log/events as a core-owned emit-target surface (storage deferred to the observability baseline + event-bus ADR). Locks the negative space: workflow primitives (tasks, dispatches, skill-runs, specs, comments) are NOT core — they are plugin-introduced.
P-0019-plugin-contractFoundational plugin-contract capstone: Path B (WebAssembly Component Model + WIT), locked 2026-05-04, proven by the V0.01 spike (c9018e3). Locks the cross-cutting contract no sibling owns — WIT ABI shape invariants (sync WIT both directions, Layer-1 async, per-concern interfaces, @since/@unstable/@deprecated gates, host-derived workspace-ctx), Wasmtime >=44 floor (Amendment 2026-10-25: restated as the three Wasmtime capabilities it stood for), wasm32-wasip2-via-wit-bindgen toolchain, the closed Extism door, and the composite lifecycle. Four tripwired deferrals; cites P-0003/P-0007/P-0012/P-0013 for the detail each owns; supersedes/overrides null.
P-0020-report-execution-contextThe reporting engine’s dedicated read-only Postgres execution context: a SELECT-only report role + READ ONLY transaction (two independent write-blocks), table + function-EXECUTE allow-lists with default-deny exclusions (admin_tokens, policy-audit stores), a scoped RLS exception keyed on per-execution SET LOCAL session settings with session-key tamper-resistance via GUC-setter revocation (chosen over SET ROLE/current_user keying), the ownership/BYPASSRLS/FORCE ROW LEVEL SECURITY model as a correctness precondition, timeout/row-cap/bounded-pool cost containment, and the OC-10 reconciliation check. Scoped exception to the P-0006/P-0009 deferred-RLS posture on exactly the caller-authored-SQL path; converges with the general R-0001 activation. Resolves the reporting-engine Frame {{P-ReportExecutionContext}} slot.
P-0021-report-definition-typeThe report-definition content type: a host-core-owned reference-cluster content artifact written through the existing content-write machinery — argued deliberately OFF the P-0018 core-entity short list (referenced by name at lookup, never a hard FK target; a third host-owned-content category). Locks the definition schema, write-time validation (including rejection of data-modifying CTEs so an invalid definition never registers), full P-0015 policy-record inheritance (visibility not-found / dont_use stub dispositions), reserved-built-in-name reservation, and (workspace_id, name) uniqueness. Resolves the reporting-engine Frame {{P-ReportDefinitionType}} slot.
P-0022-coordination-clusterThe coordination cluster’s one-slot contract record: a core host subsystem (the P-0002 verb-on-content walk — not a plugin, mints no signed artifact, does not fire the P-0013 domain-verb tripwire) with actors as durable role-instance identity (sessions are ephemeral host-derived attachments; one-live-attachment, agent-type-only, audited succession), leases as the mutual-exclusion primitive on the duration line (substrate-atomic acquisition, TTL, expired-only always-audited takeover, a registered resource-identifier scheme), and addressed messages as rows with post-send immutability, a monotonic sent→delivered→acknowledged→dispositioned lifecycle, a closed {completed, declined, obsolete} disposition vocabulary, and code-registered types (merge-request v1 + handoff v1). Two agent-visible MCP tools (claim + message, actions as closed enums) inside the 8-of-≤9 verb budget; reads default-visible in-workspace / writes strictly authority-scoped with a multi-team + trust-differentiated-actor tripwire; own storage placement outside the P-0017 four-shape content taxonomy, hard-FK to core entities only, standalone over zero content. Merger stays instance-shaped (re-arm on push transport). Log topology, audit-store detail, and the auth-bundle policy composition are explicitly out of slot. Resolves the coordination-wedge Frame {{P-CoordinationCluster}} slot.
P-0026-db-connection-authentication-transport … P-0031-test-substrate-isolation(2026-10-19, accepted with the operator-run Postgres amendment — #4018 activities 7793 and 7800) Six control-class ADRs for the operator-run PostgreSQL instance — connection authentication and transport (P-0026), authorization and role separation (P-0027), requirements-check integrity (P-0028), DB credential files (P-0029), delegated-policy inventory and supply chain (P-0030), test-substrate isolation (P-0031); each points at the V0 substrate spec clauses R-0117–R-0121 that implement it. P-0032 (probe and readiness surface) is reserved and written with the HTTPS transport amendment (#4127).
P-0023-plugin-distributionThe distribution layer’s contract record (W2-1): uniform multi-artifact OCI bundle (N≥1, wasm = layers[0], signed inner manifest as config descriptor, one flat manifest, uncompressed-only at V0); keyed-in-tree package signature (P-0005 root over the domain-separated outer-manifest digest, OCI 1.1 referrer, signer-key-pinned, never TOFU); two R-NoExternalHost transports (image-layout fs, self-hosted distribution API) behind one store contract; the bounds-first pre-phase (fetch-within-bounds → verify-package-signature → verify-blob-digests → unpack-within-bounds) behind the locked PackageVerifier seam (TUF slots behind it at R-0005-e); hard cutover, no bare/legacy load path; single-root custody exposure recorded (register R-0009). Pulls P-0019 DEF-2’s single-publisher scope ahead of its tripwire and supersedes its cosign-on-wkg shape; the [[artifacts]] schema lands as P-0003 §Amendment 2026-07-07. Resolves the plugin-distribution Frame {{P-PluginDistribution}} slot.

Project Standards

General architecture and engineering standards applied to this project. These are the baseline that mnemra-core inherits from the workspace. They were projected once, on 2026-05-20, and a project-specific decision can override any of them. Those overrides are the P-*.md files in this same directory, the P-* ADRs scoped to a single project.


2026-06-22 renumber. The workspace general-ADR corpus was renumbered (G-0001 through G-0015). Amendment chains were consolidated, and ADRs that expressed a stance rather than a one-off decision were elevated to workspace principles (P-*). The entries below are remapped to their post-reset homes per brain/decisions/MIGRATION-MAP.md. A few standards whose substance moved to a principle or a skill are kept here as pointers: the standard still applies to mnemra-core, only its canonical home changed.

G-0001: Two-Tier Architecture Decision Records

There are two tiers. General standards live in this DEFAULTS.md file, which is the project’s architectural baseline: projected once, then owned by the project. Project-specific decisions go in P-NNNN-*.md files in this directory. When a project-specific decision overrides a default, it says so explicitly in its Status field.


G-0002: Justfile as CI Contract

CI YAML invokes just ci and nothing else. Every project uses the same fixed verify-* recipe names: verify-test, verify-lint, verify-type, verify-coverage, verify-build, verify-smoke, ci. Each verify-* recipe emits a GATE <name> <PASS|FAIL> line and is idempotent from any working directory. No --fix side effects are allowed under verify-*. Auto-fix recipes live under fix-* instead.


G-0003: Merge Governance

A single consolidated merge-governance standard. It folds in three things that used to be separate: the Stage-6 closed-enum label vocabulary, the Stage-6 label-set authorization plus required-status-check enforcement, and the autonomous implementation loop that runs after plan approval. See workspace brain/decisions/G-0003-merge-governance.md.


G-0004: Review Finding Identity and Per-PR Per-Round Persistence

A review finding’s identity is the (file, content-anchor, severity) triple. The content-anchor is the SHA-256 of a normalized 5-line window: the cited line plus two lines of context above and below, with trailing whitespace stripped per line. Reviewer output includes the anchor inline. That way downstream dedup logic doesn’t need to re-read the file at the cited round’s commit to recompute it.


G-0005: Devcontainer Architecture — Per-Repo Upstream FROM + GHCR Push

Each repo’s devcontainer builds FROM an upstream, language-native base image. It’s built and pushed to GHCR by the repo’s own CI whenever .devcontainer/** changes, and SHA-pinned in the repo. Every cargo install line in a devcontainer Dockerfile must pass both --locked and --version <X.Y.Z>. Polyglot repos layer the additional language bases in their own Dockerfile. There’s no workspace-shared polyglot base.


G-0006: Layered Secret Detection — Pre-Commit + GitHub-Native + Stage 5 Alerts Query

Three layers run in every in-scope repo. First, pre-commit lefthook hooks using a workspace-shared narrow regex. Second, GitHub-native secret_scanning and secret_scanning_push_protection, enabled continuously. Third, a Stage 5 verify-secrets recipe in just ci that queries the secret-scanning alerts API with permissions.security-events: read and fails the build on any open alert.


G-0007: Feature Flags — FlagProvider Trait + Per-Repo Crate

Each in-scope repo defines its own feature-flag crate that implements a small FlagProvider trait. The default backend is env-var-driven (FLAG_<KEY>). Keys are kebab-case in source; the env vars are SCREAMING_SNAKE_CASE with a FLAG_ prefix. Extraction to a shared workspace crate waits until commonality emerges across three or more repos. That’s the rule of three, the P-PerRepoFirst principle (per-repo first, extract on rule-of-three) applied to flags.


G-0008: PR-Merge Apparatus

A single consolidated PR-merge apparatus. It folds in the prior workspace merge template plus the auto-merge recovery cap, tag-race serialization, and the GitHub Merge Queue used for R26b enforcement. (R26b is an R-code, a stable identifier for a numbered requirement; its full text lives in the requirements document that defines it.) See workspace brain/decisions/G-0008-pr-merge-apparatus.md.


G-0009: Rust Release Apparatus

A single consolidated Rust release apparatus. It folds in the prior release-plz automation standard and the monotonic, non-decreasing version policy. See workspace brain/decisions/G-0009-rust-release-apparatus.md.


G-0010: Embargo Flow Architecture — β Default + GHSA Private-Fork

The default posture is to build no embargo workflow at all. When an embargoed disclosure actually arrives, use GitHub Security Advisories (GHSA) with the temporary private-fork pattern. During an embargo, Mode A flag-flip merges are suspended in the affected repo. An audit-PR opens at T0 to re-engage the Stage 4 and Stage 5 gates before the GitHub release publishes. Trip-wires upgrade this to a built workflow if embargoes start recurring.


G-0011: Internal IPC Uses Typed Binary Encoding; JSON for Stored State and External Surfaces

Internal IPC defaults to a typed binary encoding, either Protocol Buffers or FlatBuffers. JSON is reserved for stored state and external surfaces. “Internal” has a precise meaning here: both endpoints are under the same project’s or team’s control, the payload isn’t persisted as the canonical record, and there’s no trust-domain boundary. The choice between protobuf and flatbuffers is per use case. Protobuf fits typical request/response with cross-language tooling. Flatbuffers fits read-heavy, zero-copy, mmap-able payloads.


G-0012: Project Dev Docs — mdBook + D2 + Mermaid

mdBook (Apache-2.0 / MIT, the rust-lang official tool) is the static-site generator, one per project repo, and CI deploys it to GitHub Pages. D2 handles architecture-grade diagrams in the built docs sites. Mermaid handles diagrams in committed .md files that are read in the GitHub web UI. Integration is through mdBook custom preprocessors: mdbook-d2 and mdbook-mermaid.


G-0013: Agent-First Workflow Shape — /brief + /verify

The workflow is agent-first and built on two skills. /brief is the unified pipeline through Intake (Stage 1, capture validated intent), Frame (Stage 2, synthesize the constraint summary), and Spec (Stage 3, produce the testable contract). It has two human touchpoints and a mandatory Stage 0 baseline load of values, principles, ADRs, and the constraint graph. /verify is its pair, a four-signal stack: tests, property-based tests, intent-conformance review, and a decomposer spot-check. /brief is the single canonical entry for any work that produces a spec. The older /discover, /spec, and /clarify skills survive only as internal mechanisms that the stages reuse.


G-0014: Publish-Time Human Render via Bidirectional Translation

Agent-primary doc repos publish two surfaces from one canonical source tree (docs/src/): mdBook HTML for humans, and llms.txt plus llms-full.txt for agents. Each page declares primary-audience: agent | human. The opposite-audience render is generated locally, either by an EXPLAIN pass (resolve jargon, add narrative, link the glossary) or a STRIP pass (tighten to facts plus cross-refs). Both the translations and the _published/ tree are committed, so CI stays dumb. Regeneration is hash-gated through .translation-manifest.json, which means a translation runs only when its source actually changes.


G-0015: Relational Substrate Default — Postgres (server-side) / SQLite (embedded), behind an engine-agnostic seam

The default relational substrate is keyed on deployment topology, not picked once globally.

Server-side, multi-tenant, or managed-tier work goes to PostgreSQL. That’s chosen on affirmative merits, but only after a hard license-pass-first gate: mature RLS multi-tenancy, single-transaction atomicity for multi-write commit-or-rollback, and decades-deep backup, PITR, and observability.

Embedded, single-writer, single-process work goes to SQLite. SQLite here isn’t a fallback from Postgres; it’s the correct default for that topology.

A project records its substrate against its topology rather than re-litigating Postgres-vs-SQLite each time. The storage surface is locked behind an engine-agnostic Storage seam, treated as an intrinsic contract invariant (P-LockContract, lock the contract and vary the implementation): the seam is a trait, the chosen engine is the implementation behind it. A future swap stays bounded behind that one seam (P-MinBlastRadius, a change reaches no further than the architecture allows). Don’t build a second adapter speculatively (P-Defer, defer the mechanism until evidence forces it); the second implementation waits behind a named trip-wire.

When the Postgres lane is taken with Row-Level Security, the constraints are exact. The application role must not hold BYPASSRLS and must not be a superuser. ALTER TABLE … FORCE ROW LEVEL SECURITY is required if the app role owns the tables. The tenant key must be set per transaction (SET LOCAL), never per session: a session-level SET leaks across pooled connection checkouts.

mnemra-core’s own embedded-engine choice (postgresql_embedded, a single self-hosted-binary posture) and its V0 stack specifics stay in the project ADRs P-0001 and P-0010. See workspace brain/decisions/G-0015-relational-substrate-default.md.


Elevated to workspace principles / skills

These standards still apply to mnemra-core. Their canonical home moved out of the numbered ADR corpus in the 2026-06-22 reset.

  • Testing Philosophy, 90% Coverage, Inverted Pyramid → workspace principle P-TDDPairs (the coverage-floor and pyramid section). A 90% code-coverage threshold (lines and functions) as the enforced default, an inverted test pyramid, and documented threshold exceptions.
  • Agent-Primary Source Artifacts; Human Views Derivative → workspace principle P-AgentPrimarySource. Source-of-truth artifacts are authored and stored in agent-primary form (structured, machine-addressable, stable IDs); human-readable views are derivative and never the source of truth.
  • No Compile-Time Asset Embedding in Containerized Projects → skills/rust.md §<build>. No rust_embed-style compile-time asset embedding for Docker-deployed Rust; serve static files at runtime with startup directory validation.
  • SQL File-Based Migrations for Embedded SQLite → skills/rust.md §<sqlite>. SQL file-based, compile-time-embedded, forward-only migrations.
  • Hybrid XML Format for Agent Profiles → skills/xml-profile.md. XML tags for structural sections, markdown inside the tags, at most two nesting levels.
  • Knowledge-Extraction standards → skills/knowledge-extraction.md and project-23 P-0001 through P-0004 (nudge hook, capture-table schema, duplicate-detection scope, advisory-drift detection, worked-example encoding, safety ceilings).

ADR Template


status: “proposed” date: “YYYY-MM-DD” decision-makers: [] consulted: [] informed: [] supersedes: null superseded_by: null

P-NNNN: Title

Status

proposed | rejected | accepted | deprecated | superseded

Context and Problem Statement

Describe the context and the problem you’re solving. What forces or constraints led to this decision point?

Decision Drivers

  • Driver 1: e.g., operational simplicity
  • Driver 2: e.g., fit with the existing toolchain
  • Driver 3: e.g., security posture

Considered Options

  1. Option A — brief label
  2. Option B — brief label
  3. Option C — brief label

Decision Outcome

Chosen option: Option A, because [brief rationale].

Consequences

Good:

  • Consequence 1
  • Consequence 2

Bad / Trade-offs:

  • Trade-off 1

Pros and Cons of the Options

Option A

  • Pro: …
  • Pro: …
  • Con: …

Option B

  • Pro: …
  • Con: …
  • Con: …

Option C

  • Pro: …
  • Con: …

More Information

Links, references, related ADRs, or follow-up work items.


Frontmatter Field Reference

superseded_by — Use this field when this ADR (Architecture Decision Record: a document capturing a significant technical or process decision, its context, the rejected alternatives, and the expected consequences) has been replaced by a newer decision. Set it to the identifier of the superseding ADR (e.g., superseded_by: "0007-new-decision.md"). When this field is non-null, this ADR’s status MUST also be set to superseded. The superseding ADR SHOULD reference this one in its supersedes field, which creates a bidirectional link between the two records. Don’t delete or edit an accepted ADR to reflect new thinking. Create a new ADR that supersedes it instead. The original record preserves the historical context and reasoning that led to the prior decision.

Glossary

Mnemra’s documentation uses a consistent vocabulary drawn from its architecture decision records, operating principles, and work-shaping pipeline. This glossary anchors that vocabulary for readers who are not already familiar with these terms. Each entry is a terse reference; where a fuller treatment exists in the architecture documentation, the entry points there.

Terms are grouped by category, then alphabetical within each group.


Architecture Decision Records

ADR

An Architecture Decision Record captures a significant technical or process decision — the context that prompted it, the decision itself, rejected alternatives, and expected consequences. ADRs are not changelogs; they preserve the option space a decision was made against, so future readers can understand why the selected path was taken and what was ruled out.

Mnemra-core uses the MADR format (Markdown Architectural Decision Records): each ADR is a separate .md file with structured sections. See the ADRs section of this documentation.

DEFAULTS.md

The project’s architectural baseline. DEFAULTS.md is a one-time snapshot of the workspace’s general architecture decisions, projected at the time the project was created (or last re-projected). Each entry carries an ID (e.g., G-0026) and a concise description — 1–3 sentences summarizing the decision — without the full rationale chain.

DEFAULTS.md is frozen at projection: updates to upstream workspace decisions do not auto-sync into it. Any deviation from a DEFAULTS.md entry becomes a P-* ADR, not an edit to DEFAULTS.md.

The default is the starting point; any deviation is a new P-ADR.

See also G-* ADR and P-* ADR.

G-* ADR

A G-* ADR (the G stands for global) is a workspace-wide architecture decision that applies across all projects in the workspace. These decisions lock patterns that individual projects inherit: source artifact format, workflow shape, docs publication strategy.

G-* ADRs live in workspace-internal canon and do not appear directly in mnemra-core’s ADRs, guides, or other documentation. They surface in mnemra-core docs only in two places: (1) DEFAULTS.md entries that cite their origin G-ID, and (2) P-* ADR Status fields that mark an override (Overrides G-NNNN). The codes are stable identifiers, not version numbers.

P-* ADR

A P-* ADR (the P stands for project) is an architecture decision scoped to a single project. Two categories:

  • Project-specific: a decision with no workspace-wide analog — a constraint, pattern, or tradeoff unique to this project.
  • Override: a deviation from a DEFAULTS.md baseline entry. The Status field of an override P-ADR names the default being overridden (Overrides G-NNNN).

P-* ADRs live in the project’s own repository under docs/src/adrs/. They use the same MADR format as other ADRs. See also G-* ADR.


Architecture Principles

Architecture principles are named rules that operationalize the workspace’s core values. Each principle carries a short label (P-Defer, P-WriteTimeAudience, etc.) that ADRs and design documents use to ground their decisions. The full statement of each principle — its rationale, how it shows up in practice, and anti-examples — lives in the workspace’s architecture-principles document. The entries below are terse pointers intended for readers encountering a principle label in a doc.

P-Defer

Defer mechanism choice until evidence forces it. Trip-wire-driven adoption beats anticipated-need adoption: the shape of the evidence informs the shape of the mechanism. When a mechanism is named before its trip-wire fires, see the open/deferred section of the relevant ADR.

P-InstrumentBefore

Every production surface ships instrumented before launch. Metrics, structured logs, and traces sized to the surface are in place at first use, not added after the first incident.

P-LockContract

Lock the contract; vary the implementation. The contract is what other code depends on; a stable contract makes implementations swappable without breaking callers.

P-MinBlastRadius

A change reaches as far as the architecture allows. The goal is that a fix isolates to one module and a feature lands behind one seam; when a minimal change would require touching many files in lock-step, the architecture is reporting structural debt.

P-PerRepoFirst

Per-repo first; extract on rule-of-three. Shared abstractions emerge from observed reuse, not from speculation about what the reuse will look like. Extraction that precedes the third occurrence creates shared code before it has earned its keep.

P-PreserveDecisionSpace

Preserve the option space. Every ADR carries an Alternatives Considered section listing rejected options with reasons. Dropping a rejected alternative because it now feels obviously wrong leaves future readers unable to see what was on the table.

P-TrustThenRetro

Trust the loop; retro selectively. Direction is set up front; the team executes within it; review concentrates on outcomes and patterns. Walking every decision with the reviewer serializes work through their attention — the failure mode this principle exists to prevent.

P-WriteTimeAudience

Generic at write-time for repo artifacts; identity-preserving for workspace artifacts. Repo- persisted artifacts (specs, ADRs, READMEs) use generic role labels and omit workspace-internal vocabulary, because any commit can become a publish event. Workspace-private artifacts preserve agent attribution and internal context because that attribution is the pattern signal worth keeping.


Feature Register Lifecycle Tiers

The feature register tracks each product capability at exactly one lifecycle tier. Tiers are validated by pipeline artifacts — the validator for each tier is “does this artifact exist?”, which makes the register mechanically checkable rather than prose-assessed.

idea

A captured direction — a thought or a decision-locked pointer to a provenance record. No pipeline artifact exists yet. The idea tier is the scope-anchor surface: research and discovery read idea-and-up to ensure intended directions are never silently dropped to what-exists-live.

proposed

The feature has a locked intake — it has been through intent capture. Permanent artifact; this status does not regress.

designed

A locked frame plus a locked spec both exist — the permanent “what to build” is complete. Permanent artifact (kept). A feature reaches designed before it reaches committed: release-fit cannot be judged until the design is complete.

committed

designed plus a plan, release-bound. The plan is ephemeral (not kept after the work completes); its ephemerality is why it marks commitment — a throwaway task list is generated only when work is being actively actioned against a release.

live

Built and verified in current code and canon.


Pipeline Stages

The work-shaping pipeline turns product intent into a verifiable, implementable spec in three stages. Each stage has a defined input, output, and owner; agents operate autonomously between the two human touchpoints (at intake-exit and at spec-exit).

Intake

Stage 1. The decomposer writes; agents review. Structured intent is captured — job-to-be-done, non-goals, success criteria, hard constraints — and an agent review pass validates completeness and flags conflicts with architecture principles and values. The decomposer iterates until intent is locked. Output: validated intent.

Frame

Stage 2. Agents synthesize. The constraint graph is walked from the validated intent; operating constraints are proposed; a review pass flags conflicts; routine architecture decisions are batched, novel ones escalated. Output: frame document (constraint summary and rationale chain).

Spec

Stage 3. Agents synthesize. A testable spec is produced from the frame document; a review pass validates testability and spec quality. The spec is the contract that verification consumes. Output: locked spec.


Requirement Codes

R-codes

R-codes are stable identifiers for numbered requirements in a canonical requirements or specification document. An R-code (e.g., R7, R12) refers to a specific requirement entry whose text, constraints, and rationale are defined in that document.

When an R-code appears in mnemra-core documentation, it is always accompanied by its definition and originating context — either inline at the cite site or in mnemra-core’s requirements document. R-codes do not carry stable public meaning on their own; their meaning is authoritative only in combination with the requirements document that defines them.

Mnemra-core’s R-codes will materialize once its requirements document is written. Until then, any requirement referenced in a doc is stated in full at the point of citation.