Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(#6712 PR 4b): pinned-reads masks the folded stamp's snapshot and own id with its xmin

garrytan78501867cce8
diff --git a/test/managed-sync-pinned-reads.test.ts b/test/managed-sync-pinned-reads.test.ts
index d72340434e..885cc8ad48 100644
--- a/test/managed-sync-pinned-reads.test.ts
+++ b/test/managed-sync-pinned-reads.test.ts
@@ -104,6 +104,8 @@ const VOLATILE = new Set(['id', 'created_at', 'updated_at', 'snapshot_at', 'last
'embedding_image', 'embedding_multimodal', 'edges_backfilled_at', 'search_vector', 'content_hash', 'revision_write_request_id', 'coordination_path',
'lastAt', 'startedAt', 'duration_ms', 'timings_ms']);
+const FOLD_BASE_IDS = new Set(['.intent.stamp.fold.base.xmin', '.intent.stamp.fold.base.snapshot', '.intent.stamp.fold.base.own']);
+
/** Every page-derived row the sync wrote, with ids, times, UUIDs and the checkout path replaced by labels. */
async function dump(e: BrainEngine, root: string): Promise<Record<string, string[]>> {
const pages = await e.executeRaw<{ id: number; slug: string }>('SELECT id,slug FROM pages WHERE source_id=$1', [SOURCE]);
@@ -111,8 +113,9 @@ async function dump(e: BrainEngine, root: string): Promise<Record<string, string
const norm = (value: unknown, key = '', path = ''): unknown => {
if (value === null || value === undefined) return null;
if (value instanceof Date) return '<time>';
- // #6712 PR 4b: a folded stamp records the Postgres snapshot xmin it read its base under, a transaction id as run-specific as a UUID.
- if (path === '.intent.stamp.fold.base.xmin') return '<xmin>';
+ // #6712 PR 4b: a folded stamp records the Postgres snapshot it read its base under (its xmin, the snapshot and its own
+ // transaction id, GBRA-108), transaction ids as run-specific as a UUID.
+ if (FOLD_BASE_IDS.has(path)) return `<${key}>`;
if (Array.isArray(value)) return value.map(v => norm(v, key, path));
if (typeof value === 'object') {
return Object.fromEntries(Object.entries(value as Record<string, unknown>).filter(([k]) => !VOLATILE.has(k)).sort(([a], [b]) => a < b ? -1 : 1)