reseed/release-publish publish the run's CHECKED-OUT ref, not main's tip — publish.sh:39 takes GIT_SHA:-HEAD, so fixing #2057 would green the rail onto a 3-day-stale agent #2072

Open
opened 2026-10-26 23:14:18 +00:00 by matou-build-agent · 1 comment

Symptom

The reseed-publish / release-publish rails publish whatever ref the run checked out, not main's tip. Both workflow headers claim otherwise. reseed-publish.yml's header says the rail

diffs from the NEWEST PUBLISHED registry version to origin/main and publishes origin/main's tip only when that range touches the agent-affecting set

but nothing in the rail ever resolves origin/main:

  • .forgejo/workflows/reseed-publish.yml — the only checkout is a plain actions/checkout@v4 with fetch-depth: 0. That checks out github.sha, i.e. the run's head_sha, not origin/main.
  • scripts/bootstrap-reseed/publish.sh:39 — sha="$(git -C "$root" rev-parse "${GIT_SHA:-HEAD}")". GIT_SHA is not set by either workflow, so the published sha is the checked-out HEAD.

The guard base is correct and idempotent (published_newest(), newest-published..HEAD — that part does what the header describes). It is the head of the range that is wrong.

Why it is not academic — it is live right now

Observed on the 2026-10-26 23:02 UTC healer pass (evidence /tmp/matou-heal-Matou-idss.cRvjYg, reported on #2057): every elitebook-03 publish task in the window carries head_sha 395a69ca, which stopped being main's head at 2026-10-23 17:47 UTC (7e93f241 landed then) and is 14 commits behind c9d64caa. Every matou-workstation task in the same window is at c9d64caa.

So for >3 days this rail has been running a stale ref. It happens to be red for an unrelated reason (#2057, the elitebook-03 degradation), which is the only thing that has stopped it minting a pin for 395a69ca. Fix #2057 alone and this rail goes green while publishing a 3-day-old agent — and published_newest() would then advance the tracking pin to that stale sha, which is exactly the "served pin can never catch up" failure the guard comment says the rail exists to prevent.

Note the belt-and-braces guard cannot catch this: oc_reseed_agent_affected "$base" "$sha" with base = newest published and sha = a commit behind it yields a backwards range, which is not a state the guard was written to reject.

Ruling owed

Where should the rail pin its head? Two candidate shapes, and this needs a human call because it decides what "the published agent" means:

  1. Resolve in the workflow — check out main by name (ref: main) so HEAD is main's tip at run start.
  2. Resolve in the script — have the rail pass GIT_SHA="$(git rev-parse origin/main)", making the intent explicit at the seam and leaving HEAD alone for manual/workflow_dispatch re-runs.

(2) keeps GIT_SHA's existing override contract usable and makes the header's claim literally true in the code. (1) is smaller. Either way scripts/tests/reseed-publish-workflow-test.sh should grow a case asserting the rail publishes main's tip and not the run ref, since that is the invariant that silently did not hold.

Not in scope

The reason the runs carry a stale head_sha (a stale Forgejo cron schedule CommitSHA vs. a queue backlog) is undetermined and tracked on #2057 — see the mechanism notes there. This ticket is the defect that the rail publishes the run ref at all, which is a bug whichever way that resolves: workflow_dispatch on an older ref, or a re-run of an old run, would publish a stale agent even on a perfectly healthy host.


Filed by the swarm healer, pass heal-Matou-idss-1793055771-1076509, signature 34d79489ef32. No repair attempted: the fix is a semantics ruling on the publish rail, and healer charter forbids widening/repinning the publish rails while the #2057 hanging stage is unknown.

## Symptom The `reseed-publish` / `release-publish` rails publish **whatever ref the run checked out**, not main's tip. Both workflow headers claim otherwise. `reseed-publish.yml`'s header says the rail > diffs from the NEWEST PUBLISHED registry version to origin/main and publishes **origin/main's tip** only when that range touches the agent-affecting set but nothing in the rail ever resolves `origin/main`: - `.forgejo/workflows/reseed-publish.yml` — the only checkout is a plain `actions/checkout@v4` with `fetch-depth: 0`. That checks out `github.sha`, i.e. the **run's** `head_sha`, not `origin/main`. - `scripts/bootstrap-reseed/publish.sh:39` — `sha="$(git -C "$root" rev-parse "${GIT_SHA:-HEAD}")"`. `GIT_SHA` is not set by either workflow, so the published sha is the checked-out `HEAD`. The guard base is correct and idempotent (`published_newest()`, newest-published..HEAD — that part does what the header describes). It is the **head** of the range that is wrong. ## Why it is not academic — it is live right now Observed on the 2026-10-26 23:02 UTC healer pass (evidence `/tmp/matou-heal-Matou-idss.cRvjYg`, reported on #2057): every elitebook-03 publish task in the window carries `head_sha` **`395a69ca`**, which stopped being main's head at **2026-10-23 17:47 UTC** (`7e93f241` landed then) and is 14 commits behind `c9d64caa`. Every matou-workstation task in the same window is at `c9d64caa`. So for >3 days this rail has been running a stale ref. It happens to be red for an unrelated reason (#2057, the elitebook-03 degradation), which is the only thing that has stopped it minting a pin for `395a69ca`. **Fix #2057 alone and this rail goes green while publishing a 3-day-old agent** — and `published_newest()` would then advance the tracking pin to that stale sha, which is exactly the "served pin can never catch up" failure the guard comment says the rail exists to prevent. Note the belt-and-braces guard cannot catch this: `oc_reseed_agent_affected "$base" "$sha"` with `base` = newest published and `sha` = a commit *behind* it yields a backwards range, which is not a state the guard was written to reject. ## Ruling owed Where should the rail pin its head? Two candidate shapes, and this needs a human call because it decides what "the published agent" means: 1. **Resolve in the workflow** — check out `main` by name (`ref: main`) so `HEAD` *is* main's tip at run start. 2. **Resolve in the script** — have the rail pass `GIT_SHA="$(git rev-parse origin/main)"`, making the intent explicit at the seam and leaving `HEAD` alone for manual/`workflow_dispatch` re-runs. (2) keeps `GIT_SHA`'s existing override contract usable and makes the header's claim literally true in the code. (1) is smaller. Either way `scripts/tests/reseed-publish-workflow-test.sh` should grow a case asserting the rail publishes main's tip and not the run ref, since that is the invariant that silently did not hold. ## Not in scope The *reason* the runs carry a stale `head_sha` (a stale Forgejo cron schedule `CommitSHA` vs. a queue backlog) is undetermined and tracked on #2057 — see the mechanism notes there. This ticket is the defect that the rail publishes the run ref at all, which is a bug whichever way that resolves: `workflow_dispatch` on an older ref, or a re-run of an old run, would publish a stale agent even on a perfectly healthy host. --- Filed by the swarm healer, pass `heal-Matou-idss-1793055771-1076509`, signature `34d79489ef32`. No repair attempted: the fix is a semantics ruling on the publish rail, and healer charter forbids widening/repinning the publish rails while the #2057 hanging stage is unknown.
Author
Member

Healer watchdog pass of 2026-10-27 13:03 UTC (heal-Matou-idss-1793106199-3093072, signature 34d79489ef32) — the stale-ref symptom this ticket was filed against has cleared. All 50 runs in this window, both publish rails included, carry head_sha c9d64caa, which git ls-remote confirms is main's tip.

So the ordering advice on #2057 ("land this before or alongside the elitebook repair, or closing #2057 greens the rail onto a 3-day-stale agent") no longer blocks anything: the rails would currently publish main's tip anyway.

The bug itself stands and is still worth landing — publish.sh:39 taking GIT_SHA:-HEAD while the workflow checks out the run's ref is a latent correctness hole that will re-bite the next time the run sha and main's tip diverge. It just isn't urgent, and it is no longer a prerequisite for repairing the rails. Cause of the current reds is #2073 (server-side bulk-transfer degradation on git.matou.nz).

Healer watchdog pass of 2026-10-27 13:03 UTC (`heal-Matou-idss-1793106199-3093072`, signature `34d79489ef32`) — **the stale-ref symptom this ticket was filed against has cleared.** All 50 runs in this window, both publish rails included, carry `head_sha` `c9d64caa`, which `git ls-remote` confirms is main's tip. So the ordering advice on #2057 ("land this before or alongside the elitebook repair, or closing #2057 greens the rail onto a 3-day-stale agent") **no longer blocks anything**: the rails would currently publish main's tip anyway. The bug itself stands and is still worth landing — `publish.sh:39` taking `GIT_SHA:-HEAD` while the workflow checks out the run's ref is a latent correctness hole that will re-bite the next time the run sha and main's tip diverge. It just isn't urgent, and it is no longer a prerequisite for repairing the rails. Cause of the current reds is **#2073** (server-side bulk-transfer degradation on `git.matou.nz`).
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#2072
No description provided.