test(navigation): read trackable nouns from canonical packet owner

World Packet #880 removes the duplicate tracking table from gevActions; the Cockpit refusal source-scan test should inspect the actual exported source of truth instead of assuming the previous file position. Fix failing Node 24 exact-head CI without duplicating runtime definitions.
This commit is contained in:
Kevin Rajan committed 2026-10-17 13:17:43 -05:00
1 parent 1c4c903ac6
commit daff74fe04
1 file changed
+3 -4
+3 -4
View File
@@ -6,6 +6,7 @@ import { readdirSync, readFileSync } from 'node:fs';
import { join, relative } from 'node:path';
import test from 'node:test';
import { fileURLToPath } from 'node:url';
import { TRACKABLE_FAMILIES } from './agent/worldPacket.js';
import { setLocale } from './i18n/index.js';
import {
COCKPIT_REFUSAL_NOUNS,
@@ -68,10 +69,8 @@ const NOUN_LITERAL =
/\bnoun\s*=\s*'([^']+)'|\bconst noun\s*=\s*[^?;]*\?\s*'([^']+)'\s*:\s*'([^']+)'/g;
function trackableKinds() {
const source = readFileSync(join(SRC, 'voice/gevActions.js'), 'utf8');
const block = source.match(/const TRACKABLE_FAMILIES = \[([\s\S]*?)\];/);
assert.ok(block, 'TRACKABLE_FAMILIES is still in gevActions.js');
return [...block[1].matchAll(/kind:\s*'([^']+)'/g)].map((m) => m[1]);
// This is shared with voice; test the exported owner, not its file position.
return TRACKABLE_FAMILIES.map(({ kind }) => kind);
}
// Non-literal arguments: what each one can be. A wrapper's own `noun` (or all