selfboot round-trip test couples baseline to live working-tree pin state → red on every release-prep PR #599

Closed
opened 2026-07-29 22:48:48 +02:00 by engineer · 0 comments
Owner

Symptom

TestRoundTrip_ThreeActorBootstrap (internal/selfboot) fails go-ci on release-prep PRs (first seen on PR#552 chore(release): v0.34.0, head edf9c4d):

round-trip identity broken (go): reset 9a55eccd… != baseline ebd9070e…
round-trip identity broken (bash): reset 9a55eccd… != tree0 ebd9070e…

Root cause (verified empirically)

stageReusables (internal/selfboot/selfboot_test.go) stages the 5 real reusables from the live working tree (../../.forgejo/workflows/). The round-trip identity assertion — bake(main, PhaseMainReset) must equal the tree0 baseline — holds only when the working tree is at the 'main' build-ref marker state.

release-prep.sh pins those markers 'main' → 'vX.Y.Z' on every chore(release): prepare PR (the pin→reset oscillation; post-cut bookkeeping [skip ci] resets main back). So on a release-prep branch the baseline is vX.Y.Z-pinned while bake(main) rewrites to 'main' → trees diverge → the "no-op" invariant is violated by the setup, not by the code under test.

Measured: PR head = all 5 reusables 'v0.34.0'; origin/main = all 5 'main'; delta = exactly 1 line/file (the BUILD_BAKED_TOOLKIT_REF token). Reproduced verbatim in a worktree@edf9c4d (FAIL); resetting the reusables to 'main' markers → PASS.

Not a regression

  • roundtrip_test.go was added by #547 (absent at v0.33.0). v0.34.0 is the first release-prep PR to carry this test — that is the "why now".
  • Go and bash agree on the reset SHA (9a55ecc) → port equivalence holds; this is not a port divergence.
  • PR-time-only false-positive: post-cut bookkeeping restores the 'main' marker state, so main (and every merged commit) stays green. Left unfixed, it recurs on every future prepare PR — permanent gate-oscillation → gate-erosion.

Fix (Option A, ratified)

Normalize the staged reusables' build-ref markers to 'main' in stageReusables, using bake's own byte-exact rewrite kernel (guaranteeing byte-identity with bake(main)'s fixpoint). Decouples the milestone-#77 gate baseline from the transient release-prep pin; preserves the dogfood + all assertions + zero coverage loss; permanent across all future cuts.

Refs #547

## Symptom `TestRoundTrip_ThreeActorBootstrap` (`internal/selfboot`) fails `go-ci` on release-prep PRs (first seen on PR#552 `chore(release): v0.34.0`, head edf9c4d): ``` round-trip identity broken (go): reset 9a55eccd… != baseline ebd9070e… round-trip identity broken (bash): reset 9a55eccd… != tree0 ebd9070e… ``` ## Root cause (verified empirically) `stageReusables` (`internal/selfboot/selfboot_test.go`) stages the 5 real reusables from the **live working tree** (`../../.forgejo/workflows/`). The round-trip identity assertion — `bake(main, PhaseMainReset)` must equal the `tree0` baseline — holds **only when the working tree is at the `'main'` build-ref marker state**. `release-prep.sh` pins those markers `'main' → 'vX.Y.Z'` on every `chore(release): prepare` PR (the pin→reset oscillation; `post-cut bookkeeping [skip ci]` resets `main` back). So on a release-prep branch the baseline is `vX.Y.Z`-pinned while `bake(main)` rewrites to `'main'` → trees diverge → the "no-op" invariant is violated **by the setup**, not by the code under test. Measured: PR head = all 5 reusables `'v0.34.0'`; `origin/main` = all 5 `'main'`; delta = exactly **1 line/file** (the `BUILD_BAKED_TOOLKIT_REF` token). Reproduced verbatim in a worktree@edf9c4d (FAIL); resetting the reusables to `'main'` markers → PASS. ## Not a regression - `roundtrip_test.go` was added by #547 (absent at v0.33.0). **v0.34.0 is the first release-prep PR to carry this test** — that is the "why now". - Go and bash agree on the reset SHA (9a55ecc) → port equivalence holds; this is not a port divergence. - PR-time-only false-positive: post-cut bookkeeping restores the `'main'` marker state, so `main` (and every merged commit) stays green. Left unfixed, it recurs on **every future `prepare` PR** — permanent gate-oscillation → gate-erosion. ## Fix (Option A, ratified) Normalize the staged reusables' build-ref markers to `'main'` in `stageReusables`, using bake's own byte-exact rewrite kernel (guaranteeing byte-identity with `bake(main)`'s fixpoint). Decouples the milestone-#77 gate baseline from the transient release-prep pin; preserves the dogfood + all assertions + zero coverage loss; permanent across all future cuts. Refs #547
bosun closed this issue 2026-07-29 23:08:14 +02: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.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#599
No description provided.