Skip to content

Commit 4c97819

Browse files
donjor-agent[bot]donjor
authored andcommitted
fix(fork-sync): a red candidate starts the fork-sync job (#1855)
## Problem A candidate red at `ci` files the attention issue without `rsi:fork-sync`, so it waits for a human session. #1841 now has no human-review step. ## Change - **Driver:** failed at `ci` adds `rsi:fork-sync` - **Other failures:** still unlabelled - **Loop guard:** an unchanged body never relabels - **Job mode:** a Red candidate procedure - **Definition:** the issue may name red jobs ## Scope and approval Part of #1841: one blocked sync lands with no human session. ## Verification - [x] **Red candidate test:** expects the label - [x] **Failed `check` edit:** still adds no label - [x] `vp test run scripts/fork-sync.test.ts` → 79 ok - [x] `vp run fork:ci` → exit 0 Not yet proven: a live job fixing a red candidate. Claude Opus 5.5 in Claude Code. ## Fork trailers Fork-Domain: fork-meta Fork-Tier: bugfix Fork-Upstreamable: no Co-authored-by: donjor <[email protected]>
1 parent dd1b537 commit 4c97819

5 files changed

Lines changed: 19 additions & 6 deletions

File tree

‎.agents/skills/fork-sync/SKILL.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ PATH=/tmp/fork-bin:$PATH vp run fork:sync <tag> --dry-run
174174

175175
The report's summary ends with `Verify:` and those items: behaviour to exercise once the sync lands.
176176

177+
**Red candidate.** The issue names each red job instead of a seam.
178+
179+
1. Dry run: the rebase replays from `sync/resolution`
180+
2. Read each red job: `gh run view --job <id> --log-failed`
181+
3. Reproduce with `vp test run` inside its package
182+
4. Fix at the tip, per [Candidate CI](#candidate-ci)
183+
5. Rerun, export, and report as above
184+
177185
Every rebase rewrites `refs/fork-sync/resolution` before `ci`, so a `ci` failure in the job is expected.
178186
It is one parentless commit:
179187

‎.rsi-agent/workflows/fork-sync.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ timeout: 45
1010

1111
# Fork sync resolution
1212

13-
This issue is the `hyprws` sync attention issue: a sync stopped on a seam neither rerere nor hook re-apply resolves.
14-
Its title names the target tag; its body names each manual path and the blocking commit.
13+
This issue is the `hyprws` sync attention issue: a sync stopped on a seam neither rerere nor hook re-apply resolves, or its candidate failed CI.
14+
Its title names the target tag; its body names each manual path and the blocking commit, or each red job.
1515

1616
The `fork-sync` skill owns every step and rule; follow it, and copy nothing from memory.
1717
Its "Job mode" section is this job's procedure, from a clean clone to `HEAD` at the resolution export.

‎docs/fork/operations/fork-sync.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ Its title names the step and target, so reruns never rename it; its body carries
132132

133133
The newest open `ci` issue matching `hyprws sync blocked` or `hyprws sync failed` is adopted, including legacy issues.
134134
Older matches close with a one-line pointer to the kept issue; only no match files a new one.
135-
A blocked run also adds `rsi:fork-sync` on create or rewrite, which starts rsi-pr-agent's `fork-sync` workflow; a failed run never does.
135+
A blocked run, or one failed at `ci`, also adds `rsi:fork-sync` on create or rewrite, which starts rsi-pr-agent's `fork-sync` workflow; any other failure never does.
136+
An unchanged body never relabels, so one stop gets one job per target.
136137
A clean run (applied or already-applied) closes open matches with `gh issue close --reason completed --comment "Resolved by hyprws <sha>"`.
137138
A refused publication or close lands in the report and fails the run.
138139
Dry runs never publish or close issues.

‎scripts/fork-sync.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ it("files one governed failure issue when hyprws CI is red on the candidate", ()
19211921
assert.strictEqual(value("--type"), "Notification 🔔");
19221922
assert.deepStrictEqual(
19231923
args.filter((argument, index) => args[index - 1] === "--label"),
1924-
["ci"],
1924+
["ci", "rsi:fork-sync"],
19251925
);
19261926
assert.deepStrictEqual(
19271927
recording.calls

‎scripts/fork-sync.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ const SYNC_DIR = ".t3/fork-sync";
9898
const WORKTREE_DIR = "worktree";
9999
/** The attention issue keeps the governed label and outcome-shaped legacy titles. */
100100
const BLOCK_LABEL = "ci";
101-
/** A blocked stop also starts rsi-pr-agent's `.rsi-agent/workflows/fork-sync.md`. */
101+
/**
102+
* A blocked stop or a red candidate also starts rsi-pr-agent's
103+
* `.rsi-agent/workflows/fork-sync.md`; an unchanged body never relabels, so
104+
* one stop gets one job per target.
105+
*/
102106
const AGENT_LABEL = "rsi:fork-sync";
103107
const BLOCK_TITLE_PHRASE = '"hyprws sync blocked" in:title';
104108
const FAILURE_TITLE_PHRASE = '"hyprws sync failed" in:title';
@@ -1723,7 +1727,7 @@ export const publishAttention = (
17231727
runner,
17241728
root,
17251729
stop.title,
1726-
key === "blocked" ? [AGENT_LABEL] : [],
1730+
key === "blocked" || report.failure?.step === "ci" ? [AGENT_LABEL] : [],
17271731
(previous) => attentionIssueBody(report, previous),
17281732
);
17291733
return {

0 commit comments

Comments
 (0)