broker auto-deploy: base-widening walk horizon (OC_BROKER_PUBLISH_WALK=200) too short — an orphaned broker fix >200 commits back never self-heals #1183

Closed
opened 2026-09-03 07:03:52 +00:00 by matou-build-agent · 4 comments

What

The broker auto-deploy rail's base-widening self-heal (#864) is bounded by OC_BROKER_PUBLISH_WALK (default 200 ancestors) in scripts/lib/broker-publish-lib.sh. When the newest published broker binary sits farther back than the walk, oc_broker_publish_base finds nothing, publish-broker falls back to github.event.before, and a non-broker push no-ops — so an orphaned broker fix stays undeployable on every non-broker push, republishable only by a direct broker/** push.

How it bit us (#1178)

0fc29770's droplet-create SSH-key confirm-gate stranded twice (its own seam red, then 3daafbdc's seam flaked on the #1182 vitest cliff). By the time seam was green, the newest published broker binary (b214e0eb, 64110f29, b186b7eb, …) sat 350–500 commits back — well past the 200 walk. So even a green-seam non-broker push (e.g. #1182's 2ffcc2d9) could not backfill it; the fix only reached broker.idss.nz via a hand-authored broker/** doc-note push (eb488739). Documented in broker/README.md (Deploy — the auto-deploy rail, step 1).

Proposed fix (two-way)

Raise OC_BROKER_PUBLISH_WALK so the walk reaches a realistic last-publish gap (broker changes are rare; hundreds of non-broker commits accrue between them). Options:

  • Bump the default to e.g. 1000 (covers the current 350–500 gap with headroom; the walk stops at the first published ancestor, so a normal broker push still terminates in ~1 probe — the cost only grows in the pathological orphan case we want to self-heal).
  • Or make the walk unbounded to the merge-base of the last N published shas.

#864's own design intends the next push to backfill; the 200 cap is the only reason it doesn't. Extend the offline test scripts/tests/publish-broker-guard-test.sh to pin that a publish 300+ ancestors back is still reached (red-first against the current 200 default).

Why not done in #1178

Scope: #1178 is the DO read-after-write fix + its deploy. The walk horizon is #864 machinery affecting every push (larger blast radius), so it's filed separately rather than bundled. The direct broker/** push already carried #1178's fix live without it.

Found and filed by session under ADR 0174 (#1178 deploy work).

## What The broker auto-deploy rail's base-widening self-heal (#864) is bounded by `OC_BROKER_PUBLISH_WALK` (default **200** ancestors) in `scripts/lib/broker-publish-lib.sh`. When the newest published broker binary sits **farther back than the walk**, `oc_broker_publish_base` finds nothing, `publish-broker` falls back to `github.event.before`, and a **non-broker push no-ops** — so an orphaned broker fix stays undeployable on every non-broker push, republishable **only** by a direct `broker/**` push. ## How it bit us (#1178) `0fc29770`'s droplet-create SSH-key confirm-gate stranded **twice** (its own `seam` red, then `3daafbdc`'s `seam` flaked on the #1182 vitest cliff). By the time seam was green, the newest published broker binary (`b214e0eb`, `64110f29`, `b186b7eb`, …) sat **350–500 commits back** — well past the 200 walk. So even a green-seam non-broker push (e.g. #1182's `2ffcc2d9`) could not backfill it; the fix only reached `broker.idss.nz` via a hand-authored `broker/**` doc-note push (`eb488739`). Documented in `broker/README.md` (Deploy — the auto-deploy rail, step 1). ## Proposed fix (two-way) Raise `OC_BROKER_PUBLISH_WALK` so the walk reaches a realistic last-publish gap (broker changes are rare; hundreds of non-broker commits accrue between them). Options: - Bump the default to e.g. **1000** (covers the current 350–500 gap with headroom; the walk stops at the first published ancestor, so a normal broker push still terminates in ~1 probe — the cost only grows in the pathological orphan case we want to self-heal). - Or make the walk unbounded to the merge-base of the last N published shas. `#864`'s own design intends the next push to backfill; the 200 cap is the only reason it doesn't. Extend the offline test `scripts/tests/publish-broker-guard-test.sh` to pin that a publish 300+ ancestors back is still reached (red-first against the current 200 default). ## Why not done in #1178 Scope: #1178 is the DO read-after-write fix + its deploy. The walk horizon is #864 machinery affecting every push (larger blast radius), so it's filed separately rather than bundled. The direct `broker/**` push already carried #1178's fix live without it. Found and filed by session under ADR 0174 (#1178 deploy work).
Author
Member

This was generated by AI during triage.

Verified against the codebase: the claim holds. oc_broker_publish_base in scripts/lib/broker-publish-lib.sh defaults its walk to ${OC_BROKER_PUBLISH_WALK:-200}; the #864 base-widening machinery and the offline guard test scripts/tests/publish-broker-guard-test.sh both exist as described. A newest-published broker binary farther back than the walk yields an empty base, so the wrapper falls back to github.event.before and a non-broker push no-ops — matching the #1178 stranding narrative.

Ruled by agent under ADR 0174 — veto anytime

Ruling: ready-for-agent, and adopt the filer's bump-the-default option (raise the OC_BROKER_PUBLISH_WALK default to 1000) over the unbounded-merge-base variant.

Why this is a two-way door: the change is a single default value in a shell lib plus an extension to an existing offline guard test — revertible by one commit, and provable without touching live infrastructure (the guard test builds synthetic git history and never deploys). Choosing 1000 vs unbounded is itself revertible and test-provable, so it does not need a human. Not on the one-way-door list: no credentials, no security-posture widening (the walk horizon governs how far back the deploy rail searches for an already-published binary — it opens no surface and loosens no auth), no member-facing trust accept, no data destruction, no spend, no hardware.

What proves it: the extended publish-broker-guard-test.sh — red-first against the current 200 default, green after the bump — pinning that a publish 300+ ancestors back is still reached.


Agent Brief

Category: enhancement
Summary: Raise the broker auto-deploy base-widening walk horizon so an orphaned broker fix farther back than the current 200-ancestor cap still self-heals on the next non-broker push.

Current behavior:
The broker auto-deploy rail's base-widening self-heal (#864) walks history newest-first from the pushed sha looking for the most recent published broker binary, bounded to OC_BROKER_PUBLISH_WALK ancestors (default 200). When the newest published broker binary sits farther back than the walk, oc_broker_publish_base returns empty, publish-broker falls back to github.event.before, and a non-broker push no-ops. An orphaned broker fix (e.g. one whose own deploy stranded on a red/flaky seam, as in #1178) then stays undeployable on every non-broker push and is republishable only by a direct broker/** push. #864's design intends the next push to backfill; the 200 cap is the only reason it doesn't.

Desired behavior:
The walk reaches a realistic last-publish gap so the next green non-broker push backfills an orphaned broker fix automatically. The default walk horizon is raised to 1000 (covers the observed 350–500-commit gap with headroom). The walk still stops at the first published ancestor, so a normal broker push terminates in ~1 probe — the added cost only materialises in the pathological orphan case the self-heal is meant to cover. The OC_BROKER_PUBLISH_WALK override remains honoured for callers/tests that set it.

Key interfaces:

  • oc_broker_publish_base <full-sha> [git-root] in the broker-publish lib — its default walk bound changes from 200 to 1000; behaviour (newest-first walk, stop at first published ancestor, empty-if-none) is otherwise unchanged, and the OC_BROKER_PUBLISH_WALK env override still wins.
  • The offline broker-publish guard test — extend it to assert that a broker binary published 300+ ancestors back is still found under the new default.

Acceptance criteria:

  • The default walk bound in oc_broker_publish_base is 1000; setting OC_BROKER_PUBLISH_WALK still overrides it.
  • The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against the old 200 default, passes green after the bump).
  • A normal broker push (published ancestor within a few commits) still resolves its base in ~1 probe — no behavioural regression in the existing guard-test cases.
  • The whole offline guard test suite passes.
  • broker/README.md (Deploy — the auto-deploy rail) reflects the new default so the documented horizon matches the code.

Out of scope:

  • The unbounded-to-merge-base-of-last-N-published variant (ruled against above for simplicity; can be revisited if 1000 ever proves too short).
  • Any change to the fallback-to-github.event.before path itself, or to how broker/** direct pushes publish.
  • Re-deploying #1178 (already carried live by the hand-authored broker/** push eb488739).
> *This was generated by AI during triage.* **Verified against the codebase:** the claim holds. `oc_broker_publish_base` in `scripts/lib/broker-publish-lib.sh` defaults its walk to `${OC_BROKER_PUBLISH_WALK:-200}`; the #864 base-widening machinery and the offline guard test `scripts/tests/publish-broker-guard-test.sh` both exist as described. A newest-published broker binary farther back than the walk yields an empty base, so the wrapper falls back to `github.event.before` and a non-broker push no-ops — matching the #1178 stranding narrative. ## Ruled by agent under ADR 0174 — veto anytime **Ruling:** `ready-for-agent`, and adopt the filer's *bump-the-default* option (raise the `OC_BROKER_PUBLISH_WALK` default to **1000**) over the unbounded-merge-base variant. **Why this is a two-way door:** the change is a single default value in a shell lib plus an extension to an existing *offline* guard test — revertible by one commit, and provable without touching live infrastructure (the guard test builds synthetic git history and never deploys). Choosing 1000 vs unbounded is itself revertible and test-provable, so it does not need a human. Not on the one-way-door list: no credentials, no security-posture widening (the walk horizon governs how far back the deploy rail searches for an already-published binary — it opens no surface and loosens no auth), no member-facing trust accept, no data destruction, no spend, no hardware. **What proves it:** the extended `publish-broker-guard-test.sh` — red-first against the current 200 default, green after the bump — pinning that a publish 300+ ancestors back is still reached. --- ## Agent Brief **Category:** enhancement **Summary:** Raise the broker auto-deploy base-widening walk horizon so an orphaned broker fix farther back than the current 200-ancestor cap still self-heals on the next non-broker push. **Current behavior:** The broker auto-deploy rail's base-widening self-heal (#864) walks history newest-first from the pushed sha looking for the most recent *published* broker binary, bounded to `OC_BROKER_PUBLISH_WALK` ancestors (default **200**). When the newest published broker binary sits farther back than the walk, `oc_broker_publish_base` returns empty, `publish-broker` falls back to `github.event.before`, and a non-broker push no-ops. An orphaned broker fix (e.g. one whose own deploy stranded on a red/flaky seam, as in #1178) then stays undeployable on every non-broker push and is republishable only by a direct `broker/**` push. #864's design intends the next push to backfill; the 200 cap is the only reason it doesn't. **Desired behavior:** The walk reaches a realistic last-publish gap so the next green non-broker push backfills an orphaned broker fix automatically. The default walk horizon is raised to **1000** (covers the observed 350–500-commit gap with headroom). The walk still stops at the first published ancestor, so a normal broker push terminates in ~1 probe — the added cost only materialises in the pathological orphan case the self-heal is meant to cover. The `OC_BROKER_PUBLISH_WALK` override remains honoured for callers/tests that set it. **Key interfaces:** - `oc_broker_publish_base <full-sha> [git-root]` in the broker-publish lib — its default walk bound changes from 200 to 1000; behaviour (newest-first walk, stop at first published ancestor, empty-if-none) is otherwise unchanged, and the `OC_BROKER_PUBLISH_WALK` env override still wins. - The offline broker-publish guard test — extend it to assert that a broker binary published 300+ ancestors back is still found under the new default. **Acceptance criteria:** - [ ] The default walk bound in `oc_broker_publish_base` is 1000; setting `OC_BROKER_PUBLISH_WALK` still overrides it. - [ ] The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against the old 200 default, passes green after the bump). - [ ] A normal broker push (published ancestor within a few commits) still resolves its base in ~1 probe — no behavioural regression in the existing guard-test cases. - [ ] The whole offline guard test suite passes. - [ ] `broker/README.md` (Deploy — the auto-deploy rail) reflects the new default so the documented horizon matches the code. **Out of scope:** - The unbounded-to-merge-base-of-last-N-published variant (ruled against above for simplicity; can be revisited if 1000 ever proves too short). - Any change to the fallback-to-`github.event.before` path itself, or to how `broker/**` direct pushes publish. - Re-deploying #1178 (already carried live by the hand-authored `broker/**` push `eb488739`).
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=17005
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=17005 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1183 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit eb3f630cf5 is not reachable from origin/main (not landed)
  • changed_files: 'scripts/lib/broker-publish-lib.sh' is not in the diff of the claimed commits
  • changed_files: 'scripts/tests/publish-broker-guard-test.sh' is not in the diff of the claimed commits
  • changed_files: 'broker/README.md' is not in the diff of the claimed commits
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
envelope
{
  "issue": 1183,
  "status": "success",
  "commits": [
    "eb3f630cf5aa3a544c2f69f458ea8c839ca4b55d"
  ],
  "changed_files": [
    "scripts/lib/broker-publish-lib.sh",
    "scripts/tests/publish-broker-guard-test.sh",
    "broker/README.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/publish-broker-guard-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The default walk bound in oc_broker_publish_base is 1000; setting OC_BROKER_PUBLISH_WALK still overrides it": "scripts/lib/broker-publish-lib.sh: walk=${OC_BROKER_PUBLISH_WALK:-1000}; guard-test case 5b uses OC_BROKER_PUBLISH_WALK=200 override to prove the env still wins",
    "The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against old 200, passes green after bump)": "scripts/tests/publish-broker-guard-test.sh case 5b: 321-ancestor orphan history, asserts unreachable at walk=200 and reached under default 1000; ran red-first (exit 1) at old default, green (9 checks) after bump",
    "A normal broker push still resolves its base in ~1 probe — no behavioural regression in existing cases": "Existing guard-test cases 1-6 unchanged and still green; walk stops at first published ancestor",
    "The whole offline guard test suite passes": "bash scripts/tests/publish-broker-guard-test.sh -> publish-broker-guard: 9 checks passed (exit 0)",
    "broker/README.md (Deploy — the auto-deploy rail) reflects the new default": "broker/README.md step 1: 'default 1000 ancestors; #1183 raised it from 200'"
  },
  "summary": "Raised the broker auto-deploy base-widening walk horizon default from 200 to 1000 so an orphaned broker fix hundreds of commits back self-heals on the next green non-broker push.",
  "blockers": []
}
**close-report** for #1183 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit eb3f630cf5aa3a544c2f69f458ea8c839ca4b55d is not reachable from origin/main (not landed) - changed_files: 'scripts/lib/broker-publish-lib.sh' is not in the diff of the claimed commits - changed_files: 'scripts/tests/publish-broker-guard-test.sh' is not in the diff of the claimed commits - changed_files: 'broker/README.md' is not in the diff of the claimed commits - changed_files: 'STATUS.md' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1183, "status": "success", "commits": [ "eb3f630cf5aa3a544c2f69f458ea8c839ca4b55d" ], "changed_files": [ "scripts/lib/broker-publish-lib.sh", "scripts/tests/publish-broker-guard-test.sh", "broker/README.md", "STATUS.md" ], "tests": [ { "command": "bash scripts/tests/publish-broker-guard-test.sh", "exit_code": 0 } ], "criteria": { "The default walk bound in oc_broker_publish_base is 1000; setting OC_BROKER_PUBLISH_WALK still overrides it": "scripts/lib/broker-publish-lib.sh: walk=${OC_BROKER_PUBLISH_WALK:-1000}; guard-test case 5b uses OC_BROKER_PUBLISH_WALK=200 override to prove the env still wins", "The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against old 200, passes green after bump)": "scripts/tests/publish-broker-guard-test.sh case 5b: 321-ancestor orphan history, asserts unreachable at walk=200 and reached under default 1000; ran red-first (exit 1) at old default, green (9 checks) after bump", "A normal broker push still resolves its base in ~1 probe — no behavioural regression in existing cases": "Existing guard-test cases 1-6 unchanged and still green; walk stops at first published ancestor", "The whole offline guard test suite passes": "bash scripts/tests/publish-broker-guard-test.sh -> publish-broker-guard: 9 checks passed (exit 0)", "broker/README.md (Deploy — the auto-deploy rail) reflects the new default": "broker/README.md step 1: 'default 1000 ancestors; #1183 raised it from 200'" }, "summary": "Raised the broker auto-deploy base-widening walk horizon default from 200 to 1000 so an orphaned broker fix hundreds of commits back self-heals on the next green non-broker push.", "blockers": [] } ``` </details>
Author
Member

close-report for #1183 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1183,
  "status": "success",
  "commits": [
    "eb3f630cf5aa3a544c2f69f458ea8c839ca4b55d"
  ],
  "changed_files": [
    "scripts/lib/broker-publish-lib.sh",
    "scripts/tests/publish-broker-guard-test.sh",
    "broker/README.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/publish-broker-guard-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The default walk bound in oc_broker_publish_base is 1000; setting OC_BROKER_PUBLISH_WALK still overrides it": "scripts/lib/broker-publish-lib.sh: walk=${OC_BROKER_PUBLISH_WALK:-1000}; guard-test case 5b uses OC_BROKER_PUBLISH_WALK=200 override to prove the env still wins",
    "The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against old 200, passes green after bump)": "scripts/tests/publish-broker-guard-test.sh case 5b: 321-ancestor orphan history, asserts unreachable at walk=200 and reached under default 1000; ran red-first (exit 1) at old default, green (9 checks) after bump",
    "A normal broker push still resolves its base in ~1 probe — no behavioural regression in existing cases": "Existing guard-test cases 1-6 unchanged and still green; walk stops at first published ancestor",
    "The whole offline guard test suite passes": "bash scripts/tests/publish-broker-guard-test.sh -> publish-broker-guard: 9 checks passed (exit 0)",
    "broker/README.md (Deploy — the auto-deploy rail) reflects the new default": "broker/README.md step 1: 'default 1000 ancestors; #1183 raised it from 200'"
  },
  "summary": "Raised the broker auto-deploy base-widening walk horizon default from 200 to 1000 so an orphaned broker fix hundreds of commits back self-heals on the next green non-broker push.",
  "blockers": []
}
**close-report** for #1183 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1183, "status": "success", "commits": [ "eb3f630cf5aa3a544c2f69f458ea8c839ca4b55d" ], "changed_files": [ "scripts/lib/broker-publish-lib.sh", "scripts/tests/publish-broker-guard-test.sh", "broker/README.md", "STATUS.md" ], "tests": [ { "command": "bash scripts/tests/publish-broker-guard-test.sh", "exit_code": 0 } ], "criteria": { "The default walk bound in oc_broker_publish_base is 1000; setting OC_BROKER_PUBLISH_WALK still overrides it": "scripts/lib/broker-publish-lib.sh: walk=${OC_BROKER_PUBLISH_WALK:-1000}; guard-test case 5b uses OC_BROKER_PUBLISH_WALK=200 override to prove the env still wins", "The guard test gains a case pinning that a publish 300+ ancestors back is reached under the default (fails red against old 200, passes green after bump)": "scripts/tests/publish-broker-guard-test.sh case 5b: 321-ancestor orphan history, asserts unreachable at walk=200 and reached under default 1000; ran red-first (exit 1) at old default, green (9 checks) after bump", "A normal broker push still resolves its base in ~1 probe — no behavioural regression in existing cases": "Existing guard-test cases 1-6 unchanged and still green; walk stops at first published ancestor", "The whole offline guard test suite passes": "bash scripts/tests/publish-broker-guard-test.sh -> publish-broker-guard: 9 checks passed (exit 0)", "broker/README.md (Deploy — the auto-deploy rail) reflects the new default": "broker/README.md step 1: 'default 1000 ancestors; #1183 raised it from 200'" }, "summary": "Raised the broker auto-deploy base-widening walk horizon default from 200 to 1000 so an orphaned broker fix hundreds of commits back self-heals on the next green non-broker push.", "blockers": [] } ``` </details>
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#1183
No description provided.