publish-broker orphans a broker sha whenever ci's seam is cancelled — the newest published broker binary is b9a3adfd (2026-08-24), two broker commits behind main #864

Closed
opened 2026-08-26 01:24:14 +00:00 by matou-build-agent · 1 comment

Found while working #745 (the loop-closer for #741's broker half). Filed rather than fixed there — #745's session is scoped to the expiry-tag verification.

What is wrong

ci.yml's publish-broker job publishes idss-broker/<github.sha>/ourcloud-broker-x86_64 only when git diff --name-only $GIT_BASE $GIT_SHA hits ^(broker/|go\.mod|go\.sum), where GIT_BASE is github.event.before — the previous head of THAT push. It also declares needs: seam.

So a push whose seam job is cancelled (superseded by a newer push, which happens constantly under the swarm) never runs publish-broker at all. The next successful ci run then diffs from ITS OWN before — which is already past the cancelled push's commits — sees no broker change, and prints no broker-affecting change ... nothing to publish. Nothing ever backfills. The broker sha is orphaned permanently.

Measured, 2026-08-26

Probing the generic registry for every one of the last 120 commits on main:

  • Newest published broker binary: b9a3adfd (broker: #756 — a refused gateway teardown is OWED), 2026-08-24T22:49Z.
  • Landed since, both touching broker/**, both unpublished:
    • 1aabd431 — #813, broker front-door probe: a bounded outside-in POST /v1/subdomains/probe
    • bfd7b76b — rehearsal-5: standing lease renewal + wall re-rule + device droplet carrier

The mechanism, straight off the action tasks:

2026-08-25T21:57:34Z publish-broker | eba206e4 CANCELLED
2026-08-25T22:46:02Z seam           | 9fa7e2e7 CANCELLED   <- the push carrying bfd7b76b
2026-08-25T23:04:02Z publish-broker | 67305432 success

and run 10803's own log:

publish-broker: no broker-affecting change in 70ed992c97120f81abd5f16a82ec496c18334cb7..673054329404 — nothing to publish

70ed992c is already AFTER bfd7b76b, so the broker change fell into the gap between two before pointers.

Why it matters

This is half of why the broker's auto-deploy rail (ADR 0185, #688/#689/#690) has never put a fix live. GOTCHAS #59 tells you to workflow_dispatch broker-deploy with your sha — but broker-deploy's own guard 404s on an unpublished sha and no-ops (publish-broker skipped this sha (404) — nothing to deploy), so there is nothing to deploy. (The other half is that the deploy leg has no ssh route to the mail droplet at all — #745.)

It also means #813's front-door probe and the rehearsal-5 broker work are undeployable today even if the ssh door existed.

Shape of a fix (not ruled — this is the filing)

Candidates, cheapest first:

  1. Widen the guard's base. Diff against the last sha that was actually published rather than github.event.before — e.g. walk back to the newest sha the registry already holds, or diff <last-published>..HEAD. Self-healing: one successful run backfills every orphaned push.
  2. Drop needs: seam for publish-broker (publishing a binary does not need the seam gate to have run on that exact push) so a cancelled seam stops taking it down.
  3. A catch-up leg: a scheduled job that publishes HEAD if HEAD touches broker/** relative to the newest published sha.

Whichever lands, the acceptance is the same: after a push whose seam is cancelled, main's broker sha still ends up in the registry.

Proof commands

# the newest published broker sha (200 = published, 404 = not)
for s in $(git log --format=%H -30); do
  printf '%s ' "$(curl -sI -o /dev/null -w '%{http_code}' \
    https://git.matou.nz/api/packages/Matou/generic/idss-broker/$s/ourcloud-broker-x86_64)"
  git log -1 --format='%h %s' $s | cut -c1-70
done
Found while working #745 (the loop-closer for #741's broker half). Filed rather than fixed there — #745's session is scoped to the expiry-tag verification. ## What is wrong `ci.yml`'s `publish-broker` job publishes `idss-broker/<github.sha>/ourcloud-broker-x86_64` **only when `git diff --name-only $GIT_BASE $GIT_SHA` hits `^(broker/|go\.mod|go\.sum)`**, where `GIT_BASE` is `github.event.before` — the previous head of THAT push. It also declares `needs: seam`. So a push whose `seam` job is **cancelled** (superseded by a newer push, which happens constantly under the swarm) never runs `publish-broker` at all. The next successful ci run then diffs from ITS OWN `before` — which is already past the cancelled push's commits — sees no broker change, and prints `no broker-affecting change ... nothing to publish`. **Nothing ever backfills.** The broker sha is orphaned permanently. ## Measured, 2026-08-26 Probing the generic registry for every one of the last 120 commits on `main`: - Newest published broker binary: **`b9a3adfd`** (`broker: #756 — a refused gateway teardown is OWED`), 2026-08-24T22:49Z. - Landed since, both touching `broker/**`, both **unpublished**: - `1aabd431` — #813, `broker front-door probe: a bounded outside-in POST /v1/subdomains/probe` - `bfd7b76b` — `rehearsal-5: standing lease renewal + wall re-rule + device droplet carrier` The mechanism, straight off the action tasks: ``` 2026-08-25T21:57:34Z publish-broker | eba206e4 CANCELLED 2026-08-25T22:46:02Z seam | 9fa7e2e7 CANCELLED <- the push carrying bfd7b76b 2026-08-25T23:04:02Z publish-broker | 67305432 success ``` and run 10803's own log: ``` publish-broker: no broker-affecting change in 70ed992c97120f81abd5f16a82ec496c18334cb7..673054329404 — nothing to publish ``` `70ed992c` is already AFTER `bfd7b76b`, so the broker change fell into the gap between two `before` pointers. ## Why it matters This is half of why the broker's auto-deploy rail (ADR 0185, #688/#689/#690) has never put a fix live. GOTCHAS #59 tells you to `workflow_dispatch` `broker-deploy` with your sha — but `broker-deploy`'s own guard 404s on an unpublished sha and no-ops (`publish-broker skipped this sha (404) — nothing to deploy`), so there is nothing to deploy. (The other half is that the deploy leg has no ssh route to the mail droplet at all — #745.) It also means #813's front-door probe and the rehearsal-5 broker work are undeployable today even if the ssh door existed. ## Shape of a fix (not ruled — this is the filing) Candidates, cheapest first: 1. **Widen the guard's base.** Diff against the last sha that was actually published rather than `github.event.before` — e.g. walk back to the newest sha the registry already holds, or diff `<last-published>..HEAD`. Self-healing: one successful run backfills every orphaned push. 2. **Drop `needs: seam`** for `publish-broker` (publishing a binary does not need the seam gate to have run on that exact push) so a cancelled `seam` stops taking it down. 3. **A catch-up leg**: a scheduled job that publishes `HEAD` if `HEAD` touches `broker/**` relative to the newest published sha. Whichever lands, the acceptance is the same: after a push whose `seam` is cancelled, `main`'s broker sha still ends up in the registry. ## Proof commands ```bash # the newest published broker sha (200 = published, 404 = not) for s in $(git log --format=%H -30); do printf '%s ' "$(curl -sI -o /dev/null -w '%{http_code}' \ https://git.matou.nz/api/packages/Matou/generic/idss-broker/$s/ourcloud-broker-x86_64)" git log -1 --format='%h %s' $s | cut -c1-70 done ```
Author
Member

Close report — landed under ADR 0174 (agent ruling; veto anytime).

Ruling. Two-way door: a revertible workflow-config change plus a new pure library, provable offline and confirmed against a live read-only registry probe. No one-way door touched (no credential, no spend, no posture widening). Fix chosen = candidate 1 (widen the guard's base); candidate 2 (drop needs: seam) considered and declined — the widened base self-heals across the cancellation regardless, and a published binary auto-deploys so it should have passed the gate.

What was wrong (confirmed live 2026-08-26). Unauthenticated probe of the generic registry for main's tip 487a2df6: 404. The newest published broker binary was 64110f29 — 43 commits / 4 broker commits behind main (b9a3adfd+64110f29 published; 1aabd431, bfd7b76b, 4d2573ac, baf1feb2 all landed and unpublished). Root cause exactly as filed: publish-broker diffs github.event.before..github.sha and needs: seam, so a push whose seam is cancelled never publishes, and the next run's before is already past the orphaned commits.

What landed (commit c3235bee).

  • scripts/lib/broker-publish-lib.sh — the decision core with the registry probe injected. oc_broker_publish_base walks history newest-first, probes the registry, returns the newest published ancestor; oc_broker_published_p is the probe (read is unauthenticated — the read endpoint is public and the write token REGISTRY_FORGEJO_TOKEN 401s on read, which would misread every published sha as absent).
  • .forgejo/workflows/ci.yml publish-broker step now sources the lib: no-ops if the tip is already published; else diffs <newest-published-ancestor>..HEAD, falling back to github.event.before only when the registry holds nothing within the walk. It probes all ancestors (not just broker-touching ones), so a backfilled tip sha is seen on the next push as HEAD^ and the re-publish does not recur every push.
  • scripts/tests/publish-broker-guard-test.sh — 8 checks, red before green, swept by the #873 scripts/tests/*.sh seam loop so it runs in ci. Models the orphan scenario, the widened base catching the orphan, the pre-fix base hiding it, the no-recur-after-backfill property, the empty-fallback, tip-not-its-own-base, the walk bound, and the unauthenticated-read wiring.
  • docs/GOTCHAS.md #98; STATUS.md header updated in the same commit.

Proof.

  • Offline: bash scripts/tests/publish-broker-guard-test.sh → 8 checks passed (fails against the pre-fix tree — lib absent).
  • Live read-only: sourcing the lib against the real registry resolves base=64110f29 at main's tip and the diff 64110f29..487a2df6 is broker-affecting → the fixed guard would publish HEAD, backfilling main's tip. This satisfies the acceptance criterion ("after a push whose seam is cancelled, main's broker sha still ends up in the registry").

Acceptance is self-healing, not yet live-observed: no new ci run has fired since the fix landed (a session cannot wait one out, ADR 0174 rule 7). The next green publish-broker on main will backfill 487a2df6 (or whatever tip it runs on) and deploy-broker will carry it — one run closes the whole 4-commit gap. The still-open half of the rail (no ssh route to the mail droplet, #745) is unchanged by this and named there, not here.

Ruled by agent under ADR 0174 — veto anytime.

**Close report — landed under ADR 0174 (agent ruling; veto anytime).** **Ruling.** Two-way door: a revertible workflow-config change plus a new pure library, provable offline and confirmed against a live read-only registry probe. No one-way door touched (no credential, no spend, no posture widening). Fix chosen = candidate 1 (widen the guard's base); candidate 2 (drop `needs: seam`) considered and declined — the widened base self-heals across the cancellation regardless, and a published binary auto-deploys so it should have passed the gate. **What was wrong (confirmed live 2026-08-26).** Unauthenticated probe of the generic registry for main's tip `487a2df6`: 404. The newest published broker binary was `64110f29` — **43 commits / 4 broker commits behind main** (`b9a3adfd`+`64110f29` published; `1aabd431`, `bfd7b76b`, `4d2573ac`, `baf1feb2` all landed and unpublished). Root cause exactly as filed: `publish-broker` diffs `github.event.before..github.sha` and `needs: seam`, so a push whose `seam` is cancelled never publishes, and the next run's `before` is already past the orphaned commits. **What landed (commit `c3235bee`).** - `scripts/lib/broker-publish-lib.sh` — the decision core with the registry probe injected. `oc_broker_publish_base` walks history newest-first, probes the registry, returns the newest **published ancestor**; `oc_broker_published_p` is the probe (read is **unauthenticated** — the read endpoint is public and the write token `REGISTRY_FORGEJO_TOKEN` 401s on read, which would misread every published sha as absent). - `.forgejo/workflows/ci.yml` `publish-broker` step now sources the lib: no-ops if the tip is already published; else diffs `<newest-published-ancestor>..HEAD`, falling back to `github.event.before` only when the registry holds nothing within the walk. It probes **all** ancestors (not just broker-touching ones), so a backfilled tip sha is seen on the next push as `HEAD^` and the re-publish does **not** recur every push. - `scripts/tests/publish-broker-guard-test.sh` — 8 checks, **red before green**, swept by the `#873` `scripts/tests/*.sh` seam loop so it runs in `ci`. Models the orphan scenario, the widened base catching the orphan, the pre-fix base hiding it, the no-recur-after-backfill property, the empty-fallback, tip-not-its-own-base, the walk bound, and the unauthenticated-read wiring. - `docs/GOTCHAS.md` #98; `STATUS.md` header updated in the same commit. **Proof.** - Offline: `bash scripts/tests/publish-broker-guard-test.sh` → `8 checks passed` (fails against the pre-fix tree — lib absent). - Live read-only: sourcing the lib against the real registry resolves `base=64110f29` at main's tip and the diff `64110f29..487a2df6` is broker-affecting → the fixed guard **would publish HEAD**, backfilling main's tip. This satisfies the acceptance criterion ("after a push whose seam is cancelled, main's broker sha still ends up in the registry"). **Acceptance is self-healing, not yet live-observed:** no new `ci` run has fired since the fix landed (a session cannot wait one out, ADR 0174 rule 7). The **next** green `publish-broker` on main will backfill `487a2df6` (or whatever tip it runs on) and `deploy-broker` will carry it — one run closes the whole 4-commit gap. The still-open half of the rail (no ssh route to the mail droplet, #745) is unchanged by this and named there, not here. Ruled by agent under ADR 0174 — veto anytime.
matou-build-agent 2026-08-26 23:52:20 +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.

Reference
Matou/idss#864
No description provided.