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 633b107
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
refactor(fork): sync adaptations land as owner fixups, not Fork-Repair (#1645)
## Problem
A sync that needed adaptations landed one omnibus `Fork-Repair` commit, then needed a manual `/fork-fold` repair split.
That split cost owner-selection friction and swallowed the retirement explanations.
## Change
### Sync adaptations
| Adaptation | Lands as |
| --- | --- |
| One owner | `fixup! <owner subject>`, owner's trailers |
| No single owner | standalone `upstream-fixes` commit |
| Retirement | its own commit |
The next sync's autosquash absorbs tip fixups; `fork:ci`'s `fork-fixup-fold` proves each one folds.
### Removed
| Area | Removed |
| --- | --- |
| Trailer | `Fork-Repair`, its parsing and inventory skip |
| Fold | repair split, `--old`, `citeOld`, forced fallback |
| Skill | post-sync `/fork-fold` step |
### Smaller fixes
| Area | Fix |
| --- | --- |
| Fold | plain `fixup!` renders as a member |
| Battery | red `fork:ci` skips later rows (⏭️) |
| Push refusal | worktree kept, `decision.tip` set |
| Hook guard | remedy names the tip-fixup route |
| Skill | name a tag only when the user does |
## Scope and approval
Agreed with the maintainer in-session: accept tip fixups, no separate adaptation record.
Closes#1633
- [x] Message: a replay refusal names the tip-repair route
- [x] Test: fork-hook-guard.test.ts asserts it
| Refs | Why open |
| --- | --- |
| #1632 | live condition needs the next retiring sync |
| #1635 | documented reset stays; no driver move |
## Verification
| Command | Result |
| --- | --- |
| `vp test run` on 6 touched script test files | exit 0, 169 tests |
| `vp test run scripts/lib/fork-hook-guard.test.ts` | exit 0, 11 tests |
| `vp exec tsc --noEmit` in `scripts` | exit 0 |
| `vp run fork:ci` | exit 0 |
<details>
<summary>New regression tests</summary>
| Test | Proves |
| --- | --- |
| Tip fixup stack | each folds at its owner, every member proven |
| Mixed fixups | plain and landed under one owner |
| Refused push | tip kept; a rerun publishes it |
| Red battery | only `fork:ci` runs, rest skipped |
</details>
Claude Opus 5.5, Claude Code in T3 Code.
## Fork trailers
Squashes:
- 5216fdf refactor(fork): sync adaptations land as owner fixups, not Fork-Repair (#1645) (#1645)
- ee7866f fixup! refactor(fork): sync adaptations land as owner fixups, not Fork-Repair (#1645) (#1645)
Fork-Domain: fork-meta
Fork-Tier: qol
Co-authored-by: donjor <[email protected]>
| A `fixup! <subject>` landing or sync tip |`fork:sync`, folded at the next rebase |
16
+
| Ordinary commits, now landed | This skill |
17
17
18
18
## Run
19
19
@@ -62,7 +62,6 @@ Backfill a link an earlier fold lost this way.
62
62
## Fold rule
63
63
64
64
One PR-sized intent per output commit: a feature absorbs its fixes and resolutions.
65
-
A `Fork-Repair` commit never survives the fold: [split it first](#repair-split).
66
65
67
66
Fold when both hold:
68
67
@@ -71,30 +70,27 @@ Fold when both hold:
71
70
72
71
The plan refuses a mixed-domain line: across domains the ledger would lose one.
73
72
74
-
## Repair split
73
+
## Prove
75
74
76
-
A `Fork-Repair` commit dissolves before the run, so no repair lands in the fold.
77
-
Split each one on a detached copy of the head (`git worktree add --detach <dir> <head>`):
75
+
`prove` and `publish` take the published tip as `<old>`; a tree-equal fold needs no retest.
76
+
`prove` also refuses:
78
77
79
-
1.`git rebase -i <first repair>^` and mark every `Fork-Repair` commit `edit`. Commits before the first repair keep their shas — the rebase never replays them — and owners always precede the repairs they absorb, so `Squashes:` keeps resolving against the old tip.
80
-
2. At each stop: `git reset HEAD^`; stage each owner's hunks and commit them as `fixup! <owner subject>` with the owner's trailers and the repair's line under `Squashes:` — `list` prints that line under every repair.
81
-
3. One inseparable remainder: a single `upstream-fixes` commit naming the upstream change it adapts to, without `Fork-Repair`.
82
-
4.`git rebase --continue`. The split head is tree-equal to the old tip.
83
-
84
-
Run the fold with `--head <split head> --old <old>`: 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.
85
-
A replayed member cites its `<old>` counterpart by subject, since its split sha sits on no trunk.
86
-
`prove` and `publish` take the pre-split tip as `<old>`; a tree-equal fold needs no retest.
87
-
`prove` also refuses a dropped PR link, a `Squashes:` sha `<old>` never names, 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 by several, unless it carries `Fork-Repair` or every owner cites it under `Squashes:`.
Copy file name to clipboardExpand all lines: .agents/skills/fork-sync/SKILL.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ vp run fork:sync <tag> --dry-run
19
19
20
20
`--dry-run` rebases and checks, then stops: no push, no issue, no publication.
21
21
Any other flag is a defect.
22
+
Name a tag only when the user names one; otherwise run with no tag.
22
23
23
24
A green dry run keeps its tip in the sync worktree for the real run:
24
25
@@ -47,10 +48,6 @@ Post-push recovery reads this file, never a comment.
47
48
48
49
Never edit a report; a rerun supersedes it.
49
50
50
-
## After
51
-
52
-
A repairing sync — the rebased trunk carries `Fork-Repair` commits — ends with [`/fork-fold`](../fork-fold/SKILL.md) once trunk is green: its [repair split](../fork-fold/SKILL.md#repair-split) dissolves each repair into its owners. A sync with no repairs needs no fold.
53
-
54
51
## Stops
55
52
56
53
| Report | Stop |
@@ -76,11 +73,12 @@ Resolve each seam by verdict, then follow Unblock.
| Reshape | Fork side moved too; resolve minimally, adapt at the tip |
79
-
| Retire | Upstream owns it now; traced verdict, drop at rebase |
76
+
| Retire | Upstream owns it now; its own commit, never inside a fixup|
80
77
81
78
### Check battery
82
79
83
80
The battery is red; the worktree keeps the rebased tip.
81
+
A red `fork:ci` skips every later row.
84
82
85
83
-**Red job**: `checks[].job` names it
86
84
-**Trunk-green fix**: by pull request
@@ -90,8 +88,11 @@ The battery is red; the worktree keeps the rebased tip.
90
88
### Lease refusal
91
89
92
90
The expected-old lease lost; someone landed first.
91
+
The worktree keeps the green tip; `decision.tip` names it.
93
92
94
93
-**Inspect**: the trunk
94
+
-**Carry**: tip fixups from `decision.tip`
95
+
-**Moved lease**: the rerun rebases again
95
96
-**Rerun**: never `--force`
96
97
97
98
## Unblock
@@ -103,13 +104,21 @@ In the rebase, resolve minimally: upstream's text stands, and a marked fork hook
103
104
Upstream deleted and the fork edit is net-zero: the deletion stands.
104
105
A [regenerable file](../../../docs/fork/operations/fork-sync.md#regenerable-files) regenerates; when one is pending, skip `git rebase --continue` and rerun.
105
106
Never adapt inside a replayed commit: the hook guard refuses it.
106
-
Adaptation lands once, in one `Fork-Repair` commit at the tip; [`/fork-fold`](../fork-fold/SKILL.md) dissolves it afterward.
107
+
Adaptation lands at the tip, one commit per owner:
0 commit comments