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,15 +2,15 @@
|
||||
/**
|
||||
* lint-command-contract.cjs (ADR-0002)
|
||||
*
|
||||
* Enforces the commands/gsd/*.md contract across all 65 command files:
|
||||
* Enforces the commands/msd/*.md contract across all 65 command files:
|
||||
*
|
||||
* 1. name: present, non-empty, matches gsd: or gsd- prefix
|
||||
* 1. name: present, non-empty, matches msd: or msd- prefix
|
||||
* 2. description: present, non-empty
|
||||
* 3. allowed-tools: block present, non-empty, all entries from CANONICAL_TOOLS
|
||||
* 4. execution_context @-refs: every @-reference resolves to an existing file on disk
|
||||
* 5. execution_context @-refs: each appears on its own line (no trailing prose)
|
||||
* 6. every gsd-core/workflows/*.md file is reachable from at least one
|
||||
* commands/agents/skills loader, transitively through gsd-core/**
|
||||
* 6. every msd-core/workflows/*.md file is reachable from at least one
|
||||
* commands/agents/skills loader, transitively through msd-core/**
|
||||
* (repo-level check, runs once — not per command file)
|
||||
*
|
||||
* Exit 0 = clean. Exit 1 = violations (with diagnostics).
|
||||
@@ -32,8 +32,8 @@ function resolveRoot(argv) {
|
||||
}
|
||||
|
||||
const ROOT = resolveRoot(process.argv.slice(2));
|
||||
const COMMANDS_DIR = path.join(ROOT, 'commands', 'gsd');
|
||||
const GSD_ROOT = path.join(ROOT, 'gsd-core');
|
||||
const COMMANDS_DIR = path.join(ROOT, 'commands', 'msd');
|
||||
const MSD_ROOT = path.join(ROOT, 'msd-core');
|
||||
|
||||
const {
|
||||
CANONICAL_TOOLS,
|
||||
@@ -64,8 +64,8 @@ function walkMarkdownFiles(dir, acc) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
function toGsdRelative(absPath) {
|
||||
return path.relative(GSD_ROOT, absPath).split(path.sep).join('/');
|
||||
function toMsdRelative(absPath) {
|
||||
return path.relative(MSD_ROOT, absPath).split(path.sep).join('/');
|
||||
}
|
||||
|
||||
function checkWorkflowReachability() {
|
||||
@@ -76,16 +76,16 @@ function checkWorkflowReachability() {
|
||||
];
|
||||
const loaderContents = loaderFiles.map(f => fs.readFileSync(f, 'utf-8'));
|
||||
|
||||
const gsdFileAbsPaths = walkMarkdownFiles(GSD_ROOT, []);
|
||||
const gsdFiles = new Map();
|
||||
for (const abs of gsdFileAbsPaths) {
|
||||
gsdFiles.set(toGsdRelative(abs), fs.readFileSync(abs, 'utf-8'));
|
||||
const msdFileAbsPaths = walkMarkdownFiles(MSD_ROOT, []);
|
||||
const msdFiles = new Map();
|
||||
for (const abs of msdFileAbsPaths) {
|
||||
msdFiles.set(toMsdRelative(abs), fs.readFileSync(abs, 'utf-8'));
|
||||
}
|
||||
|
||||
const workflowAbsPaths = walkMarkdownFiles(path.join(GSD_ROOT, 'workflows'), []);
|
||||
const workflowPaths = workflowAbsPaths.map(toGsdRelative);
|
||||
const workflowAbsPaths = walkMarkdownFiles(path.join(MSD_ROOT, 'workflows'), []);
|
||||
const workflowPaths = workflowAbsPaths.map(toMsdRelative);
|
||||
|
||||
const unreachable = unreachableWorkflows(loaderContents, gsdFiles, workflowPaths);
|
||||
const unreachable = unreachableWorkflows(loaderContents, msdFiles, workflowPaths);
|
||||
|
||||
return { workflowCount: workflowPaths.length, unreachable };
|
||||
}
|
||||
@@ -98,11 +98,11 @@ function check(filePath) {
|
||||
const fm = parseFrontmatter(content);
|
||||
const violations = [];
|
||||
|
||||
// 1. name: present + gsd: / gsd- prefix
|
||||
// 1. name: present + msd: / msd- prefix
|
||||
if (!fm.name || !fm.name.trim()) {
|
||||
violations.push('name: field missing or empty');
|
||||
} else if (!/^gsd[:-]/.test(fm.name.trim())) {
|
||||
violations.push(`name: must start with "gsd:" or "gsd-", got "${fm.name.trim()}"`);
|
||||
} else if (!/^msd[:-]/.test(fm.name.trim())) {
|
||||
violations.push(`name: must start with "msd:" or "msd-", got "${fm.name.trim()}"`);
|
||||
}
|
||||
|
||||
// 2. description: present + non-empty
|
||||
@@ -126,7 +126,7 @@ function check(filePath) {
|
||||
// 4+5. execution_context @-refs resolve + no trailing prose
|
||||
const refs = extractExecutionContextRefs(content);
|
||||
for (const { token, normalized, trailingProse } of refs) {
|
||||
const absPath = path.join(GSD_ROOT, normalized);
|
||||
const absPath = path.join(MSD_ROOT, normalized);
|
||||
if (!fs.existsSync(absPath)) {
|
||||
violations.push(`execution_context: @-ref "${normalized}" does not exist on disk`);
|
||||
}
|
||||
@@ -182,7 +182,7 @@ function main() {
|
||||
`\nERROR lint-command-contract: ${unreachable.length} unreachable workflow file(s) of ${workflowCount}\n\n`,
|
||||
);
|
||||
for (const p of unreachable) {
|
||||
process.stderr.write(` gsd-core/${p}\n`);
|
||||
process.stderr.write(` msd-core/${p}\n`);
|
||||
}
|
||||
process.stderr.write(
|
||||
'\nEach file above ships to every runtime but is never referenced by any command,\n' +
|
||||
|
||||
Reference in New Issue
Block a user