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 61f197e
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
fix(fork-sync): a conflict on a generated file reruns its generator (#1500)
## Problem
A sync rebase stopped on a conflicted generated file (`pnpm-lock.yaml`, `apps/web/src/routeTree.gen.ts`) or on the license list both sides append to.
Each stop cost a manual run, and a hand-merged lockfile could land.
## Change
The stop loop routes these paths through `REGENERATION_ROUTES` in `scripts/fork-sync.ts`, in table order, once every other path in the stop resolves.
| Path | Resolver |
| --- | --- |
| `pnpm-lock.yaml` | `vp install --lockfile-only` in the sync worktree |
| `third-party-licenses.config.json` | merge by package name, then `vp fmt` |
| `apps/web/src/routeTree.gen.ts` | `vp run fork:regenerate-route-tree <worktree>` from the trunk install |
| Rule | Behavior |
| --- | --- |
| Generators | restore from `HEAD`, rerun, stage |
| License merge | three-way union keyed on `name` (`scripts/lib/fork-license-merge.ts`) |
| Entry order | upstream's, then the fork's additions |
| Refusal | one entry changed on both sides, or deleted vs changed |
| Failure | a `manual` row naming resolver and error |
| Mixed stop | resume hint says rerun, not `rebase --continue` |
| Runbook | `## Regenerable files` in `docs/fork/operations/fork-sync.md` |
## Scope and approval
Closes#1488
- [ ] **Lockfile:** a conflicted fixture regenerates
- [ ] **License list:** both appends survive
- [ ] **Guard:** a test fails on an unrouted path
- [ ] **Runbook:** lists every generated path
Merge by package name was the maintainer's pick (option A) for the license list.
## Verification
```text
vp test run --config vite.config.ts scripts/fork-sync.test.ts scripts/lib/fork-license-merge.test.ts → exit 0 (62 passed)
vp test run --config vite.config.ts scripts/fork-gate-headers.test.ts → exit 0
vp run --filter @t3tools/scripts typecheck → exit 0
vp lint <touched scripts> → exit 0 (2 existing warnings)
vp run fork:delta --check → exit 0
vp run fork:ci → exit 0 (705 scripts tests)
```
| Proof | Test |
| --- | --- |
| Lockfile | both sides relock; generator sees upstream's copy; rebase continues |
| License list | both sides append; trunk keeps both |
| Guard | an unrouted generated path the fork carries fails |
| Runbook | table drift from the routes fails |
| Mutation | dropping the route-tree route fails guard and parity |
Model and harness: Claude Opus 5.5 in Claude Code (T3 Code).
## Fork trailers
Squashes:
- 930bc7d fix(fork-sync): a conflict on a generated file reruns its generator (#1500) (#1500)
- 4f79876 fixup! fix(fork-sync): a conflict on a generated file reruns its generator (#1500) (#1500)
Fork-Domain: fork-meta
Fork-Tier: core
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>
Copy file name to clipboardExpand all lines: .agents/skills/fork-sync/SKILL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,7 @@ Only a `manual` row stops the run.
92
92
93
93
In the rebase, resolve minimally: upstream's text stands, and a marked fork hook goes back verbatim.
94
94
Upstream deleted and the fork edit is net-zero: the deletion stands.
95
+
A [regenerable file](../../../docs/fork/operations/fork-sync.md#regenerable-files) regenerates; when one is pending, skip `git rebase --continue` and rerun.
95
96
Never adapt inside a replayed commit: the hook guard refuses it.
96
97
Adaptation lands once, in one `Fork-Repair` commit at the tip; [`/fork-fold`](../fork-fold/SKILL.md) dissolves it afterward.
Copy file name to clipboardExpand all lines: docs/fork/operations/fork-sync.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,8 @@ Conflict resolution is machine-owned, in this order.
83
83
| 1 | Local rerere replays resolutions within the run's rebase and stages them |
84
84
| 2 | Hook re-apply re-inserts the marked fork hooks a conflicted file declares, from the fork side onto the upstream text |
85
85
| 3 | An upstream delete of a path whose fork trunk blob still equals the base blob (a net-zero fork edit) is accepted with `git rm`|
86
-
| 4 | Anything left is a `manual` row and stops the run |
86
+
| 4 | A [regenerable file](#regenerable-files) regenerates once every other path in the stop resolves |
87
+
| 5 | Anything left is a `manual` row and stops the run |
87
88
88
89
Only upstream moved: upstream's text stands.
89
90
A marked fork hook goes back in verbatim.
@@ -113,6 +114,8 @@ Never post a block to `pingdotgg/t3code`.
113
114
5.`git rebase --continue`.
114
115
6. Rerun `vp run fork:sync <tag>`.
115
116
117
+
A pending regenerable file refuses step 5; skip it, and the rerun regenerates the file and continues.
118
+
116
119
Rerere replays content resolutions but records nothing for a delete/modify: the fix is a driver rule or a pre-adopt commit on `hyprws` (precedent `72666ffe19`, RSI-Software/t3code-hyprws#1227).
117
120
118
121
**Reshape.** Resolve minimally in the rebase: upstream's text plus marked hooks verbatim.
@@ -132,11 +135,18 @@ A run that fails on a non-blocked step (target, fetch, rebase, check, push, or a
132
135
133
136
## Regenerable files
134
137
135
-
A sync keeps the new base's version and reruns the generator after applying fork source inputs.
138
+
On a conflict, the driver resolves each path and stages the result, in table order.
139
+
A generator reruns over the resolved sources, from the path's `HEAD` copy.
140
+
The package-name merge keeps both sides' entries: upstream's order, then the fork's additions.
141
+
A failed resolver leaves a `manual` row naming the failure.
`REGENERATION_ROUTES` in `scripts/fork-sync.ts` owns the rows; a test fails when this table drifts from it, or when the fork carries a generated path neither routes.
140
150
141
151
On a branch that changes a package manifest, regenerate the lockfile before pushing, so a hand-merged lockfile fails there instead of costing a sync run.
0 commit comments