refactor(#1291): T6 — migrate test files off the core spine ahead of deletion (#1293)

The convergence lint only scanned src/ + gsd-core/bin, so ~35 test files
still imported core.cjs. Repoint all 33 behaviour importers to the leaf
modules directly (same symbol->leaf map as the src migration; leaves are the
objects core re-exported by reference), delete the now-meaningless
shim-identity describe blocks in the 8 leaf tests, and delete tests/core.test.cjs
(forwarded-behaviour coverage now lives at the leaves; resolveWorktreeRoot
test relocated to worktree-safety in T0) and tests/lint-core-spine-imports.test.cjs
(the lint is removed in T-final). Dropped the stale core.test.cjs entries from
the allow-test-rule-refs allowlist; eslint-rules RuleTester fixture path
pointed at io.cjs.

After T6: ZERO test imports core.cjs. core.cts still builds (now fully unused);
T-final deletes it. No behaviour change.

Closes #1291

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-15 18:11:20 -04:00
committed by GitHub
parent 76765bc24d
commit c76827afbc
36 changed files with 51 additions and 2650 deletions

View File

@@ -15,7 +15,7 @@ const {
setActiveWorkstream,
} = require('../gsd-core/bin/lib/planning-workspace.cjs');
const core = require('../gsd-core/bin/lib/core.cjs');
const planningWorkspaceDirect = require('../gsd-core/bin/lib/planning-workspace.cjs');
describe('planning-workspace: planningDir/planningPaths parity', () => {
const cwd = '/fake/repo';
@@ -147,7 +147,7 @@ describe('planning-workspace: lock seam', () => {
});
});
describe('core compatibility adapter: planning workspace functions', () => {
describe('planning-workspace direct: functions expose matching behavior', () => {
let savedSession;
beforeEach(() => {
@@ -160,26 +160,26 @@ describe('core compatibility adapter: planning workspace functions', () => {
else delete process.env.GSD_SESSION_KEY;
});
test('core and planning-workspace expose matching behavior', () => {
test('planning-workspace functions work consistently', () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-core-compat-'));
try {
fs.mkdirSync(path.join(tmpDir, '.planning', 'workstreams', 'alpha'), { recursive: true });
core.setActiveWorkstream(tmpDir, 'alpha');
assert.strictEqual(core.getActiveWorkstream(tmpDir), 'alpha');
planningWorkspaceDirect.setActiveWorkstream(tmpDir, 'alpha');
assert.strictEqual(planningWorkspaceDirect.getActiveWorkstream(tmpDir), 'alpha');
assert.strictEqual(getActiveWorkstream(tmpDir), 'alpha');
assert.strictEqual(
core.planningDir(tmpDir, 'feature-x', 'my-project'),
planningWorkspaceDirect.planningDir(tmpDir, 'feature-x', 'my-project'),
planningDir(tmpDir, 'feature-x', 'my-project')
);
assert.deepStrictEqual(
core.planningPaths(tmpDir, 'feature-x'),
planningWorkspaceDirect.planningPaths(tmpDir, 'feature-x'),
planningPaths(tmpDir, 'feature-x')
);
setActiveWorkstream(tmpDir, null);
assert.strictEqual(core.getActiveWorkstream(tmpDir), null);
assert.strictEqual(planningWorkspaceDirect.getActiveWorkstream(tmpDir), null);
} finally {
cleanup(tmpDir);
}