healer watchdog: watchdog_detect groups runs by JOB name, so four workflows' publish jobs share one streak bucket — a phantom release-publish streak billed a full investigation #2056

Open
opened 2026-10-23 07:10:09 +00:00 by matou-build-agent · 2 comments

Filed by the healer (heal-Matou-idss-1792738980-1510695, watchdog pass of 2026-10-23 07:02 UTC, signature d7a36c36cdb3). The fault is in .sandcastle/heal-lib.sh, which the heal charter forbids me to modify — hence a ticket. Protected path (.sandcastle), so ready-for-human.

Symptom

The trigger line was watchdog: streak (no verdict for workflow release-publish). But in the very runs.json the detector read, release-publish had no streak of its own — its terminal runs, newest first, were failure(52357), success(52351), success(52347).

Cause

watchdog_detect (heal-lib.sh ~line 207) groups by .name:

| group_by(.name)[]

.name on the actions/tasks endpoint is the job name, and the job name is not unique across workflows. Four workflows in .forgejo/workflows/ declare a job keyed publish:

cache-publish.yml   (runs-on: matou-workstation)
ci.yml              (runs-on: elitebook-03)
release-publish.yml (runs-on: elitebook-03)
reseed-publish.yml  (runs-on: elitebook-03)

So all four land in ONE bucket. The bucket this pass built, reproduced with the shipped function against the incident's own evidence:

run# workflow status
52357 release-publish failure
52354 reseed-publish failure
52351 release-publish success
52349 reseed-publish success
52347 release-publish success

$runs[0].status == "failure" and $runs[1].status == "failure" is true only because rows 1 and 2 are different workflows. The emitted label then takes $runs[0].workflow — release-publish — and the incident is reported as that workflow's streak. Neither workflow had two consecutive failures; the healer should have been silent this tick.

Reproduction (on matou-dev-server-01):

. .sandcastle/heal-lib.sh
watchdog_detect /tmp/matou-heal-Matou-idss.v1QOyj/runs.json
# → release-publish	streak

The same conflation can also mint an always-red across hosts: cache-publish runs on matou-workstation while the other three run on elitebook-03, so one wedged host's reds can fold into the other host's workflow label.

Why the existing comment did not catch it

The function's comment block was written for exactly this class — #1045 moved the emitted label from .name to .workflow_id, and the block states "Grouping stays per-.name (each job keeps its own streak)". That premise is what is false: a job name is unique per workflow, not per repo. The label was fixed one layer above the key.

Suggested shape (for the human to rule on)

Group on the workflow — or on the pair, if per-leg streaks are still wanted:

