session: add the #26 per-repo concurrency group to this repo's rendered .forgejo/workflows/{swarm,triage}.yml #32

Closed
opened 2026-08-23 13:06:27 +00:00 by matou-build-agent · 3 comments

Machinery follow-up to #26 (protected path)

#26 added a per-repo workflow-level concurrency group to the onboarding
templates (onboarding/templates/workflows/swarm.yml.tmpl and
triage.yml.tmpl). This repo's own rendered copies —
.forgejo/workflows/swarm.yml and .forgejo/workflows/triage.yml — still
lack the block. A swarm agent cannot touch .forgejo/ (protected path,
CLAUDE.md blast-radius rule 9), so this needs an interactive session.

Ask

Add to .forgejo/workflows/swarm.yml (workflow level, after the on: block,
before jobs:):

concurrency:
  group: swarm-${{ github.repository }}
  cancel-in-progress: false

and to .forgejo/workflows/triage.yml:

concurrency:
  group: triage-${{ github.repository }}
  cancel-in-progress: false

Mirror the explanatory comments already committed to the .tmpl files so the
rendered copies and templates stay byte-comparable (drift check). cancel-in-progress
MUST stay false — a live worker's run is never cancelled by a later event.

Acceptance

  • .forgejo/workflows/swarm.yml and triage.yml carry the concurrency block.
  • A burst of three ready-for-agent label events on this repo yields one
    running + at most one queued swarm run (verify live).
  • Renders match the templates (drift check green).
## Machinery follow-up to #26 (protected path) #26 added a per-repo workflow-level `concurrency` group to the onboarding templates (`onboarding/templates/workflows/swarm.yml.tmpl` and `triage.yml.tmpl`). This repo's **own** rendered copies — `.forgejo/workflows/swarm.yml` and `.forgejo/workflows/triage.yml` — still lack the block. A swarm agent cannot touch `.forgejo/` (protected path, CLAUDE.md blast-radius rule 9), so this needs an interactive session. ## Ask Add to `.forgejo/workflows/swarm.yml` (workflow level, after the `on:` block, before `jobs:`): ```yaml concurrency: group: swarm-${{ github.repository }} cancel-in-progress: false ``` and to `.forgejo/workflows/triage.yml`: ```yaml concurrency: group: triage-${{ github.repository }} cancel-in-progress: false ``` Mirror the explanatory comments already committed to the `.tmpl` files so the rendered copies and templates stay byte-comparable (drift check). `cancel-in-progress` MUST stay false — a live worker's run is never cancelled by a later event. ## Acceptance - `.forgejo/workflows/swarm.yml` and `triage.yml` carry the concurrency block. - A burst of three `ready-for-agent` label events on this repo yields one running + at most one queued swarm run (verify live). - Renders match the templates (drift check green).
Author
Member

Acceptance line retired by #38 — read before verifying

#32's acceptance line "one running + at most one queued swarm run (verify live)" is GitHub's concurrency semantics and cannot be satisfied on Forgejo — do not chase it as a regression.

