voyage/lib/validators
Kjell Tore Guttormsen 98171d7d3b
feat(gate): the brief's threat model on the plan side (decision 164, 218, 220)
plan-gate.mjs --record --brief <brief.md> (a known flag; its value is kept
out of the positional arguments, a missing value is a usage error) applies
the brief's threat model to the deduped findings before countRound when
threat-model.mjs usable() says it may: a backed finding (Voyage's own
security finding whose threat_model_ref equals an Outside: line's text)
leaves the counted set and the stop rule and goes to the new optional
verdict field known_outside ({id, rule_key, text, line}), carried to later
rounds until a reviewer marks it resolved or it is reported again under its
id. The verdict stores brief_path (carried when a later round has none).
The --record line adds known_outside (a count) and threat_model
({applied, why}): a threat model that is not usable backs nothing, every
security finding counts, and the output says why. extractVerdict
shape-checks both new fields.

The bare gate re-reads the brief at brief_path each run: an entry still
backed is a warning, PLAN_GATE_KNOWN_OUTSIDE; one no longer backed (line
gone, approval stale or not logged, brief unreadable, no brief_path, or not
a Voyage security finding) stops the plan, PLAN_GATE_OUTSIDE_NOT_BACKED: it
counts in full. gatePlan takes an optional threatModel for tests.

plan-review-dedup keeps threat_model_ref on a merge only when every merged
copy carries the same one; the S160 known issue is fixed: a null in a
reviewer's findings list is skipped instead of crashing the CLI.

plan-critic and scope-guardian: a security finding needs a concrete attack
path and high confidence (Claude Code's threshold, 167), uses
SECURITY_INJECTION or SECURITY_RISK, and quotes the Outside: line's text in
threat_model_ref when one applies; the json template carries the field.
/trekplan Phase 9 passes the brief path to plan-critic and --brief to
--record. Handover 4 names the two fields, the two codes and the flag.

Part 2, step 2.4 of the E plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:04:08 +01:00
..
architecture-discovery.mjs fix: round 7 of the release review of 6.3.0, for 6.3.1 2026-10-11 09:11:57 +02:00
brief-review-stamp.mjs fix: round 7 of the release review of 6.3.0, for 6.3.1 2026-10-11 09:11:57 +02:00
brief-validator.mjs feat(brief): optional threat model in the brief (decision 164, 218) 2026-11-08 08:47:51 +01:00
intent-approval.mjs feat(brief): optional threat model in the brief (decision 164, 218) 2026-11-08 08:47:51 +01:00
plan-gate.mjs feat(gate): the brief's threat model on the plan side (decision 164, 218, 220) 2026-11-08 09:04:08 +01:00
plan-validator.mjs chore(cleanup): R-b R3 — profiles, phase signals and the effort dialog removed, one fixed path per command 2026-11-07 21:12:57 +01:00
progress-validator.mjs fix: round 7 of the release review of 6.3.0, for 6.3.1 2026-10-11 09:11:57 +02:00
query-privacy-gate.mjs chore(cleanup): R-b R2 — STORM loop, cap hook and the --engine research choice removed 2026-11-07 20:32:38 +01:00
research-validator.mjs fix: round 7 of the release review of 6.3.0, for 6.3.1 2026-10-11 09:11:57 +02:00
review-validator.mjs refactor: simplify pass (trekexecute) 2026-11-03 12:48:04 +01:00
session-state-validator.mjs fix: round 7 of the release review of 6.3.0, for 6.3.1 2026-10-11 09:11:57 +02:00