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:
@@ -9,7 +9,7 @@
|
||||
* tests/compact-content-partition-guard.test.cjs — ADR-4139 Decision 5, epic #4139,
|
||||
* Phase 3 #4403. This is the general-purpose CI guard PARTITION-RULES.md describes: it
|
||||
* implements the five checks against every `<name>/detail/*.md` split registered under
|
||||
* `gsd-core/workflows/`, and supersedes the one-off `tests/plan-phase-compact-split.test.cjs`
|
||||
* `msd-core/workflows/`, and supersedes the one-off `tests/plan-phase-compact-split.test.cjs`
|
||||
* pilot (deleted by this same change).
|
||||
*
|
||||
* See `docs/PARTITION-RULES.md` for the operational spec — it is the source of truth for
|
||||
@@ -81,13 +81,13 @@ function computeMergeBaseSha(baseRef) {
|
||||
return /^[0-9a-f]{40}$/.test(sha) ? sha : null;
|
||||
}
|
||||
|
||||
/** `git diff --name-status <mergeBaseSha>...HEAD -- gsd-core/workflows`, parsed into
|
||||
/** `git diff --name-status <mergeBaseSha>...HEAD -- msd-core/workflows`, parsed into
|
||||
* `{status, path}` rows (`path` is always the CURRENT path — the second field of an
|
||||
* `R###\told\tnew` rename row, or the single field of every other status). `null` on
|
||||
* any git failure (ambient guard). */
|
||||
function diffNameStatusForWorkflows(mergeBaseSha) {
|
||||
const result = runGit(
|
||||
[...safeDirArgs(REPO_ROOT), 'diff', '--name-status', `${mergeBaseSha}...HEAD`, '--', 'gsd-core/workflows'],
|
||||
[...safeDirArgs(REPO_ROOT), 'diff', '--name-status', `${mergeBaseSha}...HEAD`, '--', 'msd-core/workflows'],
|
||||
{ cwd: REPO_ROOT, timeoutMs: GIT_TIMEOUT_MS },
|
||||
);
|
||||
if (result.outcome !== OUTCOME.EXITED || result.exitCode !== 0) return null;
|
||||
@@ -154,7 +154,7 @@ function allNonBlankLines(content) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check 4 (protected content): every line inside a `<!-- gsd:protected -->` sentinel at
|
||||
* Check 4 (protected content): every line inside a `<!-- msd:protected -->` sentinel at
|
||||
* the OLD spine must still be physically present in the NEW spine. A missing line that
|
||||
* now appears in one of the spine's detail parts is reported as `protected_relocated`
|
||||
* (named destination); any other missing line is `protected_deleted`. No trailer can ever
|
||||
@@ -267,7 +267,7 @@ function runPrDiffScopedChecks() {
|
||||
const newlySplitNames = new Set();
|
||||
for (const { status, path: p } of diff) {
|
||||
if (status !== 'A') continue;
|
||||
const m = /^gsd-core\/workflows\/([^/]+)\/detail\/[^/]+\.md$/.exec(p);
|
||||
const m = /^msd-core\/workflows\/([^/]+)\/detail\/[^/]+\.md$/.exec(p);
|
||||
if (m) newlySplitNames.add(m[1]);
|
||||
}
|
||||
for (const name of newlySplitNames) {
|
||||
@@ -293,7 +293,7 @@ function runPrDiffScopedChecks() {
|
||||
// is brand new relative to that base, which is check 1's domain alone. This also
|
||||
// makes checks 4/5 robust to a base ref that resolves further back than expected (a
|
||||
// known class of gotcha `resolveBase()`'s own doc comment describes — no `origin/*`
|
||||
// remote-tracking refs inside the gsd-test sandbox): a stale/older base makes an
|
||||
// remote-tracking refs inside the msd-test sandbox): a stale/older base makes an
|
||||
// already-merged, already-reviewed split look "newly introduced" from that base's
|
||||
// vantage point, and retroactively demanding a Boundary-Move-Declared trailer for a
|
||||
// split that predates the trailer mechanism's own existence is exactly the false
|
||||
@@ -388,13 +388,13 @@ describe('compact-content partition guard — real repo state (ADR-4139 Decision
|
||||
assert.strictEqual(matches.length, 1, `expected exactly one reference to compact-content-gate.md, found ${matches.length}`);
|
||||
});
|
||||
|
||||
test('every registered spine has no malformed gsd:protected sentinel', () => {
|
||||
test('every registered spine has no malformed msd:protected sentinel', () => {
|
||||
const splits = discoverRegisteredSplits().filter((s) => s.spineExists);
|
||||
for (const split of splits) {
|
||||
const { malformed } = extractProtectedBlocks(fs.readFileSync(split.spinePath, 'utf8'));
|
||||
assert.deepStrictEqual(
|
||||
malformed, [],
|
||||
`${split.spinePath} has malformed gsd:protected sentinel(s): ${JSON.stringify(malformed, null, 2)}`,
|
||||
`${split.spinePath} has malformed msd:protected sentinel(s): ${JSON.stringify(malformed, null, 2)}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -410,13 +410,13 @@ describe('compact-content partition guard — real repo state (ADR-4139 Decision
|
||||
assert.ok(single.length >= 2, `expected at least 2 single-line protected markers, found ${single.length}`);
|
||||
|
||||
// Output-format contracts:
|
||||
assert.match(spine, /<!-- gsd:protected:start -->\s*<quality_gate>/, 'quality_gate output-format contract must be protected');
|
||||
assert.match(spine, /<!-- gsd:protected:start -->\s*<success_criteria>/, 'success_criteria output-format contract must be protected');
|
||||
assert.match(spine, /<!-- gsd:protected:start -->\s*<downstream_consumer>/, 'downstream_consumer output-format contract must be protected');
|
||||
assert.match(spine, /<!-- msd:protected:start -->\s*<quality_gate>/, 'quality_gate output-format contract must be protected');
|
||||
assert.match(spine, /<!-- msd:protected:start -->\s*<success_criteria>/, 'success_criteria output-format contract must be protected');
|
||||
assert.match(spine, /<!-- msd:protected:start -->\s*<downstream_consumer>/, 'downstream_consumer output-format contract must be protected');
|
||||
// Few-shot example the workflow's own steps depend on:
|
||||
assert.match(spine, /<!-- gsd:protected:start -->\s*<failing_direction_contract>/, 'failing_direction_contract few-shot example must be protected');
|
||||
assert.match(spine, /<!-- msd:protected:start -->\s*<failing_direction_contract>/, 'failing_direction_contract few-shot example must be protected');
|
||||
// Negative instruction / guardrail:
|
||||
const guardrailCount = (spine.match(/<!-- gsd:protected -->\s*> \*\*ORCHESTRATOR RULE[^]*?Never call `ScheduleWakeup`/g) || []).length;
|
||||
const guardrailCount = (spine.match(/<!-- msd:protected -->\s*> \*\*ORCHESTRATOR RULE[^]*?Never call `ScheduleWakeup`/g) || []).length;
|
||||
assert.strictEqual(guardrailCount, 2, `expected 2 protected ScheduleWakeup guardrail paragraphs, found ${guardrailCount}`);
|
||||
});
|
||||
});
|
||||
@@ -451,12 +451,12 @@ describe('failing-first fixture: check 1 (completeness)', () => {
|
||||
|
||||
describe('failing-first fixture: check 2 (disjointness)', () => {
|
||||
test('RED — a non-trivial line appears in both the spine and a detail part', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-disjoint-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-disjoint-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'dup', 'detail'), { recursive: true });
|
||||
const duplicatedLine = 'This exact sentence must never appear twice across the split.';
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup.md'), `Spine intro.\n\n${duplicatedLine}\n\ngsd-core/workflows/dup/detail/part.md\n`);
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup.md'), `Spine intro.\n\n${duplicatedLine}\n\nmsd-core/workflows/dup/detail/part.md\n`);
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup', 'detail', 'part.md'), `Detail intro.\n\n${duplicatedLine}\n`);
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir).filter((s) => s.spineExists);
|
||||
@@ -472,11 +472,11 @@ describe('failing-first fixture: check 2 (disjointness)', () => {
|
||||
});
|
||||
|
||||
test('GREEN — the same line, rewritten distinctly on each side, is disjoint', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-disjoint-ok-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-disjoint-ok-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'dup', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup.md'), 'Spine intro.\n\nSpine-only sentence.\n\ngsd-core/workflows/dup/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup.md'), 'Spine intro.\n\nSpine-only sentence.\n\nmsd-core/workflows/dup/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'dup', 'detail', 'part.md'), 'Detail intro.\n\nDetail-only sentence.\n');
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir).filter((s) => s.spineExists);
|
||||
@@ -490,9 +490,9 @@ describe('failing-first fixture: check 2 (disjointness)', () => {
|
||||
|
||||
describe('failing-first fixture: check 3 (registration)', () => {
|
||||
test('RED — a detail/*.md exists with no matching spine (orphan)', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-orphan-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-orphan-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'orphan', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'orphan', 'detail', 'part.md'), 'Orphaned detail content.\n');
|
||||
|
||||
@@ -509,14 +509,14 @@ describe('failing-first fixture: check 3 (registration)', () => {
|
||||
});
|
||||
|
||||
test('GREEN — a spine is added that references the detail part by its full repo-relative path', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-orphan-ok-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-orphan-ok-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'orphan', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'orphan', 'detail', 'part.md'), 'Orphaned detail content.\n');
|
||||
fs.writeFileSync(
|
||||
path.join(workflowsDir, 'orphan.md'),
|
||||
'Spine intro.\n\nSee gsd-core/workflows/orphan/detail/part.md for elaboration.\n',
|
||||
'Spine intro.\n\nSee msd-core/workflows/orphan/detail/part.md for elaboration.\n',
|
||||
);
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir);
|
||||
@@ -528,11 +528,11 @@ describe('failing-first fixture: check 3 (registration)', () => {
|
||||
});
|
||||
|
||||
test('RED (size cap) — a new detail file at or over NEW_FILE_CAP', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-sizecap-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-sizecap-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'big', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\ngsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\nmsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big', 'detail', 'part.md'), 'x'.repeat(NEW_FILE_CAP));
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir).filter((s) => s.spineExists);
|
||||
@@ -548,11 +548,11 @@ describe('failing-first fixture: check 3 (registration)', () => {
|
||||
});
|
||||
|
||||
test('GREEN (size cap) — the same detail file kept just under NEW_FILE_CAP', () => {
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-sizecap-ok-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-sizecap-ok-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'big', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\ngsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\nmsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big', 'detail', 'part.md'), 'x'.repeat(NEW_FILE_CAP - 1));
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir).filter((s) => s.spineExists);
|
||||
@@ -568,11 +568,11 @@ describe('failing-first fixture: check 3 (registration)', () => {
|
||||
// The two tests above already cover limit-1 (GREEN) and limit exactly (RED,
|
||||
// ">= NEW_FILE_CAP" boundary); this is the third point, proving the cap does
|
||||
// not silently stop firing past its own threshold.
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-sizecap-over-'));
|
||||
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-sizecap-over-'));
|
||||
try {
|
||||
const workflowsDir = path.join(tmpRoot, 'gsd-core', 'workflows');
|
||||
const workflowsDir = path.join(tmpRoot, 'msd-core', 'workflows');
|
||||
fs.mkdirSync(path.join(workflowsDir, 'big', 'detail'), { recursive: true });
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\ngsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big.md'), 'Spine.\n\nmsd-core/workflows/big/detail/part.md\n');
|
||||
fs.writeFileSync(path.join(workflowsDir, 'big', 'detail', 'part.md'), 'x'.repeat(NEW_FILE_CAP + 1));
|
||||
|
||||
const splits = discoverRegisteredSplits(workflowsDir).filter((s) => s.spineExists);
|
||||
@@ -590,7 +590,7 @@ describe('failing-first fixture: check 3 (registration)', () => {
|
||||
|
||||
describe('failing-first fixture: check 4 (protected content)', () => {
|
||||
const oldSpineWithProtection =
|
||||
'Intro.\n\n<!-- gsd:protected -->\n> Never do the dangerous thing.\n\nMiddle prose.\n';
|
||||
'Intro.\n\n<!-- msd:protected -->\n> Never do the dangerous thing.\n\nMiddle prose.\n';
|
||||
|
||||
test('RED — a protected line is deleted from the spine entirely', () => {
|
||||
const newSpineContent = 'Intro.\n\nMiddle prose.\n';
|
||||
@@ -609,7 +609,7 @@ describe('failing-first fixture: check 4 (protected content)', () => {
|
||||
test('RED (relocated) — a protected line moved into a detail part is reported distinctly, not merely "deleted"', () => {
|
||||
const newSpineContent = 'Intro.\n\nMiddle prose.\n';
|
||||
const detailPathToContent = new Map([
|
||||
['gsd-core/workflows/broken/detail/part.md', 'Detail intro.\n\n> Never do the dangerous thing.\n'],
|
||||
['msd-core/workflows/broken/detail/part.md', 'Detail intro.\n\n> Never do the dangerous thing.\n'],
|
||||
]);
|
||||
const violations = checkProtectedContentForPair({
|
||||
splitName: 'broken-split',
|
||||
@@ -620,11 +620,11 @@ describe('failing-first fixture: check 4 (protected content)', () => {
|
||||
const v = violations.find((x) => x.line === '> Never do the dangerous thing.');
|
||||
assert.ok(v, `expected the relocated protected line to be named: ${JSON.stringify(violations)}`);
|
||||
assert.strictEqual(v.kind, 'protected_relocated');
|
||||
assert.strictEqual(v.relocatedTo, 'gsd-core/workflows/broken/detail/part.md');
|
||||
assert.strictEqual(v.relocatedTo, 'msd-core/workflows/broken/detail/part.md');
|
||||
});
|
||||
|
||||
test('GREEN — the protected line is still physically present in the spine', () => {
|
||||
const newSpineContent = 'Intro.\n\n<!-- gsd:protected -->\n> Never do the dangerous thing.\n\nMiddle prose.\n';
|
||||
const newSpineContent = 'Intro.\n\n<!-- msd:protected -->\n> Never do the dangerous thing.\n\nMiddle prose.\n';
|
||||
const violations = checkProtectedContentForPair({
|
||||
splitName: 'fixed-split',
|
||||
oldSpineContent: oldSpineWithProtection,
|
||||
@@ -652,7 +652,7 @@ describe('failing-first fixture: check 5 (boundary moves declared)', () => {
|
||||
/** Commit from a message written to a file (never `-m`), so a trailer block lands where
|
||||
* git's own trailer parser expects it — same reasoning as emitted-ack-trailer.test.cjs. */
|
||||
function commitMessage(dir, message) {
|
||||
const msgFile = path.join(os.tmpdir(), `gsd-partition-guard-msg-${crypto.randomBytes(6).toString('hex')}.txt`);
|
||||
const msgFile = path.join(os.tmpdir(), `msd-partition-guard-msg-${crypto.randomBytes(6).toString('hex')}.txt`);
|
||||
fs.writeFileSync(msgFile, message);
|
||||
try {
|
||||
gitOrThrow(['add', '-A'], { cwd: dir, timeoutMs: GIT_FIXTURE_TIMEOUT_MS });
|
||||
@@ -666,10 +666,10 @@ describe('failing-first fixture: check 5 (boundary moves declared)', () => {
|
||||
return gitOrThrow(['rev-parse', 'HEAD'], { cwd: dir, timeoutMs: GIT_FIXTURE_TIMEOUT_MS }).trim();
|
||||
}
|
||||
|
||||
const SPINE_KEY = 'gsd-core/workflows/spine.md'; // the trailer key our fixture declares against
|
||||
const SPINE_KEY = 'msd-core/workflows/spine.md'; // the trailer key our fixture declares against
|
||||
|
||||
test('RED — a line moved from spine to detail with no Boundary-Move-Declared trailer', (t) => {
|
||||
const dir = makeTempRepo('gsd-partition-boundary-red-');
|
||||
const dir = makeTempRepo('msd-partition-boundary-red-');
|
||||
t.after(() => cleanup(dir));
|
||||
|
||||
fs.writeFileSync(path.join(dir, 'spine.md'), 'Line A.\n\nOrdinary line that will move.\n\nLine C.\n');
|
||||
@@ -707,7 +707,7 @@ describe('failing-first fixture: check 5 (boundary moves declared)', () => {
|
||||
});
|
||||
|
||||
test('GREEN — the same move, with a Boundary-Move-Declared trailer naming the spine', (t) => {
|
||||
const dir = makeTempRepo('gsd-partition-boundary-green-');
|
||||
const dir = makeTempRepo('msd-partition-boundary-green-');
|
||||
t.after(() => cleanup(dir));
|
||||
|
||||
fs.writeFileSync(path.join(dir, 'spine.md'), 'Line A.\n\nOrdinary line that will move.\n\nLine C.\n');
|
||||
@@ -744,7 +744,7 @@ describe('failing-first fixture: check 5 (boundary moves declared)', () => {
|
||||
});
|
||||
|
||||
test('uncomputable range still throws through checkBoundaryMovesForSplit (never silently passes)', (t) => {
|
||||
const origin = makeTempRepo('gsd-partition-boundary-origin-');
|
||||
const origin = makeTempRepo('msd-partition-boundary-origin-');
|
||||
t.after(() => cleanup(origin));
|
||||
fs.writeFileSync(path.join(origin, 'spine.md'), 'Line A.\n\nOrdinary line that will move.\n');
|
||||
commitMessage(origin, 'origin A\n\nfirst commit\n');
|
||||
@@ -752,7 +752,7 @@ describe('failing-first fixture: check 5 (boundary moves declared)', () => {
|
||||
fs.writeFileSync(path.join(origin, 'spine.md'), 'Line A.\n\nOrdinary line that will move.\n\nLine B.\n');
|
||||
commitMessage(origin, 'origin B\n\nsecond commit\n');
|
||||
|
||||
const clone = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-partition-boundary-clone-'));
|
||||
const clone = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-partition-boundary-clone-'));
|
||||
t.after(() => cleanup(clone));
|
||||
gitOrThrow(['clone', '-q', '--depth', '1', `file://${origin}`, clone], { cwd: origin, timeoutMs: GIT_FIXTURE_TIMEOUT_MS });
|
||||
|
||||
@@ -820,12 +820,12 @@ describe('property: compact-content-split.cjs parsers', () => {
|
||||
// early terminator inside what is meant to be one continuous protected span.
|
||||
const bodyLineArb = fc.array(fc.constantFrom(...'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,'.split('')), { minLength: 1, maxLength: 30 })
|
||||
.map((chars) => chars.join('').trim())
|
||||
.filter((s) => s.length > 0 && !s.includes('gsd:protected'));
|
||||
.filter((s) => s.length > 0 && !s.includes('msd:protected'));
|
||||
|
||||
test('prop: any well-formed <!-- gsd:protected:start/end --> span round-trips through extractProtectedBlocks with zero malformed entries', () => {
|
||||
test('prop: any well-formed <!-- msd:protected:start/end --> span round-trips through extractProtectedBlocks with zero malformed entries', () => {
|
||||
fc.assert(
|
||||
fc.property(fc.array(bodyLineArb, { minLength: 1, maxLength: 8 }), (lines) => {
|
||||
const content = ['Intro prose.', '', '<!-- gsd:protected:start -->', ...lines, '<!-- gsd:protected:end -->', '', 'Closing prose.'].join('\n');
|
||||
const content = ['Intro prose.', '', '<!-- msd:protected:start -->', ...lines, '<!-- msd:protected:end -->', '', 'Closing prose.'].join('\n');
|
||||
const { blocks, malformed } = extractProtectedBlocks(content);
|
||||
assert.deepStrictEqual(malformed, []);
|
||||
const paired = blocks.filter((b) => b.kind === 'paired');
|
||||
|
||||
Reference in New Issue
Block a user