Phase 5 — The Implant: the write-back boundary
25 JUL AT 10:39 AM

Phase 5 — The Implant: the write-back boundary

0 LOVES 1 VIEWS
Phase 4 gave facts a shape to read; nothing writes them yet. Phase 5 is the mutation boundary — assertion-aware authoring endpoints with the forced-grounding invariant enforced structurally, a thin MCP write tool for the agent, and the duplication ruling: every writing surface enforces the invariant in its own module. Gated, by design.

Rekall's other service was the implant — writing a memory in. Phase 4 gave facts a shape to read; as of the end of it, nothing writes an assertion at all. Phase 5 is the mutation boundary: assertion-aware authoring endpoints, the forced-grounding invariant enforced structurally at the write, a thin MCP write tool so the agent files facts through the same door a human would, and the sameAs candidate-and-merge operation exposed to both.

Why a boundary and not just "let it write": everything in the 5-family (5a delete-consistency, 5b Studio authoring, 5c grounding lifecycle, 5d rollout, 5e Flutter) sits on this one boundary. If the boundary is wrong, every consumer inherits the bug. So it is designed once, deliberately, and gated — the agent writes at scale only after the structure is proven to reduce misses.

How the boundary is built

Four decisions that make one write path safe for both the human and the agent.

Forced grounding — every fact element resolving to something visible in a post — lands at the mutation boundary, not as a schema NOT-NULL. Phase 4 proved why: a schema constraint can be satisfied by a bare pointer that still isn't grounded. The boundary checks the real thing (does this resolve to a visible block?) and refuses the write otherwise. The guardrail cannot depend on the actor it constrains, so it lives in the wall, not the actor.

There are several writing surfaces — the API v1 authoring endpoints, the Studio authoring service, later the agent's runtime. The ruling (2026-07-15): each surface enforces the invariant in its own module, not by importing a shared enforcer. Many doors through one wall, and the walls all say the same thing — verified by each module's own tests. This deliberately reversed an earlier "extract to a shared package" instinct: internal/authz is the exception, not the precedent. Duplication buys future divergence; a shared copy couples modules meant to evolve apart.

The agent's write path is a thin MCP write tool over the API v1 authoring endpoints — not a private side-channel. It files a fact through the exact door a human editor would, so it inherits the grounding guard and the lifecycle rules for free. A crucial non-choice: the skill engine (which writes posts directly, bypassing the service layer) is not this write path — that is Phase 7's runtime. Routing P5 through it would create a second, divergent copy of the very invariant P5 exists to make structural.

When two blocks or posts turn out to be the same thing, the boundary exposes a sameAs candidate-and-merge operation: the fact layer moves loser → winner (alias-forward), and the content is never deleted — cleanup is optional and bulk. At assertion time both duplicates are already in visible blocks, so the merge stays inside the force rule, and its non-deletion is the nothing-hidden rule applied. The same operation is offered to both the human (in Studio) and the agent (over MCP) — one boundary, two consumers.

Total Recall — the AI Memory Layer (master)
Total Recall — the AI Memory Layer (master)
Jul 25, 2026 Total Recall
← Back to Total Recall