Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(e2e): codex plugin door asserts PLUGIN_SURFACE, not REGISTRATION_SURFACE
garrytan30d4d858282b
diff --git a/test/e2e/codex-plugin-install-real.serial.test.ts b/test/e2e/codex-plugin-install-real.serial.test.tsindex e96ea53dc0..e5ebd3d3bf 100644--- a/test/e2e/codex-plugin-install-real.serial.test.ts+++ b/test/e2e/codex-plugin-install-real.serial.test.ts@@ -10,7 +10,7 @@* config.toml, snapshot carries the curated skills + non-root mcp.json +* an EXECUTABLE launcher, dual-marketplace resolution yields exactly one* gbrain plugin, add-twice idempotency, the deterministic tools/list- * surface oracle (== the registration surface, via the snapshot launcher),+ * surface oracle (== the plugin surface, via the snapshot launcher),* the cold-home fast-fail ("No brain configured. Run: gbrain init"),* the --source-guard write gate (blocked without GBRAIN_SOURCE on a* multi-source brain, allowed with it), the `codex mcp add` coexistence@@ -30,7 +30,7 @@ import { execFileSync, spawnSync } from 'node:child_process';import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';-import { REGISTRATION_SURFACE } from '../../src/core/mcp-registration.ts';+import { PLUGIN_SURFACE } from '../../src/core/mcp-registration.ts';import {resolveCodexBinary,@@ -188,7 +188,7 @@ describe.skipIf(!PLUGIN_CAPABLE)('codex plugin door — INSTALL (no auth needed)expect(statSync(launcher).mode & 0o111, 'launcher lost its exec bit in the snapshot copy').toBeGreaterThan(0);const mcpJson = JSON.parse(readFileSync(join(snap!, '.codex-plugin', 'mcp.json'), 'utf8'));const serverArgs: string[] = mcpJson.mcpServers.gbrain.args;- expect(serverArgs).toEqual(['serve', '--surface', REGISTRATION_SURFACE, '--source-guard']);+ expect(serverArgs).toEqual(['serve', '--surface', PLUGIN_SURFACE, '--source-guard']);// (d) idempotency: add twice each — state stays sane (exactly one// gbrain@gbrain row; outcome recorded in the evidence, not softened).@@ -200,7 +200,7 @@ describe.skipIf(!PLUGIN_CAPABLE)('codex plugin door — INSTALL (no auth needed)expect(rows.length, `dual-marketplace/idempotency: expected exactly one gbrain@gbrain row:\n${list.stdout}`).toBe(1);// (e) deterministic surface oracle: tools/list through the SNAPSHOT- // launcher == the starter surface (never an LLM-output assertion).+ // launcher == PLUGIN_SURFACE (never an LLM-output assertion).const binDir = mkdtempSync(join(tmpdir(), 'gb-plugin-bin-'));const gbrainBin = gbrainBinForTests(binDir);const seededHome = mkdtempSync(join(tmpdir(), 'gb-plugin-brain-'));@@ -219,7 +219,7 @@ describe.skipIf(!PLUGIN_CAPABLE)('codex plugin door — INSTALL (no auth needed)timeoutMs: 120_000,});const publishGates = publishGatesFromDisabled(operations, new Set());- const expected = operations.filter((o) => isCallable(o, { transport: 'stdio', surface: REGISTRATION_SURFACE, scopes: [], publishGates })).map((o) => o.name).sort();+ const expected = operations.filter((o) => isCallable(o, { transport: 'stdio', surface: PLUGIN_SURFACE, scopes: [], publishGates })).map((o) => o.name).sort();expect(tools.sort()).toEqual(expected);// (f) cold-home fast-fail: fresh empty GBRAIN_HOME → actionable exit,