Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: tag the ghost-exemption guard's dispatcher read as structural (#6696)

garrytanf7410c7a4f6b
diff --git a/test/maintenance-ghost-exemption-guard.test.ts b/test/maintenance-ghost-exemption-guard.test.ts
index bb8eadd3e1..c98ced998e 100644
--- a/test/maintenance-ghost-exemption-guard.test.ts
+++ b/test/maintenance-ghost-exemption-guard.test.ts
@@ -34,6 +34,7 @@ function preparerText(file: string, name: string): string {
}
test('the ghost-refusal exemptions are exactly the maintenance kinds whose preparer passes allowMissingFile', () => {
+ // test-reads-source-ok[structural]: the exemption set must match the dispatcher's preparers that pass allowMissingFile; enumerating dispatch branches is the only way to catch a new kind that is missing from it.
const dispatcher = functionBody(readFileSync(DISPATCH_FILE, 'utf8'), 'prepareMaintenanceKind')!;
const branch = /row\.intent\?\.kind === '([a-z_]+)'(?:\s*\|\|\s*row\.intent\?\.kind === '([a-z_]+)')?\)\s*(?:\{\s*)?return\s+(?:\(await import\('([^']+)'\)\)\.)?(\w+)\(/g;
const dispatched = new Map<string, boolean>();