refactor: remove dead descriptor-driven mechanisms (no remaining consumer)
Drop code whose only consumer was a retired runtime: hostBehaviors readers for agentFileExtension, localTargetIsProjectRoot, sharedHooksDirName, skillsManifestPrefix and skipCodexSkillsManifest; the empty NON_REGISTRY_CONFIG_HOME_DESCRIPTORS array and live-config-guard plumbing; the empty RUNTIME_NOTE_AUDIENCE_BY_HEADING filter; the unused resolveVersionFrom export; and the WINDSURF_SESSION_ID workstream session key. Delete tests that only exercised those mechanisms.
This commit is contained in:
@@ -168,30 +168,7 @@ describe('#2665: TEST_ENV_BASE config-location coverage', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('descriptor-shaped config homes OUTSIDE the registry are derived, not listed', () => {
|
||||
const {
|
||||
NON_REGISTRY_CONFIG_HOME_DESCRIPTORS,
|
||||
} = require('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
|
||||
// Round 3. A runtime can own a config home that is NOT registry-visible (a
|
||||
// hardcoded descriptor inside a resolver). The registry-only derivation
|
||||
// would miss it, so the non-registry set is walked too. The set may be
|
||||
// empty (no such descriptor is shipped today) — then this is trivially
|
||||
// satisfied, and the reversion-sensitive sentinel test below proves the
|
||||
// walk itself still reaches a descriptor when one exists.
|
||||
const declared = [
|
||||
...new Set(NON_REGISTRY_CONFIG_HOME_DESCRIPTORS.flatMap((d) => d?.env ?? [])),
|
||||
];
|
||||
|
||||
const missing = declared.filter((k) => !(k in TEST_ENV_BASE));
|
||||
assert.deepStrictEqual(
|
||||
missing,
|
||||
[],
|
||||
`descriptor-declared config-location vars not scrubbed: ${missing.join(', ')}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('skillsHome env vars are walked on BOTH descriptor rungs', () => {
|
||||
test('skillsHome env vars are walked from the registry', () => {
|
||||
// Round 4. A configHome descriptor can nest a second, independently-resolved
|
||||
// descriptor (skillsHome → resolveSkillsBaseFromDescriptor), which carries
|
||||
// its own env array. Walking configHome.env alone is the identical
|
||||
@@ -201,19 +178,13 @@ describe('#2665: TEST_ENV_BASE config-location coverage', () => {
|
||||
// var currently flows from it: every skillsHome-declared var (registry and
|
||||
// non-registry alike) must land in TEST_ENV_BASE the moment one exists.
|
||||
const { runtimes } = require('../msd-core/bin/lib/capability-registry.cjs');
|
||||
const {
|
||||
NON_REGISTRY_CONFIG_HOME_DESCRIPTORS,
|
||||
} = require('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
|
||||
const declared = [
|
||||
...new Set([
|
||||
...Object.values(runtimes).flatMap(
|
||||
...new Set(
|
||||
Object.values(runtimes).flatMap(
|
||||
(r) => r?.runtime?.configHome?.skillsHome?.env ?? [],
|
||||
),
|
||||
...NON_REGISTRY_CONFIG_HOME_DESCRIPTORS.flatMap(
|
||||
(d) => d?.skillsHome?.env ?? [],
|
||||
),
|
||||
]),
|
||||
),
|
||||
];
|
||||
|
||||
const missing = declared.filter((k) => !(k in TEST_ENV_BASE));
|
||||
@@ -291,19 +262,17 @@ describe('#2665 round 4: the skillsHome walk is reversion-sensitive', () => {
|
||||
// derivation leaves every one of them green (measured by this round's
|
||||
// pre-push adversarial review). This test closes that: it cold-requires
|
||||
// helpers.cjs in a child process after injecting sentinel skillsHome env
|
||||
// vars into BOTH enumerations (registry and non-registry), so the walk
|
||||
// vars into the registry enumeration, so the walk
|
||||
// itself is what is under test, not today's empty declarations.
|
||||
test('sentinel skillsHome vars flow into TEST_ENV_BASE on both rungs', () => {
|
||||
test('sentinel skillsHome vars flow into TEST_ENV_BASE', () => {
|
||||
const { execFileSync } = require('node:child_process');
|
||||
const regPath = require.resolve('../msd-core/bin/lib/capability-registry.cjs');
|
||||
const rhPath = require.resolve('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
const helpersPath = require.resolve('./helpers.cjs');
|
||||
|
||||
const script = `
|
||||
'use strict';
|
||||
const reg = require(${JSON.stringify(regPath)});
|
||||
const rh = require(${JSON.stringify(rhPath)});
|
||||
// Rung 1 (registry): give one runtime a skillsHome env var. Push a
|
||||
// Give one runtime a skillsHome env var. Push a
|
||||
// sentinel into whichever runtime declares skillsHome, or graft one onto
|
||||
// the first runtime if none does.
|
||||
const declaring = Object.values(reg.runtimes).find(
|
||||
@@ -313,18 +282,9 @@ describe('#2665 round 4: the skillsHome walk is reversion-sensitive', () => {
|
||||
declaring.runtime.configHome.skillsHome = { kind: 'dot-home', name: '.x', env: [] };
|
||||
}
|
||||
declaring.runtime.configHome.skillsHome.env = ['MSD_TEST_SENTINEL_REGISTRY_SKILLS'];
|
||||
// Rung 2 (non-registry): graft a skillsHome onto the first descriptor
|
||||
// (the shipped set is empty, so seed one if needed).
|
||||
if (rh.NON_REGISTRY_CONFIG_HOME_DESCRIPTORS.length === 0) {
|
||||
rh.NON_REGISTRY_CONFIG_HOME_DESCRIPTORS.push({ kind: 'dot-home', name: '.x', env: [] });
|
||||
}
|
||||
rh.NON_REGISTRY_CONFIG_HOME_DESCRIPTORS[0].skillsHome = {
|
||||
kind: 'dot-home', name: '.x', env: ['MSD_TEST_SENTINEL_NONREG_SKILLS'],
|
||||
};
|
||||
const { TEST_ENV_BASE } = require(${JSON.stringify(helpersPath)});
|
||||
const missing = [
|
||||
'MSD_TEST_SENTINEL_REGISTRY_SKILLS',
|
||||
'MSD_TEST_SENTINEL_NONREG_SKILLS',
|
||||
].filter((k) => TEST_ENV_BASE[k] !== '');
|
||||
if (missing.length > 0) {
|
||||
console.error('skillsHome walk missed: ' + missing.join(', '));
|
||||
|
||||
Reference in New Issue
Block a user