refactor(#1286): T4 — migrate 5 large destructure callers off the core spine (batch 3) (#1287)

Migrate the entire core surface of commands (~23 symbols), phase (~17),
roadmap, state, template to the leaf modules directly (behaviour-identical —
leaves are the objects core re-exports by reference). All 5 now import zero
core symbols and are removed from the allowlist (9 -> 4). Dropped a dead
`void replaceInCurrentMilestone` from phase.cts; stale core.cjs docstrings
fixed. core.cts re-exports untouched (serve the remaining 4 idiom-hard
files); teardown is T-final. No behaviour change.

Closes #1286

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-15 17:03:22 -04:00
committed by GitHub
parent ec2ecdf28b
commit 645601a10d
6 changed files with 70 additions and 68 deletions

View File

@@ -10,8 +10,14 @@ import fs from 'node:fs';
import path from 'node:path';
import { realClock } from './clock.cjs';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import core = require('./core.cjs');
const { escapeRegex, normalizePhaseName, phaseMarkdownRegexSource, phaseMarkdownRegexSourceExact, output, error, findPhaseInternal, phaseTokenMatches } = core;
import ioMod = require('./io.cjs');
const { output, error } = ioMod;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import phaseIdMod = require('./phase-id.cjs');
const { escapeRegex, normalizePhaseName, phaseMarkdownRegexSource, phaseMarkdownRegexSourceExact, phaseTokenMatches } = phaseIdMod;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import phaseLocatorMod = require('./phase-locator.cjs');
const { findPhaseInternal } = phaseLocatorMod;
// eslint-disable-next-line @typescript-eslint/no-require-imports
import roadmapParserModule = require('./roadmap-parser.cjs');
const { stripShippedMilestones, extractCurrentMilestone, replaceInCurrentMilestone } = roadmapParserModule;
@@ -98,8 +104,7 @@ function countPhasePlansAndSummaries(phaseDir: string): PhasePlansAndSummaries {
};
}
// `phaseMarkdownRegexSource` moved to core.cjs (#3537) so phase.cjs and
// core.cjs itself can consume it without circular deps. Imported above.
// `phaseMarkdownRegexSource` lives in phase-id.cjs (#3537) and is imported above.
// ─── searchPhaseInContent ─────────────────────────────────────────────────────