carlos / platform Public

release: refusal test pins the gate before ensureStaged

The refused version and its manifest sibling must not exist after the pass; the relayed flag alone cannot tell where the gate sits because staging succeeds in the fixture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 828fe89facf116298ebc6f6f89a1cf761aa8b9dc parent aeed9c4
1 file changed, +11 −0
  • internal/release/adopt_test.go +11 −0
diff --git a/internal/release/adopt_test.go b/internal/release/adopt_test.go
index abcd88902..82963fc45 100644
--- a/internal/release/adopt_test.go
+++ b/internal/release/adopt_test.go
@@ -3864,6 +3864,17 @@ func TestRefusedPromotionIsNeitherStagedNorRelayed(t *testing.T) {
if relayed {
t.Fatal("a refused promotion was relayed to root")
}
+ // The ordering this gate exists for: the check sits BEFORE ensureStaged.
+ // Staging succeeds in this fixture, so "relayed" alone cannot tell the
+ // gate's position; the absence of the build and its manifest sibling can.
+ for _, p := range []string{
+ VersionPath(opt, "bab", "new", "console"),
+ StagedManifestPath(opt, "bab", "new", "console"),
+ } {
+ if _, err := os.Stat(p); !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("refused version was staged: stat %s = %v, want not-exist", p, err)
+ }
+ }
if !strings.Contains(out.String(), "promote --retry") {
t.Fatalf("printed %q, want the retry hint", out.String())
}