fix(voyage): coerce brief_version to string + quote template + update doc pin (closes #8 #11)

v5.1.0 shipped with an unquoted brief_version: 2.1 in trekbrief-template.md.
parseScalar coerced it to Number 2.1, and the sequencing gate guarded on
typeof === 'string', silently bypassing BRIEF_V51_MISSING_SIGNALS.

Three-part atomic fix:
- brief-validator.mjs:87+149 now accepts both string and number forms via
  String(fm.brief_version) coercion.
- trekbrief-template.md quotes the value so new briefs parse as String.
- doc-consistency.test.mjs pins the QUOTED form going forward.

Three regression tests added in brief-validator.test.mjs.
This commit is contained in:
Kjell Tore Guttormsen 2026-05-14 21:36:10 +02:00
commit 4c85a2c22b
4 changed files with 44 additions and 8 deletions

View file

@ -554,10 +554,10 @@ test('operational files no longer reference trekrevise (v5.0.0 removal)', () =>
// --- v5.1 — phase_signals + brief_version 2.1 ---
test('v5.1 — templates/trekbrief-template.md declares brief_version: 2.1', () => {
test('v5.1 — templates/trekbrief-template.md declares brief_version: "2.1" (quoted)', () => {
const t = read('templates/trekbrief-template.md');
assert.match(t, /^brief_version: 2\.1$/m,
'trekbrief-template.md must declare brief_version: 2.1 at top of frontmatter');
assert.match(t, /^brief_version: "2\.1"$/m,
'trekbrief-template.md must declare brief_version: "2.1" (quoted) — unquoted parses as Number and bypasses sequencing gate');
});
test('v5.1 — templates/trekbrief-template.md contains phase_signals: block', () => {