carlos / platform Public

merge: catch up with main (#151 route aliases) — aliases inherit multi-upstream entries

Main had moved well past #151 by the time this branch caught up: the merge
takes in route aliases (#151/#164), delegated wildcards (#168), woodstar docs
(#169), the unit-economics work (#171) and the account-default-resolution
seam. Seven files conflicted; all but two were additive-on-both-sides.

Resolutions that needed judgment rather than side-picking:

- internal/status/snapshot.go — both sides added a field to Probes AND to
  BoxMetrics at the same offsets (ours Upstreams, theirs Aliases). Both are
  kept, and CollectBox's "attach Metrics only when something is known" guard
  now ORs both new tables (len(aliasReadings) > 0 || len(p.Upstreams) > 0).
  Taking either side alone would have silently dropped the other's block from
  status/boxes/<label>.json for a box that knew only that one thing.

- instances_cli.go — main replaced apiAccount with resolvedAccount ("the seam
  every API-mode verb reaches through", apimode.go) across every instances
  verb. `instances set-upstreams` was written on this branch before that seam
  existed, so the mechanical resolution would have left it the ONLY instances
  verb still defaulting -account to "ops" and skipping default-account
  resolution: a user omitting -account would get create/list/delete resolving
  correctly and set-upstreams 404ing against an "ops" account they don't
  have. Converted it to -account "" + resolvedAccount to match its siblings.

- apimode.go — ours collapsed putJSON into sendJSON; main added #160's
  consoleMoved handling to the then-inline putJSON body. Ours wins: the
  auto-merged sendJSON already carries the consoleMoved branch, so the
  collapse keeps main's behavior with one copy instead of two.

- internal/host/agent.go — the edge ready hook gained both sides' wiring
  (setUpstreamSource for the probe table, then main's usage meter).

- internal/edge/edge_test.go, internal/status/status_test.go — both sides
  appended whole test funcs at adjacent offsets and git interleaved them.
  Neither side deletes a base line, so both files were rebuilt from the merge
  base with each side's additions applied at their own offsets rather than
  hand-splicing the interleaved hunks.

edge.go's Reload merged clean, and the ordering the branch needs holds:
alias wiring, then probers.Sync, then upstreams.Store. Aliases copy the
primary's upstream entry, whose proxy for a probed route is multiProxy
closed over the proberSet pointer and resolving Live(primaryHost) per
request — so an alias of a multi-upstream route inherits failover, and Sync
running after the entries are built is correct (it updates the set's
contents, never the table). TestAliasSharesUpstreamEntry is byte-identical
to main's and passes unchanged (-race -count=2).

Gate: build, vet, GOOS=darwin build, gofmt and all 27 test packages clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Paul Campbell bcde24530a3482975af3be03bacbd6d300dc56f0 parent 66bf4ebparent 8283204
100 files changed, +18490 −195
  • account_choose.go +123 −0
  • account_choose_test.go +89 −0
  • accounts.go +71 −3
  • accounts_list_test.go +81 −0
  • accounts_resolve_test.go +12 −0
  • apimode.go +393 −6
  • apimode_test.go +536 −0
  • appconfig_cli.go +16 −10
  • apps.go +8 −7
  • auth.go +57 −6
  • auth_test.go +58 −7
  • cli.go +29 −19
  • cmd/console/main.go +25 −0
  • config.go +115 −23
  • config_test.go +96 −0
  • deploy.go +2 −2
  • docs/superpowers/plans/2026-08-11-unit-economics.md +2335 −0
  • docs/superpowers/plans/2026-08-12-account-default-resolution.md +122 −0
  • docs/superpowers/plans/2026-08-12-delegated-wildcard-certs.md +427 −0
  • docs/superpowers/plans/2026-08-12-route-extra-hostnames.md +548 −0
  • docs/superpowers/plans/2026-08-12-woodstar-w0-relay-fanout.md +751 −0
  • docs/superpowers/specs/2026-08-11-unit-economics-design.md +282 −0
  • docs/superpowers/specs/2026-08-12-account-default-resolution-design.md +182 −0
  • docs/superpowers/specs/2026-08-12-proactive-cli-design.md +128 −0
  • docs/superpowers/specs/2026-08-12-route-extra-hostnames-design.md +288 −0
  • docs/superpowers/specs/2026-08-12-woodstar-carloku-migration-design.md +424 −0
  • domains_cli.go +150 −0
  • domains_cli_test.go +393 −0
  • economics.go +231 −0
  • economics_test.go +292 −0
  • fleets.go +14 −13
  • go.mod +1 −0
  • go.sum +2 −5
  • infra/modules/region-host/main.tf +20 −0
  • infra/modules/region-host/variables.tf +6 −0
  • instances_cli.go +9 −9
  • internal/console/apidomains.go +335 −0
  • internal/console/apidomains_test.go +480 −0
  • internal/console/authcli.go +9 −2
  • internal/console/cepull.go +173 −0
  • internal/console/cepull_test.go +41 −0
  • internal/console/econlistquery.go +219 −0
  • internal/console/econlistquery_test.go +202 −0
  • internal/console/economicsbill_test.go +448 −0
  • internal/console/economicspage_test.go +466 −0
  • internal/console/economicspass.go +1095 −0
  • internal/console/economicspass_test.go +452 −0
  • internal/console/economicsview.go +582 −0
  • internal/console/economicsview_test.go +267 −0
  • internal/console/server.go +363 −0
  • internal/console/store.go +24 −0
  • internal/console/templates/economics.html +739 −0
  • internal/console/templates/economics_accounts.html +172 −0
  • internal/console/templates/layout.html +22 −0
  • internal/console/view_test.go +12 −0
  • internal/domains/aliases.go +74 −0
  • internal/domains/aliases_test.go +245 −0
  • internal/domains/claims.go +251 −0
  • internal/domains/claims_test.go +256 −0
  • internal/domains/reconcile.go +43 −10
  • internal/domains/reconcile_test.go +77 −0
  • internal/economics/bill.go +31 −0
  • internal/economics/bill_test.go +28 −0
  • internal/economics/compute.go +153 −0
  • internal/economics/compute_test.go +107 −0
  • internal/economics/scenario.go +161 −0
  • internal/economics/scenario_test.go +60 −0
  • internal/edge/alias_test.go +277 −0
  • internal/edge/edge.go +64 −3
  • internal/edge/edge_test.go +70 −0
  • internal/edge/storedoor.go +43 −7
  • internal/edge/storedoor_test.go +20 −0
  • internal/edge/usagemeter.go +84 −0
  • internal/edge/usagemeter_test.go +66 −0
  • internal/edge/wildcard.go +111 −24
  • internal/edge/wildcard_test.go +134 −11
  • internal/host/agent.go +27 −3
  • internal/host/usage_loop.go +55 −0
  • internal/host/usage_loop_test.go +48 −0
  • internal/objstore/aws.go +21 −4
  • internal/registry/registry.go +121 −3
  • internal/registry/registry_test.go +186 −0
  • internal/release/store.go +82 −0
  • internal/release/store_test.go +26 −0
  • internal/status/snapshot.go +61 −9
  • internal/status/status_test.go +38 −0
  • internal/usage/census.go +23 −0
  • internal/usage/edge.go +100 −0
  • internal/usage/edge_test.go +80 −0
  • internal/usage/passes_test.go +70 −0
  • internal/usage/statement.go +78 −0
  • internal/usage/storage.go +24 −0
  • internal/usage/usage.go +33 −0
  • logs.go +2 −2
  • main.go +16 −0
  • restart.go +1 −1
  • retention.go +1 −1
  • store.go +6 −5
  • update.go +358 −0
  • update_test.go +261 −0
account_choose.go

Loading diff…

account_choose_test.go

Loading diff…

accounts.go

Loading diff…

accounts_list_test.go

Loading diff…

accounts_resolve_test.go

Loading diff…

apimode.go

Loading diff…

apimode_test.go

Loading diff…

appconfig_cli.go

Loading diff…

apps.go

Loading diff…

auth.go

Loading diff…

auth_test.go

Loading diff…

cli.go

Loading diff…

cmd/console/main.go

Loading diff…

config.go

Loading diff…

config_test.go

Loading diff…

deploy.go

Loading diff…

docs/superpowers/plans/2026-08-11-unit-economics.md

Loading diff…

docs/superpowers/plans/2026-08-12-account-default-resolution.md

Loading diff…

docs/superpowers/plans/2026-08-12-delegated-wildcard-certs.md

Loading diff…

docs/superpowers/plans/2026-08-12-route-extra-hostnames.md

Loading diff…

docs/superpowers/plans/2026-08-12-woodstar-w0-relay-fanout.md

Loading diff…

docs/superpowers/specs/2026-08-11-unit-economics-design.md

Loading diff…

docs/superpowers/specs/2026-08-12-account-default-resolution-design.md

Loading diff…

docs/superpowers/specs/2026-08-12-proactive-cli-design.md

Loading diff…

docs/superpowers/specs/2026-08-12-route-extra-hostnames-design.md

Loading diff…

docs/superpowers/specs/2026-08-12-woodstar-carloku-migration-design.md

Loading diff…

domains_cli.go

Loading diff…

domains_cli_test.go

Loading diff…

economics.go

Loading diff…

economics_test.go

Loading diff…

fleets.go

Loading diff…

go.mod

Loading diff…

go.sum

Loading diff…

infra/modules/region-host/main.tf

Loading diff…

infra/modules/region-host/variables.tf

Loading diff…

instances_cli.go

Loading diff…

internal/console/apidomains.go

Loading diff…

internal/console/apidomains_test.go

Loading diff…

internal/console/authcli.go

Loading diff…

internal/console/cepull.go

Loading diff…

internal/console/cepull_test.go

Loading diff…

internal/console/econlistquery.go

Loading diff…

internal/console/econlistquery_test.go

Loading diff…

internal/console/economicsbill_test.go

Loading diff…

internal/console/economicspage_test.go

Loading diff…

internal/console/economicspass.go

Loading diff…

internal/console/economicspass_test.go

Loading diff…

internal/console/economicsview.go

Loading diff…

internal/console/economicsview_test.go

Loading diff…

internal/console/server.go

Loading diff…

internal/console/store.go

Loading diff…

internal/console/templates/economics.html

Loading diff…

internal/console/templates/economics_accounts.html

Loading diff…

internal/console/templates/layout.html

Loading diff…

internal/console/view_test.go

Loading diff…

internal/domains/aliases.go

Loading diff…

internal/domains/aliases_test.go

Loading diff…

internal/domains/claims.go

Loading diff…

internal/domains/claims_test.go

Loading diff…

internal/domains/reconcile.go

Loading diff…

internal/domains/reconcile_test.go

Loading diff…

internal/economics/bill.go

Loading diff…

internal/economics/bill_test.go

Loading diff…

internal/economics/compute.go

Loading diff…

internal/economics/compute_test.go

Loading diff…

internal/economics/scenario.go

Loading diff…

internal/economics/scenario_test.go

Loading diff…

internal/edge/alias_test.go

Loading diff…

internal/edge/edge.go

Loading diff…

internal/edge/edge_test.go

Loading diff…

internal/edge/storedoor.go

Loading diff…

internal/edge/storedoor_test.go

Loading diff…

internal/edge/usagemeter.go

Loading diff…

internal/edge/usagemeter_test.go

Loading diff…

internal/edge/wildcard.go

Loading diff…

internal/edge/wildcard_test.go

Loading diff…

internal/host/agent.go

Loading diff…

internal/host/usage_loop.go

Loading diff…

internal/host/usage_loop_test.go

Loading diff…

internal/objstore/aws.go

Loading diff…

internal/registry/registry.go

Loading diff…

internal/registry/registry_test.go

Loading diff…

internal/release/store.go

Loading diff…

internal/release/store_test.go

Loading diff…

internal/status/snapshot.go

Loading diff…

internal/status/status_test.go

Loading diff…

internal/usage/census.go

Loading diff…

internal/usage/edge.go

Loading diff…

internal/usage/edge_test.go

Loading diff…

internal/usage/passes_test.go

Loading diff…

internal/usage/statement.go

Loading diff…

internal/usage/storage.go

Loading diff…

internal/usage/usage.go

Loading diff…

logs.go

Loading diff…

main.go

Loading diff…

restart.go

Loading diff…

retention.go

Loading diff…

store.go

Loading diff…

update.go

Loading diff…

update_test.go

Loading diff…