diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md index 6a52b22..1e150f4 100644 --- a/skills/code-review/SKILL.md +++ b/skills/code-review/SKILL.md @@ -27,7 +27,7 @@ description: >- 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 the PR comment block.** When the target is an open pull request, draft `review-body.md` and `inline-comments.json` per section 4 of [finding-schema](references/finding-schema.md), proposing `inline`/`body` placement and `record`/`issue` follow-up for each non-rejected finding. Never post to Gitea yourself: hand the block to `gitea-pr`. +8. **Draft the PR comment block.** When the target is an open pull request, 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. Never post to Gitea yourself: hand the block to `gitea-pr`. ## Your call - **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues. diff --git a/skills/code-review/references/finding-schema.md b/skills/code-review/references/finding-schema.md index bd3eb89..7305330 100644 --- a/skills/code-review/references/finding-schema.md +++ b/skills/code-review/references/finding-schema.md @@ -101,7 +101,7 @@ When the review target is an open pull request, `code-review` also drafts a PR c ### What goes in - Every finding except `Rejected` ones (those stay in the local ledger only). -- Zero eligible findings: draft nothing. A clean review is not posted unless the owner asks. +- Zero eligible findings on a `Ready` review: still draft `review-body.md` using the compact 4-axis pass template below (and omit `inline-comments.json`) so every reviewed PR head has an immutable, commit-pinned review record on Gitea. ### Per-finding routing (proposed here, decided by the owner) | Field | Values | Rule | @@ -129,6 +129,22 @@ Covered state: ``. Tier: ``. Static provenance only; - **CR-02** (``): . ``` +`review-body.md` (clean `Ready` review with zero non-rejected findings; omit `inline-comments.json`): +```markdown +**Code review @ ``** (``..``): `Ready` + +Covered state: ``. Tier: ``. Static provenance only; merge authority stays with the owner. + +| Axis | Disposition | +| :--- | :--- | +| Spec & Scope | Pass | +| Standards & Smells | Pass | +| Seam & Test Integrity | Pass | +| Defensive Invariants | Pass | + +No non-rejected findings. +``` + `inline-comments.json` (the `gt pr review --comments-file` format; `new_position` is the line number in the new version of the file and must fall inside a diff hunk): ```json [ diff --git a/tests/fixtures/test_skills_behavioral_contracts.py b/tests/fixtures/test_skills_behavioral_contracts.py index 9b15744..e52446f 100755 --- a/tests/fixtures/test_skills_behavioral_contracts.py +++ b/tests/fixtures/test_skills_behavioral_contracts.py @@ -368,9 +368,10 @@ class TestSkillsBehavioralContracts(unittest.TestCase): """Proves code-review only drafts the PR comment block and gitea-pr alone posts it, guarded.""" cr_dir = REPO_ROOT / "skills" / "code-review" cr_text = "\n".join(p.read_text() for p in cr_dir.rglob("*.md")) - # code-review drafts the block but never contains a posting command + # code-review drafts the block (including clean Ready reviews) but never contains a posting command self.assertIn("review-body.md", cr_text) self.assertIn("inline-comments.json", cr_text) + self.assertIn("No non-rejected findings.", cr_text) self.assertIsNone( re.search(r"gt pr (comment|review)\s+<", cr_text), "code-review must not contain gt posting commands; gitea-pr owns publishing",