refactor(#1294): T-final — delete the core.cjs re-export spine (epic #1267 complete) (#1295)

* refactor(#1294): T-final — delete the core.cjs re-export spine (epic #1267 complete)

After T0–T6 nothing imports core, so retire the spine and its scaffolding:
- delete src/core.cts (and the gitignored gsd-core/bin/lib/core.cjs artifact;
  remove its .gitignore + eslint-ignore entries)
- delete scripts/lint-core-spine-imports.cjs + its allowlist; drop it from the
  package.json lint:ci chain
- regenerate docs/INVENTORY-MANIFEST.json (drops the core.cjs surface)
- sweep stale references: CONTEXT.md glossary back-compat clauses (spine retired,
  callers import the leaf directly), planning-config.md CONFIG_DEFAULTS owner,
  and false present-tense core.cjs claims in leaf-module docstrings

The ADR-857 decomposition is complete: the former Core god-module is fully
dissolved into its leaf modules; no re-export spine remains. No behaviour change.

Closes #1294

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(#1294): migrate the computed-path core.cjs importers the literal grep missed

bin/install.js used require(path.join(_gsdLibDir, 'core.cjs')) (a computed
path, and bin/install.js was never in the convergence lint's scan roots), and
~8 test files referenced core.cjs via path.join/readFileSync/existsSync/FILE_ARG
forms the literal-string migration grep missed. Route install.js's symbols to
their leaves (RUNTIME_PROFILE_MAP->model-catalog, resolveTierEntry/EFFORT_SET->
model-resolver) and repoint/adjust the test references to the leaves. Recovers
the 161 'Cannot find module core.cjs' failures from the spine deletion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-15 18:50:46 -04:00
committed by GitHub
parent c76827afbc
commit 8c3d934a90
31 changed files with 62 additions and 501 deletions

View File

@@ -13,7 +13,7 @@ const assert = require('node:assert/strict');
const path = require('path');
const { extractOneLinerFromBody } = require(
path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'core.cjs')
path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'core-utils.cjs')
);
describe('bug #2660: extractOneLinerFromBody', () => {

View File

@@ -26,7 +26,7 @@ const os = require('node:os');
const { execFileSync } = require('node:child_process');
const GSD_TOOLS = path.join(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
const { ERROR_REASON } = require(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'core.cjs'));
const { ERROR_REASON } = require(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'io.cjs'));
const { cleanup } = require('./helpers.cjs');
describe('bug-2943: config-get returns schema default for context_window', () => {

View File

@@ -68,7 +68,7 @@ describe('no-source-grep rule', () => {
code: `
const fs = require('fs');
const path = require('path');
const src = fs.readFileSync(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'core.cjs'), 'utf-8');
const src = fs.readFileSync(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'io.cjs'), 'utf-8');
src.includes('someFunction');
`,
filename: 'tests/foo.test.cjs',
@@ -105,7 +105,7 @@ describe('no-source-grep rule', () => {
// allow-test-rule: pending migration
const fs = require('fs');
const path = require('path');
const src = fs.readFileSync(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'core.cjs'), 'utf-8');
const src = fs.readFileSync(path.join(__dirname, '..', 'gsd-core', 'bin', 'lib', 'io.cjs'), 'utf-8');
src.includes('someFunction');
`,
filename: 'tests/foo.test.cjs',

View File

@@ -262,7 +262,7 @@ describe('#3023 + #443: unified effort resolver (resolveEffortInternal) for Code
beforeEach(() => { projectDir = makeTmp('effort'); });
afterEach(() => { rmr(projectDir); });
test('resolveEffortInternal exported from core.cjs', () => {
test('resolveEffortInternal exported from model-resolver.cjs', () => {
assert.equal(typeof resolveEffortInternal, 'function');
});

View File

@@ -719,11 +719,11 @@ describe('#49 isValidConfigKey: model_policy.* keys accepted/rejected', () => {
// ─── KNOWN_PROVIDERS export tests ─────────────────────────────────────────────
describe('#49 KNOWN_PROVIDERS exports from model-catalog.cjs and core.cjs', () => {
test('KNOWN_PROVIDERS exported from core.cjs includes all keys from providerPresets in catalog', () => {
// KNOWN_PROVIDERS must be a Set (or array) exported from core.cjs.
describe('#49 KNOWN_PROVIDERS exports from model-catalog.cjs', () => {
test('KNOWN_PROVIDERS exported from model-catalog.cjs includes all keys from providerPresets in catalog', () => {
// KNOWN_PROVIDERS must be a Set (or array) exported from model-catalog.cjs.
assert.ok(KNOWN_PROVIDERS != null,
'KNOWN_PROVIDERS must be exported from core.cjs');
'KNOWN_PROVIDERS must be exported from model-catalog.cjs');
const isIterable = typeof KNOWN_PROVIDERS[Symbol.iterator] === 'function';
assert.ok(isIterable,
'KNOWN_PROVIDERS must be iterable (Set or array)');
@@ -741,15 +741,14 @@ describe('#49 KNOWN_PROVIDERS exports from model-catalog.cjs and core.cjs', () =
'KNOWN_PROVIDERS must not include "generic" (it is not a catalog-backed provider)');
});
test('KNOWN_PROVIDERS exported from model-catalog.cjs matches core.cjs re-export', () => {
// model-catalog.cjs must also export KNOWN_PROVIDERS (the canonical source).
// core.cjs re-exports it. Both must be identical.
test('KNOWN_PROVIDERS from model-catalog.cjs is the canonical export', () => {
// model-catalog.cjs is the canonical source of KNOWN_PROVIDERS.
assert.ok(modelCatalog.KNOWN_PROVIDERS != null,
'KNOWN_PROVIDERS must be exported from model-catalog.cjs');
const fromCatalog = [...modelCatalog.KNOWN_PROVIDERS].sort();
const fromCore = [...KNOWN_PROVIDERS].sort();
assert.deepStrictEqual(fromCore, fromCatalog,
'KNOWN_PROVIDERS from core.cjs (re-export) must match model-catalog.cjs canonical export');
const fromImport = [...KNOWN_PROVIDERS].sort();
assert.deepStrictEqual(fromImport, fromCatalog,
'KNOWN_PROVIDERS imported from model-catalog.cjs must match the module export');
});
});

View File

@@ -359,7 +359,7 @@ describe('intel router: unit tests via recording mocks', () => {
test('routeIntelCommand extract-exports: calls intelExtractExports(path.resolve(cwd, filePath))', () => {
const calls = [];
const c = makeCoreMock();
const FILE_ARG = 'lib/core.cjs';
const FILE_ARG = 'lib/io.cjs';
const EXPECTED = path.resolve(CWD, FILE_ARG);
routeIntelCommand({

View File

@@ -619,14 +619,14 @@ describe('issue #2517: install end-to-end — per-project config reaches Codex T
// resolver-construction time. Catches accidental relative-path drift in CI.
const installDir = path.dirname(require.resolve('../bin/install.js'));
const libDir = path.join(installDir, '..', 'gsd-core', 'bin', 'lib');
assert.ok(fs.existsSync(path.join(libDir, 'core.cjs')));
assert.ok(fs.existsSync(path.join(libDir, 'model-catalog.cjs')));
assert.ok(fs.existsSync(path.join(libDir, 'model-profiles.cjs')));
});
});
// ─── RUNTIME_PROFILE_MAP single source of truth (finding #16) ───────────────
describe('issue #2517: RUNTIME_PROFILE_MAP single source of truth (finding #16)', () => {
test('install.js consumes the same map as core.cjs', () => {
test('install.js consumes the same map as model-catalog.cjs', () => {
// `bin/install.js` must NOT carry its own duplicate copy of the map.
// The shared resolver imported in install.js exposes `runtime` and the
// entries through `resolveTierEntry`, so any future drift between the two

View File

@@ -24,7 +24,7 @@ const WORKTREE_SAFETY_PATH = path.join(
__dirname, '..', 'gsd-core', 'bin', 'lib', 'worktree-safety.cjs'
);
const CORE_PATH = path.join(
__dirname, '..', 'gsd-core', 'bin', 'lib', 'core.cjs'
__dirname, '..', 'gsd-core', 'bin', 'lib', 'worktree-safety.cjs'
);
const {