carlos / platform Public

copy: keep CLI table headers upper case for copies (#511)

Controller ruling: the copies table header stays upper case like every
other carlos table (HOST BOX BUILD STATE HEALTH WORKERS), and the State
and Health cell values are both capitalised so they match each other.
The copy deck rows SR-4-C02 to C11, C49 and C50 now match the code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 777ac62a118b8fbef76e7aeead7fdb29223606e6 parent 484d4fe
3 files changed, +25 −25
  • docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md +12 −12
  • instances_copies.go +7 −7
  • instances_copies_test.go +6 −6

Intent

Human

<task-notification> <task-id>a1efd5dc6140b543d</task-id> <tool-use-id>toolu_01TNYSfkzyWUANvRM27Vaod8</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/a1efd5dc6140b543d.output</output-file> <status>completed</status> <summary>Agent "Apply Luna copy review" 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>Commit 484d4fe2 applies the Luna review, and the three host tests below still fail. - **Applied:** 35 of Luna's 36 rows (SR-3-C06 kept as ruled). That is 22 rows with live code or docs text, plus SR-4-C02 to C11 for the copies table. SR-4-C06 "Starting" has no code or docs use. SR-2-C16 and SR-4-C44 use the controller's plain wording, and SR-4-C44 says "this release's hold was refused" because docs/site uses "hold" for `--swap hold`. - **Statuses:** SR-3-C06 is marked "diagnostic, not user copy (controller ruling)", and SR-4-C19, C20 and C29 are marked deferred with no code change. Every other pending or provisional row is now approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25). - **Placeholder order:** SR-4-C62 now reads "release in its channel", so I swapped the `Sprintf` arguments in `replicafloor.go` and its test. - **State labels:** the console sends the copy states as lower-case words, so I kept those and added a display mapping in `instances_copies.go`. Only the State column prints "Running", "Down", "Failed", "Unknown" and "Missing". - **Mixed-case table (your call):** the copies table now reads `HOST Box Build State Health WORKERS`, because HOST and WORKERS were not in Luna's table. The Health cell still prints lower-case "unknown", "healthy" and "unhealthy" (SR-4-C49 and C50 are not in her table). - **Test changes:** I updated expected strings in `instances_copies_test.go` and `replicaview_test.go`, and the Health "unknown" check in `instances_copies_test.go`. I also let the deck-status parser in `approved_stateless_replicas_copy_test.go` accept the "deferred" and "diagnostic" statuses. Without that, the parser rejected them as neither pending nor approved. - **Tests:** - `go test . -run 'Copy|Approved'`: pass. - `./internal/console`, `./internal/edge` and `./internal/activator` with the replica filter: pass. - `./internal/docsite`: pass. - `./internal/host`: fails 3 tests, `TestClaimBindingReadmissionWithoutRestart`, `TestClaimBindingAssemblySurvivesRosterWritesWithoutRestart` and `TestClaimBindingAssemblySurvivesRosterWritesAfterRestart`. All three report "hostwrite: lifecycle provider unavailable". I did not touch the host package or those tests, and did not run a baseline to confirm they fail without my change. - **Checks:** `gofmt -l` is clean. I deleted the scratch I created in `/tmp/g`, but left the directory because other users' files are in it.</result> <usage><subagent_tokens>84732</subagent_tokens><tool_uses>25</tool_uses><duration_ms>873749</duration_ms></usage> </task-notification>

