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 d3e402c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(fork-sync): a sync session folds the stack before its hand-off, so the driver stays the only trunk writer (#1902)
## Problem
`fork:fold publish` force-pushed `hyprws` through the ruleset's admin bypass.
That made it a second trunk writer beside the land run, against #1886.
The automated sync path never ran a fold, so fix-of-fix noise piled up on the trunk.
## Change
- **Deleted:** `fork:fold publish` and its tests
- **Fold:** a fork-sync step after a green run
- **Where:** the kept worktree, `--base <tag>`
- **Landing:** the next rerun's marker
- **Gate:** candidate CI and the lease, unchanged
- **Job budget:** fold only before 20 minutes gone
- **Job disk:** allows `apply`'s rebase worktree
The driver needs no change: an adopted, finished worktree lands any `HEAD` that contains the tag.
A fold is tree-equal, so `lostHooks` and the link guard read it like the unfolded tip.
## Scope and approval
The human asked for the fold to be part of the automated sync process.
rsi-pr-agent needs no change: the job reads the fork-sync skill.
## Verification
- fork-fold and fork-sync tests → 112/112
- `vp run fork:ci` → exit 0
Claude Opus 5.5 via Claude Code.
## Fork trailers
Fork-Domain: fork-meta
Fork-Tier: bugfix
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>
Copy file name to clipboardExpand all lines: .agents/skills/fork-fold/SKILL.md
+31-18Lines changed: 31 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,13 @@
1
1
---
2
2
name: fork-fold
3
-
description: Fold the RSI-Software/t3code-hyprws ahead commits to one PR-sized intent each: list the stack, write a plan, replay it, prove it, publish with the lease. Use on demand after a sync or landing leaves fix-of-fix noise on hyprws.
3
+
description: Fold the RSI-Software/t3code-hyprws ahead commits to one PR-sized intent each: list the stack, write a plan, replay it, prove it, hand it off through the fork-sync marker. Use inside a fork-sync session after a green run, or when fork-sync points here.
4
4
---
5
5
6
6
# Fork fold
7
7
8
8
Keep each ahead commit one PR-sized intent, so a seam conflicts once per replay, not once per commit.
9
-
The agent picks the folds; `scripts/fork-fold.ts` only lists, applies, and publishes.
9
+
The agent picks the folds; `scripts/fork-fold.ts` only lists, applies, and proves.
10
+
It never writes `hyprws`: the fold lands through the [fork-sync](../fork-sync/SKILL.md) marker, so the land run stays the only trunk writer.
10
11
11
12
## Scope
12
13
@@ -17,18 +18,29 @@ The agent picks the folds; `scripts/fork-fold.ts` only lists, applies, and publi
17
18
18
19
## Run
19
20
20
-
From a checkout with `origin/hyprws` and `upstream/main` fetched:
21
+
In the fork-sync kept worktree, after a green `vp run fork:sync <tag>`:
21
22
22
23
```bash
23
-
vp run fork:fold list --head origin/hyprws
24
-
vp run fork:fold apply plan.tsv --head origin/hyprws
25
-
vp run fork:fold publish origin/hyprws <tip>
24
+
vp run fork:fold list --base <tag> --head HEAD
25
+
vp run fork:fold apply ../fold.tsv --base <tag> --head HEAD
26
+
vp run fork:fold prove --base <tag> HEAD <tip>
27
+
git checkout --detach <tip>
26
28
```
27
29
28
30
1.**List:** domains, files, stack positions
29
-
2.**Plan:** per the [fold rule](#fold-rule)
30
-
3.**Apply:** prints `<tip>`; moves no ref. The fast path replays with merge-tree; from the first refused block the remaining plan finishes as one autosquashed rebase in a worktree under the git common dir, kept until the fold finishes; at each stop the agent resolves and reruns the same apply command
31
-
4.**Publish:** refuses unless local hyprws sits at `<old>` and the worktree where hyprws is checked out is clean; proves, then pushes with the [expected-old lease][lease] and moves the [local trunks][trunk]; a failed proof pushes nothing
31
+
2.**Plan:**`../fold.tsv`; [fold rule](#fold-rule)
32
+
3.**Apply:** prints `<tip>`; moves no ref
33
+
4.**Prove:**`<old>` is the unfolded `HEAD`
34
+
5.**Move:** detach the kept worktree at `<tip>`
35
+
6.**Rerun** the sync, then [hand off][handoff]
36
+
37
+
[handoff]: ../fork-sync/SKILL.md#hand-off
38
+
39
+
`apply` replays with merge-tree; from the first refused block the rest of the plan finishes as one autosquashed rebase in a worktree under the git common dir.
40
+
At each stop, resolve there and rerun the same apply command.
41
+
The fold is tree-equal, so the move changes nothing on disk.
42
+
The land run gates the folded tip like any sync tip: candidate CI, then the [expected-old lease][lease].
43
+
An apply stop or failed proof moves nothing: hand off the unfolded marker.
32
44
33
45
A conflict on a path the stack base lacks is fork-owned: `apply` resolves it to the old head, or drops it when the head lacks it.
34
46
Only upstream-owned conflicts stop, since only they recur on a rebase.
@@ -37,7 +49,6 @@ A middle commit may then hold a fork-owned file's final form early; only the tip
37
49
A fold is tree-equal but rewrites commit boundaries: the release delta revision changes, and a nightly may republish the same tree.
Copy file name to clipboardExpand all lines: docs/fork/internals/fork-development.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ Fork-only paths need no granularity curation.
164
164
### Fold to stay tight
165
165
166
166
Fold the ahead commits to one PR-sized intent each: a feature absorbs its fixes and resolutions, so a seam conflicts once per replay, not once per commit.
167
-
The [`fork-fold`](../../../.agents/skills/fork-fold/SKILL.md) skill runs it.
167
+
The [`fork-fold`](../../../.agents/skills/fork-fold/SKILL.md) skill runs it inside a sync session, so the fold lands through the sync marker.
168
168
Replay sees each commit, not the net, so an upstream line one commit deletes and a later one restores conflicts on every rebase; [`fork:stale-delete`](../../../scripts/lib/fork-stale-delete.ts) refuses that pair in `fork:ci`.
169
169
Fold commits that share one owning intent or cancel each other's upstream hunks, never only because they share a domain.
170
170
A cancelling pair across domains cannot share a plan line: drop both hunks by hand at the fold, and `prove` checks the tree.
0 commit comments