- code-review: new step 8 drafts review-body.md and inline-comments.json when the target is an open PR; finding-schema section 4 defines contents (all non-rejected findings), inline/body placement, record/issue follow-up routing, and SHA-scoped finding identity across re-reviews. code-review never posts, keeping it a read-only inspector. - gitea-pr: new step 6 publishes the block as one comment-only review pinned with --commit, after owner approval; gt-pulls recipe adds head_sha staleness, pending-review, and duplicate-SHA guards and forbids --approve, --request-changes, and --yes. Findings routed to an issue get one via gitea-plan first so the comment links to tracked work. - pr-lifecycle: triage keeps the published ID, disposition, and route labels. - tests: contract test asserting code-review has no posting commands and the gitea-pr publish recipe keeps its guards ahead of the post command. Motivated by lg-smtv-mcp PR #6, where nits were posted manually as a top-level comment on request.
4.1 KiB
4.1 KiB
Pull Request Lifecycle and Evidence Synthesis
Reference for gitea-pr. Defines PR states, evidence synthesis template, and feedback triage workflow.
1. Pull Request Lifecycle States
Draft (WIP) -> Review -> Changes Requested -> Ready for Merge -> Merged
| |
+-- [Rework/Fix] ----+
- Draft (WIP): PR opened early for visibility. In Gitea, prefixed with
WIP:or flagged--draft. CI may run; reviews are informal. - Review: Feature complete, working tree clean, static
code-reviewand runtimeverify-sliceevidence packets attached. Ready for formal audit. - Changes Requested: Reviewer identified defects, missing tests, or security concerns. Agent addresses feedback, commits fixes via
git-manager, and refreshes evidence. - Ready for Merge: All review threads resolved, static review confirms
Ready, runtime checks pass, and mergeability is green. - Merged: Merged into target base branch by the human owner. Associated issues are closed automatically by Gitea.
2. Standard PR Description Template
Every PR description synthesizes static provenance and runtime evidence into a transparent record:
Closes #<issue-index>
## Summary of Changes
<Concise overview of what was built, why, and what architectural decisions were made.>
## Scope & Non-Goals
- **In Scope**: <Itemized list of changes included in this PR>
- **Out of Scope**: <Explicitly deferred items or non-goals>
## Static Review Provenance (`code-review`)
- **Base Commit**: `<base-sha>` -> **Head Commit**: `<head-sha>`
- **Committed Diff Fingerprint**: `sha256:<hash>`
- **Axes Breakdown**:
- Spec & Scope: Pass
- Standards & Smells: Pass
- Seam & Test Integrity: Pass
- Defensive Invariants: Pass
- **Review Status**: `Ready`
## Runtime Verification Ledger (`verify-slice`)
| Check ID | Perspective | Scope | Description | Outcome |
| :--- | :--- | :--- | :--- | :--- |
| RV-01 | Behavioral / Seam | local | Unit & integration suite execution | PASS |
| RV-02 | State & Concurrency | local | Race condition & lock invariant check | PASS |
| RV-03 | Security / Host Boundary | local | Host socket validation boundary | PASS |
## Residual Risks & Operational Considerations
- **Environment Prerequisites**: <Any required environment variables, sockets, or permissions>
- **Reversibility**: <How to cleanly revert this slice if unexpected regressions occur>
3. Review Feedback Triage Workflow
When comments or change requests arrive on a PR:
- Extract review comments:
gt pr review comments <number> - Categorize comments:
- Defects & Invariants: Logic errors, broken tests, edge-case crashes (require code fix).
- Spec & Scope Clarifications: Questions about intent or architectural fit (require response or doc update).
- Nits / Polish: Minor style preferences that do not violate repo standards (human owner decides priority).
Findings published from a
code-reviewcomment block arrive pre-labelled with their ID, disposition, and follow-up route (recordorissue); keep those labels instead of re-categorizing.
- Implement fixes on the feature branch:
- Use
tddor direct edits. - Commit fixes incrementally following
git-managerconventions (e.g.fix(gitea-pr): address review feedback).
- Use
- Re-verify after changes:
- Run
code-reviewto confirm the updated diff fingerprint is clean. - Run
verify-sliceto substantiate runtime assertions.
- Run
- Reply and resolve threads via
gt pr:- Reply to comment:
gt pr review reply <number> <comment-id> "Fixed in <sha>" - Resolve thread:
gt pr review resolve <comment-id>
- Reply to comment:
- Push updates to remote:
git push origin <branch>
4. Release Authority Guardrail
Automated skills and checks inform the human owner; they never make the merge decision independently:
- Neither passing unit tests nor a
Readycode review implies permission to executegt pr merge. - The human owner reviews the consolidated ledger, assesses residual risks, and explicitly authorizes merge execution.