refactor(simplify): one plan read in red proof, one list marker, one put-back rule [skip-docs]

/simplify over ed6699d..HEAD (closing review of the remediation):
- red-proof reads and parses the step once (planStep) for the test list and
  tests_only; normTest goes, plan-schema exports normPlanPath, also used by
  plan-scope-sweep.
- plan-schema builds LIST_ITEM and the 1.9 File: line from one LIST_MARKER;
  the below-1.9 File: regex ends in a lookahead instead of slicing back one.
- the workflow script hoists tripletOf and puts back through dedupByTriplet.
- coordinator-contract keeps the rank in its JSDoc only; engine-findings
  drops a redundant String().
- tests: reuse knownIssues, trekplan19Block, step1Fields, one red-proof cli
  helper with childEnv, one payload-pair builder; drop a test the decision-20
  definition test covers.

No behaviour change. Suite 2462 (2460/0/2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-13 19:47:08 +02:00
commit bcf3adbba7
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
11 changed files with 90 additions and 127 deletions

View file

@ -146,6 +146,14 @@ test('HANDOVER-CONTRACTS: the design-part line and invariant 5 say "1.8 or later
assert.ok(!bullet.includes('its `Test first:` file,'), 'invariant 7 no longer says "its `Test first:` file"');
});
const trekplan19Block = () => {
const p = read('commands/trekplan.md');
const h19 = p.indexOf('**plan_version 1.9 additions**');
assert.ok(h19 >= 0, 'commands/trekplan.md has the "**plan_version 1.9 additions**" block');
const end = p.indexOf('\n>\n> **', h19);
return p.slice(h19, end < 0 ? undefined : end);
};
test('/trekplan: the 1.8 additions heading says "1.8 or later", and a separate 1.9 additions block follows it', () => {
const p = read('commands/trekplan.md');
const h18 = p.indexOf('**plan_version 1.8 or later additions**');
@ -153,9 +161,7 @@ test('/trekplan: the 1.8 additions heading says "1.8 or later", and a separate 1
assert.ok(!p.includes('**plan_version 1.8 additions**'), 'the old 1.8-only heading is gone');
const h19 = p.indexOf('**plan_version 1.9 additions**');
assert.ok(h19 > h18, 'a separate "**plan_version 1.9 additions**" block stands after the 1.8 block');
const end = p.indexOf('\n>\n> **', h19);
const block = p.slice(h19, end < 0 ? undefined : end);
assert.ok(block.includes(ANNOTATION), `the 1.9 block says "${ANNOTATION}"`);
assert.ok(trekplan19Block().includes(ANNOTATION), `the 1.9 block says "${ANNOTATION}"`);
});
// Step 12: the docs follow the 1.9 fixes. Operator decision 20 (12.10): the
@ -181,14 +187,6 @@ const invariant7 = () => {
return h4.slice(m7.index, m8 ? m7.index + m8.index : undefined);
};
const trekplan19Block = () => {
const p = read('commands/trekplan.md');
const h19 = p.indexOf('**plan_version 1.9 additions**');
assert.ok(h19 >= 0, 'commands/trekplan.md has the "**plan_version 1.9 additions**" block');
const end = p.indexOf('\n>\n> **', h19);
return p.slice(h19, end < 0 ? undefined : end);
};
const template19Paragraph = () => {
const t = read('templates/plan-template.md');
const start = t.indexOf('From plan_version 1.9 the rule is the file first on every line');
@ -275,27 +273,7 @@ test('CHANGELOG: parseDoors reads the Unreleased section\'s door lines, none bad
`one door line names plan_version 1.9: ${JSON.stringify(d.entries.map((e) => e.text))}`);
});
test('CHANGELOG: the Unreleased section\'s Known issues name the session split', () => {
const { heading, body } = firstChangelogSection();
assert.equal(heading, UNRELEASED);
const lines = body.split('\n');
const start = lines.findIndex((l) => /^### Known issues\s*$/.test(l));
assert.ok(start >= 0, 'the Unreleased section has a "### Known issues" heading');
let end = lines.length;
for (let i = start + 1; i < lines.length; i++) {
if (/^###? /.test(lines[i])) { end = i; break; }
}
const known = lines.slice(start + 1, end).join('\n');
assert.match(known, /session split/, `Known issues name the session split: ${JSON.stringify(known)}`);
});
// Step 14 of the remediation: the CHANGELOG records the review fixes. The door
// line for the Test first files names operator decision 20 (the backticked paths
// right after File:), the workflow put-back names operator decision 23, the
// engine-provenance entry states the tier rank instead of "on a severity tie",
// Known issues name the default path's verdict gate (operator decision 25), and
// the intro's measurement names the remediation's Step 13 commit. Word
// boundaries keep "operator decision 2026-10-12" from counting as decision 20.
// The Unreleased section's `### Known issues` body, up to the next heading.
const knownIssues = (body) => {
const lines = body.split('\n');
const start = lines.findIndex((l) => /^### Known issues\s*$/.test(l));
@ -307,6 +285,20 @@ const knownIssues = (body) => {
return lines.slice(start + 1, end).join('\n');
};
test('CHANGELOG: the Unreleased section\'s Known issues name the session split', () => {
const { heading, body } = firstChangelogSection();
assert.equal(heading, UNRELEASED);
const known = knownIssues(body);
assert.match(known, /session split/, `Known issues name the session split: ${JSON.stringify(known)}`);
});
// Step 14 of the remediation: the CHANGELOG records the review fixes. The door
// line for the Test first files names operator decision 20 (the backticked paths
// right after File:), the workflow put-back names operator decision 23, the
// engine-provenance entry states the tier rank instead of "on a severity tie",
// Known issues name the default path's verdict gate (operator decision 25), and
// the intro's measurement names the remediation's Step 13 commit. Word
// boundaries keep "operator decision 2026-10-12" from counting as decision 20.
test('CHANGELOG: the door lines name operator decisions 20 and 23, and none says "every test file on the Test first File line"', () => {
const { heading, body } = firstChangelogSection();
assert.equal(heading, UNRELEASED);