session: add the dev-factory #26 per-repo concurrency group to .forgejo/workflows/{swarm,triage}.yml #705

Closed
opened 2026-08-23 13:06:40 +00:00 by matou-build-agent · 1 comment

Consumer follow-up to dev-factory #26 (ADR 0001 pull-only)

dev-factory #26 added a per-repo workflow-level concurrency group to the
swarm/triage workflow templates so a triage mass-label or a burst of closed
events collapses to one running + at most one queued run instead of a matrix
storm (71 dev-factory + 73 idss no-op swarm jobs in one hour were observed).

The factory is pull-only: this repo renders its own copies of the workflows,
so the change lands here as a separate re-render, not a push from dev-factory.

Ask

Re-render (or hand-apply) so .forgejo/workflows/swarm.yml carries:

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

and .forgejo/workflows/triage.yml:

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

placed at workflow level (after on:, before jobs:). cancel-in-progress
MUST stay false — a live worker's run is never cancelled by a later event.
.forgejo/ is a protected path, so this needs a session standing.

Acceptance

  • .forgejo/workflows/{swarm,triage}.yml carry the concurrency block.
  • A burst of three ready-for-agent label events yields one running + at most
    one queued swarm run (verify live).

Upstream: Matou/dev-factory#26

## Consumer follow-up to dev-factory #26 (ADR 0001 pull-only) dev-factory #26 added a per-repo workflow-level `concurrency` group to the swarm/triage workflow templates so a triage mass-label or a burst of `closed` events collapses to one running + at most one queued run instead of a matrix storm (71 dev-factory + 73 idss no-op swarm jobs in one hour were observed). The factory is pull-only: this repo renders its own copies of the workflows, so the change lands here as a separate re-render, not a push from dev-factory. ## Ask Re-render (or hand-apply) so `.forgejo/workflows/swarm.yml` carries: ```yaml concurrency: group: swarm-${{ github.repository }} cancel-in-progress: false ``` and `.forgejo/workflows/triage.yml`: ```yaml concurrency: group: triage-${{ github.repository }} cancel-in-progress: false ``` placed at workflow level (after `on:`, before `jobs:`). `cancel-in-progress` MUST stay false — a live worker's run is never cancelled by a later event. `.forgejo/` is a protected path, so this needs a session standing. ## Acceptance - `.forgejo/workflows/{swarm,triage}.yml` carry the concurrency block. - A burst of three `ready-for-agent` label events yields one running + at most one queued swarm run (verify live). Upstream: https://git.matou.nz/Matou/dev-factory/issues/26
Author
Member

close-report for #705 — status success

Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible
workflow key that only narrows when runs execute; no security-posture change,
no credential, no spend, no data touched. Proved by an offline test plus a live
A/B on the real runner pool. .forgejo/ is a protected path, which is why this
needed a session standing rather than a swarm worker.

What landed

.forgejo/workflows/swarm.yml and triage.yml now carry a workflow-level
concurrency block between on: and jobs:, hand-applied from
Matou/dev-factory@d3288d4's onboarding/templates/workflows/{swarm,triage}.yml.tmpl
(ADR 0001 pull-only — the factory does not push, so this was a re-render, not a
sync):

concurrency:
  group: swarm-${{ github.repository }}     # triage-${{ … }} in triage.yml
  cancel-in-progress: false

