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:
@@ -2,14 +2,14 @@
|
||||
|
||||
/**
|
||||
* Behavioral tests for research-store, research-plan, and package-legitimacy
|
||||
* CLI commands (gsd-tools dispatch layer).
|
||||
* CLI commands (msd-tools dispatch layer).
|
||||
*
|
||||
* Conventions:
|
||||
* - Uses runGsdTools from tests/helpers.cjs (no source-grep)
|
||||
* - Uses runMsdTools from tests/helpers.cjs (no source-grep)
|
||||
* - No wall-clock assertions (RULESET.TESTS.no-timing-assertion)
|
||||
* - No network calls (package-legitimacy tests are arg-validation only)
|
||||
* - Each test gets a fresh temp dir via fs.mkdtempSync
|
||||
* - HOME is overridden via runGsdTools env param to sandbox ~/.gsd/ writes
|
||||
* - HOME is overridden via runMsdTools env param to sandbox ~/.msd/ writes
|
||||
*/
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
@@ -18,13 +18,13 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const os = require('node:os');
|
||||
|
||||
const { runGsdTools, cleanup } = require('./helpers.cjs');
|
||||
const { runMsdTools, cleanup } = require('./helpers.cjs');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helper: make a temp dir and return it (caller is responsible for cleanup)
|
||||
// ---------------------------------------------------------------------------
|
||||
function makeTempDir() {
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-research-test-'));
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'msd-research-test-'));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -40,7 +40,7 @@ describe('research-store: put then get round-trip', () => {
|
||||
const key = '4642afa8420709e0902413b46e2f26806499a5df710b602c22a5344f0eb298d0';
|
||||
|
||||
// PUT
|
||||
const putResult = runGsdTools(
|
||||
const putResult = runMsdTools(
|
||||
[
|
||||
'research-store', 'put', key,
|
||||
'--content', 'hello docs',
|
||||
@@ -58,7 +58,7 @@ describe('research-store: put then get round-trip', () => {
|
||||
assert.equal(entry.kind, 'docs', 'put: entry.kind mismatch');
|
||||
|
||||
// GET
|
||||
const getResult = runGsdTools(
|
||||
const getResult = runMsdTools(
|
||||
['research-store', 'get', key, '--kind', 'docs'],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -85,7 +85,7 @@ describe('research-store: get on unknown key', () => {
|
||||
try {
|
||||
// Must be a valid 64-char sha256 hex string — but nothing seeded under this key.
|
||||
const noSuchKey = '5620aa17b85cb82f1d82633c8cfb4799d3e947f58a1775248c96bbeeeb8f8537';
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-store', 'get', noSuchKey, '--kind', 'docs'],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -109,7 +109,7 @@ describe('research-plan: cache hit via pre-seeded store', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
// Compute the key the CLI will use for this question
|
||||
const researchStore = require('../gsd-core/bin/lib/research-store.cjs');
|
||||
const researchStore = require('../msd-core/bin/lib/research-store.cjs');
|
||||
const key = researchStore.researchKey({
|
||||
ecosystem: 'npm',
|
||||
library: '',
|
||||
@@ -118,7 +118,7 @@ describe('research-plan: cache hit via pre-seeded store', () => {
|
||||
kind: 'docs',
|
||||
});
|
||||
|
||||
// Seed the cache directly, passing homeDir so it writes into tmpDir/.gsd/
|
||||
// Seed the cache directly, passing homeDir so it writes into tmpDir/.msd/
|
||||
researchStore.putResearch(
|
||||
tmpDir,
|
||||
key,
|
||||
@@ -144,7 +144,7 @@ describe('research-plan: cache hit via pre-seeded store', () => {
|
||||
);
|
||||
|
||||
// Run research-plan with HOME overridden so the CLI reads from the same cache
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-plan', '--input', inputFile],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -181,7 +181,7 @@ describe('research-plan: fetch plan for unseeded question', () => {
|
||||
}),
|
||||
);
|
||||
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-plan', '--input', inputFile],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -212,7 +212,7 @@ describe('classify-confidence: context7 without --verified', () => {
|
||||
test('returns confidence MEDIUM and verified false', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['query', 'classify-confidence', '--provider', 'context7'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -235,7 +235,7 @@ describe('classify-confidence: exa without --verified', () => {
|
||||
test('returns confidence LOW', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['query', 'classify-confidence', '--provider', 'exa'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -257,7 +257,7 @@ describe('classify-confidence: exa with --verified', () => {
|
||||
test('returns confidence MEDIUM and verified true', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['query', 'classify-confidence', '--provider', 'exa', '--verified'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -279,7 +279,7 @@ describe('classify-confidence: missing --provider -> usage error', () => {
|
||||
test('exits non-zero and reports usage error when --provider is absent', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['query', 'classify-confidence'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -299,7 +299,7 @@ describe('package-legitimacy: missing --ecosystem -> usage error', () => {
|
||||
test('exits non-zero and reports usage error when --ecosystem is absent', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['package-legitimacy', 'check', 'somepackage'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -319,7 +319,7 @@ describe('research-store CLI: traversal/invalid key rejected with usage error',
|
||||
test('put ../../x --content ... → non-zero exit (usage error)', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
[
|
||||
'research-store', 'put', '../../x',
|
||||
'--content', 'evil',
|
||||
@@ -341,7 +341,7 @@ describe('research-store CLI: traversal/invalid key rejected with usage error',
|
||||
test('get ../../etc/passwd → non-zero exit (usage error)', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-store', 'get', '../../etc/passwd'],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -355,9 +355,9 @@ describe('research-store CLI: traversal/invalid key rejected with usage error',
|
||||
test('put with valid 64-hex key → success', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const researchStore = require('../gsd-core/bin/lib/research-store.cjs');
|
||||
const researchStore = require('../msd-core/bin/lib/research-store.cjs');
|
||||
const validKey = researchStore.researchKey({ ecosystem: 'npm', library: 'lodash', version: '4.0.0', query: 'chunk', kind: 'docs' });
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
[
|
||||
'research-store', 'put', validKey,
|
||||
'--content', 'test content',
|
||||
@@ -385,7 +385,7 @@ describe('FINDING-1: package-legitimacy check flag parser correctness', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
// --unknown-flag is not a valid flag; should produce a usage error, not silently skip
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['package-legitimacy', 'check', '--ecosystem', 'npm', '--unknown-flag', 'somevalue', 'mypkg'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -410,10 +410,10 @@ describe('FINDING-1: package-legitimacy check flag parser correctness', () => {
|
||||
// the CLI would exit 0 (pkgB remains as the sole package) and result.success
|
||||
// would be true — the assertions below would both FAIL.
|
||||
//
|
||||
// Green proof: the current parser (gsd-tools.cjs lines 1951-1952) hits
|
||||
// Green proof: the current parser (msd-tools.cjs lines 1951-1952) hits
|
||||
// if (a.startsWith('--')) { error(`package-legitimacy: unknown flag ${a}`, ...) }
|
||||
// which writes to stderr and exits 1.
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['package-legitimacy', 'check', '--ecosystem', 'npm', '--bad-flag', 'pkgA', 'pkgB'],
|
||||
tmpDir,
|
||||
);
|
||||
@@ -449,7 +449,7 @@ describe('FINDING-3: research-plan --input null/invalid → clean usage error, n
|
||||
try {
|
||||
const inputFile = path.join(tmpDir, 'null-input.json');
|
||||
fs.writeFileSync(inputFile, 'null');
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-plan', '--input', inputFile],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -472,7 +472,7 @@ describe('FINDING-3: research-plan --input null/invalid → clean usage error, n
|
||||
try {
|
||||
const inputFile = path.join(tmpDir, 'questions-null.json');
|
||||
fs.writeFileSync(inputFile, JSON.stringify({ questions: null }));
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-plan', '--input', inputFile],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -489,7 +489,7 @@ describe('FINDING-3: research-plan --input null/invalid → clean usage error, n
|
||||
try {
|
||||
const inputFile = path.join(tmpDir, 'questions-string.json');
|
||||
fs.writeFileSync(inputFile, JSON.stringify({ questions: 'x' }));
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
['research-plan', '--input', inputFile],
|
||||
tmpDir,
|
||||
{ HOME: tmpDir },
|
||||
@@ -510,9 +510,9 @@ describe('FINDING-4: research-store put rejects flag-as-value', () => {
|
||||
test('--content --source curated → usage error (--source is consumed as content value)', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const researchStore = require('../gsd-core/bin/lib/research-store.cjs');
|
||||
const researchStore = require('../msd-core/bin/lib/research-store.cjs');
|
||||
const validKey = researchStore.researchKey({ ecosystem: 'npm', library: 'z', version: '1', query: 'q', kind: 'docs' });
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
[
|
||||
'research-store', 'put', validKey,
|
||||
'--content', '--source', // --source starts with --, should be rejected as value for --content
|
||||
@@ -534,9 +534,9 @@ describe('FINDING-4: research-store put rejects flag-as-value', () => {
|
||||
test('well-formed put still succeeds (positive regression guard)', () => {
|
||||
const tmpDir = makeTempDir();
|
||||
try {
|
||||
const researchStore = require('../gsd-core/bin/lib/research-store.cjs');
|
||||
const researchStore = require('../msd-core/bin/lib/research-store.cjs');
|
||||
const validKey = researchStore.researchKey({ ecosystem: 'npm', library: 'lodash', version: '4', query: 'merge', kind: 'docs' });
|
||||
const result = runGsdTools(
|
||||
const result = runMsdTools(
|
||||
[
|
||||
'research-store', 'put', validKey,
|
||||
'--content', 'real content',
|
||||
|
||||
Reference in New Issue
Block a user