Repository navigation
[Phase 2] Register plan_json artifact type (plan rubric + structured-findings channel) #614
Copy link
Copy link
Closed
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupinitiativeEpic / initiative tracking issueEpic / initiative tracking issue
Description
Story
As a initiative-planner (Bob) and Epic #597's plan critic,
I want a plan_json artifact type registered with the fixed plan rubric and a structured-findings output channel,
so that an initiative plan.json can be reviewed by the same review brain before it is materialized.
Acceptance Criteria
- A plan_json entry is added to the rubric registry mapping to a plan rubric (the fixed critic checklist) and a structured-findings output channel (machine-readable findings, not GitHub PR comments).
- The content_ref adapter accepts a plan.json path and presents it to the rubric, reusing scripts/engine.sh model routing.
- The output channel emits structured findings the planner can consume before apply-plan.sh materializes the epic/DAG.
- pr_diff behavior is untouched (the Story 3 guard stays green); plan_json is purely additive.
- bats coverage exercises plan_json resolution and a sample plan producing findings; the new test is registered in the lint.yml bats list.
Tasks / Subtasks
- Author the plan rubric file under prompts/ (the fixed critic checklist), grounding its checks in plan.schema.json + validate-plan.py invariants and layering adversarial/semantic critique on top. (AC: test issue from agent #1)
- Do not duplicate the structural validator (unique ids, acyclic DAG, entry point, no dangling/self edges) — critique grounding, references, and AC quality instead.
- Add the plan_json registry entry {rubric, structured-findings channel} and a content_ref adapter that feeds a plan.json into the rubric via engine.sh. (AC: test issue from agent #1, Go-live improvements for PR review agent #2)
- Implement the structured-findings output channel (write findings JSON for the planner; do NOT call post-pr-review.sh). (AC: Add @claude delegation, auto-merge, and rebase handling #3)
- Add bats coverage, register it in lint.yml, and confirm the pr_diff guard is unchanged. (AC: Optimize review: small-PR and incremental fast paths #4, feat: add Copilot engine support via REVIEW_ENGINE toggle #5)
Dev Notes
- The plan rubric is Epic Initiative: Adversarial plan-critic + structural gates for the initiative-planner (Bob) #597's 'fixed critic rubric.' Structural invariants already exist in scripts/initiative-planner/validate-plan.py (unique ids, no dangling/self edges, acyclic, entry point) and plan.schema.json — the rubric should layer adversarial/semantic critique (grounding, reference resolution, AC testability) on top, not re-implement the validator.
- Output channel differs fundamentally from pr_diff: plans are consumed by the planner (apply-plan.sh runs after validate-plan.py), so emit machine-readable findings JSON, NOT a GitHub review. Do not invoke post-pr-review.sh for plan_json.
- This satisfies/re-scopes [Phase 2] Adversarial plan-critic pass against the fixed rubric #603 ('Adversarial plan-critic pass against the fixed rubric') to 'invoke the review agent with the plan rubric' rather than forking a bespoke critic — coordinate so [Phase 2] Adversarial plan-critic pass against the fixed rubric #603 consumes this capability, not a parallel implementation.
- Reuse scripts/engine.sh model routing (run_agentic / deep tier); do not introduce a separate model selector.
Project Structure Notes
New rubric prompt under prompts/ (e.g. prompts/plan-review.md); registry entry + adapter in scripts/lib/; consumer wiring near scripts/initiative-planner/. Keep the structured-findings channel separate from post-pr-review.sh.
References
- scripts/initiative-planner/plan.schema.json
- scripts/initiative-planner/validate-plan.py
- scripts/initiative-planner/apply-plan.sh
- scripts/engine.sh#run_agentic
- prompts/deep-review.md
- tests/test_initiative_planner.bats
Likely target surface
prompts/plan-review.mdscripts/lib/review-registry.shscripts/initiative-planner/tests/
Story prepared by the BMAD Scrum Master (Bob) for epic #610. Status: ready-for-dev.
Metadata
Metadata
Assignees
Labels
dev-leadFor dev-lead agent pickupFor dev-lead agent pickupinitiativeEpic / initiative tracking issueEpic / initiative tracking issue
Activity
don-petry commentedon Jun 15, 2026
Dev-Lead Implementation Plan
Issue: #614 — [Phase 2] Register plan_json artifact type (plan rubric + structured-findings channel)
Scope
Register a purely-additive
plan_jsonartifact type in the rubric registry — mapping a fixed adversarial/semantic plan rubric to a structured-findings output channel — with a content_ref adapter that feeds a plan.json into the rubric viaengine.shdeep-tier routing, leavingpr_diffbehavior untouched.Implementation Checklist
prompts/plan-review.md— the fixed critic rubric. Layers adversarial/semantic critique (grounding, reference resolution, AC testability, scope/sequencing) on top of the existing structural validator; does NOT re-implement validate-plan.py invariants.scripts/lib/review-registry.tsv— add theplan_jsonrow{rubric=prompts/plan-review.md, output_channel=scripts/post-plan-findings.sh}; bumpschema_version.scripts/lib/README.md— document the newplan_jsontype (structured-findings channel, not a GitHub review).scripts/post-plan-findings.sh— structured-findings output channel. Validates the findings JSON shape and emits machine-readable findings the planner can consume. Does NOT callpost-pr-review.shor anyghreview API.scripts/initiative-planner/review-plan.sh— content_ref adapter/driver. Resolves{rubric, output_channel}forartifact_type=plan_jsonfrom the registry, exports the plan path, runs the rubric viaengine.shrun_agentic(deep tier — reuses existing routing, no new selector), then dispatches findings through the resolved output channel.Tests to Write
tests/test_plan_review.bats— (1) registry resolvesplan_json→ plan-review.md + post-plan-findings.sh and referenced files exist; (2)pr_diffremains registered/unchanged (additive guard); (3) driver wiring: sources engine.sh + registry, dispatchesplan_json, exports the plan path as content_ref, invokes the resolved channel variable, never calls post-pr-review.sh; (4) output channel: a sample plan's findings JSON is emitted as machine-readable findings, malformed findings rejected, no GitHub calls.tests/test_review_registry.bats— the Phase-1 "pr_diff is the only registered type" count assertion becomes "pr_diff is still registered" (plan_json is now additive). The [Phase 1] Regression guard locking pr_diff behavior through the contract #613 Story-3 verdict/marker regression guard stays untouched and green.tests/test_plan_review.batsin thelint.ymlbats list.Test Command
bats tests/test_plan_review.bats tests/test_review_registry.bats tests/test_pr_diff_dispatch.bats tests/test_initiative_planner.batsthen full suite +bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jun 15, 2026
Dev-Lead: Implementation Complete
Plan Execution
prompts/plan-review.md— adversarial/semantic critique (grounding, reference resolution, AC testability, scope/sequencing, open-questions) layered on top of the structural validator; explicitly does not re-implementvalidate-plan.py/plan.schema.jsoninvariants.plan_jsonadditively inscripts/lib/review-registry.tsv→{rubric: prompts/plan-review.md, output_channel: scripts/post-plan-findings.sh}; bumpedschema_version1→2 and documented the type inscripts/lib/README.md.scripts/post-plan-findings.sh— validates the findings JSON shape/verdict and emits machine-readable findings for the planner. Never callspost-pr-review.sh,gh pr review, or the reviews API.scripts/initiative-planner/review-plan.sh— resolves{rubric, output_channel}forartifact_type=plan_json, presents theplan.jsonpath to the rubric, and reusesengine.shrun_agenticat the deep tier (no separate model selector), then delivers via the resolved channel.tests/test_plan_review.bats(22 tests) and registered it in thelint.ymlbats list.tests/test_review_registry.batsto "pr_diff stays registered" — its sole-type premise is exactly what this issue extends. The [Phase 1] Regression guard locking pr_diff behavior through the contract #613 Story-3 verdict/marker regression guard is untouched and green.Test Results
Files Changed
prompts/plan-review.md(new): the fixed plan critic rubric.scripts/lib/review-registry.tsv:plan_jsonrow +schema_version: 2.scripts/lib/README.md: documents theplan_jsontype / structured-findings channel.scripts/post-plan-findings.sh(new): structured-findings output channel.scripts/initiative-planner/review-plan.sh(new): content_ref adapter/driver (engine.sh deep tier).tests/test_plan_review.bats(new): 22 tests — registry resolution, driver wiring, sample-plan findings.tests/test_review_registry.bats: additive update to the registered-types guard..github/workflows/lint.yml: registers the new bats file.Notes
post-pr-review.shand the pr_diff registry row/cascade are unchanged; the [Phase 1] Regression guard locking pr_diff behavior through the contract #613 Story-3 guard stays green.plan_jsonis purely additive.apply-plan.shor the planner workflow as a gate — that is [Phase 2] Adversarial plan-critic pass against the fixed rubric #603's job ("invoke the review agent with the plan rubric"), which should consumereview-plan.shrather than fork a bespoke critic.engine.shrun_agenticdeep tier; no new model selector was introduced.feat: implement issue #614 — [Phase 2] Register plan_json artifact ty…