test(codex): align install contracts with no gsd skill copies

This commit is contained in:
Tom Boucher
2026-05-14 13:27:12 -04:00
parent 1d6284a718
commit 51f549caaf
2 changed files with 21 additions and 3 deletions

View File

@@ -179,6 +179,12 @@ function expectedSkillSet() {
return new Set([...MINIMAL_SKILL_ALLOWLIST]);
}
function expectedManifestSkillSet(runtime) {
// Codex no longer materializes gsd-* skill files in minimal mode.
if (runtime === 'codex') return new Set();
return expectedSkillSet();
}
describe('install: --minimal honoured for every runtime in --global mode', () => {
for (const runtime of SKILL_RUNTIMES) {
test(`${runtime} --global --minimal emits exactly the core skill set, zero agents`, () => {
@@ -193,7 +199,7 @@ describe('install: --minimal honoured for every runtime in --global mode', () =>
`${runtime} global manifest.mode should be "minimal"`);
assert.deepStrictEqual(
[...manifestSkillSet(manifest)].sort(),
[...expectedSkillSet()].sort(),
[...expectedManifestSkillSet(runtime)].sort(),
`${runtime} global should record exactly the MINIMAL allowlist in the manifest`,
);
assert.strictEqual(manifestAgentCount(manifest), 0,
@@ -219,7 +225,7 @@ describe('install: --minimal honoured for every runtime in --local mode', () =>
`${runtime} local manifest.mode should be "minimal"`);
assert.deepStrictEqual(
[...manifestSkillSet(manifest)].sort(),
[...expectedSkillSet()].sort(),
[...expectedManifestSkillSet(runtime)].sort(),
`${runtime} local should record exactly the MINIMAL allowlist in the manifest (regression guard for #2923)`,
);
assert.strictEqual(manifestAgentCount(manifest), 0,

View File

@@ -174,6 +174,14 @@ function assertHasGsdDirectory(root, relPath) {
);
}
function assertNoGsdDirectoryEntries(root, relPath) {
assert.equal(
listDirNames(root, relPath).some((name) => name.startsWith('gsd-')),
false,
`${relPath} should not contain generated GSD entries`
);
}
function assertFreshInstallContract(runtime, targetDir) {
const contract = RUNTIME_INSTALL_CONTRACTS[runtime];
assert.ok(contract, `missing runtime install contract for ${runtime}`);
@@ -201,7 +209,11 @@ function assertFreshInstallContract(runtime, targetDir) {
);
if (contract.surface === 'flat-skills') {
assertHasGsdDirectory(targetDir, 'skills');
if (runtime === 'codex') {
assertNoGsdDirectoryEntries(targetDir, 'skills');
} else {
assertHasGsdDirectory(targetDir, 'skills');
}
} else if (contract.surface === 'hermes-skills') {
assertHasGsdDirectory(targetDir, path.join('skills', 'gsd'));
assert.ok(