feat(plan): plan 1.8, the plan gate, the design part and the plan-side checks
Wave 1, order 3 (P3 plan mode as the start, P2 design as its own part, P9
plan side). Contracts K3-K6 for the later merges.
- plan_version 1.8 (1.7 plans stay valid): Test first on every step, one
End-to-end ("run the thing") step, optional Interface in / Interface out /
Review focus fields, a ceremony class in the header (absent =
architectural), and for architectural plans a ## Design part: module map
without cycles, architecture rules that name their enforcer and the step
that proves them, a requirements check asked as keep / change.
- K3 lib/validators/plan-gate.mjs: the critic verdict is recorded INSIDE the
plan (Claude Code's plan approval hands a hook only the plan file's text),
bound to the hash taken before the reviewers read it; 0 go / 1 stop / 2
could not run; at most 3 critic rounds, then stop and ask.
- K5 lib/verification/arch-rules.mjs: runs the target repo's own
dependency-cruiser or import-linter (installs nothing; 2 = not measured,
never green); --prove --rule shows pass -> fail on a planted violation of
that rule -> pass. Verified against dependency-cruiser 18.5.0 and
import-linter 2.15; madge 8.0.0 left out (missed a planted .mjs cycle).
- K6 lib/verification/plan-scope-sweep.mjs: changed files no step names.
- /trekplan Phases 8-10: design part, bounded critic loop, the gate before
"execute", a plan-mode path through ExitPlanMode (not yet run end to end
inside plan mode). plan-critic 10 -> 12 dimensions; scope-guardian checks
the ceremony.
- Fixed on the way: plan-validator and plan-review-dedup used the
file://argv[1] main guard (no-op under a symlink or a space); CRLF plans
failed every manifest; the dedup dropped finding severity.
Borrowed, credited in place: obra/superpowers, Kiro (docs), addyosmani/
agent-skills, mattpocock/skills, GitHub Spec Kit, bashebr/ai-native-sdlc,
Boris Cherny's public threads.
Suite 1497 (1495 / 0 / 2), 86 new tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2c89a6b580
commit
f5ca220bc0
24 changed files with 3115 additions and 61 deletions
19
README.md
19
README.md
|
|
@ -243,7 +243,7 @@ Research uses up to 5 local agents (architecture-mapper, dependency-tracer, task
|
|||
|
||||
Produces an implementation plan detailed enough for autonomous execution. **v2.0 breaking change:** requires `--brief` or `--project`. There is no longer an interview inside `/trekplan` — use `/trekbrief` first.
|
||||
|
||||
After `brief-reviewer` validates the input brief, 6–8 exploration agents analyze the codebase in parallel and merge findings into a synthesis. Optional research briefs (`--research`, or auto-discovered in `{project_dir}/research/`) enrich the plan; `architecture/overview.md` priors are loaded if an opt-in upstream architect plugin (not bundled) produced one. Opus then writes the plan with per-step YAML manifests, which `plan-critic` (10 dimensions) and `scope-guardian` adversarially review before handoff.
|
||||
After `brief-reviewer` validates the input brief, 6–8 exploration agents analyze the codebase in parallel and merge findings into a synthesis. Optional research briefs (`--research`, or auto-discovered in `{project_dir}/research/`) enrich the plan; `architecture/overview.md` priors are loaded if an opt-in upstream architect plugin (not bundled) produced one. Opus then writes the plan with per-step YAML manifests, which `plan-critic` (12 dimensions) and `scope-guardian` adversarially review in a bounded loop of at most 3 rounds before handoff.
|
||||
|
||||
Output:
|
||||
- With `--project <dir>`: `{dir}/plan.md`
|
||||
|
|
@ -271,6 +271,8 @@ Output:
|
|||
Every plan includes:
|
||||
|
||||
- **Context** — derived from brief `## Intent` + `## Goal`
|
||||
- **Global Constraints** — the brief's constraints that bind several steps, quoted verbatim
|
||||
- **Design** — only when the brief's `ceremony` is `architectural` (absent = architectural): architecture, data flow, interfaces, data models, error handling, a module map with no cycles, architecture rules that each name their enforcer, and a requirements check asked as keep / change questions
|
||||
- **Architecture Diagram** — Mermaid C4-style component diagram
|
||||
- **Codebase Analysis** — tech stack, patterns, relevant files, reusable code
|
||||
- **Research Sources** — findings from research briefs (when present)
|
||||
|
|
@ -281,14 +283,25 @@ Every plan includes:
|
|||
- **Risks and Mitigations** — from risk-assessor findings
|
||||
- **Verification** — testable end-to-end criteria
|
||||
- **Execution Strategy** — session grouping and parallel waves (plans with > 5 steps)
|
||||
- **Plan Quality Score** — quantitative grade (A-D) across 6 weighted dimensions
|
||||
- **Plan Quality Score** — quantitative grade (A-D) across 7 weighted dimensions
|
||||
- **Critic Verdict** — the last critic round's machine-readable verdict, written by `plan-gate.mjs --record`
|
||||
|
||||
Every implementation step includes:
|
||||
- **Test first:** — the test the step makes pass (required from `plan_version 1.8`)
|
||||
- **Interface in:** / **Interface out:** / **Review focus:** — optional: what the step consumes and produces, and the untested inputs it pins to a test
|
||||
- **On failure:** — what to do when verification fails (revert / retry / skip / escalate)
|
||||
- **Checkpoint:** — git commit after success
|
||||
- **Manifest:** — the objective completion predicate (Hard Rule 17)
|
||||
|
||||
Exploration uses 6–8 agents in parallel (architecture-mapper, dependency-tracer, task-finder, test-strategist, git-historian, risk-assessor, plus convention-scanner on medium+ codebases and research-scout when unfamiliar tech is detected). Adversarial review then runs `brief-reviewer`, `plan-critic` (10 dimensions, no-placeholder enforcement, manifest audit), and `scope-guardian` (creep + gap detection). Per-agent details in [`agents/`](agents/).
|
||||
One step per plan is the "run the thing" step (`End-to-end:`): the product run the way a user runs it. Without it a result is "not verified end to end", never green.
|
||||
|
||||
Exploration uses 6–8 agents in parallel (architecture-mapper, dependency-tracer, task-finder, test-strategist, git-historian, risk-assessor, plus convention-scanner on medium+ codebases and research-scout when unfamiliar tech is detected). Adversarial review then runs `brief-reviewer`, `plan-critic` (12 dimensions, no-placeholder enforcement, manifest audit, interfaces and slices, design and architecture rules), and `scope-guardian` (creep + gap detection, ceremony match). Per-agent details in [`agents/`](agents/).
|
||||
|
||||
**The plan gate.** Each critic round is written into the plan by `lib/validators/plan-gate.mjs --record`; `plan-gate.mjs <plan.md>` then exits 0 (go on), 1 (stop: invalid plan, no verdict, a verdict the plan has changed since, or an open BLOCKER) or 2 (could not run). After 3 rounds with a BLOCKER open, `/trekplan` stops and asks; it never continues silently, and "execute" is offered only when the gate exits 0. In Claude Code's plan mode the plan is written to Claude Code's plan file and approved through its own approval prompt (that `/trekplan` runs cleanly inside plan mode is not verified yet).
|
||||
|
||||
**Checks the plan hands on** (0 / 1 / 2, and 2 = "not measured", never green): `lib/verification/arch-rules.mjs --repo <dir>` runs the target repo's own dependency-cruiser or import-linter — Voyage installs nothing — and `--prove` shows a rule pass, fail on a planted violation, and pass again; `lib/verification/plan-scope-sweep.mjs --plan <plan.md> --base <ref>` lists changed files that no step names.
|
||||
|
||||
Borrowed, with credit: per-step interfaces, Global Constraints and Review Focus from [obra/superpowers](https://github.com/obra/superpowers) (MIT); the design sections and the bounded review loop from Kiro's documentation; the module map and "use the repo's own tool" from [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) (MIT); vertical slices, deep modules, the ADR bar and pass → fail → pass from [mattpocock/skills](https://github.com/mattpocock/skills) (MIT); rules that name their enforcer, adapted from [GitHub Spec Kit](https://github.com/github/spec-kit)'s constitution (MIT); the sweep for files outside the plan from [bashebr/ai-native-sdlc](https://github.com/bashebr/ai-native-sdlc) (MIT); the independent plan review and the run step from Boris Cherny's public Claude Code threads.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue