Skip to content

fix(publisher): replace stale runner-owned publication branch instead of refusing - #2642

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-2638-wp-codebox
Dec 5, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-2638-wp-codebox

Conversation

@chubes4

@chubes4 chubes4 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recurring workloads that reuse a fixed publication branch (for example Docs Agent) failed at publication once base moved past an unmerged PR: the publisher refused because the branch no longer descended from base. Now the publisher builds the new run as a commit on the current base, force-updates the branch to it and keeps the open PR. Branches that still descend from base work as before: the new commit goes on top of the existing head and the ref is updated without force.

What changed

  • An open-PR publication branch that no longer descends from base now gets a new commit built on the current base tree and parented on the base SHA, and its ref is force-updated. The same PR is kept and reported as reused.
  • The publication result reports commit.replaced_sha (the superseded head) only when a replacement happened.
  • Branches that descend from base still extend the existing head with a non-forced ref update. No new caller policy field.
  • The old refusal test in tests/runner-workspace-publisher.test.mjs is replaced by a test for the replacement case. The fast-forward case now also checks that the update is not forced and has no replaced_sha.

Verification

All gates passed on 1289aefed1cc. Base main: gated on f1871b88cbd8, target now f1871b88cbd8, re-verified: no.

  • HOMEBOY_LINT_BASE=f1871b88cbd864fad990b9212a170434433f36fe homeboy --placement local review lint wp-codebox --path . --…: passed, 67731 ms; retained gate metadata.
  • node --test tests/runner-workspace-publisher*.test.mjs: passed, 90 ms; retained gate evidence.
  • repro: none (no repro gate was declared, so these gates do not prove the issue).
  • CI: pending

Gate 2 output
runner workspace publisher ok
✔ tests/runner-workspace-publisher.test.mjs (18.000123ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 21.651991

Cook run
  • Cook ID: agent-task-2f10c7d4-be4d-4f0c-b8a9-c4a6bca50eb2
  • Attempt run ID: agent-task-2f10c7d4-be4d-4f0c-b8a9-c4a6bca50eb2-attempt-1-6de982a8
  • Gate 1: tree 96d7a966de1e913e9dbaf2e6c6914ef72cdc1f36
  • Gate 2: tree 96d7a966de1e913e9dbaf2e6c6914ef72cdc1f36

Delivery

  • Delivered: Replace stale open-PR publication branch on current base with force ref update, keeping the PR
  • Delivered: Descending branches keep existing behavior
  • Delivered: Regression test

Evidence

  • Local run of node --test tests/runner-workspace-publisher*.test.mjs: 1 test file ran and passed, including the new replacement case and the stricter fast-forward checks.
  • The local lint attempt did not run: Homeboy reported that the component has no linked extension providing deps support (it could not read the nodejs manifest). This is an environment limitation; lint is left to Homeboy's gate.

AI disclosure

Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served claude-opus-5-5. Cook time: 10m46s.

The AI read the issue and the maintainer's decision comment, changed the publisher's stale-branch handling, updated the regression tests and ran the focused publisher test, under the direction of the Cook requester. Homeboy reports controller verification separately from this account of the AI's work. A human reviews before merge.

Refs #2638

@chubes4
chubes4 marked this pull request as ready for review December 5, 2026 15:29
@chubes4
chubes4 merged commit 40491e7 into main Dec 5, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant