feat(voyage): S18 — framing-hardening (min-version gate + memory status + pre-2.2 doc + flagship hedge)
Closes devils-advocate audit #4–#6 (MAJOR×MED). Four additive, non-breaking changes to the v5.5 framing-alignment machinery: 1. --min-brief-version <ver> gate (audit #4). Opt-in version floor on /trekplan + /trekresearch, forwarded to brief-validator as --min-version. New opts.minBriefVersion warns BRIEF_VERSION_BELOW_MINIMUM (never blocks) when a brief declares a version below the floor; trekreview exempt; absent opt = no check. CLI shim parses --min-version and skips its value token in filePath detection. 2. memory_alignment.status field (audit #5). brief-reviewer now emits status: verified | n_a | contradictions so a score-5 N/A (no memory) is distinguishable from a score-5 verified-aligned brief — the score≥4 gate passes in both, status reveals whether the wrong-premise defense ran. 3. Document pre-2.2 = zero framing enforcement (audit #4). HANDOVER-CONTRACTS §Handover 1 now states the producer-elective hole + two remedies. Also fixes a stale "current is 2.1" line (current is 2.2). 4. Soften flagship overselling (audit #6). CLAUDE.md Context-Engineering principle now hedges that main-context relief is asserted-by-design, not measured (T1 PoC found Δ≈0); README carried no false claim to fix. TDD: 8 new tests written failing-first (5 validator, 1 trekbrief status pin, 2 doc-consistency cross-file pins). Suite 691→699 (697 pass / 2 skip / 0 fail). No flagship prose-pin added (deliberate, per S19 anti-bloat). 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
eb5a7324a4
commit
987e847ea1
11 changed files with 145 additions and 13 deletions
|
|
@ -147,6 +147,12 @@ test('trekbrief — v5.5 brief-reviewer declares the memory-alignment dimension'
|
|||
'brief-reviewer must define the no-memory-context N/A fallback');
|
||||
});
|
||||
|
||||
test('trekbrief — S18 brief-reviewer memory_alignment carries a status field', () => {
|
||||
const reviewer = readFileSync(REVIEWER_FILE, 'utf8');
|
||||
assert.ok(reviewer.includes('"status": "verified | n_a | contradictions"'),
|
||||
'memory_alignment must emit a status enum (verified | n_a | contradictions) so a score-5 N/A (no memory) is distinguishable from a score-5 verified-aligned brief');
|
||||
});
|
||||
|
||||
test('trekbrief — v5.5 template carries framing field, 2.2, and TL;DR section', () => {
|
||||
const tpl = readFileSync(TEMPLATE_FILE, 'utf8');
|
||||
assert.ok(/brief_version: "2\.2"/.test(tpl), 'template must declare brief_version 2.2');
|
||||
|
|
|
|||
|
|
@ -869,3 +869,30 @@ test('S17: NW2 bake-off verdict is not labeled unqualified POSITIVE (raw data un
|
|||
'T2-bakeoff-results.md must disclose the raw per-run data is un-archived / un-reproducible.',
|
||||
);
|
||||
});
|
||||
|
||||
// ── S18: framing-hardening cross-file invariants ───────────────────────────
|
||||
|
||||
test('S18: --min-brief-version is documented at the trekplan + trekresearch boundary', () => {
|
||||
// The opt-in version floor must be discoverable wherever flags live: both
|
||||
// consuming commands and the central flag reference.
|
||||
for (const f of ['commands/trekplan.md', 'commands/trekresearch.md', 'docs/command-modes.md']) {
|
||||
assert.ok(
|
||||
read(f).includes('--min-brief-version'),
|
||||
`${f} must document the --min-brief-version flag (S18 framing-hardening)`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('S18: HANDOVER-CONTRACTS documents the pre-2.2 zero-framing-enforcement hole', () => {
|
||||
// The framing defense is producer-elective: a brief declaring ≤ 2.1 sidesteps
|
||||
// it entirely. Handover 1 (PUBLIC CONTRACT) must disclose this and name the remedy.
|
||||
const h = read('docs/HANDOVER-CONTRACTS.md');
|
||||
assert.ok(
|
||||
/BRIEF_VERSION_BELOW_MINIMUM/.test(h),
|
||||
'HANDOVER-CONTRACTS.md must name the BRIEF_VERSION_BELOW_MINIMUM gate as the pre-2.2 remedy',
|
||||
);
|
||||
assert.ok(
|
||||
/zero framing enforcement|no framing enforcement|sidestep/i.test(h),
|
||||
'HANDOVER-CONTRACTS.md must state that pre-2.2 briefs receive zero framing enforcement',
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -358,3 +358,38 @@ test('validateBrief — v5.5 trekreview brief not subject to framing/TL;DR gate'
|
|||
assert.ok(!r.errors.find(e => e.code === 'BRIEF_MISSING_FRAMING'));
|
||||
assert.ok(!r.errors.find(e => e.code === 'BRIEF_MISSING_SECTION' && /TL;DR/.test(e.message)));
|
||||
});
|
||||
|
||||
// S18 — opt-in --min-brief-version gate. Warns (never blocks) when a brief
|
||||
// declares a version below the caller's floor, sidestepping framing enforcement.
|
||||
const BRIEF_21 = GOOD_BRIEF
|
||||
.replace('brief_version: "2.0"', 'brief_version: "2.1"')
|
||||
.replace('source: interview\n', 'source: interview\nphase_signals_partial: true\n');
|
||||
|
||||
test('validateBrief — S18 min-version: older brief below floor warns but does not block', () => {
|
||||
const r = validateBriefContent(BRIEF_21, { strict: true, minBriefVersion: '2.2' });
|
||||
assert.equal(r.valid, true, `must warn, not block: ${JSON.stringify(r.errors)}`);
|
||||
assert.ok(
|
||||
r.warnings.find(w => w.code === 'BRIEF_VERSION_BELOW_MINIMUM'),
|
||||
`expected BRIEF_VERSION_BELOW_MINIMUM; warnings=${JSON.stringify(r.warnings)}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('validateBrief — S18 min-version: absent opt means no version-floor check', () => {
|
||||
const r = validateBriefContent(BRIEF_21, { strict: true });
|
||||
assert.ok(!r.warnings.find(w => w.code === 'BRIEF_VERSION_BELOW_MINIMUM'));
|
||||
});
|
||||
|
||||
test('validateBrief — S18 min-version: brief meeting the floor does not warn', () => {
|
||||
const r = validateBriefContent(GOOD_BRIEF_22, { strict: true, minBriefVersion: '2.2' });
|
||||
assert.ok(!r.warnings.find(w => w.code === 'BRIEF_VERSION_BELOW_MINIMUM'));
|
||||
});
|
||||
|
||||
test('validateBrief — S18 min-version: 2.0 brief below 2.2 floor warns', () => {
|
||||
const r = validateBriefContent(GOOD_BRIEF, { minBriefVersion: '2.2' });
|
||||
assert.ok(r.warnings.find(w => w.code === 'BRIEF_VERSION_BELOW_MINIMUM'));
|
||||
});
|
||||
|
||||
test('validateBrief — S18 min-version: trekreview brief is exempt (no framing to bypass)', () => {
|
||||
const r = validateBriefContent(REVIEW_AS_BRIEF, { minBriefVersion: '2.2' });
|
||||
assert.ok(!r.warnings.find(w => w.code === 'BRIEF_VERSION_BELOW_MINIMUM'));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue