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:
@@ -25,8 +25,8 @@ const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const { createTempProject, cleanup, runGsdTools, toPosixPath } = require('./helpers.cjs');
|
||||
const planningWorkspace = require('../gsd-core/bin/lib/planning-workspace.cjs');
|
||||
const { createTempProject, cleanup, runMsdTools, toPosixPath } = require('./helpers.cjs');
|
||||
const planningWorkspace = require('../msd-core/bin/lib/planning-workspace.cjs');
|
||||
|
||||
const TODO_A = '2026-09-01-one.md';
|
||||
const TODO_B = '2026-09-02-two.md';
|
||||
@@ -49,19 +49,19 @@ function seedWorkstreamDir(tmpDir, ws) {
|
||||
}
|
||||
|
||||
function queryJson(args, cwd, env = {}) {
|
||||
const r = runGsdTools(args, cwd, env);
|
||||
assert.ok(r.success, `gsd-tools ${args.join(' ')} failed: ${r.error}`);
|
||||
const r = runMsdTools(args, cwd, env);
|
||||
assert.ok(r.success, `msd-tools ${args.join(' ')} failed: ${r.error}`);
|
||||
return JSON.parse(r.output);
|
||||
}
|
||||
|
||||
describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
test('init.todos counts root todos with GSD_WORKSTREAM set (regression)', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-initws-');
|
||||
test('init.todos counts root todos with MSD_WORKSTREAM set (regression)', (t) => {
|
||||
const tmpDir = createTempProject('msd-4256-initws-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
|
||||
assert.equal(out.todo_count, 2, `root todos must be visible under a workstream; got ${out.todo_count}`);
|
||||
assert.ok(
|
||||
@@ -81,7 +81,7 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('init.todos counts root todos via explicit --ws flag', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-initflag-');
|
||||
const tmpDir = createTempProject('msd-4256-initflag-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
@@ -96,12 +96,12 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('list-todos returns root todos under a workstream', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-listws-');
|
||||
const tmpDir = createTempProject('msd-4256-listws-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['query', 'list-todos'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'list-todos'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
|
||||
assert.equal(out.count, 2, `list-todos must see root todos under a workstream; got ${out.count}`);
|
||||
const files = out.todos.map((x) => x.file).sort();
|
||||
@@ -113,23 +113,23 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('todo match-phase sees the root todo set under a workstream', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-matchws-');
|
||||
const tmpDir = createTempProject('msd-4256-matchws-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['query', 'todo', 'match-phase', '1', '--raw'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'todo', 'match-phase', '1', '--raw'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
|
||||
assert.equal(out.todo_count, 2, `match-phase must scan the root todo set; got ${out.todo_count}`);
|
||||
});
|
||||
|
||||
test('todo complete moves the ROOT file pending -> completed under a workstream', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-complete-');
|
||||
const tmpDir = createTempProject('msd-4256-complete-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['query', 'todo', 'complete', TODO_A], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'todo', 'complete', TODO_A], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
assert.equal(out.completed, true);
|
||||
|
||||
const rootPending = path.join(tmpDir, '.planning', 'todos', 'pending', TODO_A);
|
||||
@@ -145,12 +145,12 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('todo complete --dry-run finds the root todo and mutates nothing (#4096 fence intact)', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-dryrun-');
|
||||
const tmpDir = createTempProject('msd-4256-dryrun-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['query', 'todo', 'complete', TODO_A, '--dry-run'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'todo', 'complete', TODO_A, '--dry-run'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
|
||||
assert.equal(out.dry_run, true);
|
||||
assert.equal(out.would_complete, true);
|
||||
@@ -174,12 +174,12 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('audit-open counts root pending todos under a workstream — the close gate FAILS', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-gate-');
|
||||
const tmpDir = createTempProject('msd-4256-gate-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const out = queryJson(['audit-open', '--json'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['audit-open', '--json'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
|
||||
assert.equal(out.counts.todos, 2, `the close gate must count the root todos; got ${out.counts.todos}`);
|
||||
assert.equal(out.has_open_items, true, 'pending root todos must block the milestone close');
|
||||
@@ -188,11 +188,11 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
});
|
||||
|
||||
test('audit acknowledge writes the marker into the ROOT todo under a workstream (boundary moved)', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-ack-');
|
||||
const tmpDir = createTempProject('msd-4256-ack-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
const env = { GSD_WORKSTREAM: 'feature-a' };
|
||||
const env = { MSD_WORKSTREAM: 'feature-a' };
|
||||
|
||||
const ack = queryJson(
|
||||
['audit-open', 'acknowledge', '--category', 'todos', '--milestone', 'v1.0', '--filename', TODO_A],
|
||||
@@ -214,7 +214,7 @@ describe('#4256: todos readers resolve the root under a workstream', () => {
|
||||
|
||||
describe('#4256: negative space — flat, project, and boundary scopes', () => {
|
||||
test('flat mode (no workstream) counts are unchanged', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-flat-');
|
||||
const tmpDir = createTempProject('msd-4256-flat-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
|
||||
@@ -226,24 +226,24 @@ describe('#4256: negative space — flat, project, and boundary scopes', () => {
|
||||
assert.equal(audit.counts.todos, 2);
|
||||
});
|
||||
|
||||
test('GSD_PROJECT mode also reads the cwd-relative root todos dir', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-project-');
|
||||
test('MSD_PROJECT mode also reads the cwd-relative root todos dir', (t) => {
|
||||
const tmpDir = createTempProject('msd-4256-project-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
|
||||
// Workflow writers use the literal cwd-relative `.planning/todos/...`, so
|
||||
// under a project scope the files live at the planning ROOT, not under
|
||||
// `.planning/<project>/todos/` — the reader must converge on the root.
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { GSD_PROJECT: 'myapp' });
|
||||
assert.equal(out.todo_count, 2, `root todos must be visible under GSD_PROJECT; got ${out.todo_count}`);
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { MSD_PROJECT: 'myapp' });
|
||||
assert.equal(out.todo_count, 2, `root todos must be visible under MSD_PROJECT; got ${out.todo_count}`);
|
||||
assert.ok(
|
||||
toPosixPath(out.pending_dir).endsWith('.planning/todos/pending'),
|
||||
`pending_dir must stay at the root under GSD_PROJECT, got ${out.pending_dir}`,
|
||||
`pending_dir must stay at the root under MSD_PROJECT, got ${out.pending_dir}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('legacy per-workstream symlink workaround becomes inert — count stays correct', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-symlink-');
|
||||
const tmpDir = createTempProject('msd-4256-symlink-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedRootTodos(tmpDir);
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
@@ -259,23 +259,23 @@ describe('#4256: negative space — flat, project, and boundary scopes', () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const out = queryJson(['query', 'init.todos', '--raw'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
assert.equal(out.todo_count, 2, `count must stay exact with the workaround symlink present; got ${out.todo_count}`);
|
||||
});
|
||||
|
||||
test('fresh project with no todos dir under a workstream is a legitimate zero', (t) => {
|
||||
const tmpDir = createTempProject('gsd-4256-empty-');
|
||||
const tmpDir = createTempProject('msd-4256-empty-');
|
||||
t.after(() => cleanup(tmpDir));
|
||||
seedWorkstreamDir(tmpDir, 'feature-a');
|
||||
|
||||
const init = queryJson(['query', 'init.todos', '--raw'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const init = queryJson(['query', 'init.todos', '--raw'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
assert.equal(init.todo_count, 0);
|
||||
assert.equal(init.pending_dir_exists, false);
|
||||
|
||||
const list = queryJson(['query', 'list-todos'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const list = queryJson(['query', 'list-todos'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
assert.equal(list.count, 0);
|
||||
|
||||
const audit = queryJson(['audit-open', '--json'], tmpDir, { GSD_WORKSTREAM: 'feature-a' });
|
||||
const audit = queryJson(['audit-open', '--json'], tmpDir, { MSD_WORKSTREAM: 'feature-a' });
|
||||
assert.equal(audit.counts.todos, 0);
|
||||
});
|
||||
});
|
||||
@@ -287,12 +287,12 @@ describe('#4256: todosDir resolver owns the path (planning-workspace)', () => {
|
||||
assert.equal(todosDirFrom(path.join('/fake', 'planning')), path.join('/fake', 'planning', 'todos'));
|
||||
});
|
||||
|
||||
test('todosDir(cwd) is root-scoped — GSD_WORKSTREAM does not move it', (t) => {
|
||||
const saved = process.env.GSD_WORKSTREAM;
|
||||
process.env.GSD_WORKSTREAM = 'feature-a';
|
||||
test('todosDir(cwd) is root-scoped — MSD_WORKSTREAM does not move it', (t) => {
|
||||
const saved = process.env.MSD_WORKSTREAM;
|
||||
process.env.MSD_WORKSTREAM = 'feature-a';
|
||||
t.after(() => {
|
||||
if (saved === undefined) delete process.env.GSD_WORKSTREAM;
|
||||
else process.env.GSD_WORKSTREAM = saved;
|
||||
if (saved === undefined) delete process.env.MSD_WORKSTREAM;
|
||||
else process.env.MSD_WORKSTREAM = saved;
|
||||
});
|
||||
|
||||
assert.equal(todosDir('/fake/repo'), path.join('/fake', 'repo', '.planning', 'todos'));
|
||||
@@ -300,8 +300,8 @@ describe('#4256: todosDir resolver owns the path (planning-workspace)', () => {
|
||||
});
|
||||
|
||||
test('planningPaths keeps workstream keys scoped while todos stays root-scoped', () => {
|
||||
const saved = process.env.GSD_WORKSTREAM;
|
||||
delete process.env.GSD_WORKSTREAM;
|
||||
const saved = process.env.MSD_WORKSTREAM;
|
||||
delete process.env.MSD_WORKSTREAM;
|
||||
try {
|
||||
const paths = planningPaths('/fake/repo', 'feature-x');
|
||||
assert.ok(toPosixPath(paths.planning).endsWith('.planning/workstreams/feature-x'));
|
||||
@@ -312,7 +312,7 @@ describe('#4256: todosDir resolver owns the path (planning-workspace)', () => {
|
||||
`planningPaths().todos must be deliberately root-scoped, got ${paths.todos}`,
|
||||
);
|
||||
} finally {
|
||||
if (saved !== undefined) process.env.GSD_WORKSTREAM = saved;
|
||||
if (saved !== undefined) process.env.MSD_WORKSTREAM = saved;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user