M4 — Stage 2: Review (compose model + fallback) #14
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-5/stage-2-review"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements M4 — Stage 2: Review (#5): reviews
implementation.diffagainst the project's own standards and real build/test/lint results, producing a severity-groupedreview-findings.mdvia a fresh, read-only pi agent session. Deterministic orchestration around the LLM black box, with degrade-to-default whenREVIEW_SKILL_PATHis unavailable.Closes #5.
Changes
src/artifacts:writeReviewFindings/readReviewFindings/reviewFindingsPath— verbatim round-trip forreview-findings.md(mirrorsimplementationDiffArtifact).src/review(new module):buildReviewWrapper()— thin pipeline contract: inputs (diff, standards docs, Jira context), run build/test/lint gates, review-only, and the exact severity-grouped findings structure the final message must be.gatherStandardsDocs()— collects existing standards docs (AGENTS.md,CLAUDE.md,README.md,DOMAIN.md,CODING_STANDARDS.md) in documented order, skipping missing ones.buildReviewUserPrompt()— renders Jira context + fenced diff + titled standards sections, with placeholders for empty/absent inputs.REVIEW_TOOLS(read, bash, grep, find, ls— read-only + bash; nowrite/edit) +DEFAULT_REVIEW_SKILL_BODY.runReviewStage(...)— read diff + gather docs → compose prompt (skill body + degrade-to-default) → run pi session → capture final message verbatim intoreview-findings.md. All external effects are injectable seams (runStageFn,readSkillFile,readDiff,gatherDocs).Design note
The review stage runs with a read-only + bash allowlist, so the agent cannot author the artifact itself. pi-loop captures the agent's final message (
RunStageResult.text) verbatim — the same raw-capture precedent as M3's diff capture. Findings well-formedness is driven by wrapper + default-body instructions and validated as a black-box property in the gated E2E (M8).Testing
tsc --noEmit,eslint .,prettier --checkall cleanChecklist