feat(voyage): S6 — v5.5 brief framing enforcement (brief_version 2.2)
Implements the CLAUDE.md cross-cutting invariant "brief framing must match operator intent" as a controlled brief_version 2.1->2.2 bump (operator option A1). Three defense layers, version-gated at >=2.2 so existing 2.0/2.1 briefs stay valid (forward + backward compatible), mirroring the phase_signals >=2.1 gate: - L1 framing: enum field (preserve|refine|replace|new-direction). Enum-checked on any version when present (BRIEF_INVALID_FRAMING); missing at >=2.2 -> BRIEF_MISSING_FRAMING. /trekbrief Phase 2.5 collects it BEFORE any brief prose (non-skippable, even in --quick). - L2 memory alignment: new brief-reviewer dimension 6 comparing brief Intent/Goal + framing against operator memory for explicit contradictions; degrades to score 5 (N/A) when no memory context is supplied. Wired into Phase 4e gate (memory_alignment.score >= 4). - L3 obligatory ## TL;DR (<=5 content lines) at >=2.2; soft cap -> BRIEF_TLDR_TOO_LONG warning. trekreview briefs are exempt from the framing/TL;DR gate. Handover 1 PUBLIC CONTRACT doc, README "What's new", and the CLAUDE.md invariant + agents table (brief-reviewer 5->6 dimensions) updated to 2.2 (schema axis only; plugin version badge + CHANGELOG remain S10). Iron Law followed: validator tests red->green first. Tests 586 -> 606 (+20, 604 pass / 2 skip). claude plugin validate passes (pre-existing CLAUDE.md root-context warning unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LqBYc8Ltrk7LipyJmGxXiB
This commit is contained in:
parent
fa23b16443
commit
736ae55d66
10 changed files with 409 additions and 31 deletions
|
|
@ -559,10 +559,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" (quoted)', () => {
|
||||
test('v5.5 — templates/trekbrief-template.md declares brief_version: "2.2" (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" (quoted) — unquoted parses as Number and bypasses sequencing gate');
|
||||
assert.match(t, /^brief_version: "2\.2"$/m,
|
||||
'trekbrief-template.md must declare brief_version: "2.2" (quoted) — unquoted parses as Number and bypasses sequencing gate; v5.5 bumped 2.1→2.2 for framing enforcement');
|
||||
});
|
||||
|
||||
test('v5.1 — templates/trekbrief-template.md contains phase_signals: block', () => {
|
||||
|
|
@ -641,18 +641,53 @@ test('v5.4 — Handover 1 declares the PUBLIC CONTRACT callout + breaking-for-do
|
|||
'the callout must state that a brief-schema change is a breaking change for every downstream consumer');
|
||||
});
|
||||
|
||||
test('v5.4 — brief_version 2.1 is the frozen public-contract baseline (no stale 2.0)', () => {
|
||||
test('v5.5 — brief_version 2.2 is current in the public-contract schema table (no stale 2.0/2.1)', () => {
|
||||
const t = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(!t.includes('`"2.0"` (current)'),
|
||||
'Handover 1 schema table must not still mark brief_version "2.0" as current (stale)');
|
||||
assert.ok(t.includes('`"2.1"` (current)'),
|
||||
'Handover 1 schema table must mark brief_version "2.1" as current');
|
||||
assert.ok(!t.includes('`"2.1"` (current)'),
|
||||
'Handover 1 schema table must not still mark brief_version "2.1" as current (stale — v5.5 bumped to 2.2)');
|
||||
assert.ok(t.includes('`"2.2"` (current)'),
|
||||
'Handover 1 schema table must mark brief_version "2.2" as current');
|
||||
});
|
||||
|
||||
test('v5.4 — phase_signals stays optional: v5.4 freezes, does not promote to required', () => {
|
||||
test('v5.4 — phase_signals stays optional: not promoted to required', () => {
|
||||
const t = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(!t.includes('v5.4 may promote'),
|
||||
'the speculative "v5.4 may promote phase_signals to required" line must be resolved (S3 froze the shape)');
|
||||
assert.ok(t.includes('freezes this schema as the public-contract baseline'),
|
||||
'the Versioning note must record that v5.4 freezes the schema as the public-contract baseline');
|
||||
assert.ok(t.includes('froze `2.1` as the public-contract baseline'),
|
||||
'the Versioning note must record that v5.4 froze 2.1 as the public-contract baseline');
|
||||
});
|
||||
|
||||
// --- v5.5 — framing enforcement: brief_version 2.2 (Handover 1 contract evolution) ---
|
||||
// S6: the framing-alignment invariant (CLAUDE.md) ships as a controlled brief_version
|
||||
// bump 2.1→2.2 adding two required-at-2.2 elements (framing field + ## TL;DR section),
|
||||
// version-gated so 2.0/2.1 briefs stay valid. These pin the contract-doc evolution.
|
||||
|
||||
test('v5.5 — Handover 1 schema table adds the framing field row', () => {
|
||||
const t = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(t.includes('| `framing` |'),
|
||||
'HANDOVER-CONTRACTS must add a framing row to the Handover 1 schema table');
|
||||
assert.ok(t.includes('preserve \\| refine \\| replace \\| new-direction'),
|
||||
'the framing row must list the four canonical enum values');
|
||||
});
|
||||
|
||||
test('v5.5 — Handover 1 documents the framing gate + required-at-2.2 TL;DR section', () => {
|
||||
const t = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(t.includes('v5.5 framing gate'),
|
||||
'validation-strategy table must add a v5.5 framing gate row');
|
||||
assert.ok(/##\s*TL;DR.*required at `brief_version ≥ 2\.2`/.test(t) || t.includes('`## TL;DR` — **required at `brief_version ≥ 2.2`**'),
|
||||
'body-invariants must mark ## TL;DR as required at brief_version ≥ 2.2');
|
||||
});
|
||||
|
||||
test('v5.5 — Versioning note records the 2.2 framing-enforcement evolution', () => {
|
||||
const t = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(t.includes('v5.5 → `2.2` (framing enforcement)'),
|
||||
'the Versioning note must document the v5.5 → 2.2 framing-enforcement evolution');
|
||||
});
|
||||
|
||||
test('v5.5 — voyage README.md mentions framing enforcement / brief_version 2.2', () => {
|
||||
const t = read('README.md');
|
||||
assert.ok(t.includes('framing') && t.includes('brief_version 2.2'),
|
||||
'voyage README.md must carry a "What\'s new" note for framing enforcement (brief_version 2.2)');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue