Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

GST-359 D: classify memory_recall/memory_write in the privacy sweep; owner member sweep reads only

garrytan3264872c7d21
diff --git a/test/access-member-sweep.test.ts b/test/access-member-sweep.test.ts
index 111ee552c8..24ed471ada 100644
--- a/test/access-member-sweep.test.ts
+++ b/test/access-member-sweep.test.ts
@@ -81,11 +81,13 @@ for (const kind of testBackends()) {
try { return await Promise.race([run, timeout]); } finally { clearTimeout(timer); }
}
- async function sweep(callers: Who[]): Promise<{ leaks: string[]; ran: number; revealing: Set<string> }> {
+ async function sweep(callers: Who[], opts: { readsOnly?: boolean } = {}): Promise<{ leaks: string[]; ran: number; revealing: Set<string> }> {
const leaks: string[] = [];
const revealing = new Set<string>();
let ran = 0;
for (const op of operations) {
+ // The owner's non-vacuity sweep only reads: an attested forget (GST-359 D) would withdraw the owner's own canary.
+ if (opts.readsOnly && op.mutating) continue;
for (const args of sweepArgs(op, fixture)) {
for (const as of callers) {
const out = await call(as, op.name, args);
@@ -135,7 +137,7 @@ for (const kind of testBackends()) {
expect((await call(alice, 'recall', { query: fixture.words })).all).toContain(CANARY);
expect((await call(alice, 'get_page', { slug: fixture.memberSlug })).all).toContain(CANARY);
expect((await call(alice, 'get_page', { slug: 'notes/alice-only' })).all).toContain(PAGE_CANARY);
- const { revealing } = await withEnv(NO_KEYS, () => sweep([alice]));
+ const { revealing } = await withEnv(NO_KEYS, () => sweep([alice], { readsOnly: true }));
for (const op of ['recall', 'get_page', 'get_chunks', 'search', 'query']) expect(revealing).toContain(op);
}, 1_800_000);
diff --git a/test/qm-memory-tools.test.ts b/test/qm-memory-tools.test.ts
index 83a575a6af..6503aa27b0 100644
--- a/test/qm-memory-tools.test.ts
+++ b/test/qm-memory-tools.test.ts
@@ -108,7 +108,7 @@ const BOB_ID = 'oidc:3f2a:bob-example';
const CAROL_ID = '[email protected]';
const DAVE_ID = 'U0DAVE';
const ACME = 'companies/acme-example';
-const ATTEST_OPS = ['forget', 'forget_fact', 'get_write_request', 'memory_recall', 'memory_write', 'remember'];
+const ATTEST_OPS = ['forget', 'forget_fact', 'get_write_request', 'memory_recall', 'memory_write'];
for (const kind of testBackends()) {
describe('memory_recall and memory_write (' + kind + ', repo-less)', () => {
diff --git a/test/remote-privacy-sweep.test.ts b/test/remote-privacy-sweep.test.ts
index 6453a41a77..e9dc63b904 100644
--- a/test/remote-privacy-sweep.test.ts
+++ b/test/remote-privacy-sweep.test.ts
@@ -163,6 +163,8 @@ const PARAM_FACTORY: Record<string, Record<string, unknown>> = {
query: { query: 'WORLDSWEEP' },
assemble_evidence: { hits: [{ source_id: 'default', slug: WORLD_FENCE_SLUG, chunk_id: 0 }], return_unit: 'page' },
recall: { entity: WORLD_PAGE_SLUG },
+ memory_recall: { query: WORLD.fact },
+ memory_write: { facts: [{ fact: 'fresh sweep fact', provenance: 'sweep' }], idempotency_key: 'sweep-key' },
entity: { name: WORLD_PAGE_SLUG },
synthesize: { entity: WORLD_PAGE_SLUG },
delta: { since: SINCE_EPOCH },
@@ -259,6 +261,7 @@ const EXPECTED_OUTCOME: Record<string, Outcome> = {
query: 'data',
assemble_evidence: 'data',
recall: 'data',
+ memory_recall: 'data',
entity: 'data',
delta: 'data',
context_pack: 'data',
@@ -355,6 +358,8 @@ const EXPECTED_OUTCOME: Record<string, Outcome> = {
advisor: 'denied',
// mutating ops (fresh-slug targets; envelope-echo checks only)
remember: 'ok',
+ // GST-359 D: memory_write saves only as an attested person; the sweep's callers attest none (actor_required).
+ memory_write: 'error',
forget: 'error',
purge_fact: 'error',
list_page_purges: 'error',