carlos / platform Public

Fleet public routes Task 9 fix round 2: the barrier judges two-segment channels and skips release identities by release's own rules

The pointer listing kept only one-segment channels, so a canary/<branch>
pointer below the floor, unparseable or unreadable let a fleet be
created. systemChannelOf now takes every key that is SystemPointerKey of
a release.ValidChannel name, and skips a release identity at
release.IdentityKey(tag) unread (a signed pointer for channel stable,
under the same prefix). Each channel pointer is judged as before.

Spec §9 names the rule; §7 notes the fix round (card and seal unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 9f877cfcbe9dee5f98eeaabece4d658ac540e8d7 parent 42337eb
3 files changed, +96 −9
  • docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md +12 −5
  • internal/console/fleetfloor.go +27 −4
  • internal/console/fleetfloor_test.go +57 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>a37f12949b7b1e734</task-id> <tool-use-id>toolu_011Y6g7gAXFUkqhEPgXSLsEE</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a37f12949b7b1e734.output</output-file> <status>completed</status> <summary>Agent "Implement Task 9: fleet-create barrier" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status:** DONE. All three findings are fixed test-first in one commit, 42337eb6 (on top of 2b9490a9), not pushed. **Commit:** 42337eb6 "Fleet public routes Task 9 fix round 1: the barrier judges every published pointer, repairs skip it, a deterministic early-unlock witness". **Summary:** - **P1 (stale or missing heartbeats):** the barrier no longer reads heartbeats at all; every pointer can be enumerated without them. It lists `control/system/router/` (the release identities in that listing are skipped) and reads every channel pointer. - A pointer below the floor or unparseable, without the signed override: 409 FPR-C06. - A pointer published with the override: passes. - A listing or pointer that can't be read: 503 FPR-C07. - No pointer at all: passes. - New witnesses: a below-floor pointer with no heartbeat, with every heartbeat stale, and on a channel no box follows, are all refused. The override-signed below-floor pointer lets the create through. - **P2 (repair retries):** `handleAPIFleetNew` reads the name first. - If a row exists, no fleet is created, so the barrier is skipped and the existing-row answer runs: 409 for another account's name, the owner-record repair for the caller's own. - For a new name, `CreateFleet`'s atomic insert still decides. A new test, `TestFleetCreateLosesANameTakenAfterItsRead`, covers a name taken between the read and the insert: the door answers "that name is taken". - `TestFleetCreateRetryRepairsAFailedOwnerRecord` now runs with no barrier, with a below-floor pointer, and with an unreadable pointer. It requires that a new fleet is refused while the repair succeeds. - **P2 (interleaving (c) witness):** the create is now parked just before the mutex while the publication runs `TryLock` in its last step before the write. Only the publication can hold the mutex then, so the early-unlock mutation fails 50 of 50 runs at `-count=50`. **Tests:** - RED was shown against 2b9490a9. After P1 alone, only the repair subtests still failed (the P2 red). GREEN after P2. - 13 mutations, all killed. Two survived at first: one because an absent pointer is never listed, the other because no test made a name appear between the read and the insert. I added a list-then-delete subtest and the name-race test, and both are now killed. - Console fleet, floor and door tests pass, and the interleavings pass under `-race`. - Copy gate, `TestPlan9B8RecordWriteCensus`, build, vet, gofmt and the darwin, windows and linux-arm64 cross-builds pass. - `make census-card`: no console unit and the seal (`78b7e7e3...`) is unchanged. **Spec:** - §9 now says the barrier lists and judges the published pointers, the override passes, and a name that already has a row skips the barrier. - §6 now budgets one LIST plus one GET per pointer on each new fleet create (rate-limited). - §7 has a fix-round note. **Remaining concern:** a refused create still spends one unit of the per-day create budget. The fix report is appended to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-fleet-public-routes/.superpowers/sdd/2026-10-30-fleet-public-routes/task-9-report.md`.</result> <usage><subagent_tokens>247996</subagent_tokens><tool_uses>32</tool_uses><duration_ms>940067</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b22i2iylm</task-id> <tool-use-id>toolu_01AJGGtZEoZNUiicFUMr9oij</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/b22i2iylm.output</output-file> <status>completed</status> <summary>Background command "Run the scoped Astra re-review of Task 9" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 27.7 g CO₂e (3,560,377 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-fleet-public-routes, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md b/docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md
index b6e9e1742..3bc8676e8 100644
--- a/docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md
+++ b/docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md
@@ -1223,8 +1223,10 @@ Units, by file (N = new, R = removed, otherwise a changed body or sites):
scope; the root package gains only a copy-gate list entry
(`fleetRoutesCopyBuilt` += FPR-C06, FPR-C07). Nothing to reconcile.
Task 9 fix round 1 (the barrier lists the pointers and reads no
- heartbeat; the door routes an existing name around it): console code
- only, card and seal unchanged.
+ heartbeat; the door routes an existing name around it) and fix round
+ 2 (every `release.ValidChannel` channel, two-segment ones included,
+ release identities skipped): console code only, card and seal
+ unchanged.
Root's own row readers (adopt, capability, named units, restart, stage,
rootfs, `layoutReversalIncomplete`) change no code and select by
@@ -1444,9 +1446,14 @@ the old fleet indefinitely. The RegionalDomainsFloor pattern
system channel pointers themselves (Task 9 R1 P1, controller ruling),
not the channels the heartbeats say are followed: a box whose heartbeat
is stale or missing still follows its channel and could come back on a
- below-floor pointer. It lists `control/system/router/` (every page; the
- release identities under `releases/` are skipped) and reads each
- channel pointer. It refuses (409, FPR-C06) while any pointer names a
+ below-floor pointer. It lists `control/system/router/` (every page) and reads
+ each channel pointer: every key that is `SystemPointerKey` of a name
+ `release.ValidChannel` accepts, two-segment channels such as
+ `canary/<branch>` included (Task 9 R2), except a release identity at
+ `release.IdentityKey(tag)` (`releases/<tag>.json`, a signed pointer for
+ channel stable that no box following a `releases/<tag>` channel could
+ verify; the system doors publish only canary and stable), which is
+ skipped unread. It refuses (409, FPR-C06) while any pointer names a
release below the floor or one that does not parse and was not
published with the signed override (`AllowBelowFleetForwardFloor`: the
operator has accepted the cost for that channel); a listing or a
diff --git a/internal/console/fleetfloor.go b/internal/console/fleetfloor.go
index 4e8cf68bd..32293b8d9 100644
--- a/internal/console/fleetfloor.go
+++ b/internal/console/fleetfloor.go
@@ -7,6 +7,7 @@ import (
"log"
"net/http"
"os"
+ "path"
"sort"
"strings"
@@ -166,8 +167,9 @@ const consoleFleetCreateUnreadable = "could not check this deployment's release
// fleetCreateFloorRefusal is the barrier, read under s.fleetFloorMu: one
// listing of the router's system pointers (control/system/router/, every
-// page; the release identities under releases/ are listed with them and
-// skipped) and one GET per channel pointer found. A pointer naming a
+// page; the release identities are listed with them and skipped,
+// systemChannelOf) and one GET per channel pointer found, two-segment
+// channels (canary/<branch>) included. A pointer naming a
// release below release.FleetForwardFloor, or one that does not parse,
// and not published with the override, is a 409 FPR-C06 naming the first
// such channel in key order. A listing that fails, or a listed pointer
@@ -183,8 +185,7 @@ func (s *Server) fleetCreateFloorRefusal(ctx context.Context) *doorRefusal {
}
var channels []string
for _, key := range keys {
- ch, ok := strings.CutSuffix(strings.TrimPrefix(key, prefix), ".json")
- if ok && ch != "" && !strings.Contains(ch, "/") && release.SystemPointerKey(release.SystemComponentRouter, ch) == key {
+ if ch, ok := systemChannelOf(prefix, key); ok {
channels = append(channels, ch)
}
}
@@ -209,6 +210,28 @@ func (s *Server) fleetCreateFloorRefusal(ctx context.Context) *doorRefusal {
return nil
}
+// systemChannelOf names the channel whose router pointer key is, under
+// prefix (the router's control/system/ directory), or reports false for
+// an object there that is no channel pointer. The rules are release's
+// own: a channel is what release.ValidChannel accepts, one segment or two
+// (canary/<branch>), at release.SystemPointerKey; and a release identity,
+// at release.IdentityKey(tag) (control/system/router/releases/<tag>.json),
+// is not a channel pointer, though "releases/<tag>" is a valid channel
+// name: the identity is a signed pointer for channel stable that no box
+// following such a channel could verify, and the system doors publish
+// only canary and stable. Identities are skipped unread, so a fleet
+// create reads one object per channel, not one per release.
+func systemChannelOf(prefix, key string) (string, bool) {
+ ch, ok := strings.CutSuffix(strings.TrimPrefix(key, prefix), ".json")
+ if !ok || !strings.HasPrefix(key, prefix) || !release.ValidChannel(ch) || release.SystemPointerKey(release.SystemComponentRouter, ch) != key {
+ return "", false
+ }
+ if identity, err := release.IdentityKey(path.Base(ch)); err == nil && identity == key {
+ return "", false
+ }
+ return ch, true
+}
+
// createFleetAboveTheFloor runs create, the fleet-create door's registry
// write, under s.fleetFloorMu after the barrier passes. A refusal is
// returned and create is not called. Only the barrier's reads and the
diff --git a/internal/console/fleetfloor_test.go b/internal/console/fleetfloor_test.go
index 974930f5d..4d154ffae 100644
--- a/internal/console/fleetfloor_test.go
+++ b/internal/console/fleetfloor_test.go
@@ -10,6 +10,7 @@ import (
"net/http"
"os"
"path/filepath"
+ "slices"
"strings"
"sync"
"sync/atomic"
@@ -874,6 +875,62 @@ func TestFleetCreateRefusedWhileAChannelIsBelowTheFloor(t *testing.T) {
fcPublish(t, fx, "stable", "4f3c2a1")
refused(t, fx, token, http.StatusConflict, fcBelowWant("stable", "4f3c2a1"))
})
+ // A two-segment channel (release.ValidChannel's canary/<branch>) has a
+ // pointer at control/system/router/canary/paul.json; it is judged as
+ // every other channel's is (Task 9 R2 P1).
+ t.Run("two-segment-channel/below-the-floor", func(t *testing.T) {
+ fx, token, _ := fcFixture(t, "code-fpr-c06-sub-below")
+ fcPublish(t, fx, "stable", "v0.32.0")
+ fcPublish(t, fx, "canary/paul", "v0.31.0")
+ refused(t, fx, token, http.StatusConflict, fcBelowWant("canary/paul", "v0.31.0"))
+ })
+ t.Run("two-segment-channel/unparseable", func(t *testing.T) {
+ fx, token, _ := fcFixture(t, "code-fpr-c06-sub-unparseable")
+ fcPublish(t, fx, "canary/paul", "4f3c2a1")
+ refused(t, fx, token, http.StatusConflict, fcBelowWant("canary/paul", "4f3c2a1"))
+ })
+ t.Run("two-segment-channel/with-the-override", func(t *testing.T) {
+ fx, token, _ := fcFixture(t, "code-fpr-c06-sub-override")
+ fcPublishWith(t, fx, "canary/paul", "v0.31.0", release.SystemPromoteOptions{AllowBelowFleetForwardFloor: true})
+ created(t, fx, token)
+ })
+ t.Run("two-segment-channel/unreadable", func(t *testing.T) {
+ fx, token, _ := fcFixture(t, "code-fpr-c07-sub")
+ if _, err := fx.rel.Put(t.Context(), release.SystemPointerKey("router", "canary/paul"), []byte("not a pointer"), ""); err != nil {
+ t.Fatal(err)
+ }
+ refused(t, fx, token, http.StatusServiceUnavailable, consoleFleetCreateUnreadable)
+ })
+ // The listing also returns the release identities, one per release at
+ // control/system/router/releases/<tag>.json (release.IdentityKey), each
+ // a signed pointer for channel stable. They are not channel pointers,
+ // below the floor or not. Nor is an object whose name is no channel
+ // (release.ValidChannel refuses a third segment): no box can follow it.
+ t.Run("a-release-identity-is-not-a-channel-pointer", func(t *testing.T) {
+ fx, token, _ := fcFixture(t, "code-fpr-identity")
+ fcPublish(t, fx, "stable", "v0.32.0")
+ rel := fcRelease("v0.31.0")
+ rel.Source, rel.ReleaseTag, rel.MovesProtocol = "release:v0.31.0", "v0.31.0", 1
+ wire, err := release.SignSystemIdentity(release.RootSigner(fx.priv), rel)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := release.PublishSystemIdentity(t.Context(), fx.rel, fx.pub, wire); err != nil {
+ t.Fatal(err)
+ }
+ key, err := release.IdentityKey("v0.31.0")
+ if err != nil || key != "control/system/router/releases/v0.31.0.json" {
+ t.Fatalf("the identity's key = %q, %v", key, err)
+ }
+ if _, err := fx.rel.Put(t.Context(), "control/system/router/canary/paul/extra.json", []byte("not a channel"), ""); err != nil {
+ t.Fatal(err)
+ }
+ listed, err := fx.rel.List(t.Context(), "control/system/router/")
+ if err != nil || !slices.Contains(listed, key) || !slices.Contains(listed, release.SystemPointerKey("router", "stable")) {
+ t.Fatalf("the listing = %v, %v; want the identity and the stable pointer", listed, err)
+ }
+ created(t, fx, token)
+ })
t.Run("an-unreadable-heartbeat-refuses-nothing", func(t *testing.T) {
fx, token, _ := fcFixture(t, "code-fpr-c07-heartbeat")
fcPublish(t, fx, "stable", "v0.32.0")