Skip to content

Commit c4f7bec

Browse files
docs(audit): correct A4 — primary merge now category-gated, dreamer keeps cross-identity
The P1 #1 fix (5386309) added a primary-agent ownership/category gate to ctx_memory merge, so A4's old 'do not add an ownership guard to merge' guidance now contradicts shipped code. Rewritten to record the split: primary callers go through memoryVisibleToTool (same as update/archive), dreamer keeps the unrestricted cross-identity supersede path. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
1 parent 5386309 commit c4f7bec

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

docs/AUDIT-KNOWN-ISSUES.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,18 @@ demotion *aligns* with the decay philosophy (older history is the first to lose
4848
fidelity). A round-robin / even-distribution demotion would add complexity for a
4949
path that seldom runs and whose bias is already the desired one. Accepted.
5050

51-
### A4. `ctx_memory merge` does not enforce single-project ownership
52-
53-
`tools.ts` — unlike `update`/`delete`/`archive` (which guard that the target
54-
belongs to the current project), `merge` intentionally allows cross-identity
55-
consolidation. The merge loop supersedes each source memory under **its own**
56-
project identity and queues a per-project supersede-delta row, so every affected
57-
project's m[1] reconciles correctly. This is a supported dreamer capability
58-
(see the "merging across identities" test). Do not add an ownership guard to
59-
`merge`.
51+
### A4. `ctx_memory merge` ownership is split by caller: primary-gated, dreamer cross-identity
52+
53+
`tools.ts``merge` is in the primary action set, so a **primary** caller is
54+
held to the same visibility gate as `update`/`archive`: every source memory must
55+
pass `memoryVisibleToTool` (own project in any category, or a foreign workspace
56+
member only in a shared category). A primary agent cannot consolidate a memory it
57+
cannot see. The **dreamer** keeps the unrestricted cross-identity path — its merge
58+
loop supersedes each source under **its own** project identity and queues a
59+
per-project supersede-delta row, so every affected project's m[1] reconciles
60+
(see the "merging across identities" test). The gate is the same one
61+
update/archive use; do not weaken `merge` back to a bare project-ownership check —
62+
that reintroduces the foreign-non-shared-category mutation hole.
6063

6164
### A5. Re-observing a fact does not revive an archived memory
6265

0 commit comments

Comments
 (0)