regional box names: rev 2, display name only (Paul's ruling), Astra R1 findings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+335
−333
docs/superpowers/specs/2026-10-25-regional-box-labels-design.md+0 −333docs/superpowers/specs/2026-10-25-regional-box-names-design.md+320 −0docs/superpowers/specs/CODEX-FINDINGS-REGIONAL-BOX-NAMES-R1.md+15 −0
CI passed — run details
diff --git a/docs/superpowers/specs/2026-10-25-regional-box-labels-design.md b/docs/superpowers/specs/2026-10-25-regional-box-labels-design.md| deleted file mode 100644 |
| index d5abd94ae..000000000 |
| --- a/docs/superpowers/specs/2026-10-25-regional-box-labels-design.md |
| +++ /dev/null |
| @@ -1,333 +0,0 @@ |
| -# Regional box labels |
| - |
| -Status: draft, awaiting Paul's approval. Branch `design-regional-box-labels`. |
| - |
| -## Intent |
| - |
| -Every box that runs `carlos agent` gets a public pseudonym from |
| -`status.Label(machineID)` (`internal/status/snapshot.go`): a first name and a |
| -gerund, `dennis-stenciling`. Both halves come from one global pair of |
| -40-word lists, so a name tells you nothing about where the box is. |
| - |
| -Paul wants the name to say where the box is and to sound like it belongs |
| -there: |
| - |
| - seamus-ploughing-ie |
| - martin-queueing-uk |
| - |
| -Three asks, all his: |
| - |
| -1. The region goes in the name, as a suffix. |
| -2. The first name is a typical name for that region. |
| -3. The verb is both a host's job (minding, carrying, serving, routing, |
| - holding, watching) and a typical activity in that region. |
| - |
| -Why: an operator reading the status page, a log line or an alert can tell |
| -at a glance which region a box is in, and the names are more fun. Today |
| -that takes a lookup against `STATUS_BOX_REGION`. |
| - |
| -## Goals |
| - |
| -- `name-verb-region` labels for boxes whose operator opts in. |
| -- Themed word lists for every region the flagship runs today: `ie`, `uk`, |
| - `us`, `au`. |
| -- A region code with no themed lists still gets the suffix, on top of |
| - today's global lists. |
| -- One place resolves a box's label, so the status snapshot, the log, error |
| - and analytics feeds and the metrics fallback all agree. |
| - |
| -## Non-goals |
| - |
| -- Fleet boxes. They publish under the label their operator picked |
| - (`internal/host/fleetidentity.go`) and never under `status.Label`. That |
| - stays exactly as it is. |
| -- Detecting two boxes with the same label. No such guard exists today. |
| - This change makes a clash less likely (see Collisions) and adds nothing |
| - more. |
| -- Different verbs for different kinds of box (edge, scanner, app host). |
| - Only app hosts publish under this label today, and a verb per kind of box |
| - would put each box's role on the public page. |
| -- Renaming anything that isn't `status.Label`: AWS `Name` tags, hostnames, |
| - tofu resource names, the operator-picked fleet labels. |
| - |
| -## Anti-goals |
| - |
| -These would make it a failure even if it worked: |
| - |
| -- **A box renamed by an upgrade.** A box with no label region must produce |
| - byte-for-byte the label it produces today. Renaming changes the status |
| - object key and the feed source name, so it only ever happens when an |
| - operator chose it. |
| -- **A machine id that can be recovered from the label.** The sha256 |
| - derivation stays. |
| -- **Names that read as a caricature of a place.** "Typical" means names |
| - people there actually have, across ages, not a joke accent. The lists go |
| - through copy review before they ship. |
| -- **Tenant names, team names or famous people.** No `tito`, `paul` or |
| - `bill`. Neutral common names only. |
| -- **A region the status page doesn't already show.** See Privacy. |
| - |
| -## Constraints found in the code |
| - |
| -- **The label is a stable key.** It names `status/boxes/<label>.json` |
| - (`snapshot.go`, `WriteBox`), it is the `Box` field on every log and error |
| - record (`internal/applog/sink.go`, `internal/apperr/sink.go`), and it is a |
| - path segment in analytics day files, |
| - `analytics/.../<app>/<box>/days/<date>.json` |
| - (`internal/analytics/day.go`, `BoxPrefix`). |
| -- **The status page never forgets a box.** `BuildFleet` |
| - (`internal/status/fleet.go`) lists every `status/boxes/*.json` and marks |
| - old ones `Stale`. It never drops them. A renamed box shows up twice, once |
| - as a stale box, until someone deletes its old key. |
| -- **Seven call sites compute the label.** `status.Label(readMachineID())` |
| - appears in `internal/host/agent.go` for the log sink, error sink, log |
| - shipper, error shipper and analytics meter (around lines 244, 245, 465, |
| - 468 and 531). `metricsBoxLabel` (`internal/host/metrics_loop.go`) falls |
| - back to it. `CollectBox` (`snapshot.go`) stamps it on the snapshot. They |
| - must all use the same region, or the same box goes by two names. |
| -- **There is no region code on the home box.** `CARLOS_REGION` is the |
| - placement code (`us`, `uk`, `au`), but the flagship's IE box leaves it |
| - unset on purpose: unset means "serves ""-scoped records". Setting |
| - `CARLOS_REGION=ie` there would change placement, so the label can't |
| - borrow it. |
| -- **`STATUS_BOX_REGION` is free text** (`"UK · London"`, `"AU · Sydney"`). |
| - It's for display, and parsing a code out of it would be fragile. |
| -- **The platform is general-purpose.** carloku.com is one deployment. Which |
| - box is in which region is deployment configuration |
| - (`carloku-infrastructure`, `platform-infrastructure` for dev), never |
| - platform code. The platform can ship themed lists keyed by region code, |
| - as long as any deployment can use them and nothing assumes carloku's |
| - regions. |
| - |
| -## Design |
| - |
| -### The input: `STATUS_LABEL_REGION` |
| - |
| -There's a new agent environment variable, `STATUS_LABEL_REGION`. It sits |
| -next to `STATUS_BOX_REGION` because it is a status-page setting, not a |
| -placement setting. |
| - |
| -- Unset or empty: the label is exactly today's `name-verb`, from the global |
| - lists. Nothing changes on upgrade. |
| -- Set to a valid code: the label is `name-verb-<code>`. |
| -- Set to something invalid: log once at startup, naming the variable and |
| - the value, and fall back to the unset behaviour. This follows the agent's |
| - existing degrade-don't-disable rule for status identity |
| - (`metricsBoxLabel`, the status loop). |
| - |
| -A valid code is 2 to 8 lowercase ASCII letters, `^[a-z]{2,8}$`. That covers |
| -every CARLOS placement code in use and keeps the label safe as an object key |
| -segment and a path segment. It must not contain `-`, the label's separator. |
| -If `registry` already has a placement-code validator with the same or a |
| -tighter grammar, the builder should use that one instead. |
| - |
| -It is an opt-in, not a default taken from `CARLOS_REGION`. Defaulting would |
| -rename every non-home box on upgrade (anti-goal 1) and would leave the home |
| -box out anyway. |
| - |
| -### Word lists |
| - |
| -Each themed region gets a name list and a verb list. Both are fixed-size Go |
| -arrays in `internal/status`, next to today's `labelNames` and |
| -`labelActions`, so the label space stays easy to audit. |
| - |
| -Rules for every list: |
| - |
| -- Exactly 40 entries. That keeps 1,600 labels per region, the same as |
| - today's global space, and keeps the existing uint32 index-bias reasoning |
| - unchanged. |
| -- Lowercase ASCII letters only, no hyphens or spaces. Irish fadas are |
| - dropped (`siobhan`, `padraig`). Compound activities run together |
| - (`narrowboating`, `lockkeeping`). |
| -- No duplicates within a list. The same word can appear in two regions, |
| - because the suffix tells them apart. |
| -- Verbs are gerunds. Each one should work as a host's job and as something |
| - people do in that region. Where a word can't manage both, the regional |
| - pastime wins. |
| -- Local spelling: `signalling` in uk and au, `barbecuing` in us. |
| - |
| -Lookup is `themes[code]`. A code with no entry uses today's global lists |
| -plus the suffix (`ada-stargazing-de`). Adding a region later is one map |
| -entry and two arrays, with no other code change. |
| - |
| -### Derivation |
| - |
| -`Label` keeps its algorithm: `sha256(machineID)`, name index from bytes |
| -0-3, verb index from bytes 4-7, each `uint32 % 40`. Only the lists it |
| -indexes into change, plus the suffix. |
| - |
| -So the unset case has to stay identical. Today's test |
| -(`internal/status/status_test.go`) only checks that a label is stable, not |
| -what it is. Before changing anything, the builder captures today's output |
| -for a handful of ids as golden values, and those must pass unchanged |
| -afterwards. |
| - |
| -The builder decides the signature. Two obvious ones are |
| -`Label(machineID, region string)` with every caller updated, or a new |
| -`RegionalLabel` beside an unchanged `Label`. Either way there must be one |
| -resolver in `internal/host`, for example `boxLabel(getenv, machineID)`. |
| -It reads `STATUS_LABEL_REGION` once, and all seven call sites go through |
| -it. `metricsBoxLabel` and the exported `BoxLabel` that the relay uses fall |
| -back to it instead of calling `status.Label` directly. |
| - |
| -The doc comment on `Label` currently says the label "give[s] away nothing |
| -about the machine". It needs rewriting to say the label can now carry the |
| -operator-set region code, and nothing else. |
| - |
| -### Privacy |
| - |
| -Today's label is public and has to stay safe to publish. |
| - |
| -- The machine id still goes through sha256. The region code is an operator |
| - setting, not something derived from the machine. |
| -- On the flagship, every box's `STATUS_BOX_REGION` already says its region |
| - in words next to the label in `fleet.json`, so the code adds nothing new. |
| -- An operator who sets `STATUS_LABEL_REGION` but not `STATUS_BOX_REGION` |
| - publishes a region they weren't publishing before. That's their choice, |
| - and the README entry for the variable says so in plain words. |
| - |
| -### Collisions |
| - |
| -Two boxes with the same label overwrite each other's status object. With |
| -the suffix, boxes in different regions can never clash. Within a region |
| -the space is 1,600 labels, the same as today's whole fleet. That's no worse |
| -for any region and better overall. Nothing more is in scope. |
| - |
| -### Rollout (operator steps, per box) |
| - |
| -A label change is a rename, so it happens one box at a time and on purpose: |
| - |
| -1. Set `STATUS_LABEL_REGION=<code>` in the box's `host.env`. For the |
| - flagship this goes through `scripts/bootstrap-box.sh` in |
| - `carloku-infrastructure`, which gains an argument the same way |
| - `STATUS_BOX_REGION` did. It's a separate change in that repo, plus the |
| - dev root in `platform-infrastructure`. Don't hand-edit user_data: a |
| - user_data change restarts the instance. |
| -2. Restart the agent through the normal path (`update-platform-binary.sh` |
| - or `carlos system apply`, whichever the release in use calls for). |
| -3. Wait for `status/boxes/<new>.json` to appear, then delete |
| - `status/boxes/<old>.json` so the status page stops showing a stale |
| - twin. The old label is the box's current one, which is in `fleet.json` |
| - before the change. |
| -4. Roll order stays dev boxes, dev console, check, flagship boxes, |
| - flagship console. The console doesn't compute labels, so the console |
| - steps are only the usual check. |
| - |
| -What the rename leaves behind, by design: |
| - |
| -- Log and error records before the switch carry the old `Box` value, and |
| - records after it carry the new one. |
| -- Analytics for the day of the switch is split across two box |
| - directories. That's fine: `ReadRange` (`internal/analytics/read.go`) |
| - already lists every box directory for an app and merges them per day, |
| - summing counters and unioning visitor sketches, because instances move |
| - between boxes anyway. |
| - |
| -The agent doesn't delete the old status key itself. That would need a |
| -`DeleteObject` grant the box role may not have, and an id-less label |
| -clash could delete another box's live snapshot. Four flagship boxes and a |
| -few dev boxes is a handful of `aws s3 rm` commands. *(Claude's call.)* |
| - |
| -## Starter word lists |
| - |
| -These are a first draft for copy review (a Luna pass on Paul's house |
| -rules). They aren't final. |
| - |
| -### ie |
| - |
| -Names: seamus, siobhan, niamh, aoife, ciaran, padraig, maeve, sinead, eoin, |
| -orla, declan, grainne, cian, roisin, fionn, saoirse, colm, brid, oisin, |
| -aisling, darragh, caoimhe, ronan, deirdre, cathal, una, tadhg, eimear, |
| -donal, clodagh, fiachra, muireann, lorcan, sorcha, eamon, nuala, diarmuid, |
| -ailbhe, cormac, mairead. |
| - |
| -Verbs: minding, herding, shepherding, droving, ploughing, thatching, |
| -baling, foddering, ferrying, footing, milking, churning, stacking, carting, |
| -rambling, welcoming, pouring, brewing, distilling, baking, knitting, |
| -weaving, walling, fencing, hurling, busking, fiddling, storytelling, |
| -angling, trawling, rowing, shopkeeping, gathering, haymaking, turfcutting, |
| -harvesting, penning, shearing, grazing, lambing. |
| - |
| -### uk |
| - |
| -Names: martin, nigel, gareth, gemma, ian, claire, derek, colin, julie, |
| -trevor, alison, graham, keith, wendy, barry, sharon, gavin, kirsty, neil, |
| -lorraine, stuart, hayley, darren, joanne, craig, nicola, malcolm, fiona, |
| -rhys, bethan, alastair, morag, hamish, ellie, hugh, rosie, alfie, imogen, |
| -tom, dave. |
| - |
| -Verbs: queueing, brewing, narrowboating, punting, lockkeeping, signalling, |
| -shunting, portering, marshalling, trainspotting, bellringing, |
| -allotmenting, rambling, pottering, fettling, mending, darning, |
| -letterboxing, hedgelaying, wassailing, carolling, twitching, bowling, |
| -batting, quizzing, caravanning, baking, pickling, jamming, hoovering, |
| -tidying, stewarding, rowing, fellrunning, morrisdancing, busking, |
| -tinkering, crocheting, beachcombing, gardening. |
| - |
| -### us |
| - |
| -Names: hank, betty, earl, peggy, chuck, dolores, randy, tammy, dwayne, |
| -shelby, cody, travis, wade, loretta, dale, bonnie, gus, rhonda, bud, patsy, |
| -mike, jennifer, chris, ashley, brian, amanda, kevin, heather, jason, |
| -melissa, josh, brittany, tyler, kayla, jake, megan, dylan, madison, cole, |
| -savannah. |
| - |
| -Verbs: tailgating, grilling, barbecuing, wrangling, ranching, lassoing, |
| -corralling, trucking, hauling, railroading, carpooling, roadtripping, |
| -bussing, carhopping, potlucking, babysitting, lifeguarding, ushering, |
| -bellhopping, dispatching, shuttling, logging, homesteading, prospecting, |
| -panning, canning, whittling, squaredancing, linedancing, bowling, |
| -pitching, quarterbacking, cheerleading, flyfishing, rafting, camping, |
| -surfing, skateboarding, carving, trailblazing. |
| - |
| -### au |
| - |
| -Names: bruce, sheila, shane, kylie, brett, tracey, wayne, narelle, craig, |
| -leanne, scott, kerry, glenn, raelene, troy, bronwyn, mick, nathan, chloe, |
| -lachlan, matilda, isla, kane, jacinta, jarrah, banjo, tahlia, cooper, |
| -ruby, brodie, belinda, dean, darcy, mitchell, harley, tegan, clancy, lily, |
| -mackenzie, ella. |
| - |
| -Verbs: mustering, droving, shearing, jackarooing, boundaryriding, fencing, |
| -lifesaving, patrolling, shouting, barbecuing, roadtraining, ferrying, |
| -surfing, bodyboarding, snorkelling, sailing, yabbying, crabbing, |
| -rockpooling, fossicking, prospecting, bushwalking, camping, caravanning, |
| -stargazing, beachcombing, skimboarding, tipping, bowling, brewing, |
| -pouring, busking, yachting, rowing, diving, birdwatching, swimming, |
| -fishing, kayaking, gardening. |
| - |
| -The au lists stay away from Aboriginal and Torres Strait Islander cultural |
| -practices on purpose. They aren't ours to make into hostnames. |
| - |
| -## Tests the builder owes |
| - |
| -- Unset `STATUS_LABEL_REGION`: `Label` output is byte-identical to the |
| - golden values captured from today's code. |
| -- For each themed region: the label is stable for a given id, has the shape |
| - `^[a-z]+-[a-z]+-<code>$`, and uses that region's lists. |
| -- An unthemed valid code: global lists plus the suffix. |
| -- An invalid code (`UK`, `u-k`, `ireland1`, a nine-letter code): falls back |
| - to the unset label and logs once. |
| -- List hygiene, checked in a test rather than by eye: each list has 40 |
| - entries, all `^[a-z]+$`, none duplicated within the list. |
| -- One resolver, wired for real: a test drives the production wiring |
| - (following the production-wired-witness rule) and shows that the snapshot |
| - label, the log sink's box, the error sink's box, the analytics meter's |
| - box and `metricsBoxLabel`'s fallback are the same string for a box with |
| - `STATUS_LABEL_REGION` set. |
| -- Fleet boxes: with `CARLOS_FLEET` set, `STATUS_LABEL_REGION` has no |
| - effect. |
| - |
| -## Docs the builder owes |
| - |
| -- README: a `STATUS_LABEL_REGION` entry next to `STATUS_BOX_REGION`. It |
| - covers what it does, that setting it renames the box, that the code is |
| - public, and the delete-the-old-key step. |
| -- The `Label` doc comment, as above. |
| - |
| -## Left to the builder |
| - |
| -- `Label`'s signature, and where the resolver lives in `internal/host`. |
| -- Whether to reuse a `registry` placement-code validator. |
| -- The exact log line for an invalid code. It goes through copy review with |
| - the word lists. |
diff --git a/docs/superpowers/specs/2026-10-25-regional-box-names-design.md b/docs/superpowers/specs/2026-10-25-regional-box-names-design.md| new file mode 100644 |
| index 000000000..4132f830d |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-10-25-regional-box-names-design.md |
| @@ -0,0 +1,320 @@ |
| +# Regional box display names |
| + |
| +Status: revision 2, awaiting Paul's approval. Branch |
| +`design-regional-box-labels`. Revision 1 renamed the box label itself. |
| +Astra's builder check showed that the label is now the box's operational |
| +identity, and Paul ruled (2026-10-25) that the regional name is a display |
| +name. Making it the identity for new boxes is a later step. |
| + |
| +## Intent |
| + |
| +Every box in the shared fleet has an identity label. It's either the |
| +hashed pseudonym `status.Label(machineID)` (`dennis-stenciling`, |
| +`internal/status/snapshot.go`) or, for a box a region group launched, a |
| +group reference (`g-` plus 20 hex digits, `internal/host/boxreference.go`). |
| +That label says nothing about where the box is, and a `g-` reference isn't |
| +something a person can remember. |
| + |
| +Paul wants a name that says where the box is and sounds like it belongs |
| +there: |
| + |
| + seamus-ploughing-ie |
| + martin-queueing-uk |
| + |
| +Three asks, all his: |
| + |
| +1. The region goes in the name, as a suffix. |
| +2. The first name is a typical name for that region. |
| +3. The verb is both a host's job (minding, carrying, serving, routing, |
| + holding, watching) and a typical activity in that region. |
| + |
| +Why: an operator reading the status page or the console can tell at a |
| +glance which region a box is in, group boxes get a name a person can say |
| +out loud, and the names are more fun. |
| + |
| +## Goals |
| + |
| +- A `name-verb-region` display name on every shared-fleet box whose |
| + operator opts in, hashed-label boxes and group boxes alike. |
| +- Themed word lists for every region the flagship runs today: `ie`, `uk`, |
| + `us`, `au`. |
| +- A region code with no themed lists still gets a name, from today's |
| + global lists plus the suffix. |
| +- The public status page and the console's hosts table show the display |
| + name, with the identity label still visible next to it. |
| + |
| +## Non-goals |
| + |
| +- **Changing any box's identity.** The identity label keys the status |
| + report (`status/boxes/<label>.json`), enrollment records |
| + (`internal/host/boxrecord.go`), join invitations |
| + (`internal/host/joinroot.go`), the host actor check that holds a box |
| + whose label doesn't match its enrollment (`internal/host/joinmode.go`), |
| + layout intents (`internal/host/layoutleg.go`), and the `Box` field of |
| + log, error and analytics records. None of that changes. |
| +- **Regional identities for new boxes.** Paul said new boxes can pick up |
| + the new naming later. That's a separate design. This one shouldn't make |
| + it harder, but it doesn't do it. |
| +- **Fleet boxes.** Their operators already pick their names |
| + (`internal/host/fleetidentity.go`), and their reports never reach the |
| + public `fleet.json`. |
| +- **Different verbs for different kinds of box** (edge, scanner, app |
| + host). That would publish each box's role. |
| +- **Every place a label appears.** Logs, alerts, the roles page and the |
| + CLI keep showing the identity label. Only the status page and the |
| + console's hosts table are in scope. |
| + |
| +## Anti-goals |
| + |
| +These would make it a failure even if it worked: |
| + |
| +- **Anything keyed on the display name.** It's for people to read. Code |
| + that looks a box up, writes an object or compares boxes uses the |
| + identity label, always. |
| +- **A change on upgrade.** A box without the new setting publishes a |
| + report byte-for-byte the same as today's. |
| +- **Anything new about the machine on a public page.** See Privacy. |
| +- **Names that read as a caricature of a place.** "Typical" means names |
| + people there actually have, across ages, not a joke accent. The lists go |
| + through copy review before they ship. |
| +- **Tenant names, team names or famous people.** No `tito`, `paul` or |
| + `bill`. Neutral common names only. |
| + |
| +## Constraints found in the code |
| + |
| +- **The report's label is settled late.** `CollectBox` stamps |
| + `status.Label(p.MachineID)`. Then `statusTick` |
| + (`internal/host/agent.go`, `labelOverride`) replaces it with the fleet |
| + label, and `groupStatusTick` (`internal/host/boxreference.go`) with the |
| + group reference. The display name has to come from the label the report |
| + is finally published under, so it must be computed after those |
| + overrides. |
| +- **There is no region code on the home box.** `CARLOS_REGION` is the |
| + placement code (`us`, `uk`, `au`), but the flagship's IE box leaves it |
| + unset on purpose: unset means "serves ""-scoped records". The name |
| + can't borrow it. |
| +- **`STATUS_BOX_REGION` is free text** (`"UK · London"`). It's for |
| + display, and parsing a code out of it would be fragile. |
| +- **The platform is general-purpose.** carloku.com is one deployment. |
| + Which box is in which region is deployment configuration |
| + (`carloku-infrastructure`, and `platform-infrastructure` for dev). The |
| + platform can ship themed lists keyed by region code, as long as any |
| + deployment can use them and nothing assumes carloku's regions. |
| +- **Old reports stay readable.** Readers of `status/boxes/*.json` and |
| + `fleet.json` must treat a missing name as "show the label", because |
| + boxes on older releases never write one. |
| + |
| +## Design |
| + |
| +### The input: `STATUS_NAME_REGION` |
| + |
| +There's a new agent environment variable, `STATUS_NAME_REGION`. It sits |
| +next to `STATUS_BOX_REGION` because it's a status-page setting, not a |
| +placement setting. Group boxes get it the same way they get the rest of |
| +`host.env`. |
| + |
| +- Unset or empty: no display name. The report has no `name` field, and |
| + everything looks as it does today. |
| +- A valid code: the report carries `name`. |
| +- Something invalid: log once at startup, naming the variable and the |
| + value, and carry no name. That follows the agent's existing |
| + degrade-don't-disable rule for status. |
| + |
| +A valid code is 2 to 8 lowercase ASCII letters, `^[a-z]{2,8}$`, which |
| +covers every CARLOS placement code in use. If `registry` already has a |
| +placement-code validator with the same or a tighter grammar, use that one. |
| + |
| +### Derivation |
| + |
| + name = names[r][i] + "-" + verbs[r][j] + "-" + code |
| + |
| +`r` is the code's themed lists, or today's global `labelNames` and |
| +`labelActions` if the code has none. `i` and `j` are `uint32 % 40` of |
| +bytes 0-3 and 4-7 of `sha256("carlos-box-name/v1\x00" + label)`, where |
| +`label` is the identity label the report is published under. |
| + |
| +- It's derived from the identity label, not the machine id. The label is |
| + already public, so the name reveals nothing the page didn't already |
| + show, and group boxes, which have no hash label, are covered by the |
| + same rule. |
| +- The domain prefix keeps the indexes independent of `status.Label`'s own |
| + hash. Otherwise a hashed-label box under an unthemed code would just get |
| + its own label back with a suffix, and the name would be predictable in |
| + a confusing way. |
| +- A box keeps its name for as long as it keeps its label and its code. |
| + |
| +The function lives in `internal/status`, next to `Label`, so the label |
| +space stays easy to audit. `statusTick` calls it once the label is final |
| +and puts the result on `Box.Name` (`json:"name,omitempty"`). `BuildFleet` |
| +copies it to `FleetBox.Name` (`json:"name,omitempty"`), and the console's |
| +`HostRow` (`internal/console/view.go`) gets it too. |
| + |
| +### Word lists |
| + |
| +Each themed region gets a name list and a verb list. Both are fixed-size Go |
| +arrays in `internal/status`, next to today's `labelNames` and |
| +`labelActions`. |
| + |
| +Rules for every list: |
| + |
| +- Exactly 40 entries, the same space as today's lists, so the existing |
| + uint32 index-bias reasoning carries over. |
| +- Lowercase ASCII letters only, no hyphens or spaces. Irish fadas are |
| + dropped (`siobhan`, `padraig`). Compound activities run together |
| + (`narrowboating`, `lockkeeping`). |
| +- No duplicates within a list. The same word can appear in two regions, |
| + because the suffix tells them apart. |
| +- Verbs are gerunds. Each one should work as a host's job and as something |
| + people do in that region. Where a word can't manage both, the regional |
| + pastime wins. |
| +- Local spelling: `signalling` in uk and au, `barbecuing` in us. |
| + |
| +Lookup is a map from code to lists. Adding a region later is one map entry |
| +and two arrays, with no other code change. |
| + |
| +### Showing it |
| + |
| +- **Status page** (`internal/status/assets/index.html`): the box column |
| + shows the name and puts the label beneath it in smaller, muted text. A |
| + box without a name shows the label exactly as today. Both go through |
| + the page's existing text-only path (`asText`, never `innerHTML`). |
| +- **Console hosts table**: the same arrangement. |
| + |
| +Exact layout is the builder's call within that. |
| + |
| +### Clashes |
| + |
| +Two boxes in one region can end up with the same display name, a 1-in-1,600 |
| +chance for each pair. That's cosmetic. Nothing is keyed on the name, and the |
| +label is shown next to it. Nothing is done about it. |
| + |
| +### Privacy |
| + |
| +- The name is a hash of the identity label, which `fleet.json` already |
| + publishes, plus an operator-set code. |
| +- On the flagship, every box's `STATUS_BOX_REGION` already says its region |
| + in words, so the code adds nothing. |
| +- An operator who sets `STATUS_NAME_REGION` but not `STATUS_BOX_REGION` |
| + publishes a region they weren't publishing before. That's their choice, |
| + and the README entry says so. |
| + |
| +### Rollout |
| + |
| +Nothing gets renamed, so there's no migration. Per deployment: |
| + |
| +1. Add the setting to each box's `host.env`. For the flagship that goes |
| + through `scripts/bootstrap-box.sh` in `carloku-infrastructure`, which |
| + gains an argument the way `STATUS_BOX_REGION` did, plus the dev root in |
| + `platform-infrastructure`. Those are separate changes in those repos. |
| + Don't hand-edit user_data, because a user_data change restarts the |
| + instance. |
| +2. Restart the agent through the normal path. |
| +3. The usual roll order: dev boxes, dev console, check, flagship boxes, |
| + flagship console. The console needs the release that knows about `name` |
| + before the hosts table shows it, but nothing breaks either way. |
| + |
| +## Starter word lists |
| + |
| +These are a first draft for copy review (a Luna pass on Paul's house |
| +rules). They aren't final. |
| + |
| +### ie |
| + |
| +Names: seamus, siobhan, niamh, aoife, ciaran, padraig, maeve, sinead, eoin, |
| +orla, declan, grainne, cian, roisin, fionn, saoirse, colm, brid, oisin, |
| +aisling, darragh, caoimhe, ronan, deirdre, cathal, una, tadhg, eimear, |
| +donal, clodagh, fiachra, muireann, lorcan, sorcha, eamon, nuala, diarmuid, |
| +ailbhe, cormac, mairead. |
| + |
| +Verbs: minding, herding, shepherding, droving, ploughing, thatching, |
| +baling, foddering, ferrying, footing, milking, churning, stacking, carting, |
| +rambling, welcoming, pouring, brewing, distilling, baking, knitting, |
| +weaving, walling, fencing, hurling, busking, fiddling, storytelling, |
| +angling, trawling, rowing, shopkeeping, gathering, haymaking, turfcutting, |
| +harvesting, penning, shearing, grazing, lambing. |
| + |
| +### uk |
| + |
| +Names: martin, nigel, gareth, gemma, ian, claire, derek, colin, julie, |
| +trevor, alison, graham, keith, wendy, barry, sharon, gavin, kirsty, neil, |
| +lorraine, stuart, hayley, darren, joanne, craig, nicola, malcolm, fiona, |
| +rhys, bethan, alastair, morag, hamish, ellie, hugh, rosie, alfie, imogen, |
| +tom, dave. |
| + |
| +Verbs: queueing, brewing, narrowboating, punting, lockkeeping, signalling, |
| +shunting, portering, marshalling, trainspotting, bellringing, |
| +allotmenting, rambling, pottering, fettling, mending, darning, |
| +letterboxing, hedgelaying, wassailing, carolling, twitching, bowling, |
| +batting, quizzing, caravanning, baking, pickling, jamming, hoovering, |
| +tidying, stewarding, rowing, fellrunning, morrisdancing, busking, |
| +tinkering, crocheting, beachcombing, gardening. |
| + |
| +### us |
| + |
| +Names: hank, betty, earl, peggy, chuck, dolores, randy, tammy, dwayne, |
| +shelby, cody, travis, wade, loretta, dale, bonnie, gus, rhonda, bud, patsy, |
| +mike, jennifer, chris, ashley, brian, amanda, kevin, heather, jason, |
| +melissa, josh, brittany, tyler, kayla, jake, megan, dylan, madison, cole, |
| +savannah. |
| + |
| +Verbs: tailgating, grilling, barbecuing, wrangling, ranching, lassoing, |
| +corralling, trucking, hauling, railroading, carpooling, roadtripping, |
| +bussing, carhopping, potlucking, babysitting, lifeguarding, ushering, |
| +bellhopping, dispatching, shuttling, logging, homesteading, prospecting, |
| +panning, canning, whittling, squaredancing, linedancing, bowling, |
| +pitching, quarterbacking, cheerleading, flyfishing, rafting, camping, |
| +surfing, skateboarding, carving, trailblazing. |
| + |
| +### au |
| + |
| +Names: bruce, sheila, shane, kylie, brett, tracey, wayne, narelle, craig, |
| +leanne, scott, kerry, glenn, raelene, troy, bronwyn, mick, nathan, chloe, |
| +lachlan, matilda, isla, kane, jacinta, jarrah, banjo, tahlia, cooper, |
| +ruby, brodie, belinda, dean, darcy, mitchell, harley, tegan, clancy, lily, |
| +mackenzie, ella. |
| + |
| +Verbs: mustering, droving, shearing, jackarooing, boundaryriding, fencing, |
| +lifesaving, patrolling, shouting, barbecuing, roadtraining, ferrying, |
| +surfing, bodyboarding, snorkelling, sailing, yabbying, crabbing, |
| +rockpooling, fossicking, prospecting, bushwalking, camping, caravanning, |
| +stargazing, beachcombing, skimboarding, tipping, bowling, brewing, |
| +pouring, busking, yachting, rowing, diving, birdwatching, swimming, |
| +fishing, kayaking, gardening. |
| + |
| +The au lists stay away from Aboriginal and Torres Strait Islander cultural |
| +practices on purpose. They aren't ours to make into hostnames. |
| + |
| +## Tests the builder owes |
| + |
| +- With `STATUS_NAME_REGION` unset, the published report and `fleet.json` |
| + are byte-identical to today's, and there's no `name` key. |
| +- For each themed region: the name is stable for a given label, has the |
| + shape `^[a-z]+-[a-z]+-<code>$`, and uses that region's lists. |
| +- An unthemed valid code: global lists plus the suffix. |
| +- An invalid code (`UK`, `u-k`, `ireland1`, nine letters): no name, one |
| + log line. |
| +- List hygiene, checked in a test rather than by eye: each list has 40 |
| + entries, all `^[a-z]+$`, none duplicated within the list. |
| +- Production-wired witnesses: drive the real status tick for a |
| + hashed-label box and for a group box (`CARLOS_BOX_REFERENCE=group`, with |
| + the group identity seam stubbed). Show that `name` is derived from the |
| + label the report is published under, not from `status.Label(machineID)`. |
| +- `BuildFleet` copies `name`, and a report without it still loads. |
| +- Status page: with a name, the name and the label both render as text; |
| + without one, the row is unchanged. |
| +- Fleet boxes: with `CARLOS_FLEET` set, no name is published. |
| + |
| +## Docs the builder owes |
| + |
| +- README: a `STATUS_NAME_REGION` entry next to `STATUS_BOX_REGION`. It |
| + says what the variable does, that the name is for display only and that |
| + the code is public. |
| + |
| +## Left to the builder |
| + |
| +- Function names and where exactly the call sits in the status tick. |
| +- Whether to reuse a `registry` placement-code validator. |
| +- The status page and hosts table layout, within "name, then the label |
| + beneath it". |
| +- The exact log line for an invalid code. It goes through copy review with |
| + the word lists. |
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-REGIONAL-BOX-NAMES-R1.md b/docs/superpowers/specs/CODEX-FINDINGS-REGIONAL-BOX-NAMES-R1.md| new file mode 100644 |
| index 000000000..5b8ae7794 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-REGIONAL-BOX-NAMES-R1.md |
| @@ -0,0 +1,15 @@ |
| +1. **Should opting into a regional label also rename the box’s operational identity, or must that identity remain stable?** |
| + `metricsBoxLabel` also identifies enrollment records and join invitations ([boxrecord.go:178](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/boxrecord.go:178), [joinroot.go:140](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/joinroot.go:140)). An enrolled box whose newly resolved label differs from its stored enrollment enters the held state ([joinmode.go:144](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/joinmode.go:144)). `BoxLabel()` also selects layout instructions ([layoutleg.go:728](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/layoutleg.go:728)). |
| + **Why this changes the plan:** the prescribed fallback change can affect whether a box hosts applications. The plan needs either a separation between public labels and operational identity, a supported identity migration, or an explicit restriction on which boxes may opt in. Restarting and deleting the old status object does not resolve this. |
| + |
| +Incorrect code claims: |
| + |
| +- **“Every box” gets its public pseudonym from `status.Label`.** Group-launched boxes publish status under a separate group reference. `groupStatusTick` overrides the label and refuses publication while that reference is unavailable ([boxreference.go:103](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/boxreference.go:103)); metrics also prioritizes it ([metrics_loop.go:718](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/metrics_loop.go:718)). |
| + |
| +- **Fleet boxes publish “never under `status.Label`.”** Their log/error sinks and analytics meter still receive the hash label directly ([agent.go:293](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/agent.go:293), [agent.go:954](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/agent.go:954)). Invalid fleet identities also fall back to it for metrics, and README explicitly documents the heartbeat fallback ([metrics_loop.go:722](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/metrics_loop.go:722), [README.md:752](/home/paulca/.cache/tmp/claude-1001/regional-labels/README.md:752)). |
| + |
| +- **“The status page never forgets a box.”** When modification-time listing succeeds, objects last written more than 24 hours ago are excluded. Stores without that capability retain the old listing behavior ([fleet.go:238](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/status/fleet.go:238)). Deletion is therefore not always necessary to remove a stale twin from the page. |
| + |
| +- **“No such guard exists today” for label collisions.** Status snapshots can overwrite one another, but enrollment publication already detects a reference held by another instance and refuses it ([boxrecord.go:125](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/host/boxrecord.go:125)). |
| + |
| +- **The analytics object path is wrong.** It is `apps/<sqid>/<app>/analytics/<box>/days/<date>.json`, not `analytics/.../<app>/<box>/days/<date>.json` ([day.go:37](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/analytics/day.go:37), [day.go:87](/home/paulca/.cache/tmp/claude-1001/regional-labels/internal/analytics/day.go:87)). |
| \ No newline at end of file |