refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* GSD Tools Tests - frontmatter.cjs
|
||||
* MSD Tools Tests - frontmatter.cjs
|
||||
*
|
||||
* Tests for the hand-rolled YAML parser's pure function exports:
|
||||
* extractFrontmatter, reconstructFrontmatter, spliceFrontmatter,
|
||||
@@ -17,10 +17,10 @@ const {
|
||||
spliceFrontmatter,
|
||||
stripFrontmatter,
|
||||
parseMustHavesBlock,
|
||||
} = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
} = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
const { normalizePhaseName } = require('../gsd-core/bin/lib/phase-id.cjs');
|
||||
const { scanFencedBlocks } = require('../gsd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
const { normalizePhaseName } = require('../msd-core/bin/lib/phase-id.cjs');
|
||||
const { scanFencedBlocks } = require('../msd-core/bin/lib/markdown-sectionizer.cjs');
|
||||
|
||||
// ─── extractFrontmatter ─────────────────────────────────────────────────────
|
||||
|
||||
@@ -357,19 +357,19 @@ describe('reconstructFrontmatter', () => {
|
||||
});
|
||||
|
||||
test('#3257: full-line comments survive an extract→reconstruct round-trip', () => {
|
||||
const original = '---\ngsd_state_version: 1.0\n# NOTE: current_phase is hand-maintained here\ncurrent_phase: 3\nstatus: executing\n---';
|
||||
const original = '---\nmsd_state_version: 1.0\n# NOTE: current_phase is hand-maintained here\ncurrent_phase: 3\nstatus: executing\n---';
|
||||
const extracted = extractFrontmatter(original);
|
||||
assert.strictEqual(extracted['gsd_state_version'], '1.0');
|
||||
assert.strictEqual(extracted['msd_state_version'], '1.0');
|
||||
assert.strictEqual(extracted['current_phase'], '3');
|
||||
|
||||
const reconstructed = reconstructFrontmatter(extracted);
|
||||
// #3257: the comment must survive in place (between gsd_state_version and current_phase).
|
||||
// #3257: the comment must survive in place (between msd_state_version and current_phase).
|
||||
assert.ok(
|
||||
reconstructed.includes('# NOTE: current_phase is hand-maintained here'),
|
||||
`comment should survive reconstruct; got:\n${reconstructed}`,
|
||||
);
|
||||
// data identity preserved alongside the comment.
|
||||
assert.ok(reconstructed.includes('gsd_state_version: "1.0"'));
|
||||
assert.ok(reconstructed.includes('msd_state_version: "1.0"'));
|
||||
assert.ok(reconstructed.includes('current_phase: 3'));
|
||||
assert.ok(reconstructed.includes('status: executing'));
|
||||
// the reconstructed output re-parses to the same data (idempotent round-trip).
|
||||
@@ -887,13 +887,13 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
function buildStateWithCuratedPhaseName({ phaseName = 'Native Global Hotkey', aside = 'next; Phase 15 landed, UAT deferred' } = {}) {
|
||||
return [
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'milestone: v1.0',
|
||||
'milestone_name: Test',
|
||||
'current_phase: "16"',
|
||||
@@ -907,7 +907,7 @@ function buildStateWithCuratedPhaseName({ phaseName = 'Native Global Hotkey', as
|
||||
' percent: 75',
|
||||
'---',
|
||||
'',
|
||||
'# GSD State',
|
||||
'# MSD State',
|
||||
'',
|
||||
'## Configuration',
|
||||
'Current Phase: 16',
|
||||
@@ -939,7 +939,7 @@ describe('#1695: state patch of an unrelated field preserves curated current_pha
|
||||
const statePath = path.join(tmpDir, '.planning', 'STATE.md');
|
||||
fs.writeFileSync(statePath, buildStateWithCuratedPhaseName());
|
||||
|
||||
const result = runGsdTools(['query', 'state.patch', JSON.stringify({ Status: 'Paused for review' })], tmpDir);
|
||||
const result = runMsdTools(['query', 'state.patch', JSON.stringify({ Status: 'Paused for review' })], tmpDir);
|
||||
assert.ok(result.success, `state patch failed: ${result.error}`);
|
||||
|
||||
const fm = readFm(statePath);
|
||||
@@ -954,7 +954,7 @@ describe('#1695: state patch of an unrelated field preserves curated current_pha
|
||||
const statePath = path.join(tmpDir, '.planning', 'STATE.md');
|
||||
fs.writeFileSync(statePath, buildStateWithCuratedPhaseName());
|
||||
|
||||
const result = runGsdTools(['query', 'state.patch', JSON.stringify({ 'Current Plan': '3' })], tmpDir);
|
||||
const result = runMsdTools(['query', 'state.patch', JSON.stringify({ 'Current Plan': '3' })], tmpDir);
|
||||
assert.ok(result.success, `state patch failed: ${result.error}`);
|
||||
|
||||
const fm = readFm(statePath);
|
||||
@@ -970,7 +970,7 @@ describe('#1695: state patch of an unrelated field preserves curated current_pha
|
||||
// fire — syncStateFrontmatter re-derives current_phase_name from the new line.
|
||||
// (Acceptance criterion from #1743: the guard must not pin a scalar whose body
|
||||
// source genuinely changed.)
|
||||
const result = runGsdTools(['query', 'state.patch', JSON.stringify({ Phase: '17 — Brand New Phase Name' })], tmpDir);
|
||||
const result = runMsdTools(['query', 'state.patch', JSON.stringify({ Phase: '17 — Brand New Phase Name' })], tmpDir);
|
||||
assert.ok(result.success, `state patch failed: ${result.error}`);
|
||||
|
||||
const fm = readFm(statePath);
|
||||
@@ -1019,8 +1019,8 @@ const { test, describe, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
function makePlanProject(files = {}) {
|
||||
const dir = createTempProject();
|
||||
@@ -1105,7 +1105,7 @@ describe('bug #2770 — non-string truths must be coerced, not dropped', () => {
|
||||
'.planning/phases/01-foundation/01-02-PLAN.md': PLAN_BARE_INT_TRUTH(2),
|
||||
});
|
||||
|
||||
const result = runGsdTools('roadmap annotate-dependencies 1', tmpDir);
|
||||
const result = runMsdTools('roadmap annotate-dependencies 1', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const out = JSON.parse(result.output);
|
||||
@@ -1132,7 +1132,7 @@ describe('bug #2770 — non-string truths must be coerced, not dropped', () => {
|
||||
'.planning/phases/01-foundation/01-02-PLAN.md': PLAN_NUMERIC_TRUTH(2, 'shared-rule'),
|
||||
});
|
||||
|
||||
const result = runGsdTools('roadmap annotate-dependencies 1', tmpDir);
|
||||
const result = runMsdTools('roadmap annotate-dependencies 1', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const out = JSON.parse(result.output);
|
||||
@@ -1223,8 +1223,8 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { runGsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { runMsdTools, createTempProject, cleanup } = require('./helpers.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// Helpers
|
||||
@@ -1247,7 +1247,7 @@ function buildStateWithCuratedProgress(opts) {
|
||||
|
||||
return [
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'status: executing',
|
||||
'progress:',
|
||||
` total_phases: ${totalPhases}`,
|
||||
@@ -1257,7 +1257,7 @@ function buildStateWithCuratedProgress(opts) {
|
||||
` percent: ${percent}`,
|
||||
'---',
|
||||
'',
|
||||
'# GSD State',
|
||||
'# MSD State',
|
||||
'',
|
||||
'## Configuration',
|
||||
'Current Phase: 6',
|
||||
@@ -1365,14 +1365,14 @@ describe('#3242 Bug A: body-only state.update preserves curated progress frontma
|
||||
const phasesDir = path.join(tmpDir, '.planning', 'phases');
|
||||
createPhaseDirs(phasesDir, 6);
|
||||
|
||||
const updateResult = runGsdTools(
|
||||
const updateResult = runMsdTools(
|
||||
['state', 'update', 'Last Activity', '2026-05-07'],
|
||||
tmpDir,
|
||||
);
|
||||
assert.ok(updateResult.success, `state update failed: ${updateResult.error}`);
|
||||
|
||||
// Read back and assert via state json (JSON return value, not raw file grep)
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
@@ -1408,7 +1408,7 @@ describe('#3242 Bug A: body-only state.update preserves curated progress frontma
|
||||
const statePath = path.join(tmpDir, '.planning', 'STATE.md');
|
||||
fs.writeFileSync(statePath, buildStateWithCuratedProgress({ lastActivity: '2026-01-01' }));
|
||||
|
||||
const updateResult = runGsdTools(
|
||||
const updateResult = runMsdTools(
|
||||
['state', 'update', 'Last Activity', '2026-05-07'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -1417,7 +1417,7 @@ describe('#3242 Bug A: body-only state.update preserves curated progress frontma
|
||||
// Assert via structured JSON output — not raw file text scanning.
|
||||
// state json extracts Last Activity from the body and surfaces it as
|
||||
// fm.last_activity, matching the no-source-grep testing standard.
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
assert.strictEqual(
|
||||
@@ -1442,13 +1442,13 @@ describe('#3242 Bug A: body-only state.update preserves curated progress frontma
|
||||
percent: 50,
|
||||
}).replace('Last Activity: 2026-01-01\n', 'Last Activity: 2026-01-01\nProgress: [█████░░░░░] 50%\n'));
|
||||
|
||||
const updateResult = runGsdTools(
|
||||
const updateResult = runMsdTools(
|
||||
['state', 'update', 'Progress', '[████████░░] 80%'],
|
||||
tmpDir,
|
||||
);
|
||||
assert.ok(updateResult.success, `state update failed: ${updateResult.error}`);
|
||||
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
assert.strictEqual(fm.progress.percent, 80);
|
||||
@@ -1493,7 +1493,7 @@ describe('#1264: state.patch preserves curated progress frontmatter for non-prog
|
||||
);
|
||||
createPhasePlanOnlyDirs(path.join(tmpDir, '.planning', 'phases'), 5);
|
||||
|
||||
const patchResult = runGsdTools([
|
||||
const patchResult = runMsdTools([
|
||||
'query',
|
||||
'state.patch',
|
||||
JSON.stringify({ 'Current Phase': '08.2' }),
|
||||
@@ -1522,7 +1522,7 @@ describe('#1264: state.patch preserves curated progress frontmatter for non-prog
|
||||
);
|
||||
createPhasePlanOnlyDirs(path.join(tmpDir, '.planning', 'phases'), 8);
|
||||
|
||||
const patchResult = runGsdTools([
|
||||
const patchResult = runMsdTools([
|
||||
'query',
|
||||
'state.patch',
|
||||
JSON.stringify({ 'Total Plans in Phase': '8' }),
|
||||
@@ -1573,7 +1573,7 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
// Body: 6 realized phases visible to disk scan.
|
||||
// Frontmatter: intentionally absent so buildStateFrontmatter runs fresh.
|
||||
fs.writeFileSync(statePath, [
|
||||
'# GSD State',
|
||||
'# MSD State',
|
||||
'',
|
||||
'## Configuration',
|
||||
'Current Phase: 6',
|
||||
@@ -1596,7 +1596,7 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
createPhaseDirs(phasesDir, 6);
|
||||
|
||||
// state json rebuilds frontmatter from disk+body — this exercises buildStateFrontmatter
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
@@ -1624,7 +1624,7 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
const statePath = path.join(tmpDir, '.planning', 'STATE.md');
|
||||
|
||||
fs.writeFileSync(statePath, [
|
||||
'# GSD State',
|
||||
'# MSD State',
|
||||
'',
|
||||
'## Configuration',
|
||||
'Current Phase: 3',
|
||||
@@ -1645,7 +1645,7 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
const phasesDir = path.join(tmpDir, '.planning', 'phases');
|
||||
createPhaseDirs(phasesDir, 3);
|
||||
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
@@ -1666,7 +1666,7 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
const statePath = path.join(tmpDir, '.planning', 'STATE.md');
|
||||
|
||||
fs.writeFileSync(statePath, [
|
||||
'# GSD State',
|
||||
'# MSD State',
|
||||
'',
|
||||
'## Configuration',
|
||||
'Current Phase: 6',
|
||||
@@ -1687,11 +1687,11 @@ describe('#3242 Bug B: progress.percent reflects phase fraction when ROADMAP dec
|
||||
const phasesDir = path.join(tmpDir, '.planning', 'phases');
|
||||
createPhaseDirs(phasesDir, 6);
|
||||
|
||||
const syncResult = runGsdTools('state sync', tmpDir);
|
||||
const syncResult = runMsdTools('state sync', tmpDir);
|
||||
assert.ok(syncResult.success, `state sync failed: ${syncResult.error}`);
|
||||
|
||||
// Read the body's Progress field via state json (JSON output is authoritative)
|
||||
const jsonResult = runGsdTools('state json', tmpDir);
|
||||
const jsonResult = runMsdTools('state json', tmpDir);
|
||||
assert.ok(jsonResult.success, `state json failed: ${jsonResult.error}`);
|
||||
|
||||
const fm = JSON.parse(jsonResult.output);
|
||||
@@ -1740,7 +1740,7 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
const FIXTURE_DIR = path.join(__dirname, 'fixtures', 'adversarial', 'frontmatter');
|
||||
|
||||
@@ -1896,7 +1896,7 @@ describe('feat-3594: frontmatter parser does not throw on ANY corpus fixture', (
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
/**
|
||||
* mulberry32 — small fast deterministic PRNG. Seed in, [0,1) out.
|
||||
@@ -2034,8 +2034,8 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
const __assert2736 = require('node:assert/strict');
|
||||
const __fs2736 = require('node:fs');
|
||||
const __path2736 = require('node:path');
|
||||
const { runGsdTools: __run2736, createTempProject: __mk2736, cleanup: __rm2736 } = require('./helpers.cjs');
|
||||
const __state2736 = require('../gsd-core/bin/lib/state.cjs');
|
||||
const { runMsdTools: __run2736, createTempProject: __mk2736, cleanup: __rm2736 } = require('./helpers.cjs');
|
||||
const __state2736 = require('../msd-core/bin/lib/state.cjs');
|
||||
|
||||
const PAREN_NAME_2736 = 'Closer-ruling measurement (D1a)';
|
||||
|
||||
@@ -2046,7 +2046,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
function postAdvanceState2736() {
|
||||
return [
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'milestone: v1.10',
|
||||
'current_phase: 48',
|
||||
'current_phase_name: Harness debt clearance',
|
||||
@@ -2134,7 +2134,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
__path2736.join(planningDir, 'STATE.md'),
|
||||
[
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'current_phase: 1',
|
||||
'current_phase_name: Foundation',
|
||||
'status: executing',
|
||||
@@ -2209,7 +2209,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
__path2736.join(planningDir, 'STATE.md'),
|
||||
[
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'current_phase: 1',
|
||||
'current_phase_name: Foundation',
|
||||
'status: executing',
|
||||
@@ -2262,7 +2262,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
__t2736('the intent-held name survives the begin-phase sync verbatim', () => {
|
||||
writeBeginFixture2736([
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'current_phase: 1',
|
||||
'current_phase_name: Foundation',
|
||||
'status: planning',
|
||||
@@ -2302,7 +2302,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
// applyStatePreservation is what this pins.
|
||||
writeBeginFixture2736([
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'current_phase: 1',
|
||||
'current_phase_name: Foundation',
|
||||
'status: planning',
|
||||
@@ -2338,7 +2338,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
// resume invocation's --name.
|
||||
writeBeginFixture2736([
|
||||
'---',
|
||||
'gsd_state_version: 1.0',
|
||||
'msd_state_version: 1.0',
|
||||
'current_phase: 2',
|
||||
`current_phase_name: ${PAREN_NAME_2736}`,
|
||||
'status: executing',
|
||||
@@ -2393,9 +2393,9 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
const __assert3374 = require('node:assert/strict');
|
||||
const __fs3374 = require('node:fs');
|
||||
const __path3374 = require('node:path');
|
||||
const { runGsdTools: __run3374, createTempProject: __mk3374, cleanup: __rm3374 } = require('./helpers.cjs');
|
||||
const { extractFrontmatter: __extractFm3374 } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { stateExtractField: __extractField3374 } = require('../gsd-core/bin/lib/state-document.cjs');
|
||||
const { runMsdTools: __run3374, createTempProject: __mk3374, cleanup: __rm3374 } = require('./helpers.cjs');
|
||||
const { extractFrontmatter: __extractFm3374 } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
const { stateExtractField: __extractField3374 } = require('../msd-core/bin/lib/state-document.cjs');
|
||||
|
||||
const FRESH_3374 = 'Phase 2 gap closure executed — FRESH frontmatter value';
|
||||
const STALE_3374 = 'Phase 1 complete, ready to plan Phase 2';
|
||||
@@ -2441,7 +2441,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
__path3374.join(planningDir, 'STATE.md'),
|
||||
[
|
||||
'---',
|
||||
"gsd_state_version: '1.0'",
|
||||
"msd_state_version: '1.0'",
|
||||
'milestone: v1.0',
|
||||
'current_phase: 2',
|
||||
'current_phase_name: Second phase',
|
||||
@@ -2566,7 +2566,7 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
'use strict';
|
||||
|
||||
// allow-test-rule: source-text-is-the-product (see #2847)
|
||||
// agents/gsd-planner.md is the deployed runtime prompt contract — testing its
|
||||
// agents/msd-planner.md is the deployed runtime prompt contract — testing its
|
||||
// text content tests the deployed contract (CONTRIBUTING.md exception matrix).
|
||||
//
|
||||
// Regression tests for #2847: "--gaps does not load planner-gap-closure.md,
|
||||
@@ -2576,17 +2576,17 @@ test('extractFrontmatter handles large frontmatter blocks without body bleed', (
|
||||
// conditionally-loaded prose. Fix: src/frontmatter.cts gained a
|
||||
// `plan-gap-closure` schema (covered behaviorally in frontmatter-cli.test.cjs
|
||||
// / frontmatter.unit.test.cjs); this block covers the prompt-level wiring in
|
||||
// agents/gsd-planner.md's <step name="validate_plan"> that selects it via a
|
||||
// agents/msd-planner.md's <step name="validate_plan"> that selects it via a
|
||||
// real `--schema "$SCHEMA"` shell-variable reference instead of a hardcoded
|
||||
// literal. An earlier revision left the bash line unconditional
|
||||
// (`--schema plan)`) while only prose mentioned the conditional — caught by
|
||||
// review, not tests; the assertions below target executable content
|
||||
// specifically to catch that shape. See
|
||||
// .gsd/bug/fix-2847-gap-closure-frontmatter/10-diagnosis.md.
|
||||
// .msd/bug/fix-2847-gap-closure-frontmatter/10-diagnosis.md.
|
||||
//
|
||||
// Deliberately NOT touched: gsd-core/workflows/plan-phase.md sits under the
|
||||
// Deliberately NOT touched: msd-core/workflows/plan-phase.md sits under the
|
||||
// ADR-857 PRE_PHASE6 byte ceiling and cannot absorb a gap_closure mention;
|
||||
// the gsd-planner.md validate_plan step is the actual call site and is
|
||||
// the msd-planner.md validate_plan step is the actual call site and is
|
||||
// sufficient on its own.
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
@@ -2594,7 +2594,7 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const PLANNER_AGENT_PATH = path.join(__dirname, '..', 'agents', 'gsd-planner.md');
|
||||
const PLANNER_AGENT_PATH = path.join(__dirname, '..', 'agents', 'msd-planner.md');
|
||||
|
||||
function readFile(p) {
|
||||
return fs.readFileSync(p, 'utf-8');
|
||||
@@ -2643,7 +2643,7 @@ function findValidateInvocationLine(bashBlock) {
|
||||
return bashBlock.split('\n').find((l) => l.includes('frontmatter.validate')) || null;
|
||||
}
|
||||
|
||||
// ─── agents/gsd-planner.md: validate_plan step BINDS schema to mode (#2847) ──
|
||||
// ─── agents/msd-planner.md: validate_plan step BINDS schema to mode (#2847) ──
|
||||
//
|
||||
// This describe block asserts on the EXECUTABLE content of the step — the literal
|
||||
// argument passed to `--schema` in the fenced bash block the agent actually runs —
|
||||
@@ -2657,14 +2657,14 @@ function findValidateInvocationLine(bashBlock) {
|
||||
// block, `--schema plan-gap-closure` only in the prose sentence above it) before
|
||||
// the bash block was changed to `--schema "$SCHEMA"`.
|
||||
|
||||
describe('#2847: gsd-planner.md validate_plan step BINDS --schema to gap_closure mode (executable content, not prose)', () => {
|
||||
describe('#2847: msd-planner.md validate_plan step BINDS --schema to gap_closure mode (executable content, not prose)', () => {
|
||||
const plannerContent = readFile(PLANNER_AGENT_PATH);
|
||||
const validateStep = extractStep(plannerContent, 'validate_plan');
|
||||
const bashBlock = extractFirstBashBlock(validateStep || '');
|
||||
const invocationLine = findValidateInvocationLine(bashBlock);
|
||||
|
||||
test('validate_plan step exists and has a fenced bash block invoking frontmatter.validate', () => {
|
||||
assert.ok(validateStep, '<step name="validate_plan"> must exist in agents/gsd-planner.md');
|
||||
assert.ok(validateStep, '<step name="validate_plan"> must exist in agents/msd-planner.md');
|
||||
assert.ok(bashBlock, 'validate_plan step must have a ```bash fenced block');
|
||||
assert.ok(invocationLine, 'validate_plan step bash block must invoke frontmatter.validate');
|
||||
});
|
||||
@@ -2748,12 +2748,12 @@ describe('#2847: gsd-planner.md validate_plan step BINDS --schema to gap_closure
|
||||
|
||||
// ─── Cross-file consistency: schema name used by both files matches (#2847) ──
|
||||
|
||||
describe('#2847: schema name consistency between gsd-planner.md and src/frontmatter.cts', () => {
|
||||
test('gsd-planner.md references the exact schema name "plan-gap-closure"', () => {
|
||||
describe('#2847: schema name consistency between msd-planner.md and src/frontmatter.cts', () => {
|
||||
test('msd-planner.md references the exact schema name "plan-gap-closure"', () => {
|
||||
const plannerContent = readFile(PLANNER_AGENT_PATH);
|
||||
assert.ok(
|
||||
plannerContent.includes('plan-gap-closure'),
|
||||
'agents/gsd-planner.md must reference the literal schema name "plan-gap-closure" ' +
|
||||
'agents/msd-planner.md must reference the literal schema name "plan-gap-closure" ' +
|
||||
'(the exact key registered in FRONTMATTER_SCHEMAS in src/frontmatter.cts) — a ' +
|
||||
'mismatched name would fail at runtime with "Unknown schema"'
|
||||
);
|
||||
@@ -2780,12 +2780,12 @@ describe('#2847: schema name consistency between gsd-planner.md and src/frontmat
|
||||
* (acceptance criteria 1-3). The generalized "arbitrary content before the fence" fork
|
||||
* (tolerate vs diagnose) is a product-intent decision, surfaced in the PR — out of scope.
|
||||
*
|
||||
* Matrix: .gsd/bug/fix/2977-frontmatter-bom-tolerance/50-test-matrix.md
|
||||
* Matrix: .msd/bug/fix/2977-frontmatter-bom-tolerance/50-test-matrix.md
|
||||
*/
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { extractFrontmatter } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { extractFrontmatter } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
const BOM = '\uFEFF';
|
||||
|
||||
@@ -2855,7 +2855,7 @@ describe('extractFrontmatter BOM tolerance (#2977)', () => {
|
||||
{
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { extractFrontmatter, reconstructFrontmatter, escapeDoubleQuotedScalar } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { extractFrontmatter, reconstructFrontmatter, escapeDoubleQuotedScalar } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
describe('#3881 review finding 3: prototype-chain keys never crash extract/reconstruct', () => {
|
||||
const hostileKeys = ['constructor', '__proto__', 'toString', 'valueOf', 'hasOwnProperty'];
|
||||
@@ -2939,7 +2939,7 @@ describe('extractFrontmatter BOM tolerance (#2977)', () => {
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { extractFrontmatter, FRONTMATTER_UNPARSEABLE } = require('../gsd-core/bin/lib/frontmatter.cjs');
|
||||
const { extractFrontmatter, FRONTMATTER_UNPARSEABLE } = require('../msd-core/bin/lib/frontmatter.cjs');
|
||||
|
||||
const FIXTURE_DIR2 = path.join(__dirname, 'fixtures', 'adversarial', 'frontmatter');
|
||||
function readFixture2(name) {
|
||||
@@ -2985,7 +2985,7 @@ describe('extractFrontmatter BOM tolerance (#2977)', () => {
|
||||
assert.ok(Buffer.byteLength(JSON.stringify(parsed), 'utf8') < 1024);
|
||||
});
|
||||
|
||||
const ADD_TESTS_PATH = path.join(__dirname, '..', 'commands', 'gsd', 'add-tests.md');
|
||||
const ADD_TESTS_PATH = path.join(__dirname, '..', 'commands', 'msd', 'add-tests.md');
|
||||
|
||||
test('B1 blockScalarValueIsNotTheBlockIndicator: argument-instructions is the instruction text, not "|"', () => {
|
||||
const content = fs.readFileSync(ADD_TESTS_PATH, 'utf8');
|
||||
|
||||
Reference in New Issue
Block a user