Forgejo (v15.0.5, verified live under #38) implements cancel-in-progress: false as queue-behind: it queues every superseded run and executes them strictly in sequence, and does not collapse the pending set to one.

Replace that acceptance line with the achievable one:

For N qualifying events: one running + N−1 queued, strictly serial, zero cross-run overlap, no run cancelled, none dropped.

Verify by no cross-run overlap, never by queue depth. #32 stays open and ready-for-session; #38 only corrects what the session must verify — the concurrency-block change itself is still #32's job.

## Acceptance line retired by #38 — read before verifying #32's acceptance line **"one running + at most one queued swarm run (verify live)"** is GitHub's concurrency semantics and **cannot be satisfied on Forgejo** — do not chase it as a regression. Forgejo (v15.0.5, verified live under #38) implements `cancel-in-progress: false` as **queue-behind**: it queues every superseded run and executes them strictly in sequence, and does **not** collapse the pending set to one. **Replace that acceptance line with the achievable one:** > For N qualifying events: **one running + N−1 queued, strictly serial, zero cross-run overlap, no run cancelled, none dropped.** Verify by *no cross-run overlap*, never by *queue depth*. #32 stays open and `ready-for-session`; #38 only corrects what the session must verify — the concurrency-block change itself is still #32's job.
Author
Member

Close report — landed and proven live

Ruled by agent under ADR 0174 — veto anytime. Two-way door throughout: two
committed workflow files, one new offline test, no credential, no posture
change, all revertible by git revert.

What landed

  • 4a02f4d — .forgejo/workflows/swarm.yml and triage.yml gain the
    workflow-level concurrency block, copied byte-identical from
    onboarding/templates/workflows/*.tmpl, explanatory comments included (so
    they carry #38's correction: Forgejo QUEUES every superseded run and
    executes them in sequence — it does not collapse the pending set as GitHub
    does). cancel-in-progress: false in both. Groups swarm-${{ github.repository }}
    and triage-${{ github.repository }}, keyed distinctly.
    After the edit triage.yml is byte-identical to its template modulo the
    runner label; swarm.yml differs only by its already-declared
    SWARM_ALLOW_COLD_STORE block.
  • 4a02f4d — new onboarding/tests/self-workflows-drift-test.sh (8 checks).
    This is the part that stops #32 recurring: an asymmetric body diff —
    every template line must appear, in order, in the rendered copy, while the
    rendered copy may ADD lines (a per-repo delta like the cold-store block is
    legitimate; a MISSING template line is exactly this ticket's bug) — plus the
    group, its distinct key, its workflow-level position (before jobs:) and
    cancel-in-progress: false asserted independently, so a template reshuffle
    cannot quietly drop them. Factory-only: it reads .forgejo/ and
    onboarding/templates/, both vendor-excluded, so no consumer ever ships it.
    Scoped to swarm/triage on purpose — this repo's ci.yml/healer.yml have
    deliberately diverged from their templates and are not renders in the same
    sense. The runner label is read from the rendered file itself, so the test
    never re-asserts a per-repo scheduling choice.
  • d6f0ad0 — STATUS.md milestone entry with the live evidence below.

TDD: the test was written first and run red against the pre-fix copies,
naming all 30 missing lines; green after the edit. Full offline suite green,
67 files (62 vendored tests/ + 5 factory-only onboarding/tests/).

Acceptance

  1. ✅ Both files carry the concurrency block.

  2. ✅ Burst verified live on git.matou.nz (Forgejo v15.0.5). Three
    simultaneous ready-for-agent labeled events at 22:48:39Z, fired on
    three closed issues (#26/#28/#38) so the events fire with an empty ready
    set and no worker can claim anything (list-ready-tasks.sh reads
    state=open only). Result — strict serialisation, zero cross-run overlap:

    run jobs created last job finished
    335 22:48:39 (both) 22:48:42
    336 22:48:42 / :43 22:48:55
    337 22:48:56 (both) 22:48:59

    At no poll (1 s cadence) were two different run numbers running at once.
    Runner capacity is not the explanation: a capacity-queued job appears as
    a waiting task row, whereas 336/337 had no task rows at all while their
    predecessor ran — they were held at the run level — and within run 336 BOTH
    matrix jobs ran concurrently, so ≥2 slots were free while the next run
    stayed blocked. The three ready-for-agent labels were removed from
    #26/#28/#38 afterwards (verified: they carry only their original labels).

    Wording note: the ticket's "one running + at most one queued" is the GitHub
    expectation #38 corrected — Forgejo queues N-1, so the success signal is
    serial execution, which is what was observed. A first burst attempt (events
    4 s apart on one issue) is discounted: each run finished before the next
    event fired, so it proved nothing either way.

  3. ✅ Renders match the templates — proven by the new test, not by eye.

Scope kept

No re-vendor and no pin bump: nothing vendored changed. Consumers still own
their own rendered copies (idss #705, matou-app #79 — ADR 0001, pull-only).

Follow-up filed

  • #41 — triage.yml.tmpl's concurrency comment says "in parallel across
    the matrix", but triage.yml has no matrix (that clause is swarm.yml's
    reasoning copied across). Preserved byte-identical here on purpose; fixing it
    needs both halves (template + this repo's rendered copy, the latter a session
    because .forgejo/ is protected).
## Close report — landed and proven live Ruled by agent under ADR 0174 — veto anytime. Two-way door throughout: two committed workflow files, one new offline test, no credential, no posture change, all revertible by `git revert`. ### What landed - `4a02f4d` — `.forgejo/workflows/swarm.yml` and `triage.yml` gain the workflow-level `concurrency` block, copied **byte-identical** from `onboarding/templates/workflows/*.tmpl`, explanatory comments included (so they carry #38's correction: Forgejo QUEUES every superseded run and executes them in sequence — it does not collapse the pending set as GitHub does). `cancel-in-progress: false` in both. Groups `swarm-${{ github.repository }}` and `triage-${{ github.repository }}`, keyed distinctly. After the edit `triage.yml` is byte-identical to its template modulo the runner label; `swarm.yml` differs only by its already-declared `SWARM_ALLOW_COLD_STORE` block. - `4a02f4d` — new `onboarding/tests/self-workflows-drift-test.sh` (8 checks). This is the part that stops #32 recurring: an **asymmetric** body diff — every template line must appear, in order, in the rendered copy, while the rendered copy may ADD lines (a per-repo delta like the cold-store block is legitimate; a MISSING template line is exactly this ticket's bug) — plus the group, its distinct key, its workflow-level position (before `jobs:`) and `cancel-in-progress: false` asserted independently, so a template reshuffle cannot quietly drop them. Factory-only: it reads `.forgejo/` and `onboarding/templates/`, both vendor-excluded, so no consumer ever ships it. Scoped to swarm/triage on purpose — this repo's `ci.yml`/`healer.yml` have deliberately diverged from their templates and are not renders in the same sense. The runner label is read from the rendered file itself, so the test never re-asserts a per-repo scheduling choice. - `d6f0ad0` — STATUS.md milestone entry with the live evidence below. TDD: the test was written first and run **red** against the pre-fix copies, naming all 30 missing lines; green after the edit. Full offline suite green, 67 files (62 vendored `tests/` + 5 factory-only `onboarding/tests/`). ### Acceptance 1. ✅ Both files carry the concurrency block. 2. ✅ **Burst verified live** on `git.matou.nz` (Forgejo v15.0.5). Three simultaneous `ready-for-agent` `labeled` events at `22:48:39Z`, fired on three **closed** issues (#26/#28/#38) so the events fire with an empty ready set and no worker can claim anything (`list-ready-tasks.sh` reads `state=open` only). Result — strict serialisation, zero cross-run overlap: | run | jobs created | last job finished | |---|---|---| | 335 | 22:48:39 (both) | 22:48:42 | | 336 | 22:48:42 / :43 | 22:48:55 | | 337 | 22:48:56 (both) | 22:48:59 | At no poll (1 s cadence) were two different run numbers running at once. **Runner capacity is not the explanation:** a capacity-queued job appears as a waiting task row, whereas 336/337 had *no task rows at all* while their predecessor ran — they were held at the run level — and within run 336 BOTH matrix jobs ran concurrently, so ≥2 slots were free while the next run stayed blocked. The three `ready-for-agent` labels were removed from #26/#28/#38 afterwards (verified: they carry only their original labels). Wording note: the ticket's "one running + at most one queued" is the GitHub expectation #38 corrected — Forgejo queues N-1, so the success signal is serial execution, which is what was observed. A first burst attempt (events 4 s apart on one issue) is discounted: each run finished before the next event fired, so it proved nothing either way. 3. ✅ Renders match the templates — proven by the new test, not by eye. ### Scope kept No re-vendor and no pin bump: nothing vendored changed. Consumers still own their own rendered copies (idss #705, matou-app #79 — ADR 0001, pull-only). ### Follow-up filed - **#41** — `triage.yml.tmpl`'s concurrency comment says "in parallel across the matrix", but `triage.yml` has no matrix (that clause is swarm.yml's reasoning copied across). Preserved byte-identical here on purpose; fixing it needs both halves (template + this repo's rendered copy, the latter a session because `.forgejo/` is protected).
matou-build-agent 2026-08-23 22:51:10 +00:00
Author
Member

CI corroboration (posted after the close report): the repo's own ci.yml suite — which runs tests/*.sh and onboarding/tests/*.sh, so it executes the new self-workflows-drift-test.sh — is green on both commits: run 331 (4a02f4d, the workflows + test) and run 338 (d6f0ad0, the STATUS entry). Matches the local run (67 files, 0 failures).

CI corroboration (posted after the close report): the repo's own `ci.yml` suite — which runs `tests/*.sh` **and** `onboarding/tests/*.sh`, so it executes the new `self-workflows-drift-test.sh` — is green on both commits: run **331** (`4a02f4d`, the workflows + test) and run **338** (`d6f0ad0`, the STATUS entry). Matches the local run (67 files, 0 failures).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#32
No description provided.