Files
msd-core/tests/model-catalog-runtime-defaults.test.cjs
Jakub Zych 6cfa0c55d2 refactor: drop 12 runtimes, keep Claude, Codex, OpenCode, Cursor, ZCode, Antigravity
Removes kilo, kimi, kimi-code, copilot, windsurf, augment, trae, qwen, hermes,
cline, codebuddy and pi end to end: capability descriptors, installer branches
and converters (bin/install.js 14.9k -> 11.2k lines), TypeScript converters,
hook surfaces and runtime homes, review lanes qwen/kimi-code, the two pi
migrations, Kimi payload normalization in the hook guards, dead hostBehaviors
vocabulary, launcher home probes, fixtures, runtime-specific tests and the
prose that presented them as supported.

Installer output for the six kept runtimes is byte-identical to before the
prune. The Kimi tool-vocabulary tests in workflow-guard, read-guard and
read-injection-scanner are left in place pending a decision.
2026-10-06 20:02:40 +02:00

80 lines
3.5 KiB
JavaScript

// allow-test-rule: source-text-is-the-product
// These docs tables are the shipped operator surface for runtime model tiers.
'use strict';
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { catalog, KNOWN_RUNTIMES } = require('../msd-core/bin/lib/model-catalog.cjs');
const { allRuntimes } = require('../bin/install.js');
const ROOT = path.join(__dirname, '..');
const SETTINGS_ADVANCED = fs.readFileSync(path.join(ROOT, 'msd-core', 'workflows', 'settings-advanced.md'), 'utf8');
const CONFIG_DOC = fs.readFileSync(path.join(ROOT, 'docs', 'CONFIGURATION.md'), 'utf8');
const catalogPath = path.join(ROOT, 'msd-core', 'bin', 'shared', 'model-catalog.json');
const CATALOG_RAW = fs.readFileSync(catalogPath, 'utf8');
describe('model catalog runtime defaults parity (#3229)', () => {
test('known runtimes match catalog keys', () => {
assert.deepStrictEqual([...KNOWN_RUNTIMES].sort(), Object.keys(catalog.runtimeTierDefaults).sort());
});
test('installer-supported runtimes are all known to the model catalog', () => {
assert.deepStrictEqual([...allRuntimes].sort(), [...KNOWN_RUNTIMES].sort());
});
test('settings-advanced runtime defaults table matches catalog for concrete runtimes', () => {
for (const [runtime, tiers] of Object.entries(catalog.runtimeTierDefaults)) {
if (!tiers.opus) continue; // Group B runtimes intentionally have no built-ins
assert.ok(SETTINGS_ADVANCED.includes(`| \`${runtime}\``), `settings-advanced.md missing ${runtime} row`);
for (const alias of ['opus', 'sonnet', 'haiku']) {
const entry = tiers[alias];
assert.ok(entry?.model, `${runtime}.${alias} missing model in catalog`);
assert.ok(
SETTINGS_ADVANCED.includes(`\`${entry.model}\``),
`settings-advanced.md missing ${runtime}.${alias} model ${entry.model}`,
);
}
}
});
test('CONFIGURATION runtime defaults table matches catalog for concrete runtimes', () => {
for (const [runtime, tiers] of Object.entries(catalog.runtimeTierDefaults)) {
if (!tiers.opus) continue;
assert.ok(CONFIG_DOC.includes(`| \`${runtime}\``), `CONFIGURATION.md missing ${runtime} row`);
for (const alias of ['opus', 'sonnet', 'haiku']) {
const entry = tiers[alias];
assert.ok(
CONFIG_DOC.includes(`\`${entry.model}\``),
`CONFIGURATION.md missing ${runtime}.${alias} model ${entry.model}`,
);
}
}
});
test('Group B runtimes remain documented as having no built-in defaults', () => {
const groupB = Object.keys(catalog.runtimeTierDefaults)
.filter(runtime => !catalog.runtimeTierDefaults[runtime].opus);
assert.ok(groupB.length > 0, 'expected at least one Group B runtime in catalog');
for (const runtime of groupB) {
const tiers = catalog.runtimeTierDefaults[runtime];
assert.equal(tiers.opus, null);
assert.equal(tiers.sonnet, null);
assert.equal(tiers.haiku, null);
}
assert.ok(SETTINGS_ADVANCED.includes('Group B'));
assert.ok(CONFIG_DOC.includes('Group B'));
});
test('catalog contains no retired/invalid model IDs', () => {
// Retired per issue #779 verify-first audit (gemini-cli source + OpenAI Codex models page).
const RETIRED = ['"gemini-3-pro"', '"gpt-5.3-codex"'];
for (const id of RETIRED) {
assert.ok(!CATALOG_RAW.includes(id), `retired model ID ${id} must not appear in model-catalog.json (see #779)`);
}
});
});