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:
@@ -3,7 +3,7 @@
|
||||
// text IS the artifact under test (the copies have no runtime binding).
|
||||
/**
|
||||
* Kimi guard-normalization parity test (#2304 / PR #2326 review Major 1;
|
||||
* extended by PR #2301 review Major 2 for hooks/gsd-write-guard.js).
|
||||
* extended by PR #2301 review Major 2 for hooks/msd-write-guard.js).
|
||||
*
|
||||
* The KIMI_TOOL_NAMES map + normalizeKimiPayload helper is deliberately
|
||||
* inlined per hook script (a sibling require is a staging dependency that
|
||||
@@ -20,7 +20,7 @@
|
||||
* convertKimiToolName without updating the guards fails HERE instead
|
||||
* of leaving a guard silently dormant (the #2304 failure mode).
|
||||
*
|
||||
* gsd-write-guard.js is bound SEMANTICALLY, not byte-wise: its copy
|
||||
* msd-write-guard.js is bound SEMANTICALLY, not byte-wise: its copy
|
||||
* intentionally omits the Edit-class mapping (the guard exits 0 for any
|
||||
* tool but Write, so StrReplaceFile/old_string handling there is dead code
|
||||
* — #2301 review Major 1), so its map is checked against the installer
|
||||
@@ -28,7 +28,7 @@
|
||||
* required to CARRY a block, so the copy cannot silently disappear.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -51,7 +51,7 @@ const ALL_BLOCK_FILES = fs
|
||||
.sort();
|
||||
|
||||
// Bound semantically (map-inverse + Write-dormancy), never byte-wise — see header.
|
||||
const WRITE_GUARD_FILE = 'hooks/gsd-write-guard.js';
|
||||
const WRITE_GUARD_FILE = 'hooks/msd-write-guard.js';
|
||||
|
||||
// The byte-identity cohort: every scanned guard except the deliberate subset.
|
||||
const HOOK_FILES = ALL_BLOCK_FILES.filter((f) => f !== WRITE_GUARD_FILE);
|
||||
@@ -60,18 +60,18 @@ const HOOK_FILES = ALL_BLOCK_FILES.filter((f) => f !== WRITE_GUARD_FILE);
|
||||
// broken scan, not a passing test — without this floor, an over-narrow filter
|
||||
// would "pass" by finding nothing to check.
|
||||
const KNOWN_NORMALIZED_GUARDS = [
|
||||
'hooks/gsd-prompt-guard.js',
|
||||
'hooks/gsd-read-guard.js',
|
||||
'hooks/gsd-read-injection-scanner.js',
|
||||
'hooks/gsd-secret-read-guard.js',
|
||||
'hooks/gsd-workflow-guard.js',
|
||||
'hooks/gsd-worktree-path-guard.js',
|
||||
'hooks/msd-prompt-guard.js',
|
||||
'hooks/msd-read-guard.js',
|
||||
'hooks/msd-read-injection-scanner.js',
|
||||
'hooks/msd-secret-read-guard.js',
|
||||
'hooks/msd-workflow-guard.js',
|
||||
'hooks/msd-worktree-path-guard.js',
|
||||
];
|
||||
|
||||
// Claude tool names whose PreToolUse/PostToolUse guards are registered with a
|
||||
// translated matcher on Kimi (runtime-hooks-surface.cts buildKimiHooksTomlBlock):
|
||||
// the write guards match WriteFile|StrReplaceFile, the injection scanner
|
||||
// matches ReadFile, and gsd-workflow-guard.js matches Shell|WriteFile|StrReplaceFile.
|
||||
// matches ReadFile, and msd-workflow-guard.js matches Shell|WriteFile|StrReplaceFile.
|
||||
const GUARD_RELEVANT_CLAUDE_TOOLS = ['Write', 'Edit', 'MultiEdit', 'Read', 'Bash'];
|
||||
|
||||
function extractBlock(file) {
|
||||
@@ -157,7 +157,7 @@ describe('Kimi guard normalization parity', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('gsd-write-guard.js maps the Kimi name for Write (its only inspected tool)', () => {
|
||||
test('msd-write-guard.js maps the Kimi name for Write (its only inspected tool)', () => {
|
||||
const map = parseMap(extractBlock(WRITE_GUARD_FILE));
|
||||
const modulePath = convertKimiToolName('Write');
|
||||
assert.ok(modulePath, "installer no longer maps 'Write' — update this test");
|
||||
@@ -177,7 +177,7 @@ describe('Kimi guard normalization parity', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// The two shell guards (gsd-graphify-update.sh, gsd-phase-boundary.sh) carry
|
||||
// The two shell guards (msd-graphify-update.sh, msd-phase-boundary.sh) carry
|
||||
// the same #2304 normalization reimplemented in shell — a byte-identity
|
||||
// assertion cannot span the JS↔shell boundary, so instead of faking one this
|
||||
// block pins the two vocabulary facts each script depends on to the
|
||||
@@ -189,27 +189,27 @@ describe('Kimi shell-guard vocabulary parity (#2304)', () => {
|
||||
const readHook = (file) =>
|
||||
fs.readFileSync(path.join(__dirname, '..', file), 'utf8');
|
||||
|
||||
test('gsd-graphify-update.sh maps the installer\'s Bash vocabulary back to Bash', () => {
|
||||
test('msd-graphify-update.sh maps the installer\'s Bash vocabulary back to Bash', () => {
|
||||
const modulePath = convertKimiToolName('Bash');
|
||||
assert.ok(modulePath, 'installer no longer maps Bash — update this test');
|
||||
const kimiName = modulePath.slice(modulePath.lastIndexOf(':') + 1);
|
||||
const src = readHook('hooks/gsd-graphify-update.sh');
|
||||
const src = readHook('hooks/msd-graphify-update.sh');
|
||||
assert.ok(
|
||||
src.includes('TOOL_NAME="${TOOL_NAME##*:}"'),
|
||||
'gsd-graphify-update.sh no longer strips the Kimi module-path prefix'
|
||||
'msd-graphify-update.sh no longer strips the Kimi module-path prefix'
|
||||
);
|
||||
assert.ok(
|
||||
src.includes(`[ "$TOOL_NAME" = "${kimiName}" ]`) && src.includes('TOOL_NAME="Bash"'),
|
||||
`gsd-graphify-update.sh no longer maps Kimi '${kimiName}' to Bash — ` +
|
||||
`msd-graphify-update.sh no longer maps Kimi '${kimiName}' to Bash — ` +
|
||||
'the hook is silently dormant on Kimi (#2304)'
|
||||
);
|
||||
});
|
||||
|
||||
test('gsd-phase-boundary.sh prefers Kimi\'s authoritative tool_input.path, falls back to file_path (#2752)', () => {
|
||||
const src = readHook('hooks/gsd-phase-boundary.sh');
|
||||
test('msd-phase-boundary.sh prefers Kimi\'s authoritative tool_input.path, falls back to file_path (#2752)', () => {
|
||||
const src = readHook('hooks/msd-phase-boundary.sh');
|
||||
assert.ok(
|
||||
src.includes('(typeof i.path===\'string\'&&i.path)||(typeof i.file_path===\'string\'&&i.file_path)||\'\''),
|
||||
'gsd-phase-boundary.sh no longer prefers tool_input.path over file_path — ' +
|
||||
'msd-phase-boundary.sh no longer prefers tool_input.path over file_path — ' +
|
||||
'path is the authoritative field (kimi-cli executes on it); a model-supplied ' +
|
||||
'decoy file_path must not suppress or fabricate a reminder (#2752, mirrors #2595)'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user