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:
@@ -4,7 +4,7 @@
|
||||
// Per CONTRIBUTING.md exception matrix.
|
||||
|
||||
/**
|
||||
* Tests for gsd-read-guard.js PreToolUse hook.
|
||||
* Tests for msd-read-guard.js PreToolUse hook.
|
||||
*
|
||||
* The read guard intercepts Write/Edit tool calls on existing files and injects
|
||||
* advisory guidance telling the model to Read the file first. This prevents
|
||||
@@ -15,7 +15,7 @@
|
||||
* The hook is advisory-only (does not block) so Claude Code behavior is unaffected.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -26,10 +26,10 @@ const { runHook: runHookSeam } = require('./helpers/process-seam.cjs');
|
||||
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'gsd-read-guard.js');
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'msd-read-guard.js');
|
||||
|
||||
// Bounds a single direct invocation of the advisory-only, no-subprocess
|
||||
// gsd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// msd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// (10000ms) despite a similar "no fan-out" class — kept as its own constant
|
||||
// since this migration never widens a bound without a fresh bench citation.
|
||||
const READ_GUARD_HOOK_TIMEOUT_MS = 5000;
|
||||
@@ -62,11 +62,11 @@ function runHook(payload, envOverrides = {}) {
|
||||
};
|
||||
}
|
||||
|
||||
describe('gsd-read-guard hook', () => {
|
||||
describe('msd-read-guard hook', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = createTempDir('gsd-read-guard-');
|
||||
tmpDir = createTempDir('msd-read-guard-');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -217,18 +217,18 @@ describe('gsd-read-guard hook', () => {
|
||||
const buildHooksPath = path.join(__dirname, '..', 'scripts', 'build-hooks.js');
|
||||
const content = fs.readFileSync(buildHooksPath, 'utf8');
|
||||
assert.ok(
|
||||
content.includes('gsd-read-guard.js'),
|
||||
'gsd-read-guard.js must be in HOOKS_TO_COPY so it ships in hooks/dist/'
|
||||
content.includes('msd-read-guard.js'),
|
||||
'msd-read-guard.js must be in HOOKS_TO_COPY so it ships in hooks/dist/'
|
||||
);
|
||||
});
|
||||
|
||||
test('hook is registered in install.js uninstall hook list', () => {
|
||||
// Check the actual exported uninstall hook list instead of grepping
|
||||
// install.js source text.
|
||||
const { GSD_UNINSTALL_HOOKS } = require('../bin/install.js');
|
||||
const { MSD_UNINSTALL_HOOKS } = require('../bin/install.js');
|
||||
assert.ok(
|
||||
GSD_UNINSTALL_HOOKS.includes('gsd-read-guard.js'),
|
||||
'gsd-read-guard.js must be in the uninstall GSD_UNINSTALL_HOOKS list'
|
||||
MSD_UNINSTALL_HOOKS.includes('msd-read-guard.js'),
|
||||
'msd-read-guard.js must be in the uninstall MSD_UNINSTALL_HOOKS list'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -268,7 +268,7 @@ describe('gsd-read-guard hook', () => {
|
||||
/**
|
||||
* Regression test for bug #2344
|
||||
*
|
||||
* gsd-read-guard.js checked process.env.CLAUDE_SESSION_ID to detect the
|
||||
* msd-read-guard.js checked process.env.CLAUDE_SESSION_ID to detect the
|
||||
* Claude Code runtime and skip its advisory. However, Claude Code CLI exports
|
||||
* CLAUDECODE=1, not CLAUDE_SESSION_ID. The skip never fired, so the
|
||||
* READ-BEFORE-EDIT advisory injected on every Edit/Write call inside Claude
|
||||
@@ -278,7 +278,7 @@ describe('gsd-read-guard hook', () => {
|
||||
* emitting the advisory.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -288,10 +288,10 @@ const { runHook: runHookSeam } = require('./helpers/process-seam.cjs');
|
||||
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'gsd-read-guard.js');
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'msd-read-guard.js');
|
||||
|
||||
// Bounds a single direct invocation of the advisory-only, no-subprocess
|
||||
// gsd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// msd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// (10000ms) despite a similar "no fan-out" class — kept as its own constant
|
||||
// since this migration never widens a bound without a fresh bench citation.
|
||||
const READ_GUARD_HOOK_TIMEOUT_MS = 5000;
|
||||
@@ -321,7 +321,7 @@ function runHook(payload, envOverrides = {}) {
|
||||
describe('bug #2344: read guard skips on CLAUDECODE env var', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => { tmpDir = createTempDir('gsd-read-guard-2344-'); });
|
||||
beforeEach(() => { tmpDir = createTempDir('msd-read-guard-2344-'); });
|
||||
afterEach(() => { cleanup(tmpDir); });
|
||||
|
||||
test('skips advisory when CLAUDECODE=1 is set (Claude Code CLI env)', () => {
|
||||
@@ -394,7 +394,7 @@ describe('bug #2344: read guard skips on CLAUDECODE env var', () => {
|
||||
* future-proofing.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe, beforeEach, afterEach } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -404,10 +404,10 @@ const { execFileSync } = require('node:child_process');
|
||||
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'gsd-read-guard.js');
|
||||
const HOOK_PATH = path.join(__dirname, '..', 'hooks', 'msd-read-guard.js');
|
||||
|
||||
// Bounds a single direct invocation of the advisory-only, no-subprocess
|
||||
// gsd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// msd-read-guard.js hook; tighter than the shared QUICK_SPAWN_TIMEOUT_MS norm
|
||||
// (10000ms) despite a similar "no fan-out" class — kept as its own constant
|
||||
// since this migration never widens a bound without a fresh bench citation.
|
||||
const READ_GUARD_HOOK_TIMEOUT_MS = 5000;
|
||||
@@ -454,7 +454,7 @@ function runHookInClaudeCodeSubprocess(payload, envOverrides = {}) {
|
||||
describe('bug #2520: read guard detects Claude Code without relying on CLAUDECODE env', () => {
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => { tmpDir = createTempDir('gsd-read-guard-2520-'); });
|
||||
beforeEach(() => { tmpDir = createTempDir('msd-read-guard-2520-'); });
|
||||
afterEach(() => { cleanup(tmpDir); });
|
||||
|
||||
test('skips advisory when stdin payload includes session_id (Claude Code hook-subprocess env)', () => {
|
||||
@@ -534,7 +534,7 @@ describe('#2304: Kimi tool vocabulary is normalized by the read guard', () => {
|
||||
// happens against the production shape.
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => { tmpDir = createTempDir('gsd-read-guard-2304-'); });
|
||||
beforeEach(() => { tmpDir = createTempDir('msd-read-guard-2304-'); });
|
||||
afterEach(() => { cleanup(tmpDir); });
|
||||
|
||||
test('WriteFile on an existing file injects read-first guidance like Write', () => {
|
||||
@@ -617,7 +617,7 @@ describe('#2547: read guard against the production Kimi payload shape', () => {
|
||||
// SUPPOSED to fail — update them then, rather than deleting the coverage.
|
||||
let tmpDir;
|
||||
|
||||
beforeEach(() => { tmpDir = createTempDir('gsd-read-guard-2547-'); });
|
||||
beforeEach(() => { tmpDir = createTempDir('msd-read-guard-2547-'); });
|
||||
afterEach(() => { cleanup(tmpDir); });
|
||||
|
||||
const LIVE_SESSION_ID = 'e7123e54-0977-45dd-848a-b9c8a45a5cd3';
|
||||
|
||||
Reference in New Issue
Block a user