feat(voyage): wire 4 downstream commands to brief.phase_signals + composition rule (v5.1)

This commit is contained in:
Kjell Tore Guttormsen 2026-05-13 21:13:51 +02:00
commit d3975c441c
4 changed files with 121 additions and 0 deletions

View file

@ -894,6 +894,36 @@ VOYAGE_PROFILE=balanced /trekplan --project ...
Stats records emit `profile`, `phase_models`, `parallel_agents`, and
`profile_source` so operators can audit which profile drove which session.
## Composition rule (v5.1)
Independent of the profile system. When `brief.md` carries
`phase_signals` (brief_version ≥ 2.1), each downstream phase resolves
effort + model as:
```
effort_for_phase = brief.phase_signals[<phase>]?.effort ?? 'standard'
model_for_phase = brief.phase_signals[<phase>]?.model ?? profile.phase_models[<phase>]
```
The brief signal wins per-phase when present; the profile fills any
gaps. There is no helper module — composition is documented prose in
each downstream command.
For `/trekplan` specifically: `effort == 'low'` activates the existing
`--quick`-equivalent code-path (skip Phase 5 agent swarm — plan directly
without exploration agents). `effort == 'standard'` (or absent) → no
change. High-effort behavior is deferred to v5.1.1 per brief Non-Goal
("No complete per-phase effort dictionary").
### Sequencing gate surface
Phase 1 already calls `brief-validator.mjs --soft`. If the validator
returns `BRIEF_V51_MISSING_SIGNALS` in `errors` (brief_version ≥ 2.1
without `phase_signals` or `phase_signals_partial: true`), halt with a
one-line message: `Brief is brief_version 2.1 but does not carry phase_signals
— re-run /trekbrief to commit them (Phase 3.5).` Enforcement is
validator-only; this surface just makes the friendly hint readable.
## Hard rules
- **Brief-driven**: Every plan decision must trace back to a section of the