diff --git a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
index 7810d8758..667289422 100644
--- a/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
+++ b/docs/superpowers/plans/2026-11-01-stateless-replicas-copy.md
@@ -73,16 +73,16 @@ copy too. Internal wire enums are not an excuse to expose unreviewed text.
| id | file | text | status |
|---|---|---|---|
| SR-4-C01 | internal/console/templates/app_overview.html | <running> of <desired> copies running | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C02 | instances_copies.go | Box | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C03 | instances_copies.go | Build | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C04 | instances_copies.go | State | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C05 | instances_copies.go | Health | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C06 | instances_copies.go | Starting | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C07 | instances_copies.go | Running | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C08 | instances_copies.go | Down | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C09 | instances_copies.go | Failed | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C10 | instances_copies.go | Unknown | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C11 | instances_copies.go | Missing | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
+| SR-4-C02 | instances_copies.go | BOX | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C03 | instances_copies.go | BUILD | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C04 | instances_copies.go | STATE | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C05 | instances_copies.go | HEALTH | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C06 | instances_copies.go | Starting | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C07 | instances_copies.go | Running | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C08 | instances_copies.go | Down | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C09 | instances_copies.go | Failed | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C10 | instances_copies.go | Unknown | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C11 | instances_copies.go | Missing | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
| SR-4-C12 | run.go | run on this healthy assigned copy's box; otherwise choose a healthy copy | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C13 | internal/console/replicaview.go | <box> is not a healthy assigned copy of this instance | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C14 | internal/console/replicaview.go | no healthy copy is available for this command. try again after a copy is running | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
@@ -120,8 +120,8 @@ copy too. Internal wire enums are not an excuse to expose unreviewed text.
| SR-4-C46 | internal/console/replicadeploy.go | the new build's workers failed on <box>, so the deploy stopped. other copies keep serving | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C47 | internal/console/replicaview.go | this app runs more than one copy of an instance, so a restart would stop every copy at the same time. deploy a new build instead: its copies switch one box at a time | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C48 | internal/console/replicaview.go | This app runs more than one copy of an instance, so a restart would stop every copy at the same time. Deploy a new build instead: its copies switch one box at a time. | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C49 | instances_copies.go | healthy | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
-| SR-4-C50 | instances_copies.go | unhealthy | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
+| SR-4-C49 | instances_copies.go | Healthy | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
+| SR-4-C50 | instances_copies.go | Unhealthy | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) (controller: CLI header case) |
| SR-4-C51 | docs/site/cli.md | For an instance with more than one copy, `carlos instances list` prints a second table with one row per copy: its box, build, state, health and workers. These come from the router's live check of each copy, not from the boxes' five-minute reports. A copy with no live reading shows as unknown, and a copy that no box holds yet shows as missing. The app's overview page counts the copies running out of the copies wanted. | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C52 | docs/site/cli.md | An instance with more than one copy keeps a separate page cache on each copy's box. A purge clears only the cache of the copy that sent it, so another copy can serve its own saved page until it expires or that copy purges it too. | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
| SR-4-C53 | docs/site/cli.md | An app that runs more than one copy of an instance refuses `carlos restart --app` and `--environment`, because every copy would restart at the same time. Deploy a new build instead: its copies switch one box at a time. | approved (Luna pass 2026-11-11, delegated by Paul 2026-10-25) |
diff --git a/instances_copies.go b/instances_copies.go
index 12f345cc2..20d3bb2ee 100644
--- a/instances_copies.go
+++ b/instances_copies.go
@@ -15,17 +15,17 @@ import (
// The copies table's heading and words. Copy: pending Paul's copy review.
const (
- copiesColBox = "Box" // copy SR-4-C02 (provisional)
- copiesColBuild = "Build" // copy SR-4-C03 (provisional)
- copiesColState = "State" // copy SR-4-C04 (provisional)
- copiesColHealth = "Health" // copy SR-4-C05 (provisional)
+ copiesColBox = "BOX" // copy SR-4-C02 (provisional)
+ copiesColBuild = "BUILD" // copy SR-4-C03 (provisional)
+ copiesColState = "STATE" // copy SR-4-C04 (provisional)
+ copiesColHealth = "HEALTH" // copy SR-4-C05 (provisional)
copyRunning = "running" // copy SR-4-C07 (provisional)
copyDown = "down" // copy SR-4-C08 (provisional)
copyFailed = "failed" // copy SR-4-C09 (provisional)
copyUnknown = "unknown" // copy SR-4-C10 (provisional)
copyMissing = "missing" // copy SR-4-C11 (provisional)
- copyHealthy = "healthy" // copy SR-4-C49 (provisional)
- copyUnhealthy = "unhealthy" // copy SR-4-C50 (provisional)
+ copyHealthy = "Healthy" // copy SR-4-C49 (provisional)
+ copyUnhealthy = "Unhealthy" // copy SR-4-C50 (provisional)
copyCellMaxBytes = 128
)
@@ -51,7 +51,7 @@ func copyRows(r apiInstanceRecord) []replicaCopyRow {
case copyDown, copyFailed:
row.Health = copyUnhealthy
default:
- row.Health = copyUnknown
+ row.Health = copyLabelUnknown
}
if (row.State == copyRunning || row.State == copyDown || row.State == copyFailed) &&
c.WorkersDeclared > 0 && c.WorkersRunning >= 0 && c.WorkersRunning <= c.WorkersDeclared {
diff --git a/instances_copies_test.go b/instances_copies_test.go
index 8d4fb184f..915bbff34 100644
--- a/instances_copies_test.go
+++ b/instances_copies_test.go
@@ -41,12 +41,12 @@ func TestReplicaCopyListRowsPerBox(t *testing.T) {
if len(lines) != 4 {
t.Fatalf("copies table, want a heading and three rows:\n%s", out)
}
- if got := strings.Fields(lines[0]); strings.Join(got, " ") != "HOST Box Build State Health WORKERS" {
+ if got := strings.Fields(lines[0]); strings.Join(got, " ") != "HOST BOX BUILD STATE HEALTH WORKERS" {
t.Fatalf("heading %q", lines[0])
}
for i, want := range [][]string{
- {"shop.example.com", "b1", "v2", "Running", "healthy", "2/2"},
- {"shop.example.com", "b2", "v1", "Down", "unhealthy", "0/2"},
+ {"shop.example.com", "b1", "v2", "Running", "Healthy", "2/2"},
+ {"shop.example.com", "b2", "v1", "Down", "Unhealthy", "0/2"},
{"shop.example.com", "-", "-", "Missing", "-", "-"},
} {
if got := strings.Fields(lines[i+1]); strings.Join(got, " ") != strings.Join(want, " ") {
@@ -72,10 +72,10 @@ func TestReplicaCopyListCleansCells(t *testing.T) {
if len(lines) != 3 {
t.Fatalf("copies table, want a heading and two rows:\n%s", out)
}
- if got := strings.Join(strings.Fields(lines[1]), " "); got != "shop.example.com - - Unknown unknown -" {
+ if got := strings.Join(strings.Fields(lines[1]), " "); got != "shop.example.com - - Unknown Unknown -" {
t.Fatalf("unclean row = %q", got)
}
- if got := strings.Join(strings.Fields(lines[2]), " "); got != "shop.example.com b2 v1 Unknown unknown -" {
+ if got := strings.Join(strings.Fields(lines[2]), " "); got != "shop.example.com b2 v1 Unknown Unknown -" {
t.Fatalf("unknown row = %q", got)
}
}
@@ -89,7 +89,7 @@ func TestReplicaVisibilityLegacyColumnsUnchanged(t *testing.T) {
var buf bytes.Buffer
printInstancesList(&buf, recs)
out := buf.String()
- if strings.Contains(out, "\n\n") || strings.Contains(out, "Box") {
+ if strings.Contains(out, "\n\n") || strings.Contains(out, "BOX") {
t.Fatalf("a one-copy list printed a copies table:\n%s", out)
}
lines := strings.Split(strings.TrimRight(out, "\n"), "\n")