docs(cleanup): R-b CHANGELOG, scope-aware full swarm, stale wording

The /trekresearch Phase 4 sentence said contrarian-researcher runs every
time, also under --local; it now runs whenever the scope includes external.
Three stale "sequencing gate" and stats mentions in touched files follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-07 21:16:47 +01:00
commit 94400c6c3b
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
5 changed files with 31 additions and 14 deletions

View file

@ -58,6 +58,10 @@ Part B makes a WARN open the merge lock and the release check only when the oper
- **`~` and `$HOME` in the arguments of `/trekendsession`, `/trekcontinue` and `/trekreview` are no longer expanded** (ARG, fix round 4.5b). The arguments reach the arg parser as text on stdin, not as shell words, so nothing in them is expanded: write the path out (`~/x` stays the three characters `~/x`).
- **The autonomy gate is the `--gates` flag parser** (cleanup R-a, R9). `lib/util/autonomy-gate.mjs` keeps only `gatesValue` and `parseGatesArgs`: `--gates [value]` prints `{"ok":true,"gates":true|false}`, a bad value a usage error (exit 1). The state machine (`STATES`, `EVENTS`, `transition`), which no command used, is gone; the four commands call the parser with the flag only.
- **The live tests left the round files** (cleanup R-a, R8). The tests of live behaviour in the `retterunde*`, `trial*`, `fix-round-4-5a-prose` and `fix-round-4-5b2-b-prose` files moved into the test file named after the source they test, each seen failing under a mutation of that source; the round files, the eight round end-to-end scripts and `tests/synthetic/plan-run-C.md` (now `tests/fixtures/plan-run-c.md`) are gone. `timing-under-load.test.mjs` is `timing.test.mjs`; `lib-imports.test.mjs` holds the import checks. The suite goes from 3336 to 2930 tests: duplicates and the tests of removed files left with them.
- **One fixed path per command** (cleanup R-b, decision 209). With the phase signals gone, each command takes the heavier of its old paths. `/trekresearch` launches every agent its scope allows, and `contrarian-researcher` runs as wave 2 whenever the scope includes external. `/trekreview` always runs all four coordinator passes: a finding with no citation is dropped, and an unknown `rule_key` goes to `unverified` (the old high path's normalization to `PLAN_EXECUTE_DRIFT` is gone). `/trekplan` no longer writes the `## Adversarial Pass 2 (v5.1.1 high-effort)` section that only said the pass was skipped. The low-effort shortcuts are gone; the `--quick` modes stay. This also ends the earlier entry's "spawn sites follow the profile": a Voyage agent is spawned with no model parameter, so its own `model: opus` applies, and the two spawns of Claude Code's built-in agents (`/trekplan`'s Explore deep-dive, `/trekresearch`'s Phase 5 follow-up) pass `model: "opus"`.
- **The brief carries no phase signals** (cleanup R-b, decision 191; Handover 1). `/trekbrief` no longer asks for per-phase effort and model, the template has no `phase_signals` block, and the brief validator's signal codes (`BRIEF_V51_MISSING_SIGNALS`, `BRIEF_SIGNALS_MUTUALLY_EXCLUSIVE`, `BRIEF_INVALID_PHASE_SIGNALS` and the phase, effort and model codes) are gone. An older brief's `phase_signals` key is ignored, so every existing brief stays valid. A consumer that read the signals from a brief gets none from a new one.
- **`--engine` is gone and `--profile` is retired** (cleanup R-b). `/trekresearch --engine` no longer exists. `--profile` is still read as a flag with a value, so a typed value is not taken as a path, and nothing uses it (see Known issues).
- **`intent-approval.mjs --stamp` prints `stamped`, `intent_hash` and `approved_at`** (cleanup R-b). The `record` field and the `brief-approved` stats record are gone; the stamp writes nothing outside the brief.
### Fixed
@ -218,21 +222,32 @@ Fix round 4.5a (decisions 57, 67 and 68): the round's 30 findings, where a Voyag
**Cleanup R-a (decisions 188, 200-208).** What existed only for history or had no user, removed before the new design (187); git history keeps all of it.
- **The June trials and their docs** (R4): the balance charter and analysis, the T1 synthesis and T2 bakeoff and workflow-substrate results, the devil's-advocate plan and results, the narrow-wins, balance-backlog, token-trim and brief-assessment docs, the S22 dogfood, the 2.1.181 decision matrix, the delegation audit, the eval-corpus README, `MIGRATION.md` and `verify.sh` (`npm run verify` with it).
- **The three orchestrator reference docs and the dormant `synthesis-agent`** (R4, R5): `agents/` holds 20 agents, all spawnable. Why orchestration runs in the session is now one sentence in `docs/architecture.md`, and why every agent is pinned `opus` is in `docs/profiles.md` §Model & effort axes.
- **The three orchestrator reference docs and the dormant `synthesis-agent`** (R4, R5): `agents/` holds 20 agents, all spawnable. Why orchestration runs in the session is now one sentence in `docs/architecture.md`, and why every agent is pinned `opus` is in `docs/architecture.md` §Model & effort (moved there from `docs/profiles.md` in R-b).
- **Code with no caller** (R6): `lib/parsers/project-discovery.mjs`, `lib/parsers/bash-normalize.mjs`, `lib/plan/synthesis-digest-schema.mjs`, `lib/review/fidelity-diff.mjs`, `lib/util/test-census.mjs`, `lib/validators/next-session-prompt-validator.mjs` (`/trekcontinue` Phase 1.5 now uses the project folder's prompt file and names a root one as ignored), the bakeoff scripts, `templates/spec-template.md`, the root `settings.json` and `examples/01-add-verbose-flag/`.
- **Arm B and `--workflow`** (R6, X10): `scripts/trekreview-armB.workflow.mjs` and the `/trekreview --workflow` flag; the standard path is the only review path.
- **The fix-round chain** (R7): the round red scripts, regression scripts, mutation files and round prose and script tests. `tests/helpers/red-round.sh`, `red-judge.mjs` and `red-mutate.mjs` stay (K2), as do the 4.5b2 part A corpus and end-to-end script.
**Cleanup R-b (decisions 175, 189-191, 209).** Voyage's own measurement, the STORM loop and the profiles went, in three commits on one branch; 109 files and about 19 000 lines. `npm test` went from 2930 tests to 2309, 0 failing. `tests/lib/removed-surfaces.test.mjs` fails when a tracked file names a removed surface again (seen red in all three groups before the removal).
- **Measurement, statistics and export** (R1, decision 189). `lib/stats/`, `lib/exporters/`, the `post-bash-stats` and `otel-export` hooks, the per-command stats phases (`/trekbrief` Phase 7, `/trekplan` Phase 12, `/trekexecute` Phase 9, `/trekcontinue` Phase 5, and the stats half of `/trekresearch` and `/trekreview` Phase 8), the events `/trekexecute` Phase 8 wrote around the merge (the merge lock never read them), the yardstick, the end-state gate and registry, the comparison gate, `docs/observability.md` and `examples/observability/`. Claude Code's own OpenTelemetry (`CLAUDE_CODE_ENABLE_TELEMETRY`) gives tool durations, tokens and cost per agent and skill; before the removal it was seen working against a local receiver with Claude Code 2.1.319: the command name, Bash durations, and model, effort and tokens per helper (condition 175).
- **The STORM loop and the research engine choice** (R2, decision 190). `/trekresearch` Phase 4.5 and the Phase 5 follow-up loop (Phase 5 keeps its single pass, at most two follow-ups, every run), the `--engine` flag with the deep-research adapter and its self-check, the `pre-agent-cap` hook, `lib/util/research-loop-cap.mjs`, `scripts/storm-measure.mjs` and the engine and STORM docs.
- **Profiles, phase signals and the effort dialog** (R3, decision 191). `lib/profiles/` (the four profiles and both resolvers), `lib/validators/profile-validator.mjs`, `lib/parsers/profile-jaccard.mjs`, `docs/profiles.md` (its model and effort part is now `docs/architecture.md` §Model & effort), `/trekbrief` Phase 3.5, the Profile, Composition rule, Sequencing gate and High-effort sections of the five commands, the plan validator's `MANIFEST_PROFILE_DRIFT`, the manifest's `profile_used`, `resolveTrekcontinueProfile`, and the test-set case `plan-halts-without-phase-signals` (the test set has seven cases). Every helper is a Voyage agent pinned `model: opus`; the telemetry run above saw a pinned and an unpinned one run Opus 5.5 at effort high.
- **The files R-a left for R-b** (decision 205): `docs/T1-cc26-delegated-orchestration.md`, `lib/review/gold-scorer.mjs` with its test, `tests/lib/gold-eval.test.mjs`, `tests/fixtures/bakeoff-rich/runs/run-perfect.json` and `scripts/synthesis-measure.mjs` with its test; the path check has no "removed in R-b" exception left.
### Known issues
- **Some files wait for R-b** (cleanup R-a, decision 205). `docs/T1-cc26-delegated-orchestration.md` and `lib/review/gold-scorer.mjs` with its test stay: `scripts/end-state-registry.json`, whose hash is frozen, names them (D-06 probes the scorer). `tests/lib/gold-eval.test.mjs` and `tests/fixtures/bakeoff-rich/runs/run-perfect.json` stay with the scorer: they are the one end-to-end check that the review contract keeps every seeded finding. `scripts/comparison-gate.mjs` still lists the removed `settings.json` and `verify.sh` in a part's scope, and the profile calibration notes under `tests/synthetic/` still name the removed `examples/01-add-verbose-flag/brief.md`; both are R-b files. `scripts/synthesis-measure.mjs` and its test stay for R-b's measurement tooling (R1), although their default paths name the removed synthesis fixtures and results doc. `tests/fixtures/bakeoff-rich/` stays for V3 (decision 202); its README still describes the removed bakeoff harness as current.
- **`tests/fixtures/bakeoff-rich/` has no reader** (cleanup R-b). It stays for V3 (decision 202); with `gold-eval` gone nothing reads `gold.json`, and its README still describes the removed bakeoff harness as current.
- **The query guard has no caller** (cleanup R-b). `lib/validators/query-privacy-gate.mjs` and its tests stay, but its callers were the removed STORM steps, so no research query passes through it; its header and `skills/researching-sources/` say so. Left for the design (187).
- **Eleven agents take the session's effort** (cleanup R-b). Nine agents pin `effort: high`; the other eleven inherit the session level, so a session started below high runs them below high. Left for the design (187).
- **A typed `--profile` is ignored without a word** (cleanup R-b). The parser keeps `--profile` as a retired valued flag, so `--profile x` consumes `x` instead of reading it as a path, and no command says the flag does nothing.
- **The plan gate still leaves out a Pass 2 heading** (cleanup R-b). `lib/validators/plan-gate.mjs` keeps its exclusion of the "Adversarial Pass 2 (v5.1.1 high-effort)" heading that `/trekplan`'s high-effort path wrote, so older plans hash the same; no command writes the marker now.
- **The lessons apply still skips `original_rule_key`** (cleanup R-b). `lib/review/recurrence.mjs` skips a finding's `original_rule_key`, which only the removed high-effort normalization wrote; harmless, left.
- **Part A's end-to-end script no longer runs** (cleanup R-a). `tests/e2e-fix-round-4-5b2-a.sh` stays, but its callers were the removed round scripts, and `npm test` runs only `*.test.mjs`; it is listed for an upgrade (A1).
- **The path check has blind spots** (cleanup R-a). `tests/lib/living-paths.test.mjs` skips a line with an `@<sha>` or `MIT` on it or on the two lines above, so a live path next to a credit is not checked, and it reads a backticked span only when the whole span is a path, so `lib/x.mjs --flag` is not checked unless it carries `${CLAUDE_PLUGIN_ROOT}/`. It reads only `.md` files, so a dead path in code (a script's default input, a comment) is not checked either.
- **A removed flag is ignored, not refused** (cleanup R-a). The arg parser puts an unknown flag in `unknown` and the commands do not report it, so `/trekreview --workflow` now runs the standard review without a word.
- **`/trekcontinue` Phase 1.5 chooses a prompt file nothing reads** (cleanup R-a, decided in its plan). With the validator gone it prefers the project folder's `NEXT-SESSION-PROMPT.local.md` over a root one and says so in one line; no later phase reads the file, and the producer and age checks are gone.
- **A plan's `profile:` field has no writer.** README, `docs/`, `/trekexecute` and `/trekcontinue` say a plan carries or passes on a profile, but no command writes `profile:` to a plan; the plan validator's `MANIFEST_PROFILE_DRIFT` check reads it, and `resolveTrekcontinueProfile` has no caller outside its tests. Left whole for a later hardening part, which chooses between writing the field and taking the promises out.
- **Splices and dropped `--x=` options outside fix round 4.5b** (decision 82). The commands' bash blocks still splice `{placeholder}` values into shell lines outside the four places the round closed (the Phase 0 parser lines of `/trekendsession`, `/trekcontinue` and `/trekreview`, and `/trekendsession` Phase 3), for example `"{brief_path}"` in `/trekplan` and the unquoted `{project_dir}` in `/trekendsession` Phase 4; and the release check, the lessons apply (`lib/review/recurrence.mjs`) and the park tool still drop an unknown `--x=` option without a word. One open finding, for fix round 4.5c or 4.5d.
- **Two 4.5b findings moved to fix round 4.5c.** M12 (`lib/review/reviewed-commit.mjs` makes four git calls per path per commit; at most two paths per commit reach that loop) goes with 4.5c's single `git cat-file --batch` read, and Dc (the trekcontinue `line_ref` row in `tests/fixtures/jsonl-schemas.md`) with 4.5c's change of `line_ref` to a heading anchor.
- **A 4.5b finding moved to fix round 4.5c.** M12 (`lib/review/reviewed-commit.mjs` makes four git calls per path per commit; at most two paths per commit reach that loop) goes with 4.5c's single `git cat-file --batch` read. The second, Dc (the trekcontinue `line_ref` row in `tests/fixtures/jsonl-schemas.md`), went with that file in cleanup R-b.
- **Step 9's narrowed unborn-HEAD rule is not recorded as a plan deviation** (MAJOR `c76a0bb8`, `lib/util/park-attempt-files.mjs`; decision 88). The park tool reads HEAD as unborn only when `headIsUnborn` agrees, which narrows plan Step 9's rule; the narrowing was logged as an executor decision, not as a plan amendment.
- **The arg parser's stdin-unreadable branch has no test** (MAJOR `b0fd0a04`, `lib/parsers/arg-parser.mjs`; decision 88). No test exercises `ARG_STDIN_UNREADABLE` and its exit 1, the path that makes `/trekcontinue` and `/trekendsession` stop when stdin cannot be read.
- **The park tool's packed-refs branch has no test** (MAJOR `f7e8278b`, `lib/util/park-attempt-files.mjs`; decision 88). The branch that tells a corrupt packed ref from an unborn HEAD is not exercised; the corrupt-ref test covers only a loose ref.
@ -242,7 +257,7 @@ Fix round 4.5a (decisions 57, 67 and 68): the round's 30 findings, where a Voyag
- **The park tool misnames a detached HEAD it cannot read** (MAJOR `e3824c6d`, `lib/util/park-attempt-files.mjs`; decision 88). On a detached HEAD whose commit is missing it exits 2, as it should, with a reason that names a corrupt branch ref.
- **The lessons-block check accepts any valid lesson line** (MINOR `5114fa84`, `lib/review/reviewed-commit.mjs`; decision 88). A line added inside the block that passes the lesson-line check, an instruction written in the lesson form included, does not make the review stale.
- **The label keeps inner quotes** (MINOR `e585ce27`, `lib/parsers/arg-parser.mjs` `tailOf`; decision 88). `tailOf` strips quotes only when one pair wraps the whole rest, so `brief.md "Session 2" of "3"` gives the label `"Session 2" of "3"`.
- **The Bash guard knows one heredoc delimiter** (MINOR `8959d2cd`, `hooks/scripts/pre-bash-executor.mjs`; decision 88). It has no general rule for a quoted heredoc's closing line, so another heredoc in the commands, such as a stats record's, can still be closed early by a typed line equal to its delimiter.
- **The Bash guard knows one heredoc delimiter** (MINOR `8959d2cd`, `hooks/scripts/pre-bash-executor.mjs`; decision 88). It has no general rule for a quoted heredoc's closing line, so another heredoc in the commands can still be closed early by a typed line equal to its delimiter.
- **A command that mentions the parser's heredoc opener with a line after it stays blocked** (fix round 4.5b part 2, decision 88). The guard checks every opener of `VOYAGE_ARGS_EOF_7F3C9E` that has a non-blank line after the opener's line, so such a command stays blocked unless it is a quoted heredoc whose closing line is the one last non-empty line, for example a commit message written as a heredoc that mentions the opener. Write it on one line, or read it from a file. Two kinds of such command pass, under the conditions the ESC and SLT bullets above give: one whose opener's first `<` follows an odd run of backslashes, unless two escaped `<` in a row name the delimiter (see EVL), a case fix round 4.5b2 part A widens, and one whose opener is text inside a string on its line, unless a backslash-newline splits it (see SIS).
- **A `bash -c $'...'` command on one physical line is not checked** (fix round 4.5b part 2, decision 88). It carries no literal newline, so the guard sees no line after the opener even when `bash -c` expands it into a heredoc of the parser's delimiter; part 1 blocked it by accident. The shipped commands never produce it from `$ARGUMENTS`.
- **The tokenizer splits a quoted value at a quote of the same kind that starts a word** (TOK, decision 88). `'the '90s were great'` gives `'the` and `90s were great` (accepted by the operator on 2026-10-27, part 2's brief). The argv form's self-quoting of a word that holds spaces (`-- 'say "hi"'`) splits (accepted on 2026-10-28). Since part 3, a quoted value that ends in whitespace pairs again, so such a value may also hold what follows it up to a quote that ends a word: `--project "x --since " HEAD` gives `--project` = `x --since `. Review finding `564d6dff` (decision 90) names this case: such a value can swallow a later flag with no error.
@ -293,6 +308,7 @@ Fix round 4.5a (decisions 57, 67 and 68): the round's 30 findings, where a Voyag
- two-way: review gate 4.5b2 part B — `review_version` 1.2 and the answered-MAJOR merge lock (decisions 93-105, 128); a revert restores the 1.1 gate, 1.2 files still read under the old validator (unknown keys tolerated), and K2 `review` records keep the record shape.
- two-way: fix round 4.5b2 part C (decisions 135, 137) — a revert restores part B's behaviour.
- two-way: cleanup R-a (decisions 188, 200-208) — revert its commits; the removed files come back from git, and no format, flag value or record shape changed except the `/trekreview --workflow` flag and the autonomy gate's `--state`/`--event` arguments, which no shipped command used.
- two-way, one exception: cleanup R-b (decisions 175, 189-191, 209) — revert its commits; the removed files, hooks, phases and flags come back from git. One-way for briefs written after R-b: they carry no `phase_signals`, so after a revert the old validator refuses each one that declares `brief_version` 2.1 or later (`BRIEF_V51_MISSING_SIGNALS`) until the signals are added by hand.
## v6.5.0 — 2026-10-18 — Three skills for brief, criteria and review, English labels, and three trial-5 fixes

View file

@ -270,10 +270,11 @@ Skip to Phase 8 after writing the brief.
**Determine which agents to launch based on scope:**
Every run launches the FULL swarm for its scope: all 5 local agents and all 4
external agents, and `contrarian-researcher` runs every time, as wave 2 (see
Launch rules), so the final brief always carries an adversarial
counter-evidence pass.
Every run launches the FULL swarm for its scope: all 5 local agents when the
scope includes local, and all 4 external agents when it includes external.
`contrarian-researcher` is one of the external four and runs every time the
scope includes external, as wave 2 (see Launch rules), so a brief with external
research always carries an adversarial counter-evidence pass.
### Local agents (scope = both or local)

View file

@ -1,5 +1,5 @@
---
description: "/trekplan on a brief that passes the sequencing gate but carries no intent approval halts at the intent gate (veikart steg 1)."
description: "/trekplan on a brief that passes the brief validator but carries no intent approval halts at the intent gate (veikart steg 1)."
expected_outcome: "intent-approval.mjs --check runs and reports BRIEF_INTENT_NOT_APPROVED; /trekplan halts and names /trekbrief --approve; no Agent call (no exploration swarm), no plan.md."
tags: [proevesett, from=proevesett-intent-gate]
runs: 1

View file

@ -31,7 +31,7 @@ function phase5(doc) {
test('trekresearch — Phase 4 runs the full swarm with contrarian-researcher as wave 2 every time (decision 209)', () => {
const flatText = read().replace(/\s+/g, ' ');
assert.ok(
flatText.includes('Every run launches the FULL swarm for its scope: all 5 local agents and all 4 external agents, and `contrarian-researcher` runs every time, as wave 2 (see Launch rules)'),
flatText.includes('Every run launches the FULL swarm for its scope: all 5 local agents when the scope includes local, and all 4 external agents when it includes external. `contrarian-researcher` is one of the external four and runs every time the scope includes external, as wave 2 (see Launch rules)'),
'Phase 4 must state the one fixed path: the full swarm, contrarian-researcher as wave 2 every run',
);
assert.ok(
@ -40,7 +40,7 @@ test('trekresearch — Phase 4 runs the full swarm with contrarian-researcher as
);
});
// --- Spawn model, turn budget and stats writer ---
// --- Spawn model ---
/** Whitespace (line breaks too) collapsed to one space. */
const flat = (s) => s.replace(/\s+/g, ' ').trim();

View file

@ -572,12 +572,12 @@ test('operational files no longer reference trekrevise (v5.0.0 removal)', () =>
}
});
// --- v5.1 — brief_version 2.1 ---
// --- v5.5 — brief_version 2.2 ---
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\.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');
'trekbrief-template.md must declare brief_version: "2.2" (quoted) — unquoted parses as Number and bypasses the version gate; v5.5 bumped 2.1→2.2 for framing enforcement');
});
// --- v5.4 — brief.md formalized as PUBLIC CONTRACT (Handover 1) ---