You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aafd1e1
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
fix(fork): folds never drop a PR link, and a plan line can attach one (#1498)
## Problem
A refold drops PR links an older fold wrote as a bare `(#N)` on its member lines: `forkPullRequests` harvests only full `RSI-Software/t3code-hyprws#N` refs there.
The 2026-10-02 sync refold lost `#395` this way; `#29` and `#177` went earlier.
## Change
- **Harvest:** `forkPullRequests` also reads a bare `(#N)` on `Squashes:` member lines
- **Guard:** `prove` runs a link guard; it refuses a fold that drops any link an old commit cites
- **Backfill:** a plan field `RSI-Software/t3code-hyprws#N` attaches that link to the line's lead member line; a lone member then renders as a fold
- **Docs:** fork guide and `fork-fold` skill state the rule and the plan field
On today's trunk the bare harvest already rescues 7 links that the next refold would have dropped (`#118`, `#142`, `#174`, `#178`, `#183`, `#671`, `#753`).
## Scope and approval
Refs #1491
Implements its decision rows: harvest, guard, backfill on the next fold, no pin tags or extra refs.
No trunk history is rewritten here, so the backfill conditions stay open until the next fold publishes with these plan lines:
```text
be0d8ab#395c12585f#1772613b16#29
```
The other eight links still need an attach-or-retire call at that fold.
## Verification
```text
vp test run scripts/fork-fold.test.ts → exit 0 (32 passed)
vp run typecheck (scripts) → exit 0
vp run fork:ci → exit 0
```
<details>
<summary>Dry-run backfill on origin/hyprws b4b09b8 (no ref moved)</summary>
An identity plan of all 139 ahead commits plus the three link fields above:
```text
fork:fold apply → 139 commits → 139 on 9f65218585
- be0d8ab feat(desktop): launch Electron … (#224) (#224) (#395)
- c12585f feat(agents): select custom main-thread agents (#31) (#31) (#177)
- 2613b16 refactor(web): centralize thread route navigation (#1480) (#29)
fork:fold prove origin/hyprws 9f65218585
member guard → 0 finding(s)
link guard → 0 finding(s)
git diff --quiet → exit 0
fork:delta --check → exit 0
fork:scan --replay-of b4b09b8 → exit 0
```
</details>
Claude Opus 5.5, Claude Code.
## Fork trailers
Squashes:
- be0770d fix(fork): folds never drop a PR link, and a plan line can attach one (#1498) (#1498)
- 6d6fe23 fixup! fix(fork): folds never drop a PR link, and a plan line can attach one (#1498) (#1498)
Fork-Domain: fork-meta
Fork-Tier: core
Co-authored-by: donjor <[email protected]>
-**Fold:** lead prose, `Squashes:` with each member's PR references, merged trailers
58
58
59
+
A `RSI-Software/t3code-hyprws#N` field attaches that PR link to the lead's `Squashes:` line; a lone member then renders as a fold.
60
+
Backfill a link an earlier fold lost this way.
61
+
59
62
## Fold rule
60
63
61
64
One PR-sized intent per output commit: a feature absorbs its fixes and resolutions.
@@ -80,7 +83,7 @@ Split each one on a detached copy of the head (`git worktree add --detach <dir>
80
83
81
84
Run the fold with `--head <split head>`: each fixup joins its owner's plan line and squashes there, so the owner's `Squashes:` lists its own old sha, the repair sha, and the repair's references.
82
85
`prove` and `publish` take the pre-split tip as `<old>`; a tree-equal fold needs no retest.
83
-
`prove` also refuses a commit naming no `<old>` member or touching a path none of its members touched, and an old commit owned by no new commit or, unless it carries `Fork-Repair`, by several.
86
+
`prove` also refuses a dropped PR link, a commit naming no `<old>` member or touching a path none of its members touched, and an old commit owned by no new commit or, unless it carries `Fork-Repair`, by several.
A generic fix in no product domain is `upstream-fixes`.
105
105
New commits land on top and move down at the next rebase.
106
106
Reorder only on a clean stack; publish with a lease.
107
-
A squash lists its members under `Squashes:`, one `- <sha> <subject>` line each plus every PR reference the member carried, so the rebase scan reads every member as a replay counterpart; a refold keeps the links an earlier fold gathered.
107
+
A squash lists its members under `Squashes:`, one `- <sha> <subject>` line each plus every PR reference the member carried, so the rebase scan reads every member as a replay counterpart.
108
+
A refold keeps every link an earlier fold gathered, bare `(#N)` markers included, and `prove` refuses a fold that drops one.
0 commit comments