carlos / platform Public

edge: fleet boxes list only their own domain claims (hunt H5-M8)

A fleet token could list every account's claimed hostnames, pending
ones included. The store door's claim listing now returns only the
caller's own claims. Fleet-derived alias rows never reach platform
edges, so a fleet can serve a name only to traffic that name's DNS
sends it (reasoning in serveClaimListing).
- one claim refresh at a time, admission capped per edge and per
  account (503 via the shared Unavailable path, Retry-After 2);
- a changed claim that cannot be re-read fails the listing (502)
  instead of being left out.
Reviewed by Astra and Fable 5.2 over three rounds (census APPROVE).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from sec-h5-m8-fleet-hostnames into main.
claude agent, operated by paul@keymail.dev 75231bfde57a92e2bc35d0ce9300edf2a2decc42 parent e4bd27f
12 files changed, +1,022 −74
  • docs/superpowers/notes/census-proposal-sec-h5-m8-fleet-hostnames.md +19 −0
  • internal/console/domaincatchall.go +9 −1
  • internal/domains/aliases.go +6 −4
  • internal/domains/claims.go +7 −6
  • internal/edge/fleetapi_e2e_test.go +70 −30
  • internal/edge/hunt_H5-M8_test.go +55 −0
  • internal/edge/storedoor.go +74 −25
  • internal/edge/storedoor_claims.go +280 −0
  • internal/edge/storedoor_claims_test.go +486 −0
  • internal/edge/storedoor_test.go +9 −8
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv +6 −0

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-8dJ6wY
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading golang.org/x/net v0.62.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading golang.org/x/text v0.43.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== launchctx (4 s, from +0 s)
ok  	amadan.net/carlos/platform.git/launchctx	0.016s
?   	amadan.net/carlos/platform.git/launchctx/controlname	[no test files]
?   	amadan.net/carlos/platform.git/launchctx/wireid	[no test files]
=== vet (173 s, from +0 s)
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
=== vet-tags (167 s, from +0 s)
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (378 s, from +14 s)
ok  	github.com/carlosframework/platform/cmd/carlos-media	122.606s
?   	github.com/carlosframework/platform/cmd/changelog	[no test files]
ok  	github.com/carlosframework/platform/cmd/console	205.365s
ok  	github.com/carlosframework/platform/cmd/mediaimage	37.124s
ok  	github.com/carlosframework/platform/cmd/moveprobe	15.216s
ok  	github.com/carlosframework/platform/cmd/pricebook-export	0.081s
ok  	github.com/carlosframework/platform/cmd/rootfswitness	0.167s
ok  	github.com/carlosframework/platform/cmd/runsc-assets	0.229s
ok  	github.com/carlosframework/platform/cmd/zddprobe	0.947s
ok  	github.com/carlosframework/platform/internal/agentsock	0.067s
ok  	github.com/carlosframework/platform/internal/alerting	0.034s
ok  	github.com/carlosframework/platform/internal/analytics	0.457s
ok  	github.com/carlosframework/platform/internal/appconfig	38.521s
ok  	github.com/carlosframework/platform/internal/apperr	0.569s
ok  	github.com/carlosframework/platform/internal/applog	3.802s
ok  	github.com/carlosframework/platform/internal/apppolicy	2.146s
ok  	github.com/carlosframework/platform/internal/assetcache	0.936s
ok  	github.com/carlosframework/platform/internal/awsinv	0.016s
ok  	github.com/carlosframework/platform/internal/awsmanaged	10.354s
ok  	github.com/carlosframework/platform/internal/awsregiongroup	1.159s
ok  	github.com/carlosframework/platform/internal/awsterminations	0.024s
ok  	github.com/carlosframework/platform/internal/backupswords	0.023s
ok  	github.com/carlosframework/platform/internal/billing	0.118s
ok  	github.com/carlosframework/platform/internal/billing/billingtest	0.059s
ok  	github.com/carlosframework/platform/internal/billingstripe	1.860s
ok  	github.com/carlosframework/platform/internal/boxchoice	0.034s
ok  	github.com/carlosframework/platform/internal/boxid	2.055s
?   	github.com/carlosframework/platform/internal/boxid/boxidtest	[no test files]
?   	github.com/carlosframework/platform/internal/boxid/internal/signtest	[no test files]
ok  	github.com/carlosframework/platform/internal/boxroles	0.022s
ok  	github.com/carlosframework/platform/internal/boxself	0.355s
ok  	github.com/carlosframework/platform/internal/boxvolumes	0.039s
ok  	github.com/carlosframework/platform/internal/caps	3.446s
ok  	github.com/carlosframework/platform/internal/certwarm	0.011s
ok  	github.com/carlosframework/platform/internal/cgroup	1.503s
ok  	github.com/carlosframework/platform/internal/changelog	3.575s
ok  	github.com/carlosframework/platform/internal/clamd	0.084s
?   	github.com/carlosframework/platform/internal/cliflag	[no test files]
ok  	github.com/carlosframework/platform/internal/clireg	0.008s
ok  	github.com/carlosframework/platform/internal/codehealth	14.685s
ok  	github.com/carlosframework/platform/internal/compute	0.040s
ok  	github.com/carlosframework/platform/internal/consolefleet	0.016s
?   	github.com/carlosframework/platform/internal/controlname	[no test files]
?   	github.com/carlosframework/platform/internal/controlsock	[no test files]
ok  	github.com/carlosframework/platform/internal/dbdoor	11.103s
ok  	github.com/carlosframework/platform/internal/dbdoor/dbdoortest	0.029s
ok  	github.com/carlosframework/platform/internal/dbquery	0.047s
ok  	github.com/carlosframework/platform/internal/dbreads	3.037s
?   	github.com/carlosframework/platform/internal/dbreads/dbreadstest	[no test files]
ok  	github.com/carlosframework/platform/internal/dbverify	0.025s
ok  	github.com/carlosframework/platform/internal/demo	0.018s
ok  	github.com/carlosframework/platform/internal/demobuild	4.190s
ok  	github.com/carlosframework/platform/internal/democlaim	0.486s
ok  	github.com/carlosframework/platform/internal/devbox	12.962s
ok  	github.com/carlosframework/platform/internal/dnsrec	0.010s
ok  	github.com/carlosframework/platform/internal/docsite	0.259s
ok  	github.com/carlosframework/platform/internal/domainreg	0.036s
ok  	github.com/carlosframework/platform/internal/domains	65.564s
ok  	github.com/carlosframework/platform/internal/doorkey	0.029s
ok  	github.com/carlosframework/platform/internal/economics	0.017s
ok  	github.com/carlosframework/platform/internal/edgefence	0.152s
ok  	github.com/carlosframework/platform/internal/edgeguard	0.242s
?   	github.com/carlosframework/platform/internal/edgeproof	[no test files]
ok  	github.com/carlosframework/platform/internal/edgesfile	0.205s
ok  	github.com/carlosframework/platform/internal/egressaddr	0.006s
ok  	github.com/carlosframework/platform/internal/execsandbox	96.387s
ok  	github.com/carlosframework/platform/internal/fileacl	0.014s
ok  	github.com/carlosframework/platform/internal/fleetapi	2.011s
ok  	github.com/carlosframework/platform/internal/fleetstore	0.015s
ok  	github.com/carlosframework/platform/internal/fxrate	0.053s
ok  	github.com/carlosframework/platform/internal/gate	4.264s
ok  	github.com/carlosframework/platform/internal/genselect	0.139s
ok  	github.com/carlosframework/platform/internal/geo	0.042s
ok  	github.com/carlosframework/platform/internal/geoip	0.120s
ok  	github.com/carlosframework/platform/internal/groupadmission	0.025s
ok  	github.com/carlosframework/platform/internal/grouprollaws	16.832s
ok  	github.com/carlosframework/platform/internal/hadeparture	0.047s
ok  	github.com/carlosframework/platform/internal/hafresh	0.008s
ok  	github.com/carlosframework/platform/internal/hairpin	0.199s
ok  	github.com/carlosframework/platform/internal/historyreadback	1.117s
ok  	github.com/carlosframework/platform/internal/hostactors	21.601s
ok  	github.com/carlosframework/platform/internal/hostbox	18.443s
ok  	github.com/carlosframework/platform/internal/hostclaim	2.702s
ok  	github.com/carlosframework/platform/internal/hostenv	0.033s
ok  	github.com/carlosframework/platform/internal/hostevidence	0.030s
ok  	github.com/carlosframework/platform/internal/hostexec	20.998s
ok  	github.com/carlosframework/platform/internal/hostfence	0.136s
ok  	github.com/carlosframework/platform/internal/hostfiles	22.906s
ok  	github.com/carlosframework/platform/internal/hostfloor	0.382s
ok  	github.com/carlosframework/platform/internal/hostguard	1.451s
ok  	github.com/carlosframework/platform/internal/hostops	5.906s
?   	github.com/carlosframework/platform/internal/hostops/fencerelease	[no test files]
ok  	github.com/carlosframework/platform/internal/hostops/internal/fencerelease	0.008s
ok  	github.com/carlosframework/platform/internal/hostquarantine	0.009s
ok  	github.com/carlosframework/platform/internal/hostrelocate	1.765s
ok  	github.com/carlosframework/platform/internal/hostresolve	0.431s
ok  	github.com/carlosframework/platform/internal/hostwrite	0.008s
ok  	github.com/carlosframework/platform/internal/infraview	0.006s
ok  	github.com/carlosframework/platform/internal/ingresshealth	0.007s
ok  	github.com/carlosframework/platform/internal/ingresshealth/awstg	0.007s
ok  	github.com/carlosframework/platform/internal/instancectl	66.161s
ok  	github.com/carlosframework/platform/internal/instanceexec	8.925s
ok  	github.com/carlosframework/platform/internal/instancefs	12.541s
ok  	github.com/carlosframework/platform/internal/instancekey	0.008s
ok  	github.com/carlosframework/platform/internal/instanceupdates	0.030s
ok  	github.com/carlosframework/platform/internal/interactive	0.620s
ok  	github.com/carlosframework/platform/internal/launchd	0.010s
ok  	github.com/carlosframework/platform/internal/layout	18.077s
ok  	github.com/carlosframework/platform/internal/layout/pubclass	98.008s
ok  	github.com/carlosframework/platform/internal/lbhealth	0.011s
ok  	github.com/carlosframework/platform/internal/lease	144.809s
ok  	github.com/carlosframework/platform/internal/lease/leasetest	1.304s
ok  	github.com/carlosframework/platform/internal/lease/locktest	0.019s
ok  	github.com/carlosframework/platform/internal/ledger	0.081s
ok  	github.com/carlosframework/platform/internal/mail	1.016s
ok  	github.com/carlosframework/platform/internal/mailer	0.808s
ok  	github.com/carlosframework/platform/internal/mailsubmit	1.143s
ok  	github.com/carlosframework/platform/internal/mailwire	0.016s
ok  	github.com/carlosframework/platform/internal/maintenance	0.199s
ok  	github.com/carlosframework/platform/internal/maintenanceexec	8.261s
ok  	github.com/carlosframework/platform/internal/maintenanceguard	0.312s
ok  	github.com/carlosframework/platform/internal/managedboot	3.365s
?   	github.com/carlosframework/platform/internal/managedboot/boottest	[no test files]
?   	github.com/carlosframework/platform/internal/managedboot/roottest	[no test files]
ok  	github.com/carlosframework/platform/internal/media	1.708s
ok  	github.com/carlosframework/platform/internal/media/mediatest	0.013s
ok  	github.com/carlosframework/platform/internal/mediaaws	58.353s
ok  	github.com/carlosframework/platform/internal/mediahandler	40.149s
ok  	github.com/carlosframework/platform/internal/mediajobs	0.886s
ok  	github.com/carlosframework/platform/internal/medialocal	9.713s
ok  	github.com/carlosframework/platform/internal/metrics	0.155s
ok  	github.com/carlosframework/platform/internal/minorunits	0.010s
ok  	github.com/carlosframework/platform/internal/moves	50.489s
ok  	github.com/carlosframework/platform/internal/moves/archive	1.848s
ok  	github.com/carlosframework/platform/internal/moves/offlinerun	0.071s
ok  	github.com/carlosframework/platform/internal/namedunits	0.034s
ok  	github.com/carlosframework/platform/internal/objstore	1.906s
ok  	github.com/carlosframework/platform/internal/ops	12.307s
ok  	github.com/carlosframework/platform/internal/pageindex	3.853s
ok  	github.com/carlosframework/platform/internal/parity	0.099s
?   	github.com/carlosframework/platform/internal/parity/cmd/parity-doc	[no test files]
ok  	github.com/carlosframework/platform/internal/park	0.653s
ok  	github.com/carlosframework/platform/internal/perf	0.195s
ok  	github.com/carlosframework/platform/internal/plans	0.121s
ok  	github.com/carlosframework/platform/internal/privatefile	0.010s
ok  	github.com/carlosframework/platform/internal/provision	227.206s
ok  	github.com/carlosframework/platform/internal/proxyproto	0.938s
ok  	github.com/carlosframework/platform/internal/publicrelease	0.061s
ok  	github.com/carlosframework/platform/internal/ratelimit	0.293s
ok  	github.com/carlosframework/platform/internal/regionlabel	0.052s
ok  	github.com/carlosframework/platform/internal/regionname	0.034s
ok  	github.com/carlosframework/platform/internal/registrar	0.006s
ok  	github.com/carlosframework/platform/internal/registrar/openprovider	0.528s
?   	github.com/carlosframework/platform/internal/registrar/registrartest	[no test files]
ok  	github.com/carlosframework/platform/internal/registry	79.779s
ok  	github.com/carlosframework/platform/internal/relay	7.465s
ok  	github.com/carlosframework/platform/internal/release	125.079s
?   	github.com/carlosframework/platform/internal/release/requestwitness	[no test files]
ok  	github.com/carlosframework/platform/internal/replicagen	0.019s
ok  	github.com/carlosframework/platform/internal/replicas	0.090s
ok  	github.com/carlosframework/platform/internal/reqrec	6.142s
ok  	github.com/carlosframework/platform/internal/rollout	10.527s
ok  	github.com/carlosframework/platform/internal/rolloutwords	0.063s
ok  	github.com/carlosframework/platform/internal/rootaws	95.928s
ok  	github.com/carlosframework/platform/internal/rootfsimage	0.919s
ok  	github.com/carlosframework/platform/internal/rootparticipation	0.112s
ok  	github.com/carlosframework/platform/internal/rootstate	0.037s
ok  	github.com/carlosframework/platform/internal/runs	0.746s
ok  	github.com/carlosframework/platform/internal/s3compat	0.026s
ok  	github.com/carlosframework/platform/internal/s3fake	1.232s
ok  	github.com/carlosframework/platform/internal/s3meter	0.670s
ok  	github.com/carlosframework/platform/internal/safefile	0.021s
ok  	github.com/carlosframework/platform/internal/schedule	22.300s
ok  	github.com/carlosframework/platform/internal/seeds	0.052s
ok  	github.com/carlosframework/platform/internal/share	0.053s
ok  	github.com/carlosframework/platform/internal/sim/litestreamfacts	5.222s
ok  	github.com/carlosframework/platform/internal/sim/mediajobs	49.395s
ok  	github.com/carlosframework/platform/internal/sim/regionha	21.463s
ok  	github.com/carlosframework/platform/internal/status	0.392s
ok  	github.com/carlosframework/platform/internal/steering	0.172s
ok  	github.com/carlosframework/platform/internal/stopevidence	0.401s
ok  	github.com/carlosframework/platform/internal/storecfg	0.333s
ok  	github.com/carlosframework/platform/internal/svcrole	0.008s
ok  	github.com/carlosframework/platform/internal/systemd	5.506s
?   	github.com/carlosframework/platform/internal/systemdshow	[no test files]
ok  	github.com/carlosframework/platform/internal/team	3.091s
ok  	github.com/carlosframework/platform/internal/teamcontract	0.178s
ok  	github.com/carlosframework/platform/internal/telemetry	0.027s
ok  	github.com/carlosframework/platform/internal/termfence	2.816s
ok  	github.com/carlosframework/platform/internal/timerspec	0.019s
ok  	github.com/carlosframework/platform/internal/tsidentity	4.177s
ok  	github.com/carlosframework/platform/internal/tunnelclient	0.388s
ok  	github.com/carlosframework/platform/internal/unixdial	0.012s
ok  	github.com/carlosframework/platform/internal/updatewords	0.034s
ok  	github.com/carlosframework/platform/internal/upstreamguard	0.015s
?   	github.com/carlosframework/platform/internal/upstreamguard/guardtest	[no test files]
ok  	github.com/carlosframework/platform/internal/usage	0.177s
ok  	github.com/carlosframework/platform/internal/version	0.009s
ok  	github.com/carlosframework/platform/internal/vet	2.825s
ok  	github.com/carlosframework/platform/internal/zonehost	0.030s
ok  	github.com/carlosframework/platform/internal/zonehost/route53zones	0.059s
?   	github.com/carlosframework/platform/internal/zonehost/zonehosttest	[no test files]
?   	github.com/carlosframework/platform/scripts/gitleaks-gate	[no test files]
ok  	github.com/carlosframework/platform/scripts/govulncheck-gate	0.026s
ok  	github.com/carlosframework/platform/scripts/pathmapcheck	0.102s
ok  	github.com/carlosframework/platform/scripts/region-ha-g2/fixture	5.183s
ok  	github.com/carlosframework/platform/scripts/stateless-replicas-drill	1.189s
ok  	github.com/carlosframework/platform/scripts/witness-pointer	0.028s
=== cutover-witness (157 s, from +14 s)
ok  	github.com/carlosframework/platform	4.061s
=== internal_grouproll@0 (271 s, from +72 s)
ok  	github.com/carlosframework/platform/internal/grouproll	269.600s
=== internal_grouproll@1 (277 s, from +72 s)
ok  	github.com/carlosframework/platform/internal/grouproll	275.335s
=== internal_activator@0 (148 s, from +145 s)
ok  	github.com/carlosframework/platform/internal/activator	143.494s
=== internal_activator@1 (127 s, from +145 s)
ok  	github.com/carlosframework/platform/internal/activator	122.807s
=== internal_activator@2 (137 s, from +145 s)
ok  	github.com/carlosframework/platform/internal/activator	132.324s
=== internal_activator@3 (165 s, from +145 s)
ok  	github.com/carlosframework/platform/internal/activator	160.893s
=== internal_edge@0 (199 s, from +165 s)
ok  	github.com/carlosframework/platform/internal/edge	191.617s
=== internal_edge@1 (146 s, from +165 s)
ok  	github.com/carlosframework/platform/internal/edge	137.860s
=== internal_edge@2 (150 s, from +165 s)
ok  	github.com/carlosframework/platform/internal/edge	140.896s
=== internal_edge@3 (222 s, from +165 s)
ok  	github.com/carlosframework/platform/internal/edge	213.529s
=== root@0 (133 s, from +170 s)
ok  	github.com/carlosframework/platform	124.684s
=== root@1 (109 s, from +170 s)
ok  	github.com/carlosframework/platform	99.026s
=== root@2 (124 s, from +170 s)
ok  	github.com/carlosframework/platform	115.204s
=== root@3 (118 s, from +170 s)
ok  	github.com/carlosframework/platform	109.548s
=== root@4 (109 s, from +170 s)
ok  	github.com/carlosframework/platform	100.821s
=== internal_host@0 (169 s, from +215 s)
ok  	github.com/carlosframework/platform/internal/host	164.584s
=== internal_host@1 (156 s, from +215 s)
ok  	github.com/carlosframework/platform/internal/host	150.783s
=== internal_host@2 (148 s, from +215 s)
ok  	github.com/carlosframework/platform/internal/host	143.107s
=== internal_host@3 (197 s, from +215 s)
ok  	github.com/carlosframework/platform/internal/host	192.002s
=== internal_host@4 (241 s, from +216 s)
ok  	github.com/carlosframework/platform/internal/host	236.753s
=== internal_host@5 (264 s, from +216 s)
ok  	github.com/carlosframework/platform/internal/host	260.029s
=== internal_console@0 (169 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	161.446s
=== internal_console@1 (183 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	175.445s
=== internal_console@2 (214 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	207.300s
=== internal_console@3 (257 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	249.303s
=== internal_console@4 (202 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	194.632s
=== internal_console@5 (247 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	239.639s
=== internal_console@6 (235 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	228.354s
=== internal_console@7 (218 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	210.918s
=== internal_console@8 (257 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	249.884s
=== internal_console@9 (224 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	218.390s
=== internal_console@10 (245 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	237.881s
=== internal_console@11 (242 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	234.676s
=== internal_console@12 (318 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	311.993s
=== internal_console@13 (220 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	211.803s
=== internal_console@14 (213 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	205.679s
=== internal_console@15 (247 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	241.069s
=== internal_console@16 (252 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	245.572s
=== internal_console@17 (221 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	213.287s
=== internal_console@18 (212 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	205.045s
=== internal_console@19 (212 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	205.215s
=== internal_console@20 (255 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	248.195s
=== internal_console@21 (265 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	258.291s
=== internal_console@22 (261 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	253.427s
=== internal_console@23 (245 s, from +224 s)
ok  	github.com/carlosframework/platform/internal/console	237.470s
=== lists: internal_console 223 s, internal_edge 163 s, internal_activator 144 s, internal_host 215 s, root 169 s, internal_grouproll 72 s
=== cpu: the gate used 12970 cpu-seconds in 542 s, about 23.9 of 32 cores; the machine as a whole was 80% busy
=== opentofu ===
opentofu: 39 test files in 11 suites, OpenTofu v1.13.9
  initialised in 15 s
  ok      18 s  infra/modules/box-fence-writer/tests/writer.tftest.hcl  Success! 1 passed, 0 failed.
  ok      17 s  infra/modules/deployment-buckets/tests/console_floors.tftest.hcl  Success! 1 passed, 0 failed.
  ok      25 s  infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      14 s  infra/modules/deployment-buckets/tests/db_reads.tftest.hcl  Success! 1 passed, 0 failed.
  ok      12 s  infra/modules/deployment-buckets/tests/evidence.tftest.hcl  Success! 1 passed, 0 failed.
  ok      26 s  infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl  Success! 3 passed, 0 failed.
  ok      23 s  infra/modules/deployment-buckets/tests/media_results.tftest.hcl  Success! 2 passed, 0 failed.
  ok      85 s  infra/modules/media-engine/tests/media_engine.tftest.hcl  Success! 24 passed, 0 failed.
  ok      30 s  infra/modules/pdf-host/tests/computed.tftest.hcl  Success! 2 passed, 0 failed.
  ok      60 s  infra/modules/pdf-host/tests/pdf_host.tftest.hcl  Success! 24 passed, 0 failed.
  ok      42 s  infra/modules/region-group-operator-document/tests/document.tftest.hcl  Success! 12 passed, 0 failed.
  ok      19 s  infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl  Success! 2 passed, 0 failed.
  ok      64 s  infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl  Success! 30 passed, 0 failed.
  ok      46 s  infra/modules/region-host/tests/alert_publish.tftest.hcl  Success! 18 passed, 0 failed.
  ok      44 s  infra/modules/region-host/tests/alerts_topic.tftest.hcl  Success! 16 passed, 0 failed.
  ok      14 s  infra/modules/region-host/tests/analytics_prune.tftest.hcl  Success! 2 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/console_mail.tftest.hcl  Success! 4 passed, 0 failed.
  ok       7 s  infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl  Success! 1 passed, 0 failed.
  ok      71 s  infra/modules/region-host/tests/group.tftest.hcl  Success! 32 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/group_alarms.tftest.hcl  Success! 4 passed, 0 failed.
  ok      11 s  infra/modules/region-host/tests/group_iam.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/group_isolation.tftest.hcl  Success! 1 passed, 0 failed.
  ok      36 s  infra/modules/region-host/tests/group_operator.tftest.hcl  Success! 13 passed, 0 failed.
  ok       8 s  infra/modules/region-host/tests/group_user_data.tftest.hcl  Success! 3 passed, 0 failed.
  ok      29 s  infra/modules/region-host/tests/health_alarms.tftest.hcl  Success! 10 passed, 0 failed.
  ok      13 s  infra/modules/region-host/tests/ingress_drain_read.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/instance_metadata.tftest.hcl  Success! 1 passed, 0 failed.
  ok      24 s  infra/modules/region-host/tests/mailer.tftest.hcl  Success! 6 passed, 0 failed.
  ok      13 s  infra/modules/region-host/tests/mailer_group.tftest.hcl  Success! 2 passed, 0 failed.
  ok      13 s  infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl  Success! 2 passed, 0 failed.
  ok     105 s  infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl  Success! 46 passed, 0 failed.
  ok      67 s  infra/modules/region-host/tests/store_conversion.tftest.hcl  Success! 27 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/store_scanning.tftest.hcl  Success! 4 passed, 0 failed.
  ok      31 s  infra/modules/region-host/tests/store_versioning.tftest.hcl  Success! 11 passed, 0 failed.
  ok      14 s  infra/modules/region-host/tests/store_write_credentials.tftest.hcl  Success! 4 passed, 0 failed.
  ok      17 s  infra/modules/region-host/tests/user_data_ignored.tftest.hcl  Success! 3 passed, 0 failed.
  ok      10 s  infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      17 s  infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl  Success! 5 passed, 0 failed.
  ok      27 s  infra/modules/scanner-host/tests/scanner_host.tftest.hcl  Success! 14 passed, 0 failed.
opentofu: 39 files in 208 s
opentofu: PASS
=== cross ===
--- shard 0 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/arm64
--- shard 1 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/amd64
--- shard 2 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling linux/arm64
linux/arm64 carlos binary: 66781346 bytes (ceiling 70000000)
--- shard 3 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/amd64
--- shard 4 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/arm64
=== minio-contract ===
go version go1.26.10 linux/arm64
minio contract: arm64, minio RELEASE.2025-09-07T16-13-09Z, mc RELEASE.2025-08-13T08-35-41Z
  minio: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/minio.linux-arm64.RELEASE.2025-09-07T16-13-09Z
  minio: downloaded, digest verified
  mc: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/mc.linux-arm64.RELEASE.2025-08-13T08-35-41Z
  mc: downloaded, digest verified
  minio healthy on 127.0.0.1:37343
Added `local` successfully.
Bucket created successfully `local/contract-bucket`.
Bucket created successfully `local/denied-bucket`.
Created policy `contract-only` successfully.
Added user `scopeduser` successfully.
Attached Policies: [contract-only]
To User: scopeduser
  buckets and scoped user ready
=== RUN   TestDeliveredContractMinio
=== RUN   TestDeliveredContractMinio/put
=== RUN   TestDeliveredContractMinio/get_round-trips_the_body
=== RUN   TestDeliveredContractMinio/list_shows_the_key
=== RUN   TestDeliveredContractMinio/head_and_list_agree_on_the_version
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed
=== RUN   TestDeliveredContractMinio/delete_removes_it
=== RUN   TestDeliveredContractMinio/cross-bucket_denial
--- PASS: TestDeliveredContractMinio (0.03s)
    --- PASS: TestDeliveredContractMinio/put (0.00s)
    --- PASS: TestDeliveredContractMinio/get_round-trips_the_body (0.00s)
    --- PASS: TestDeliveredContractMinio/list_shows_the_key (0.00s)
    --- PASS: TestDeliveredContractMinio/head_and_list_agree_on_the_version (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route (0.01s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed (0.00s)
    --- PASS: TestDeliveredContractMinio/delete_removes_it (0.00s)
    --- PASS: TestDeliveredContractMinio/cross-bucket_denial (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.037s
=== RUN   TestT4StorageProbeMinio
2026/11/30 16:43:02 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18ECE04F3678DF0B, HostID: c457af856c4a71ff64902512f16ef4a7b826b5aa955dd7e60812589de2ec57af, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
--- PASS: TestT4StorageProbeMinio (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/host	0.045s
=== RUN   TestS3StoreMinioContract
=== RUN   TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN   TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.03s)
    --- PASS: TestS3StoreMinioContract/conditional_get_and_etag_listing (0.01s)
    --- PASS: TestS3StoreMinioContract/bump_through_every_mutation_path (0.02s)
PASS
ok  	github.com/carlosframework/platform/internal/release	0.043s
Bucket created successfully `local/analytics-versions`.
local/analytics-versions versioning is enabled
Created policy `analytics-versions` successfully.
Added user `analyticsversions` successfully.
Attached Policies: [analytics-versions]
To User: analyticsversions
=== RUN   TestS3StoreMinioVersions
--- PASS: TestS3StoreMinioVersions (0.03s)
PASS
ok  	github.com/carlosframework/platform/internal/release	0.040s
Bucket created successfully `local/store-versioned`.
local/store-versioned versioning is enabled
Created policy `store-versioned` successfully.
Added user `storeversioned` successfully.
Attached Policies: [store-versioned]
To User: storeversioned
=== RUN   TestVersionedContractMinio
--- PASS: TestVersionedContractMinio (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.020s
Bucket created successfully `local/wc-bucket`.
Created policy `writer` successfully.
Added user `wcwriter` successfully.
Attached Policies: [writer]
To User: wcwriter
=== RUN   TestWriteCredentialContractMinio
=== RUN   TestWriteCredentialContractMinio/put_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/multipart_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag
=== RUN   TestWriteCredentialContractMinio/refused:_bucket_settings
=== RUN   TestWriteCredentialContractMinio/refused:_head
=== RUN   TestWriteCredentialContractMinio/refused:_list
=== RUN   TestWriteCredentialContractMinio/refused:_put_outside_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_put_beside_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_put_to_another_bucket
=== RUN   TestWriteCredentialContractMinio/refused:_copy_from_the_store
=== RUN   TestWriteCredentialContractMinio/refused:_read_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_read_elsewhere
=== RUN   TestWriteCredentialContractMinio/refused:_list_uploads
=== RUN   TestWriteCredentialContractMinio/refused:_delete
=== RUN   TestWriteCredentialContractMinio/refused:_tag
=== RUN   TestWriteCredentialContractMinio/refused:_put_tagged
--- PASS: TestWriteCredentialContractMinio (0.04s)
    --- PASS: TestWriteCredentialContractMinio/put_under_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/multipart_under_the_prefix (0.01s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_bucket_settings (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_head (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_list (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_outside_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_beside_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_to_another_bucket (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_copy_from_the_store (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_read_under_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_read_elsewhere (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_list_uploads (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_delete (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_tag (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_tagged (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.048s
=== RUN   TestEndToEndMinio
=== RUN   TestEndToEndMinio/plan
=== RUN   TestEndToEndMinio/roll
=== RUN   TestEndToEndMinio/replace
=== RUN   TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.48s)
    --- PASS: TestEndToEndMinio/plan (0.01s)
    --- PASS: TestEndToEndMinio/roll (0.13s)
    --- PASS: TestEndToEndMinio/replace (0.16s)
    --- PASS: TestEndToEndMinio/remove (0.15s)
PASS
ok  	github.com/carlosframework/platform/internal/grouproll	0.489s
Bucket created successfully `local/dbf-deploy`.
Bucket created successfully `local/dbf-data-ie`.
Bucket created successfully `local/dbf-data-uk`.
local/dbf-deploy versioning is enabled
Created policy `dbf-console` successfully.
Created policy `dbf-ukbox` successfully.
Added user `dbfconsole` successfully.
Added user `dbfukbox` successfully.
Attached Policies: [dbf-console]
To User: dbfconsole
Attached Policies: [dbf-ukbox]
To User: dbfukbox
=== RUN   TestDBForwardMinio
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 16:43:10 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/30 16:43:10 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/30 16:43:10 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 16:43:10 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 16:43:10 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 16:43:11 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/30 16:43:11 console: could not notify member@example.com of a CLI token issue: keymail: lookup member@example.com: keymail: GET /api/federation/lookup?addr=member%40example.com&from=console%40127.0.0.1%3A41637: could not determine target mailbox
    agent.go:136: dbreads: dbr_lklfdo6zxyt7todqsmjph264lu: planned 3 files (1544 bytes) and restored to 3 in 14ms
    agent.go:136: dbreads: dbr_lklfdo6zxyt7todqsmjph264lu: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 16:43:12 console: db read dbr_lklfdo6zxyt7todqsmjph264lu: relayed 1 chunks (102 bytes) in 1.005s, ended done
    agent.go:136: dbreads: dbr_bg4alkb6jywai4ulfbz3agisga: planned 1 files (720 bytes) and restored to 1 in 11ms
    agent.go:136: dbreads: dbr_bg4alkb6jywai4ulfbz3agisga: output 5 bytes in 1 confirmed chunks in 1ms
2026/11/30 16:43:13 console: db read dbr_bg4alkb6jywai4ulfbz3agisga: relayed 1 chunks (102 bytes) in 1.005s, ended done
    agent.go:136: dbreads: dbr_3zlewsmjjofe3t7fls3pqxtldm: planned 3 files (1544 bytes) and held through 3 in 12ms
    agent.go:136: dbreads: dbr_3zlewsmjjofe3t7fls3pqxtldm: output 1544 bytes in 1 confirmed chunks in 3ms
2026/11/30 16:43:14 console: db read dbr_3zlewsmjjofe3t7fls3pqxtldm: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN   TestDBForwardMinio/by_disconnect
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_fs3pdjnjn4mhep6fol5zxwg2ha: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/30 16:43:14 console: db read dbr_fs3pdjnjn4mhep6fol5zxwg2ha: relayed 0 chunks (0 bytes) in 19ms, ended client gone
    agent.go:136: dbreads: dbr_fs3pdjnjn4mhep6fol5zxwg2ha: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN   TestDBForwardMinio/by_timeout
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_mbgtk5lthfc5t4lxpvbbkez3s4: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/30 16:43:34 console: db read dbr_mbgtk5lthfc5t4lxpvbbkez3s4: relayed 0 chunks (0 bytes) in 19.687s, ended no-result
    agent.go:136: dbreads: dbr_mbgtk5lthfc5t4lxpvbbkez3s4: output 5 bytes in 1 confirmed chunks in 19.659s
--- PASS: TestDBForwardMinio (23.36s)
    --- PASS: TestDBForwardMinio/by_disconnect (0.23s)
    --- PASS: TestDBForwardMinio/by_timeout (19.80s)
PASS
ok  	github.com/carlosframework/platform/internal/console	23.409s
Bucket created successfully `local/media-transfers`.
Bucket created successfully `local/media-transfer-results`.
local/media-transfer-results versioning is enabled
Created policy `media-transfers` successfully.
Added user `mediatransfers` successfully.
Attached Policies: [media-transfers]
To User: mediatransfers
=== RUN   TestMediaTransfersMinio
    upload.go:117: codec: the store already holds video.mp4
    upload.go:117: codec: the store already holds video.m3u8
    upload.go:117: codec: the store already holds poster.jpg
--- PASS: TestMediaTransfersMinio (0.07s)
PASS
ok  	github.com/carlosframework/platform/internal/mediaaws	0.075s
Bucket created successfully `local/media-local-store`.
Bucket created successfully `local/media-local-results`.
Created policy `media-local` successfully.
Added user `medialocal` successfully.
Attached Policies: [media-local]
To User: medialocal
=== RUN   TestLocalEndToEndMinio
--- PASS: TestLocalEndToEndMinio (0.55s)
PASS
ok  	github.com/carlosframework/platform/internal/medialocal	0.553s
=== RUN   TestHeldHandoverTwoBoxMinio
2026/11/30 16:43:39 edge: mesh key: minted
2026/11/30 16:43:39 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 16:43:39 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 16:43:39 tenant admission is open. accepting tenant work
2026/11/30 16:43:39 activator: HA placement host=shop-9eaad094.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T16:43:39Z lock_generation=0
2026/11/30 16:43:39 lease: t8-9eaad094/shop-9eaad094.example.test: HA lease acquired in 4ms (first wake)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: started carlos-instance@shop\x2d9eaad094.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 6ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: carlos-instance@shop\x2d9eaad094.example.test.service launched in 7ms, healthy 0s later
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: woke in 20ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 8ms
2026/11/30 16:43:39 lease: t8-9eaad094/plain-9eaad094.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/30 16:43:39 activator: no replica for plain-9eaad094.example.test in s3://contract-bucket/t8-9eaad094/plain-9eaad094.example.test — booting fresh
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: started carlos-instance@plain\x2d9eaad094.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 4ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 2ms)
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: carlos-instance@plain\x2d9eaad094.example.test.service launched in 8ms, healthy 0s later
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: woke in 96ms: checks 0s, lease 2ms, restore 20ms, identity 0s, protect 0s, spawn 8ms, replicate 67ms
2026/11/30 16:43:39 lease: t8-9eaad094/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/30 16:43:39 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 16:43:39 activator: bot0.shop.bac.sidecar.internal: woke in 68ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 57ms
2026/11/30 16:43:39 activator: next-due probe plain-9eaad094.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 16:43:39 activator: plain-9eaad094.example.test hibernated
2026/11/30 16:43:39 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:f6688b6d62acc5c0f74a8333fe3b9562b17e88126fcb1e40d9b8b47c68c1d01c) in 8ms: files 1ms, sync 5ms, record 1ms, marker 2ms
2026/11/30 16:43:39 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/30 16:43:39 activator: next-due probe shop-9eaad094.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: released with a marker (clean true, txid 1, files 3:d97d0401b74d932b38f3c1e23f0631b62b5bc2e372e7c118a0d2768b8791f566) in 5ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/30 16:43:39 activator: shop-9eaad094.example.test hibernated
2026/11/30 16:43:39 lease: t8-9eaad094/shop-9eaad094.example.test: HA lease acquired in 3ms (clean marker)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: restored (other-box)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: started carlos-instance@shop\x2d9eaad094.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 0s, control socket 0s, key gate 0s, logs 0s) 1ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: carlos-instance@shop\x2d9eaad094.example.test.service launched in 2ms, healthy 0s later
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: woke in 85ms: checks 0s, lease 4ms, restore 24ms, identity 0s, protect 0s, spawn 2ms, replicate 55ms
2026/11/30 16:43:39 edge: ha-take shop-9eaad094.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/30 16:43:39 edge: forward shop-9eaad094.example.test: annie handed the request over to betty; sending it there (occurrence #1)
    hadrain_twobox_minio_linux_test.go:1238: drain report: {V:1 Transaction:t8-witness Incarnation:7e800d6fa8bc1744f47a8dcd67d013c7 Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-30 16:43:39.484847905 +0000 UTC FinishedAt:2026-11-30 16:43:39.682480791 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-9eaad094.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:plain-9eaad094.example.test Kind:other Marker:true Clean:true Reason:} {Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:146 Todays:0 RefusedAtOnce:1} Closed:0 Quiet:{DrainQuiet:{Waking:0 Stopping:0 Recovering:0 Owed:0} Held:[]}}
    hadrain_twobox_minio_linux_test.go:1239: driver calls: [begin shop-9eaad094.example.test <nil> stop plain-9eaad094.example.test marker=true clean=true <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> releasing shop-9eaad094.example.test <nil> stop shop-9eaad094.example.test marker=true clean=true <nil> taken shop-9eaad094.example.test betty <nil> end-moves]
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-9eaad094/plain-9eaad094.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/bot0.shop.bac.sidecar.internal/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/head.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/generations/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/files/0/manifest.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/files/0/objects/0000000000000001-f690491134db7f1014f95ba96b5d839874ac76134440e1bc5a59e5c0f387de70
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/files/0/objects/0000000000000003-890c004db19c9360c2aa5bcee318c85c29f157031972e0ed6535175b9d68affa
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/0000/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/0000/0000000000000002-0000000000000002.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-9eaad094/shop-9eaad094.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-9eaad094/shop-9eaad094.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1243: drain took 243ms; S3 calls 43 (DELETE lock=1 GET files=3 GET head=1 GET lock=2 GET replica=2 LIST replica=28 PUT lock=3 PUT replica=3); deployment store calls 20 (GET edges=14 LIST edges=4 PUT edges=2)
    hadrain_twobox_minio_linux_test.go:1367: the fenced A's start gate answers 503 "This service is unavailable. Try again later.\n" (Retry-After "10")
2026/11/30 16:43:39 lease: t8-9eaad094/plain-9eaad094.example.test: acquired in 1ms (client 0s, lock read and write 1ms)
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: started carlos-instance@plain\x2d9eaad094.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 0s, control socket 0s, key gate 0s, logs 0s) 0s, launch file 0s, gate 0s, root start 1ms)
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: carlos-instance@plain\x2d9eaad094.example.test.service launched in 1ms, healthy 0s later
2026/11/30 16:43:39 lease: /tmp/carlos-minio-contract-oolJPL/g/dw1286888511/data/instances/plain-9eaad094.example.test/plain-9eaad094.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/30 16:43:39 activator: plain-9eaad094.example.test: woke in 8ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 0s, spawn 1ms, replicate 4ms
2026/11/30 16:43:39 activator: next-due probe shop-9eaad094.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 16:43:39 activator: shop-9eaad094.example.test: released with a marker (clean true, txid 2, files 3:d97d0401b74d932b38f3c1e23f0631b62b5bc2e372e7c118a0d2768b8791f566) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/30 16:43:39 activator: shop-9eaad094.example.test hibernated
2026/11/30 16:43:39 tenant admission is closed for shutdown
2026/11/30 16:43:39 activator: next-due probe plain-9eaad094.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 16:43:39 activator: plain-9eaad094.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.67s)
=== RUN   TestHeldHandoverLostLeaseMinio
2026/11/30 16:43:39 edge: mesh key: minted
2026/11/30 16:43:39 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 16:43:39 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 16:43:39 tenant admission is open. accepting tenant work
2026/11/30 16:43:39 activator: HA placement host=shop-73b70bd8.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T16:43:39Z lock_generation=0
2026/11/30 16:43:39 lease: t8-73b70bd8/shop-73b70bd8.example.test: HA lease acquired in 3ms (first wake)
2026/11/30 16:43:39 activator: shop-73b70bd8.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 16:43:39 activator: shop-73b70bd8.example.test: started carlos-instance@shop\x2d73b70bd8.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 6ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 16:43:39 activator: shop-73b70bd8.example.test: carlos-instance@shop\x2d73b70bd8.example.test.service launched in 7ms, healthy 0s later
2026/11/30 16:43:39 activator: shop-73b70bd8.example.test: woke in 66ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 54ms
2026/11/30 16:43:40 activator: next-due probe shop-73b70bd8.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 16:43:40 activator: final checkpoint shop-73b70bd8.example.test: lease: release marker owed for s3://contract-bucket/t8-73b70bd8/shop-73b70bd8.example.test/lock.json (If-Match "f41c8a147eaedf2f6db526c68be5e44d"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/30 16:43:40 activator: shop-73b70bd8.example.test hibernated
2026/11/30 16:43:40 activator: handover of shop-73b70bd8.example.test left: released without a marker; its held requests get today's answer
    hadrain_twobox_minio_linux_test.go:1469: the held request's hold ended "shop-73b70bd8.example.test client 4 "
    hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-73b70bd8.example.test <nil> releasing shop-73b70bd8.example.test <nil> stop shop-73b70bd8.example.test marker=false clean=false <nil> left shop-73b70bd8.example.test released without a marker]
    hadrain_twobox_minio_linux_test.go:1487: a request after the loss: 503 "This instance cannot wake right now. Please try again shortly.\n" (Retry-After "10", holder "none", 0s, err <nil>)
2026/11/30 16:43:40 tenant admission is closed for shutdown
2026/11/30 16:43:40 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.32s)
PASS
ok  	github.com/carlosframework/platform/internal/host	1.033s
Bucket created successfully `local/gen-take`.
local/gen-take versioning is enabled
Created policy `gen-take` successfully.
Added user `gentake` successfully.
Attached Policies: [gen-take]
To User: gentake
=== RUN   TestGenerationTakeMinio
=== RUN   TestGenerationTakeMinio/take
2026/11/30 16:43:41 lease: instances/gen-1796057021259212292.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/30 16:43:41 lease: instances/gen-1796057021259212292.shop.example.com: HA lease acquired in 3ms (holder terminated)
    gentake_minio_test.go:308: a second create-only copy onto instances/gen-1796057021259212292.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/30 16:43:41 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/30 16:43:41 http: proxy error: context canceled
2026/11/30 16:43:41 http: proxy error: context canceled
2026/11/30 16:43:41 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: a write has waited too long to reach storage (write fence)"
=== RUN   TestGenerationTakeMinio/switch-412
2026/11/30 16:43:41 lease: instances/gen-1796057021384418493.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 16:43:41 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: fetch ltx files: lease: a write has waited too long to reach storage (write fence)"
2026/11/30 16:43:41 lease: instances/gen-1796057021384418493.shop.example.com: HA lease acquired in 2ms (clean marker)
=== RUN   TestGenerationTakeMinio/copy-version
=== RUN   TestGenerationTakeMinio/store-time
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 4ms (first wake)
2026/11/30 16:43:41 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 3ms (clean marker)
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/30 16:43:41 lease: instances/gen-1796057021434503172.shop.example.com: HA lease acquired in 3ms (unclean marker)
=== RUN   TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.35s)
    --- PASS: TestGenerationTakeMinio/take (0.13s)
    --- PASS: TestGenerationTakeMinio/switch-412 (0.04s)
    --- PASS: TestGenerationTakeMinio/copy-version (0.01s)
    --- PASS: TestGenerationTakeMinio/store-time (0.16s)
    --- PASS: TestGenerationTakeMinio/skew (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/lease	0.357s
minio contract: PASS
=== staticcheck ===
go version go1.26.10 linux/arm64
go: downloading honnef.co/go/tools v0.8.2
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/sync v0.23.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
staticcheck: clean
=== govulncheck ===
go version go1.26.10 linux/arm64
go: downloading golang.org/x/vuln v1.8.0
go: downloading golang.org/x/telemetry v0.0.0-20260908163034-4bcc4b2ee518
go: downloading golang.org/x/tools v0.50.0
govulncheck: scanned github.com/carlosframework/platform, amadan.net/carlos/platform.git/launchctx, carlos-vulnscan
GO-2026-6859  called  stdlib@v1.26.10, fixed in v1.26.11
    HTTP/1 server crash due to MaxBytesReader header race in net/http
    excepted until 2027-01-31 (.amadan/govulncheck-exceptions.tsv:9): net/http MaxBytesReader header race, fixed in go1.26.11. CI and releases stay on go1.26.10 because 1.26.11 deadlocks the edge's Expect: 100-continue path (#897, .amadan/go-toolchain.sh); #904 checked every production MaxBytesReader site and found it unreachable.
GO-2026-5932  required  golang.org/x/crypto@v0.58.0, fixed in v0.58.1-0.20261009181718-2f1f834330b2
    The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues
    not fatal: no call path to the vulnerable code
govulncheck: clean (2 finding(s), none called outside .amadan/govulncheck-exceptions.tsv)
=== code-health ===
go version go1.26.10 linux/arm64
    codehealth_test.go:42: scanned in 1m52.577s
    codehealth_test.go:107: line metrics (code lines, then physical):
          file-lines  5471  7324  internal/activator activator_test.go
          file-lines  4177  7014  internal/console server.go
          file-lines  4128  6292  . apimode.go
          file-lines  3785  7224  internal/activator activator.go
          file-lines  3530  4459  . apimode_test.go
          file-lines  3261  3864  internal/registry registry_test.go
          file-lines  3175  6342  internal/host agent.go
          file-lines  3094  3992  internal/provision reconcile_test.go
          func-lines   870   891  internal/host plan14InstalledClaimLaunch
          func-lines   810  1277  internal/provision Reconcile
          func-lines   769  1242  internal/console (*Server).handleAPIInstanceCreate
          func-lines   683  1238  internal/host runAgent
          func-lines   571   908  internal/activator (*Service).doWakeOnce
          func-lines   538   546  internal/host runServingParkPeerNamespace
          func-lines   519   712  . runRoute
          func-lines   509   569  internal/host TestPagingIsRateLimited
          func-lines   494   817  internal/release adoptHost
          func-lines   441   500  internal/host TestRootInstanceStopExecStop
          func-lines   421   436  internal/host (*ClaimWakeAssembly).Build
          func-lines   421   437  internal/team TestFixture
          func-lines   412   414  internal/console TestDemoProtectionsSourceToLimitAndTakedown
          func-lines   408   485  . TestFleetAppServesThroughTheHub
          func-lines   402   406  internal/registry (*Registry).haJournal
          func-lines   400   868  internal/provision rootReadArchivedChain
          func-lines   399   733  internal/release PassFilter
          func-lines   390   398  internal/host runFilesSeedPreparationWithLive
          func-lines   383   406  internal/console TestDemoSourceToLiveAndUpdate
          func-lines   374   377  internal/host plan14RequiredArtifactsRootRunner
          func-lines   371   417  internal/host TestRootEgressKernelProof
          func-lines   369   883  internal/edge (*Edge).ServeHTTP
          func-lines   367   584  internal/console (*Server).handleAPIShip
          func-lines   364   371  internal/host testRootMigrationBootstrap
          func-lines   360   362  internal/edge TestDemoAPIAliasBoundary
          func-lines   358   629  cmd/console serve
          func-lines   357   358  internal/registry (*Registry).dispatchRemote
          func-lines   355   372  internal/host TestRootSandboxUpdateFromOldBox
          func-lines   343   354  internal/analytics Prune
          func-lines   340   353  internal/host newColdRootHarness
          func-lines   335   557  internal/console (*Store).migrate
          func-lines   334   334  internal/host TestPlan12RecoveryRestoreSourceDatabase
          func-lines   330   371  internal/edge TestRegionalNameNeverLeavesItsRegion
          func-lines   329   471  . runDeploy
          func-lines   329   329  internal/host TestPlan12RecoveryRestoreSourceDatabase.func1
          func-lines   327   369  internal/edge TestTunnelWebSocketEndToEnd
          func-lines   325   455  internal/objstore TestDeliveredContractMinio
          func-lines   320   654  internal/appconfig SyncExecWithCallbacks
          func-lines   315   318  internal/host plan14TimerIntention
          func-lines   311   314  internal/host plan14TimerIntention.func1
          func-lines   310   315  internal/hostbox ColdHandover.Run
          func-lines   308   309  internal/host rootFilesSeedIsolatedWitness
          func-lines   305   323  internal/host hairpinKernelWitness
          func-lines   304   308  internal/console TestHAP2ProductionDoors
          func-lines   302   329  internal/host TestRootG2PoolIngress
        release-importers: . cmd/console internal/activator internal/analytics internal/appconfig internal/apperr internal/applog internal/apppolicy internal/boxid internal/boxvolumes internal/console internal/dbreads internal/dbreads/dbreadstest internal/dbverify internal/demobuild internal/domains internal/doorkey internal/edge internal/edgeproof internal/edgesfile internal/fleetapi internal/grouproll internal/grouprollaws internal/historyreadback internal/host internal/hostactors internal/hostbox internal/hostclaim internal/hostevidence internal/hostexec internal/hostfence internal/hostfiles internal/hostfloor internal/hostguard internal/hostops internal/hostrelocate internal/hostresolve internal/instancectl internal/instanceupdates internal/interactive internal/layout internal/lease internal/ledger internal/mail internal/mailer internal/mailsubmit internal/metrics internal/moves internal/objstore internal/ops internal/park internal/plans internal/provision internal/relay internal/rollout internal/rootfsimage internal/runs internal/s3fake internal/schedule internal/seeds internal/status internal/telemetry internal/usage internal/vet scripts/pathmapcheck scripts/witness-pointer
        not scanned (216 files):
          cmd/carlos-media/drill_other.go: built only for other systems or tags
          cmd/carlos-media/harden_other.go: built only for other systems or tags
          cmd/console/fleetsocket_other.go: built only for other systems or tags
          cmd/console/servelock_windows.go: built only for other systems or tags
          cmd/moveprobe/detach_windows.go: built only for other systems or tags
          cmd/rootfswitness/mmap_other.go: built only for other systems or tags
          devbox_acl_other.go: built only for other systems or tags
          devbox_envfile_darwin_test.go: built only for other systems or tags
          devbox_envfile_other.go: built only for other systems or tags
          domains_transfer_signals_other.go: built only for other systems or tags
          interactive_term_darwin.go: built only for other systems or tags
          interactive_term_other.go: built only for other systems or tags
          internal/activator/claimprocess_root_other.go: built only for other systems or tags
          internal/activator/escrow_stamp_other.go: built only for other systems or tags
          internal/activator/fleetreserve_other.go: built only for other systems or tags
          internal/activator/harecord_other.go: built only for other systems or tags
          internal/activator/ownenv_other.go: built only for other systems or tags
          internal/activator/pty_other.go: built only for other systems or tags
          internal/activator/race_on_test.go: built only for other systems or tags
          internal/activator/rolelaunch_other.go: built only for other systems or tags
          internal/assetcache/statfs_other.go: built only for other systems or tags
          internal/boxself/io_other.go: built only for other systems or tags
          internal/cgroup/cleanup_other.go: built only for other systems or tags
          internal/cgroup/cleanup_other_test.go: built only for other systems or tags
          internal/cgroup/hostprocs_other.go: built only for other systems or tags
          internal/cgroup/recreate_other.go: built only for other systems or tags
          internal/cgroup/role_other.go: built only for other systems or tags
          internal/cgroup/shim_other.go: built only for other systems or tags
          internal/cgroup/strict_other.go: built only for other systems or tags
          internal/cgroup/verify_other.go: built only for other systems or tags
          internal/console/claim_sql_identity_other.go: built only for other systems or tags
          internal/console/geoipverify_other.go: built only for other systems or tags
          internal/console/hostreports_process_other.go: built only for other systems or tags
          internal/console/replicaview_other.go: built only for other systems or tags
          internal/console/restore_sim_nice_other_test.go: built only for other systems or tags
          internal/console/scalecost_other_test.go: built only for other systems or tags
          internal/console/seedscratch_windows.go: built only for other systems or tags
          internal/dbreads/worker_other.go: built only for other systems or tags
          internal/demobuild/security_other.go: built only for other systems or tags
          internal/democlaim/source_other.go: built only for other systems or tags
          internal/devbox/peer_darwin.go: built only for other systems or tags
          internal/devbox/peer_darwin_test.go: built only for other systems or tags
          internal/devbox/peer_other.go: built only for other systems or tags
          internal/devbox/socketcheck_other.go: built only for other systems or tags
          internal/domains/certimport_read_portable.go: built only for other systems or tags
          internal/edge/devboxpeer_other.go: built only for other systems or tags
          internal/edge/hairpin_other.go: built only for other systems or tags
          internal/edge/heldbudget_other.go: built only for other systems or tags
          internal/edge/purge_listen_unix.go: built only for other systems or tags
          internal/edge/purge_listen_windows.go: built only for other systems or tags
          internal/edge/race_on_test.go: built only for other systems or tags
          internal/edge/replicaconsole_owner_other.go: built only for other systems or tags
          internal/edge/replicaconsole_peer_other.go: built only for other systems or tags
          internal/edge/replicaconsole_socket_other_test.go: built only for other systems or tags
          internal/edge/static_artifact_other.go: built only for other systems or tags
          internal/edge/static_recordlock_other.go: built only for other systems or tags
          internal/edge/static_sweep_other.go: built only for other systems or tags
          internal/execsandbox/cleanup_other.go: built only for other systems or tags
          internal/execsandbox/file_other.go: built only for other systems or tags
          internal/execsandbox/oci_other.go: built only for other systems or tags
          internal/fileacl/fileacl_darwin.go: built only for other systems or tags
          internal/fileacl/fileacl_darwin_amd64.s: built only for other systems or tags
          internal/fileacl/fileacl_darwin_arm64.s: built only for other systems or tags
          internal/fileacl/fileacl_darwin_test.go: built only for other systems or tags
          internal/grouproll/state_other.go: built only for other systems or tags
          internal/grouprollaws/pty_darwin.go: built only for other systems or tags
          internal/grouprollaws/pty_other.go: built only for other systems or tags
          internal/hairpin/native_other.go: built only for other systems or tags
          internal/host/applylock_other_test.go: built only for other systems or tags
          internal/host/bootstrapfs_other.go: built only for other systems or tags
          internal/host/boxroles_config_other.go: built only for other systems or tags
          internal/host/claimfilesseed_delegation_other.go: built only for other systems or tags
          internal/host/claimfilesseed_transport_other.go: built only for other systems or tags
          internal/host/claimjournal_containment_other.go: built only for other systems or tags
          internal/host/claimjournal_migration_other.go: built only for other systems or tags
          internal/host/claimlaunch_kernel_other.go: built only for other systems or tags
          internal/host/claimlaunch_rev2_other_test.go: built only for other systems or tags
          internal/host/claimproduction_other.go: built only for other systems or tags
          internal/host/claimready_other.go: built only for other systems or tags
          internal/host/claimroleassembly_other.go: built only for other systems or tags
          internal/host/claimservingartifact_other.go: built only for other systems or tags
          internal/host/claimservinghandover_reboot_other.go: built only for other systems or tags
          internal/host/claimservinghandover_reboot_other_test.go: built only for other systems or tags
          internal/host/claimservingpark_other.go: built only for other systems or tags
          internal/host/claimstate_other.go: built only for other systems or tags
          internal/host/claimstop_kernel_other.go: built only for other systems or tags
          internal/host/claimtoken_inventory_other.go: built only for other systems or tags
          internal/host/claimunit_dropin_other.go: built only for other systems or tags
          internal/host/claimunit_files_other.go: built only for other systems or tags
          internal/host/claimunit_migrate_other.go: built only for other systems or tags
          internal/host/claimunit_ready_other.go: built only for other systems or tags
          internal/host/claimunit_socket_migration_other.go: built only for other systems or tags
          internal/host/consolefleet_owner_other.go: built only for other systems or tags
          internal/host/dbreads_other.go: built only for other systems or tags
          internal/host/egress_rail_other.go: built only for other systems or tags
          internal/host/fileowner_other.go: built only for other systems or tags
          internal/host/flock_windows.go: built only for other systems or tags
          internal/host/group_config_other.go: built only for other systems or tags
          internal/host/group_maintenance_other.go: built only for other systems or tags
          internal/host/group_maintenance_verbs_other.go: built only for other systems or tags
          internal/host/group_receipt_other.go: built only for other systems or tags
          internal/host/hadrain_call_other.go: built only for other systems or tags
          internal/host/hadrain_socket_other.go: built only for other systems or tags
          internal/host/hadrainfence_other.go: built only for other systems or tags
          internal/host/headroom_other.go: built only for other systems or tags
          internal/host/installchannel_other.go: built only for other systems or tags
          internal/host/managedboot_other.go: built only for other systems or tags
          internal/host/metrics_nested_other.go: built only for other systems or tags
          internal/host/movesfloor_other.go: built only for other systems or tags
          internal/host/movesfloorgate_other.go: built only for other systems or tags
          internal/host/movesheldrelease_other.go: built only for other systems or tags
          internal/host/movesmeasure_other.go: built only for other systems or tags
          internal/host/offcloudcredentials_other.go: built only for other systems or tags
          internal/host/registrychild_exec_other.go: built only for other systems or tags
          internal/host/registrychild_other.go: built only for other systems or tags
          internal/host/registryowner_chown_other.go: built only for other systems or tags
          internal/host/registryowner_descriptor_unix.go: built only for other systems or tags
          internal/host/replicahealth_other.go: built only for other systems or tags
          internal/host/rootgeneration_census_other.go: built only for other systems or tags
          internal/host/rootgeneration_kernel_other.go: built only for other systems or tags
          internal/host/rootgeneration_payload_other.go: built only for other systems or tags
          internal/host/rootgeneration_retired_other.go: built only for other systems or tags
          internal/host/rootmigration_production_other.go: built only for other systems or tags
          internal/host/runscset_other.go: built only for other systems or tags
          internal/host/sandboxenv_other.go: built only for other systems or tags
          internal/host/statfs_windows.go: built only for other systems or tags
          internal/host/systemapply_other.go: built only for other systems or tags
          internal/hostbox/census_vendor_other.go: built only for other systems or tags
          internal/hostbox/inventory_identity_other.go: built only for other systems or tags
          internal/hostbox/journalmigration_other.go: built only for other systems or tags
          internal/hostbox/journalnamespace_other.go: built only for other systems or tags
          internal/hostbox/journaltrust_other.go: built only for other systems or tags
          internal/hostbox/migration_census_other.go: built only for other systems or tags
          internal/hostbox/typedpark_other.go: built only for other systems or tags
          internal/hostenv/group_other.go: built only for other systems or tags
          internal/hostenv/write_other.go: built only for other systems or tags
          internal/hostenv/write_other_test.go: built only for other systems or tags
          internal/hostexec/clock_other.go: built only for other systems or tags
          internal/hostexec/clock_other_test.go: built only for other systems or tags
          internal/hostexec/local_other.go: built only for other systems or tags
          internal/hostexec/pending_other.go: built only for other systems or tags
          internal/hostexec/probe_other.go: built only for other systems or tags
          internal/hostexec/rootprocess_other.go: built only for other systems or tags
          internal/hostfiles/dir_other.go: built only for other systems or tags
          internal/hostfiles/refuse_other.go: built only for other systems or tags
          internal/hostfiles/watch_other.go: built only for other systems or tags
          internal/hostfloor/controllers_other.go: built only for other systems or tags
          internal/hostfloor/image_other.go: built only for other systems or tags
          internal/hostguard/flock_other.go: built only for other systems or tags
          internal/hostguard/flock_other_test.go: built only for other systems or tags
          internal/hostguard/record_other.go: built only for other systems or tags
          internal/instancectl/claimexec_other.go: built only for other systems or tags
          internal/instancectl/claimexec_socket_other.go: built only for other systems or tags
          internal/instancectl/claimlaunch_snapshot_other.go: built only for other systems or tags
          internal/instancectl/claimnetwork_other.go: built only for other systems or tags
          internal/instancectl/demo_snapshot_other.go: built only for other systems or tags
          internal/instancectl/egress_cgroup_other.go: built only for other systems or tags
          internal/instancectl/egress_dropin_other.go: built only for other systems or tags
          internal/instancectl/fleetsize_other.go: built only for other systems or tags
          internal/instancectl/gvisorprobe_other.go: built only for other systems or tags
          internal/instancectl/peer_other.go: built only for other systems or tags
          internal/instancectl/peer_tuple_other.go: built only for other systems or tags
          internal/instancectl/rootfs_identity_other.go: built only for other systems or tags
          internal/instanceexec/claimexec_other.go: built only for other systems or tags
          internal/instanceexec/exec_rootfs_other.go: built only for other systems or tags
          internal/instanceexec/netlink_route_other.go: built only for other systems or tags
          internal/instanceexec/probe_gvisor_other.go: built only for other systems or tags
          internal/instanceexec/probe_hardening_other.go: built only for other systems or tags
          internal/instanceexec/probe_other.go: built only for other systems or tags
          internal/instanceexec/probe_rootfs_other.go: built only for other systems or tags
          internal/instanceexec/sandbox_other.go: built only for other systems or tags
          internal/instanceexec/scope_other.go: built only for other systems or tags
          internal/instanceexec/stop_other.go: built only for other systems or tags
          internal/instanceexec/tty_other.go: built only for other systems or tags
          internal/instancefs/instancefs_other.go: built only for other systems or tags
          internal/launchd/activate_darwin.go: built only for other systems or tags
          internal/launchd/activate_darwin_amd64.s: built only for other systems or tags
          internal/launchd/activate_darwin_arm64.s: built only for other systems or tags
          internal/launchd/activate_darwin_test.go: built only for other systems or tags
          internal/layout/journal_other.go: built only for other systems or tags
          internal/layout/links_other.go: built only for other systems or tags
          internal/mailer/keys_other.go: built only for other systems or tags
          internal/maintenanceexec/run_other.go: built only for other systems or tags
          internal/managedboot/admission_other.go: built only for other systems or tags
          internal/managedboot/identity_other.go: built only for other systems or tags
          internal/mediahandler/collect_other.go: built only for other systems or tags
          internal/mediahandler/procs_other.go: built only for other systems or tags
          internal/medialocal/runner_other.go: built only for other systems or tags
          internal/moves/archive/open_other.go: built only for other systems or tags
          internal/moves/archive/sync_other.go: built only for other systems or tags
          internal/ops/flock_windows.go: built only for other systems or tags
          internal/park/local_other.go: built only for other systems or tags
          internal/privatefile/io_other.go: built only for other systems or tags
          internal/proxyproto/peek_other.go: built only for other systems or tags
          internal/relay/race_on_test.go: built only for other systems or tags
          internal/release/consumedfence_other.go: built only for other systems or tags
          internal/release/digestcache_other.go: built only for other systems or tags
          internal/rootaws/credentials_other.go: built only for other systems or tags
          internal/rootaws/open_darwin.go: built only for other systems or tags
          internal/rootfsimage/dir_other.go: built only for other systems or tags
          internal/rootstate/authoritydir_other.go: built only for other systems or tags
          internal/rootstate/authorityfile_other.go: built only for other systems or tags
          internal/rootstate/file_other.go: built only for other systems or tags
          internal/rootstate/link_other.go: built only for other systems or tags
          internal/rootstate/persistent_other.go: built only for other systems or tags
          internal/rootstate/state_other.go: built only for other systems or tags
          internal/safefile/file_other.go: built only for other systems or tags
          internal/safefile/reap_other.go: built only for other systems or tags
          internal/stopevidence/fds_other.go: built only for other systems or tags
          internal/stopevidence/fds_other_test.go: built only for other systems or tags
          internal/stopevidence/holders_other.go: built only for other systems or tags
          internal/stopevidence/reconstruct_other.go: built only for other systems or tags
          internal/team/storelock_other.go: built only for other systems or tags
          internal/team/storelock_windows.go: built only for other systems or tags
          move_offline_run_other.go: built only for other systems or tags
          system_group_other.go: built only for other systems or tags
        
    codehealth_test.go:115: fatal               1093 at  474 sites  log.Fatal*, (*log.Logger).Fatal* and os.Exit in the root package's production files
    codehealth_test.go:115: sleep               1006 at  812 sites  time.Sleep in test files
    codehealth_test.go:115: db-no-context        873 at  696 sites  database calls with no context (dbOpWithoutContext) in production files
    codehealth_test.go:115: host-context         188 at  142 sites  context.Background and context.TODO in internal/host production files
    codehealth_test.go:115: func-lines         18582 at   45 sites  functions over 300 code lines (blank and comment-only lines not counted)
    codehealth_test.go:115: file-lines         30621 at    8 sites  files over 3,000 code lines, counted the same way
    codehealth_test.go:115: release-importers     66 at    1 sites  packages whose production files import internal/release
    codehealth_test.go:119: below the record: func-lines cmd/console serve -: 358 in the code, the record allows 362 (make code-health-record lowers it)
    codehealth_test.go:119: below the record: file-lines . apimode.go -: 4128 in the code, the record allows 4147 (make code-health-record lowers it)
    codehealth_test.go:119: below the record: file-lines internal/console server.go -: 4177 in the code, the record allows 4191 (make code-health-record lowers it)
    codehealth_test.go:119: below the record: file-lines internal/host agent.go -: 3175 in the code, the record allows 3204 (make code-health-record lowers it)
--- PASS: TestCodeHealth (112.58s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	114.148s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: HEAD is on main; comparing with its parent e4bd27f373ffad7b03b0927cb9efe7caed7b6801
=== RUN   TestRecordAgainstBase
--- PASS: TestRecordAgainstBase (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	0.008s
code-health record: no line went up without a reason
=== race ===
go version go1.26.10 linux/arm64
GATE_RACE=1 .amadan/test-gate.sh

amadan: job cancelled — a newer push superseded it

landed from sec-h5-m8-fleet-hostnames

diff --git a/docs/superpowers/notes/census-proposal-sec-h5-m8-fleet-hostnames.md b/docs/superpowers/notes/census-proposal-sec-h5-m8-fleet-hostnames.md
new file mode 100644
index 000000000..c30f73a19
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-sec-h5-m8-fleet-hostnames.md
@@ -0,0 +1,19 @@
+# Census approval: sec-h5-m8-fleet-hostnames
+
+Ruling `census-ruling-sec-h5-m8-fleet-hostnames`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/edge/storedoor.go` `storeDoor.serveListing` | body | unchanged (1) | passes the caller sqid to serveClaimListing (H5-M8: the claim listing names only the fleet account own claims, pending included; admitted per account before any work, one shared claim refresh); no read added, no store or file reach changed |
+
+Envelopes re-pinned: `internal/domains`, `internal/edge`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/edge/storedoor.go` `storeDoor.serveListing`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input
+
+Seal: `e3c8bc6a560e863ed44c7ab2f9367a4347ec767d8da2c3b1f1eafc90e45c89e8` → `a6a19c800d55f99ed1c70068e38ffa66aef7af8f55199e97e986d9bbb0e0d80d`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/console/domaincatchall.go b/internal/console/domaincatchall.go
index 657a204a9..9475708b0 100644
--- a/internal/console/domaincatchall.go
+++ b/internal/console/domaincatchall.go
@@ -321,7 +321,15 @@ func catchallOverForeignChildMsg(parent string, proof dnsRecord) string {
// N4): an account whose parent's DNS carries its domain challenge right
// now (domainChallengeHeld) has shown the domain is its own, and passes.
// The child keeps its exact claim, which beats the catch-all's star at the
-// edge, so the catch-all takes nothing from it. Otherwise the 409 says
+// edge (edgesfile.ResolveNameAuthority prefers an exact name to the
+// "*.<parent>" row), so the catch-all takes nothing from it. That holds
+// for this star only. A name an instance catch-all or an account namespace
+// derives is an exact alias row like the child's, and the edge does not
+// prefer the claim between two of those: there the box's alias pass
+// yielding to the claim it reads is the only guard. A platform box reads
+// every claim; a fleet box reads only its own account's (H5-M8), and its
+// rows never reach the platform edges (serveClaimListing says why that is
+// safe). Otherwise the 409 says
// why and names that record (catchallOverForeignChildMsg), rather than the
// neutral answer that left the owner with nothing to act on. Asked only
// when there is a child to answer for, so the common case makes no lookup.
diff --git a/internal/domains/aliases.go b/internal/domains/aliases.go
index 3560c8285..185cb243d 100644
--- a/internal/domains/aliases.go
+++ b/internal/domains/aliases.go
@@ -374,10 +374,12 @@ type AliasReport struct {
// pass cannot afford to have missed. A claim whose GET failed, or whose body
// is unparseable or from a newer schema, always counts: nothing says it is
// not ours. A claim whose GET said "does not exist" is the shape of the fleet
-// store door withholding a foreign account's (or a pending) body behind a
-// listing that still shows its name; that reaches this box's tables only
-// through an account with a route here, since every derivation requires the
-// claim's tenancy to match a local route's. So a not-found claim counts only
+// store door withholding a pending body behind a listing that still shows
+// its name (since H5-M8 the door lists only the fleet account's own claims,
+// so a foreign one is no longer listed at all; a platform box reads the
+// bucket directly), or of a claim detached since the listing; that reaches
+// this box's tables only through an account with a route here, since every
+// derivation requires the claim's tenancy to match a local route's. So a not-found claim counts only
// if some account it is tied to owns a route in this registry. The account is
// found from what the pass already holds: a local route on the claim's own
// host, an alias row for the host (plain, catch-all star, or an instance name
diff --git a/internal/domains/claims.go b/internal/domains/claims.go
index 89c48c1d1..c3ce10a0f 100644
--- a/internal/domains/claims.go
+++ b/internal/domains/claims.go
@@ -930,16 +930,17 @@ func readClaim(ctx context.Context, s release.Store, key string) (c Claim, ok, f
// readClaimDetail is readClaim plus notFound: the GET said the object does
// not exist. That is the one failure the fleet store door uses on purpose (a
-// foreign account's or a pending claim's body is a 404 behind a listing that
-// shows its name), so a caller that reports completeness needs it apart from
-// a store error, an unparseable body or a schema this binary cannot read.
+// pending claim's body is a 404 behind a listing that shows its name; since
+// H5-M8 another account's claim is not listed at all, and its body is a 404
+// too), so a caller that reports completeness needs it apart from a store
+// error, an unparseable body or a schema this binary cannot read.
func readClaimDetail(ctx context.Context, s release.Store, key string) (c Claim, ok, firm, notFound bool) {
raw, _, err := s.Get(ctx, key)
if err != nil {
// Not-found is quiet: a claim detached between the listing and this
- // read, or, through the fleet store door, another account's claim,
- // whose NAME the door lists but whose body it withholds (#215). The
- // listing still counts it as claimed (listWithHosts).
+ // read, or, through the fleet store door, this account's pending
+ // claim, whose NAME the door lists but whose body it withholds
+ // (#215). The listing still counts it as claimed (listWithHosts).
if !errors.Is(err, os.ErrNotExist) {
log.Printf("domains: claim %s: %v", key, err)
}
diff --git a/internal/edge/fleetapi_e2e_test.go b/internal/edge/fleetapi_e2e_test.go
index 3d6c71959..684251d7e 100644
--- a/internal/edge/fleetapi_e2e_test.go
+++ b/internal/edge/fleetapi_e2e_test.go
@@ -764,13 +764,18 @@ func TestFleetBoxPolicyReadsKeepTheRequestBudget(t *testing.T) {
wantRow("cart", "10.0.5.20", "large", signed)
}
-// TestFleetBoxCatchallYieldsToAnotherTenantsClaim (#215 review): the store
-// door withholds another account's claim BODY from a fleet box, but must
-// still list its NAME. An instance catch-all derives no <label>.<parent>
-// alias over a name somebody else has claimed, and ReconcileAliases decides
-// "somebody else has claimed it" from the listing; a listing narrowed to the
-// box's own account let the box shadow the other tenant's claim.
-func TestFleetBoxCatchallYieldsToAnotherTenantsClaim(t *testing.T) {
+// TestFleetBoxCatchallSeesNoOtherTenantsClaim (H5-M8; until then
+// TestFleetBoxCatchallYieldsToAnotherTenantsClaim, #215 review). The store
+// door withholds another account's claim from a fleet box, name and body
+// alike. So a fleet box's instance catch-all no longer yields a
+// <label>.<parent> name to a claim another tenant holds on it: the box
+// derives it as it derives any unclaimed name. That is the contract now,
+// and safe because a fleet box's rows never reach a platform edge, so the
+// other tenant's name is still served from its own claim everywhere the
+// platform routes it (serveClaimListing says why). This pins all three: the
+// listing omits the name, the body is the door's 404, and the box derives
+// the name beside the unclaimed control.
+func TestFleetBoxCatchallSeesNoOtherTenantsClaim(t *testing.T) {
w := newFleetDoorWorld(t)
ctx := context.Background()
const parent = "teams.example.com"
@@ -780,7 +785,7 @@ func TestFleetBoxCatchallYieldsToAnotherTenantsClaim(t *testing.T) {
if _, err := domains.AttachInstanceCatchall(ctx, w.store, parent, w.sqid, "jelly", "", ""); err != nil {
t.Fatal(err)
}
- // The other tenant's exact claim on the name the catch-all would derive.
+ // The other tenant's exact claim on the name the catch-all derives.
if _, _, err := domains.AttachClaim(ctx, w.store, domains.Claim{
Host: "beta." + parent, Account: w.other, App: "shop", Route: "shop." + w.other + ".oncarlos.com",
CreatedBy: "sam@keymail.dev",
@@ -789,18 +794,15 @@ func TestFleetBoxCatchallYieldsToAnotherTenantsClaim(t *testing.T) {
}
instance := "beta." + w.sqid + ".oncarlos.com"
w.put(t, "apps/"+w.sqid+"/jelly/instances/"+instance+".json", `{}`)
- // A second instance whose name nobody else claims: the control that
- // shows the catch-all does derive through the door.
control := "acme." + w.sqid + ".oncarlos.com"
w.put(t, "apps/"+w.sqid+"/jelly/instances/"+control+".json", `{}`)
- // The box sees the other tenant's NAME but not its claim.
keys, err := w.boxA.List(ctx, domains.ClaimsPrefix)
if err != nil {
t.Fatal(err)
}
- if !slices.Contains(keys, domains.ClaimKey("beta."+parent)) {
- t.Fatalf("listing %v omits another tenant's claimed name", keys)
+ if slices.Contains(keys, domains.ClaimKey("beta."+parent)) {
+ t.Fatalf("listing %v names another tenant's claim", keys)
}
if _, _, err := w.boxA.Get(ctx, domains.ClaimKey("beta."+parent)); !errors.Is(err, os.ErrNotExist) {
t.Fatalf("another tenant's claim body: err = %v, want not-found", err)
@@ -810,17 +812,16 @@ func TestFleetBoxCatchallYieldsToAnotherTenantsClaim(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if err := reg.Upsert(registry.Route{Host: instance, Slug: "beta", App: "jelly", Account: w.sqid, Kind: "instance", Status: "ready"}); err != nil {
- t.Fatal(err)
- }
- if err := reg.SetProvisioned(instance, true); err != nil {
- t.Fatal(err)
- }
- if err := reg.Upsert(registry.Route{Host: control, Slug: "acme", App: "jelly", Account: w.sqid, Kind: "instance", Status: "ready"}); err != nil {
- t.Fatal(err)
- }
- if err := reg.SetProvisioned(control, true); err != nil {
- t.Fatal(err)
+ for _, rt := range []registry.Route{
+ {Host: instance, Slug: "beta", App: "jelly", Account: w.sqid, Kind: "instance", Status: "ready"},
+ {Host: control, Slug: "acme", App: "jelly", Account: w.sqid, Kind: "instance", Status: "ready"},
+ } {
+ if err := reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.SetProvisioned(rt.Host, true); err != nil {
+ t.Fatal(err)
+ }
}
if err := domains.ReconcileAliases(ctx, w.boxA, reg, time.Now, nil, nil); err != nil {
t.Fatal(err)
@@ -829,15 +830,54 @@ func TestFleetBoxCatchallYieldsToAnotherTenantsClaim(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- derived := false
+ derived := map[string]string{}
for _, a := range aliases {
- if a.Alias == "beta."+parent {
- t.Fatalf("the box derived %+v over another tenant's claim", a)
+ derived[a.Alias] = a.Host
+ }
+ if derived["acme."+parent] != control || derived["beta."+parent] != instance {
+ t.Fatalf("aliases = %+v, want acme.%s and beta.%s both derived on the fleet box", aliases, parent, parent)
+ }
+}
+
+// TestFleetBoxListsOnlyClaimsItMayKnow (H5-M8), through the edge and the
+// box's real store client: another account's claims, verified or pending,
+// are never in a fleet box's claim listing, even on the very name the box's
+// own instance catch-all derives; the account's own, pending included, are.
+func TestFleetBoxListsOnlyClaimsItMayKnow(t *testing.T) {
+ w := newFleetDoorWorld(t)
+ ctx := context.Background()
+ attach := func(c domains.Claim, proven bool) {
+ t.Helper()
+ if _, _, _, err := domains.AttachClaimProven(ctx, w.store, c, time.Now(), func() bool { return proven }); err != nil {
+ t.Fatal(err)
}
- derived = derived || (a.Alias == "acme."+parent && a.Host == control)
}
- if !derived {
- t.Fatalf("aliases = %+v, want acme.%s derived for the unclaimed name", aliases, parent)
+ attach(domains.Claim{Host: "teams.example.com", Account: w.sqid, App: "jelly"}, true)
+ if _, err := domains.AttachInstanceCatchall(ctx, w.store, "teams.example.com", w.sqid, "jelly", "", ""); err != nil {
+ t.Fatal(err)
+ }
+ w.put(t, "apps/"+w.sqid+"/jelly/instances/beta."+w.sqid+".oncarlos.com.json", `{}`)
+ attach(domains.Claim{Host: "soon.example.com", Account: w.sqid, App: "jelly"}, false)
+ attach(domains.Claim{Host: "beta.teams.example.com", Account: w.other, App: "shop"}, true)
+ attach(domains.Claim{Host: "launch.teams.example.com", Account: w.other, App: "shop"}, false)
+ attach(domains.Claim{Host: "a.beta.teams.example.com", Account: w.other, App: "shop"}, true)
+ attach(domains.Claim{Host: "secret-launch.example.org", Account: w.other, App: "shop"}, false)
+ attach(domains.Claim{Host: "shop.example.org", Account: w.other, App: "shop"}, true)
+
+ want := []string{
+ domains.ClaimKey("*.teams.example.com"),
+ domains.ClaimKey("soon.example.com"),
+ domains.ClaimKey("teams.example.com"),
+ }
+ for name, box := range map[string]release.Store{"box-a": w.boxA, "box-b": w.boxB} {
+ keys, err := box.List(ctx, domains.ClaimsPrefix)
+ if err != nil {
+ t.Fatal(err)
+ }
+ slices.Sort(keys)
+ if !slices.Equal(keys, want) {
+ t.Fatalf("%s lists %v, want %v", name, keys, want)
+ }
}
}
diff --git a/internal/edge/hunt_H5-M8_test.go b/internal/edge/hunt_H5-M8_test.go
new file mode 100644
index 000000000..ed073eefd
--- /dev/null
+++ b/internal/edge/hunt_H5-M8_test.go
@@ -0,0 +1,55 @@
+package edge
+
+// Hunt H5-M8 (verifier: opus). One valid dynamic fleet token lists every
+// tenant's claimed hostname through the store door: serveClaimListing returns
+// every domains/*.json key with no account or pending filter, so a foreign
+// account's claims — including pending (unpublished, unproven) names and
+// names a wildcard cert keeps out of CT — are disclosed to any fleet box.
+//
+// This asserts the secure behaviour: a foreign account's pending hostname is
+// NOT listed to this fleet token. It failed before the H5-M8 fix, which
+// confirmed the leak; it passes now that the listing names only this
+// account's own claims. (The claim BODY is already protected — serveClaim 404s it — which
+// this test also checks, so only the name enumeration is the live gap. The
+// code comment on serveClaimListing calls the whole listing deliberate:
+// ReconcileAliases needs it. That design note is for the report, not a
+// reason the name does not leak.)
+
+import (
+ "context"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/domains"
+)
+
+func TestHunt_H5_M8_FleetTokenEnumeratesForeignHostnames(t *testing.T) {
+ d, store := newTestDoor(t)
+ ctx := context.Background()
+ put := func(c domains.Claim) {
+ t.Helper()
+ if _, _, _, err := domains.AttachClaimProven(ctx, store, c, time.Now(), func() bool { return !c.Pending }); err != nil {
+ t.Fatal(err)
+ }
+ }
+ put(domains.Claim{Host: "own.example.com", Account: testSqid, App: "web", Route: "web." + testSqid + ".oncarlos.com"})
+ put(domains.Claim{Host: "secret-launch.zz99.example", Account: "zz99", App: "shop", Pending: true})
+
+ w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil)
+ if w.Code != 200 {
+ t.Fatalf("listing = %d", w.Code)
+ }
+ if strings.Contains(w.Body.String(), "secret-launch.zz99.example") {
+ t.Fatalf("H5-M8: a fleet token for account %q was shown another account's PENDING hostname in the claim listing: %s",
+ testSqid, strings.TrimSpace(w.Body.String()))
+ }
+
+ // The body stays protected: byte-identical 404 to an absent claim.
+ absent := doorDo(d, "GET", "/store/o/domains/absent.example.com.json", "", nil)
+ foreign := doorDo(d, "GET", "/store/o/domains/secret-launch.zz99.example.json", "", nil)
+ if foreign.Code != absent.Code || foreign.Body.String() != absent.Body.String() {
+ t.Errorf("foreign claim body = %d %q, want the same 404 an absent claim gets (%d %q)",
+ foreign.Code, foreign.Body.String(), absent.Code, absent.Body.String())
+ }
+}
diff --git a/internal/edge/storedoor.go b/internal/edge/storedoor.go
index 39cbd72e5..3ab9f2614 100644
--- a/internal/edge/storedoor.go
+++ b/internal/edge/storedoor.go
@@ -103,6 +103,10 @@ type storeDoor struct {
getTotal int
getAccounts map[string]int
getDeadlineUnsupported sync.Once
+
+ // claims folds the claim bodies serveClaimListing scopes by
+ // (claimOwnerCache). The zero value is ready.
+ claims claimOwnerCache
}
type storeGETIdentity struct {
@@ -423,7 +427,7 @@ func (d *storeDoor) serveListing(w http.ResponseWriter, r *http.Request, sqid, f
return
}
if scope == domains.ClaimsPrefix {
- d.serveClaimListing(w, r, dirs)
+ d.serveClaimListing(w, r, sqid, dirs)
return
}
out := []string{} // never null on the wire: an empty listing is []
@@ -628,9 +632,9 @@ func canonicalPrefix(raw string) (string, bool) {
// app — see appPolicyRead
//
// domains/ is NOT here, and is served by its own two paths instead
-// (serveClaim, serveClaimListing): a box can list every claimed hostname,
-// but reads only its own account's verified claims, with the person who
-// made each one stripped out (#215).
+// (serveClaim, serveClaimListing): a box lists its own account's claimed
+// hostnames and no other account's (H5-M8), and reads only its own account's verified claims, with the person who made
+// each one stripped out (#215).
//
// The fleets/<fleet>/** line is not in F3's enumeration and is not a
// widening of it: the fleet's own prefix is the only place it may WRITE, and
@@ -656,9 +660,10 @@ func canonicalPrefix(raw string) (string, bool) {
// materializes a claim whose route is a local route of the claim's own
// account, and a fleet box's routes are all its own account's, so those are
// the only bodies the door serves (serveClaim). It also needs to know which
-// NAMES are claimed at all, whoever by, so the listing stays whole
-// (serveClaimListing). Write stays console-only: aclWrite never answers true
-// for a domains/ key.
+// NAMES were claimed, whoever by, since a derived name yields to any claim
+// on it; the listing was whole for that reason until H5-M8 cut it to the
+// account's own claims (serveClaimListing says why that is safe). Write stays
+// console-only: aclWrite never answers true for a domains/ key.
//
// A promotion record (settings spec §4.1, release.PromotionRecordKey) is
// granted because a box needs it and it holds nothing secret: it is the
@@ -907,8 +912,9 @@ func aclListScope(sqid, fleet, prefix string) (string, bool) {
case prefix == "domains" || prefix == "domains/":
// #151: the OTHER shared scope. Claims are keyed by hostname, not
// tenant, so there is no subtree to narrow into: serveClaimListing
- // names every claimed hostname, and serveClaim withholds every body
- // but this account's verified ones (#215). ReconcileAliases always
+ // filters per claim instead (its own account's only, H5-M8), and
+ // serveClaim withholds every body but this
+ // account's verified ones (#215). ReconcileAliases always
// lists the whole prefix; a narrower ask (e.g.
// "domains/x.example.json") is refused rather than widened, matching accounts/'s deliberate refusal of
// "accounts/<sqid>/" — see that case's comment.
@@ -986,28 +992,71 @@ func (d *storeDoor) serveClaim(w http.ResponseWriter, r *http.Request, sqid, key
w.Write(out)
}
-// serveClaimListing lists every claim KEY under domains/: hostnames only,
-// whoever holds them. The listing has to be whole, because ReconcileAliases
-// decides "a claim on this name wins, whoever holds it" from it (an instance
-// catch-all derives no <label>.<parent> alias over a name another account
-// claimed), and a listing narrowed to this account would let a box shadow
-// another tenant's claim. A hostname alone is what DNS publishes anyway; the
-// claim behind it (who, which app, its paths, whether it is proven) stays
-// behind serveClaim's 404. Child directories: none, claims are flat.
-func (d *storeDoor) serveClaimListing(w http.ResponseWriter, r *http.Request, dirs bool) {
+// serveClaimListing lists the claim KEYS under domains/ that are this
+// fleet's own account's, pending ones included, and no others (H5-M8).
+//
+// The listing was once whole, on the reasoning that a hostname alone says
+// no more than DNS. It said more: names that do not resolve yet, names
+// nobody has proved (pending reservations), and names a wildcard
+// certificate keeps out of CT logs, for every tenant on the platform, to
+// anyone holding a fleet token, which any account that runs its own fleet
+// does.
+//
+// It was whole for one reason: ReconcileAliases yields a name it would
+// DERIVE (an instance catch-all's <label>.<parent>, an account namespace's
+// <prefix>.<name>.<apps>) to a claim on that name, whoever holds it, and it
+// learns of claims from this listing. A fleet box now never sees another
+// account's claim, so it may derive such a name over it. That is safe
+// because of where a fleet box's rows can be served:
+//
+// - Its rows never reach a platform edge. Edges files are a platform-box
+// job, skipped on a fleet box (internal/host edgesFileLoop,
+// shouldSkipPublisherElection: CARLOS_FLEET set), and a fleet token
+// cannot write control/edges/ anyway (aclWrite). A platform edge serves
+// its own registry and the edges files under control/edges/ (Reload's
+// alias fold; homeMap's edgesPrefix), so nothing a fleet box derives is
+// among them.
+// - The platform edge sends a request to a fleet only for a name a
+// platform box's rows route there (FleetArmVerdict over its registry),
+// and a platform box's alias pass reads every claim straight from the
+// bucket (internal/host aliasPassReporting over the deploy store), so
+// those rows still yield.
+// - So the names a fleet box derives give it no new cross-account routing
+// authority: they decide only which of its own apps answers traffic
+// that already reaches it. That is traffic the name's DNS sends to the
+// fleet's own ingress, which whoever controls that DNS decides, or
+// traffic the platform already delegates to the fleet through a
+// platform row. One such row is a "*.<parent>" catch-all star, which
+// the edge falls back to for a child with no exact serving row
+// (edgesfile.ResolveNameAuthority), such as another account's pending
+// claim; the forwarded request keeps the child's Host, so the fleet's
+// derived alias can pick which of its apps answers it. The platform had
+// already sent that request to the fleet.
+//
+// A claim the door had to read and could not has unknown ownership and
+// fails the listing (502, ownClaims), so the box's pass changes nothing.
+// Listings are admitted globally and per account before any work and hold
+// their slot until the response is written (503 with Retry-After past
+// either bound), and share one claim refresh at a time (claimOwnerCache),
+// whose steady state is one listing and no GETs. Child directories: none,
+// claims are flat.
+func (d *storeDoor) serveClaimListing(w http.ResponseWriter, r *http.Request, sqid string, dirs bool) {
out := []string{}
if !dirs {
- keys, err := d.store.List(r.Context(), domains.ClaimsPrefix)
+ release, ok := d.claims.admit(sqid)
+ if !ok {
+ Unavailable(w, "claim-listing-busy", "store busy", claimListingRetryAfter)
+ return
+ }
+ defer release() // after the response is written
+ entries, err := d.claims.snapshot(r.Context(), d.store)
+ if err == nil {
+ out, err = ownClaims(sqid, entries)
+ }
if err != nil {
d.storeFailed(w, r, "list", domains.ClaimsPrefix, err)
return
}
- for _, key := range keys {
- if _, ok := canonicalKey(key); ok && strings.HasSuffix(key, ".json") {
- out = append(out, key)
- }
- }
- sort.Strings(out)
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(out)
diff --git a/internal/edge/storedoor_claims.go b/internal/edge/storedoor_claims.go
new file mode 100644
index 000000000..4ff589b9d
--- /dev/null
+++ b/internal/edge/storedoor_claims.go
@@ -0,0 +1,280 @@
+package edge
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "os"
+ "sort"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/carlosframework/platform/internal/domains"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// claimOwner is the account one claim body names, read as a generic JSON
+// object the way serveClaim reads it, not through domains.Claim: a claim of
+// a schema newer than this edge still has an account, and refusing to judge
+// it would drop the account's own claim from its own listing during a roll.
+// A body that does not decode has no account: it is nobody's own.
+func claimOwner(body []byte) string {
+ var obj map[string]json.RawMessage
+ if json.Unmarshal(body, &obj) != nil {
+ return ""
+ }
+ var account string
+ _ = json.Unmarshal(obj["account"], &account)
+ return account
+}
+
+// cachedClaim is one claim key as the last fold left it.
+//
+// - known: account is what the body said at stamp mod.
+// - unread: the latest fold had to read the body (its stamp moved, or it
+// was never read or not yet settled) and could not (a store error, not
+// a not-found). Its ownership is unknown, whatever an older revision
+// said: the claim may have changed hands. An unread entry is never
+// known.
+// - settled: the stamp is old enough to trust as unchanged
+// (claimOwnerSettle). An entry is reused without a GET only when it is
+// known, not unread, settled, and its stamp is the listing's.
+type cachedClaim struct {
+ mod time.Time
+ settled bool
+ known bool
+ unread bool
+ account string
+}
+
+// claimOwnerSettle is domains.ClaimCache's modSettle: S3 stamps have
+// one-second granularity, so a claim rewritten within the second it was read
+// is not trusted as unchanged.
+const claimOwnerSettle = 2 * time.Second
+
+// claimFoldTimeout bounds one refresh. The refresh is detached from every
+// request, so this is the only thing that stops one stuck on a slow store.
+const claimFoldTimeout = 5 * time.Minute
+
+// claimListingsMax and claimListingsPerAccount bound the claim listings an
+// edge serves at once, in all and for one account. Vars only so a test can
+// lower them.
+var (
+ claimListingsMax = 64
+ claimListingsPerAccount = 4
+)
+
+// claimListingRetryAfter is the Retry-After a refused listing carries, in
+// seconds: about one alias pass.
+const claimListingRetryAfter = 2
+
+// claimOwnerCache folds the deployment's claim bodies down to their owning
+// account, so serveClaimListing can name a fleet's own claims and no others
+// (H5-M8). It holds one invariant against request amplification:
+//
+// - Admission first (admit): a listing is admitted, globally and for its
+// account, before the edge does any work for it, and holds its slot
+// until its response is written. Past either bound it is refused (503,
+// Retry-After), so one account cannot crowd out another, and the edge's
+// work is bounded by claimListingsMax listings at a time.
+// - One refresh at a time (snapshot): a listing that finds a refresh
+// running waits for it and shares its result; otherwise it starts one.
+// The refresh runs detached, under claimFoldTimeout, so a caller that
+// goes away neither stops it nor throws its reads away.
+// - Publication cannot lose newer progress: the refresh is the only
+// writer, one runs at a time, and each starts from what the last one
+// published, so no older fold can publish over a newer one. A refresh
+// cut off by its deadline publishes what it read (foldClaims), and the
+// next one reads only the rest.
+//
+// The steady state is one listing and no GETs: a body is read again only
+// when its stamp moves (domains.ClaimCache's rules: reuse only on an equal,
+// settled stamp; the map is replaced whole each refresh, which evicts a
+// detached claim). A store that cannot answer ListMod (test fakes) is folded
+// uncached. The map is never mutated once published, so callers read it
+// without the lock.
+type claimOwnerCache struct {
+ mu sync.Mutex
+ entries map[string]cachedClaim
+ inflight *claimRefresh
+ admitted int
+ perAccount map[string]int
+}
+
+type claimRefresh struct {
+ done chan struct{}
+ waiters int // under claimOwnerCache.mu
+ entries map[string]cachedClaim
+ err error
+}
+
+// admit takes a listing slot for sqid, or reports that the edge or the
+// account is at its bound. release gives the slot back; call it once.
+func (c *claimOwnerCache) admit(sqid string) (release func(), ok bool) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ if c.admitted >= claimListingsMax || c.perAccount[sqid] >= claimListingsPerAccount {
+ return nil, false
+ }
+ if c.perAccount == nil {
+ c.perAccount = map[string]int{}
+ }
+ c.admitted++
+ c.perAccount[sqid]++
+ var once sync.Once
+ return func() {
+ once.Do(func() {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.admitted--
+ if c.perAccount[sqid]--; c.perAccount[sqid] <= 0 {
+ delete(c.perAccount, sqid)
+ }
+ })
+ }, true
+}
+
+// snapshot returns the entries of the refresh running when it is called,
+// or of one it starts. ctx bounds only this caller's wait.
+func (c *claimOwnerCache) snapshot(ctx context.Context, s release.Store) (map[string]cachedClaim, error) {
+ c.mu.Lock()
+ run := c.inflight
+ if run == nil {
+ run = &claimRefresh{done: make(chan struct{})}
+ c.inflight = run
+ prev := c.entries
+ go func() {
+ fctx, cancel := context.WithTimeout(context.Background(), claimFoldTimeout)
+ defer cancel()
+ entries, err := foldClaims(fctx, s, prev)
+ c.mu.Lock()
+ if entries != nil {
+ c.entries = entries
+ }
+ c.inflight = nil
+ c.mu.Unlock()
+ run.entries, run.err = entries, err
+ close(run.done)
+ }()
+ }
+ run.waiters++
+ c.mu.Unlock()
+ defer func() {
+ c.mu.Lock()
+ run.waiters--
+ c.mu.Unlock()
+ }()
+ select {
+ case <-run.done:
+ if run.err != nil {
+ return nil, run.err
+ }
+ return run.entries, nil
+ case <-ctx.Done():
+ return nil, ctx.Err()
+ }
+}
+
+// foldClaims lists the claims and reads every body prev cannot vouch for.
+// A claim gone between the listing and its read is left out (detached); a
+// body that fails to read is kept as unread, ownership unknown, and the fold
+// goes on: the caller decides what that means (ownClaims). A body whose
+// stamp is unchanged since a settled read is not read again, so the account
+// that read found still stands; only a revision the fold had to read and
+// could not is unknown.
+//
+// When ctx ends part way, the fold stops reading and returns ctx's error
+// together with the entries it has: every body it read, and prev's entry
+// for each listed key it did not reach (re-read next fold, since its stamp
+// moved or it would have been reused). A failed listing returns nil entries,
+// and the caller keeps prev.
+func foldClaims(ctx context.Context, s release.Store, prev map[string]cachedClaim) (map[string]cachedClaim, error) {
+ var listed []release.KeyMod
+ lister, cacheable := s.(release.ModLister)
+ if cacheable {
+ got, err := lister.ListMod(ctx, domains.ClaimsPrefix)
+ if err != nil {
+ return nil, err
+ }
+ listed = got
+ } else {
+ keys, err := s.List(ctx, domains.ClaimsPrefix)
+ if err != nil {
+ return nil, err
+ }
+ for _, k := range keys {
+ listed = append(listed, release.KeyMod{Key: k})
+ }
+ }
+ now := time.Now()
+ next := make(map[string]cachedClaim, len(listed))
+ var stopped error
+ for _, km := range listed {
+ if _, ok := canonicalKey(km.Key); !ok || !strings.HasSuffix(km.Key, ".json") {
+ continue
+ }
+ old, had := prev[km.Key]
+ if stopped == nil {
+ stopped = ctx.Err()
+ }
+ if stopped != nil {
+ if had {
+ next[km.Key] = old
+ }
+ continue
+ }
+ if had && cacheable && old.known && old.settled && old.mod.Equal(km.Mod) {
+ next[km.Key] = old
+ continue
+ }
+ body, _, err := s.Get(ctx, km.Key)
+ switch {
+ case errors.Is(err, os.ErrNotExist):
+ // detached since the listing
+ case err != nil && ctx.Err() != nil:
+ stopped = ctx.Err()
+ if had {
+ next[km.Key] = old
+ }
+ case err != nil:
+ next[km.Key] = cachedClaim{mod: km.Mod, unread: true}
+ default:
+ next[km.Key] = cachedClaim{
+ mod: km.Mod, settled: cacheable && now.Sub(km.Mod) >= claimOwnerSettle,
+ known: true, account: claimOwner(body),
+ }
+ }
+ }
+ return next, stopped
+}
+
+// errClaimUnjudged is a claim body the door had to read and could not, so
+// whose it is now is unknown. A listing without it could make the box drop
+// that claim's rows (it may have passed to this account); one with it could
+// name another account's claim. The box's pass fails and changes nothing
+// instead.
+var errClaimUnjudged = errors.New("a claim that could be this account's cannot be read")
+
+// ownClaims is serveClaimListing's rule over a fold, sorted: every claim
+// whose body names sqid, pending ones included, and nothing else. A claim
+// whose ownership is unknown (unread) fails the listing (errClaimUnjudged);
+// one whose stamp is unchanged since a settled read keeps that read's
+// account, so another account's is left out without a GET.
+func ownClaims(sqid string, entries map[string]cachedClaim) ([]string, error) {
+ out := []string{}
+ if sqid == "" {
+ return out, nil
+ }
+ for key, e := range entries {
+ switch {
+ case e.unread:
+ return nil, fmt.Errorf("%s: %w", key, errClaimUnjudged)
+ case e.known && e.account == sqid:
+ out = append(out, key)
+ }
+ }
+ sort.Strings(out)
+ return out, nil
+}
diff --git a/internal/edge/storedoor_claims_test.go b/internal/edge/storedoor_claims_test.go
new file mode 100644
index 000000000..76d5fecc6
--- /dev/null
+++ b/internal/edge/storedoor_claims_test.go
@@ -0,0 +1,486 @@
+package edge
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "net/http"
+ "runtime"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/domains"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// putRawClaim writes one claim body straight into the store, past every
+// attach rule, so a test can lay out exactly the claims it means to.
+func putRawClaim(t *testing.T, s release.Store, host, body string) {
+ t.Helper()
+ if _, err := s.Put(context.Background(), domains.ClaimKey(host), []byte(body), ""); err != nil {
+ t.Fatal(err)
+ }
+}
+
+func putClaimAs(t *testing.T, s release.Store, c domains.Claim) {
+ t.Helper()
+ c.Schema = 1
+ b, err := json.Marshal(c)
+ if err != nil {
+ t.Fatal(err)
+ }
+ putRawClaim(t, s, c.Host, string(b))
+}
+
+func listedClaims(t *testing.T, d *storeDoor) []string {
+ t.Helper()
+ w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil)
+ if w.Code != http.StatusOK {
+ t.Fatalf("claim listing = %d %s", w.Code, w.Body.String())
+ }
+ var keys []string
+ if err := json.Unmarshal(w.Body.Bytes(), &keys); err != nil {
+ t.Fatal(err)
+ }
+ return keys
+}
+
+const claimTestApps = "oncarlos.com"
+
+func putInstanceRecord(t *testing.T, s release.Store, account, app, host string) {
+ t.Helper()
+ if _, err := s.Put(context.Background(), release.AppPrefix(account, app)+"instances/"+host+".json", []byte(`{}`), ""); err != nil {
+ t.Fatal(err)
+ }
+}
+
+// TestStoreDoorClaimListingIsOwnOnly (H5-M8): a fleet token lists its own
+// account's claims, pending ones included, and never another account's,
+// pending or not, wherever it sits: one label under the account's own
+// instance catch-all parent (at an instance's label or not), under its
+// account namespace at any depth (at a host of its own or not), deeper, or
+// anywhere else. A body that does not decode is nobody's; one of a newer
+// schema still carries its account.
+func TestStoreDoorClaimListingIsOwnOnly(t *testing.T) {
+ d, store := newTestDoor(t)
+ d.fleetAccount = func(string) (string, bool) { return "bdq", true }
+ mine := func(host string, pending bool) domains.Claim {
+ return domains.Claim{Host: host, Account: "bdq", App: "web", Pending: pending}
+ }
+ theirs := func(host string, pending bool) domains.Claim {
+ return domains.Claim{Host: host, Account: "bcd", App: "shop", Pending: pending}
+ }
+ // An active instance catch-all, with instances at beta and acme.
+ putClaimAs(t, store, mine("teams.example.com", false))
+ putClaimAs(t, store, domains.Claim{Host: "*.teams.example.com", Account: "bdq", App: "web", Instances: true})
+ putInstanceRecord(t, store, "bdq", "web", "beta.bdq."+claimTestApps)
+ putInstanceRecord(t, store, "bdq", "web", "acme.bdq."+claimTestApps)
+ // An active account namespace, with an instance and a canary host.
+ if _, created, err := domains.AttachAccountNamespace(context.Background(), store, "harbour", claimTestApps, "bdq", "2026-11-11T00:00:00Z", "ops@example.com"); err != nil || !created {
+ t.Fatalf("hold: %v %v", created, err)
+ }
+ putInstanceRecord(t, store, "bdq", "shop", "team.bdq."+claimTestApps)
+ if _, err := store.Put(context.Background(), release.AppPrefix("bdq", "shop")+"channels/canary/c1.json", []byte(`{}`), ""); err != nil {
+ t.Fatal(err)
+ }
+ putClaimAs(t, store, mine("pend.example.net", true))
+ putRawClaim(t, store, "future.example.io", `{"schema":99,"host":"future.example.io","account":"bdq"}`)
+
+ putClaimAs(t, store, theirs("beta.teams.example.com", false))
+ putClaimAs(t, store, theirs("acme.teams.example.com", true))
+ putClaimAs(t, store, theirs("launch.teams.example.com", true))
+ putClaimAs(t, store, theirs("a.beta.teams.example.com", false))
+ putClaimAs(t, store, theirs("team.harbour."+claimTestApps, false))
+ putClaimAs(t, store, theirs("shop.harbour."+claimTestApps, true))
+ putClaimAs(t, store, theirs("c1.shop.harbour."+claimTestApps, false))
+ putClaimAs(t, store, theirs("x.team.harbour."+claimTestApps, false))
+ putClaimAs(t, store, theirs("x.pend.example.net", false))
+ putClaimAs(t, store, theirs("theirs.example.org", false))
+ putClaimAs(t, store, theirs("secret.example.org", true))
+ putClaimAs(t, store, domains.Claim{Host: "*.theirs.example.org", Account: "bcd", App: "shop", Instances: true})
+ putRawClaim(t, store, "junk.teams.example.com", "not json")
+
+ got := strings.Join(listedClaims(t, d), "\n")
+ want := strings.Join([]string{
+ domains.ClaimKey(domains.NamespaceHost("harbour", claimTestApps)),
+ domains.ClaimKey("*.teams.example.com"),
+ domains.ClaimKey("future.example.io"),
+ domains.ClaimKey("pend.example.net"),
+ domains.ClaimKey("teams.example.com"),
+ }, "\n")
+ if got != want {
+ t.Fatalf("listing:\n%s\nwant:\n%s", got, want)
+ }
+
+ // The other account's fleet sees its own claims, and none of these.
+ other, _ := newTestDoor(t)
+ other.store = store
+ other.fleetAccount = func(string) (string, bool) { return "bcd", true }
+ for _, k := range listedClaims(t, other) {
+ if strings.Contains(k, "bdq") || k == domains.ClaimKey("teams.example.com") || k == domains.ClaimKey("pend.example.net") {
+ t.Fatalf("bcd's listing names bdq's claim %s", k)
+ }
+ }
+ if keys := listedClaims(t, other); len(keys) != 12 {
+ t.Fatalf("bcd's listing = %v, want its own 12 claims", keys)
+ }
+}
+
+// claimReadCounter is a ModLister over a DirStore whose stamps are fixed in
+// the past (so the settle bound never applies) and moved by hand, counting
+// the claim GETs that reach it and failing the ones a test asks it to.
+// onGet, when set, runs after each claim GET is counted; gate, when set,
+// holds every listing until it is closed.
+type claimReadCounter struct {
+ *release.DirStore
+ mu sync.Mutex
+ mods map[string]time.Time
+ gets int
+ listings int
+ fails map[string]bool
+ onGet func(n int)
+ gate chan struct{}
+}
+
+func newClaimReadCounter(dir *release.DirStore) *claimReadCounter {
+ return &claimReadCounter{DirStore: dir, mods: map[string]time.Time{}, fails: map[string]bool{}}
+}
+
+func (c *claimReadCounter) ListMod(ctx context.Context, prefix string) ([]release.KeyMod, error) {
+ c.mu.Lock()
+ c.listings++
+ gate := c.gate
+ c.mu.Unlock()
+ if gate != nil {
+ <-gate
+ }
+ keys, err := c.DirStore.List(ctx, prefix)
+ if err != nil {
+ return nil, err
+ }
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ out := make([]release.KeyMod, 0, len(keys))
+ for _, k := range keys {
+ m, ok := c.mods[k]
+ if !ok {
+ m = time.Unix(1_700_000_000, 0)
+ c.mods[k] = m
+ }
+ out = append(out, release.KeyMod{Key: k, Mod: m})
+ }
+ return out, nil
+}
+
+func (c *claimReadCounter) Get(ctx context.Context, key string) ([]byte, string, error) {
+ c.mu.Lock()
+ n := 0
+ if strings.HasPrefix(key, domains.ClaimsPrefix) {
+ c.gets++
+ n = c.gets
+ }
+ fail, onGet := c.fails[key], c.onGet
+ c.mu.Unlock()
+ if n > 0 && onGet != nil {
+ onGet(n)
+ }
+ if fail {
+ return nil, "", errors.New("store blip")
+ }
+ return c.DirStore.Get(ctx, key)
+}
+
+// touch moves key's stamp, so the next fold reads its body again.
+func (c *claimReadCounter) touch(key string) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.mods[key] = c.mods[key].Add(time.Second)
+}
+
+func (c *claimReadCounter) setFail(key string, fail bool) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.fails[key] = fail
+}
+
+func (c *claimReadCounter) claimGets() int {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ return c.gets
+}
+
+func (c *claimReadCounter) counts() (listings, gets int) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ return c.listings, c.gets
+}
+
+func (c *claimReadCounter) setGate(g chan struct{}) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.gate = g
+}
+
+// TestStoreDoorClaimListingCostAndFailure: the listing costs the edge what
+// the box's own claim cache costs (one listing, and a GET only for a claim
+// whose stamp moved). A claim whose stamp is unchanged keeps the account its
+// last settled read found, so another account's is left out with no GET,
+// whatever the store would say now. A claim the door had to read and could
+// not (never read, or its stamp moved) has unknown ownership and fails the
+// listing: the box's pass then changes nothing.
+func TestStoreDoorClaimListingCostAndFailure(t *testing.T) {
+ d, dir := newTestDoor(t)
+ store := newClaimReadCounter(dir)
+ d.store = store
+ putClaimAs(t, dir, domains.Claim{Host: "own.example.com", Account: testSqid, App: "web"})
+ putClaimAs(t, dir, domains.Claim{Host: "theirs.example.org", Account: "zz99", App: "shop"})
+
+ want := domains.ClaimKey("own.example.com")
+ list := func(what string) {
+ t.Helper()
+ if got := strings.Join(listedClaims(t, d), " "); got != want {
+ t.Fatalf("%s = %v, want %v", what, got, want)
+ }
+ }
+ fails := func(what string) {
+ t.Helper()
+ if w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil); w.Code != http.StatusBadGateway || strings.Contains(w.Body.String(), "domains/") {
+ t.Fatalf("%s = %d %q, want the door's 502 store error", what, w.Code, w.Body.String())
+ }
+ }
+ list("first listing")
+ list("steady listing")
+ if n := store.claimGets(); n != 2 {
+ t.Fatalf("two listings cost %d claim GETs, want 2 (the first fold's)", n)
+ }
+
+ // Another account's claim, stamp unchanged: no GET, still left out.
+ theirs := domains.ClaimKey("theirs.example.org")
+ store.setFail(theirs, true)
+ list("listing over an unchanged claim the store cannot read")
+ if n := store.claimGets(); n != 2 {
+ t.Fatalf("an unchanged claim was read again (%d GETs)", n)
+ }
+ // Its stamp moves and the read fails: whose it is now is unknown.
+ store.touch(theirs)
+ fails("listing with a changed claim that cannot be read")
+ store.setFail(theirs, false)
+ list("listing once it reads")
+
+ // This account's own goes unreadable: the listing fails.
+ own := domains.ClaimKey("own.example.com")
+ store.setFail(own, true)
+ store.touch(own)
+ fails("listing with this account's unreadable claim")
+ store.setFail(own, false)
+ list("listing once that reads")
+
+ // A claim never read: unknown too.
+ fresh := domains.ClaimKey("fresh.example.org")
+ putClaimAs(t, dir, domains.Claim{Host: "fresh.example.org", Account: "zz99", App: "shop"})
+ store.setFail(fresh, true)
+ fails("listing with a never-read unreadable claim")
+ store.setFail(fresh, false)
+ list("listing once the new claim reads")
+}
+
+// TestClaimFoldKeepsProgressWhenCancelled: a fold cut off part way (its
+// request gone) still publishes every body it read, so the next fold reads
+// only the rest. Without it a cold edge with more claims than one request
+// can read in time never converges.
+func TestClaimFoldKeepsProgressWhenCancelled(t *testing.T) {
+ _, dir := newTestDoor(t)
+ store := newClaimReadCounter(dir)
+ for _, h := range []string{"a.example.com", "b.example.com", "c.example.com", "d.example.com"} {
+ putClaimAs(t, dir, domains.Claim{Host: h, Account: "zz99", App: "shop"})
+ }
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ store.onGet = func(n int) {
+ if n == 2 {
+ cancel()
+ }
+ }
+ entries, err := foldClaims(ctx, store, nil)
+ if !errors.Is(err, context.Canceled) {
+ t.Fatalf("cancelled fold: err = %v, want context.Canceled", err)
+ }
+ read := 0
+ for _, e := range entries {
+ if e.known {
+ read++
+ }
+ }
+ if read != 2 {
+ t.Fatalf("cancelled fold published %d read entries (%v), want the 2 it read", read, entries)
+ }
+ store.onGet = nil
+ entries, err = foldClaims(context.Background(), store, entries)
+ if gets := store.claimGets(); err != nil || len(entries) != 4 || gets != 4 {
+ t.Fatalf("resumed fold: %d entries after %d GETs, err %v; want 4 after 4 (the 2 left)", len(entries), gets, err)
+ }
+}
+
+// TestStoreDoorClaimListingTransferWithFailedRead: a claim whose stamp moved
+// and whose body then fails to read has unknown ownership, whatever it said
+// before. Here it passed from another account to this one; a listing that
+// left it out on the strength of the old owner would tell the box it holds
+// no such claim, and its pass would remove the claim's rows. The listing
+// fails instead (502), so the pass changes nothing.
+func TestStoreDoorClaimListingTransferWithFailedRead(t *testing.T) {
+ d, dir := newTestDoor(t)
+ store := newClaimReadCounter(dir)
+ d.store = store
+ putClaimAs(t, dir, domains.Claim{Host: "own.example.com", Account: testSqid, App: "web"})
+ putClaimAs(t, dir, domains.Claim{Host: "moving.example.com", Account: "zz99", App: "shop"})
+ if got := strings.Join(listedClaims(t, d), " "); got != domains.ClaimKey("own.example.com") {
+ t.Fatalf("before the transfer: %v", got)
+ }
+ key := domains.ClaimKey("moving.example.com")
+ if err := dir.Delete(context.Background(), key); err != nil {
+ t.Fatal(err)
+ }
+ putClaimAs(t, dir, domains.Claim{Host: "moving.example.com", Account: testSqid, App: "web"})
+ store.touch(key)
+ store.setFail(key, true)
+ if w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil); w.Code != http.StatusBadGateway || strings.Contains(w.Body.String(), "domains/") {
+ t.Fatalf("listing after a transfer whose body failed to read = %d %q, want the door's 502", w.Code, w.Body.String())
+ }
+ store.setFail(key, false)
+ want := domains.ClaimKey("moving.example.com") + " " + domains.ClaimKey("own.example.com")
+ if got := strings.Join(listedClaims(t, d), " "); got != want {
+ t.Fatalf("once it reads: %v, want %v", got, want)
+ }
+}
+
+// waitUntil polls done until it holds, failing the test after 10 s.
+func waitUntil(t *testing.T, what string, done func() bool) {
+ t.Helper()
+ deadline := time.Now().Add(10 * time.Second)
+ for !done() {
+ if time.Now().After(deadline) {
+ t.Fatalf("timed out waiting for %s", what)
+ }
+ runtime.Gosched()
+ }
+}
+
+// TestClaimListingSingleFlight: at most one claim refresh runs per edge.
+// Concurrent cold callers wait on it and share its result (one listing, one
+// GET per claim between them); a caller that goes away does not stop it; a
+// caller arriving mid-fold joins it rather than starting a second one; and
+// what it read is published whole, so the next refresh reads nothing again.
+// With one refresh at a time, an older fold can never publish over a newer
+// one's entries.
+func TestClaimListingSingleFlight(t *testing.T) {
+ _, dir := newTestDoor(t)
+ store := newClaimReadCounter(dir)
+ for _, h := range []string{"a.example.com", "b.example.com", "c.example.com"} {
+ putClaimAs(t, dir, domains.Claim{Host: h, Account: "zz99", App: "shop"})
+ }
+ var cache claimOwnerCache
+ waiting := func(n int) func() bool {
+ return func() bool {
+ cache.mu.Lock()
+ defer cache.mu.Unlock()
+ return cache.inflight != nil && cache.inflight.waiters == n
+ }
+ }
+
+ store.setGate(make(chan struct{}))
+ const callers = 8
+ errs := make(chan error, callers)
+ for i := 0; i < callers; i++ {
+ go func() {
+ entries, err := cache.snapshot(context.Background(), store)
+ if err == nil && len(entries) != 3 {
+ err = errors.New("short result")
+ }
+ errs <- err
+ }()
+ }
+ waitUntil(t, "8 waiting callers", waiting(callers))
+ close(store.gate)
+ for i := 0; i < callers; i++ {
+ if err := <-errs; err != nil {
+ t.Fatalf("caller: %v", err)
+ }
+ }
+ if listings, gets := store.counts(); listings != 1 || gets != 3 {
+ t.Fatalf("8 concurrent cold callers cost %d listings and %d GETs, want 1 and 3", listings, gets)
+ }
+
+ // One caller goes away mid-fold, another joins it.
+ for _, h := range []string{"a.example.com", "b.example.com"} {
+ store.touch(domains.ClaimKey(h))
+ }
+ store.setGate(make(chan struct{}))
+ ctx, cancel := context.WithCancel(context.Background())
+ go func() {
+ _, err := cache.snapshot(ctx, store)
+ errs <- err
+ }()
+ waitUntil(t, "the first caller", waiting(1))
+ go func() {
+ _, err := cache.snapshot(context.Background(), store)
+ errs <- err
+ }()
+ waitUntil(t, "the second caller to join", waiting(2))
+ cancel()
+ if err := <-errs; !errors.Is(err, context.Canceled) {
+ t.Fatalf("departed caller: err = %v, want context.Canceled", err)
+ }
+ close(store.gate)
+ if err := <-errs; err != nil {
+ t.Fatalf("joined caller: %v", err)
+ }
+ if listings, gets := store.counts(); listings != 2 || gets != 5 {
+ t.Fatalf("after the shared refresh: %d listings, %d GETs; want 2 and 5 (one fold, the 2 changed claims)", listings, gets)
+ }
+ store.setGate(nil)
+ if _, err := cache.snapshot(context.Background(), store); err != nil {
+ t.Fatal(err)
+ }
+ if _, gets := store.counts(); gets != 5 {
+ t.Fatalf("the refresh's entries were not all published: the next one read %d bodies again", gets-5)
+ }
+}
+
+// TestClaimListingAdmission: claim listings are admitted before any work,
+// globally and per account. An account at its cap gets 503 with a
+// Retry-After, and another account is still admitted.
+func TestClaimListingAdmission(t *testing.T) {
+ defer func(g, a int) { claimListingsMax, claimListingsPerAccount = g, a }(claimListingsMax, claimListingsPerAccount)
+ claimListingsMax, claimListingsPerAccount = 3, 2
+ d, store := newTestDoor(t)
+ putClaimAs(t, store, domains.Claim{Host: "own.example.com", Account: testSqid, App: "web"})
+
+ var held []func()
+ for i := 0; i < 2; i++ {
+ release, ok := d.claims.admit(testSqid)
+ if !ok {
+ t.Fatalf("admission %d of %s's 2 refused", i+1, testSqid)
+ }
+ held = append(held, release)
+ }
+ w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil)
+ if w.Code != http.StatusServiceUnavailable || w.Header().Get("Retry-After") == "" || strings.Contains(w.Body.String(), "domains/") {
+ t.Fatalf("listing past the account's cap = %d %q (Retry-After %q), want 503 with Retry-After", w.Code, w.Body.String(), w.Header().Get("Retry-After"))
+ }
+ other, ok := d.claims.admit("zz99")
+ if !ok {
+ t.Fatal("another account was refused while only " + testSqid + " was at its cap")
+ }
+ if _, ok := d.claims.admit("qq77"); ok {
+ t.Fatal("a fourth listing was admitted past the global cap of 3")
+ }
+ other()
+ for _, release := range held {
+ release()
+ }
+ if keys := listedClaims(t, d); len(keys) != 1 {
+ t.Fatalf("listing once admitted = %v", keys)
+ }
+}
diff --git a/internal/edge/storedoor_test.go b/internal/edge/storedoor_test.go
index 75fce3690..baa550561 100644
--- a/internal/edge/storedoor_test.go
+++ b/internal/edge/storedoor_test.go
@@ -998,7 +998,9 @@ func TestStoreDoorOnlyOnReservedHost(t *testing.T) {
// person's address), its account and app, its path map, and whether anyone
// had proved it. It now reads only its own account's verified claims,
// without created_by; every other claim body answers the door's
-// byte-identical 404. The listing still names every claimed hostname.
+// byte-identical 404. The listing names its own account's claims, pending
+// ones included, and since H5-M8 no other account's
+// (TestStoreDoorClaimListingIsOwnOnly).
func TestStoreDoorClaimsAreOwnAccountAndRedacted(t *testing.T) {
d, store := newTestDoor(t)
ctx := context.Background()
@@ -1013,12 +1015,11 @@ func TestStoreDoorClaimsAreOwnAccountAndRedacted(t *testing.T) {
put(domains.Claim{Host: "theirs.example.com", Account: "zz99", App: "shop", CreatedBy: "sam@keymail.dev"})
w := doorDo(d, "GET", "/store/list?prefix=domains/", "", nil)
- // Every claimed NAME is listed, whoever holds it: the alias pass decides
- // "someone else claimed this" from the listing. Bodies are what is
- // withheld (below).
+ // Its own claims, pending included; no other account's claim is listed
+ // (H5-M8).
if w.Code != http.StatusOK || strings.TrimSpace(w.Body.String()) !=
- `["domains/own.example.com.json","domains/pending.example.com.json","domains/theirs.example.com.json"]` {
- t.Fatalf("listing = %d %s, want every claimed hostname", w.Code, w.Body.String())
+ `["domains/own.example.com.json","domains/pending.example.com.json"]` {
+ t.Fatalf("listing = %d %s, want this account's claims only", w.Code, w.Body.String())
}
w = doorDo(d, "GET", "/store/o/domains/own.example.com.json", "", nil)
if w.Code != http.StatusOK {
@@ -1456,8 +1457,8 @@ func TestStoreDoorManagedReadyKeyMatchesConsole(t *testing.T) {
// box on a customer fleet reads its own account's namespace claim through
// the store door, which is all it needs to derive the account's names. The
// key carries a "*"; the door serves it like any other claim key. Another
-// account's fleet sees the name in the listing and gets the door's 404 for
-// the body, which its alias pass reads as a decision, not a failure.
+// account's fleet gets the door's 404 for the body (and, since H5-M8, does
+// not see the name in its listing at all).
func TestStoreDoorReturnsOwnNamespaceClaim(t *testing.T) {
const apps = "oncarlos.com"
doorFor := func(account string) (*storeDoor, *release.DirStore) {
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 4375ca60d..7761db7d1 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -315,3 +315,4 @@ plan14-root-reads-gvisor-slice3-containment.tsv 0fdff597ef83fb9966e07c70b4283001
plan14-root-reads-catchall-stamp-now.tsv c9940b1b6fb0146a30a2fb2b557f898ac6d28ba80df7dfe642cc623b581f347b
plan14-root-reads-gvisor-followups.tsv bf71949458c3c44c86b778a2a3e0d0b352268f5640c28b6b5d2f25bc2a5318b2
plan14-root-reads-instance-usage.tsv e3c8bc6a560e863ed44c7ab2f9367a4347ec767d8da2c3b1f1eafc90e45c89e8
+plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv a6a19c800d55f99ed1c70068e38ffa66aef7af8f55199e97e986d9bbb0e0d80d
diff --git a/internal/provision/testdata/plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv b/internal/provision/testdata/plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv
new file mode 100644
index 000000000..cf6e99f00
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv
@@ -0,0 +1,6 @@
+# Census overlay sec-h5-m8-fleet-hostnames, written by census-propose (#369). census-ruling-sec-h5-m8-fleet-hostnames, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-sec-h5-m8-fleet-hostnames.md.
+# 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy dae97a40ae3bec3537122f48e9e8ec99577253fe4869ec94dc272950b2223356 internal/edge/storedoor.go storeDoor.serveListing legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sec-h5-m8-fleet-hostnames;basis=passes the caller sqid to serveClaimListing (H5-M8: the claim listing names only the fleet account own claims, pending included; admitted per account before any work, one shared claim refresh); no read added, no store or file reach changed file:Query@204 b608051f9f1a7bc5d3093c4757ecee3e215b0c69f9215ce84521a632e5b2c237
+internal/edge/storedoor.go storeDoor.serveListing legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sec-h5-m8-fleet-hostnames;basis=passes the caller sqid to serveClaimListing (H5-M8: the claim listing names only the fleet account own claims, pending included; admitted per account before any work, one shared claim refresh); no read added, no store or file reach changed file:Query@204 b608051f9f1a7bc5d3093c4757ecee3e215b0c69f9215ce84521a632e5b2c237
+@coverage internal/domains 64cbc16b2dcd675f36cdf465efc3690a5ff648252c26473076477a8b0ba534a2
+@coverage internal/edge 06d9ba25595201e966c43ab06689bed1a8433b06d86eca1847c67a5e8b24a0bc