Skip to content

feat(unic-pr-review): align code-simplifier with toolkit's two-phase post-pass model #216

@orioltf

Description

@orioltf

What to build

Adopt pr-review-toolkit's two-phase model: run the Review Aspect agents first, and only when the review passes run code-simplifier as a second polish phase — instead of unic's current single parallel fan-out that includes code-simplifier in the initial batch at "three or more changed source files".

Decision (locked):

  • Two-phase flow, similar to the toolkit. Phase 1 = the Review Aspect fan-out (unchanged). Phase 2 = code-simplifier, conditional on Phase 1 passing.
  • "Passing" = no Critical and no Important findings (only Minor, or none, remain). Maps the toolkit's loose "after passing review" onto unic's Severity thresholds (ADR-0002). Don't waste a polish pass on code that still has real problems.
  • Keep the existing ≥3-changed-source-files gate as an additional condition — tiny PRs don't trigger a second phase even when they pass.
  • Respect preview / --dry-run: Phase 2 computes and renders but does not post.

Produce an ADR recording this and its interaction with the Approval Loop and re-review modes, then implement the sequencing change.

Acceptance criteria

  • An ADR records the two-phase decision: the "passing" gate (no Critical/no Important), the retained ≥3-source-files condition, and the interaction with the Approval Loop (ADR-0003) and re-review mode.
  • code-simplifier is removed from the initial parallel batch and runs as a post-review phase, only when Phase 1 yields no Critical and no Important findings and ≥3 source files changed.
  • When Phase 1 has any Critical or Important finding, code-simplifier does NOT run.
  • Phase 2 honours preview / --dry-run (computes/renders, posts nothing).
  • Spawn/orchestration tests reflect the chosen model: pass+≥3-source → Phase 2 runs; pass+<3-source → no Phase 2; Important present → no Phase 2.

Blocked by

None - can start immediately (independent of the gating slices #213#215).

Metadata

Metadata

Assignees

No one assigned

    Labels

    app:unic-pr-reviewArea: apps/claude-code/unic-pr-reviewfeatureNew capabilityready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions