carlos / platform Public

console: main's floor-door tests meet the resolved-latest floor (H6-M3)

Found running round 1's wider console set: since the merge,
TestSystemDoorsRefuseBelowTheRootfsFloor, ...RegionalFloor and
...FleetForwardFloor failed. main's tests take the latest public release
(v0.18.0, below the channel's current release) to a floor refusal, then
through it with the floor override. The branch's H6-M3 floor refuses a
resolved latest below the current release first, whatever the overrides
say, because latest.txt is unsigned.

The H6-M3 rule stays. The latest legs now expect its refusal, and the
override legs name the step back with "version": "v0.18.0", as the
refusal tells the operator to. A named release also meets the layout
downgrade gate, which main's latest path skipped, so the regional and
fleet tests' box reports a flat layout first (seedFlatBox).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4272d2f3d54ef954f501cf93442ab15556c486d7 parent 5065df4
2 files changed, +34 −6
  • internal/console/apisystemupdate_test.go +27 −4
  • internal/console/fleetfloor_test.go +7 −2
diff --git a/internal/console/apisystemupdate_test.go b/internal/console/apisystemupdate_test.go
index 8d1c07181..06c5b5380 100644
--- a/internal/console/apisystemupdate_test.go
+++ b/internal/console/apisystemupdate_test.go
@@ -88,6 +88,17 @@ func seedBox(t *testing.T, fx *consoleFixture, label, platform, channel, rel str
}
}
+// seedFlatBox is seedBox reporting a flat instance layout, so the layout
+// downgrade gate (layoutguard.go) lets a named old release through.
+func seedFlatBox(t *testing.T, fx *consoleFixture, label, platform, channel, rel string) {
+ t.Helper()
+ b := status.CollectBox(nil, status.Probes{Release: rel, Platform: platform, SystemChannel: channel, Layout: &status.LayoutReport{Mode: "flat"}}, time.Now())
+ b.Label = label
+ if err := status.WriteBox(context.Background(), fx.rel, b); err != nil {
+ t.Fatal(err)
+ }
+}
+
func TestSystemDoorsAreForOpsOwnersOnly(t *testing.T) {
fx := newConsoleFixture(t)
if err := fx.st.AddMember(OpsAccountID, "member@keymail.dev", RoleMember, time.Now()); err != nil {
@@ -547,6 +558,10 @@ func mustGetObject(t *testing.T, fx *consoleFixture, key string) []byte {
// (rootfs apps Plan 3, Task 15 round 4): a named version at the door, the
// latest release inside the job, both before anything is reserved or
// written; the override goes through and is signed onto that pointer only.
+// latestSteerWant is the refusal of a resolved latest below the release a
+// channel serves (resolvedSystemLatestAllowed, hunt H6-M3).
+const latestSteerWant = "the feed's latest.txt names %s, below the %s that router/canary already serves; a resolved latest never moves a channel back. To step back on purpose name the release with --version, or run carlos system rollback"
+
func TestSystemDoorsRefuseBelowTheRootfsFloor(t *testing.T) {
fx := newConsoleFixture(t)
systemFeed(t, fx, map[string][]byte{"carlos-linux-arm64": []byte("ELF arm64")})
@@ -584,14 +599,17 @@ func TestSystemDoorsRefuseBelowTheRootfsFloor(t *testing.T) {
if st != http.StatusOK {
t.Fatalf("update to the latest = %d %v", st, out)
}
- if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(want, "v0.18.0") {
+ // A resolved latest below the release the channel serves is refused
+ // whatever the overrides say (hunt H6-M3): latest.txt is unsigned. A
+ // step back is named with --version, below.
+ if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(latestSteerWant, "v0.18.0", "v0.29.0") {
t.Fatalf("the latest (v0.18.0) job = %v", job)
}
if p := pointer(); p.Current.Version != "v0.29.0" {
t.Fatalf("a refused promotion moved the pointer to %s", p.Current.Version)
}
- st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "spread": "0s", "allow_below_rootfs_floor": true}, owner)
+ st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "version": "v0.18.0", "spread": "0s", "allow_below_rootfs_floor": true}, owner)
if st != http.StatusOK {
t.Fatalf("update with the override = %d %v", st, out)
}
@@ -666,14 +684,19 @@ func TestSystemDoorsRefuseBelowTheRegionalFloor(t *testing.T) {
if st != http.StatusOK {
t.Fatalf("update to the latest = %d %v", st, out)
}
- if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(want, "v0.18.0") {
+ // A resolved latest below the release the channel serves is refused
+ // whatever the overrides say (hunt H6-M3): latest.txt is unsigned. A
+ // step back is named with --version, below.
+ if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(latestSteerWant, "v0.18.0", "v0.31.0") {
t.Fatalf("the latest (v0.18.0) job = %v", job)
}
if p := pointer(); p.Current.Version != "v0.31.0" {
t.Fatalf("a refused promotion moved the pointer to %s", p.Current.Version)
}
- st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "spread": "0s", "allow_below_rootfs_floor": true, "allow_below_regional_floor": true}, owner)
+ // Named, a step back meets the layout gate too: the box reports flat.
+ seedFlatBox(t, fx, "ie", "linux-arm64", "canary", "v0.31.0")
+ st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "version": "v0.18.0", "spread": "0s", "allow_below_rootfs_floor": true, "allow_below_regional_floor": true}, owner)
if st != http.StatusOK {
t.Fatalf("update with both overrides = %d %v", st, out)
}
diff --git a/internal/console/fleetfloor_test.go b/internal/console/fleetfloor_test.go
index ed2c1fd53..1a4548efd 100644
--- a/internal/console/fleetfloor_test.go
+++ b/internal/console/fleetfloor_test.go
@@ -623,7 +623,10 @@ func TestSystemDoorsRefuseBelowTheFleetForwardFloor(t *testing.T) {
if st != http.StatusOK {
t.Fatalf("update to the latest = %d %v", st, out)
}
- if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(want, "v0.18.0") {
+ // A resolved latest below the release the channel serves is refused
+ // whatever the overrides say (hunt H6-M3): latest.txt is unsigned. A
+ // step back is named with --version, below.
+ if job := waitJob(t, fx, owner, str(t, out, "job")); job["error"] != fmt.Sprintf(latestSteerWant, "v0.18.0", "v0.32.0") {
t.Fatalf("the latest (v0.18.0) job = %v", job)
}
if p := pointer("canary"); p.Current.Version != "v0.32.0" {
@@ -640,7 +643,9 @@ func TestSystemDoorsRefuseBelowTheFleetForwardFloor(t *testing.T) {
t.Fatalf("a first publication of a named v0.31.0 = %d %v", st, out)
}
- st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "spread": "0s", "allow_below_rootfs_floor": true, "allow_below_fleet_forward_floor": true}, owner)
+ // Named, a step back meets the layout gate too: the box reports flat.
+ seedFlatBox(t, fx, "ie", "linux-arm64", "canary", "v0.32.0")
+ st, out = postJSON(t, fx.ts.URL+"/api/cli/system/update", map[string]any{"channel": "canary", "version": "v0.18.0", "spread": "0s", "allow_below_rootfs_floor": true, "allow_below_fleet_forward_floor": true}, owner)
if st != http.StatusOK {
t.Fatalf("update with both overrides = %d %v", st, out)
}