Skip to content

docs: hosted memory governance contract design (#6)#48

Merged
BunsDev merged 1 commit into
mainfrom
docs/issue-6-memory-contract
Jul 7, 2026
Merged

docs: hosted memory governance contract design (#6)#48
BunsDev merged 1 commit into
mainfrom
docs/issue-6-memory-contract

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 7, 2026

Copy link
Copy Markdown
Member

Design/contract doc for #6, following the repo's established pattern (a design doc — docs/durable-task-store.md — precedes the coordinated implementation). Single new file, no code touched, so it doesn't contend with the in-flight #2 store work or the #13 permission-gate follow-up.

What it defines

docs/memory-contract.md — the memory governance contract between coven-github (policy authority) and coven-code (policy enforcer):

  • memory_policy brief block (additive, optional, deny-by-default): tenant/repo/branch scope, a trust_scope enum, read_scopes/write_scopes namespaces, approval_required, and retention. Absent block or missing scope = memory off, never "unrestricted".
  • memory_used result metadata: entries read (for citation), proposed writes (with approval state), and runtime-rejected candidates — so the adapter can re-validate and reviews can cite what memory shaped them.
  • Trust model: fork-PR and external actors can never write durable memory (the issue's sharpest risk — memory poisoning via hostile fork content), enforced both by empty write-scopes and adapter-side re-validation.
  • Prefix-addressable keys (repo/<owner>/<name>/..., tenant/<install>/...) that make inspect/revoke-by-installation/repo mechanically possible (the API surface itself waits on Add tenant-scoped task API authentication for CovenCave and hosted clients #3).
  • Redaction ties memory writes to Split agent read auth from publication write auth #4's secret-scrubbing so credentials can't enter durable memory.
  • Adapter enforcement points mapped to real files, and the write path that Add marker-backed comments and maintainer command protocol #13's currently-no-op @familiar remember/forget commands will drive.

Scope

Design only — it proposes the additive schema changes (session-brief.schema.json, result.schema.json) but does not edit the locked bilateral contract, since those land in lockstep with the coven-code side. Phased for coordinated rollout; does not close #6.

Relationship to sibling issues is called out inline: builds toward #3 (inspect/revoke API), reuses #13's permission lookup for trust_scope, and reuses #4's redact module.

🤖 Generated with Claude Code

Proposes the coven-github <-> coven-code memory contract: a deny-by-default
memory_policy brief block (tenant/repo/branch/trust scoping, read/write scopes,
approval, retention), memory_used result metadata for citation and validation,
a trust model where fork/external actors can never write durable memory,
prefix-addressable keys for inspect/revoke, redaction of secrets before
persistence, and adapter-side re-validation of every memory write. Phased for
coordinated bilateral rollout.

Signed-off-by: Val Alexander <bunsthedev@gmail.com>
Copilot AI review requested due to automatic review settings July 7, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new design/contract document defining how hosted durable memory governance should be expressed and enforced across the coven-github (policy authority) → coven-code (policy enforcer) boundary, as groundwork for issue #6 and related hosted-safety work.

Changes:

  • Introduces a proposed memory_policy block for session-brief.json to explicitly scope memory enablement, read/write namespaces, trust, and retention.
  • Specifies memory_used result metadata to support citation, approval workflows, and adapter-side revalidation of proposed writes.
  • Documents the trust model, key addressability requirements, and redaction/enforcement points in the adapter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/memory-contract.md
Comment on lines +60 to +61
- Local/self-hosted memory behavior. Self-hosters own their own store; the
fail-closed hosted rules apply only when a `memory_policy` is present.
Comment thread docs/memory-contract.md
Comment on lines +156 to +161
- **`read_scopes` / `write_scopes`** name namespaces, never raw paths. The
runtime resolves a namespace to concrete keys itself, but every resolved key
MUST be prefixed by the tenant + repo coordinates (see
[Addressability](#addressability-inspect-and-revoke)). `tenant_shared` is
cross-repo memory *within one installation*; `familiar_global` is
cross-tenant and is **never** granted in hosted mode by default.
Comment thread docs/memory-contract.md
Comment on lines +170 to +173
| `trust_scope` | Who | Default read | Default durable write |
|---|---|---|---|
| `maintainer` | admin/maintain/write actor on the target repo (see #13 permission gate) | `repo`, `tenant_shared` | `repo` (subject to `approval_required`) |
| `collaborator` | triage/read collaborator | `repo` | none (may *propose*, needs approval) |
@BunsDev
BunsDev merged commit dedab27 into main Jul 7, 2026
2 checks passed
@BunsDev
BunsDev deleted the docs/issue-6-memory-contract branch July 7, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define hosted memory governance contract between coven-github and coven-code

2 participants