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:
Jakub Zych
2026-10-06 01:47:40 +02:00
parent fe069b2a56
commit a9a7a328e6
2763 changed files with 78465 additions and 78434 deletions

View File

@@ -9,7 +9,7 @@ const { test, describe, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const { runGsdTools, createTempDir, createTempProject, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempDir, createTempProject, cleanup } = require('./helpers.cjs');
// ─── scan-sessions ────────────────────────────────────────────────────────────
@@ -17,7 +17,7 @@ describe('scan-sessions command', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-profile-test-');
tmpDir = createTempDir('msd-profile-test-');
});
afterEach(() => {
@@ -27,7 +27,7 @@ describe('scan-sessions command', () => {
test('returns empty array for empty sessions directory', () => {
const sessionsDir = path.join(tmpDir, 'projects');
fs.mkdirSync(sessionsDir, { recursive: true });
const result = runGsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
const result = runMsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.ok(Array.isArray(out), 'should return an array');
@@ -46,7 +46,7 @@ describe('scan-sessions command', () => {
].join('\n');
fs.writeFileSync(path.join(projectDir, 'session-001.jsonl'), sessionData);
const result = runGsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
const result = runMsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.ok(Array.isArray(out), 'should return array');
@@ -64,7 +64,7 @@ describe('scan-sessions command', () => {
fs.writeFileSync(path.join(projectDir, `session-${i}.jsonl`), data + '\n');
}
const result = runGsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
const result = runMsdTools(['scan-sessions', '--path', sessionsDir, '--raw'], tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.strictEqual(out[0].sessionCount, 3);
@@ -78,7 +78,7 @@ describe('extract-messages command', () => {
let tmpDir;
beforeEach(() => {
tmpDir = createTempDir('gsd-profile-test-');
tmpDir = createTempDir('msd-profile-test-');
});
afterEach(() => {
@@ -101,7 +101,7 @@ describe('extract-messages command', () => {
messages.map(m => JSON.stringify(m)).join('\n')
);
const result = runGsdTools(['extract-messages', 'my-project', '--path', sessionsDir, '--raw'], tmpDir);
const result = runMsdTools(['extract-messages', 'my-project', '--path', sessionsDir, '--raw'], tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.strictEqual(out.messages_extracted, 2, 'should extract 2 genuine user messages');
@@ -127,7 +127,7 @@ describe('extract-messages command', () => {
messages.map(m => JSON.stringify(m)).join('\n')
);
const result = runGsdTools(['extract-messages', 'filter-test', '--path', sessionsDir, '--raw'], tmpDir);
const result = runMsdTools(['extract-messages', 'filter-test', '--path', sessionsDir, '--raw'], tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.strictEqual(out.messages_extracted, 2, 'should only extract 2 genuine external messages');
@@ -148,7 +148,7 @@ describe('profile-questionnaire command', () => {
});
test('returns questionnaire structure', () => {
const result = runGsdTools('profile-questionnaire --raw', tmpDir);
const result = runMsdTools('profile-questionnaire --raw', tmpDir);
assert.ok(result.success, `Failed: ${result.error}`);
const out = JSON.parse(result.output);
assert.ok(out.questions, 'should have questions array');
@@ -168,7 +168,7 @@ describe('profile-questionnaire command', () => {
'use strict';
/**
* Regression test for bug #866: profile-pipeline temp output dirs must be
* created under GSD_TEMP_DIR (path.join(os.tmpdir(), 'gsd')), not directly
* created under MSD_TEMP_DIR (path.join(os.tmpdir(), 'msd')), not directly
* under os.tmpdir() root where reapStaleTempFiles() never scans.
*
* Hardening (adversarial-review follow-up):
@@ -187,14 +187,14 @@ const { test, describe, beforeEach, afterEach } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('fs');
const path = require('path');
const { runGsdTools, createTempDir, cleanup } = require('./helpers.cjs');
const { runMsdTools, createTempDir, cleanup } = require('./helpers.cjs');
describe('bug-866: profile-pipeline temp dirs under GSD_TEMP_DIR', () => {
describe('bug-866: profile-pipeline temp dirs under MSD_TEMP_DIR', () => {
let tmpDir;
let isolatedSysTmp;
beforeEach(() => {
tmpDir = createTempDir('gsd-866-');
tmpDir = createTempDir('msd-866-');
// Create an isolated os.tmpdir() root inside the fixture so the child
// process never writes to the real shared temp dir.
isolatedSysTmp = path.join(tmpDir, 'systmp');
@@ -221,13 +221,13 @@ describe('bug-866: profile-pipeline temp dirs under GSD_TEMP_DIR', () => {
return sessionsDir;
}
test('extract-messages output_file is under GSD_TEMP_DIR, not os.tmpdir() root', () => {
test('extract-messages output_file is under MSD_TEMP_DIR, not os.tmpdir() root', () => {
const sessionsDir = createSessions(tmpDir);
// Pass the isolated tmp root so the child's os.tmpdir() = isolatedSysTmp.
// Belt-and-suspenders: set all three env vars Node checks (TMPDIR=POSIX,
// TEMP+TMP=Windows).
const result = runGsdTools(
const result = runMsdTools(
['extract-messages', 'test-project-866', '--path', sessionsDir, '--raw'],
tmpDir,
{ TMPDIR: isolatedSysTmp, TEMP: isolatedSysTmp, TMP: isolatedSysTmp }
@@ -242,36 +242,36 @@ describe('bug-866: profile-pipeline temp dirs under GSD_TEMP_DIR', () => {
const outputFile = out.output_file;
// The expected GSD_TEMP_DIR from the child's perspective: isolatedSysTmp/gsd
const expectedGsdTempDir = path.join(isolatedSysTmp, 'gsd');
// The expected MSD_TEMP_DIR from the child's perspective: isolatedSysTmp/msd
const expectedMsdTempDir = path.join(isolatedSysTmp, 'msd');
// Normalize both sides via realpath to kill macOS /var↔/private/var symlink
// flakiness. Realpath the existing output_file's parent directory (the file
// itself may have been cleaned up already, but the dir will exist).
const expectedRoot = fs.realpathSync(expectedGsdTempDir);
const expectedRoot = fs.realpathSync(expectedMsdTempDir);
const outputDir = path.dirname(outputFile);
// The output dir must exist since the tool just wrote there; realpath it.
const actualDir = fs.realpathSync(outputDir);
assert.ok(
actualDir.startsWith(expectedRoot + path.sep) || actualDir === expectedRoot,
`output_file "${outputFile}" must be under GSD_TEMP_DIR "${expectedGsdTempDir}" (realpath: ${expectedRoot}); got dir "${actualDir}"`
`output_file "${outputFile}" must be under MSD_TEMP_DIR "${expectedMsdTempDir}" (realpath: ${expectedRoot}); got dir "${actualDir}"`
);
// Must NOT be directly under the isolated systmp root (i.e., no gsd-pipeline-*
// Must NOT be directly under the isolated systmp root (i.e., no msd-pipeline-*
// at depth 1 of isolatedSysTmp).
const rel = path.relative(isolatedSysTmp, outputFile);
const depth1Dir = rel.split(path.sep)[0];
assert.ok(
!depth1Dir.startsWith('gsd-pipeline-'),
`output_file must not be in isolatedSysTmp/gsd-pipeline-* but got depth-1 dir: "${depth1Dir}"`
!depth1Dir.startsWith('msd-pipeline-'),
`output_file must not be in isolatedSysTmp/msd-pipeline-* but got depth-1 dir: "${depth1Dir}"`
);
});
test('profile-sample output_file is under GSD_TEMP_DIR, not os.tmpdir() root', () => {
test('profile-sample output_file is under MSD_TEMP_DIR, not os.tmpdir() root', () => {
const sessionsDir = createSessions(tmpDir);
const result = runGsdTools(
const result = runMsdTools(
['profile-sample', '--path', sessionsDir, '--raw'],
tmpDir,
{ TMPDIR: isolatedSysTmp, TEMP: isolatedSysTmp, TMP: isolatedSysTmp }
@@ -286,22 +286,22 @@ describe('bug-866: profile-pipeline temp dirs under GSD_TEMP_DIR', () => {
const outputFile = out.output_file;
const expectedGsdTempDir = path.join(isolatedSysTmp, 'gsd');
const expectedMsdTempDir = path.join(isolatedSysTmp, 'msd');
const expectedRoot = fs.realpathSync(expectedGsdTempDir);
const expectedRoot = fs.realpathSync(expectedMsdTempDir);
const outputDir = path.dirname(outputFile);
const actualDir = fs.realpathSync(outputDir);
assert.ok(
actualDir.startsWith(expectedRoot + path.sep) || actualDir === expectedRoot,
`output_file "${outputFile}" must be under GSD_TEMP_DIR "${expectedGsdTempDir}" (realpath: ${expectedRoot}); got dir "${actualDir}"`
`output_file "${outputFile}" must be under MSD_TEMP_DIR "${expectedMsdTempDir}" (realpath: ${expectedRoot}); got dir "${actualDir}"`
);
const rel = path.relative(isolatedSysTmp, outputFile);
const depth1Dir = rel.split(path.sep)[0];
assert.ok(
!depth1Dir.startsWith('gsd-profile-'),
`output_file must not be in isolatedSysTmp/gsd-profile-* but got depth-1 dir: "${depth1Dir}"`
!depth1Dir.startsWith('msd-profile-'),
`output_file must not be in isolatedSysTmp/msd-profile-* but got depth-1 dir: "${depth1Dir}"`
);
});
});