Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: the private-hold audit tags its src read as structural (#7897)

garrytana77d3184ddfc
diff --git a/test/import-private-hold-callers-7897.test.ts b/test/import-private-hold-callers-7897.test.ts
index 1e7bf256ef..80741de579 100644
--- a/test/import-private-hold-callers-7897.test.ts
+++ b/test/import-private-hold-callers-7897.test.ts
@@ -74,6 +74,7 @@ describe('import entry points hold a non-canonical private request (#7897)', ()
});
test('importFromFile holds before it imports, so its callers need no opt-in', () => {
+ // test-reads-source-ok[structural]: the hold must run before the import inside importFromFile; call order is the contract this audit relies on.
const source = readFileSync(join('src', 'core', 'import-file.ts'), 'utf8');
const body = source.slice(source.indexOf('export async function importFromFile('), source.indexOf('\nexport ', source.indexOf('export async function importFromFile(') + 1));
expect(body.indexOf('noncanonicalPrivateHold(content')).toBeGreaterThan(0);