Skip to content

The sweep re-asks the ancestry question and observes its own merges in the same tick - #428

Merged
renmengye merged 2 commits into
mainfrom
feat/sweep-rebless
Sep 23, 2026
Merged

renmengye merged 2 commits into
mainfrom
feat/sweep-rebless

Conversation

@renmengye

Copy link
Copy Markdown
Member

Two latency fixes for self-merge, prompted by gpt-speedrun#27: its publish-time blessing was refused by an equality bug (#427), and because the sweep only reads the saved decision, the PR stayed held after the fix and needed a hand merge.

Re-asking only the ancestry question

When a parked run's blessing is empty and the saved reason was the base-ancestry refusal, the sweep re-evaluates it with the same containment helper publish uses (_contains_tip): the measured base must contain the current tip and the published head must contain it too. Every other guard in why_not still applies (panel clean, checks green, no message waiting, head unchanged). Any other saved reason (panel blocking, HEAD unreadable, ref absent) is never re-blessed. On success the sweep records the blessing on the run record, updates the PR's self-merge line, and merges in the same pass.

Publish now persists the reason kind, the measured base and the published head. Records written before this change carry only prose; the two known shapes are parsed (bounded hex) and the published head is taken from the ledger's pending record, and only when exactly one matches the PR.

Observing a merge in the same tick

After the sweep merges a PR it runs the same observation the next tick would (close_if_done), so the ledger confirmation and the run's ending land in the same sweep. The ledger hold is respected; an observation failure is logged and retried next tick without a second merge attempt.

Tests

A fixture generated from the current record schema shaped like #27 is re-blessed and merged; a base that advanced past the measured base is not; panel-blocking and HEAD-unreadable reasons are never re-blessed; a sweep-performed merge is confirmed and ended in the same sweep; a failed observation leaves the run for the next tick. Allowing any reason to re-bless fails four tests.

Compatibility

Run records gain three optional fields (auto_bless_reason_kind, auto_bless_base, auto_publish_head); older records without them are read as before, and an older kernel ignores the fields. No change to PR bodies beyond the existing status wording, none to ledger formats. Upgrading: no action needed; a PR held only by a base-moved blessing heals on the next tick.

🤖 Generated with Claude Code

…n the same tick

A PR held only because the measured base "moved" is rechecked each
sweep with the same containment test publish uses; publish now records
the reason kind, the measured base and the published head so the check
needs no prose. A merge the sweep performs is observed and confirmed in
the same pass instead of the next one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head 10be40fc — reviewer summarizer:hermes/gpt-5.6-terra over coverage+credentials+deployment+general+lifecycle+prose.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: 1 blocking, 0 advisory.

1 finding attached to the lines below.

Merged 1 blocking lifecycle finding: a failed merge can sweep a re-blessed run using stale state and incorrectly terminalize it as STUCK. Rejected: none.

Comment thread src/outerloop/tick.py
…used

The sweep reloads the record after the merge pass, so the wake pass
never writes back a copy without the saved blessing, and a run it has
just blessed skips the wake pass for that tick.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@renmengye renmengye added the outerloop:review re-request the advisory review label Sep 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head 5fd92eff — reviewer hermes/gpt-5.6-terra.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: no defects found.

@renmengye
renmengye merged commit 9ca3d7c into main Sep 23, 2026
5 checks passed
@renmengye
renmengye deleted the feat/sweep-rebless branch September 23, 2026 02:14
@renmengye renmengye mentioned this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

outerloop:review re-request the advisory review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant