Skip to content

Commit ec5756e

Browse files
donjor-agent[bot]donjor
authored andcommitted
feat(fork-sync): a pushed resolution reruns the sync from the trunk (#1850)
## Problem A resolution an agent pushes to `sync/resolution` waits up to six hours for the next scheduled sync. A `push` trigger cannot rerun it safely: it runs the pushed commit's workflow files, with repository secrets. ## Change New `hyprws-sync-resolution.yml` dispatches the trunk's own sync: 1. rsi-pr-agent pushes `sync/resolution` 2. Its `<!-- rsi:fork-sync -->` comment turns `**pushed**` 3. `issue_comment` runs this file from `hyprws` 4. The job runs `gh workflow run hyprws-upstream-sync.yml --ref hyprws` 5. The sync imports the branch as data (stacked layer below) - **Gate:** author `rsi-pr-agent[bot]`, marker, `**pushed**` - **Permissions:** `actions: write` only; no secret - **Queue:** the sync's `hyprws-sync` group, not cancelled - **Fallback:** the 6-hour schedule A separate file keeps every repository comment out of the sync's concurrency group. ### Residual risk This PR runs no code or workflow from `sync/resolution`, but the push itself can: - **Vector:** a pushed commit adding an `on: push` workflow - **Runs with:** `HYPRWS_MIRROR_TOKEN`, an elevatable `GITHUB_TOKEN` - **Enabled by:** rsi-pr-agent push tokens carry `workflows: write` No change in this repository closes it; it needs a settings change: - a) Move `HYPRWS_MIRROR_TOKEN` to an environment restricted to `hyprws` (recommended) - b) Drop `workflows: write` from the `fork-sync` push token; the resolution commit never needs it Agent-authored resolutions also reach candidate CI and `vp run fork:ci`, as upstream code already does. ## Scope and approval Refs #1844 Refs #1841 The close condition needs a live push after merge: "A sync/resolution push reruns the sync". The App never pushes `hyprws`; no ruleset bypass. ## Verification - [x] `actionlint .github/workflows/hyprws-sync-resolution.yml` → exit 0 - [x] `vp run fork:ci` → exit 0 **Unverified:** the live trigger; the `rsi:fork-sync` definition lands in #1848. Claude Opus 5.5, Claude Code in T3 Code. ## Fork trailers Fork-Domain: fork-meta Fork-Tier: core Co-authored-by: donjor <[email protected]>
1 parent 6f33ca0 commit ec5756e

4 files changed

Lines changed: 40 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ It hands its resolutions to the next run as data on `sync/resolution`.
154154
4. Repeat until the rebase finishes
155155
5. Commit tip adaptation there; rerun once
156156
6. `git update-ref --no-deref HEAD refs/fork-sync/resolution`
157-
7. Report `committed`: rsi-pr-agent pushes `HEAD`
157+
7. Report `committed`: rsi-pr-agent pushes `HEAD`; the sync reruns
158158

159159
Every rebase rewrites `refs/fork-sync/resolution` before `ci`, so a `ci` failure in the job is expected.
160160
It is one parentless commit:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: hyprws sync resolution
2+
3+
# A resolution pushed to sync/resolution reruns the upstream sync from the
4+
# trunk's own definition. Nothing from that branch ever runs here: `fork:sync`
5+
# imports it as data (docs/fork/operations/fork-sync.md#resolution-data).
6+
#
7+
# No `push` trigger: a push runs the workflow files of the pushed commit, and
8+
# the resolution commit holds none. The signal is rsi-pr-agent's sticky comment
9+
# on the sync attention issue turning `**pushed**`; `issue_comment` always runs
10+
# this file from the default branch. The job holds no secret and only
11+
# dispatches; the dispatched run queues behind any sync in flight.
12+
13+
on:
14+
issue_comment:
15+
types: [created, edited]
16+
17+
permissions: {}
18+
19+
jobs:
20+
rerun:
21+
name: Rerun the upstream sync
22+
if: >-
23+
github.event.comment.user.login == 'rsi-pr-agent[bot]' &&
24+
startsWith(github.event.comment.body, '<!-- rsi:fork-sync -->') &&
25+
contains(github.event.comment.body, '**pushed**')
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 5
28+
permissions:
29+
actions: write
30+
steps:
31+
- name: Dispatch the trunk's sync
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
run: gh workflow run hyprws-upstream-sync.yml --ref hyprws --repo "$GITHUB_REPOSITORY"

‎docs/fork/internals/fork-delta.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ Upstream ships rich Markdown editing with safe frontmatter and MDX boundaries, o
394394
| `scripts/fork-*.ts` and their `fork:*` aliases | The fork tooling; hand-run ones get an alias |
395395
| [`fork-sync`](../../../.agents/skills/fork-sync/SKILL.md) skill | The sync driver's run and unblock procedure |
396396
| `.github/workflows/hyprws-upstream-sync.yml` | The sync workflow and its fork-local issue upserts |
397+
| `.github/workflows/hyprws-sync-resolution.yml` | Reruns the sync once rsi-pr-agent pushes a resolution |
397398
| `.github/pull_request_template.md` trailer block | Points to `FORK_DOMAINS` for the domain list |
398399
| `.rsi-agent/workflows/*.md` | rsi-pr-agent copies of `.macroscope/check-run-agents/`, source SHA in each |
399400

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ The driver keeps them as git data instead.
119119
- **Refusal:** any other path fails the run
120120

121121
The driver reads the branch as data only; nothing on it executes.
122+
123+
**Rerun:** `hyprws-sync-resolution.yml` dispatches the trunk's sync when rsi-pr-agent's `fork-sync` comment reads `**pushed**`.
124+
A `push` trigger cannot do it: it runs the pushed commit's workflow files, and the resolution commit has none.
125+
A hand push reruns with `gh workflow run hyprws-upstream-sync.yml --ref hyprws`.
122126
The [job mode](../../../.agents/skills/fork-sync/SKILL.md#job-mode) runbook produces it.
123127

124128
## Attention issue lifecycle

0 commit comments

Comments
 (0)