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:
Kjell Tore Guttormsen 2026-06-19 13:33:00 +02:00
commit 987e847ea1
11 changed files with 145 additions and 13 deletions

View file

@ -164,9 +164,17 @@ The caller MAY supply operator memory excerpts or file paths in your prompt.
- **If memory context IS supplied:** compare the brief — especially `## Intent`,
`## Goal`, and the frontmatter `framing:` value — against those facts. Report
**EXPLICIT contradictions only** (a brief claim that a memory fact directly
negates), never vibes or soft mismatches.
- **If NO memory context is supplied:** score `5`, set `contradictions: []`, and
note "no memory context supplied". Do not speculate or invent contradictions.
negates), never vibes or soft mismatches. With no contradiction found, set
`status: "verified"`; with one or more, set `status: "contradictions"`.
- **If NO memory context is supplied:** score `5`, set `contradictions: []`,
`status: "n_a"`, and note "no memory context supplied". Do not speculate or
invent contradictions.
The `status` field is load-bearing: a `score: 5` alone is ambiguous because it is
emitted both when memory was checked and aligned (`verified`) and when no memory
was available to check (`n_a`). Downstream gates that read `memory_alignment.score
≥ 4` therefore pass in *both* cases — `status` is what tells the operator whether
the wrong-premise defense actually ran or was simply absent.
Flag as **memory-misaligned** if:
- The frontmatter `framing:` value contradicts memory (e.g. `framing: preserve`
@ -256,6 +264,7 @@ information that would strengthen the brief. List only if actionable.}
},
"memory_alignment": {
"score": 1-5,
"status": "verified | n_a | contradictions",
"contradictions": [
{ "brief_claim": "{quoted brief text}", "memory_fact": "{quoted memory fact}", "file": "{source file}" }
]