feat(code-review): draft compact 4-axis Ready review-body.md on clean PRs
- skills/code-review/references/finding-schema.md: add clean Ready 4-axis pass template for review-body.md (omitting inline-comments.json) so every reviewed PR head has a commit-pinned Gitea record - skills/code-review/SKILL.md: update Step 8 to draft review-body.md on clean Ready PR reviews as well - tests/fixtures/test_skills_behavioral_contracts.py: assert clean Ready PR review template presence
This commit is contained in:
1 parent
15406b46cc
commit
a42120b1aa
3 files changed
+20
-3
No files matched your search
@@ -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.
|
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).
|
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.
|
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
|
## Your call
|
||||||
- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
|
- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ When the review target is an open pull request, `code-review` also drafts a PR c
|
|||||||
|
|
||||||
### What goes in
|
### What goes in
|
||||||
- Every finding except `Rejected` ones (those stay in the local ledger only).
|
- 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)
|
### Per-finding routing (proposed here, decided by the owner)
|
||||||
| Field | Values | Rule |
|
| Field | Values | Rule |
|
||||||
@@ -129,6 +129,22 @@ Covered state: `<Clean | fingerprint>`. Tier: `<tier>`. Static provenance only;
|
|||||||
- **CR-02** (`<location>`): <invariant, impact, and suggested change>.
|
- **CR-02** (`<location>`): <invariant, impact, and suggested change>.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`review-body.md` (clean `Ready` review with zero non-rejected findings; omit `inline-comments.json`):
|
||||||
|
```markdown
|
||||||
|
**Code review @ `<short-head-sha>`** (`<base-ref>`..`<head-ref>`): `Ready`
|
||||||
|
|
||||||
|
Covered state: `<Clean | fingerprint>`. Tier: `<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):
|
`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
|
```json
|
||||||
[
|
[
|
||||||
|
|||||||
+2
-1
@@ -368,9 +368,10 @@ class TestSkillsBehavioralContracts(unittest.TestCase):
|
|||||||
"""Proves code-review only drafts the PR comment block and gitea-pr alone posts it, guarded."""
|
"""Proves code-review only drafts the PR comment block and gitea-pr alone posts it, guarded."""
|
||||||
cr_dir = REPO_ROOT / "skills" / "code-review"
|
cr_dir = REPO_ROOT / "skills" / "code-review"
|
||||||
cr_text = "\n".join(p.read_text() for p in cr_dir.rglob("*.md"))
|
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("review-body.md", cr_text)
|
||||||
self.assertIn("inline-comments.json", cr_text)
|
self.assertIn("inline-comments.json", cr_text)
|
||||||
|
self.assertIn("No non-rejected findings.", cr_text)
|
||||||
self.assertIsNone(
|
self.assertIsNone(
|
||||||
re.search(r"gt pr (comment|review)\s+<", cr_text),
|
re.search(r"gt pr (comment|review)\s+<", cr_text),
|
||||||
"code-review must not contain gt posting commands; gitea-pr owns publishing",
|
"code-review must not contain gt posting commands; gitea-pr owns publishing",
|
||||||
|
|||||||
Reference in new issue
Block a user