Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(goldens): the EO8/EO9 fake answers the chunk-read manifest probe as the owning role

garrytane6cc44b3e675
diff --git a/test/fixtures/goldens/postgres-engine-gauge/acquires-by-case.json b/test/fixtures/goldens/postgres-engine-gauge/acquires-by-case.json
index 0b835050b0..543dda8f77 100644
--- a/test/fixtures/goldens/postgres-engine-gauge/acquires-by-case.json
+++ b/test/fixtures/goldens/postgres-engine-gauge/acquires-by-case.json
@@ -92,30 +92,34 @@
"getCallersOf#default": {},
"getCallersOf#sourceId": {},
"getChunkPage#default": {
- "raw": 1
+ "raw": 2
},
"getChunkPage#sourceIds+excludePrivate": {
+ "raw": 2
+ },
+ "getChunkWindows#default": {
"raw": 1
},
- "getChunkWindows#default": {},
- "getChunkWindows#scopedPrivateSafe": {},
- "getChunks#default": {
+ "getChunkWindows#scopedPrivateSafe": {
"raw": 1
},
+ "getChunks#default": {
+ "raw": 2
+ },
"getChunks#excludePrivate": {
- "raw": 1
+ "raw": 2
},
"getChunks#includeEmbedding": {
- "raw": 1
+ "raw": 2
},
"getChunks#includeUnsealed": {
- "raw": 1
+ "raw": 2
},
"getChunks#requireSafeChunks": {
- "raw": 1
+ "raw": 2
},
"getChunks#sourceIds": {
- "raw": 1
+ "raw": 2
},
"getChunksWithEmbeddings#default": {},
"getChunksWithEmbeddings#sourceId+includeUnsealed": {},
diff --git a/test/fixtures/goldens/sql-text/_driver.json b/test/fixtures/goldens/sql-text/_driver.json
index a777bad579..c050026b6f 100644
--- a/test/fixtures/goldens/sql-text/_driver.json
+++ b/test/fixtures/goldens/sql-text/_driver.json
@@ -97,6 +97,15 @@
},
"getChunkPage": {
"default": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -126,6 +135,15 @@
}
],
"sourceIds+excludePrivate": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -157,6 +175,15 @@
},
"getChunkWindows": {
"default": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 8,
"unsafeOptions": {
@@ -168,6 +195,15 @@
}
],
"scopedPrivateSafe": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 9,
"unsafeOptions": {
@@ -181,6 +217,15 @@
},
"getChunks": {
"default": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -201,6 +246,15 @@
}
],
"excludePrivate": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -221,6 +275,15 @@
}
],
"includeEmbedding": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -241,6 +304,15 @@
}
],
"includeUnsealed": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -261,6 +333,15 @@
}
],
"requireSafeChunks": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
@@ -281,6 +362,15 @@
}
],
"sourceIds": [
+ {
+ "paramCount": 0,
+ "unsafeOptions": {
+ "cancelFence": false,
+ "prepare": true,
+ "simple": true
+ },
+ "via": "unsafe"
+ },
{
"paramCount": 0,
"unsafeOptions": {
diff --git a/test/fixtures/goldens/sql-text/chunks.json b/test/fixtures/goldens/sql-text/chunks.json
index c21c0495f9..fdd3bf1bf5 100644
--- a/test/fixtures/goldens/sql-text/chunks.json
+++ b/test/fixtures/goldens/sql-text/chunks.json
@@ -92,6 +92,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -120,6 +126,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -144,6 +156,12 @@
},
"getChunkWindows": {
"default": [
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -161,6 +179,12 @@
}
],
"scopedPrivateSafe": [
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -187,6 +211,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -204,6 +234,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -221,6 +257,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -238,6 +280,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -255,6 +303,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
@@ -272,6 +326,12 @@
"sql": "SELECT key, value FROM config WHERE key IN ('search_embedding_column', 'embedding_columns')",
"textSha256": "0c97097b286eb3415cffbfa812bc301187d88bc7a5266678332b0f4c8c571371"
},
+ {
+ "lane": "pool",
+ "params": [],
+ "sql": "-- chunk-visibility-ok: whether any chunk row of a segmented body exists, no row is returned SELECT has_table_privilege('page_body_manifest', 'SELECT') AS readable, NOT has_table_privilege('page_body_manifest', 'SELECT') AND (EXISTS (SELECT 1 FROM content_chunks WHERE body_generation IS NOT NULL) OR EXISTS (SELECT 1 FROM content_chunks WHERE occurrence_id IS NOT NULL)) AS segmented",
+ "textSha256": "75ecb41b752625a4285cb1565fca93fb129e937f20a857bd5cea5c49e9df970b"
+ },
{
"lane": "pool",
"params": [
diff --git a/test/helpers/postgres-engine-sql-cases.ts b/test/helpers/postgres-engine-sql-cases.ts
index 9a301ff66a..6e74afe9aa 100644
--- a/test/helpers/postgres-engine-sql-cases.ts
+++ b/test/helpers/postgres-engine-sql-cases.ts
@@ -179,6 +179,8 @@ const DEFAULT_RULES: Rule[] = [
[/AS snapshot_withdrawals/, [{ ...PAGE_ROW, source_incarnation: INCARNATION, snapshot_tags: [], snapshot_withdrawals: [], fingerprint_body: '', fingerprint_timeline: '' }]],
[/current_setting\('app\.scopes', true\) AS scopes/, [{ scopes: '*' }]],
[/^SHOW enable_seqscan$/, [{ enable_seqscan: 'on' }]],
+ // The chunk-read manifest probe (safe-chunks.ts chunkManifestReads) as the owning role answers it.
+ [/chunk-visibility-ok: whether any chunk row of a segmented body exists/, [{ readable: true, segmented: false }]],
[/^SHOW statement_timeout$/, [{ statement_timeout: '0' }]],
];