Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(visibility): privacy aliases are protected frontmatter keys; remember schema stays in budget; withdrawal scenario pins its world copy

garrytaneebf461fd747
diff --git a/src/core/frontmatter-recovery.ts b/src/core/frontmatter-recovery.ts
index c034ac7509..72946c81d7 100644
--- a/src/core/frontmatter-recovery.ts
+++ b/src/core/frontmatter-recovery.ts
@@ -25,7 +25,7 @@ export const RECOVERY_VERSION = 1;
* `repair/visibility.ts`, connector publication). `test/frontmatter-recovery.test.ts`
* greps those readers so a new key cannot be missed.
*/
-export const PROTECTED_FRONTMATTER_KEYS: readonly string[] = ['visibility', 'derived_from', 'source_slug', 'synthesized_by', 'concepts', 'captured_via', 'event', 'pinned_question'];
+export const PROTECTED_FRONTMATTER_KEYS: readonly string[] = ['visibility', 'derived_from', 'source_slug', 'synthesized_by', 'concepts', 'captured_via', 'event', 'pinned_question', 'access', 'confidentiality'];
/** Keys that decide which page a file is. A duplicate is never resolved. */
export const IDENTITY_FRONTMATTER_KEYS: readonly string[] = ['slug', 'type', 'id', 'source_id'];
diff --git a/src/core/verbs.ts b/src/core/verbs.ts
index 53b3fb6b84..62bf18fa96 100644
--- a/src/core/verbs.ts
+++ b/src/core/verbs.ts
@@ -102,7 +102,7 @@ const remember: Operation = {
visibility: {
type: 'string',
enum: ['world', 'private'],
- description: 'world (default) or private (local CLI). Omitted on a private target page or brain default: private.',
+ description: 'world (default) or private (local CLI).',
},
replaces: { type: 'string', description: 'fact_id this fact replaces (same entity, or none).', fullSurfaceOnly: true },
},
diff --git a/test/helpers/visibility-withdrawal-scenarios.ts b/test/helpers/visibility-withdrawal-scenarios.ts
index 375b20a1e4..47dff8131d 100644
--- a/test/helpers/visibility-withdrawal-scenarios.ts
+++ b/test/helpers/visibility-withdrawal-scenarios.ts
@@ -42,7 +42,7 @@ const withdrawals = async (engine: BrainEngine) => Number((await engine.executeR
/** 1a: a remote forget of an unlinked fact never names or withdraws a linked copy on a page the caller cannot read. */
export async function unlinkedForgetKeepsHiddenCopies(engine: BrainEngine): Promise<void> {
await seedPages(engine);
- const hidden = await call(engine, 'remember', { fact: CLAIM, entity: 'crm/hidden-co', provenance: 'meeting notes' }, 'local');
+ const hidden = await call(engine, 'remember', { fact: CLAIM, entity: 'crm/hidden-co', provenance: 'meeting notes', visibility: 'world' }, 'local');
expect(hidden.body.status).toBe('inserted');
const unlinked = await call(engine, 'remember', { fact: CLAIM, provenance: 'call notes', infer_entity: false });
const id = unlinked.body.id;
@@ -57,7 +57,7 @@ export async function unlinkedForgetKeepsHiddenCopies(engine: BrainEngine): Prom
// Fail closed: a call that does not say it is local is treated as remote.
expect((await call(engine, 'forget', { id: String(id) }, 'unset')).body.message).toBe(GENERIC_CLAIM_LINKED(id));
// One fixed text whatever the number of hidden copies.
- await call(engine, 'remember', { fact: CLAIM, entity: 'crm/hidden-two', provenance: 'meeting notes' }, 'local');
+ await call(engine, 'remember', { fact: CLAIM, entity: 'crm/hidden-two', provenance: 'meeting notes', visibility: 'world' }, 'local');
const two = await call(engine, 'forget', { id: String(id) });
expect(two.body.message).toBe(one.body.message);
expect(two.body.suggestion).toBe(one.body.suggestion);