test: scope the rename guard to the emission site, not any occurrence

The 0.9.0 guard asserted `!src.includes('VERSION-UNAVAILABLE')`. That is
stricter than the intent: it fails the suite the moment someone writes the
historical name into a comment explaining why the code was renamed — the
archaeology this repo deliberately keeps next to the code. Scoped to
`code: 'VERSION-UNAVAILABLE'` instead.

Mutation-tested: re-introducing the old code name at the emission site fails
2 tests. No behaviour change, so no version bump — v0.9.0 still names this
engine.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CTNGvxzCLZp3UXfibYG4kb
This commit is contained in:
Kjell Tore Guttormsen 2026-08-09 22:09:03 +02:00
commit 36583646ff

View file

@ -1661,9 +1661,14 @@ test('no version claimed anywhere is nothing to judge, not a skip', () => {
// The rename is the point, not cosmetics: `-UNAVAILABLE` is this engine's
// naming for a `notRun` skip (`DESC-UNAVAILABLE`, `INSTALL-TRUTH`). One
// OK-level `-UNAVAILABLE` would mislead exactly the reader this change serves.
// Scoped to the EMISSION form (`code: '…'`) on purpose. A bare
// `src.includes('VERSION-UNAVAILABLE')` also passes today, and is wrong: it
// would fail the suite the moment someone writes the historical name into a
// comment explaining why the code was renamed — which is exactly the
// archaeology this repo wants kept next to the code.
test('the un-runnable version codes keep the -UNAVAILABLE naming', () => {
const src = readFileSync(new URL('./repo-standard-check.mjs', import.meta.url), 'utf8');
assert.ok(!src.includes('VERSION-UNAVAILABLE'), 'VERSION-UNAVAILABLE was renamed to VERSION-NONE');
assert.ok(!/code:\s*'VERSION-UNAVAILABLE'/.test(src), 'VERSION-UNAVAILABLE was renamed to VERSION-NONE');
});
test('an unreachable catalog is un-runnable — a second run resolves it', () => {