docs: memory build-vs-gate decision (Position C) + universal gate pattern + arch.md index#146
Merged
Merged
Conversation
…tern + arch.md index
Decision + reframe
- research/memory-build-vs-gate-decision.md: DECIDED Position C — memory is
three layers (engine / store / gate). AgentKeys owns the K3-encrypted,
per-actor, cap-gated, audited STORE + the GATE; the ranking/extraction
ENGINE is delegated to the ecosystem (mem0-self-hosted / Claude memory
tool / Hermes-native / agentmemory). Rejects "pure gate, use their store"
(breaks the founding privacy requirement 3/5). Claude's own memory tool
validates the split (engine closed, store yours via BetaAbstractMemoryTool).
- plan/agentkeys-memory-design.md: reframed from "memory system" to "gated
memory backend". Engine sections (vector index, BM25, /search,
/rebuild-index, embedding rotation) demoted to optional pluggable stages
E1/E2 with ENGINE banners. §9 stages split into CORE (store+gate:
M-1→M0→M1→M1.5 namespace gate→M2→M3→M4) and ENGINE (E1/E2, deferred).
Generalization
- research/universal-gate-pattern.md: the engine/store/gate split
generalizes to every worker (memory / email / payment / home-IoT). Four
cap-token policy primitives (operation / resource-scope /
quantitative-limit / attribute-constraint) + the determinism principle
("no burgers" = deterministic MCC/category check, never an LLM judgment
at the gate) + stateless-vs-cumulative-limit distinction. New workers are
template instances; home-IoT "control only kids' equipment" = resource
scope + op-level.
Research inputs
- research/ai-memory-systems-survey.md companion + agentmemory-and-claw-code
-followup.md (engine landscape that fed the decision).
- research/README.md: index rows for the three new docs.
arch.md indexing + defect cleanup (single-source-of-truth hygiene)
- Added a "Design records & research" index block linking the decision,
the gated-backend spec, and the universal-gate pattern from arch.md.
- §15.2 memory-service: filled the [TODO link] placeholder with the
Position-C anchors; documented store-vs-engine + 4 types × namespaces.
- Fixed broken companion-doc links (spec/signer-protocol.md,
spec/threat-model-key-custody.md were pointing at docs/ root).
- Removed stray committed reasoning ("Wait —"/"Hmm" lines) from the header.
- §17.5: collapsed a corrupted cap-endpoint table (88 rows, /v1/cap/
memory-search duplicated 41×) to the 5 canonical rows; fixed the intro
count. 0 broken internal links remain.
No code changes. Planning + research + docs only.
…cs Phase C) Found by the agentkeys-docs cross-link audit: - ../cloud-setup.md → cloud-bootstrap.md (renamed in #99; arch.md is in docs/) - ../runbook-k3-rotation.md → runbook-k3-rotation.md (drop ../; lives at docs/ top) - ../v2-stage1-migration-and-demo.md → v2-stage1-migration-and-demo.md (drop ../) - spec/spec/heima-open-questions.md → spec/heima-open-questions.md (double-spec typo) - ../wiki/agent-role-and-usage-hdkd-per-agent-omni.md → wiki/agent-role-and-usage-hdkd-per-agent-omni.md (drop ../) arch.md now has 0 broken internal links; 0 stale old-path refs repo-wide; publish-wiki.yml targets docs/wiki/.
…keys-docs Phase C) - arch.md §22a.5a: spec/spec/heima-open-questions.md → spec/heima-open-questions.md (double-spec typo, anchored link the prior pass missed). - New docs/wiki/agent-role-and-usage-hdkd-per-agent-omni.md — the focused operator reference for the agent role that CLAUDE.md + arch.md (§6, §25) link to but that never existed. Defers to arch.md per the wiki-location policy; covers agent-vs-master role, per-agent actor_omni stability, gated capabilities, and the create/run/scope/revoke operator flow. arch.md now has 0 broken internal links (verified). The agent-role page resolves the last 2 broken refs (arch.md §6 + §25).
…c-040fa6 # Conflicts: # docs/research/README.md
…paths after #141 merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pre-implementation research + decision + docs. No code changes. Three threads, plus source-of-truth hygiene:
1. Decision: memory = engine / store / gate (Position C)
docs/research/memory-build-vs-gate-decision.mdrecords the call: AgentKeys owns the gated, K3-encrypted, per-actor, audited memory STORE + the GATE; the ranking/extraction ENGINE is delegated to the ecosystem (mem0-self-hosted / Claude memory tool / Hermes-native / agentmemory).BetaAbstractMemoryToolbacks it with "S3, encrypted files"). AgentKeys can literally be a Claude memory backend.2. Reframe:
agentkeys-memory-design.md→ "gated memory backend"/search,/rebuild-index, vector index, BM25, embedding rotation) demoted to optional pluggable stages E1/E2 with🔌 ENGINEbanners.M-1 → M0 → M1 → M1.5 namespace gate → M2 → M3 → M4) and ENGINE (E1/E2, deferred).3. Generalization: the universal gate pattern
docs/research/universal-gate-pattern.md— the engine/store/gate split generalizes to every worker (memory / email / payment / home-IoT). The cap-token is the universal policy carrier with four primitives:deny_attrs:["mcc:5814"]Plus the determinism principle: the gate decides authorization deterministically on structured attributes; semantic judgment ("is this a burger?") happens upstream and reduces to an attribute the gate checks — never an LLM judgment at the gate (non-deterministic, prompt-injectable, unauditable). New workers (e.g.
agentkeys-worker-iot) become template instances.4. arch.md indexing + source-of-truth hygiene
Per the architecture-as-source-of-truth policy,
arch.mdnow links outward to the new docs, and I fixed pre-existing defects found while anchoring:[TODO link]placeholder with the Position-C anchors + store-vs-engine framing + the 4 types × namespaces.signer-protocol.md/threat-model-key-custody.mdpointed atdocs/but live indocs/spec/./v1/cap/memory-searchwas duplicated 41× (88 rows total) — down to the 5 canonical rows; fixed the intro count. arch.md: 2160 → 2077 lines.0 broken internal links remain in arch.md.
New / changed files
docs/research/memory-build-vs-gate-decision.md,docs/research/universal-gate-pattern.md,docs/research/agentmemory-and-claw-code-followup.mddocs/plan/agentkeys-memory-design.md(reframe),docs/arch.md(index + defect cleanup),docs/research/README.md(index rows)Test plan
](...)targets).memory-searchduplication removed.docs/research/*.mdpresent indocs/research/README.mdindex.Notes for reviewers
/create-prpolicy: committed from the Claude Code worktree (git), pushed via jj from the main repo; noCo-Authored-Byline.agentkeys-docsskill referenced in CLAUDE.md does not exist on disk — the docs organization here was done manually against the documented layout policy. Worth either creating that skill or dropping the reference (out of scope for this PR).