Fleet public routes Task 0: copy deck (eight pending rows) and its gate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+166
−0
approved_fleet_routes_copy_test.go+110 −0docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md+56 −0
diff --git a/approved_fleet_routes_copy_test.go b/approved_fleet_routes_copy_test.go| new file mode 100644 |
| index 000000000..e278fd83e |
| --- /dev/null |
| +++ b/approved_fleet_routes_copy_test.go |
| @@ -0,0 +1,110 @@ |
| +// approved_fleet_routes_copy_test.go |
| +package main |
| + |
| +import ( |
| + "os" |
| + "regexp" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +// The copy gate of the fleet public routes feature (plan |
| +// 2026-10-30-fleet-public-routes.md Task 0), over its one deck. It is |
| +// approved_fleet_secrets_copy_test.go's gate with this deck's path and id |
| +// prefix: |
| +// |
| +// - TestFleetRoutesCopyRecordIsComplete: the deck names exactly |
| +// fleetRoutesCopyIDs; |
| +// - TestFleetRoutesCopyHasNoEmDash: no em dash and no en dash in a text; |
| +// - TestFleetRoutesCopyBuiltIsApproved: an id in fleetRoutesCopyBuilt is an |
| +// approved row, so no pending string reaches code or docs; |
| +// - TestFleetRoutesCopyBuiltIsApplied: a built row's text is in the file it |
| +// names. |
| +const fleetRoutesCopyRecordPath = "docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md" |
| + |
| +// Canonical ids only: two digits from C01 to C99, three digits from C100. No |
| +// leading zero on a three-digit id, no C00. |
| +var fleetRoutesCopyIDPattern = regexp.MustCompile(`^FPR-C(0[1-9]|[1-9][0-9]{1,2})$`) |
| + |
| +// fleetRoutesCopyIDs is the deck's inventory, pinned as a literal list in the |
| +// deck's order. A struck row stays in it: the deck keeps the row for history. |
| +var fleetRoutesCopyIDs = []string{ |
| + "FPR-C01", "FPR-C02", "FPR-C03", "FPR-C04", |
| + "FPR-C05", "FPR-C06", "FPR-C07", "FPR-C08", |
| +} |
| + |
| +// fleetRoutesCopyStatuses are the statuses the deck may carry: the rootfs |
| +// deck's three, so a superseded row can be struck rather than deleted. |
| +var fleetRoutesCopyStatuses = []string{"pending", "approved", "struck"} |
| + |
| +// fleetRoutesCopyBuilt is every id whose text the code or docs carry. The |
| +// task that writes a row's text adds its id here in the same commit, once the |
| +// row is approved. Task 3 builds the CLI refusal (FPR-C01); Task 8 the floor |
| +// rows (FPR-C02 to FPR-C05); Task 9 the fleet-create barrier (FPR-C06, |
| +// FPR-C07); Task 11 the REASON cell (FPR-C08). |
| +var fleetRoutesCopyBuilt = []string{} |
| + |
| +func mustParseFleetRoutesRecord(t *testing.T) []copyRow { |
| + t.Helper() |
| + raw, err := os.ReadFile(fleetRoutesCopyRecordPath) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + rows, err := parseCopyTableStatuses(string(raw), fleetRoutesCopyRecordPath, fleetRoutesCopyIDPattern, "an FPR-C<nn>", fleetRoutesCopyStatuses...) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return rows |
| +} |
| + |
| +func TestFleetRoutesCopyIDPattern(t *testing.T) { |
| + for _, ok := range []string{"FPR-C01", "FPR-C99", "FPR-C100"} { |
| + if !fleetRoutesCopyIDPattern.MatchString(ok) { |
| + t.Errorf("%s refused", ok) |
| + } |
| + } |
| + for _, bad := range []string{"FPR-C1", "FPR-C00", "FPR-C001", "FPR-C1000", "FPR-1-C01", "FSK-C01", "fpr-c01"} { |
| + if fleetRoutesCopyIDPattern.MatchString(bad) { |
| + t.Errorf("%s accepted", bad) |
| + } |
| + } |
| +} |
| + |
| +func TestFleetRoutesCopyRecordIsComplete(t *testing.T) { |
| + reportAll(t, checkMovesInventory(mustParseFleetRoutesRecord(t), fleetRoutesCopyIDs)) |
| +} |
| + |
| +func TestFleetRoutesCopyHasNoEmDash(t *testing.T) { |
| + rows := mustParseFleetRoutesRecord(t) |
| + reportAll(t, checkMovesNoEmDash(rows)) |
| + for _, r := range rows { |
| + if strings.ContainsRune(r.Text, '–') { |
| + t.Errorf("%s: the text holds an en dash", r.ID) |
| + } |
| + } |
| +} |
| + |
| +func TestFleetRoutesCopyBuiltIsApproved(t *testing.T) { |
| + reportAll(t, checkRunBuilt(mustParseFleetRoutesRecord(t), fleetRoutesCopyBuilt)) |
| +} |
| + |
| +// fleetRoutesAppliedText is a row's text as the code prints it: the deck |
| +// writes a newline as a literal backslash-n, and Markdown needs a backslash |
| +// before a pipe inside a table cell, which Go must not print. |
| +func fleetRoutesAppliedText(s string) string { |
| + return strings.NewReplacer(`\n`, "\n", `\|`, "|").Replace(s) |
| +} |
| + |
| +func TestFleetRoutesCopyAppliedTextUnescapes(t *testing.T) { |
| + if got, want := fleetRoutesAppliedText(`a \| b\nc`), "a | b\nc"; got != want { |
| + t.Errorf("fleetRoutesAppliedText = %q, want %q", got, want) |
| + } |
| +} |
| + |
| +func TestFleetRoutesCopyBuiltIsApplied(t *testing.T) { |
| + rows := builtRows(mustParseFleetRoutesRecord(t), fleetRoutesCopyBuilt) |
| + for i := range rows { |
| + rows[i].Text = fleetRoutesAppliedText(rows[i].Text) |
| + } |
| + reportAll(t, checkRunApplied(rows, ".")) |
| +} |
diff --git a/docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md b/docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md| new file mode 100644 |
| index 000000000..f15dfc9b2 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-10-30-fleet-public-routes-copy.md |
| @@ -0,0 +1,56 @@ |
| +# Fleet public routes: copy deck |
| + |
| +Every user-facing string of the fleet public routes feature (spec |
| +`docs/superpowers/specs/2026-10-29-fleet-public-routes-design.md` rev 4, plan |
| +`docs/superpowers/plans/2026-10-30-fleet-public-routes.md`). The gate is |
| +`approved_fleet_routes_copy_test.go` at the repo root, which reads this deck in |
| +the format of `2026-10-29-fleet-secrets-key-copy.md`: columns id, file, text, |
| +status. Ids are `FPR-C01` upward, never renumbered. |
| + |
| +Every row is `pending`: these are drafts, and copy review settles the words. |
| +A row comes back `approved` with its final text. No later task writes a row |
| +that is not `approved`, and each adds its ids to `fleetRoutesCopyBuilt` in the |
| +commit that writes them. |
| + |
| +The rules: |
| + |
| +- The file cell is the exact repo-relative file the owning task writes the |
| + string into. The parenthesis after it names where in that file the string |
| + goes. |
| +- A `\n` in a text is a line break inside one literal. A pipe inside a text is |
| + written `\|`, because Markdown needs it escaped in a table cell and Go must |
| + not print the backslash. |
| +- No em dashes and no en dashes. A pause is a full stop and a new sentence. |
| +- Console and CLI output is lower case after a full stop. |
| +- Placeholders are Go verbs, filled in the order the row gives them. FPR-C05 is |
| + a `const` and cannot format, so the floor is written into its text at build |
| + time, as RD-32 writes `v0.31.0` (`layoutintent.go:296`); the row keeps its |
| + `%s`, and Task 8 checks the applied text against `"v"+FleetForwardFloor.String()`. |
| +- Diagnostics and log lines are not copy, except the override log line |
| + (FPR-C04), which is, as the regional floor's RD-31 is (plan ruling P-2). The |
| + CLI shows only the flag's help text (FPR-C05). The held-host reason |
| + (FPR-C08) is computed by the console from its own registry (plan ruling P-3). |
| + |
| +Placeholders by row: |
| + |
| +- FPR-C01: the host, the app, the fleet. |
| +- FPR-C02: the channel, its release, the floor, the target release. |
| +- FPR-C03: the channel, the floor, the target release. |
| +- FPR-C04: the target release, the floor, the channel. |
| +- FPR-C05: the floor. |
| +- FPR-C06: the channel, its release, the floor, the floor. |
| +- FPR-C07: none. |
| +- FPR-C08: the fleet. |
| + |
| +## Tasks 3, 8, 9 and 11: the fleet public routes strings |
| + |
| +| id | file | text | status | |
| +|---|---|---|---| |
| +| FPR-C01 | cli.go (`carlos add`, `route`, `remove` on a forward host; Task 3) | %s is app %s on fleet %s. its route follows the app's instance record, so change the app instead: carlos apps place or carlos instances delete | pending | |
| +| FPR-C02 | internal/console/fleetfloor.go (409, a channel move across the floor; Task 8) | %s runs %s. this deployment has a customer fleet, so it must run %s or later. %s is not one. to move the channel there anyway, pass --allow-below-fleet-forward-floor | pending | |
| +| FPR-C03 | internal/console/fleetfloor.go (409, a first publication below the floor; Task 8) | %s has no release yet. this deployment has a customer fleet, so its first release must be %s or later. %s is not one. to publish it anyway, pass --allow-below-fleet-forward-floor | pending | |
| +| FPR-C04 | internal/console/fleetfloor.go (console log on the override; Task 8) | moving to %s below %s on %s with --allow-below-fleet-forward-floor: the hub keeps serving fleet apps it can no longer retire. remove their routes first | pending | |
| +| FPR-C05 | internal/release/layoutintent.go (`FleetForwardFloorOverrideUsage`, flag help; Task 8) | allow a release below %s while customer fleets exist. a hub on that release keeps serving fleet apps it can no longer retire | pending | |
| +| FPR-C06 | internal/console/fleets.go (409, fleet create while a channel is below the floor; Task 9) | this deployment's %s channel is on %s, below %s. new fleets wait until every channel is on %s or later. try again after the deployment's next update | pending | |
| +| FPR-C07 | internal/console/fleets.go (503, fleet create when a channel pointer cannot be read; Task 9) | could not check this deployment's release channels. try again in a minute | pending | |
| +| FPR-C08 | internal/console/apiinstances.go (REASON, a fleet-placed instance whose host another route holds; Task 11) | another route on the router holds this name, so requests do not reach fleet %s. the deployment's operator can remove that route | pending | |