| group_by([(.workflow_id // .name), .name])[]

Grouping on .workflow_id alone also collapses a matrix's legs onto one incident, which the comment block already names as desirable. Either way the key must include the workflow, so two workflows can never interleave into one streak.

Worth a scripts/tests/ case: a fixture with interleaved release-publish/reseed-publish publish rows must emit nothing.

  • #1045 (closed) — the same root shape, fixed at the label only.
  • #2045 (open) — degraded signatures keyed per workflow name, same files, different defect.

Evidence

/tmp/matou-heal-Matou-idss.v1QOyj on matou-dev-server-01 (runs.json, prompt.txt). No repair attempted; no containers started.

Filed by the healer (`heal-Matou-idss-1792738980-1510695`, watchdog pass of 2026-10-23 07:02 UTC, signature `d7a36c36cdb3`). The fault is in `.sandcastle/heal-lib.sh`, which the heal charter forbids me to modify — hence a ticket. Protected path (`.sandcastle`), so `ready-for-human`. ## Symptom The trigger line was `watchdog: streak (no verdict for workflow release-publish)`. But in the very `runs.json` the detector read, **`release-publish` had no streak of its own** — its terminal runs, newest first, were `failure(52357), success(52351), success(52347)`. ## Cause `watchdog_detect` (`heal-lib.sh` ~line 207) groups by `.name`: ``` | group_by(.name)[] ``` `.name` on the `actions/tasks` endpoint is the **job** name, and the job name is not unique across workflows. Four workflows in `.forgejo/workflows/` declare a job keyed `publish`: ``` cache-publish.yml (runs-on: matou-workstation) ci.yml (runs-on: elitebook-03) release-publish.yml (runs-on: elitebook-03) reseed-publish.yml (runs-on: elitebook-03) ``` So all four land in ONE bucket. The bucket this pass built, reproduced with the shipped function against the incident's own evidence: | run# | workflow | status | |---|---|---| | 52357 | release-publish | failure | | 52354 | **reseed-publish** | failure | | 52351 | release-publish | success | | 52349 | reseed-publish | success | | 52347 | release-publish | success | `$runs[0].status == "failure" and $runs[1].status == "failure"` is true only because rows 1 and 2 are *different workflows*. The emitted label then takes `$runs[0].workflow` — `release-publish` — and the incident is reported as that workflow's streak. Neither workflow had two consecutive failures; the healer should have been silent this tick. Reproduction (on `matou-dev-server-01`): ``` . .sandcastle/heal-lib.sh watchdog_detect /tmp/matou-heal-Matou-idss.v1QOyj/runs.json # → release-publish streak ``` The same conflation can also mint an `always-red` across hosts: `cache-publish` runs on `matou-workstation` while the other three run on `elitebook-03`, so one wedged host's reds can fold into the other host's workflow label. ## Why the existing comment did not catch it The function's comment block was written for exactly this class — #1045 moved the **emitted label** from `.name` to `.workflow_id`, and the block states "Grouping stays per-`.name` (each job keeps its own streak)". That premise is what is false: a job name is unique per *workflow*, not per repo. The label was fixed one layer above the key. ## Suggested shape (for the human to rule on) Group on the workflow — or on the pair, if per-leg streaks are still wanted: ``` | group_by([(.workflow_id // .name), .name])[] ``` Grouping on `.workflow_id` alone also collapses a matrix's legs onto one incident, which the comment block already names as desirable. Either way the key must include the workflow, so two workflows can never interleave into one streak. Worth a `scripts/tests/` case: a fixture with interleaved `release-publish`/`reseed-publish` `publish` rows must emit nothing. ## Related - #1045 (closed) — the same root shape, fixed at the label only. - #2045 (open) — degraded signatures keyed per workflow name, same files, different defect. ## Evidence `/tmp/matou-heal-Matou-idss.v1QOyj` on `matou-dev-server-01` (`runs.json`, `prompt.txt`). No repair attempted; no containers started.
Author
Member

The real fault this phantom alert happened to point at is filed as #2057 (elitebook-03 degraded since ~03:24 UTC — every pinned job burns its timeout ceiling). Two of that host's workflows are in the conflated publish bucket described above, which is how one isolated failure in each read as a streak in one.

The real fault this phantom alert happened to point at is filed as #2057 (`elitebook-03` degraded since ~03:24 UTC — every pinned job burns its timeout ceiling). Two of that host's workflows are in the conflated `publish` bucket described above, which is how one isolated failure in each read as a streak in one.
Author
Member

Second sighting, 2026-10-23 16:02 UTC (healer heal-Matou-idss-1792771387-2805806, signature 34d79489ef32, evidence /tmp/matou-heal-Matou-idss.sQJGUg). The conflation is confirmed still live, but with a wrinkle worth pinning before anyone fixes it: this time the alert was not a phantom.

The bucket .name == "publish" held three rows from two workflows:

run# workflow status
52383 reseed-publish failure
52379 release-publish failure
52377 reseed-publish failure

All three failures, so the shipped detector emitted reseed-publish always-red. But reseed-publish's own rows in isolation are failure(52383), failure(52377) — ≥2 terminal runs, all failed. The suggested regrouping on (.workflow_id, .name) therefore still emits reseed-publish always-red here, correctly, and would additionally have stayed silent on release-publish (one failure).

So the fix is safe against this payload rather than merely untested on it — but the scripts/tests/ fixture should assert both directions, not just the silence case:

  1. interleaved release-publish/reseed-publish rows with no per-workflow streak → emit nothing (the 07:10 phantom);
  2. two reseed-publish failures alongside one release-publish failure → emit reseed-publish always-red and nothing for release-publish (this payload).

Without (2) a regrouping that over-corrects — say, dropping a bucket whose rows span workflows — would have swallowed a genuine always-red on a rail that has been dark since 03:24 UTC (#2057, now escalated).

No repair attempted; .sandcastle/heal-lib.sh remains out of charter. No containers started.

Second sighting, 2026-10-23 16:02 UTC (healer `heal-Matou-idss-1792771387-2805806`, signature `34d79489ef32`, evidence `/tmp/matou-heal-Matou-idss.sQJGUg`). The conflation is confirmed still live, but with a wrinkle worth pinning before anyone fixes it: **this time the alert was not a phantom.** The bucket `.name == "publish"` held three rows from two workflows: | run# | workflow | status | |---|---|---| | 52383 | reseed-publish | failure | | 52379 | release-publish | failure | | 52377 | reseed-publish | failure | All three failures, so the shipped detector emitted `reseed-publish always-red`. But `reseed-publish`'s own rows in isolation are `failure(52383), failure(52377)` — ≥2 terminal runs, all failed. The suggested regrouping on `(.workflow_id, .name)` therefore still emits `reseed-publish always-red` here, correctly, and would additionally have stayed silent on `release-publish` (one failure). So the fix is safe against this payload rather than merely untested on it — but the `scripts/tests/` fixture should assert **both** directions, not just the silence case: 1. interleaved `release-publish`/`reseed-publish` rows with no per-workflow streak → emit nothing (the 07:10 phantom); 2. two `reseed-publish` failures alongside one `release-publish` failure → emit `reseed-publish always-red` and nothing for `release-publish` (this payload). Without (2) a regrouping that over-corrects — say, dropping a bucket whose rows span workflows — would have swallowed a genuine always-red on a rail that has been dark since 03:24 UTC (#2057, now escalated). No repair attempted; `.sandcastle/heal-lib.sh` remains out of charter. No containers started.
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#2056
No description provided.