Skip to content

Commit e6d00e1

Browse files
committed
fix(scripts): name the probe's case loaders off the self-test anchor
dispatch-gates' self-test anchor reads any function whose name spells self-test as a self-test entry and wants each compound one ledgered. These two only load and register cases into the drift script's own self-test, so they are renamed (registerProbeCases, loadProbeModule) rather than ledgered. Claude-Session: https://claude.ai/code/session_01CXydFDyiQwNbGFkmwrcRQq Co-authored-by: Claude <noreply@anthropic.com>
1 parent 58f5b41 commit e6d00e1

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎scripts/check-corpus-claim-drift.mjs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
675675
'The dispatch-gates declaration (#9964\'s pattern)': 4,
676676
'At the PROGRAM level': 10,
677677
// #22059 step ①: cases registered by scripts/skill-example-probe.mjs
678-
// (`registerProbeSelfTest`), named by its PROBE_SELF_TEST_BATTERIES.
678+
// (`registerProbeCases`), named by its PROBE_SELF_TEST_BATTERIES.
679679
'Probe extractor: fences, languages, markers, census (#22059)': 14,
680680
'Probe transform: the supported shapes and the coverage miss (#22059)': 18,
681681
'Probe mapping and judge, over synthetic schemas (#22059)': 21,
@@ -1401,7 +1401,7 @@ function selfTest(probe) {
14011401
// Loaded by the dispatch below and handed in, so this function stays
14021402
// synchronous. A probe that failed to load registers nothing, and its four
14031403
// batteries then name themselves at the floor.
1404-
if (probe) probe.module.registerProbeSelfTest({ battery, expect }, { ts: probe.ts, yaml: probe.yaml });
1404+
if (probe) probe.module.registerProbeCases({ battery, expect }, { ts: probe.ts, yaml: probe.yaml });
14051405

14061406
// ── The floor: every declared battery RAN, and ran its cases (#13489) ───
14071407
//
@@ -1508,7 +1508,7 @@ if (process.argv.includes('--probe-examples')) {
15081508
/* The probe's cases need the TypeScript parser and `yaml` — root dev
15091509
* dependencies — but no build. A load failure is reported, never swallowed:
15101510
* the probe batteries then fail the floor by name. */
1511-
async function loadProbeForSelfTest() {
1511+
async function loadProbeModule() {
15121512
try {
15131513
const module = await import('./skill-example-probe.mjs');
15141514
const { default: ts } = await import('typescript');
@@ -1521,7 +1521,7 @@ async function loadProbeForSelfTest() {
15211521
}
15221522

15231523
if (process.argv.includes('--self-test')) {
1524-
selfTest(await loadProbeForSelfTest());
1524+
selfTest(await loadProbeModule());
15251525
if (!selfTestReachedVerdict) {
15261526
console.error(
15271527
'\n✗ check-corpus-claim-drift self-test: selfTest() returned without reaching its verdict,\n'

‎scripts/skill-example-probe.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ function fakeObject(shape) {
15301530
* @param {{battery:(name:string)=>void, expect:(label:string, cond:boolean)=>void}} harness
15311531
* @param {{ts:any, yaml:any}} deps
15321532
*/
1533-
export function registerProbeSelfTest({ battery, expect }, { ts, yaml }) {
1533+
export function registerProbeCases({ battery, expect }, { ts, yaml }) {
15341534
const B = PROBE_SELF_TEST_BATTERIES;
15351535
const fence = (lang, body, extra = {}) => ({ line: 1, endLine: 1, indent: 0, info: lang, lang, family: LANG_FAMILY[lang] ?? null, body, heading: null, marker: null, unclosed: false, ...extra });
15361536
const deps = { ts, yaml, helpers: { Field: { text: (c = {}) => ({ type: 'text', ...c }) } } };

0 commit comments

Comments
 (0)