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 de9176b
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
rsi-pr-agent
committed
fix(fork-sync): the trunk moves only to a sha hyprws CI passed on sync/candidate (#1701)
## Problem
A sync lease-pushed its rebased tip straight to `hyprws` after a local check battery.
The battery approximated `hyprws CI` but never equalled it, so a green sync could still leave the trunk red and block the nightly.
## Change
The sync driver now moves the trunk only to a sha that `hyprws CI` already passed.
1. Force-push the rebased tip to `sync/candidate`
2. Poll that sha's `hyprws CI` push run
3. Green: lease-push the same sha to `hyprws`
4. Red: `hyprws` stays; the worktree keeps the tip
### Driver
- **Battery**: deleted, with `fork-ci-jobs.ts`
- **Report**: `checks[]` becomes `ci` (schema v2)
- **Reuse**: a sha's run, e.g. a dry run's green
- **Flake**: resume names `gh run rerun --failed`
- **Give-up**: no run in 5 min, or 1 h; wall time
- **Retry**: same sha recreates the candidate ref
### CI and workflows
- **Candidate `fork:ci`**: scans from the new base
- **Stale-delete**: skipped; all commits replay
- **`hyprws CI`**: runs on `sync/candidate` pushes
- **Sync job**: gains `actions: read`
- **Release**: unchanged; trigger filters `hyprws`
### Fixup-fold check
Closes#1700: every `hyprws` PR's `Check` went red here.
- **Cause**: lazy blob fetch mid-replay
- **Symptom**: GitHub refuses it, `not our ref`
- **Fix**: fetch the replay's blobs in one batch
- **Replay**: runs with lazy fetches off
## Scope and approval
Maintainer-directed in session: option A of the fork-sync audit (candidate branch, CI green, then trunk push).
## Verification
- [x] **Focused tests**: 5 files, 92 passed
- [x] **Driver**: order, reuse, retry, red, slow reads
- [x] **Checks**: scripts typecheck, `fork:ci` exit 0
- [x] **Ledger**: synthetic candidate `rebased=true`
- [x] **Fold**: CI-shaped clone, git 2.56, exit 0 twice
- [ ] **Live**: candidate dry run after merge
Claude Opus 5.5 via Claude Code in T3 Code.
## Fork trailers
Squashes:
- db464ee fix(fork-sync): the trunk moves only to a sha hyprws CI passed on sync/candidate (#1701) (#1701)
- 88209b0 fixup! fix(fork-sync): the trunk moves only to a sha hyprws CI passed on sync/candidate (#1701) (#1701)
Fork-Domain: fork-meta
Fork-Tier: core
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>
|Branch |`sync/candidate`, force-pushed with the tip; unprotected|
41
+
|Run | the full`hyprws CI` push run on that sha |
42
+
|Reuse | a sha that already has a run reuses it; no second push |
43
+
|Wait | gives up if no run starts in 5 minutes or ends in an hour|
44
+
|Push | only the sha the run passed, under the lease|
45
+
|Red|`hyprws` stays put; `ci.jobs` names each red job |
46
+
|Scope |`fork:ci` scans from the new base and skips stale-delete|
47
+
48
+
A candidate replays every fork commit, so stale-delete has nothing new to judge.
49
49
50
50
`fork-fold` publishes only a tree-equal fold, so it inherits the same guarantee.
51
51
@@ -74,7 +74,7 @@ Issue comments are projections of it: never parse one, and never treat an edit t
74
74
|`lease`| The fetched `origin/hyprws` sha the push is leased against |
75
75
|`trunk`| Trunk before and after |
76
76
|`conflicts[]`| Every stop's path, fork and upstream commit, resolution |
77
-
|`checks[]`| The check battery and each verdict |
77
+
|`ci`| The candidate's `hyprws CI` run, conclusion, and jobs|
78
78
|`decision`| A blocked run's or kept tip's worktree, paths, and resume |
79
79
80
80
Decisions persist to the report before any comment posts.
@@ -139,12 +139,12 @@ Autosquash discards a fixup's body, so a reason worth keeping goes in its own co
139
139
140
140
**Kept sync worktree.** Created through the `t3.json` setup step, so a stop has dependencies installed.
141
141
It carries every stop's rows between runs, so the report keeps them.
142
-
A green dry run or a refused push keeps it, so its tip and tip fixups reach the next run.
142
+
A red candidate, a green dry run, or a refused push keeps it, so its tip and tip fixups reach the next run.
143
143
Rerun after each stop: the report records only the stops a run saw.
144
144
145
145
## Failure lifecycle
146
146
147
-
A run that fails on a non-blocked step (target, fetch, rebase, check, push, or a crash) rewrites one standing failure issue the same way a block does, through the same `gh` route.
147
+
A run that fails on a non-blocked step (target, fetch, rebase, ci, push, or a crash) rewrites one standing failure issue the same way a block does, through the same `gh` route.
@@ -185,13 +185,14 @@ Conflict tables live in the block issue.
185
185
186
186
Create a fine-grained token owned by the automation actor, scoped to this repository, with read-and-write **Contents** and **Workflows**.
187
187
Store it as the `HYPRWS_MIRROR_TOKEN` Actions secret.
188
-
The workflow uses its own `GITHUB_TOKEN` with `issues: write`; never widen the token.
188
+
Only its push of `sync/candidate` starts `hyprws CI`; a `GITHUB_TOKEN` push starts no workflow.
189
+
The workflow uses its own `GITHUB_TOKEN` with `actions: read` and `issues: write`; never widen the token.
189
190
190
191
### Which events run the fork matrix
191
192
192
193
`hyprws-ci.yml` produces every context the `hyprws` ruleset requires: `Check`, `Test`, `Test Scripts`, `Test Web`, `merge-tree`, and three `Test Server` shards.
193
194
`hyprws-body.yml` stays advisory: no ruleset requires its `Body` context.
194
-
It runs on a pull request opened, pushed to, or reopened, on a push to a fork trunk or release branch, and on `merge_group`.
195
+
It runs on a pull request opened, pushed to, or reopened, on a push to a fork trunk, release branch, or `sync/candidate`, and on `merge_group`.
195
196
196
197
It skips `ready_for_review`, already covered on that draft head.
197
198
Add the `merge_group` trigger before requiring a queue in the ruleset.
@@ -253,7 +254,7 @@ T3 Connect stays dark unless all four repository variables exist:
253
254
|**Trunk lease rejected**|`decision.tip` keeps the tip; inspect, rerun; never `--force`|
254
255
|**A blocked issue remains**| Unblock by hand. Retirement needs a traced decision |
255
256
|**A failure issue remains**| Inspect the report, fix, and rerun; the next clean run closes it |
256
-
|**Check battery red**| Fix by pull request; never weaken a check |
257
+
|**Candidate CI red**| Fix in the kept worktree, or `gh run rerun --failed` a flake|
257
258
|**Stable release fails**| Fix and rerun. Never move a published tag |
0 commit comments