Files
skills/skills/gitea-pr/references/pr-lifecycle.md
T
kiskaadee a11d942554 feat(code-review): draft PR comment blocks for gitea-pr to publish
- 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.
2026-11-15 14:11:59 -05:00

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] ----+
  1. Draft (WIP): PR opened early for visibility. In Gitea, prefixed with WIP: or flagged --draft. CI may run; reviews are informal.
  2. Review: Feature complete, working tree clean, static code-review and runtime verify-slice evidence packets attached. Ready for formal audit.
  3. Changes Requested: Reviewer identified defects, missing tests, or security concerns. Agent addresses feedback, commits fixes via git-manager, and refreshes evidence.
  4. Ready for Merge: All review threads resolved, static review confirms Ready, runtime checks pass, and mergeability is green.
  5. 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:

  1. Extract review comments:
    gt pr review comments <number>
    
  2. 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-review comment block arrive pre-labelled with their ID, disposition, and follow-up route (record or issue); keep those labels instead of re-categorizing.
  3. Implement fixes on the feature branch:
    • Use tdd or direct edits.
    • Commit fixes incrementally following git-manager conventions (e.g. fix(gitea-pr): address review feedback).
  4. Re-verify after changes:
    • Run code-review to confirm the updated diff fingerprint is clean.
    • Run verify-slice to substantiate runtime assertions.
  5. 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>
  6. 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 Ready code review implies permission to execute gt pr merge.
  • The human owner reviews the consolidated ledger, assesses residual risks, and explicitly authorizes merge execution.