fix(voyage): inject plan_critic via Phase 9 readAndUpdate (906f155d)

This commit is contained in:
Kjell Tore Guttormsen 2026-05-10 21:03:54 +02:00
commit 5f26de2f0d
2 changed files with 62 additions and 0 deletions

View file

@ -625,3 +625,24 @@ test('docs/annotation-quickstart.md exists with ≤7 numbered steps and example-
`${path} must reference the canonical example fixture for hands-on verification`,
);
});
test('commands/trekplan.md Phase 9 documents plan_critic injection via readAndUpdate (906f155d)', () => {
// Phase 9 (adversarial review) writes the plan-critic verdict back into
// plan.md frontmatter AFTER plan-review-dedup completes. The inject must
// happen post-Phase-8 (write) because Phase 8 precedes Phase 9 in the
// pipeline — the value cannot be in Phase 8's frontmatter template.
// Both the field name (plan_critic) and the inject mechanism
// (readAndUpdate from lib/util/markdown-write.mjs) must be documented
// so future maintainers can trace the contract.
const text = read('commands/trekplan.md');
assert.match(
text,
/plan_critic/,
'commands/trekplan.md must document plan_critic frontmatter field (906f155d)',
);
assert.match(
text,
/readAndUpdate/,
'commands/trekplan.md must reference readAndUpdate from lib/util/markdown-write.mjs (906f155d)',
);
});