Groups are keyed distinctly so the two heavy flows queue independently — they
already coordinate on the shared host-capacity slots (#577 / ADR 0184), not on
this group. cancel-in-progress is false and guarded against ever flipping.

New offline guard scripts/tests/workflow-concurrency-test.sh (red before
green — first run: "swarm.yml carries no workflow-level concurrency block
(#705)"
; now 8 checks pass). It asserts the block is at workflow level
(column 0, after on:, before jobs: — indented under a job it would apply per
matrix leg instead of per run), that each group is per-repo and distinct from
the other workflow's, that cancel-in-progress is false, and cross-checks all
of it against the parsed YAML document (including that no job declares its own
concurrency).

Acceptance

1. Both workflows carry the concurrency block — yes, verified on
origin/main.

2. "A burst of three ready-for-agent label events yields one running + at
most one queued swarm run (verify live)"
— verified live, with one honest
amendment to the wording (below).

Three ready-for-agent label events fired in the same second onto closed
issues (#708/#706/#703 — list-ready-tasks.sh queries state=open, so each run
is a guaranteed no-op; the labels were removed afterwards, all three issues are
back to their original sets). Result — runs 9346/9347/9348, strictly serial:

run#9346  17:07:29 -> 17:07:32
run#9347  17:07:32 -> 17:07:35
run#9348  17:07:36 -> 17:07:39

Across every post-change swarm run there is zero cross-run overlap. The
pre-change contrast is the storm itself: live worker run 9326 (16:39:32 -> 17:01:07, 22 minutes) was overlapped by nine other swarm runs.

That alone was not proof, because matou-workstation's forgejo-runner is
capacity: 1 — it could not have overlapped them either way. So an A/B probe
pair
ran on the multi-capacity swarm pool, three workflow_dispatches each
fired in the same second (17:21:19Z), one arm with the group and one without:

arm runs
CONTROL (no concurrency) 9357 17:21:20->:53; 9358 and 9359 both 17:21:54->17:22:27
GROUPED (concurrency-probe-${{ github.repository }}) 9356 17:21:20->:53; 9360 17:22:28->17:23:01; 9361 17:23:02->:35

Same pool, same second: the control arm overlapped, proving capacity >= 2 was
available; the grouped arm never once overlapped. Workflow-level concurrency
is honoured by this instance
(Forgejo v15.0.5; the feature landed in Forgejo
v14.0). All three grouped runs finished success — so cancel-in-progress: false is confirmed too: a later run never kills an earlier one.

The two probe workflows were added and deleted inside this session
(5ec90b0c -> 8b951784 -> 33a0e88c); .forgejo/workflows/ is back to its
eight real workflows.

The amendment

The acceptance line says "at most one queued". That is GitHub's semantics.
Forgejo implements cancel-in-progress: false as queue behind, not "keep at
most one pending" — it queues every superseded run rather than collapsing the
pending set. A burst of three therefore gives one running + two queued.

Nothing is dropped and nothing runs in parallel, so the effect #26 was bought
for — the matrix storm — is gone; the queue itself is not collapsed. Flagged
upstream as Matou/dev-factory#38 so the consumers still owing this change
(Matou/dev-factory#32, matou-app#79) do not read "three runs queued" as a
failed verification. I have taken the substance of the criterion as met and the
wording as inherited from the upstream ticket; veto if you read it the other
way.

Commits (all on main)

  • 840c6674 — the concurrency block on both workflows + the offline guard +
    STATUS.md
  • 5ec90b0c, 8b951784, 33a0e88c — probe up, A/B on the swarm pool, probe
    down
  • 349b0ee3 — STATUS.md: the live evidence and the semantics amendment

STATUS.md carries the header note and a milestone-log entry. No secrets
written; nothing outside .forgejo/workflows/, scripts/tests/ and STATUS.md
was touched.

**close-report** for #705 — status `success` Ruled by agent under ADR 0174 — veto anytime. **Two-way door:** a revertible workflow key that only *narrows* when runs execute; no security-posture change, no credential, no spend, no data touched. Proved by an offline test plus a live A/B on the real runner pool. `.forgejo/` is a protected path, which is why this needed a session standing rather than a swarm worker. ## What landed `.forgejo/workflows/swarm.yml` and `triage.yml` now carry a workflow-level `concurrency` block between `on:` and `jobs:`, hand-applied from `Matou/dev-factory@d3288d4`'s `onboarding/templates/workflows/{swarm,triage}.yml.tmpl` (ADR 0001 pull-only — the factory does not push, so this was a re-render, not a sync): ```yaml concurrency: group: swarm-${{ github.repository }} # triage-${{ … }} in triage.yml cancel-in-progress: false ``` Groups are keyed distinctly so the two heavy flows queue independently — they already coordinate on the shared host-capacity slots (#577 / ADR 0184), not on this group. `cancel-in-progress` is `false` and guarded against ever flipping. New offline guard `scripts/tests/workflow-concurrency-test.sh` (red before green — first run: *"swarm.yml carries no workflow-level concurrency block (#705)"*; now 8 checks pass). It asserts the block is at **workflow** level (column 0, after `on:`, before `jobs:` — indented under a job it would apply per matrix leg instead of per run), that each group is per-repo and distinct from the other workflow's, that `cancel-in-progress` is `false`, and cross-checks all of it against the parsed YAML document (including that no job declares its own `concurrency`). ## Acceptance **1. Both workflows carry the concurrency block** — yes, verified on `origin/main`. **2. "A burst of three `ready-for-agent` label events yields one running + at most one queued swarm run (verify live)"** — verified live, with one honest amendment to the wording (below). Three `ready-for-agent` label events fired in the same second onto **closed** issues (#708/#706/#703 — `list-ready-tasks.sh` queries `state=open`, so each run is a guaranteed no-op; the labels were removed afterwards, all three issues are back to their original sets). Result — runs 9346/9347/9348, strictly serial: ``` run#9346 17:07:29 -> 17:07:32 run#9347 17:07:32 -> 17:07:35 run#9348 17:07:36 -> 17:07:39 ``` Across **every** post-change swarm run there is **zero** cross-run overlap. The pre-change contrast is the storm itself: live worker run 9326 (`16:39:32 -> 17:01:07`, 22 minutes) was overlapped by **nine** other swarm runs. That alone was not proof, because `matou-workstation`'s `forgejo-runner` is `capacity: 1` — it could not have overlapped them either way. So an **A/B probe pair** ran on the multi-capacity `swarm` pool, three `workflow_dispatch`es each fired in the same second (`17:21:19Z`), one arm with the group and one without: | arm | runs | |---|---| | CONTROL (no `concurrency`) | 9357 `17:21:20->:53`; **9358 and 9359 both `17:21:54->17:22:27`** | | GROUPED (`concurrency-probe-${{ github.repository }}`) | 9356 `17:21:20->:53`; 9360 `17:22:28->17:23:01`; 9361 `17:23:02->:35` | Same pool, same second: the control arm overlapped, proving capacity >= 2 was available; the grouped arm never once overlapped. **Workflow-level `concurrency` is honoured by this instance** (Forgejo v15.0.5; the feature landed in Forgejo v14.0). All three grouped runs finished `success` — so `cancel-in-progress: false` is confirmed too: a later run never kills an earlier one. The two probe workflows were added and deleted inside this session (`5ec90b0c` -> `8b951784` -> `33a0e88c`); `.forgejo/workflows/` is back to its eight real workflows. ### The amendment The acceptance line says "at most one **queued**". That is GitHub's semantics. Forgejo implements `cancel-in-progress: false` as **queue behind**, not "keep at most one pending" — it queues *every* superseded run rather than collapsing the pending set. A burst of three therefore gives **one running + two queued**. Nothing is dropped and nothing runs in parallel, so the effect #26 was bought for — the matrix storm — is gone; the queue itself is not collapsed. Flagged upstream as **`Matou/dev-factory#38`** so the consumers still owing this change (`Matou/dev-factory#32`, `matou-app#79`) do not read "three runs queued" as a failed verification. I have taken the substance of the criterion as met and the wording as inherited from the upstream ticket; veto if you read it the other way. ## Commits (all on `main`) - `840c6674` — the concurrency block on both workflows + the offline guard + `STATUS.md` - `5ec90b0c`, `8b951784`, `33a0e88c` — probe up, A/B on the swarm pool, probe down - `349b0ee3` — `STATUS.md`: the live evidence and the semantics amendment `STATUS.md` carries the header note and a milestone-log entry. No secrets written; nothing outside `.forgejo/workflows/`, `scripts/tests/` and `STATUS.md` was touched.
matou-build-agent 2026-08-23 17:28:03 +00:00
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/idss#705
No description provided.