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:
Kjell Tore Guttormsen 2026-06-18 13:09:50 +02:00
commit 736ae55d66
10 changed files with 409 additions and 31 deletions

View file

@ -35,8 +35,12 @@ missing, vague, or contradictory.
## Input
You receive the path to a brief file (trekbrief v2.0 format, produced by
`/trekbrief`). Read it and evaluate its quality across five dimensions.
You receive the path to a brief file (trekbrief format, produced by
`/trekbrief`). Read it and evaluate its quality across six dimensions.
The caller may also supply **operator memory context** (paths or excerpts of
`feedback_*` / `project_*` facts) in your prompt for the memory-alignment
dimension. If none is supplied, that dimension scores 5 (N/A) — see dimension 6.
A brief has these sections (see template for full structure):
- `## Intent` — why the work matters (load-bearing)
@ -148,6 +152,31 @@ Flag as **research-plan invalid** if:
- `research_topics` count in frontmatter does not match section count
- `research_status: complete` but research files are missing on disk
### 6. Memory alignment (NEW in v5.5)
The brief is the pipeline's source of truth, but the operator's *real* intent
also lives in memory facts (`feedback_*`, `project_*`). When the two diverge,
downstream reasoning power polishes a wrong premise instead of challenging it.
This dimension is the second layer of the framing-alignment defense.
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.
Flag as **memory-misaligned** if:
- The frontmatter `framing:` value contradicts memory (e.g. `framing: preserve`
but memory records the prior direction was explicitly abandoned)
- `## Intent` or `## Goal` asserts a premise a memory fact directly negates
- A Constraint or Preference contradicts a recorded operator preference
For each contradiction, capture: the brief claim (quoted), the memory fact
(quoted), and the source file. These feed `/trekbrief` Phase 4e follow-ups.
## Rating
Rate each dimension on two parallel scales:
@ -193,6 +222,7 @@ find it by reading the last `json` code fence.
| Testability | {Pass/Weak/Fail} | {brief summary or "None"} |
| Scope clarity | {Pass/Weak/Fail} | {brief summary or "None"} |
| Research Plan | {Pass/Weak/Fail} | {brief summary or "None"} |
| Memory alignment | {Pass/Weak/Fail} | {brief summary, "None", or "N/A — no memory"} |
### Findings
@ -224,6 +254,12 @@ information that would strengthen the brief. List only if actionable.}
{ "topic": "{topic title}", "issue": "{what is missing or wrong}" }
]
},
"memory_alignment": {
"score": 1-5,
"contradictions": [
{ "brief_claim": "{quoted brief text}", "memory_fact": "{quoted memory fact}", "file": "{source file}" }
]
},
"verdict": "PROCEED | PROCEED_WITH_RISKS | REVISE"
}
```