diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md index 8600a93..9f3f986 100644 --- a/skills/code-review/SKILL.md +++ b/skills/code-review/SKILL.md @@ -23,16 +23,15 @@ description: >- - **Standards & Smells**: repository rules and Fowler smell diagnostics from [smell-heuristics](references/smell-heuristics.md) (evaluated as confirmed violations, potential smells, or contextual trade-offs). - **Seam & Test Integrity**: audit test diffs against [seams-and-mocking](../tdd/references/seams-and-mocking.md) and [test-quality](../tdd/references/test-quality.md) (public seams, injected timing callables, deterministic waits/teardown, non-tautological literals, boundary coverage, single-behavior naming). - **Defensive Invariants**: system properties from [defensive-invariants](references/defensive-invariants.md) (trust boundaries, authority, consistency, failure semantics, resource limits). -4. **Record structured findings.** Record every finding using the schema in [finding-schema](references/finding-schema.md) (`ID`, `Axis`, `Severity`, `Evidence`, `Invariant`, `Impact`, `Disposition`). A strong pass on one axis never compensates for a failure on another. +4. **Record structured findings.** Record every finding using the schema in [finding-schema](references/finding-schema.md) (`ID`, `Axis`, `Severity`, `Evidence`, `Invariant`, `Impact`, `Disposition`). Never self-assign `Accepted Trade-off` on a review pass: all valid findings start as `Confirmed` (or `Unresolved`); only the human owner may grant `Accepted Trade-off`. A strong pass on one axis never compensates for a failure on another. 5. **Aggregate without silent resolution.** When multiple reviewers or passes disagree, keep the disagreement visible under `Unresolved` until evidence settles it. 6. **Emit executable runtime checks.** For stateful or high-risk paths that static inspection cannot prove, emit runnable fenced shell commands for `verify-slice` following the Step 6 contract in [finding-schema](references/finding-schema.md) (stating purpose, `local` vs. `live-infra` scope classification, explicit pass condition, and explicit failure signal). -7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), or `Ready` (all four axes completed, no confirmed or unresolved blocking findings remain, and exact covered revisions plus working-tree state are recorded). Static review establishes static provenance for that diff only; never authorize release. -8. **Draft and publish the PR review block (standalone open PR only).** Keep the codebase strictly read-only (never edit repo files or mutate project boards). When invoked standalone on an open PR, draft `review-body.md` (and `inline-comments.json` when inline findings exist) per section 4 of [finding-schema](references/finding-schema.md), including the compact 4-axis pass block on clean `Ready` reviews. Show the draft for owner approval; once approved, publish one `--comment` review pinned with `--commit ` (passing `head_sha` and duplicate/pending guards, and creating any `issue`-routed follow-ups via `gitea-plan` first). Skip PR publishing when delegated inside `implement-slice`. +7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), `Pending Triage` (only untriaged Medium/Low findings remain; never recommend merging until each takes one of the 3 triage exits in [finding-schema](references/finding-schema.md)), or `Ready` (all four axes completed and zero untriaged findings remain). Static review establishes static provenance for that diff only; never authorize release. +8. **Auto-publish the PR review block (standalone open PR only).** Keep the codebase strictly read-only (never edit repo files or mutate project boards). When invoked standalone on an open PR, draft `review-body.md` (and `inline-comments.json` when inline findings exist) per section 4 of [finding-schema](references/finding-schema.md), including the compact 4-axis pass block on clean `Ready` reviews, verify `head_sha` and duplicate/pending guards, and automatically publish one `--comment` review pinned with `--commit ` in the same turn. Skip PR publishing when delegated inside `implement-slice`. ## Your call -- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues. -- **Publishing findings**: approve the drafted review body, inline list, and follow-up routes before `code-review` posts to the PR. -- **Adjudicating unresolved disagreements**: resolve conflicting reviewer perspectives or accepted architectural trade-offs. +- **Triaging findings (3 exits before merge)**: for each `Confirmed` or `Unresolved` finding, decide whether to (A) fix in-branch now, (B) promote to a live tracker (append/create Gitea issue or `todo.txt` via `tuxedo add`), or (C) grant permanent `Accepted Trade-off` (`record`). +- **Adjudicating unresolved disagreements**: resolve conflicting reviewer perspectives. - **Authorizing release**: verification and review evidence inform decisions, but the human owner remains the sole release authority. ## Done when diff --git a/skills/code-review/references/axes.md b/skills/code-review/references/axes.md index 243591f..f7027c7 100644 --- a/skills/code-review/references/axes.md +++ b/skills/code-review/references/axes.md @@ -25,18 +25,16 @@ The distinction between recommendations is clear: `Needs Rework` means an establ | Condition Observed | Final Recommendation | Action Required | | :--- | :--- | :--- | -| **Confirmed Critical or High** | `Needs Rework` | Fix confirmed defects before release review. | -| **Confirmed Medium or Low requiring changes** | `Needs Rework` | Apply requested refactoring or test coverage fixes. | +| **Confirmed Critical or High** | `Needs Rework` | Fix confirmed defects on the branch before release review. | +| **Confirmed or Unresolved Medium or Low (untriaged)** | `Pending Triage` | Do not recommend merge. Human owner chooses 1 of 3 exits per finding: (A) fix in-branch, (B) promote to live tracker (Gitea issue or `todo.txt`), or (C) grant permanent `Accepted Trade-off`. | | **Unresolved Critical or High** | `Blocked` | Resolve missing evidence or escalate to human owner before proceeding. | -| **Unresolved Medium or Low** | `Ready` (Conditional) | Human owner may adjudicate and accept trade-offs without blocking. | | **Scope Inability or Missing Base Ref** | `Blocked` | Establish base commit and diff boundaries before reviewing. | -| **No Blocking Findings** | `Ready` | Implementation is structurally sound; proceed to `verify-slice` or release. | +| **Zero Untriaged Findings** | `Ready` | All findings resolved, tracked in a live tracker, or explicitly granted `Accepted Trade-off` by the owner. | -### `Ready` Semantics and Downstream Reuse -`Ready` means the review completed across all four axes, no confirmed or unresolved blocking findings remain (`Needs Rework` or `Blocked`), and the report explicitly identifies the base revision, head revision, and relevant working-tree state it covered. `Ready (Conditional)` qualifies as `Ready` for downstream handshake reuse only after the human owner adjudicates the open Medium/Low items (`Accepted Trade-off` or `Rejected`). A `Ready` review establishes static provenance for that exact diff; it does not substitute for runtime verification or authorize release. - -### Documented Trade-Off Acceptance -When a human owner accepts a documented trade-off for a Medium or Low finding, record the finding disposition as `Accepted Trade-off` (distinct from `Rejected`). This preserves audit traceability without misclassifying an intentional compromise as a disproven defect. +### `Ready` vs. `Pending Triage` Semantics and Downstream Reuse +- **No agent self-adjudication**: Reviewer agents must never self-assign `Accepted Trade-off` on a review pass. Every valid observation (including `Low` nits) starts as `Confirmed` (or `Unresolved`), producing `Pending Triage` (or `Needs Rework`) rather than `Ready`. +- **`Pending Triage` blocks merge recommendations**: A review in `Pending Triage` qualifies as `Ready` for `gitea-pr` merge readiness only after every finding has taken one of the three explicit exits: (A) fixed in a new commit on the branch, (B) recorded in a live tracker that future agents read (an open Gitea issue or `todo.txt` via `tuxedo add`), or (C) explicitly approved by the human owner as a permanent `Accepted Trade-off` (no future action needed). +- A `Ready` review establishes static provenance for that exact diff; it does not substitute for runtime verification or authorize release. ## 3. Risk-Scaled Execution Tiers diff --git a/skills/code-review/references/finding-schema.md b/skills/code-review/references/finding-schema.md index a7369a3..3155f2b 100644 --- a/skills/code-review/references/finding-schema.md +++ b/skills/code-review/references/finding-schema.md @@ -18,14 +18,19 @@ Every reported finding must populate all seven fields: | **Impact** | Concrete failure consequence if left unaddressed. | What breaks in production, concurrency, or maintenance (e.g., "Stored XSS when name contains `