diff --git a/plugins/ultraplan-local/commands/ultraplan-local.md b/plugins/ultraplan-local/commands/ultraplan-local.md index 6f11ce9..a4b473c 100644 --- a/plugins/ultraplan-local/commands/ultraplan-local.md +++ b/plugins/ultraplan-local/commands/ultraplan-local.md @@ -168,6 +168,46 @@ Project: {project_dir or "-"} Research: {N local briefs, M extra via --research} ``` +### When the input is type:ultrareview (Handover 6) + +The brief input may be a `review.md` produced by `/ultrareview-local` +instead of a `brief.md` produced by `/ultrabrief-local`. Both files +share the same handover slot — `type` is the discriminator. + +If `fm.type === 'ultrareview'`: + + 1. Skip the `research_status` gate above (review.md has no + `research_topics` and no Research Plan section). + 2. Extract the `findings` array from the frontmatter — this is the + list of 40-char hex finding-IDs the review surfaced. + 3. Read the body's last fenced ```json``` block to recover the full + finding objects (the frontmatter only has IDs; the JSON has the + `severity`, `file`, `line`, `rule_key`, `title`, `detail`, + `recommended_action` payload). + 4. Filter findings to severity ∈ `{BLOCKER, MAJOR}`. MINOR and + SUGGESTION are skipped for v1.0 plan-input — they are advisory + only and would inflate the plan with low-priority churn. + 5. Treat each remaining finding as a plan goal: + - `recommended_action` → step intent + - `file` → primary `Files:` target + - `id` → goes into the plan's `source_findings:` frontmatter list + 6. When writing `plan.md`, populate the frontmatter field + `source_findings: [, , ...]` containing exactly the IDs + of the BLOCKER + MAJOR findings consumed. The list provides the + audit trail back to `review.md`. + 7. Use **block-style YAML** for the `source_findings:` list. The + frontmatter parser at `lib/util/frontmatter.mjs` does not support + flow-style arrays; `source_findings: [a, b]` is broken — use: + ```yaml + source_findings: + - 0123456789abcdef0123456789abcdef01234567 + - fedcba9876543210fedcba9876543210fedcba98 + ``` + +`source_findings:` is **additive and optional** — plans produced from a +`type: brief` input simply omit the field. No `plan_version` bump is +required for this addition (backwards compatible). + ## Phase 1.5 — Export (runs only when mode = export) **Skip this phase entirely unless mode = export.** diff --git a/plugins/ultraplan-local/templates/plan-template.md b/plugins/ultraplan-local/templates/plan-template.md index 2bd355c..d7c3fbf 100644 --- a/plugins/ultraplan-local/templates/plan-template.md +++ b/plugins/ultraplan-local/templates/plan-template.md @@ -1,3 +1,19 @@ + + # {Task Title} > **Plan quality: {grade}** ({score}/100) — {APPROVE | APPROVE_WITH_NOTES | REVISE | REPLAN}