|
1 | 1 | --- |
2 | | -description: Append-only PR body updates — never clobber existing PR descriptions (READ → backup → merge → write) |
| 2 | +description: Append-only PR body updates when human override authorizes a body edit (Layers 1–6) |
3 | 3 | alwaysApply: true |
4 | 4 | --- |
5 | 5 |
|
6 | | -# Append-only PR body workflow |
| 6 | +# Append-only PR body workflow (Layers 1–6 — after human override only) |
7 | 7 |
|
8 | | -`ManagePullRequest update_pr`, `gh pr edit`, and GitHub's API **replace the entire PR body** when `body` is set. Passing only the latest follow-up paragraph deletes the original Summary and any CodeRabbit release notes. |
| 8 | +**Layer 0 applies first:** `.cursor/rules/pr-body-comment-only.mdc` — Cursor agents |
| 9 | +**comment only** by default. This file governs body writes **only** when the human |
| 10 | +set `CURSOR_PR_BODY_HUMAN_OVERRIDE_ACK=1` in the current session. |
9 | 11 |
|
10 | | -**NEVER** use `ManagePullRequest update_pr` with delta-only `body=`. Use `append-pr-body.sh` instead. |
| 12 | +`ManagePullRequest update_pr`, `gh pr edit`, and GitHub's API **replace the entire PR body** |
| 13 | +when `body` is set. Passing only the latest follow-up paragraph deletes the original Summary. |
11 | 14 |
|
12 | 15 | **Canonical skill:** `bin/orama-system/skills/cursor-pr-body/SKILL.md` |
13 | 16 | **Incident ledger:** `bin/orama-system/references/pr-body-anti-clobber-incident-ledger.md` |
14 | | -**Canonical script:** `scripts/cursor/append-pr-body.sh` |
15 | | -**Curriculum:** `bin/orama-system/cidf/references/integrative-editing-examples.md` §1 |
| 17 | +**Canonical script:** `scripts/cursor/append-pr-body.sh` |
16 | 18 |
|
17 | | -## Non-negotiable workflow |
| 19 | +## Non-negotiable workflow (human-authorized body edit only) |
18 | 20 |
|
19 | 21 | | Step | Action | |
20 | | -|------|--------| |
| 22 | +| ---- | ------ | |
21 | 23 | | 1. **READ** | `gh pr view <N> --repo <owner/repo> --json body --jq .body` | |
22 | 24 | | 2. **BACKUP** | Save to `.git/pr-body-backups/<repo-slug>-pr<N>-<UTC-timestamp>.md` | |
23 | | -| 3. **MERGE** | Keep original `## Summary` and scope at top; append `## Follow-up: …` blocks chronologically; preserve CodeRabbit auto-generated sections and Cursor metadata below unchanged | |
24 | | -| 4. **WRITE** | Full merged body only — never delta-only | |
| 25 | +| 3. **MERGE** | Keep original `## Summary`; append `## Follow-up:` chronologically | |
| 26 | +| 4. **WRITE** | `append-pr-body.sh` or `gh pr edit --body-file` with **full** merged body | |
25 | 27 |
|
26 | | -## Preferred write path |
| 28 | +## Forbidden (even with human override) |
27 | 29 |
|
28 | | -```bash |
29 | | -bash scripts/cursor/append-pr-body.sh <owner/repo> <pr-number> \ |
30 | | - --title "Follow-up: <short title>" \ |
31 | | - --file follow-up.md |
32 | | -``` |
33 | | - |
34 | | -Or: edit the backup copy integratively, then `gh pr edit <N> --repo <owner/repo> --body-file merged-body.md`. |
35 | | - |
36 | | -## Tool-specific constraints |
37 | | - |
38 | | -| Tool | Rule | |
39 | | -|------|------| |
40 | | -| `append-pr-body.sh` | Inserts before `<!-- CURSOR_AGENT_PR_BODY_END -->` or CodeRabbit marker; aborts if body changed since read | |
41 | | -| `ManagePullRequest update_pr` | **Avoid.** Agent-managed PRs only; if unavoidable, pass **full** integrative merged body — never delta-only. Prefer `append-pr-body.sh` | |
42 | | -| `gh pr edit` | Requires token with `updatePullRequest` scope; same full-body rule applies | |
43 | | - |
44 | | -## Forbidden |
45 | | - |
46 | | -- `update_pr` / `gh pr edit` with `body=` containing only the latest paragraph or CI delta |
47 | | -- Rewriting or deleting the original Summary to match a side quest (aguara, harmonization, etc.) |
| 30 | +- Delta-only `body=` containing only the latest paragraph or CI delta |
48 | 31 | - Skipping backup because "it's a small follow-up" |
49 | | -- Hand-editing CodeRabbit `<!-- release notes by coderabbit.ai -->` blocks unless explicitly fixing a factual error |
50 | | - |
51 | | -## When to append |
52 | | - |
53 | | -- Stack harmonization / rebase notes after resolving conflicts |
54 | | -- CodeRabbit or human review fixes applied in a follow-up commit |
55 | | -- CI failure root cause + verification command output |
56 | | -- Post-merge integration status across a PR chain (#244 → #245 → …) |
57 | | - |
58 | | -## Insertion order |
59 | | - |
60 | | -New `## Follow-up:` blocks go **below** the original agent summary and **above** CodeRabbit auto-generated release notes (when present). Chronological order — never reorder prior follow-ups. |
| 32 | +- Reordering or deleting prior follow-ups |
0 commit comments