docs(voyage): harmonize fan-out hedge + add banned-phrase guard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-06-20 21:35:40 +02:00
commit fd0e5775eb
2 changed files with 47 additions and 1 deletions

View file

@ -1220,3 +1220,49 @@ test('S33: the analysis doc records the D1D3 resolved forks (considered-and-k
// reader sees the downgrade was reconsidered-and-declined, not overlooked.
assert.ok(/40d8742/.test(t), 'decision record must cite the model-pin commit 40d8742 (D3 kept firm, document-only)');
});
// ── S38 — fan-out hedge harmonization + relief-assertion forward-guard (SC d) ──
//
// The brief's SC(d) premise — an unhedged "fan-out relieves main context" string
// present in ~23 files awaiting a removal diff — is factually false: plan-time
// enumeration shows the unhedged set is ∅. Every live relief mention is already
// hedged (the sole one is CLAUDE.md:5, hedged since S18), and the
// docs/T2-bakeoff-results.md "frees the main context" lines are a DIFFERENT, true
// background-execution claim (must NOT be touched). SC(d) therefore ships as:
// (1) one surgical harmonization at CLAUDE.md:5 making the replacement phrase
// "parallel wall-clock" grep-positive (the Δ≈0 / "not yet demonstrated"
// qualifier kept intact), and
// (2) this durable forward-guard — a PRECISE relief-assertion matcher (verb-of-
// relief + main-context, NOT a bare "main context" grep that would false-fail
// benign locatives like "runs inline in main context") scoped to product-
// facing docs, requiring an adjacent hedge token on any match.
// Fix the SOURCE prose (add the hedge / drop the claim), never this test.
test('S38: CLAUDE.md carries the harmonized fan-out phrase "parallel wall-clock" (SC d)', () => {
assert.ok(
read('CLAUDE.md').includes('parallel wall-clock'),
'CLAUDE.md:5 must state the replacement phrase "parallel wall-clock + structured artifact handoffs" (SC d harmonization)',
);
});
test('S38: forward-guard — no product-facing doc asserts main-context relief unhedged (SC d)', () => {
// Banned form: a verb of relief adjacent to "main context" (or "main-context …
// relief"), NOT a plain locative ("runs in main context"). Decision/research
// records (docs/*) are append-only history and out of scope by design.
const RELIEF = /(relieve|relieves|relieving|free|frees|offload|offloads)\b[^.\n]{0,40}\bmain[-\s]context\b|\bmain[-\s]context\b[^.\n]{0,20}\brelief\b|swarm\s+relieves\s+context/i;
const HEDGE = /Δ|not measured|asserted-by-design|not yet demonstrated|not demonstrated/i;
const productFacing = ['README.md', 'CLAUDE.md', ...listMd('commands').map((f) => `commands/${f}`)];
const offenders = [];
for (const rel of productFacing) {
read(rel).split('\n').forEach((ln, i) => {
if (RELIEF.test(ln) && !HEDGE.test(ln)) offenders.push(`${rel}:${i + 1} ${ln.trim().slice(0, 100)}`);
});
}
assert.equal(
offenders.length,
0,
'Unhedged main-context-relief assertion(s) in product-facing docs — add an adjacent hedge ' +
'(Δ / "not measured" / "asserted-by-design" / "not yet demonstrated") or drop the claim:\n' +
offenders.join('\n'),
);
});