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:
@@ -23,7 +23,6 @@ const SESSION_IDENTITY_ENV_KEYS = [
|
||||
'OPENCODE_SESSION_ID',
|
||||
'GEMINI_SESSION_ID',
|
||||
'CURSOR_SESSION_ID',
|
||||
'WINDSURF_SESSION_ID',
|
||||
'TERM_SESSION_ID',
|
||||
'WT_SESSION',
|
||||
'TMUX_PANE',
|
||||
@@ -46,11 +45,8 @@ function builtLib() {
|
||||
if (_builtLib) return _builtLib;
|
||||
try {
|
||||
const { runtimes } = require('../msd-core/bin/lib/capability-registry.cjs');
|
||||
const {
|
||||
NON_REGISTRY_CONFIG_HOME_DESCRIPTORS,
|
||||
MSD_LOCATION_ENV_KEYS,
|
||||
} = require('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
_builtLib = { runtimes, NON_REGISTRY_CONFIG_HOME_DESCRIPTORS, MSD_LOCATION_ENV_KEYS };
|
||||
const { MSD_LOCATION_ENV_KEYS } = require('../msd-core/bin/lib/runtime-homes.cjs');
|
||||
_builtLib = { runtimes, MSD_LOCATION_ENV_KEYS };
|
||||
} catch (cause) {
|
||||
throw new Error(
|
||||
'tests/helpers.cjs derives the config-location scrub set from the built runtime '
|
||||
@@ -70,9 +66,9 @@ function builtLib() {
|
||||
// MSD_WORKSTREAM — planningDir() workstream segment (src/planning-workspace.cts)
|
||||
//
|
||||
// #2665 round 3: this list shrinks as sources become enumerable, and that direction
|
||||
// is the point. Descriptor-resolved vars were NOT added here — they now derive from
|
||||
// NON_REGISTRY_CONFIG_HOME_DESCRIPTORS, because hand-adding each var a reviewer
|
||||
// names is precisely what reopened this bug three times.
|
||||
// is the point. Descriptor-resolved vars were NOT added here — they derive from the
|
||||
// capability registry, because hand-adding each var a reviewer names is precisely
|
||||
// what reopened this bug three times.
|
||||
const NON_REGISTRY_CONFIG_LOCATION_ENV_KEYS = [
|
||||
'GROK_AGENTS_HOME',
|
||||
'MSD_RUNTIME',
|
||||
@@ -120,7 +116,7 @@ const WRITE_ESCAPE_PERMISSION_ENV_KEYS = ['MSD_ALLOW_SYMLINKED_DEST'];
|
||||
let _configLocationEnvKeys = null;
|
||||
function configLocationEnvKeys() {
|
||||
if (_configLocationEnvKeys) return _configLocationEnvKeys;
|
||||
const { runtimes, NON_REGISTRY_CONFIG_HOME_DESCRIPTORS, MSD_LOCATION_ENV_KEYS } = builtLib();
|
||||
const { runtimes, MSD_LOCATION_ENV_KEYS } = builtLib();
|
||||
_configLocationEnvKeys = [
|
||||
...new Set([
|
||||
// 1. Every runtime descriptor the capability registry carries — including
|
||||
@@ -133,19 +129,12 @@ function configLocationEnvKeys() {
|
||||
...Object.values(runtimes).flatMap(
|
||||
(r) => r?.runtime?.configHome?.skillsHome?.env ?? [],
|
||||
),
|
||||
// 2. Descriptor-shaped config homes resolved OUTSIDE the registry (a host's
|
||||
// native config.toml home). Derived, not hand-listed.
|
||||
// Same skillsHome walk as rung 1 — a descriptor is a descriptor.
|
||||
...NON_REGISTRY_CONFIG_HOME_DESCRIPTORS.flatMap((d) => [
|
||||
...(d?.env ?? []),
|
||||
...(d?.skillsHome?.env ?? []),
|
||||
]),
|
||||
// 3. MSD's OWN location vars — a different family: they decide where MSD keeps
|
||||
// 2. MSD's OWN location vars — a different family: they decide where MSD keeps
|
||||
// user-owned state ($MSD_HOME/.msd/), not where a runtime keeps its config.
|
||||
...MSD_LOCATION_ENV_KEYS,
|
||||
// 4. The residue that is neither registry-carried nor descriptor-shaped.
|
||||
// 3. The residue that is not registry-carried.
|
||||
...NON_REGISTRY_CONFIG_LOCATION_ENV_KEYS,
|
||||
// 5. Write-escape permissions — NOT locations. Same mechanism because the
|
||||
// 4. Write-escape permissions — NOT locations. Same mechanism because the
|
||||
// hazard is identical (ambient env lets a suite write outside the sandbox);
|
||||
// named separately above so the list does not misdescribe what they are.
|
||||
...WRITE_ESCAPE_PERMISSION_ENV_KEYS,
|
||||
@@ -1066,7 +1055,7 @@ function resetRuntimeWarningCaches() {
|
||||
const SESSION_ENV_KEYS = [
|
||||
'MSD_SESSION_KEY', 'CODEX_THREAD_ID', 'CLAUDE_SESSION_ID', 'CLAUDE_CODE_SESSION_ID',
|
||||
'CLAUDE_CODE_SSE_PORT',
|
||||
'OPENCODE_SESSION_ID', 'GEMINI_SESSION_ID', 'CURSOR_SESSION_ID', 'WINDSURF_SESSION_ID',
|
||||
'OPENCODE_SESSION_ID', 'GEMINI_SESSION_ID', 'CURSOR_SESSION_ID',
|
||||
'TERM_SESSION_ID', 'WT_SESSION', 'TMUX_PANE', 'ZELLIJ_SESSION_NAME',
|
||||
'TTY', 'SSH_TTY', 'CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS',
|
||||
'MSD_WORKSTREAM', 'MSD_PROJECT',
|
||||
|
||||
Reference in New Issue
Block a user