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,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// #2618: deterministic renderer for STATE.md's "### Pending Todos" section
|
||||
// body. See .gsd/phase/feat-2618-compact-todo-pointers/40-design.md and
|
||||
// body. See .msd/phase/feat-2618-compact-todo-pointers/40-design.md and
|
||||
// 50-test-matrix.md for the full rationale and case list.
|
||||
|
||||
const test = require('node:test');
|
||||
@@ -11,10 +11,10 @@ const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const fc = require('fast-check');
|
||||
|
||||
const initLib = require('../gsd-core/bin/lib/init.cjs');
|
||||
const initLib = require('../msd-core/bin/lib/init.cjs');
|
||||
const { renderPendingTodosMarkdown } = initLib;
|
||||
const { cleanup } = require('./helpers.cjs');
|
||||
const { escapeRegex } = require('../gsd-core/bin/lib/pattern.cjs');
|
||||
const { escapeRegex } = require('../msd-core/bin/lib/pattern.cjs');
|
||||
const { PROBE_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
|
||||
const MAX = 240;
|
||||
@@ -204,7 +204,7 @@ const TODO_RELATIVE_TAIL = path
|
||||
.join('/');
|
||||
|
||||
test('renderPendingTodosMarkdown: cap is deterministic w.r.t. base-path length (needs clause survives long absolute bases)', () => {
|
||||
const shortBase = path.resolve('/', 'gsd-2618-short-base');
|
||||
const shortBase = path.resolve('/', 'msd-2618-short-base');
|
||||
const longBase = path.join(shortBase, LONG_BASE_SEGMENT);
|
||||
const todoAt = (base) =>
|
||||
makeTodo({ path: path.join(base, TODO_RELATIVE_TAIL), needs: 'Add a max-attempts cap.' });
|
||||
@@ -223,12 +223,12 @@ test('renderPendingTodosMarkdown: cap is deterministic w.r.t. base-path length (
|
||||
|
||||
test('renderPendingTodosMarkdown: already-relative path is byte-stable with and without projectRoot', () => {
|
||||
const todo = makeTodo({ needs: 'define retry behavior' });
|
||||
const withRoot = renderPendingTodosMarkdown([todo], path.resolve('/', 'gsd-2618-rel-root'));
|
||||
const withRoot = renderPendingTodosMarkdown([todo], path.resolve('/', 'msd-2618-rel-root'));
|
||||
assert.equal(withRoot, renderPendingTodosMarkdown([todo]));
|
||||
});
|
||||
|
||||
test('renderPendingTodosMarkdown: absolute path without projectRoot keeps the legacy absolute link and drop order', () => {
|
||||
const base = path.join(path.resolve('/', 'gsd-2618-legacy-base'), LONG_BASE_SEGMENT);
|
||||
const base = path.join(path.resolve('/', 'msd-2618-legacy-base'), LONG_BASE_SEGMENT);
|
||||
const todo = makeTodo({ path: path.join(base, TODO_RELATIVE_TAIL), needs: 'a real needs clause' });
|
||||
const line = renderPendingTodosMarkdown([todo]);
|
||||
// Opt-out callers keep today's behavior: over-cap drops needs first, link
|
||||
@@ -238,7 +238,7 @@ test('renderPendingTodosMarkdown: absolute path without projectRoot keeps the le
|
||||
});
|
||||
|
||||
test('renderPendingTodosMarkdown: long base + long title still bounds the bullet and keeps the drop order', () => {
|
||||
const base = path.join(path.resolve('/', 'gsd-2618-order-base'), LONG_BASE_SEGMENT);
|
||||
const base = path.join(path.resolve('/', 'msd-2618-order-base'), LONG_BASE_SEGMENT);
|
||||
const todo = makeTodo({
|
||||
path: path.join(base, TODO_RELATIVE_TAIL),
|
||||
title: 'A'.repeat(300),
|
||||
@@ -252,9 +252,9 @@ test('renderPendingTodosMarkdown: long base + long title still bounds the bullet
|
||||
});
|
||||
|
||||
test('renderPendingTodosMarkdown: absolute path outside projectRoot renders a ../ relative link', () => {
|
||||
const root = path.resolve('/', 'gsd-2618-outside-root');
|
||||
const root = path.resolve('/', 'msd-2618-outside-root');
|
||||
const outsideTodo = path.join(
|
||||
path.resolve('/', 'gsd-2618-outside-sibling'),
|
||||
path.resolve('/', 'msd-2618-outside-sibling'),
|
||||
TODO_RELATIVE_TAIL,
|
||||
);
|
||||
const line = renderPendingTodosMarkdown([makeTodo({ path: outsideTodo })], root);
|
||||
@@ -272,7 +272,7 @@ test('renderPendingTodosMarkdown: absolute path outside projectRoot renders a ..
|
||||
});
|
||||
|
||||
test('renderPendingTodosMarkdown: path equal to projectRoot falls back to the raw link target', () => {
|
||||
const root = path.resolve('/', 'gsd-2618-eq-root');
|
||||
const root = path.resolve('/', 'msd-2618-eq-root');
|
||||
const line = renderPendingTodosMarkdown([makeTodo({ path: root })], root);
|
||||
assert.ok(line.includes(`[todo file](${root})`));
|
||||
});
|
||||
@@ -280,7 +280,7 @@ test('renderPendingTodosMarkdown: path equal to projectRoot falls back to the ra
|
||||
test('renderPendingTodosMarkdown: non-string path keeps the empty-link fallback', () => {
|
||||
const line = renderPendingTodosMarkdown(
|
||||
[makeTodo({ path: 42 })],
|
||||
path.resolve('/', 'gsd-2618-num-root'),
|
||||
path.resolve('/', 'msd-2618-num-root'),
|
||||
);
|
||||
assert.match(line, /\[todo file\]\(\)$/);
|
||||
});
|
||||
@@ -290,18 +290,18 @@ test('renderPendingTodosMarkdown: non-string path keeps the empty-link fallback'
|
||||
const { spawnSync } = require('node:child_process');
|
||||
|
||||
function runQueryInitTodos(cwd) {
|
||||
const gsdTools = path.join(__dirname, '..', 'gsd-core', 'bin', 'gsd-tools.cjs');
|
||||
const result = spawnSync(process.execPath, [gsdTools, 'query', 'init.todos'], {
|
||||
const msdTools = path.join(__dirname, '..', 'msd-core', 'bin', 'msd-tools.cjs');
|
||||
const result = spawnSync(process.execPath, [msdTools, 'query', 'init.todos'], {
|
||||
cwd,
|
||||
encoding: 'utf8',
|
||||
timeout: PROBE_TIMEOUT_MS,
|
||||
});
|
||||
assert.equal(result.status, 0, `gsd_run query init.todos failed: ${result.stderr}`);
|
||||
assert.equal(result.status, 0, `msd_run query init.todos failed: ${result.stderr}`);
|
||||
return JSON.parse(result.stdout);
|
||||
}
|
||||
|
||||
test('cmdInitTodos: pending_read_ok is true and pending_todos_markdown present for a healthy empty dir', (t) => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2618-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2618-'));
|
||||
t.after(() => cleanup(dir));
|
||||
fs.mkdirSync(path.join(dir, '.planning', 'todos', 'pending'), { recursive: true });
|
||||
|
||||
@@ -312,7 +312,7 @@ test('cmdInitTodos: pending_read_ok is true and pending_todos_markdown present f
|
||||
});
|
||||
|
||||
test('cmdInitTodos: real todo file produces a rendered bullet via the CLI', (t) => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2618-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2618-'));
|
||||
t.after(() => cleanup(dir));
|
||||
const pendingDir = path.join(dir, '.planning', 'todos', 'pending');
|
||||
fs.mkdirSync(pendingDir, { recursive: true });
|
||||
@@ -346,7 +346,7 @@ test('cmdInitTodos: real todo file produces a rendered bullet via the CLI', (t)
|
||||
// The Needs clause is asserted on the STRUCTURED field, not the rendered
|
||||
// bullet: the bullet embeds the todo file's ABSOLUTE path, so its total
|
||||
// length varies by runner tmpdir (macOS CI's /private/var/folders/… plus
|
||||
// the test harness's gsd-test-run-* wrapper pushed the full bullet past
|
||||
// the test harness's msd-test-run-* wrapper pushed the full bullet past
|
||||
// renderPendingTodoBullet's intended 240-char cap, whose documented first
|
||||
// degradation step is to drop the Needs clause — a correct product
|
||||
// behavior this test must not depend on the runner's path length for).
|
||||
@@ -358,7 +358,7 @@ test('cmdInitTodos: real todo file produces a rendered bullet via the CLI', (t)
|
||||
});
|
||||
|
||||
test('cmdInitTodos: needs clause survives a deterministically long base path (#4384 macOS shape)', (t) => {
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2618-long-'));
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2618-long-'));
|
||||
t.after(() => cleanup(root));
|
||||
// One long path segment: deterministic on every OS (no real macOS dependency).
|
||||
// Pre-fix, the absolute-link bullet exceeds 240 chars even on Linux /tmp,
|
||||
@@ -398,7 +398,7 @@ test('cmdInitTodos: needs clause survives a deterministically long base path (#4
|
||||
});
|
||||
|
||||
test('cmdInitTodos: bullet order is filename-sorted regardless of write/insertion order', (t) => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-2618-'));
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-2618-'));
|
||||
t.after(() => cleanup(dir));
|
||||
const pendingDir = path.join(dir, '.planning', 'todos', 'pending');
|
||||
fs.mkdirSync(pendingDir, { recursive: true });
|
||||
@@ -431,8 +431,8 @@ function extractUpdateStateStep(workflowPath) {
|
||||
}
|
||||
|
||||
test('workflow parity: add-todo.md and check-todos.md update_state steps are byte-identical', () => {
|
||||
const addTodoPath = path.join(__dirname, '..', 'gsd-core', 'workflows', 'add-todo.md');
|
||||
const checkTodosPath = path.join(__dirname, '..', 'gsd-core', 'workflows', 'check-todos.md');
|
||||
const addTodoPath = path.join(__dirname, '..', 'msd-core', 'workflows', 'add-todo.md');
|
||||
const checkTodosPath = path.join(__dirname, '..', 'msd-core', 'workflows', 'check-todos.md');
|
||||
const a = extractUpdateStateStep(addTodoPath);
|
||||
const b = extractUpdateStateStep(checkTodosPath);
|
||||
assert.equal(a, b, 'update_state step prose must be identical across both workflows (DEFECT.GENERATIVE-FIX)');
|
||||
|
||||
Reference in New Issue
Block a user