Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(grants): map the F3 Postgres E2E; accept SELECT * in the writeback transport mock

garrytan32f8ec099030
diff --git a/scripts/e2e-test-map.ts b/scripts/e2e-test-map.ts
index 27c025bb62..6a4e8cdce0 100644
--- a/scripts/e2e-test-map.ts
+++ b/scripts/e2e-test-map.ts
@@ -108,8 +108,12 @@ export const E2E_TEST_MAP: Record<string, string[]> = {
"src/core/scope.ts": ["test/e2e/client-grants.test.ts", "test/e2e/shared-skills-transports.test.ts"],
"src/core/grants/**": ["test/e2e/client-grants.test.ts", "test/e2e/harness-access.test.ts", "test/e2e/delegated-grants-withdrawal.test.ts", "test/e2e/delegated-http-worker.test.ts"],
// #5231/#5893 (O-ENG-7): legacy-token rescope and the explicit no-source grant on Postgres.
- "src/core/grants/legacy-token.ts": ["test/e2e/auth-rescope-token.test.ts"],
- "src/core/legacy-token-scope.ts": ["test/e2e/auth-rescope-token.test.ts", "test/e2e/auth-permissions.test.ts"],
+ "src/core/grants/legacy-token.ts": ["test/e2e/auth-rescope-token.test.ts", "test/e2e/access-token-grants.test.ts"],
+ "src/core/legacy-token-scope.ts": ["test/e2e/auth-rescope-token.test.ts", "test/e2e/auth-permissions.test.ts", "test/e2e/access-token-grants.test.ts"],
+ // F3: unified token grant columns, lazy migration, drift and the born-unified mint on Postgres.
+ "src/core/grants/model.ts": ["test/e2e/access-token-grants.test.ts"],
+ "src/core/grants/access-token-schema.ts": ["test/e2e/access-token-grants.test.ts"],
+ "src/core/token-mint.ts": ["test/e2e/access-token-grants.test.ts", "test/e2e/auth-rescope-token.test.ts"],
"src/core/facts/withdrawal*.ts": ["test/e2e/delegated-grants-withdrawal.test.ts", "test/e2e/withdrawal-bounded-safety-postgres.test.ts", "test/e2e/withdrawal-crash-postgres.test.ts", "test/e2e/memory-safety-wave-postgres.test.ts", "test/e2e/fact-withdrawal-scope-postgres.test.ts"],
"src/commands/mcp*.ts": ["test/e2e/harness-access.test.ts"],
// OpenRouter subagent-loop families: the family allowlist + recipe feed the
diff --git a/test/mcp-instructions-writeback.test.ts b/test/mcp-instructions-writeback.test.ts
index b32f4fe87c..4a653c3a4a 100644
--- a/test/mcp-instructions-writeback.test.ts
+++ b/test/mcp-instructions-writeback.test.ts
@@ -132,7 +132,7 @@ describe('legacy bearer transport serves the shared builder output (parity)', ()
kind: 'postgres',
executeRaw: async (sql: string, params?: unknown[]) => {
const norm = sql.replace(/\s+/g, ' ').trim().toLowerCase();
- if (norm.startsWith('select id, name')) {
+ if (norm.startsWith('select id, name') || norm.startsWith('select * from access_tokens')) {
const row = validTokens.get(params?.[0] as string);
return row ? [{ ...row, permissions: { takes_holders: ['world'] } }] : [];
}