carlos / platform Public

console: witnesses that every place door refuses a rootfs app, same target and claim consoles included; strike RFS-4-C03 and C04 (rootfs apps Plan 4 Task 4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 3ad0d014523212b30774a7d2ddcfb6244fea473a parent a953623
3 files changed, +103 −5
  • approved_rootfs_copy_test.go +5 −3
  • docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md +2 −2
  • internal/console/rootfs_place_test.go +96 −0

Intent

Human

<task-notification> <task-id>ab5cb4d417d2c9352</task-id> <tool-use-id>toolu_01CnSumpPLr5L8mmYJfsXXzU</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/18ea9266-acea-4f37-abab-b97c6a7faffa/tasks/ab5cb4d417d2c9352.output</output-file> <status>completed</status> <summary>Agent "Preflight rootfs Plan 4 remaining tasks" 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_WITH_CONCERNS** I wrote no product code and edited nothing outside the SDD directory. Scratch files are deleted. **Files written** (all in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-4/.superpowers/sdd/2026-10-28-rootfs-apps-4-console/`): - `common.md` - `preflight-4.md`: summary first, then rows 4.1 to 4.80, with tasks and task pairs in separate tables. - `task-4-brief.md`, `task-6-brief.md`, `task-7-brief.md`, `task-8-brief.md`, `task-9-brief.md`, `task-10-brief.md` - `task-11-brief.md`: opens with a prerequisites and owners table. **PAUL? items:** 1. **[4.5] Five approved docs rows whose facts changed.** They need one copy-review pass, and the proposed texts are in the preflight. - C128 is wrong now that `apps place` refuses every rootfs app, whatever the target. - C44, C100 and C136 are wrong because `carlos run` on rootfs rows was cut and reverted with Plan 3 Task 12 (bba9a52d). - C57 is wrong because #328's operator egress allow now reaches private addresses. - C32 is optional: it leaves out overlap deploys. - Until Paul answers, Tasks 7 and 9 build everything else and leave these lines out. 2. **[4.61] Task 11 approval A.** No release contains Group W (v0.30.x carries only R), so Task 11 needs all of: - the merge go for this branch; - a release containing W and Plan 4; - the dev roll, boxes first, then the console; - r10r moved off its `r10-hold` channel, or a hand-installed binary on it. **Concerns and rulings the controller should know:** - **Task 4 writes no production code.** Paul's Task 13 ruling already refuses every rootfs place. Task 4 adds three witness tests (same target, before the claim branch, both browser forms) and marks C03/C04 `struck` in the deck and in `rootfsCopyStruck`. - **The copy gate can't read many file cells today** (C12–C29, C127–C135). It doesn't strip cells that name two files or bare names, and `README.md` would resolve to the repo's own README. Each task corrects its own cells. - **Task 6 tenant isolation:** `foldRollout` writes rollout views in three places, and one of them (refused views) has no tenant tag and skips the check. Workers are copied only in the two tagged places. The tenant test has three arms, including another account's fleet box tagging this host. The real boundary is fleet ownership in `loadRolloutJoin` plus the report's tags. - **Task 8 can't do its arm64 step here.** This machine has no Docker, only rootless podman with the sandbox disabled, and no arm64 emulation (registering it needs root). Task 8 does an amd64 smoke test instead. The arm64 build and `carlos ship --check` move to Task 11 Step 0 on r10r, as the R10 run did. - **CSRF:** the plan's bare curl POSTs would get 422. Forgery protection stays on in the sample (only the crash endpoint skips it), and Task 11 posts with a cookie jar and token. - **Fence fixes in the Rails guide:** - `carlos rollback` needs a channel, so the fence becomes `carlos rollback --app shop stable`. - The `carlos run` line is removed. - The plan named five fence positions but gave four fences; the brief lays out five. - **Task 11 checks dropped:** - The C05 probe on a second, unready fleet: fleet rows can't be deleted, so it would leave permanent residue, and a test already pins C05. - The "DB column non-zero" check: fleet boxes' database sizes are never joined, so the column always shows `-` for a fleet instance. - **Task 11 uses fleet r10r** (Paul's keep instruction), not a new fleet `home`. - **Census:** Task 6 changes files in the root package, which is in census scope. Task 10 writes the census card (`census-propose NAME=rootfs-apps-4`) for Astra, not Paul. Task 10 runs targeted tests only, not `make test`. - **Build serially:** Tasks 4, 6, 7, 8 and 9 all edit `approved_rootfs_copy_test.go` and the deck. - **No per-task cross-model review** under rule 3. The whole-branch review is pointed at Task 6's join code. - **The `Ruling: &lt;what&gt; — &lt;why&gt; — &lt;cost&gt;` lines in `preflight-4.md` use em dashes** because that is the format you specified. The briefs and `common.md` have none. - **Not owned by any task:** the carloku.com docs only update after `carlosframework/website` re-syncs the docs.</result> <usage><subagent_tokens>379102</subagent_tokens><tool_uses>130</tool_uses><duration_ms>1479029</duration_ms></usage> </task-notification>

Attributed to this commit: 12.9 g CO₂e (1,614,354 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-apps-4-console, 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/approved_rootfs_copy_test.go b/approved_rootfs_copy_test.go
index 009656a5d..2ae9784a4 100644
--- a/approved_rootfs_copy_test.go
+++ b/approved_rootfs_copy_test.go
@@ -141,9 +141,11 @@ var rootfsCopyIDs = []string{
// neither become struck nor stop being struck without this list changing in
// the same commit. RFS-3-C13 was struck by the Plan 3 pre-flight (row 3.1,
// claims shelved), RFS-3-C25 by Paul's Task 15 round 3 ruling (the floor
-// refuses by version). RFS-1-C15 and RFS-3-C28 are live until Plan 5 Task 2a
-// and Plan 6 Task 16 strike them.
-var rootfsCopyStruck = []string{"RFS-3-C13", "RFS-3-C25"}
+// refuses by version), and RFS-4-C03 and C04 by the Plan 4 pre-flight (row
+// 4.4): Paul's Task 13 ruling refuses every rootfs place with RFS-3-C24, so
+// the plan's own place refusal was never built. RFS-1-C15 and RFS-3-C28 are
+// live until Plan 5 Task 2a and Plan 6 Task 16 strike them.
+var rootfsCopyStruck = []string{"RFS-3-C13", "RFS-3-C25", "RFS-4-C03", "RFS-4-C04"}
// rootfsCopyStatuses are the statuses the deck may carry. struck is the
// rootfs deck's own: a struck row is never reviewed, never built and never
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
index 362b66064..9658e8c34 100644
--- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
+++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
@@ -217,8 +217,8 @@ From the plan: Placeholders: `<app>` an app; `<fleet>` a fleet name; `<region>`
|---|---|---|---|
| RFS-4-C01 | internal/console/rootfs.go | <app> is a rootfs app, and a rootfs app runs only on boxes your account owns. a rootfs app is placed when it is made: create a new app with carlos apps create <name> --place fleet/<fleet> and ship to it | approved |
| RFS-4-C02 | internal/console/rootfs.go | <app> is a rootfs app, and a rootfs app does not run in a dedicated pool yet. create the instance without a pool | approved |
-| RFS-4-C03 | internal/console/rootfs.go | <app> is a rootfs app, so it cannot move to the shared boxes. a rootfs app runs only on boxes your account owns | approved |
-| RFS-4-C04 | internal/console/rootfs.go | <app> is a rootfs app with instances, and a rootfs app's instances cannot move to other boxes yet. delete its instances first, or create a new app where you want it to run | approved |
+| RFS-4-C03 | internal/console/rootfs.go (struck 2026-10-28: Paul's Plan 3 Task 13 ruling refuses carlos apps place for every rootfs app with RFS-3-C24) | <app> is a rootfs app, so it cannot move to the shared boxes. a rootfs app runs only on boxes your account owns | struck |
+| RFS-4-C04 | internal/console/rootfs.go (struck 2026-10-28: Paul's Plan 3 Task 13 ruling refuses carlos apps place for every rootfs app with RFS-3-C24) | <app> is a rootfs app with instances, and a rootfs app's instances cannot move to other boxes yet. delete its instances first, or create a new app where you want it to run | struck |
| RFS-4-C05 | internal/console/rootfs.go | none of fleet <fleet>'s boxes can run a rootfs app yet. a box can once it runs a platform release with rootfs support, on the nested layout, with overlap deploys on, and has passed its rootfs check | approved |
| RFS-4-C06 | internal/console/rootfs.go | no box in <region> can run a rootfs app yet. a box can once it runs a platform release with rootfs support, on the nested layout, with overlap deploys on, and has passed its rootfs check | approved |
| RFS-4-C07 | internal/console/rootfs.go | could not check which boxes can run a rootfs app. try again | approved |
diff --git a/internal/console/rootfs_place_test.go b/internal/console/rootfs_place_test.go
new file mode 100644
index 000000000..cdebc15a7
--- /dev/null
+++ b/internal/console/rootfs_place_test.go
@@ -0,0 +1,96 @@
+package console
+
+// Witnesses for Paul's Plan 3 Task 13 ruling as it meets every place door:
+// carlos apps place refuses an app whose established kind is rootfs, any
+// target, the same target included, with RFS-3-C24, before the claim branch
+// (rootfs apps Plan 4 Task 4, preflight rows 4.10 to 4.12). The refusal is
+// built; these pin the edges TestPlaceRefusesARootfsKindApp does not.
+
+import (
+ "html"
+ "net/http"
+ "net/url"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// An app already placed on a fleet, then established as rootfs, is refused
+// when asked for the same fleet again: the kind check comes before any
+// comparison with where the app already is, so a rootfs app has no no-op
+// place either.
+func TestPlaceRootfsSameTargetIsRefused(t *testing.T) {
+ fx, token, reg := placeKindWorld(t, "code-rfs-place-same")
+ if code, _, raw := rawReq(t, http.MethodPost, placeURL(fx, "shop"), token, `{"target":"fleet/pi"}`); code != http.StatusOK {
+ t.Fatalf("place before the app has a kind = %d %s, want 200", code, raw)
+ }
+ putKindMarker(t, fx, release.KindRootfs)
+ before := readPlaceState(t, fx, reg)
+ if before.placement != "fleet/pi" {
+ t.Fatalf("setup: placement = %q, want fleet/pi", before.placement)
+ }
+ code, _, raw := rawReq(t, http.MethodPost, placeURL(fx, "shop"), token, `{"target":"fleet/pi"}`)
+ if code != http.StatusConflict || errorText(raw) != rootfsPlaceWant {
+ t.Fatalf("same-target place of a rootfs app = %d %s, want 409 %q", code, raw, rootfsPlaceWant)
+ }
+ if after := readPlaceState(t, fx, reg); !after.equal(before) {
+ t.Fatalf("a refused place wrote:\nbefore %+v\nafter %+v", before, after)
+ }
+}
+
+// On a console that keeps host claims, a rootfs app is refused before the
+// claim branch is reached: with no claim engine wired, that branch would
+// answer 503, and with one it would start an operation. Placing onto a fleet
+// and clearing the placement are both refused with C24, and nothing is
+// written.
+func TestPlaceRootfsRefusesBeforeTheClaim(t *testing.T) {
+ fx, token, reg := placeKindWorld(t, "code-rfs-place-claim")
+ putKindMarker(t, fx, release.KindRootfs)
+ fx.srv.cfg.HostClaim = true
+ if fx.srv.cfg.ClaimPlacement != nil {
+ t.Fatal("setup: ClaimPlacement must be nil so the claim branch would answer 503")
+ }
+ for _, body := range []string{`{"target":"fleet/pi"}`, `{"target":""}`} {
+ before := readPlaceState(t, fx, reg)
+ code, _, raw := rawReq(t, http.MethodPost, placeURL(fx, "shop"), token, body)
+ if code != http.StatusConflict || errorText(raw) != rootfsPlaceWant {
+ t.Fatalf("place %s with host claims on = %d %s, want 409 %q", body, code, raw, rootfsPlaceWant)
+ }
+ if after := readPlaceState(t, fx, reg); !after.equal(before) {
+ t.Fatalf("place %s: a refused place wrote:\nbefore %+v\nafter %+v", body, before, after)
+ }
+ }
+}
+
+// Both browser doors say the refusal: a 303 back to the page the form lives
+// on, with C24 in the flash, and the app's placement as it was.
+func TestPlaceRootfsBrowserFlash(t *testing.T) {
+ fx, _, reg := placeKindWorld(t, "code-rfs-place-browser")
+ putKindMarker(t, fx, release.KindRootfs)
+ c := newBrowser(t)
+ signUp(t, fx, c, "code-rfs-place-browser-in")
+ csrf := sessionToken(t, fx, c)
+ before := readPlaceState(t, fx, reg)
+ want := html.EscapeString(rootfsPlaceWords)
+
+ status, loc, _ := postForm(t, c, fx.u("/apps/shop/place"), url.Values{"csrf": {csrf}, "target": {"fleet/pi"}})
+ if status != http.StatusSeeOther || !strings.HasSuffix(loc, "/apps/shop/settings/placement") {
+ t.Fatalf("app place page = %d to %q, want 303 to the placement settings", status, loc)
+ }
+ if _, _, body := get(t, c, fx.u("/apps/shop/settings/placement")); !strings.Contains(body, want) {
+ t.Fatalf("no C24 flash on the app's placement page:\n%s", body)
+ }
+
+ status, loc, _ = postForm(t, c, fx.u("/fleets/pi/place"), url.Values{"csrf": {csrf}, "app": {"shop"}})
+ if status != http.StatusSeeOther || !strings.HasSuffix(loc, "/fleets/pi") {
+ t.Fatalf("fleet place page = %d to %q, want 303 to the fleet page", status, loc)
+ }
+ if _, _, body := get(t, c, fx.u("/fleets/pi")); !strings.Contains(body, want) {
+ t.Fatalf("no C24 flash on the fleet page:\n%s", body)
+ }
+
+ if after := readPlaceState(t, fx, reg); !after.equal(before) {
+ t.Fatalf("a refused place wrote:\nbefore %+v\nafter %+v", before, after)
+ }
+}