carlos / platform Public

console: one admission rule for every data transfer (H3-M6)

Fixes hunt finding H3-M6: creates, moves and app placements could land
an instance on a host still holding a deleted record's leftover data.
Every data transfer now asks one rule (hostname history active and the
destination examined and covered, else refuse with operator advice);
staged moves carry a checked:<dest> stamp; the activator refuses to
seed over a database it cannot attribute instead of purging it.
Review: Astra + Fable R1-R3, Paul's refuse-up-front ruling, final cuts;
census APPROVE (H3M6-R3-astra, H3M6-R3census3-astra,
H3M6-copycensus-astra); copy pass applied.

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

Squashed from sec-h3-m6-leftover-host into main.
claude agent, operated by paul@keymail.dev b27b45592dee7995f9a4600bd5b854b69a2c2e28 parent 1dee7c4
33 files changed, +1,905 −94
  • approved_moves_copy_test.go +3 −0
  • docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md +136 −0
  • docs/superpowers/notes/census-proposal-sec-h3-m6-leftover-host.md +25 −0
  • docs/superpowers/plans/2026-10-06-moves-phase1-copy.md +14 −0
  • internal/activator/move_h3m6_test.go +70 −0
  • internal/activator/seedplace.go +55 −1
  • internal/activator/seedplace_h3m6_linux_test.go +114 −0
  • internal/activator/seedplace_linux_test.go +24 −18
  • internal/console/apiinstancemove.go +11 −0
  • internal/console/apiinstancemove_offline.go +10 −1
  • internal/console/apiinstances.go +1 −1
  • internal/console/apiinstances_haenable_test.go +4 −0
  • internal/console/apisidecars.go +1 −0
  • internal/console/createleftovers.go +123 −52
  • internal/console/createleftovers_h3m6_test.go +189 −0
  • internal/console/createleftovers_test.go +26 −16
  • internal/console/datatransfer.go +221 −0
  • internal/console/datatransfer_guard_test.go +178 −0
  • internal/console/fleets.go +23 −0
  • internal/console/ha_born_test.go +4 −0
  • internal/console/ha_pool_scope_test.go +32 −3
  • internal/console/hacreate_test.go +3 −0
  • internal/console/hapool_test.go +3 −0
  • internal/console/hunt_H3-M6_test.go +36 −0
  • internal/console/moveleftovers.go +75 −0
  • internal/console/moveleftovers_h3m6_test.go +328 −0
  • internal/console/placeleftovers_h3m6_test.go +126 −0
  • internal/provision/h3m6_leftover_census_test.go +35 −0
  • internal/provision/offline_move.go +12 −1
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/provision.go +10 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-sec-h3-m6-leftover-host.tsv +11 −0

CI passed — 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-BRIUTG
.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/smithy-go v1.28.1
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/aws/aws-sdk-go-v2/service/sns v1.43.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/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading golang.org/x/sys v0.49.0
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/cespare/xxhash/v2 v2.3.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
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/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
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 github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
=== launchctx (4 s, from +0 s)
ok  	amadan.net/carlos/platform.git/launchctx	0.015s
?   	amadan.net/carlos/platform.git/launchctx/controlname	[no test files]
?   	amadan.net/carlos/platform.git/launchctx/wireid	[no test files]
=== vet (176 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/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 modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== vet-tags (193 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/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (386 s, from +14 s)
ok  	github.com/carlosframework/platform/cmd/carlos-media	128.528s
?   	github.com/carlosframework/platform/cmd/changelog	[no test files]
ok  	github.com/carlosframework/platform/cmd/console	219.021s
ok  	github.com/carlosframework/platform/cmd/mediaimage	41.218s
ok  	github.com/carlosframework/platform/cmd/moveprobe	15.129s
ok  	github.com/carlosframework/platform/cmd/pricebook-export	0.057s
ok  	github.com/carlosframework/platform/cmd/rootfswitness	0.198s
ok  	github.com/carlosframework/platform/cmd/runsc-assets	0.176s
ok  	github.com/carlosframework/platform/cmd/zddprobe	1.053s
ok  	github.com/carlosframework/platform/internal/agentsock	0.097s
ok  	github.com/carlosframework/platform/internal/alerting	0.035s
ok  	github.com/carlosframework/platform/internal/analytics	0.297s
ok  	github.com/carlosframework/platform/internal/appconfig	43.936s
ok  	github.com/carlosframework/platform/internal/apperr	0.378s
ok  	github.com/carlosframework/platform/internal/applog	4.029s
ok  	github.com/carlosframework/platform/internal/apppolicy	1.950s
ok  	github.com/carlosframework/platform/internal/assetcache	0.497s
ok  	github.com/carlosframework/platform/internal/awsinv	0.022s
ok  	github.com/carlosframework/platform/internal/awsmanaged	9.683s
ok  	github.com/carlosframework/platform/internal/awsregiongroup	0.439s
ok  	github.com/carlosframework/platform/internal/awsterminations	0.036s
ok  	github.com/carlosframework/platform/internal/backupswords	0.011s
ok  	github.com/carlosframework/platform/internal/billing	0.124s
ok  	github.com/carlosframework/platform/internal/billing/billingtest	0.055s
ok  	github.com/carlosframework/platform/internal/billingstripe	1.837s
ok  	github.com/carlosframework/platform/internal/boxchoice	0.027s
ok  	github.com/carlosframework/platform/internal/boxid	2.725s
?   	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.010s
ok  	github.com/carlosframework/platform/internal/boxself	0.262s
ok  	github.com/carlosframework/platform/internal/boxvolumes	0.045s
ok  	github.com/carlosframework/platform/internal/caps	4.110s
ok  	github.com/carlosframework/platform/internal/certwarm	0.005s
ok  	github.com/carlosframework/platform/internal/cgroup	1.470s
ok  	github.com/carlosframework/platform/internal/changelog	3.615s
ok  	github.com/carlosframework/platform/internal/clamd	0.082s
?   	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	16.636s
ok  	github.com/carlosframework/platform/internal/compute	0.052s
ok  	github.com/carlosframework/platform/internal/consolefleet	0.014s
?   	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.887s
ok  	github.com/carlosframework/platform/internal/dbdoor/dbdoortest	0.123s
ok  	github.com/carlosframework/platform/internal/dbquery	0.032s
ok  	github.com/carlosframework/platform/internal/dbreads	3.340s
?   	github.com/carlosframework/platform/internal/dbreads/dbreadstest	[no test files]
ok  	github.com/carlosframework/platform/internal/dbverify	0.012s
ok  	github.com/carlosframework/platform/internal/demo	0.011s
ok  	github.com/carlosframework/platform/internal/demobuild	4.579s
ok  	github.com/carlosframework/platform/internal/democlaim	0.407s
ok  	github.com/carlosframework/platform/internal/devbox	17.551s
ok  	github.com/carlosframework/platform/internal/dnsrec	0.009s
ok  	github.com/carlosframework/platform/internal/docsite	0.076s
ok  	github.com/carlosframework/platform/internal/domainreg	0.023s
ok  	github.com/carlosframework/platform/internal/domains	74.031s
ok  	github.com/carlosframework/platform/internal/doorkey	0.016s
ok  	github.com/carlosframework/platform/internal/economics	0.023s
ok  	github.com/carlosframework/platform/internal/edgefence	0.134s
ok  	github.com/carlosframework/platform/internal/edgeguard	0.220s
?   	github.com/carlosframework/platform/internal/edgeproof	[no test files]
ok  	github.com/carlosframework/platform/internal/edgesfile	0.079s
ok  	github.com/carlosframework/platform/internal/egressaddr	0.015s
ok  	github.com/carlosframework/platform/internal/execsandbox	105.843s
ok  	github.com/carlosframework/platform/internal/fileacl	0.010s
ok  	github.com/carlosframework/platform/internal/fleetapi	1.407s
ok  	github.com/carlosframework/platform/internal/fleetstore	0.018s
ok  	github.com/carlosframework/platform/internal/fxrate	0.031s
ok  	github.com/carlosframework/platform/internal/gate	4.679s
ok  	github.com/carlosframework/platform/internal/genselect	0.075s
ok  	github.com/carlosframework/platform/internal/geo	0.081s
ok  	github.com/carlosframework/platform/internal/geoip	0.084s
ok  	github.com/carlosframework/platform/internal/groupadmission	0.008s
ok  	github.com/carlosframework/platform/internal/grouprollaws	17.166s
ok  	github.com/carlosframework/platform/internal/hadeparture	0.036s
ok  	github.com/carlosframework/platform/internal/hafresh	0.013s
ok  	github.com/carlosframework/platform/internal/hairpin	0.257s
ok  	github.com/carlosframework/platform/internal/historyreadback	1.095s
ok  	github.com/carlosframework/platform/internal/hostactors	22.414s
ok  	github.com/carlosframework/platform/internal/hostbox	23.157s
ok  	github.com/carlosframework/platform/internal/hostclaim	2.722s
ok  	github.com/carlosframework/platform/internal/hostenv	0.048s
ok  	github.com/carlosframework/platform/internal/hostevidence	0.012s
ok  	github.com/carlosframework/platform/internal/hostexec	27.802s
ok  	github.com/carlosframework/platform/internal/hostfence	0.157s
ok  	github.com/carlosframework/platform/internal/hostfiles	27.089s
ok  	github.com/carlosframework/platform/internal/hostfloor	0.433s
ok  	github.com/carlosframework/platform/internal/hostguard	1.583s
ok  	github.com/carlosframework/platform/internal/hostops	7.245s
?   	github.com/carlosframework/platform/internal/hostops/fencerelease	[no test files]
ok  	github.com/carlosframework/platform/internal/hostops/internal/fencerelease	0.022s
ok  	github.com/carlosframework/platform/internal/hostquarantine	0.011s
ok  	github.com/carlosframework/platform/internal/hostrelocate	1.592s
ok  	github.com/carlosframework/platform/internal/hostresolve	0.539s
ok  	github.com/carlosframework/platform/internal/hostwrite	0.015s
ok  	github.com/carlosframework/platform/internal/identity	0.012s
ok  	github.com/carlosframework/platform/internal/infraview	0.009s
ok  	github.com/carlosframework/platform/internal/ingresshealth	0.014s
ok  	github.com/carlosframework/platform/internal/ingresshealth/awstg	0.009s
ok  	github.com/carlosframework/platform/internal/instancectl	66.351s
ok  	github.com/carlosframework/platform/internal/instanceexec	9.088s
ok  	github.com/carlosframework/platform/internal/instancefs	16.211s
ok  	github.com/carlosframework/platform/internal/instancekey	0.009s
ok  	github.com/carlosframework/platform/internal/instanceupdates	0.024s
ok  	github.com/carlosframework/platform/internal/interactive	0.707s
ok  	github.com/carlosframework/platform/internal/launchd	0.005s
ok  	github.com/carlosframework/platform/internal/layout	20.979s
ok  	github.com/carlosframework/platform/internal/layout/pubclass	105.420s
ok  	github.com/carlosframework/platform/internal/lbhealth	0.009s
ok  	github.com/carlosframework/platform/internal/lease	149.963s
ok  	github.com/carlosframework/platform/internal/lease/leasetest	1.163s
ok  	github.com/carlosframework/platform/internal/lease/locktest	0.031s
ok  	github.com/carlosframework/platform/internal/ledger	0.050s
ok  	github.com/carlosframework/platform/internal/mail	0.958s
ok  	github.com/carlosframework/platform/internal/mailer	0.798s
ok  	github.com/carlosframework/platform/internal/mailsubmit	1.299s
ok  	github.com/carlosframework/platform/internal/mailwire	0.006s
ok  	github.com/carlosframework/platform/internal/maintenance	0.159s
ok  	github.com/carlosframework/platform/internal/maintenanceexec	8.567s
ok  	github.com/carlosframework/platform/internal/maintenanceguard	0.241s
ok  	github.com/carlosframework/platform/internal/managedboot	3.582s
?   	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.806s
ok  	github.com/carlosframework/platform/internal/media/mediatest	0.010s
ok  	github.com/carlosframework/platform/internal/mediaaws	63.002s
ok  	github.com/carlosframework/platform/internal/mediahandler	41.580s
ok  	github.com/carlosframework/platform/internal/mediajobs	0.884s
ok  	github.com/carlosframework/platform/internal/medialocal	10.089s
ok  	github.com/carlosframework/platform/internal/metrics	0.114s
ok  	github.com/carlosframework/platform/internal/minorunits	0.009s
ok  	github.com/carlosframework/platform/internal/moves	55.903s
ok  	github.com/carlosframework/platform/internal/moves/archive	2.660s
ok  	github.com/carlosframework/platform/internal/moves/offlinerun	0.060s
ok  	github.com/carlosframework/platform/internal/namedunits	0.033s
ok  	github.com/carlosframework/platform/internal/objstore	2.242s
ok  	github.com/carlosframework/platform/internal/ops	16.088s
ok  	github.com/carlosframework/platform/internal/pageindex	3.980s
ok  	github.com/carlosframework/platform/internal/parity	0.123s
?   	github.com/carlosframework/platform/internal/parity/cmd/parity-doc	[no test files]
ok  	github.com/carlosframework/platform/internal/park	0.785s
ok  	github.com/carlosframework/platform/internal/perf	0.191s
ok  	github.com/carlosframework/platform/internal/plans	0.103s
ok  	github.com/carlosframework/platform/internal/privatefile	0.014s
ok  	github.com/carlosframework/platform/internal/provision	236.024s
ok  	github.com/carlosframework/platform/internal/proxyproto	0.947s
ok  	github.com/carlosframework/platform/internal/publicrelease	0.085s
ok  	github.com/carlosframework/platform/internal/ratelimit	0.239s
ok  	github.com/carlosframework/platform/internal/regionlabel	0.060s
ok  	github.com/carlosframework/platform/internal/regionname	0.042s
ok  	github.com/carlosframework/platform/internal/registrar	0.011s
ok  	github.com/carlosframework/platform/internal/registrar/openprovider	0.901s
?   	github.com/carlosframework/platform/internal/registrar/registrartest	[no test files]
ok  	github.com/carlosframework/platform/internal/registry	85.200s
ok  	github.com/carlosframework/platform/internal/relay	7.588s
ok  	github.com/carlosframework/platform/internal/release	129.712s
?   	github.com/carlosframework/platform/internal/release/requestwitness	[no test files]
ok  	github.com/carlosframework/platform/internal/replicagen	0.088s
ok  	github.com/carlosframework/platform/internal/replicas	0.146s
ok  	github.com/carlosframework/platform/internal/reqrec	8.587s
ok  	github.com/carlosframework/platform/internal/rollout	11.703s
ok  	github.com/carlosframework/platform/internal/rolloutwords	0.022s
ok  	github.com/carlosframework/platform/internal/rootaws	104.355s
ok  	github.com/carlosframework/platform/internal/rootfsimage	1.416s
ok  	github.com/carlosframework/platform/internal/rootparticipation	0.111s
ok  	github.com/carlosframework/platform/internal/rootstate	0.043s
ok  	github.com/carlosframework/platform/internal/runs	0.821s
ok  	github.com/carlosframework/platform/internal/s3compat	0.023s
ok  	github.com/carlosframework/platform/internal/s3fake	1.481s
ok  	github.com/carlosframework/platform/internal/s3meter	0.660s
ok  	github.com/carlosframework/platform/internal/safefile	0.032s
ok  	github.com/carlosframework/platform/internal/schedule	20.939s
ok  	github.com/carlosframework/platform/internal/seeds	0.121s
ok  	github.com/carlosframework/platform/internal/share	0.033s
ok  	github.com/carlosframework/platform/internal/sim/litestreamfacts	4.645s
ok  	github.com/carlosframework/platform/internal/sim/mediajobs	51.770s
ok  	github.com/carlosframework/platform/internal/sim/regionha	21.496s
ok  	github.com/carlosframework/platform/internal/status	0.388s
ok  	github.com/carlosframework/platform/internal/steering	0.216s
ok  	github.com/carlosframework/platform/internal/stopevidence	0.416s
ok  	github.com/carlosframework/platform/internal/storecfg	0.482s
ok  	github.com/carlosframework/platform/internal/svcrole	0.013s
ok  	github.com/carlosframework/platform/internal/systemd	6.699s
?   	github.com/carlosframework/platform/internal/systemdshow	[no test files]
ok  	github.com/carlosframework/platform/internal/team	3.421s
ok  	github.com/carlosframework/platform/internal/teamcontract	0.168s
ok  	github.com/carlosframework/platform/internal/telemetry	0.019s
ok  	github.com/carlosframework/platform/internal/termfence	3.124s
ok  	github.com/carlosframework/platform/internal/timerspec	0.018s
ok  	github.com/carlosframework/platform/internal/tsidentity	4.256s
ok  	github.com/carlosframework/platform/internal/tunnelclient	0.400s
ok  	github.com/carlosframework/platform/internal/unixdial	0.027s
ok  	github.com/carlosframework/platform/internal/updatewords	0.059s
ok  	github.com/carlosframework/platform/internal/upstreamguard	0.013s
?   	github.com/carlosframework/platform/internal/upstreamguard/guardtest	[no test files]
ok  	github.com/carlosframework/platform/internal/usage	0.162s
ok  	github.com/carlosframework/platform/internal/version	0.009s
ok  	github.com/carlosframework/platform/internal/vet	2.925s
ok  	github.com/carlosframework/platform/internal/zonehost	0.020s
ok  	github.com/carlosframework/platform/internal/zonehost/route53zones	0.053s
?   	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.021s
ok  	github.com/carlosframework/platform/scripts/pathmapcheck	0.093s
ok  	github.com/carlosframework/platform/scripts/region-ha-g2/fixture	5.237s
ok  	github.com/carlosframework/platform/scripts/stateless-replicas-drill	1.280s
ok  	github.com/carlosframework/platform/scripts/witness-pointer	0.030s
=== cutover-witness (163 s, from +14 s)
ok  	github.com/carlosframework/platform	2.699s
=== internal_grouproll@0 (279 s, from +74 s)
ok  	github.com/carlosframework/platform/internal/grouproll	278.055s
=== internal_grouproll@1 (281 s, from +74 s)
ok  	github.com/carlosframework/platform/internal/grouproll	280.041s
=== internal_activator@0 (155 s, from +148 s)
ok  	github.com/carlosframework/platform/internal/activator	148.869s
=== internal_activator@1 (139 s, from +148 s)
ok  	github.com/carlosframework/platform/internal/activator	133.557s
=== internal_activator@2 (141 s, from +148 s)
ok  	github.com/carlosframework/platform/internal/activator	136.136s
=== internal_activator@3 (168 s, from +148 s)
ok  	github.com/carlosframework/platform/internal/activator	162.815s
=== internal_edge@0 (205 s, from +168 s)
ok  	github.com/carlosframework/platform/internal/edge	194.729s
=== internal_edge@1 (146 s, from +168 s)
ok  	github.com/carlosframework/platform/internal/edge	136.069s
=== internal_edge@2 (155 s, from +168 s)
ok  	github.com/carlosframework/platform/internal/edge	144.058s
=== internal_edge@3 (225 s, from +168 s)
ok  	github.com/carlosframework/platform/internal/edge	214.272s
=== root@0 (142 s, from +174 s)
ok  	github.com/carlosframework/platform	132.895s
=== root@1 (111 s, from +174 s)
ok  	github.com/carlosframework/platform	101.039s
=== root@2 (122 s, from +174 s)
ok  	github.com/carlosframework/platform	112.012s
=== root@3 (117 s, from +174 s)
ok  	github.com/carlosframework/platform	105.292s
=== root@4 (106 s, from +175 s)
ok  	github.com/carlosframework/platform	95.103s
=== internal_host@0 (174 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	170.040s
=== internal_host@1 (155 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	150.689s
=== internal_host@2 (172 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	167.088s
=== internal_host@3 (196 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	191.731s
=== internal_host@4 (243 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	238.888s
=== internal_host@5 (261 s, from +219 s)
ok  	github.com/carlosframework/platform/internal/host	256.030s
=== internal_console@0 (178 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	169.923s
=== internal_console@1 (195 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	187.007s
=== internal_console@2 (233 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	225.463s
=== internal_console@3 (253 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	245.036s
=== internal_console@4 (218 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	208.862s
=== internal_console@5 (223 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	216.155s
=== internal_console@6 (239 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	231.057s
=== internal_console@7 (239 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	230.693s
=== internal_console@8 (241 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	233.535s
=== internal_console@9 (261 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	252.932s
=== internal_console@10 (231 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	223.981s
=== internal_console@11 (258 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	250.444s
=== internal_console@12 (354 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	346.242s
=== internal_console@13 (232 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	223.995s
=== internal_console@14 (226 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	217.871s
=== internal_console@15 (230 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	222.906s
=== internal_console@16 (240 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	232.512s
=== internal_console@17 (259 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	249.956s
=== internal_console@18 (220 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	213.220s
=== internal_console@19 (233 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	224.961s
=== internal_console@20 (241 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	232.864s
=== internal_console@21 (238 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	229.480s
=== internal_console@22 (234 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	226.426s
=== internal_console@23 (247 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	240.151s
=== lists: internal_console 226 s, internal_edge 167 s, internal_activator 147 s, internal_host 218 s, root 173 s, internal_grouproll 73 s
=== cpu: the gate used 13164 cpu-seconds in 582 s, about 22.6 of 32 cores; the machine as a whole was 75% busy
=== opentofu ===
opentofu: 40 test files in 11 suites, OpenTofu v1.13.9
  initialised in 14 s
  ok      17 s  infra/modules/box-fence-writer/tests/writer.tftest.hcl  Success! 1 passed, 0 failed.
  ok      19 s  infra/modules/deployment-buckets/tests/console_floors.tftest.hcl  Success! 1 passed, 0 failed.
  ok      28 s  infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      21 s  infra/modules/deployment-buckets/tests/db_reads.tftest.hcl  Success! 1 passed, 0 failed.
  ok      20 s  infra/modules/deployment-buckets/tests/evidence.tftest.hcl  Success! 1 passed, 0 failed.
  ok      32 s  infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl  Success! 3 passed, 0 failed.
  ok      26 s  infra/modules/deployment-buckets/tests/media_results.tftest.hcl  Success! 2 passed, 0 failed.
  ok      29 s  infra/modules/deployment-buckets/tests/published_floors.tftest.hcl  Success! 3 passed, 0 failed.
  ok      82 s  infra/modules/media-engine/tests/media_engine.tftest.hcl  Success! 24 passed, 0 failed.
  ok      25 s  infra/modules/pdf-host/tests/computed.tftest.hcl  Success! 2 passed, 0 failed.
  ok      57 s  infra/modules/pdf-host/tests/pdf_host.tftest.hcl  Success! 24 passed, 0 failed.
  ok      41 s  infra/modules/region-group-operator-document/tests/document.tftest.hcl  Success! 12 passed, 0 failed.
  ok      18 s  infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl  Success! 2 passed, 0 failed.
  ok      67 s  infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl  Success! 30 passed, 0 failed.
  ok      45 s  infra/modules/region-host/tests/alert_publish.tftest.hcl  Success! 18 passed, 0 failed.
  ok      41 s  infra/modules/region-host/tests/alerts_topic.tftest.hcl  Success! 16 passed, 0 failed.
  ok      11 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       6 s  infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl  Success! 1 passed, 0 failed.
  ok      70 s  infra/modules/region-host/tests/group.tftest.hcl  Success! 32 passed, 0 failed.
  ok      11 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       5 s  infra/modules/region-host/tests/group_isolation.tftest.hcl  Success! 1 passed, 0 failed.
  ok      37 s  infra/modules/region-host/tests/group_operator.tftest.hcl  Success! 13 passed, 0 failed.
  ok       9 s  infra/modules/region-host/tests/group_user_data.tftest.hcl  Success! 3 passed, 0 failed.
  ok      30 s  infra/modules/region-host/tests/health_alarms.tftest.hcl  Success! 10 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/ingress_drain_read.tftest.hcl  Success! 4 passed, 0 failed.
  ok       7 s  infra/modules/region-host/tests/instance_metadata.tftest.hcl  Success! 1 passed, 0 failed.
  ok      25 s  infra/modules/region-host/tests/mailer.tftest.hcl  Success! 6 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/mailer_group.tftest.hcl  Success! 2 passed, 0 failed.
  ok      14 s  infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl  Success! 2 passed, 0 failed.
  ok     104 s  infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl  Success! 46 passed, 0 failed.
  ok      68 s  infra/modules/region-host/tests/store_conversion.tftest.hcl  Success! 27 passed, 0 failed.
  ok      16 s  infra/modules/region-host/tests/store_scanning.tftest.hcl  Success! 4 passed, 0 failed.
  ok      30 s  infra/modules/region-host/tests/store_versioning.tftest.hcl  Success! 11 passed, 0 failed.
  ok      15 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      12 s  infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      15 s  infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl  Success! 5 passed, 0 failed.
  ok      28 s  infra/modules/scanner-host/tests/scanner_host.tftest.hcl  Success! 14 passed, 0 failed.
opentofu: 40 files in 214 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:22889
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.02s)
        --- 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 23:12:54 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18ECF595A6057007, HostID: df00f1491028cb42ca026ed1185c37ecda38fc8c5f78627d7597bed261aaee25, 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.043s
=== 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.042s
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.039s
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.021s
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_beside_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_copy_from_the_store
=== RUN   TestWriteCredentialContractMinio/refused:_read_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_read_elsewhere
=== RUN   TestWriteCredentialContractMinio/refused:_head
=== RUN   TestWriteCredentialContractMinio/refused:_delete
=== RUN   TestWriteCredentialContractMinio/refused:_put_tagged
=== RUN   TestWriteCredentialContractMinio/refused:_put_to_another_bucket
=== RUN   TestWriteCredentialContractMinio/refused:_bucket_settings
=== RUN   TestWriteCredentialContractMinio/refused:_list
=== RUN   TestWriteCredentialContractMinio/refused:_list_uploads
=== RUN   TestWriteCredentialContractMinio/refused:_tag
=== RUN   TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag
=== RUN   TestWriteCredentialContractMinio/refused:_put_outside_the_prefix
--- PASS: TestWriteCredentialContractMinio (0.04s)
    --- PASS: TestWriteCredentialContractMinio/put_under_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/multipart_under_the_prefix (0.01s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_beside_the_prefix (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:_head (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_delete (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_tagged (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_to_another_bucket (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_bucket_settings (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_list (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_list_uploads (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_tag (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_put_outside_the_prefix (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.046s
=== RUN   TestEndToEndMinio
=== RUN   TestEndToEndMinio/plan
=== RUN   TestEndToEndMinio/roll
=== RUN   TestEndToEndMinio/replace
=== RUN   TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.47s)
    --- PASS: TestEndToEndMinio/plan (0.01s)
    --- PASS: TestEndToEndMinio/roll (0.12s)
    --- PASS: TestEndToEndMinio/replace (0.15s)
    --- PASS: TestEndToEndMinio/remove (0.15s)
PASS
ok  	github.com/carlosframework/platform/internal/grouproll	0.474s
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 23:13:02 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 23:13:02 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 23:13:02 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 23:13:02 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/30 23:13:02 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/30 23:13:02 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/30 23:13:03 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/30 23:13:03 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/30 23:13:03 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/30 23:13:03 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 23:13:03 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 23:13:03 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 23:13:03 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/30 23:13:03 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%3A34249: could not determine target mailbox
    agent.go:136: dbreads: dbr_n3ck2qdr5id5qzmwnyioz6fdoi: planned 3 files (1544 bytes) and restored to 3 in 14ms
    agent.go:136: dbreads: dbr_n3ck2qdr5id5qzmwnyioz6fdoi: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 23:13:04 console: db read dbr_n3ck2qdr5id5qzmwnyioz6fdoi: relayed 1 chunks (102 bytes) in 1.006s, ended done
    agent.go:136: dbreads: dbr_7e3gkuqx2brujoe3qq73mzwcpa: planned 1 files (720 bytes) and restored to 1 in 12ms
    agent.go:136: dbreads: dbr_7e3gkuqx2brujoe3qq73mzwcpa: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 23:13:05 console: db read dbr_7e3gkuqx2brujoe3qq73mzwcpa: relayed 1 chunks (102 bytes) in 1.005s, ended done
    agent.go:136: dbreads: dbr_npmnjprj3kfbzkvavhl4rbaare: planned 3 files (1544 bytes) and held through 3 in 12ms
    agent.go:136: dbreads: dbr_npmnjprj3kfbzkvavhl4rbaare: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/30 23:13:06 console: db read dbr_npmnjprj3kfbzkvavhl4rbaare: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN   TestDBForwardMinio/by_disconnect
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_n4ckq5dpi4hhbw5ssqovyoi7su: planned 3 files (1544 bytes) and restored to 3 in 14ms
2026/11/30 23:13:06 console: db read dbr_n4ckq5dpi4hhbw5ssqovyoi7su: relayed 0 chunks (0 bytes) in 36ms, ended client gone
    agent.go:136: dbreads: dbr_n4ckq5dpi4hhbw5ssqovyoi7su: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN   TestDBForwardMinio/by_timeout
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_xmrcfgesgitivu7e6wqqq6qwmy: planned 3 files (1544 bytes) and restored to 3 in 14ms
2026/11/30 23:13:26 console: db read dbr_xmrcfgesgitivu7e6wqqq6qwmy: relayed 0 chunks (0 bytes) in 19.422s, ended no-result
    agent.go:136: dbreads: dbr_xmrcfgesgitivu7e6wqqq6qwmy: output 5 bytes in 1 confirmed chunks in 19.391s
--- PASS: TestDBForwardMinio (23.12s)
    --- PASS: TestDBForwardMinio/by_disconnect (0.25s)
    --- PASS: TestDBForwardMinio/by_timeout (19.53s)
PASS
ok  	github.com/carlosframework/platform/internal/console	23.167s
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.078s
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.57s)
PASS
ok  	github.com/carlosframework/platform/internal/medialocal	0.580s
=== RUN   TestHeldHandoverTwoBoxMinio
2026/11/30 23:13:31 edge: mesh key: minted
2026/11/30 23:13:31 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 23:13:31 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 23:13:31 tenant admission is open. accepting tenant work
2026/11/30 23:13:31 activator: HA placement host=shop-49491f3e.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T23:13:31Z lock_generation=0
2026/11/30 23:13:31 lease: t8-49491f3e/shop-49491f3e.example.test: HA lease acquired in 4ms (first wake)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: started carlos-instance@shop\x2d49491f3e.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 7ms, control socket 0s, key gate 0s, logs 0s) 7ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: carlos-instance@shop\x2d49491f3e.example.test.service launched in 9ms, healthy 0s later
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: woke in 21ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 9ms, replicate 7ms
2026/11/30 23:13:31 lease: t8-49491f3e/plain-49491f3e.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/30 23:13:31 activator: no replica for plain-49491f3e.example.test in s3://contract-bucket/t8-49491f3e/plain-49491f3e.example.test — booting fresh
2026/11/30 23:13:31 activator: plain-49491f3e.example.test: started carlos-instance@plain\x2d49491f3e.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) 5ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 23:13:31 activator: plain-49491f3e.example.test: carlos-instance@plain\x2d49491f3e.example.test.service launched in 7ms, healthy 0s later
2026/11/30 23:13:31 activator: plain-49491f3e.example.test: woke in 38ms: checks 0s, lease 2ms, restore 17ms, identity 0s, protect 0s, spawn 7ms, replicate 12ms
2026/11/30 23:13:31 lease: t8-49491f3e/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/30 23:13:31 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 23:13:31 activator: bot0.shop.bac.sidecar.internal: woke in 19ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 7ms
2026/11/30 23:13:31 activator: next-due probe plain-49491f3e.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 23:13:31 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:1a564017a02925aaa2ab7e216b0577690df146252ecd193fb91af07f0594f14a) in 8ms: files 1ms, sync 4ms, record 1ms, marker 2ms
2026/11/30 23:13:31 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/30 23:13:31 activator: plain-49491f3e.example.test hibernated
2026/11/30 23:13:31 activator: next-due probe shop-49491f3e.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: released with a marker (clean true, txid 1, files 3:14a60e7ad5e47be831db1b25662b69b3e4d0732dc6a112cad0392f422c346029) in 6ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/30 23:13:31 activator: shop-49491f3e.example.test hibernated
2026/11/30 23:13:31 lease: t8-49491f3e/shop-49491f3e.example.test: HA lease acquired in 3ms (clean marker)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: restored (other-box)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: started carlos-instance@shop\x2d49491f3e.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 23:13:31 activator: shop-49491f3e.example.test: carlos-instance@shop\x2d49491f3e.example.test.service launched in 2ms, healthy 0s later
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: woke in 85ms: checks 0s, lease 4ms, restore 24ms, identity 0s, protect 0s, spawn 2ms, replicate 56ms
2026/11/30 23:13:31 edge: ha-take shop-49491f3e.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/30 23:13:31 edge: forward shop-49491f3e.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:1fb7433e066738a12618db6f1ae9d626 Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-30 23:13:31.535407356 +0000 UTC FinishedAt:2026-11-30 23:13:31.73384593 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-49491f3e.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:} {Host:plain-49491f3e.example.test Kind:other Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:149 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-49491f3e.example.test <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> stop plain-49491f3e.example.test marker=true clean=true <nil> releasing shop-49491f3e.example.test <nil> stop shop-49491f3e.example.test marker=true clean=true <nil> taken shop-49491f3e.example.test betty <nil> end-moves]
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/bot0.shop.bac.sidecar.internal/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/bot0.shop.bac.sidecar.internal/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/bot0.shop.bac.sidecar.internal/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/bot0.shop.bac.sidecar.internal/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/bot0.shop.bac.sidecar.internal/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-49491f3e/plain-49491f3e.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/head.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/generations/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/files/0/manifest.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/files/0/objects/0000000000000001-2c2816f68adf92090128dc23b0e63d605a84f0ce658609a92449e94ab91f9eda
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/files/0/objects/0000000000000003-b3a7bed4327e2ea225f232ae346f1f6debed97e2cb82cceae44eb546025aa1b1
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/0000/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/0000/0000000000000002-0000000000000002.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-49491f3e/shop-49491f3e.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-49491f3e/shop-49491f3e.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1243: drain took 248ms; S3 calls 48 (DELETE lock=1 GET files=3 GET head=1 GET lock=2 GET replica=2 LIST replica=32 PUT lock=3 PUT replica=4); 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 23:13:31 lease: t8-49491f3e/plain-49491f3e.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/30 23:13:31 activator: plain-49491f3e.example.test: started carlos-instance@plain\x2d49491f3e.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 23:13:31 activator: plain-49491f3e.example.test: carlos-instance@plain\x2d49491f3e.example.test.service launched in 1ms, healthy 0s later
2026/11/30 23:13:31 lease: /tmp/carlos-minio-contract-7egTee/g/dw2019917449/data/instances/plain-49491f3e.example.test/plain-49491f3e.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/30 23:13:31 activator: plain-49491f3e.example.test: woke in 8ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 1ms, spawn 2ms, replicate 4ms
2026/11/30 23:13:31 activator: next-due probe shop-49491f3e.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 23:13:31 activator: shop-49491f3e.example.test: released with a marker (clean true, txid 2, files 3:14a60e7ad5e47be831db1b25662b69b3e4d0732dc6a112cad0392f422c346029) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/30 23:13:31 activator: shop-49491f3e.example.test hibernated
2026/11/30 23:13:31 tenant admission is closed for shutdown
2026/11/30 23:13:31 activator: next-due probe plain-49491f3e.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 23:13:31 activator: plain-49491f3e.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.57s)
=== RUN   TestHeldHandoverLostLeaseMinio
2026/11/30 23:13:31 edge: mesh key: minted
2026/11/30 23:13:31 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 23:13:31 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 23:13:31 tenant admission is open. accepting tenant work
2026/11/30 23:13:31 activator: HA placement host=shop-047c8ca0.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T23:13:31Z lock_generation=0
2026/11/30 23:13:31 lease: t8-047c8ca0/shop-047c8ca0.example.test: HA lease acquired in 3ms (first wake)
2026/11/30 23:13:31 activator: shop-047c8ca0.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 23:13:31 activator: shop-047c8ca0.example.test: started carlos-instance@shop\x2d047c8ca0.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 23:13:31 activator: shop-047c8ca0.example.test: carlos-instance@shop\x2d047c8ca0.example.test.service launched in 7ms, healthy 0s later
2026/11/30 23:13:31 activator: shop-047c8ca0.example.test: woke in 18ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 7ms
2026/11/30 23:13:32 activator: next-due probe shop-047c8ca0.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 23:13:32 activator: final checkpoint shop-047c8ca0.example.test: lease: release marker owed for s3://contract-bucket/t8-047c8ca0/shop-047c8ca0.example.test/lock.json (If-Match "82762b3b404f970459143acb80d1e803"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/30 23:13:32 activator: shop-047c8ca0.example.test hibernated
2026/11/30 23:13:32 activator: handover of shop-047c8ca0.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-047c8ca0.example.test client 4 "
    hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-047c8ca0.example.test <nil> releasing shop-047c8ca0.example.test <nil> stop shop-047c8ca0.example.test marker=false clean=false <nil> left shop-047c8ca0.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 23:13:32 tenant admission is closed for shutdown
2026/11/30 23:13:32 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.27s)
PASS
ok  	github.com/carlosframework/platform/internal/host	0.888s
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 23:13:33 lease: instances/gen-1796080413287970877.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/30 23:13:33 lease: instances/gen-1796080413287970877.shop.example.com: HA lease acquired in 2ms (holder terminated)
    gentake_minio_test.go:308: a second create-only copy onto instances/gen-1796080413287970877.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/30 23:13:33 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 23:13:33 http: proxy error: context canceled
2026/11/30 23:13:33 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)"
2026/11/30 23:13:33 http: proxy error: context canceled
=== RUN   TestGenerationTakeMinio/switch-412
2026/11/30 23:13:33 lease: instances/gen-1796080413413288089.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 23:13:33 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 23:13:33 lease: instances/gen-1796080413413288089.shop.example.com: HA lease acquired in 2ms (clean marker)
=== RUN   TestGenerationTakeMinio/copy-version
=== RUN   TestGenerationTakeMinio/store-time
2026/11/30 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 23:13:33 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 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 2ms (clean marker)
2026/11/30 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 23:13:33 lease: instances/gen-1796080413514755107.shop.example.com: HA lease acquired in 2ms (unclean marker)
=== RUN   TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.38s)
    --- PASS: TestGenerationTakeMinio/take (0.13s)
    --- PASS: TestGenerationTakeMinio/switch-412 (0.09s)
    --- PASS: TestGenerationTakeMinio/copy-version (0.01s)
    --- PASS: TestGenerationTakeMinio/store-time (0.15s)
    --- PASS: TestGenerationTakeMinio/skew (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/lease	0.399s
minio contract: PASS
=== staticcheck ===
go version go1.26.10 linux/arm64
go: downloading honnef.co/go/tools v0.8.2
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
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/tools v0.50.0
go: downloading golang.org/x/telemetry v0.0.0-20260908163034-4bcc4b2ee518
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 1m56.313s
    codehealth_test.go:107: line metrics (code lines, then physical):
          file-lines  5471  7324  internal/activator activator_test.go
          file-lines  4160  6981  internal/console server.go
          file-lines  4120  6283  . 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   628  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               1090 at  473 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         30596 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 -: 4120 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 -: 4160 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 (116.32s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	117.231s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: HEAD is on main; comparing with its parent 1dee7c49e2e4da6c25e5f362f87d7fb0dbc1f43b
=== 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
=== internal_systemd@0 (14 s, from +14 s)
ok  	github.com/carlosframework/platform/internal/systemd	13.508s
=== internal_rootaws@0 (26 s, from +33 s)
ok  	github.com/carlosframework/platform/internal/rootaws	25.452s
=== internal_activator@0 (291 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	288.703s
=== internal_activator@1 (264 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	262.021s
=== internal_activator@2 (279 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	276.785s
=== internal_activator@3 (419 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	417.007s
=== internal_activator@4 (306 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	304.179s
=== internal_activator@5 (309 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	306.723s
=== internal_activator@6 (305 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	303.318s
=== internal_activator@7 (378 s, from +111 s)
ok  	github.com/carlosframework/platform/internal/activator	376.225s
=== internal_edge@0 (85 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	81.105s
=== internal_edge@1 (102 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	98.589s
=== internal_edge@2 (210 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	207.048s
=== internal_edge@3 (164 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	160.508s
=== internal_edge@4 (190 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	186.609s
=== internal_edge@5 (227 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	223.938s
=== internal_edge@6 (204 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	200.208s
=== internal_edge@7 (214 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	210.621s
=== internal_edge@8 (265 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	261.461s
=== internal_edge@9 (285 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	281.447s
=== internal_edge@10 (226 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	222.618s
=== internal_edge@11 (223 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	219.493s
=== internal_edge@12 (252 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	248.776s
=== internal_edge@13 (256 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	252.539s
=== internal_edge@14 (177 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	173.124s
=== internal_edge@15 (257 s, from +134 s)
ok  	github.com/carlosframework/platform/internal/edge	253.706s
=== internal_host@0 (16 s, from +195 s)
ok  	github.com/carlosframework/platform/internal/host	11.924s
=== internal_host@1 (9 s, from +195 s)
ok  	github.com/carlosframework/platform/internal/host	5.615s
=== lists: internal_edge 134 s, internal_activator 111 s, internal_host 194 s, internal_rootaws 33 s, internal_systemd 13 s
=== cpu: the gate used 7678 cpu-seconds in 530 s, about 14.5 of 32 cores; the machine as a whole was 45% busy
=== gitleaks ===
go version go1.26.10 linux/arm64
go: downloading github.com/zricethezav/gitleaks/v8 v8.30.1
go: downloading github.com/rs/zerolog v1.33.0
go: downloading github.com/spf13/viper v1.19.0
go: downloading github.com/mholt/archives v0.1.2
go: downloading github.com/gitleaks/go-gitdiff v0.9.1
go: downloading golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa
go: downloading github.com/hashicorp/go-version v1.7.0
go: downloading github.com/fatih/semgroup v1.2.0
go: downloading github.com/charmbracelet/lipgloss v0.5.0
go: downloading github.com/BobuSumisu/aho-corasick v1.0.3
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/h2non/filetype v1.1.3
go: downloading github.com/Masterminds/sprig/v3 v3.3.0
go: downloading golang.org/x/sync v0.11.0
go: downloading github.com/muesli/termenv v0.15.1
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
go: downloading github.com/mattn/go-runewidth v0.0.14
go: downloading github.com/sorairolake/lzip-go v0.3.5
go: downloading github.com/klauspost/compress v1.17.11
go: downloading github.com/STARRY-S/zip v0.2.1
go: downloading github.com/bodgit/sevenzip v1.6.0
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
go: downloading github.com/minio/minlz v1.0.0
go: downloading github.com/nwaples/rardecode/v2 v2.1.0
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading golang.org/x/text v0.22.0
go: downloading github.com/fsnotify/fsnotify v1.8.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/spf13/afero v1.12.0
go: downloading github.com/spf13/cast v1.7.1
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading dario.cat/mergo v1.0.1
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.3.0
go: downloading github.com/huandu/xstrings v1.5.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.4.0
go: downloading golang.org/x/crypto v0.35.0
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.9
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading golang.org/x/sys v0.30.0
go: downloading github.com/bodgit/plumbing v1.3.0
go: downloading github.com/bodgit/windows v1.0.1
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading go4.org v0.0.0-20230225012048-214862532bf5
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/hashicorp/golang-lru/v2 v2.0.7
go: downloading github.com/hashicorp/errwrap v1.1.0
self-test: reported source file: a key
self-test: reported source file: a 64-hex key
self-test: reported source file: a census-shaped entry
self-test: reported source file: a key marked gitleaks:allow
self-test: reported source file: a test's fake value outside tests
self-test: reported allowed file: another key beside its allowed value
self-test: reported a tracked file named gitleaks-gate-sentinel.env
self-test: reported 100 near misses of the names notscanned.go lists
self-test: skipped  the 33 files notscanned.go lists
self-test: refused  a notscanned.go entry git does not track
self-test: refused  a config that does not parse
self-test: refused  a config that does not exist
self-test: refused  a missing gitleaks binary
self-test: 6 planted keys reported, 134 tracked files judged, 3 broken setups refused
gitleaks: scanned 12143 tracked files; 33 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
gitleaks: clean

landed from sec-h3-m6-leftover-host

diff --git a/approved_moves_copy_test.go b/approved_moves_copy_test.go
index 908f5f610..b16d82f30 100644
--- a/approved_moves_copy_test.go
+++ b/approved_moves_copy_test.go
@@ -114,6 +114,7 @@ var movesCopyIDs = []string{
// #339: refused while the instance still serves, and status after an
// abort from staging.
"MV-O200", "MV-O202", "MV-O203", "MV-O204",
+ "MV-O205", "MV-O206", "MV-O207", "MV-O208", "MV-O209", "MV-O210", "MV-O211",
// carlos move offline run (plans/2026-11-15-offline-move-run.md, Task 5;
// deck docs/drafts/offline-move-run/copy-review/strings.json).
"OR01", "OR02", "OR03", "OR04", "OR05", "OR06", "OR07",
@@ -1235,6 +1236,8 @@ var movesScanFiles = []string{
"internal/console/movesrecovery.go",
"internal/console/apiinstancemove_offline.go",
"internal/console/apiinstancemove_offline_facts.go",
+ // Hunt H3-M6: the move doors' sentences for the shared data-transfer rule.
+ "internal/console/moveleftovers.go",
"internal/console/claim_runtime.go",
"internal/alerting/alerting.go",
"internal/hostops/move_log_writer.go",
diff --git a/docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md b/docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md
new file mode 100644
index 000000000..4df6e0ba2
--- /dev/null
+++ b/docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md
@@ -0,0 +1,136 @@
+# H3-M6: binding a host's data to its owner on the box
+
+Status: design note for a decision, not built. The console's shared
+data-transfer rule (`internal/console/datatransfer.go`) checks only the
+bucket replicas it can read. Local data on a box stays open even to members:
+the pooled, no-bucket and same-region cases below. This note covers what the
+console cannot close, and ends with the operator procedure for the seed
+refusal that this branch adds.
+
+## The gap
+
+A box treats data as belonging to a host by its name alone. A replica at
+`instances/<host>`, staging at `moves/<host>/`, and a local database at the
+row's path all carry only the hostname. When a record is deleted, its data is
+kept on purpose. When a new record later takes the same host, whatever app or
+account it belongs to, it gets that data:
+
+- `restorePlainStaging` returns any local database as a warm cache, then
+ restores the host's prefix if there is no local database.
+- A move of an instance that never woke stages nothing, so the target restores
+ its own prefix (activator `TestH3M6MoveOfANeverWokenHostLandsOnTheTargetsLeftover`).
+- Someone who can write to the record bucket can publish a record for any host
+ without going through the console's refusals. The box then restores that
+ host's data for them. Lease ownership names a box and process, not an
+ account or app.
+
+## What the stamp binds
+
+Every data location gets one owner stamp, written once by the box that first
+creates data there:
+
+- `RecordKey(account, app, host)`, the record's identity.
+- The lifetime: the record's incarnation (`hostclaim.Incarnation`, from
+ account, app, host and created_at), so a deleted and re-created record with
+ the same key is a different owner. A restore names the lifetime it brings
+ back (`restoreProof`).
+- Where it lives: `instances/<host>/owner.json` beside the replica (and inside
+ each generation for HA), `moves/<host>/owner.json` copied with the staging,
+ and `<db>.owner` beside a local database, next to the `.seed` and `.assigned`
+ markers.
+
+**Open: the signing authority.** A record-bucket writer must not be able to
+forge a stamp, and boxes must verify stamps that other boxes wrote (a move's
+target verifies the source's). `boxid` cannot sign: it only verifies an
+AWS-signed identity document, and the box never holds AWS's key. Candidates:
+- a console-held key that signs stamps on the box's request, verified with a
+ public key published like the release key;
+- a KMS key per deployment that boxes may sign with and anyone may verify,
+ with grants scoped to the box role.
+
+The choice, and how keys are distributed and rotated, needs a decision before
+any build.
+
+## Where the box checks it
+
+Missing or mismatched means refuse, and nothing is ever deleted:
+
+1. In `restorePlainStaging`, before a local database counts as a warm cache,
+ and before restoring the prefix.
+2. When a warm cache is returned on any path, the seed fallback's own-replica
+ restore included.
+3. In seed placement (`seededRestore`), in place of the refusal on unattributed
+ files that this branch adds.
+4. When a move lands (legacy promotion, offline and Phase 1 landings): the
+ staged stamp and any target-prefix stamp must name the landing record.
+5. On the first wake after `carlos apps place` re-homes a record, which is the
+ same check as 1 at the new storage.
+
+## Rollout order
+
+1. Boxes write stamps for data their live records create from now on, and check
+ nothing yet. Each box reports any location it holds with no stamp.
+2. Data that existed before step 1 is NOT adopted by whichever record holds it
+ now: that could certify the very misbinding this work found. A location is
+ stamped only on independent provenance:
+ - the record's own lifetime chain (`restoreProof`: owner, app lifetime,
+ allocation lineage);
+ - or an operator's ruling, recorded with its evidence.
+
+ Anything ambiguous stays unstamped and unclaimable. During this inventory,
+ data-kind creates, moves, places and restores are paused (S5, as in an
+ invalidated history), and the record bucket's writers are limited to the
+ console.
+3. Boxes enforce the stamps, region by region. Dev goes first.
+4. The console lifts its blanket refusals (below).
+
+## What it closes, and what it lets us lift
+
+It closes what the console cannot see: pooled records (the pool box's
+database), consoles with no data bucket, and a same-region local database. A
+pooled record on an app that is placed is re-homed unchecked too: the rule
+keys on the record's pool.
+
+It lets us lift:
+- the out-of-sight 409 on creates, moves and places, on every console, claim
+ and Phase 1 consoles included;
+- the refusal of an app re-creating its own deleted host: the stamp's lifetime
+ chain gives the provenance that a hostname mark cannot.
+
+## Operator procedure: a seed refused over unattributed files
+
+`carlos logs` shows the refused instance's wake reason: "could not start from
+its seed: this box already has database files for it that nothing marks as this
+seed's". The box keeps those files and retries on every wake.
+
+**Leave it refused.** That is the safe state: the wake never writes or
+purges the path. Recovery is blocked on a capability the platform does not
+have yet.
+
+1. **Verified quiescence comes first, and nothing provides it today.**
+ Moving or clearing the files is safe only once wakes of the host and the
+ reconcile and seed passes on its box are proved stopped. No supported
+ command does that. "Leave it refused" is not a fence: once the last
+ blocking file is gone, the next wake places the seed.
+2. **Do not delete the instance to pause it.**
+ - For a fleet file seed, `carlos instances delete` aborts the seed
+ (SeedAbort). Reconcile then runs rollbackFleetFileSeed, which purges both
+ local database locations without reading the marker: exactly the files
+ the refusal kept.
+ - On a console whose hostname history is active, delete also burns the
+ hostname for good.
+ - Deleting ends the seed's lifecycle, so there is no retry of this instance
+ afterwards.
+3. **What to gather meanwhile, read-only.**
+ - The box: the instance's placement is on `carlos instances`.
+ - The path: the box log line "holds data no marker attributes to this seed"
+ names it. Gap: no CLI prints a row's path or the files beside it.
+ - Earlier owners: the console's lifetime and retirement records, and any
+ `.seed` marker naming another seed id.
+ - `carlos system hosts-used status` gives only the mode, the mark count,
+ closed fleets and the floor. Gap: no command shows whether a given host
+ is marked.
+4. **Once a quiescence capability exists:** set the files aside under
+ `<DataDir>/.superseded/<host>/<unix nanos>/` (never delete what is not
+ proved this record's own), then let the next wake place the seed, and
+ confirm it in `carlos logs` and the box log ("placed seed <id>").
diff --git a/docs/superpowers/notes/census-proposal-sec-h3-m6-leftover-host.md b/docs/superpowers/notes/census-proposal-sec-h3-m6-leftover-host.md
new file mode 100644
index 000000000..57c00a886
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-sec-h3-m6-leftover-host.md
@@ -0,0 +1,25 @@
+# Census approval: sec-h3-m6-leftover-host
+
+Ruling `census-ruling-sec-h3-m6-leftover-host`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/activator/seedplace.go` `ExecBackend.placeSeed` | body | unchanged (2) | H3-M6 round 3 (Fable P3): the cleanup after a failed post-rename identity check removes the database before its marker (was marker first), so a crash between the two leaves a marker alone, which the next wake purges and re-places, never an unmarked database the new unattributed-data refusal would keep refusing. Same two instancefs.RemoveAllBeneath calls under the instance directory; no new read, path or authority. Agent, not root. |
+| `internal/activator/seedplace.go` `ExecBackend.seededRestore` | sites | +registry:Assigned | H3-M6 round 2: on an unlabelled row with no own replica, after the placed check and before the purge, asks unattributedLocalData (Lstat of the database, WAL, SHM and both litestream meta dirs at the row's path, beside instancefs; symlinks are not data and are not followed) and refuses the wake (seedOverUnattributedData) when any is present, instead of purging it. +registry:Assigned is the new rt.Assigned == "" guard. Round 3 changed only the refusal's sentence. The agent as carlos, not root; it refuses more and deletes less; every path comes from the registry row. Copy pass (Luna, 2026-11-30, Paul's delegation) reworded that sentence again; the code is unchanged. |
+
+Envelopes re-pinned: `internal/activator`, `internal/provision`.
+
+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/activator/seedplace.go` `ExecBackend.placeSeed`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields.
+- `internal/activator/seedplace.go` `ExecBackend.seededRestore`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.;rev3=census-ruling-fleet-seeded-create-2;basis=Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, accepts it as this seed's only when this seed's own placement is still at the row's path: the marker naming this seed together with the database, both read through seedPlacedAt (instancefs, no symlink followed). A marker alone, another seed's, or either unreadable refuses (copy-exists) and nothing is restored. That probe runs under the start rule, after settleSeedObligation and reconcileAssignment (a labelled row's copy not kept under its assignment is set aside first), and the kept copy then passes startAllowed in the restore; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x4) are rt passed on: to placeSeed, to reportSeedFailure, and to the two start-rule calls before the own-placement probe (settleSeedObligation, reconcileAssignment), both of which it already made further down for every seed. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant.
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/activator/seedplace.go:unattributedLocalData`: reads +file:Lstat; written legacy, accepted-legacy, frozen
+
+Seal: `13d05e2a4038ca4978d27a38be07e96025ee6f00f39519c41a3000e2dda3b387` → `8e42c8ece77bba4ec895af4d7cae0aa80aec06885b7614cc1c5c572f9ef9ebc4`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-sec-h3-m6-leftover-host.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md b/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
index 6333b4509..987b37a1c 100644
--- a/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
+++ b/docs/superpowers/plans/2026-10-06-moves-phase1-copy.md
@@ -825,3 +825,17 @@ Sentences the fixes for Astra's whole-branch review of `offline-move-run` (round
| OR75 | move.go | Copy failed | approved |
| OR76 | move_offline_run.go | Stopped staging after <tries> tries without starting a round. <host> keeps serving and nothing went offline. | approved |
| OR77 | docs/site/cli.md | refused before anything was written: by the console, at the first status read or the first stage (`--resume` included), or by `carlos` itself (run as root, or with no console) | approved |
+
+## Moves: the shared data-transfer rule (hunt H3-M6)
+
+The move doors' refusals from the shared data-transfer rule (`internal/console/moveleftovers.go`, branch `sec-h3-m6-leftover-host`). The legacy and Phase 1 requests and the offline start and stage all ask it before their first write. `<host>` is the instance and `<to>` the destination's label. MV-O205 is a destination in this console's sight whose bucket already holds data for the host (it may be the instance's own earlier copy). MV-O206 is the 503 when that bucket cannot be read. MV-O207 to MV-O210 are out of sight: the history is not active, it can never be completed on this console, the destination was not examined or has changed, and the history or roster cannot be read. MV-O211 is a staged move that an older console staged without the rule's check. Approved by Luna on 2026-11-30 under Paul's 2026-10-25 delegation; MV-O209 and MV-O210 as Luna changed them, the other five unchanged.
+
+| id | file | text | status |
+|---|---|---|---|
+| MV-O205 | internal/console/moveleftovers.go | <host> can't move to <to>: <host> already has data in <to>. An operator has to look at it before this can go ahead. | approved |
+| MV-O206 | internal/console/moveleftovers.go | <host> can't move to <to>: the data in <to> could not be checked. Try again. | approved |
+| MV-O207 | internal/console/moveleftovers.go | <host> can't move to <to>: this console can't check <to> for data a deleted record left under <host>. An operator can allow it by completing the hostname history (console hosts-used) with <to> scanned. | approved |
+| MV-O208 | internal/console/moveleftovers.go | <host> can't move to <to>: this console can't check <to> for data a deleted record left under <host>, and its hostname history can't be completed while host claims or Phase 1 moves are on. | approved |
+| MV-O209 | internal/console/moveleftovers.go | <host> can't move to <to>: <to> was not scanned when the hostname history was completed, or the boxes or data bucket there have changed since. An operator can allow it by completing the history again with <to> scanned. | approved |
+| MV-O210 | internal/console/moveleftovers.go | <host> can't move to <to>: the hostname history, or the boxes or data bucket in <to>, could not be read. Try again. | approved |
+| MV-O211 | internal/console/moveleftovers.go | <host> was staged for <to> before this console checked <to> for data left under it. Abort the move and stage it again. | approved |
diff --git a/internal/activator/move_h3m6_test.go b/internal/activator/move_h3m6_test.go
new file mode 100644
index 000000000..5ff854b15
--- /dev/null
+++ b/internal/activator/move_h3m6_test.go
@@ -0,0 +1,70 @@
+package activator
+
+// Hunt H3-M6, the move route (Fable round 1 P1 candidate, Astra P1-2):
+// shopapp creates acme.example.com in a region whose bucket is clean,
+// never wakes it, and moves it to the region where titogo's deleted
+// record of the same host left its replica. This witness runs the box
+// half of a legacy move as it runs in production: the source round mirrors
+// the source's own prefix into the target's moves/<host>/ (movespass.go
+// legacyMoveRound, lease.MirrorPrefix), and the target's first wake is
+// Restore. A never-woken host has nothing in the source prefix, so the
+// round stages nothing, the promotion has nothing to promote, and the wake
+// restores the target's own prefix: titogo's database. The console's move
+// doors refuse such a move (hunt H3-M6, internal/console/moveleftovers.go);
+// the box cannot tell whose the prefix is.
+
+import (
+ "context"
+ "path/filepath"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/lease"
+ "github.com/carlosframework/platform/internal/registry"
+)
+
+func TestH3M6MoveOfANeverWokenHostLandsOnTheTargetsLeftover(t *testing.T) {
+ ctx := context.Background()
+ b := testExecBackend(t) // the target box
+ f := newFakeMirrorStore()
+ b.Mirror = f
+ host := "acme.example.com"
+ const sourceBucket = "source-region-data"
+
+ // titogo's deleted record left its replica in the target's bucket.
+ leftover := b.Cfg.hibernatePrefix(host) + "/ltx/0/0000000000000001-0000000000000001.ltx"
+ f.put(b.Cfg.Bucket, leftover, "titogo")
+
+ // The source's round for shopapp's never-woken host: nothing to copy.
+ round, err := lease.MirrorPrefix(ctx, f, sourceBucket, HibernatePrefix("", host), b.Cfg.Bucket, MovesPrefix(host), lease.Receipts{})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if round.Changed != 0 {
+ t.Fatalf("the round staged %d objects for a host that never woke", round.Changed)
+ }
+
+ var restoredFrom []string
+ setKnob(t, &restoreReplica, func(_ context.Context, dbPath, bucket, prefix, _ string) (bool, error) {
+ objs, _ := f.List(context.Background(), bucket, prefix)
+ if len(objs) == 0 {
+ return false, nil
+ }
+ restoredFrom = append(restoredFrom, bucket+"/"+prefix)
+ return true, writeMinimalSQLite(dbPath)
+ })
+ // shopapp's record, landed: its first wake on the target.
+ rt := registry.Route{Host: host, Kind: "instance", Account: "acct", App: "shopapp", Socket: filepath.Join(t.TempDir(), "i.sock")}
+ fresh, err := b.Restore(ctx, rt)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if fresh || len(restoredFrom) != 1 || restoredFrom[0] != b.Cfg.Bucket+"/"+b.Cfg.hibernatePrefix(host) {
+ t.Fatalf("fresh %v, restored from %v", fresh, restoredFrom)
+ }
+ if own, _ := f.List(ctx, b.Cfg.Bucket, b.Cfg.hibernatePrefix(host)); own[leftover].ETag != "titogo" {
+ t.Fatalf("own prefix = %v", own)
+ }
+ // Witnessed: shopapp's first wake restored titogo's replica. This is
+ // the box behaving as designed for a host with no owner stamp
+ // (docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md).
+}
diff --git a/internal/activator/seedplace.go b/internal/activator/seedplace.go
index 0781dadca..abe9cfe34 100644
--- a/internal/activator/seedplace.go
+++ b/internal/activator/seedplace.go
@@ -90,6 +90,39 @@ func seedRefusedClaim(host string) error {
return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: claim control is on for this box.", host)}
}
+// seedOverUnattributedData is a seed whose first wake found database files
+// at its path (the database, its WAL or SHM, or litestream metadata) that
+// no marker attributes to this seed (H3-M6). That is not proof they are
+// another record's, only that nothing here says they are this one's. It
+// carries no code: a box reports nothing, and every wake refuses until an
+// operator has followed the procedure in
+// docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md.
+func seedOverUnattributedData(host, path string) error {
+ return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: this box already has database files for it with no marker tying them to this seed, so they were kept and the seed was not placed. An operator has to check them.", host),
+ Err: fmt.Errorf("%s holds data no marker attributes to this seed; refusing to purge it", path)}
+}
+
+// unattributedLocalData names the first entry at a seed's path that holds
+// a database's data: the database, its WAL or SHM, or either litestream
+// meta directory. A symlink is not data (the purge removes the link and
+// never follows it), nor is a marker or a fetch's temp file. "" when there
+// is none. An entry that cannot be examined is an error, never absence.
+func unattributedLocalData(dir, base string) (string, error) {
+ for _, n := range []string{base, base + "-wal", base + "-shm", base + "-litestream", ".activator-" + base + "-litestream"} {
+ fi, err := os.Lstat(filepath.Join(dir, n))
+ if errors.Is(err, os.ErrNotExist) {
+ continue
+ }
+ if err != nil {
+ return "", err
+ }
+ if fi.Mode()&os.ModeSymlink == 0 {
+ return n, nil
+ }
+ }
+ return "", nil
+}
+
func seedPlaceFailed(host string, err error) error {
return &SeedPlacementError{Sentence: fmt.Sprintf("%s could not start from its seed: it could not be put in place. The next wake tries again.", host), Err: err}
}
@@ -272,6 +305,24 @@ func (b *ExecBackend) seededRestore(ctx context.Context, rt registry.Route, src
log.Printf("activator: %s: keeping seed %s placed by an earlier wake", host, src.ID)
return false, nil
}
+ // A database still at the path is not this seed's (placed above
+ // would have kept it): another seed's, or the local copy of a deleted
+ // record that held this host, whatever its app or account. Nothing
+ // here says whose, so it is never purged to make room (hunt H3-M6):
+ // on an unlabelled row the wake refuses and leaves it in place. A
+ // labelled row's copy is set aside below and the start rule refuses
+ // it the same way. Only data counts: a marker alone, an earlier
+ // fetch's temp file, or a link (which the purge removes, never its
+ // target) is purged as before.
+ if rt.Assigned == "" {
+ held, err := unattributedLocalData(dir, base)
+ if err != nil {
+ return fail(seedPlaceFailed(host, err))
+ }
+ if held != "" {
+ return fail(seedOverUnattributedData(host, filepath.Join(dir, held)))
+ }
+ }
// Placing the snapshot is a start from something other than the
// host's own copy: on a labelled row, the start rule decides it as it
// decides an empty start. Anything still at the path is a copy kept
@@ -528,8 +579,11 @@ func (b *ExecBackend) placeSeed(ctx context.Context, rt registry.Route, src *see
return seedPlaceFailed(host, err)
}
if err := sameFileAt(dir, base, wrote); err != nil {
- _ = instancefs.RemoveAllBeneath(dir, base+SeedMarkerSuffix)
+ // The database before its marker: a crash between the two leaves a
+ // marker alone, which the next wake purges and re-places, never an
+ // unmarked database, which it would refuse (H3-M6).
_ = instancefs.RemoveAllBeneath(dir, base)
+ _ = instancefs.RemoveAllBeneath(dir, base+SeedMarkerSuffix)
return seedPlaceFailed(host, err)
}
return nil
diff --git a/internal/activator/seedplace_h3m6_linux_test.go b/internal/activator/seedplace_h3m6_linux_test.go
new file mode 100644
index 000000000..b1604b259
--- /dev/null
+++ b/internal/activator/seedplace_h3m6_linux_test.go
@@ -0,0 +1,114 @@
+//go:build linux
+
+package activator
+
+// Hunt H3-M6, the fleet file seed route (Astra round 1, P1-3): a seed with
+// no replica of its own, placed on a box that still holds another app's
+// database at the same host's path (that app's record deleted, its local
+// copy left), must not purge that database to make room. Nothing on the
+// box says whose it is, so the wake refuses and leaves it where it is, on
+// an unlabelled row and a labelled one alike.
+
+import (
+ "bytes"
+ "context"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/seeds"
+)
+
+const otherAppsData = "another app's database, left when its record was deleted"
+
+// leaveOtherAppsDatabase writes a database with no marker at the row's
+// path, and optionally a marker naming another seed beside it.
+func leaveOtherAppsDatabase(t *testing.T, dbPath, marker string) {
+ t.Helper()
+ if err := os.MkdirAll(filepath.Dir(dbPath), 0o700); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(dbPath, []byte(otherAppsData), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(dbPath+"-wal", []byte("w"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ if marker != "" {
+ if err := os.WriteFile(dbPath+SeedMarkerSuffix, []byte(marker+"\n"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ }
+}
+
+// otherAppsDataSurvives reports whether the leftover's bytes are still on
+// the box: at the row's path, or set aside under .superseded.
+func otherAppsDataSurvives(t *testing.T, b *ExecBackend, dbPath string) bool {
+ t.Helper()
+ if got, err := os.ReadFile(dbPath); err == nil && bytes.Equal(got, []byte(otherAppsData)) {
+ return true
+ }
+ found := false
+ _ = filepath.WalkDir(filepath.Join(b.DataDir, ".superseded"), func(p string, d os.DirEntry, err error) error {
+ if err == nil && !d.IsDir() {
+ if got, rerr := os.ReadFile(p); rerr == nil && bytes.Equal(got, []byte(otherAppsData)) {
+ found = true
+ }
+ }
+ return nil
+ })
+ return found
+}
+
+func TestH3M6FleetFileSeedRefusesAnotherAppsLocalDatabase(t *testing.T) {
+ for _, c := range []struct {
+ name, assigned, marker string
+ }{
+ {"unlabelled", "", ""},
+ {"unlabelled-foreign-marker", "", "sd_bbbbbbbbbbbbbbbbbbbbbbbbbb"},
+ {"labelled", "asg-h3m6", ""},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ r := fleetFileSeedRig(t, false)
+ r.rt.Assigned = c.assigned
+ leaveOtherAppsDatabase(t, r.rt.DBPath, c.marker)
+ _, err := r.b.Restore(context.Background(), r.rt)
+ if err == nil {
+ t.Fatal("the seed was placed over another app's database; want the wake refused")
+ }
+ if r.objs.opens != 0 {
+ t.Fatalf("snapshot opened %d times; nothing may be fetched over data that is not this seed's", r.objs.opens)
+ }
+ if !otherAppsDataSurvives(t, r.b, r.rt.DBPath) {
+ t.Fatal("the other app's database was deleted")
+ }
+ if len(r.placed) != 0 {
+ t.Fatalf("reported placed: %v", r.placed)
+ }
+ })
+ }
+}
+
+// The same rule on a region box: a --from or import seed's first wake over
+// a database it cannot attribute refuses, with the member's sentence, and
+// keeps the database in place.
+func TestH3M6RegionSeedRefusesAnUnattributedDatabase(t *testing.T) {
+ noOwnReplica(t)
+ b, rt := nestedBackend(t, &fakeControl{}, &fakeUnit{})
+ rt, objs, _ := seededRoute(t, b, rt, seeds.StateReady)
+ leaveOtherAppsDatabase(t, rt.DBPath, "")
+ _, err := b.Restore(context.Background(), rt)
+ if err == nil || !strings.Contains(err.Error(), "could not start from its seed: this box already has database files for it with no marker tying them to this seed, so they were kept and the seed was not placed. An operator has to check them.") {
+ t.Fatalf("Restore = %v; want the unattributed-data refusal", err)
+ }
+ if objs.opens != 0 {
+ t.Fatalf("snapshot opened %d times", objs.opens)
+ }
+ if !otherAppsDataSurvives(t, b, rt.DBPath) {
+ t.Fatal("the unattributed database was deleted")
+ }
+ if _, err := os.Stat(rt.DBPath + "-wal"); err != nil {
+ t.Fatalf("its WAL was removed: %v", err)
+ }
+}
diff --git a/internal/activator/seedplace_linux_test.go b/internal/activator/seedplace_linux_test.go
index a7847e6df..42a455d68 100644
--- a/internal/activator/seedplace_linux_test.go
+++ b/internal/activator/seedplace_linux_test.go
@@ -118,10 +118,14 @@ func TestSeededRestorePlacesTheSnapshot(t *testing.T) {
}
}
-func TestSeededRestorePurgesAnotherSeedsDatabase(t *testing.T) {
+// Another seed's database at the path (an aborted import's, or a deleted
+// record's under the same host) is not this seed's, and nothing says whose
+// it is: the wake refuses and purges none of it (hunt H3-M6). Before, it
+// was purged to make room.
+func TestSeededRestoreRefusesAnotherSeedsDatabase(t *testing.T) {
noOwnReplica(t)
b, rt := nestedBackend(t, &fakeControl{}, &fakeUnit{})
- rt, _, id := seededRoute(t, b, rt, seeds.StateSwapped)
+ rt, objs, _ := seededRoute(t, b, rt, seeds.StateSwapped)
os.MkdirAll(filepath.Dir(rt.DBPath), 0o700)
os.WriteFile(rt.DBPath, []byte("an aborted import's data"), 0o600)
os.WriteFile(rt.DBPath+"-wal", []byte("w"), 0o600)
@@ -129,33 +133,35 @@ func TestSeededRestorePurgesAnotherSeedsDatabase(t *testing.T) {
os.WriteFile(rt.DBPath+SeedMarkerSuffix, []byte("sd_bbbbbbbbbbbbbbbbbbbbbbbbbb\n"), 0o600)
meta := filepath.Join(filepath.Dir(rt.DBPath), ".activator-"+filepath.Base(rt.DBPath)+"-litestream")
os.MkdirAll(meta, 0o700)
- if _, err := b.Restore(context.Background(), rt); err != nil {
- t.Fatal(err)
+ if _, err := b.Restore(context.Background(), rt); err == nil {
+ t.Fatal("the seed was placed over another seed's database")
}
- for _, p := range []string{rt.DBPath + "-wal", rt.DBPath + "-shm", meta} {
- if _, err := os.Stat(p); !os.IsNotExist(err) {
- t.Errorf("%s survived the purge", p)
- }
+ if objs.opens != 0 {
+ t.Fatalf("snapshot opened %d times", objs.opens)
}
- if m, _ := os.ReadFile(rt.DBPath + SeedMarkerSuffix); strings.TrimSpace(string(m)) != id {
- t.Fatalf("marker = %q, want %s", m, id)
+ for _, p := range []string{rt.DBPath, rt.DBPath + "-wal", rt.DBPath + "-shm", meta} {
+ if _, err := os.Stat(p); err != nil {
+ t.Errorf("%s was removed: %v", p, err)
+ }
}
- if b, _ := os.ReadFile(rt.DBPath); bytes.Equal(b, []byte("an aborted import's data")) {
- t.Fatal("the other seed's database stood in for this one")
+ if m, _ := os.ReadFile(rt.DBPath + SeedMarkerSuffix); strings.TrimSpace(string(m)) != "sd_bbbbbbbbbbbbbbbbbbbbbbbbbb" {
+ t.Fatalf("marker = %q, want the other seed's, untouched", m)
}
}
-func TestSeededRestorePurgesAnUnmarkedDatabase(t *testing.T) {
+// A marker alone (this seed's placement cut short before its rename, or
+// another seed's) holds no data: it is purged and the snapshot placed.
+func TestSeededRestorePlacesOverAMarkerAlone(t *testing.T) {
noOwnReplica(t)
b, rt := nestedBackend(t, &fakeControl{}, &fakeUnit{})
- rt, objs, _ := seededRoute(t, b, rt, seeds.StateReady)
+ rt, objs, id := seededRoute(t, b, rt, seeds.StateReady)
os.MkdirAll(filepath.Dir(rt.DBPath), 0o700)
- os.WriteFile(rt.DBPath, []byte("an unmarked database"), 0o600)
+ os.WriteFile(rt.DBPath+SeedMarkerSuffix, []byte("sd_bbbbbbbbbbbbbbbbbbbbbbbbbb\n"), 0o600)
if fresh, err := b.Restore(context.Background(), rt); err != nil || fresh || objs.opens != 1 {
- t.Fatalf("fresh %v err %v opens %d; want the unmarked database replaced by the snapshot", fresh, err, objs.opens)
+ t.Fatalf("fresh %v err %v opens %d; want the snapshot placed", fresh, err, objs.opens)
}
- if got, _ := os.ReadFile(rt.DBPath); !bytes.Equal(got, objs.body[mustSeedID(t, rt)]) {
- t.Fatal("the unmarked database stood in for the seed")
+ if m, _ := os.ReadFile(rt.DBPath + SeedMarkerSuffix); strings.TrimSpace(string(m)) != id {
+ t.Fatalf("marker = %q, want %s", m, id)
}
}
diff --git a/internal/console/apiinstancemove.go b/internal/console/apiinstancemove.go
index 48ebd5170..ce1625430 100644
--- a/internal/console/apiinstancemove.go
+++ b/internal/console/apiinstancemove.go
@@ -472,6 +472,11 @@ func (s *Server) legacyHandleAPIInstanceMoveRequest(w http.ResponseWriter, r *ht
jsonError(w, http.StatusBadRequest, "moves to the home region are not supported yet — the home publishes no staging lane")
return
}
+ // The shared data-transfer rule (H3-M6, datatransfer.go).
+ if ref := s.moveTransferRefusal(r.Context(), "api instance move "+acct.Sqid+"/"+app, rec, to); ref != nil {
+ writeRefusal(w, ref)
+ return
+ }
// The armed gate is MANDATORY for moves — unlike create there is no
// dormant path, because a move needs a live target box to restore on;
// a deployment with no armed placements cannot be a move target at all.
@@ -664,6 +669,12 @@ func (s *Server) handleAPIInstanceMoveRequest(w http.ResponseWriter, r *http.Req
jsonError(w, http.StatusConflict, "the instance is already in "+toName)
return
}
+ // The shared data-transfer rule (H3-M6, datatransfer.go), before any policy
+ // read or claim write.
+ if ref := s.moveTransferRefusal(ctx, "api instance move "+acct.Sqid+"/"+app, rec, to); ref != nil {
+ writeRefusal(w, ref)
+ return
+ }
// Both policy reads fail closed (round-4 finding 13): an unreadable
// manifest or storage binding is a 503, never a pass.
m, err := provision.GetManifest(ctx, s.cfg.Releases, acct.Sqid, app)
diff --git a/internal/console/apiinstancemove_offline.go b/internal/console/apiinstancemove_offline.go
index 53bf81cf2..3e8cd3e2d 100644
--- a/internal/console/apiinstancemove_offline.go
+++ b/internal/console/apiinstancemove_offline.go
@@ -676,6 +676,11 @@ func (s *Server) offlineBeginChecks(w http.ResponseWriter, r *http.Request, d of
jsonError(w, http.StatusConflict, "the instance is already in "+region)
return "", offlineFleet{}, false, false
}
+ // The shared data-transfer rule (H3-M6, datatransfer.go): start and stage alike.
+ if ref := s.moveTransferRefusal(ctx, "offline move "+d.acct.Sqid+"/"+d.app, rec, to); ref != nil {
+ writeRefusal(w, ref)
+ return "", offlineFleet{}, false, false
+ }
m, err := provision.GetManifest(ctx, s.cfg.Releases, d.acct.Sqid, d.app)
if err != nil && !errors.Is(err, os.ErrNotExist) {
log.Printf("console: offline move %s: manifest: %v", host, err)
@@ -850,7 +855,11 @@ func (s *Server) handleAPIInstanceOfflineStage(w http.ResponseWriter, r *http.Re
return
}
}
- st := provision.StageTarget{Stager: moves.OfflineStager(names), Bucket: tgt.DataBucket, Region: tgt.DataBucketRegion}
+ // Checked stamps the move with the destination the shared
+ // data-transfer rule just passed for in offlineBeginChecks (H3-M6):
+ // its own staging prefix is then exempt at restage and start, and no
+ // unstamped move's is.
+ st := provision.StageTarget{Stager: moves.OfflineStager(names), Bucket: tgt.DataBucket, Region: tgt.DataBucketRegion, Checked: provision.StageCheckedFor(to)}
s.offlineBegin(w, r, d, createOnly, func(id string) func(*provision.Record) error {
return provision.OfflineStage(id, d.rec.Region, to, d.addr, st, time.Now())
})
diff --git a/internal/console/apiinstances.go b/internal/console/apiinstances.go
index 9466c8379..f3d3241cc 100644
--- a/internal/console/apiinstances.go
+++ b/internal/console/apiinstances.go
@@ -2484,7 +2484,7 @@ func (s *Server) handleAPIInstanceCreate(w http.ResponseWriter, r *http.Request)
if ref := s.leftoverReplicaRefusal(r.Context(), leftoverCreate{
HAData: s.shouldStampHA(rec) && !seeded && rec.DerivesPaths(),
logTag: "api instances create " + acct.Sqid + "/" + app,
- host: host, region: region, pool: rec.Pool,
+ host: host, region: region, pool: rec.Pool, proofExempt: seeded || !rec.DataKind(),
exists: func(ctx context.Context) (bool, error) {
// Judged when admitted on (a nil judge is GetRecord): a stale
// body is no record, and the create replaces it.
diff --git a/internal/console/apiinstances_haenable_test.go b/internal/console/apiinstances_haenable_test.go
index d4051ac3c..3dddb524a 100644
--- a/internal/console/apiinstances_haenable_test.go
+++ b/internal/console/apiinstances_haenable_test.go
@@ -550,6 +550,10 @@ func TestStaleRouteNeverPlacesHAApp(t *testing.T) {
if code, res := w.enable(t, "legacy", `{}`); code != http.StatusOK {
t.Fatalf("legacy enable = %d %v", code, res)
}
+ // The legacy control creates land on fleet pi, out of the leftover
+ // rail's sight: the shared data-transfer rule (H3-M6) admits them only
+ // under an active history that examined pi.
+ forceHostsState(t, w.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:us", "fleet:pi"}})
create := func(app string) *provision.Record {
t.Helper()
host := haEnableHost(app)
diff --git a/internal/console/apisidecars.go b/internal/console/apisidecars.go
index a3589647a..75dfcc826 100644
--- a/internal/console/apisidecars.go
+++ b/internal/console/apisidecars.go
@@ -448,6 +448,7 @@ func (s *Server) handleAPISidecarCreate(w http.ResponseWriter, r *http.Request)
readFailed: doorRefusal{Status: http.StatusBadGateway, Msg: "could not create the sidecar — try again"},
taken: "the name " + name + " still holds data from a deleted sidecar. Choose another name, or ask an operator to purge it.",
unsure: "could not check whether the name " + name + " is free. Try again.",
+ subject: "the sidecar " + name,
}); ref != nil {
setNoCapacityRetryAfter(w, ref)
jsonError(w, ref.Status, ref.Msg)
diff --git a/internal/console/createleftovers.go b/internal/console/createleftovers.go
index 045511d66..e9de8ce28 100644
--- a/internal/console/createleftovers.go
+++ b/internal/console/createleftovers.go
@@ -11,15 +11,25 @@
// console's data bucket still holds an LTX file, and refuse on uncertainty
// when the bucket cannot be read.
//
-// For legacy creates the check only sees THIS console's region. A
-// record homed in another region, placed on a customer fleet, or run in a
-// pool is created unchecked, because its data lives somewhere this console's
-// role cannot read (resolveReplica's residency rules). Leftovers in this region under a
-// host created elsewhere are not seen either, and a later move of that
-// instance into this region would land on top of them. A console with no
-// data bucket configured checks nothing. Plain HA data creates instead require
-// home, unpooled data with a bounded whole-prefix proof and retain the staging
-// check. Uninspectable home data fails closed; remote and pooled data is refused.
+// The console can only check replicas in its own region's bucket. Data a
+// deleted record left on a box's disk is beyond it: a pooled record's
+// database on its pool box, every record on a console with no data bucket,
+// and a local database in this region whose bucket prefix is clean. None of
+// those is proved safe here; they are the box owner binding's to close
+// (docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md).
+//
+// For legacy creates the check only sees THIS console's region. The create
+// doors, the move doors and the place door all go through one admission
+// rule (dataTransferRefusal, datatransfer.go): in sight, this bucket check;
+// out of sight (another region's bucket, a fleet), an active hostname
+// history that examined the destination and still covers it, else 409
+// (hunt H3-M6). A pooled record keeps no replica of its own and is created
+// unchecked here: its leftovers are local, on the pool box, and not this
+// rail's to see. A console with no data bucket configured checks nothing,
+// which does not make its boxes' local leftovers safe. Plain HA data
+// creates instead require home, unpooled data with a bounded whole-prefix
+// proof and retain the staging check. Uninspectable home data fails
+// closed; remote and pooled data is refused.
package console
@@ -45,7 +55,8 @@ import (
// record's data is on the pool's own box; a fleet placement is never this
// console's to read, whatever its own region string says; and otherwise the
// record's region must equal the console's ("" == "" on the home region and
-// on a single-region deployment).
+// on a single-region deployment). Applies means the bucket replica can be
+// checked, nothing more: a local database on the box is not seen.
func (s *Server) leftoverCheckApplies(region, pool string) bool {
if s.cfg.HibernateBucket == "" || pool != "" {
return false
@@ -56,6 +67,25 @@ func (s *Server) leftoverCheckApplies(region, pool string) bool {
return region == s.cfg.Region
}
+// leftoverOutOfSight reports whether a record homed in region, in pool,
+// keeps a host-keyed replica this console cannot read: a data bucket is
+// configured here (a console with none checks nothing), the record is
+// unpooled (a pooled record keeps no replica of its own), and its data
+// lives in another region's bucket or on a fleet. Such a create cannot be
+// proved free of a deleted record's data from here (H3-M6). Pooled records
+// and consoles with no data bucket are not out of sight here, and not
+// proved safe either: their leftovers are local, on a box, and only the
+// box owner binding can refuse them.
+func (s *Server) leftoverOutOfSight(region, pool string) bool {
+ if s.cfg.HibernateBucket == "" || pool != "" {
+ return false
+ }
+ if _, fleet := registry.FleetPlacement(region); fleet {
+ return true
+ }
+ return region != s.cfg.Region
+}
+
// hostHoldsReplicaData reports whether host's replica prefix or its move
// staging prefix holds any LTX file, at any level from 0 to the snapshot
// level. It stops at the first file. Every error is returned, never treated
@@ -86,6 +116,19 @@ func (s *Server) hostHoldsReplicaData(ctx context.Context, host string) (bool, e
return s.prefixHoldsGenerations(ctx, loc, res.Client)
}
+// hostHoldsReplicaDataBesideStaging is hostHoldsReplicaData without the
+// move staging prefix: for a move whose own staged pre-copy is there
+// (dataTransfer.ownStaging). The replica prefix and its generations are
+// checked exactly as hostHoldsReplicaData checks them.
+func (s *Server) hostHoldsReplicaDataBesideStaging(ctx context.Context, host string) (bool, error) {
+ loc := activator.HibernatePrefix(s.cfg.HibernatePrefix, host)
+ held, res, err := s.prefixHoldsData(ctx, loc)
+ if held || err != nil {
+ return held, err
+ }
+ return s.prefixHoldsGenerations(ctx, loc, res.Client)
+}
+
// replicaPrefixesHoldData keeps one level walker for HA and legacy callers.
func (s *Server) replicaPrefixesHoldData(ctx context.Context, prefixes ...string) (bool, error) {
for _, prefix := range prefixes {
@@ -182,14 +225,31 @@ type leftoverCreate struct {
duplicate, readFailed doorRefusal
// taken and unsure are the rail's 409 and 503 sentences.
taken, unsure string
+ // subject names what is created in the shared rule's refusals
+ // (dataTransferRefusal): "the sidecar <name>", or the host when "".
+ subject string
+ // proofExempt is a create that needs no proof out of sight. A --from
+ // copy or a region import: its own door refuses every region but this
+ // console's ("a copy stays in its source's region", "an import runs in
+ // this console's region"), so it is never out of sight and the rail
+ // checks it as usual. A file seed on a fleet IS admitted out of sight
+ // (seedfile.go beginFileSeed), and is safe only because its box refuses
+ // it over anything it cannot attribute to this seed: a replica without
+ // this seed's placement marker (fleetSeedNotOwn), anything staged for
+ // the host (fleetSeedStagingRefusal), and a local database this seed did
+ // not place (seedOverUnattributedData, H3-M6 round 2). A static or
+ // service record: it never wakes a database, and its kind cannot
+ // change (provision.ErrKindChange).
+ proofExempt bool
}
// leftoverReplicaRefusal is the rail as the doors call it. It answers nil
-// when the create may go ahead: the record is out of this console's sight
-// (leftoverCheckApplies), or the host holds no replica data. Otherwise it
-// answers 409 with taken, or 503 with unsure when the bucket could not be
-// read. The store's own error is logged and never returned: it carries the
-// bucket name.
+// when the create may go ahead: the record is unchecked here (pooled, or no
+// data bucket; exempt out of sight), or the shared admission rule
+// (dataTransferRefusal) admits it. A prospective HA data create keeps its
+// own whole-prefix proof. Otherwise it answers 409 or 503: taken and
+// unsure in sight, the rule's own sentences out of sight. The store's own
+// error is logged and never returned: it carries the bucket name.
//
// It reads the record first. A create retried after a lost response finds
// its own record there, and that record's live replica fills the prefix,
@@ -204,7 +264,8 @@ type leftoverCreate struct {
// some of. The door must likewise take a fresh budget for its write after
// this returns.
func (s *Server) leftoverReplicaRefusal(parent context.Context, c leftoverCreate) *doorRefusal {
- if !c.HAData && !s.leftoverCheckApplies(c.region, c.pool) {
+ if !c.HAData && !s.leftoverCheckApplies(c.region, c.pool) &&
+ (c.proofExempt || !s.leftoverOutOfSight(c.region, c.pool)) {
return nil
}
ctx, cancel := context.WithTimeout(parent, instanceStoreTimeout)
@@ -217,44 +278,54 @@ func (s *Server) leftoverReplicaRefusal(parent context.Context, c leftoverCreate
if exists {
return &c.duplicate
}
- unsure := c.unsure
- taken := c.taken
- var held bool
- if c.HAData {
- kind := "instance"
- if c.sidecar {
- kind = "sidecar"
- }
- name := s.offlinePlace(c.region)
- if s.haScopeInvalid {
- return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: fmt.Sprintf(haCapacityUnknownRefusal, name), haCapacityRetryAfter: 60}
+ if !c.HAData {
+ // The shared admission rule (datatransfer.go): the bucket check in
+ // sight, with this door's own sentences; an active, examined and
+ // covering history out of sight.
+ subject := c.subject
+ if subject == "" {
+ subject = c.host
}
- if len(s.haPools[s.homeRegionOut(c.region)]) > 0 {
- return s.scopedHALeftoverRefusal(ctx, c, kind, name)
- }
- if s.homeRegionIn(c.region) != "" || c.pool != "" {
- return &doorRefusal{Status: http.StatusConflict, Msg: fmt.Sprintf("high availability data creation is not available yet in %s. use the console's home region without a pool.", name)}
- }
- unsure = fmt.Sprintf("could not check this %s's data in %s. nothing was created. try again. persistent failures may require an operator to check data access for this region.", kind, name)
- if s.cfg.SeedData == nil || !s.leftoverCheckApplies(c.region, c.pool) {
- return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: unsure}
- }
- prefix := activator.HibernatePrefix(s.cfg.HibernatePrefix, c.host) + "/"
- class, proofErr := firstHALeftover(ctx, s.cfg.SeedData, prefix)
- if proofErr != nil {
- log.Printf("console: %s: HA prefix check for %s: %v", c.logTag, c.host, proofErr)
- return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: unsure}
- }
- if class != "" {
- return &doorRefusal{Status: http.StatusConflict, Msg: fmt.Sprintf("%s still holds %s from a deleted %s. choose another address, or ask an operator to purge it.", c.host, class, kind)}
- }
- // The whole-prefix proof covered every instance level. Move staging
- // remains a separate prefix and must still be checked at all levels.
- held, err = s.replicaPrefixesHoldData(ctx, strings.TrimSuffix(activator.MovesPrefix(c.host), "/"))
- taken = fmt.Sprintf("%s still holds replica from a deleted %s. choose another address, or ask an operator to purge it.", c.host, kind)
- } else {
- held, err = s.hostHoldsReplicaData(ctx, c.host)
+ return s.dataTransferRefusal(ctx, dataTransfer{
+ logTag: c.logTag,
+ recs: []transferRec{{c.host, c.pool}},
+ to: c.region,
+ what: func(place string) string { return subject + " can't be created in " + place },
+ taken: func(string) string { return c.taken },
+ unsure: c.unsure,
+ })
+ }
+ kind := "instance"
+ if c.sidecar {
+ kind = "sidecar"
+ }
+ name := s.offlinePlace(c.region)
+ if s.haScopeInvalid {
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: fmt.Sprintf(haCapacityUnknownRefusal, name), haCapacityRetryAfter: 60}
+ }
+ if len(s.haPools[s.homeRegionOut(c.region)]) > 0 {
+ return s.scopedHALeftoverRefusal(ctx, c, kind, name)
+ }
+ if s.homeRegionIn(c.region) != "" || c.pool != "" {
+ return &doorRefusal{Status: http.StatusConflict, Msg: fmt.Sprintf("high availability data creation is not available yet in %s. use the console's home region without a pool.", name)}
+ }
+ unsure := fmt.Sprintf("could not check this %s's data in %s. nothing was created. try again. persistent failures may require an operator to check data access for this region.", kind, name)
+ if s.cfg.SeedData == nil || !s.leftoverCheckApplies(c.region, c.pool) {
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: unsure}
+ }
+ prefix := activator.HibernatePrefix(s.cfg.HibernatePrefix, c.host) + "/"
+ class, proofErr := firstHALeftover(ctx, s.cfg.SeedData, prefix)
+ if proofErr != nil {
+ log.Printf("console: %s: HA prefix check for %s: %v", c.logTag, c.host, proofErr)
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: unsure}
+ }
+ if class != "" {
+ return &doorRefusal{Status: http.StatusConflict, Msg: fmt.Sprintf("%s still holds %s from a deleted %s. choose another address, or ask an operator to purge it.", c.host, class, kind)}
}
+ // The whole-prefix proof covered every instance level. Move staging
+ // remains a separate prefix and must still be checked at all levels.
+ held, err := s.replicaPrefixesHoldData(ctx, strings.TrimSuffix(activator.MovesPrefix(c.host), "/"))
+ taken := fmt.Sprintf("%s still holds replica from a deleted %s. choose another address, or ask an operator to purge it.", c.host, kind)
if err != nil {
log.Printf("console: %s: leftover replica check for %s: %v", c.logTag, c.host, err)
return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: unsure}
diff --git a/internal/console/createleftovers_h3m6_test.go b/internal/console/createleftovers_h3m6_test.go
new file mode 100644
index 000000000..53fef5e37
--- /dev/null
+++ b/internal/console/createleftovers_h3m6_test.go
@@ -0,0 +1,189 @@
+package console
+
+// Hunt H3-M6: a create whose data would live where this console cannot
+// read (another region's bucket, a fleet) cannot be proved free of a
+// deleted record's replica, which the new record's first wake would
+// restore whatever app or account it belonged to. Such a create is refused
+// until the hostname history is active, when the mark step refuses every
+// host that has held data (S1) and a fresh mark proves the host free. The
+// tests go through the production doors (rawReq on the instance and
+// sidecar create URLs).
+
+import (
+ "context"
+ "net/http"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+// msgCreateUnchecked is the shared rule's refusal of a create out of sight
+// with the history not active.
+func msgCreateUnchecked(subject, place, host string) string {
+ return msgTransferUnchecked(subject+" can't be created in "+place, place, host)
+}
+
+// shopappFixture is leftoverFixture with a second app of the same account,
+// shopapp, enabled for unpooled instances on titogo's instance domain (an
+// operator-set domain; the hunt's premise).
+func shopappFixture(t *testing.T, code string) *leftoverFx {
+ t.Helper()
+ fx := leftoverFixture(t, code)
+ if _, err := fx.st.CreateAppIn(OpsAccountID, "shopapp", "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ m := titoManifest()
+ m.App, m.Pool = "shopapp", ""
+ enableInstances(t, fx.consoleFixture, "shopapp", m)
+ return fx
+}
+
+func shopappRecord(t *testing.T, fx *leftoverFx, host string) bool {
+ t.Helper()
+ _, err := provision.GetRecord(context.Background(), fx.rel, "bab", "shopapp", host)
+ return err == nil
+}
+
+// Another app's create on titogo's leftover host: out of the console's
+// region it is refused for want of proof (the hunt's case; 201 before),
+// and in the console's region the leftover rail sees the replica and
+// refuses it as it always did. Neither writes shopapp's record.
+func TestH3M6CrossAppCreateOnALeftoverHost(t *testing.T) {
+ for _, c := range []struct {
+ name, console, want string
+ }{
+ {"out-of-region", "uk", msgCreateUnchecked("acme.go.tito.io", "ie", "acme.go.tito.io")},
+ {"same-region", "ie", "acme.go.tito.io still holds data from a deleted instance."},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ fx := shopappFixture(t, "code-h3m6-"+c.name)
+ fx.leaveReplica(t, "acme.go.tito.io") // titogo's, from its deleted record
+ fx.srv.cfg.Region = c.console
+ status, _, out := rawReq(t, http.MethodPost, instancesURL(fx.consoleFixture, "bab", "shopapp"), fx.token,
+ `{"host":"acme.go.tito.io","region":"ie"}`)
+ if status != http.StatusConflict || !strings.Contains(out, c.want) {
+ t.Fatalf("shopapp's create on titogo's leftover host = %d %s, want 409 %q", status, out, c.want)
+ }
+ if shopappRecord(t, fx, "acme.go.tito.io") {
+ t.Fatal("a refused create wrote shopapp's record anyway")
+ }
+ })
+ }
+}
+
+// A fleet placement is out of sight whatever the console's region: the
+// data is in the fleet's own bucket. shopapp placed on a fleet is refused
+// the same way, naming the fleet.
+func TestH3M6FleetPlacedCreateIsRefused(t *testing.T) {
+ fx := shopappFixture(t, "code-h3m6-fleet")
+ if status, body := postJSON(t, fx.ts.URL+"/api/cli/fleets/bab/new",
+ map[string]string{"name": "eleven", "bucket": "eleven-fleet-data"}, fx.token); status != http.StatusOK {
+ t.Fatalf("create fleet = %d %v", status, body)
+ }
+ owner := cliToken(t, fx.consoleFixture, "paul@keymail.dev", "code-h3m6-fleet-owner")
+ if status, body := postJSON(t, fx.ts.URL+"/api/cli/apps/bab/shopapp/place",
+ map[string]string{"target": "fleet/eleven"}, owner); status != http.StatusOK {
+ t.Fatalf("place = %d %v", status, body)
+ }
+ status, _, out := rawReq(t, http.MethodPost, instancesURL(fx.consoleFixture, "bab", "shopapp"), fx.token,
+ `{"host":"acme.go.tito.io","region":"ie"}`)
+ if status != http.StatusConflict || errorText(out) != msgCreateUnchecked("acme.go.tito.io", "fleet eleven", "acme.go.tito.io") {
+ t.Fatalf("fleet-placed create = %d %s, want the out-of-sight 409", status, out)
+ }
+ if shopappRecord(t, fx, "acme.go.tito.io") {
+ t.Fatal("a refused create wrote shopapp's record anyway")
+ }
+ if n := fx.opens.Load(); n != 0 {
+ t.Fatalf("replica clients opened = %d for a fleet placement, want 0", n)
+ }
+}
+
+// activeOutOfRegion is a console in uk whose hostname history is active
+// and examined ie, as activation would leave it.
+func activeOutOfRegion(t *testing.T, fx *leftoverFx) {
+ t.Helper()
+ fx.srv.cfg.Region = "uk"
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie", "region:uk"}})
+}
+
+// With the history active, the mark is the proof. A host activation found
+// data under (marked) is refused with S1 at both doors, whoever's the data
+// was; an unmarked host was never used, so the create goes ahead out of
+// region, and marks it.
+func TestH3M6ActiveHistoryDecidesOutOfRegion(t *testing.T) {
+ for _, d := range leftoverDoors {
+ t.Run(d.name+"/marked", func(t *testing.T) {
+ fx := leftoverFixture(t, "code-h3m6-marked-"+d.name)
+ activeOutOfRegion(t, fx)
+ if _, err := provision.MarkHostUsed(context.Background(), fx.rel, provision.HostUse{Host: d.host, Source: "activation"}); err != nil {
+ t.Fatal(err)
+ }
+ status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body)
+ if status != http.StatusConflict || !strings.Contains(out, msgHostUsed(d.host)) {
+ t.Fatalf("create on a marked host = %d %s, want S1", status, out)
+ }
+ if d.exists(t, fx.consoleFixture) {
+ t.Fatal("a refused create wrote a record anyway")
+ }
+ })
+ t.Run(d.name+"/unmarked", func(t *testing.T) {
+ fx := leftoverFixture(t, "code-h3m6-fresh-"+d.name)
+ activeOutOfRegion(t, fx)
+ status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body)
+ if status != http.StatusCreated {
+ t.Fatalf("create on an unmarked host = %d %s, want 201", status, out)
+ }
+ if !d.exists(t, fx.consoleFixture) || !marked(t, fx.rel, d.host) {
+ t.Fatal("the create answered 201 without its record and its mark")
+ }
+ })
+ }
+}
+
+// The app's own retry of an out-of-region create that landed still gets
+// the door's ordinary duplicate answer, after the history stopped being
+// active (an operator's invalidation lifted back to incomplete, say).
+func TestH3M6OutOfRegionRetryIsTheOrdinaryDuplicate(t *testing.T) {
+ dup := map[string]string{"instance": "instance acme.go.tito.io already exists", "sidecar": "sidecar bot already exists"}
+ for _, d := range leftoverDoors {
+ t.Run(d.name, func(t *testing.T) {
+ fx := leftoverFixture(t, "code-h3m6-retry-"+d.name)
+ activeOutOfRegion(t, fx)
+ if status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body); status != http.StatusCreated {
+ t.Fatalf("first create = %d %s", status, out)
+ }
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeIncomplete})
+ status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body)
+ if status != http.StatusConflict || !strings.Contains(out, dup[d.name]) {
+ t.Fatalf("retry = %d %s, want the ordinary 409 %q", status, out, dup[d.name])
+ }
+ })
+ }
+}
+
+// Which records the rail cannot see: unpooled, with a data bucket here,
+// and homed in another region or on a fleet.
+func TestLeftoverOutOfSight(t *testing.T) {
+ s := &Server{}
+ for _, c := range []struct {
+ region, pool, console, bucket string
+ want bool
+ }{
+ {"", "", "", "data-test", false},
+ {"ie", "", "ie", "data-test", false},
+ {"uk", "", "ie", "data-test", true},
+ {"", "", "ie", "data-test", true},
+ {"ie", "", "", "data-test", true},
+ {"fleet/acme", "", "fleet/acme", "data-test", true},
+ {"fleet/acme", "", "", "data-test", true},
+ {"uk", "", "ie", "", false},
+ {"uk", "tito", "ie", "data-test", false},
+ } {
+ s.cfg.Region, s.cfg.HibernateBucket = c.console, c.bucket
+ if got := s.leftoverOutOfSight(c.region, c.pool); got != c.want {
+ t.Errorf("record %q pool %q on console %q (bucket %q) = %v, want %v", c.region, c.pool, c.console, c.bucket, got, c.want)
+ }
+ }
+}
diff --git a/internal/console/createleftovers_test.go b/internal/console/createleftovers_test.go
index c941c4104..43bb92449 100644
--- a/internal/console/createleftovers_test.go
+++ b/internal/console/createleftovers_test.go
@@ -179,23 +179,33 @@ func TestCreateAllowsACleanHost(t *testing.T) {
}
}
-// A record homed in another region is not checked: its data lives in that
-// region's bucket, which this console cannot read. The gap is documented at
-// the rail; this pins that the rail does not refuse what it cannot see.
-func TestCreateSkipsTheCheckInAnotherRegion(t *testing.T) {
+// A record homed in another region keeps its data in that region's bucket,
+// which this console cannot read, so it cannot prove the host free of a
+// deleted record's replica. Until the hostname history is active the create
+// is refused (H3-M6), leftover or not, without reaching for a replica
+// client and without writing a record. (It answered 201 unchecked before.)
+// createleftovers_h3m6_test.go has the active history, fleets and retries.
+func TestCreateRefusesAnotherRegionUntilTheHistoryIsActive(t *testing.T) {
for _, d := range leftoverDoors {
- t.Run(d.name, func(t *testing.T) {
- fx := leftoverFixture(t, "code-left-region-"+d.name)
- fx.srv.cfg.Region = "uk"
- fx.leaveReplica(t, d.host)
- status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body)
- if status != http.StatusCreated {
- t.Fatalf("create = %d %s, want 201 (unchecked)", status, out)
- }
- if n := fx.opens.Load(); n != 0 {
- t.Fatalf("replica clients opened = %d for an out-of-region record, want 0", n)
- }
- })
+ for _, leftover := range []bool{true, false} {
+ t.Run(fmt.Sprintf("%s/leftover=%v", d.name, leftover), func(t *testing.T) {
+ fx := leftoverFixture(t, "code-left-region-"+d.name)
+ fx.srv.cfg.Region = "uk"
+ if leftover {
+ fx.leaveReplica(t, d.host)
+ }
+ status, _, out := rawReq(t, http.MethodPost, d.url(fx.consoleFixture), fx.token, d.body)
+ if status != http.StatusConflict || !strings.Contains(out, "can't be created in ie: this console can't check ie") {
+ t.Fatalf("create = %d %s, want the out-of-sight 409", status, out)
+ }
+ if d.exists(t, fx.consoleFixture) {
+ t.Fatal("a refused create wrote a record anyway")
+ }
+ if n := fx.opens.Load(); n != 0 {
+ t.Fatalf("replica clients opened = %d for an out-of-region record, want 0", n)
+ }
+ })
+ }
}
}
diff --git a/internal/console/datatransfer.go b/internal/console/datatransfer.go
new file mode 100644
index 000000000..cf7c637d5
--- /dev/null
+++ b/internal/console/datatransfer.go
@@ -0,0 +1,221 @@
+package console
+
+import (
+ "context"
+ "log"
+ "net/http"
+
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+// The one admission rule for binding data-kind records to storage (hunt
+// H3-M6, Paul's ruling 2026-11-30: refuse up front, one shared rule).
+//
+// A box keeps a record's database under its HOST alone, and a deleted
+// record's data stays where it was. Any door that puts a data-kind record
+// on storage it was not on (a create, a move's start or stage, an app's
+// placement onto a fleet or back home) can hand that record another
+// owner's data unless the destination is proved free of it. Every such
+// door calls the rule (dataTransferVerdict) before its first write;
+// TestEveryDataTransferDoorAsksTheSharedRule fails a door that does not.
+//
+// The rule, per record, by where the destination's data lives:
+// - In sight (a data bucket here, unpooled, the console's own region):
+// the bucket's replica and staging prefixes are checked for each host
+// (hostHoldsReplicaData). Held is 409, unreadable is 503.
+// - Out of sight (another region's bucket, a fleet): admitted only when
+// the hostname history is active AND the destination was examined and
+// is still covered: hostsTargetRefusal (examined, not closed) and
+// hostsCoverageRefusal (no box or bucket added since), the facts a
+// create already meets. Every host that ever held data in an examined
+// target was marked. A record CREATED under an active history holds its
+// host only because the mark was new (S1), so nothing else ever held
+// data under it. A record created before activation is not proved so:
+// marks are first-wins and pass while incomplete, and activation marks
+// a host once whether a live record, a leftover, or both named it. Such
+// a never-woken record moved to a target holding another owner's
+// leftover is the residual this rule does not close; each console
+// needs a one-time audit at activation (its live data records older
+// than activation, against the other targets' buckets). Anything else
+// is 409, telling an operator what to run; an unreadable history is
+// 503.
+// - Neither (a pooled record, a console with no data bucket): the data a
+// deleted record left is on a box's disk, which the console cannot
+// read. Not proved safe; it is the box owner binding's to refuse
+// (docs/superpowers/notes/2026-11-30-h3-m6-box-owner-binding.md).
+//
+// A transfer with no data-kind record admits at once.
+
+// transferRec is one data-kind record the door binds: its host and pool.
+type transferRec struct{ host, pool string }
+
+// dataTransfer is one door's request, as the rule needs it.
+type dataTransfer struct {
+ logTag string
+ // recs are the data-kind records the door binds at to. A create
+ // passes the record it would write.
+ recs []transferRec
+ // to is the destination in the record's Region form ("" home,
+ // "fleet/<name>").
+ to string
+ // ownStaging is a move whose record carries an offline move staged to
+ // this destination by a stage door that passed this rule
+ // (MoveState.StageChecked): its own pre-copy at moves/<host>/ is not a
+ // leftover, so that one prefix is not counted. The replica prefix and
+ // its generations still are.
+ ownStaging bool
+ // what opens every refusal dataTransferRefusal words: "acme can't be
+ // created in ie", given the destination's label. The move doors word
+ // their own (moveTransferRefusal).
+ what func(place string) string
+ // taken and unsure, when set, replace the in-sight answers (the create
+ // doors' approved sentences).
+ taken func(host string) string
+ unsure string
+ // unchecked, when set, replaces the out-of-sight refusal for a history
+ // that is not active (the place door: completing the history would not
+ // admit a place, which an active history refuses outright).
+ unchecked func(place, host string) string
+}
+
+// transferVerdict is the rule's answer.
+type transferVerdict int
+
+const (
+ transferAdmitted transferVerdict = iota
+ transferHeld // 409: in sight, data at the host's prefixes
+ transferUnsure // 503: in sight, the bucket could not be read
+ transferUnchecked // 409: out of sight, history not active
+ transferNeverChecked // 409: out of sight, claims or Phase 1 on
+ transferUncovered // 409: out of sight, not examined or not covered
+ transferUnreadable // 503: out of sight, history or roster unreadable
+)
+
+// transferOutcome is the verdict, the host it is about, and the
+// destination's label.
+type transferOutcome struct {
+ verdict transferVerdict
+ host, place string
+}
+
+// dataTransferVerdict is the rule itself. Every door reaches it, through
+// dataTransferRefusal or moveTransferRefusal.
+func (s *Server) dataTransferVerdict(ctx context.Context, t dataTransfer) transferOutcome {
+ if len(t.recs) == 0 {
+ return transferOutcome{}
+ }
+ place := s.offlinePlace(t.to)
+ outOfSight := ""
+ for _, rec := range t.recs {
+ switch {
+ case s.leftoverCheckApplies(t.to, rec.pool):
+ held, err := s.hostHoldsReplicaData(ctx, rec.host)
+ if t.ownStaging {
+ held, err = s.hostHoldsReplicaDataBesideStaging(ctx, rec.host)
+ }
+ if err != nil {
+ log.Printf("console: %s: leftover replica check for %s: %v", t.logTag, rec.host, err)
+ return transferOutcome{transferUnsure, rec.host, place}
+ }
+ if held {
+ log.Printf("console: %s: refused: %s still holds replica data (H3-M6)", t.logTag, rec.host)
+ return transferOutcome{transferHeld, rec.host, place}
+ }
+ case s.leftoverOutOfSight(t.to, rec.pool):
+ if outOfSight == "" {
+ outOfSight = rec.host
+ }
+ }
+ }
+ if outOfSight == "" {
+ return transferOutcome{}
+ }
+ mode, err := s.hostsMode(ctx)
+ if err != nil {
+ log.Printf("console: %s: read the hostname history's mode: %v", t.logTag, err)
+ return transferOutcome{transferUnreadable, outOfSight, place}
+ }
+ if mode != provision.HostsModeActive {
+ log.Printf("console: %s: refused: %s's data would be in %q, out of this console's sight, and the hostname history is %s (H3-M6)", t.logTag, outOfSight, t.to, mode)
+ if s.cfg.HostClaim || s.cfg.MovesEnabled {
+ return transferOutcome{transferNeverChecked, outOfSight, place}
+ }
+ return transferOutcome{transferUnchecked, outOfSight, place}
+ }
+ for _, check := range []func(context.Context, string) *doorRefusal{s.hostsTargetRefusal, s.hostsCoverageRefusal} {
+ if ref := check(ctx, t.to); ref != nil {
+ if ref.Status == http.StatusServiceUnavailable {
+ return transferOutcome{transferUnreadable, outOfSight, place}
+ }
+ log.Printf("console: %s: refused: %q was not examined, or is not covered as recorded, by the active hostname history (H3-M6)", t.logTag, t.to)
+ return transferOutcome{transferUncovered, outOfSight, place}
+ }
+ }
+ return transferOutcome{}
+}
+
+// dataTransferRefusal is the rule worded for the create and place doors:
+// nil when admitted, else the refusal.
+func (s *Server) dataTransferRefusal(ctx context.Context, t dataTransfer) *doorRefusal {
+ o := s.dataTransferVerdict(ctx, t)
+ if o.verdict == transferAdmitted {
+ return nil
+ }
+ what := t.what(o.place)
+ switch o.verdict {
+ case transferHeld:
+ if t.taken != nil {
+ return &doorRefusal{Status: http.StatusConflict, Msg: t.taken(o.host)}
+ }
+ return &doorRefusal{Status: http.StatusConflict, Msg: msgTransferHeld(what, o.host, o.place)}
+ case transferUnsure:
+ if t.unsure != "" {
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: t.unsure}
+ }
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: what + ": the data in " + o.place + " could not be checked. Try again."}
+ case transferUnchecked:
+ if t.unchecked != nil {
+ return &doorRefusal{Status: http.StatusConflict, Msg: t.unchecked(o.place, o.host)}
+ }
+ return &doorRefusal{Status: http.StatusConflict, Msg: msgTransferUnchecked(what, o.place, o.host)}
+ case transferNeverChecked:
+ return &doorRefusal{Status: http.StatusConflict, Msg: msgTransferNeverChecked(what, o.place, o.host)}
+ case transferUncovered:
+ return &doorRefusal{Status: http.StatusConflict, Msg: msgTransferUncovered(what, o.place)}
+ default:
+ return &doorRefusal{Status: http.StatusServiceUnavailable, Msg: msgTransferUnreadable(what, o.place)}
+ }
+}
+
+// The rule's sentences. what is the door's opening ("acme can't move to
+// uk"), place the destination's label, host the record's hostname.
+func msgTransferHeld(what, host, place string) string {
+ return what + ": " + host + " already has data in " + place + ". An operator has to look at it before this can go ahead."
+}
+
+func msgTransferUnreadable(what, place string) string {
+ return what + ": the hostname history, or the boxes or data bucket in " + place + ", could not be read. Try again."
+}
+
+func msgTransferUnchecked(what, place, host string) string {
+ return what + ": this console can't check " + place + " for data a deleted record left under " + host +
+ ". An operator can allow it by completing the hostname history (console hosts-used) with " + place + " scanned."
+}
+
+// msgPlaceUnchecked is the place door's out-of-sight refusal with the
+// history not active. Completing the history is no way through: an active
+// history refuses every place (S3, msgPlacementFixed).
+func msgPlaceUnchecked(app, place, host string) string {
+ return app + "'s instances can't move to " + place + ": this console can't check " + place + " for data a deleted record left under " + host +
+ ", so their placement can't be changed."
+}
+
+func msgTransferNeverChecked(what, place, host string) string {
+ return what + ": this console can't check " + place + " for data a deleted record left under " + host +
+ ", and its hostname history can't be completed while host claims or Phase 1 moves are on."
+}
+
+func msgTransferUncovered(what, place string) string {
+ return what + ": " + place + " was not scanned when the hostname history was completed, or the boxes or data bucket there have changed since." +
+ " An operator can allow it by completing the history again with " + place + " scanned."
+}
diff --git a/internal/console/datatransfer_guard_test.go b/internal/console/datatransfer_guard_test.go
new file mode 100644
index 000000000..e3acf6bc1
--- /dev/null
+++ b/internal/console/datatransfer_guard_test.go
@@ -0,0 +1,178 @@
+package console
+
+// The guard for the shared data-transfer rule (H3-M6, datatransfer.go): no
+// console door may bind a data-kind record to storage without asking
+// dataTransferVerdict (directly, or through dataTransferRefusal or
+// moveTransferRefusal). It reads the package's own source. A function that
+// rewrites a record's region (SetRecordRegion) or builds a move's start
+// (MoveRequest, MoveStartTransition, OfflineStart, OfflineStage) must reach
+// the rule through this package's calls, and so must every door named in
+// transferDoors (the create doors write through helpers the sinks do not
+// name). A new door that skips the rule fails here.
+
+import (
+ "go/ast"
+ "go/parser"
+ "go/token"
+ "os"
+ "path/filepath"
+ "sort"
+ "strings"
+ "testing"
+)
+
+// transferSinks are the provision calls that put an existing record on
+// other storage, or begin to.
+var transferSinks = map[string]bool{
+ "SetRecordRegion": true, "MoveRequest": true, "MoveStartTransition": true,
+ "OfflineStart": true, "OfflineStage": true,
+}
+
+// transferDoors must reach the rule whatever they call.
+var transferDoors = []string{
+ "handleAPIInstanceCreate", "handleAPISidecarCreate",
+ "legacyHandleAPIInstanceMoveRequest", "handleAPIInstanceMoveRequest",
+ "handleAPIInstanceOfflineStart", "handleAPIInstanceOfflineStage",
+ "placeAppTarget",
+}
+
+const transferRule = "dataTransferVerdict"
+
+// transferGraph is each declared function's (or method's, by name) set of
+// referenced names, and the sinks it calls.
+type transferGraph struct {
+ refs map[string]map[string]bool
+ sinks map[string][]string
+}
+
+func buildTransferGraph(fset *token.FileSet, files []*ast.File) transferGraph {
+ g := transferGraph{refs: map[string]map[string]bool{}, sinks: map[string][]string{}}
+ for _, f := range files {
+ for _, d := range f.Decls {
+ fd, ok := d.(*ast.FuncDecl)
+ if !ok || fd.Body == nil {
+ continue
+ }
+ name := fd.Name.Name
+ if g.refs[name] == nil {
+ g.refs[name] = map[string]bool{}
+ }
+ ast.Inspect(fd.Body, func(n ast.Node) bool {
+ switch x := n.(type) {
+ case *ast.SelectorExpr:
+ g.refs[name][x.Sel.Name] = true
+ if id, ok := x.X.(*ast.Ident); ok && id.Name == "provision" && transferSinks[x.Sel.Name] {
+ g.sinks[name] = append(g.sinks[name], x.Sel.Name+"@"+fset.Position(x.Pos()).String())
+ }
+ case *ast.Ident:
+ g.refs[name][x.Name] = true
+ }
+ return true
+ })
+ }
+ }
+ return g
+}
+
+// reaches reports whether from refers, directly or through the package's
+// own functions, to the rule.
+func (g transferGraph) reaches(from string) bool {
+ seen := map[string]bool{}
+ stack := []string{from}
+ for len(stack) > 0 {
+ f := stack[len(stack)-1]
+ stack = stack[:len(stack)-1]
+ if seen[f] {
+ continue
+ }
+ seen[f] = true
+ for r := range g.refs[f] {
+ if r == transferRule {
+ return true
+ }
+ if _, declared := g.refs[r]; declared && !seen[r] {
+ stack = append(stack, r)
+ }
+ }
+ }
+ return false
+}
+
+// transferProblems is every sink function and named door that does not
+// reach the rule.
+func transferProblems(g transferGraph, doors []string) []string {
+ var out []string
+ for f, sites := range g.sinks {
+ if f != transferRule && !g.reaches(f) {
+ out = append(out, f+" writes a record's storage ("+strings.Join(sites, ", ")+") without asking "+transferRule)
+ }
+ }
+ for _, d := range doors {
+ if _, ok := g.refs[d]; !ok {
+ out = append(out, "door "+d+" is gone: update transferDoors")
+ } else if !g.reaches(d) {
+ out = append(out, "door "+d+" does not ask "+transferRule)
+ }
+ }
+ sort.Strings(out)
+ return out
+}
+
+func TestEveryDataTransferDoorAsksTheSharedRule(t *testing.T) {
+ fset := token.NewFileSet()
+ paths, err := filepath.Glob("*.go")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var files []*ast.File
+ for _, p := range paths {
+ if strings.HasSuffix(p, "_test.go") {
+ continue
+ }
+ f, err := parser.ParseFile(fset, p, nil, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ files = append(files, f)
+ }
+ g := buildTransferGraph(fset, files)
+ if len(g.sinks) < 4 {
+ t.Fatalf("found sinks only in %v: the walk is broken", g.sinks)
+ }
+ if p := transferProblems(g, transferDoors); len(p) > 0 {
+ t.Fatalf("data-transfer guard:\n %s", strings.Join(p, "\n "))
+ }
+}
+
+// The guard fails a door that skips the rule, directly or through a
+// helper, and passes one that asks it through a helper.
+func TestDataTransferGuardRejectsASkippingDoor(t *testing.T) {
+ src := `package console
+func (s *Server) openDoor() { provision.SetRecordRegion(nil, nil, "", "", "", "") }
+func (s *Server) helperDoor() { s.rewrite() }
+func (s *Server) rewrite() { provision.OfflineStart("", "", "", "", 0) }
+func (s *Server) goodDoor() { if s.check() == nil { provision.MoveRequest("", 0) } }
+func (s *Server) check() *doorRefusal { s.dataTransferVerdict(nil, dataTransfer{}); return nil }
+func (s *Server) dataTransferVerdict(any, any) transferOutcome { return transferOutcome{} }
+`
+ dir := t.TempDir()
+ p := filepath.Join(dir, "x.go")
+ if err := os.WriteFile(p, []byte(src), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ fset := token.NewFileSet()
+ f, err := parser.ParseFile(fset, p, nil, 0)
+ if err != nil {
+ t.Fatal(err)
+ }
+ got := transferProblems(buildTransferGraph(fset, []*ast.File{f}), []string{"helperDoor", "goodDoor", "missingDoor"})
+ want := []string{"door helperDoor does not ask", "door missingDoor is gone", "openDoor writes", "rewrite writes"}
+ if len(got) != len(want) {
+ t.Fatalf("problems = %q, want %d", got, len(want))
+ }
+ for i, w := range want {
+ if !strings.HasPrefix(got[i], w) {
+ t.Errorf("problem %d = %q, want prefix %q", i, got[i], w)
+ }
+ }
+}
diff --git a/internal/console/fleets.go b/internal/console/fleets.go
index d6c144d3d..f585d8a62 100644
--- a/internal/console/fleets.go
+++ b/internal/console/fleets.go
@@ -1029,6 +1029,29 @@ func (s *Server) placeAppTarget(ctx context.Context, acct *Account, app, target
if len(stale) > 0 {
return http.StatusConflict, staleSealedRefusal(app, stale)
}
+ // The shared data-transfer rule (H3-M6, datatransfer.go), before the
+ // claim's start and before any write: a place re-homes every changed
+ // record onto the target's storage, in both directions (onto a fleet,
+ // and back to "" home), and a data-kind record there could inherit a
+ // deleted record's data under its host. An app whose changed records
+ // are all exempt kinds (static, service) places as before.
+ var moving []transferRec
+ for _, rec := range changed {
+ if rec.DataKind() {
+ moving = append(moving, transferRec{rec.Host, rec.Pool})
+ }
+ }
+ if ref := s.dataTransferRefusal(ctx, dataTransfer{
+ logTag: "place " + acct.Sqid + "/" + app,
+ recs: moving,
+ to: target,
+ what: func(place string) string { return app + "'s instances can't move to " + place },
+ // Completing the history would not admit a place: an active one
+ // refuses every place (msgPlacementFixed, above).
+ unchecked: func(place, host string) string { return msgPlaceUnchecked(app, place, host) },
+ }); ref != nil {
+ return ref.Status, ref.Msg
+ }
// An app with a fleet size moves only to a fleet of the account's own
// whose every box has room for it (#892 S2 P7, PS-2-C14), before
// anything is written. A host-claim console hands the walk to the
diff --git a/internal/console/ha_born_test.go b/internal/console/ha_born_test.go
index b94d6e568..820971cec 100644
--- a/internal/console/ha_born_test.go
+++ b/internal/console/ha_born_test.go
@@ -70,9 +70,13 @@ func TestCreateStampsBornHA(t *testing.T) {
if rec := create("ha.shop.example.com", "ie"); !rec.HA || rec.Region != "" {
t.Fatal("a host created in an HA region is not stamped")
}
+ // A create outside the console's region needs an active hostname
+ // history (H3-M6, createleftovers.go): the mark is its only proof.
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:uk"}})
if rec := create("legacy.shop.example.com", "uk"); rec.HA {
t.Fatal("stamped outside an HA region")
}
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeIncomplete})
// The home region's records keep region "", and match by the home code.
fx.srv.cfg.HomeRegion = "ie"
if rec := create("home.shop.example.com", ""); rec.Region != "" || !rec.HA {
diff --git a/internal/console/ha_pool_scope_test.go b/internal/console/ha_pool_scope_test.go
index 30624128e..aa406199d 100644
--- a/internal/console/ha_pool_scope_test.go
+++ b/internal/console/ha_pool_scope_test.go
@@ -188,6 +188,15 @@ func haPoolWorldNew(t *testing.T, region, pool string, tweak func(*Config)) *haP
return w
}
+// legacyAdmitted makes the hostname history active over the world's region
+// as it is now, so a legacy (non-HA, unpooled) control create there passes
+// the shared data-transfer rule (H3-M6): the region is out of the home
+// console's sight.
+func (w *haPoolWorld) legacyAdmitted(t *testing.T) {
+ t.Helper()
+ forceHostsState(t, w.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:" + w.region}})
+}
+
func (w *haPoolWorld) edge(t *testing.T, ref string, edit func(map[string]any)) {
t.Helper()
body := haEdit(t, haGolden(t), func(m map[string]any) {
@@ -408,6 +417,7 @@ func TestHAPoolLegacyMatchesDisabled(t *testing.T) {
}
})
w.srv.haCapacity.Store(nil)
+ w.legacyAdmitted(t)
code, _, out := w.post(t, sidecar, w.body(sidecar))
if code != 201 {
t.Fatalf("legacy=%d %s", code, out)
@@ -473,6 +483,9 @@ func TestHAPoolShapeAndDevScope(t *testing.T) {
m := titoSidecarManifest()
m.Pool, m.Regions, m.Hibernate = pool, nil, &no
enableSidecars(t, w.consoleFixture, "titogo", m)
+ if pool == "" {
+ w.legacyAdmitted(t)
+ }
w.track()
code, _, out := w.post(t, true, w.body(true))
if pool == "ha" {
@@ -526,6 +539,7 @@ func TestHAPoolMixedStorage(t *testing.T) {
m := titoManifest()
m.Pool, m.Regions = "", nil
enableInstances(t, w.consoleFixture, "titogo", m)
+ w.legacyAdmitted(t)
code, _, out = w.post(t, false, `{"host":"plain.go.tito.io","region":"us"}`)
if code != 201 {
t.Fatalf("plain create blocked by mixed storage=%d %s", code, out)
@@ -578,6 +592,10 @@ func TestHAPoolTransfersRemainRegional(t *testing.T) {
if err := w.st.SetOperator("alice@keymail.dev", true); err != nil {
t.Fatal(err)
}
+ // A legacy create out of the console's region is admitted by the
+ // shared data-transfer rule (H3-M6) only under an active history
+ // that examined it.
+ forceHostsState(t, w.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie", "region:us"}})
code, _, out := w.post(t, false, fmt.Sprintf(`{"host":"acme.go.tito.io","region":%q}`, from))
if code != 201 {
t.Fatalf("legacy setup=%d %s", code, out)
@@ -619,7 +637,10 @@ func TestHAPoolTransfersRemainRegional(t *testing.T) {
// TestHAPoolUnprovenStorage: a box whose edges file cannot be read or parsed
// (the observer marks both malformed), or whose placement is not a valid
// region, could be on any bucket, so scoped HA creates fail closed (Opus
-// create-path review F1, F2). Plain creates are untouched.
+// create-path review F1, F2). The HA gate leaves a plain create alone: shown
+// here only on a console with no data bucket, since with one a plain create
+// out of the console's region meets the shared data-transfer rule (H3-M6),
+// which refuses it while this box's edges file does not read complete.
func TestHAPoolUnprovenStorage(t *testing.T) {
for _, mode := range []string{"malformed", "bad-placement"} {
t.Run(mode, func(t *testing.T) {
@@ -639,8 +660,16 @@ func TestHAPoolUnprovenStorage(t *testing.T) {
m := titoManifest()
m.Pool, m.Regions = "", nil
enableInstances(t, w.consoleFixture, "titogo", m)
- if code, _, out = w.post(t, false, `{"host":"plain.go.tito.io","region":"us"}`); code != 201 {
- t.Fatalf("plain create blocked=%d %s", code, out)
+ // The plain control runs with no data bucket, which the shared
+ // data-transfer rule (H3-M6) leaves to the box: an active history
+ // would refuse it here, since the unproven box's edges file does
+ // not read complete.
+ bucket := w.srv.cfg.HibernateBucket
+ w.srv.cfg.HibernateBucket = ""
+ code, _, out = w.post(t, false, `{"host":"plain.go.tito.io","region":"us"}`)
+ w.srv.cfg.HibernateBucket = bucket
+ if code != 201 {
+ t.Fatalf("plain create on a no-bucket console blocked by the HA gate=%d %s", code, out)
}
})
}
diff --git a/internal/console/hacreate_test.go b/internal/console/hacreate_test.go
index 831f83aad..0f89ea4b7 100644
--- a/internal/console/hacreate_test.go
+++ b/internal/console/hacreate_test.go
@@ -326,6 +326,9 @@ func TestHACreateAddressBackedSkipsHADataProof(t *testing.T) {
region := "ie"
if mode == "remote" {
region = "uk"
+ // Outside the console's region only an active hostname
+ // history proves the host free (H3-M6, createleftovers.go).
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:uk"}})
}
createCapacityEvidence(t, fx.srv, "allow", func(m map[string]any) { m["named_pools"] = []string{"tito"} }, region)
data := &haCreateStore{Store: fx.srv.cfg.SeedData, pageErr: errors.New("must not inspect HA prefix")}
diff --git a/internal/console/hapool_test.go b/internal/console/hapool_test.go
index f53679f80..e5e2ae513 100644
--- a/internal/console/hapool_test.go
+++ b/internal/console/hapool_test.go
@@ -116,6 +116,9 @@ func haPoolGateWorld(t *testing.T, region, pool string, tweak func(*Config)) *ha
w := haPoolWorldNew(t, region, pool, tweak)
list := w.srv.cfg.HAPoolAccounts
w.srv.cfg.HAPoolAccounts = []string{"bab"}
+ if pool == "" {
+ w.legacyAdmitted(t)
+ }
if code, _, out := w.post(t, false, fmt.Sprintf(`{"host":%q,"region":%q}`, haGateProbeHost, region)); code != http.StatusCreated {
t.Fatalf("fixture success control (instance) = %d %s", code, out)
}
diff --git a/internal/console/hunt_H3-M6_test.go b/internal/console/hunt_H3-M6_test.go
new file mode 100644
index 000000000..e6b6a7c2e
--- /dev/null
+++ b/internal/console/hunt_H3-M6_test.go
@@ -0,0 +1,36 @@
+package console
+
+import (
+ "net/http"
+ "testing"
+ "time"
+)
+
+// hunt H3-M6 (Opus verifier). titogo once ran acme.go.tito.io homed in ie
+// and its record was deleted; its replica stays at instances/acme.go.tito.io
+// in ie's data bucket. A second app, shopapp, whose instance domain is the
+// same go.tito.io (an operator-set domain; the member enable door pins every
+// app of an account to <sqid>.<AppsDomain>, which is just as shared within
+// the account), creates acme.go.tito.io homed in ie through a console whose
+// own region is uk. leftoverCheckApplies (createleftovers.go:43) skips every
+// record outside the console's region, so the create is not checked, and the
+// box's restorePlain (activator/backend_exec.go:829) restores from the
+// host-only prefix with no owner check. SECURE: refused (409).
+func TestHunt_H3_M6_CrossAppCreateOnALeftoverHostOutOfRegion(t *testing.T) {
+ fx := leftoverFixture(t, "code-hunt-m6")
+ if _, err := fx.st.CreateAppIn(OpsAccountID, "shopapp", "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ m := titoManifest()
+ m.App, m.Pool = "shopapp", ""
+ enableInstances(t, fx.consoleFixture, "shopapp", m)
+ fx.leaveReplica(t, "acme.go.tito.io") // titogo's, from the deleted record
+
+ fx.srv.cfg.Region = "uk"
+ status, _, out := rawReq(t, http.MethodPost, instancesURL(fx.consoleFixture, "bab", "shopapp"), fx.token,
+ `{"host":"acme.go.tito.io","region":"ie"}`)
+ if status != http.StatusConflict {
+ t.Fatalf("H3-M6: shopapp's create on titogo's leftover host = %d %s (replica clients opened: %d); want 409",
+ status, out, fx.opens.Load())
+ }
+}
diff --git a/internal/console/moveleftovers.go b/internal/console/moveleftovers.go
new file mode 100644
index 000000000..1999b6fbc
--- /dev/null
+++ b/internal/console/moveleftovers.go
@@ -0,0 +1,75 @@
+package console
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+// The move doors' use of the shared admission rule (datatransfer.go, hunt
+// H3-M6). A move lands an instance on the target region's copy of its
+// host's prefix. When the source has nothing to stage (an instance that
+// never woke), the legacy target's first wake promotes nothing and restores
+// the target's own prefix, which may hold a deleted record's replica,
+// whoever's it was (activator
+// TestH3M6MoveOfANeverWokenHostLandsOnTheTargetsLeftover). Every door that
+// starts a move asks the rule before its first write: the legacy request,
+// the Phase 1 request, and the offline start and stage
+// (offlineBeginChecks).
+//
+// A destination in sight gets the bucket check, as a create does: an
+// instance created out of sight before the rule existed was never checked
+// there. A move back to a region whose prefix still holds this instance's
+// own lineage from an earlier stay is refused with it, until an operator
+// removes that copy (the staged copy would have replaced it). Fleet and
+// pooled records never reach here (moveGate refuses both).
+
+// moveTransferRefusal is nil when a move of rec to the region code to may
+// start, else the shared rule's refusal, worded here whole for the moves
+// copy record (approved_moves_copy_test.go reads these sentences).
+//
+// An offline move already staged to this destination (start, restage)
+// finds its own pre-copy at moves/<host>/ in the target bucket
+// (internal/host movesoffline_stage.go). That one prefix is exempt only
+// for a move the stage door stamped after the rule passed with it empty
+// (MoveState.StageChecked). An unstamped staged move into this console's
+// sight was staged by an older console, maybe over a deleted record's
+// staging: it is refused, and staged again from scratch.
+func (s *Server) moveTransferRefusal(ctx context.Context, logTag string, rec *provision.Record, to string) *offlineRefusal {
+ if !rec.DataKind() {
+ return nil
+ }
+ host := rec.Host
+ mv, staged := offlineStaged(rec)
+ own := staged && mv.To == to
+ stamped := own && mv.StageChecked == provision.StageCheckedFor(to)
+ if own && !stamped && s.leftoverCheckApplies(to, rec.Pool) {
+ place := s.offlinePlace(to)
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s was staged for %s before this console checked %s for data left under it. Abort the move and stage it again.", host, place, place)}
+ }
+ o := s.dataTransferVerdict(ctx, dataTransfer{
+ logTag: logTag,
+ recs: []transferRec{{host, rec.Pool}},
+ to: to,
+ ownStaging: stamped,
+ })
+ p := o.place
+ switch o.verdict {
+ case transferAdmitted:
+ return nil
+ case transferHeld:
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s can't move to %s: %s already has data in %s. An operator has to look at it before this can go ahead.", host, p, host, p)}
+ case transferUnsure:
+ return &offlineRefusal{status: http.StatusServiceUnavailable, msg: fmt.Sprintf("%s can't move to %s: the data in %s could not be checked. Try again.", host, p, p)}
+ case transferUnchecked:
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s can't move to %s: this console can't check %s for data a deleted record left under %s. An operator can allow it by completing the hostname history (console hosts-used) with %s scanned.", host, p, p, host, p)}
+ case transferNeverChecked:
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s can't move to %s: this console can't check %s for data a deleted record left under %s, and its hostname history can't be completed while host claims or Phase 1 moves are on.", host, p, p, host)}
+ case transferUncovered:
+ return &offlineRefusal{status: http.StatusConflict, msg: fmt.Sprintf("%s can't move to %s: %s was not scanned when the hostname history was completed, or the boxes or data bucket there have changed since. An operator can allow it by completing the history again with %s scanned.", host, p, p, p)}
+ default:
+ return &offlineRefusal{status: http.StatusServiceUnavailable, msg: fmt.Sprintf("%s can't move to %s: the hostname history, or the boxes or data bucket in %s, could not be read. Try again.", host, p, p)}
+ }
+}
diff --git a/internal/console/moveleftovers_h3m6_test.go b/internal/console/moveleftovers_h3m6_test.go
new file mode 100644
index 000000000..6bc928ef2
--- /dev/null
+++ b/internal/console/moveleftovers_h3m6_test.go
@@ -0,0 +1,328 @@
+package console
+
+// Hunt H3-M6, the move route. An instance never woken and moved lands on
+// whatever a deleted record of the same host left at the destination: its
+// source has nothing to stage, so the target's first wake restores the
+// target's own prefix (activator
+// TestH3M6MoveOfANeverWokenHostLandsOnTheTargetsLeftover). Every move door
+// asks the shared data-transfer rule (datatransfer.go): out of sight, an
+// active history that examined the destination and still covers it; in
+// sight, the bucket check. The tests go through the production doors.
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ lsfile "github.com/benbjohnson/litestream/file"
+
+ "github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/dbdoor/dbdoortest"
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+func moveWhat(host, place string) string { return host + " can't move to " + place }
+
+// msgStagedUnchecked is moveTransferRefusal's refusal of a staged move with
+// no StageChecked stamp.
+func msgStagedUnchecked(host, place string) string {
+ return host + " was staged for " + place + " before this console checked " + place + " for data left under it. Abort the move and stage it again."
+}
+
+// moveFixture is leftoverFixture (a data bucket, this console in ie) with
+// titogo's acme created in ie, where the rail checked it clean.
+func moveFixture(t *testing.T, code string) (*leftoverFx, string) {
+ t.Helper()
+ fx := leftoverFixture(t, code)
+ u := instancesURL(fx.consoleFixture, "bab", "titogo")
+ m := titoManifest()
+ m.Regions, m.Pool = nil, ""
+ enableInstances(t, fx.consoleFixture, "titogo", m)
+ if c, _, out := rawReq(t, http.MethodPost, u, fx.token, `{"host":"acme.go.tito.io","region":"ie"}`); c != http.StatusCreated {
+ t.Fatalf("create = %d %s", c, out)
+ }
+ return fx, u + "/acme.go.tito.io/move"
+}
+
+func noMoveOnRecord(t *testing.T, fx *leftoverFx) {
+ t.Helper()
+ rec, err := provision.GetRecord(context.Background(), fx.rel, "bab", "titogo", "acme.go.tito.io")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if rec.Move != nil {
+ t.Fatalf("a refused move wrote %+v", rec.Move)
+ }
+}
+
+func activeHistory(t *testing.T, fx *leftoverFx) {
+ t.Helper()
+ forceHostsState(t, fx.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie", "region:uk"}})
+}
+
+const ukEdges = `{"v":1,"box":"uk-box","eip":"1.2.3.4","placement":"uk","data_bucket":"data-uk","data_bucket_region":"eu-west-2","hosts":{}}`
+
+func legacyMoveFixture(t *testing.T, code string) (*leftoverFx, string) {
+ t.Helper()
+ fx, moveURL := moveFixture(t, code)
+ if _, err := fx.rel.Put(context.Background(), "control/edges/uk-box.json", []byte(ukEdges), ""); err != nil {
+ t.Fatal(err)
+ }
+ return fx, moveURL
+}
+
+func TestH3M6LegacyMoveOutOfSightIsRefused(t *testing.T) {
+ fx, moveURL := legacyMoveFixture(t, "code-h3m6-move-legacy")
+ want := msgTransferUnchecked(moveWhat("acme.go.tito.io", "uk"), "uk", "acme.go.tito.io")
+ code, _, out := rawReq(t, http.MethodPost, moveURL, fx.token, `{"region":"uk"}`)
+ if code != http.StatusConflict || errorText(out) != want {
+ t.Fatalf("move to uk = %d %s, want 409 %q", code, out, want)
+ }
+ noMoveOnRecord(t, fx)
+ // Active, with uk examined and covered as it is now: admitted.
+ activeHistory(t, fx)
+ if code, _, out := rawReq(t, http.MethodPost, moveURL, fx.token, `{"region":"uk"}`); code != http.StatusAccepted {
+ t.Fatalf("move with the history active = %d %s, want 202", code, out)
+ }
+}
+
+// Active history is not enough by itself (round 2, Astra P1-2): a region
+// added after activation was never examined, and a region whose data
+// bucket changed since is not covered as recorded. Both are refused, with
+// nothing written.
+func TestH3M6ActiveHistoryMoveNeedsTheDestinationCovered(t *testing.T) {
+ for _, c := range []struct {
+ name string
+ st provision.HostsState
+ }{
+ {"region added after activation", provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie"},
+ RegionTargets: []string{"box:ie-box"}}},
+ {"bucket changed since", provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie", "region:uk"},
+ RegionTargets: []string{"box:uk-box", "bucket:data-uk-old"}}},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ fx, moveURL := legacyMoveFixture(t, "code-h3m6-move-cov-"+strings.ReplaceAll(c.name, " ", "-"))
+ forceHostsState(t, fx.srv, c.st)
+ want := msgTransferUncovered(moveWhat("acme.go.tito.io", "uk"), "uk")
+ code, _, out := rawReq(t, http.MethodPost, moveURL, fx.token, `{"region":"uk"}`)
+ if code != http.StatusConflict || errorText(out) != want {
+ t.Fatalf("move = %d %s, want 409 %q", code, out, want)
+ }
+ noMoveOnRecord(t, fx)
+ })
+ }
+}
+
+func TestH3M6Phase1MoveOutOfSightIsRefused(t *testing.T) {
+ fx, moveURL := moveFixture(t, "code-h3m6-move-p1")
+ if err := fx.st.SetOperator("alice@keymail.dev", true); err != nil {
+ t.Fatal(err)
+ }
+ enableMovesPhase1(fx.consoleFixture)
+ armMoveFleet(t, fx.consoleFixture, ieBox("ie-box"), ukBox("uk-box"))
+ claimFor(t, fx.consoleFixture, "acme.go.tito.io", "ie-box", "ie")
+ // Phase 1 is on, so the history can never be completed here.
+ want := msgTransferNeverChecked(moveWhat("acme.go.tito.io", "uk"), "uk", "acme.go.tito.io")
+ code, _, out := rawReq(t, http.MethodPost, moveURL, fx.token, `{"region":"uk"}`)
+ if code != http.StatusConflict || errorText(out) != want {
+ t.Fatalf("move to uk = %d %s, want 409 %q", code, out, want)
+ }
+ noMoveOnRecord(t, fx)
+ activeHistory(t, fx)
+ if code, _, out := rawReq(t, http.MethodPost, moveURL, fx.token, `{"region":"uk"}`); code != http.StatusAccepted {
+ t.Fatalf("move with the history active = %d %s, want 202", code, out)
+ }
+}
+
+// The offline doors, start and stage: refused out of sight with nothing
+// written, and admitted once the history is active and covers uk.
+func TestH3M6OfflineMoveOutOfSightIsRefused(t *testing.T) {
+ for _, path := range []string{"", "/stage"} {
+ t.Run("door"+path, func(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-ie", "ie"
+ w.refused(http.MethodPost, path, `{"region":"uk"}`, http.StatusConflict,
+ msgTransferUnchecked(moveWhat(offlineHost, "uk"), "uk", offlineHost))
+ forceHostsState(t, w.fx.srv, provision.HostsState{Mode: provision.HostsModeActive, Examined: []string{"region:ie", "region:uk"}})
+ if code, out := w.req(http.MethodPost, path, `{"region":"uk"}`); code != http.StatusAccepted {
+ t.Fatalf("POST %s with the history active = %d %s, want 202", path, code, out)
+ }
+ })
+ }
+}
+
+// fileReplicas points srv's replica reader at a directory, as
+// leftoverFixture does, and returns it.
+func fileReplicas(t *testing.T, srv *Server) string {
+ t.Helper()
+ root := t.TempDir()
+ srv.cfg.HibernatePrefix = "instances"
+ srv.dbReplica = rootReplica(func(_ context.Context, prefix string) (replicaReader, error) {
+ return lsfile.NewReplicaClient(filepath.Join(root, prefix)), nil
+ })
+ return root
+}
+
+// A move into this console's own region gets the bucket check a create
+// gets: a clean prefix admits it, a deleted record's replica refuses it.
+func TestH3M6MoveIntoTheConsolesRegionIsChecked(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-uk", "uk"
+ root := fileReplicas(t, w.fx.srv)
+ dbdoortest.Replicate(t, filepath.Join(root, activator.HibernatePrefix("instances", offlineHost)), 1)
+ w.refused(http.MethodPost, "", `{"region":"uk"}`, http.StatusConflict,
+ msgTransferHeld(moveWhat(offlineHost, "uk"), offlineHost, "uk"))
+
+ clean := newOfflineWorld(t, oneEach...)
+ clean.fx.srv.cfg.HibernateBucket, clean.fx.srv.cfg.Region = "data-uk", "uk"
+ fileReplicas(t, clean.fx.srv)
+ clean.start()
+}
+
+// Which destinations are out of the rail's sight.
+func TestMoveOutOfSight(t *testing.T) {
+ s := &Server{}
+ for _, c := range []struct {
+ to, console, bucket string
+ want bool
+ }{
+ {"uk", "ie", "data-test", true},
+ {"", "ie", "data-test", true},
+ {"ie", "ie", "data-test", false},
+ {"", "", "data-test", false},
+ {"uk", "", "data-test", true},
+ {"uk", "ie", "", false},
+ } {
+ s.cfg.Region, s.cfg.HibernateBucket = c.console, c.bucket
+ if got := s.leftoverOutOfSight(c.to, ""); got != c.want {
+ t.Errorf("move to %q on console %q (bucket %q) = %v, want %v", c.to, c.console, c.bucket, got, c.want)
+ }
+ }
+}
+
+// leaveStaged writes LTX files where an offline stager pre-copies the
+// host's replica: moves/<host>/ in the target's (here, this console's)
+// bucket.
+func leaveStaged(t *testing.T, root, host string) {
+ t.Helper()
+ dbdoortest.Replicate(t, filepath.Join(root, strings.TrimSuffix(activator.MovesPrefix(host), "/")), 1)
+}
+
+// Round 3 (Astra P1-1, Fable P1): an offline move staged into this
+// console's region finds its own pre-copy at moves/<host>/. Restage and
+// start for that same staged move are admitted: only that move's own
+// staging prefix is exempt, and a deleted record's replica at
+// instances/<host> still refuses.
+func TestH3M6StagedMoveIntoTheConsolesRegionIsNotItsOwnLeftover(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-uk", "uk"
+ root := fileReplicas(t, w.fx.srv)
+ w.ok("/stage", `{"region":"uk"}`, provision.OfflineStaging)
+ leaveStaged(t, root, offlineHost) // the stager's first round
+ w.ok("/stage", `{"region":"uk"}`, provision.OfflineStaging)
+ w.ok("", `{"region":"uk"}`, provision.OfflineStopping)
+}
+
+func TestH3M6StagedMoveStillRefusesAReplicaLeftover(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-uk", "uk"
+ root := fileReplicas(t, w.fx.srv)
+ w.ok("/stage", `{"region":"uk"}`, provision.OfflineStaging)
+ leaveStaged(t, root, offlineHost)
+ dbdoortest.Replicate(t, filepath.Join(root, activator.HibernatePrefix("instances", offlineHost)), 1)
+ w.refused(http.MethodPost, "", `{"region":"uk"}`, http.StatusConflict,
+ msgTransferHeld(moveWhat(offlineHost, "uk"), offlineHost, "uk"))
+}
+
+// Staging with no matching staged move on the record (an abandoned move's
+// copy) is not exempt.
+func TestH3M6StagingWithoutAStagedMoveRefuses(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-uk", "uk"
+ root := fileReplicas(t, w.fx.srv)
+ leaveStaged(t, root, offlineHost)
+ for _, path := range []string{"", "/stage"} {
+ w.refused(http.MethodPost, path, `{"region":"uk"}`, http.StatusConflict,
+ msgTransferHeld(moveWhat(offlineHost, "uk"), offlineHost, "uk"))
+ }
+}
+
+// A staged move with no StageChecked stamp (staged by a console from before
+// the rule) may sit on a deleted record's staging: its restage and start
+// are refused with the abort-and-stage-again sentence, nothing written. A
+// fresh stage carries the stamp (TestH3M6StagedMoveIntoTheConsolesRegionIsNotItsOwnLeftover).
+func TestH3M6UnstampedStagedMoveIsRefused(t *testing.T) {
+ w := newOfflineWorld(t, oneEach...)
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-uk", "uk"
+ root := fileReplicas(t, w.fx.srv)
+ w.ok("/stage", `{"region":"uk"}`, provision.OfflineStaging)
+ if got := w.record().Move.StageChecked; got != provision.StageCheckedFor("uk") {
+ t.Fatalf("a fresh stage stamped %q, want %q", got, provision.StageCheckedFor("uk"))
+ }
+ w.edit(func(rec *provision.Record) error { rec.Move.StageChecked = ""; return nil })
+ leaveStaged(t, root, offlineHost) // the older stage's copy, or a deleted record's
+ for _, path := range []string{"", "/stage"} {
+ w.refused(http.MethodPost, path, `{"region":"uk"}`, http.StatusConflict, msgStagedUnchecked(offlineHost, "uk"))
+ }
+}
+
+// homeStageWorld is the flagship's shape (TestOfflineHomeRegion's): the
+// console is the home, named ie, with a data bucket it reads, and the
+// instance is in uk; the move goes into home, the record's "".
+func homeStageWorld(t *testing.T) (*offlineWorld, string) {
+ t.Helper()
+ w := newOfflineWorldIn(t, "ie", "uk", offlineBox{Box: "home-box", Bucket: "data-ie"}, ukOff("uk-box"))
+ w.fx.srv.cfg.HibernateBucket, w.fx.srv.cfg.Region = "data-ie", ""
+ return w, fileReplicas(t, w.fx.srv)
+}
+
+// treeState is every file under root with its size, for "storage unchanged".
+func treeState(t *testing.T, root string) string {
+ t.Helper()
+ var b strings.Builder
+ if err := filepath.WalkDir(root, func(p string, d os.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if fi, err := d.Info(); err == nil && !d.IsDir() {
+ fmt.Fprintf(&b, "%s %d\n", p, fi.Size())
+ }
+ return nil
+ }); err != nil {
+ t.Fatal(err)
+ }
+ return b.String()
+}
+
+// The home region is "" on the record, and so was an absent stamp when the
+// stamp was the bare destination (Astra census round 2): an unstamped
+// staged move into home over leftover staging is refused with the bucket
+// unchanged. A fresh home stage carries a non-empty stamp.
+func TestH3M6UnstampedStagedMoveIntoHomeIsRefused(t *testing.T) {
+ w, root := homeStageWorld(t)
+ w.ok("/stage", `{"region":"ie"}`, provision.OfflineStaging)
+ if got := w.record().Move.StageChecked; got == "" || got != provision.StageCheckedFor("") {
+ t.Fatalf("a fresh home stage stamped %q, want %q", got, provision.StageCheckedFor(""))
+ }
+ w.edit(func(rec *provision.Record) error { rec.Move.StageChecked = ""; return nil })
+ leaveStaged(t, root, offlineHost)
+ before := treeState(t, root)
+ for _, path := range []string{"", "/stage"} {
+ w.refused(http.MethodPost, path, `{"region":"ie"}`, http.StatusConflict, msgStagedUnchecked(offlineHost, w.fx.srv.offlinePlace("")))
+ }
+ if treeState(t, root) != before {
+ t.Fatal("a refused start or restage changed the data bucket")
+ }
+}
+
+func TestH3M6FreshHomeStageStagesRestagesAndStarts(t *testing.T) {
+ w, root := homeStageWorld(t)
+ w.ok("/stage", `{"region":"ie"}`, provision.OfflineStaging)
+ leaveStaged(t, root, offlineHost)
+ w.ok("/stage", `{"region":"ie"}`, provision.OfflineStaging)
+ w.ok("", `{"region":"ie"}`, provision.OfflineStopping)
+}
diff --git a/internal/console/placeleftovers_h3m6_test.go b/internal/console/placeleftovers_h3m6_test.go
new file mode 100644
index 000000000..9d2e4d85a
--- /dev/null
+++ b/internal/console/placeleftovers_h3m6_test.go
@@ -0,0 +1,126 @@
+package console
+
+// Hunt H3-M6, the place route (round 2, Astra P1-1 and Fable P1): `carlos
+// apps place` re-homes every existing record of an app onto the target's
+// storage. Onto a fleet, the fleet box's first wake restores the fleet
+// bucket's prefix for the host; back home, the home bucket's. Both
+// directions ask the shared data-transfer rule before any write.
+
+import (
+ "context"
+ "net/http"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+func placeWhat(app, place string) string { return app + "'s instances can't move to " + place }
+
+// placeFixture is leftoverFixture on a home console (region ""), with
+// fleet eleven, and the owner's token (place is owner-only).
+func h3m6PlaceFixture(t *testing.T, code string) (*leftoverFx, string) {
+ t.Helper()
+ fx := leftoverFixture(t, code)
+ fx.srv.cfg.Region = ""
+ m := titoManifest()
+ m.Regions, m.Pool = nil, ""
+ enableInstances(t, fx.consoleFixture, "titogo", m)
+ if status, body := postJSON(t, fx.ts.URL+"/api/cli/fleets/bab/new",
+ map[string]string{"name": "eleven", "bucket": "eleven-fleet-data"}, fx.token); status != http.StatusOK {
+ t.Fatalf("create fleet = %d %v", status, body)
+ }
+ return fx, cliToken(t, fx.consoleFixture, "paul@keymail.dev", code+"-owner")
+}
+
+func h3m6Place(t *testing.T, fx *leftoverFx, owner, target string) (int, map[string]any) {
+ t.Helper()
+ return postJSON(t, fx.ts.URL+"/api/cli/apps/bab/titogo/place", map[string]string{"target": target}, owner)
+}
+
+func acmeRegion(t *testing.T, fx *leftoverFx) string {
+ t.Helper()
+ rec, err := provision.GetRecord(context.Background(), fx.rel, "bab", "titogo", "acme.go.tito.io")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return rec.Region
+}
+
+func createAcme(t *testing.T, fx *leftoverFx) {
+ t.Helper()
+ if c, _, out := rawReq(t, http.MethodPost, instancesURL(fx.consoleFixture, "bab", "titogo"), fx.token,
+ `{"host":"acme.go.tito.io"}`); c != http.StatusCreated {
+ t.Fatalf("create = %d %s", c, out)
+ }
+}
+
+// Onto a fleet: the fleet's bucket is out of sight, so with the history
+// not active the place is refused before any write, the app's placement
+// and the record's region left as they were.
+func TestH3M6PlaceOntoAFleetIsRefused(t *testing.T) {
+ fx, owner := h3m6PlaceFixture(t, "code-h3m6-place-fleet")
+ createAcme(t, fx) // home, in sight, checked clean
+ status, body := h3m6Place(t, fx, owner, "fleet/eleven")
+ want := msgPlaceUnchecked("titogo", "fleet eleven", "acme.go.tito.io")
+ if status != http.StatusConflict || body["error"] != want {
+ t.Fatalf("place = %d %v, want 409 %q", status, body, want)
+ }
+ if r := acmeRegion(t, fx); r != "" {
+ t.Fatalf("a refused place re-homed the record to %q", r)
+ }
+ if p, _, err := fx.st.appPlacementRow(context.Background(), OpsAccountID, "titogo"); err != nil || p != "" {
+ t.Fatalf("a refused place wrote the placement %q (%v)", p, err)
+ }
+}
+
+// Back home: the home bucket is in sight, so a deleted record's replica
+// under the host refuses the unplace, and a clean one admits it.
+func TestH3M6UnplaceBackHomeIsChecked(t *testing.T) {
+ fx, owner := h3m6PlaceFixture(t, "code-h3m6-place-home")
+ // Put acme on the fleet the way a console with no data bucket would,
+ // which checks nothing (the box owner binding's case).
+ bucket := fx.srv.cfg.HibernateBucket
+ fx.srv.cfg.HibernateBucket = ""
+ createAcme(t, fx)
+ if status, body := h3m6Place(t, fx, owner, "fleet/eleven"); status != http.StatusOK {
+ t.Fatalf("place with no data bucket = %d %v", status, body)
+ }
+ fx.srv.cfg.HibernateBucket = bucket
+ if r := acmeRegion(t, fx); r != "fleet/eleven" {
+ t.Fatalf("record region = %q", r)
+ }
+ fx.leaveReplica(t, "acme.go.tito.io") // another record's, deleted
+ status, body := h3m6Place(t, fx, owner, "")
+ want := msgTransferHeld(placeWhat("titogo", "the home region"), "acme.go.tito.io", "the home region")
+ if status != http.StatusConflict || body["error"] != want {
+ t.Fatalf("unplace = %d %v, want 409 %q", status, body, want)
+ }
+ if r := acmeRegion(t, fx); r != "fleet/eleven" {
+ t.Fatalf("a refused unplace re-homed the record to %q", r)
+ }
+}
+
+func TestH3M6UnplaceOntoACleanHomeIsAdmitted(t *testing.T) {
+ fx, owner := h3m6PlaceFixture(t, "code-h3m6-place-clean")
+ bucket := fx.srv.cfg.HibernateBucket
+ fx.srv.cfg.HibernateBucket = ""
+ createAcme(t, fx)
+ if status, body := h3m6Place(t, fx, owner, "fleet/eleven"); status != http.StatusOK {
+ t.Fatalf("place = %d %v", status, body)
+ }
+ fx.srv.cfg.HibernateBucket = bucket
+ if status, body := h3m6Place(t, fx, owner, ""); status != http.StatusOK {
+ t.Fatalf("unplace onto a clean home = %d %v, want 200", status, body)
+ }
+ if r := acmeRegion(t, fx); r != "" {
+ t.Fatalf("record region = %q, want home", r)
+ }
+}
+
+// An app with no data-kind record places as before.
+func TestH3M6PlaceWithNoDataRecordIsAdmitted(t *testing.T) {
+ fx, owner := h3m6PlaceFixture(t, "code-h3m6-place-empty")
+ if status, body := h3m6Place(t, fx, owner, "fleet/eleven"); status != http.StatusOK {
+ t.Fatalf("place = %d %v, want 200", status, body)
+ }
+}
diff --git a/internal/provision/h3m6_leftover_census_test.go b/internal/provision/h3m6_leftover_census_test.go
new file mode 100644
index 000000000..0afe5b6ee
--- /dev/null
+++ b/internal/provision/h3m6_leftover_census_test.go
@@ -0,0 +1,35 @@
+package provision
+
+// Hunt H3-M6 rounds 2 and 3 re-pin two console writers on the existing
+// chain. Classes and key sites stay unchanged. Both now ask the shared
+// data-transfer rule (dataTransferRefusal: a bucket read in sight, the held
+// hostname-history state and the edges or fleet roster out of sight)
+// before any write, and can only refuse earlier:
+// - handleAPIInstanceMoveRequest (Phase 1 branch), via moveTransferRefusal,
+// right after the "already in" refusal and before any policy read,
+// claim CAS or SetRecordMove;
+// - placeAppTarget, for the app's changed data-kind records (with its own
+// out-of-sight sentence, msgPlaceUnchecked), after the
+// sealed-values check and before the claim placement start, the
+// placement column write and every SetRecordRegion.
+func h3m6LeftoverWriteCensusInventory() []censusEntry {
+ entries := append([]censusEntry(nil), secH3M2ScopedKeyWriteCensusInventory()...)
+ for _, r := range []censusEntry{
+ {"internal/console/apiinstancemove.go", "Server.handleAPIInstanceMoveRequest", "record-writer", "key:SetRecordMove,lit:instances", "e5bfd15a685799b31cb36b9f1c4692a383bb79add3c051dfcddd117602f65720"},
+ {"internal/console/fleets.go", "Server.placeAppTarget", "record-writer", "key:RecordsPrefix,key:SetRecordRegion", "1ea3d4cd38bbb58a30828f0e122cdd76783c4eebb04a15cf6138b232a2370eb0"},
+ } {
+ found := false
+ for i, e := range entries {
+ if e.File == r.File && e.Unit == r.Unit {
+ if e.Class != r.Class || e.Kinds != r.Kinds {
+ panic("h3-m6 re-pin changes class or kinds: " + r.File + ":" + r.Unit)
+ }
+ entries[i], found = r, true
+ }
+ }
+ if !found {
+ panic("h3-m6 re-pin of an unlisted unit: " + r.File + ":" + r.Unit)
+ }
+ }
+ return entries
+}
diff --git a/internal/provision/offline_move.go b/internal/provision/offline_move.go
index 9176e8f99..3bebfee79 100644
--- a/internal/provision/offline_move.go
+++ b/internal/provision/offline_move.go
@@ -157,7 +157,17 @@ func OfflineStart(id, from, to, by string, now time.Time) func(*Record) error {
// StageTarget is what a stage fixes for the whole move: the one box that
// copies (Stager) and where the copy goes (Bucket, the target's data
// bucket, in Region).
-type StageTarget struct{ Stager, Bucket, Region string }
+type StageTarget struct {
+ Stager, Bucket, Region string
+ // Checked is MoveState.StageChecked: StageCheckedFor the destination
+ // the stage door's shared data-transfer rule passed for, or "".
+ Checked string
+}
+
+// StageCheckedFor is the StageChecked token for the destination to (a
+// record Region, "" for home): never "", so the absent field (an older
+// console's staged move) matches no destination, home included.
+func StageCheckedFor(to string) string { return "checked:" + to }
// OfflineStage is OfflineStart into offline-staging: the same refusals and
// the same stamps, plus staged_at, the stager and the staging destination
@@ -173,6 +183,7 @@ func OfflineStage(id, from, to, by string, st StageTarget, now time.Time) func(*
return err
}
rec.Move.Stager, rec.Move.StageBucket, rec.Move.StageRegion = st.Stager, st.Bucket, st.Region
+ rec.Move.StageChecked = st.Checked
return nil
}
}
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go
index d039c9ede..61258b885 100644
--- a/internal/provision/plan9_b8_census_test.go
+++ b/internal/provision/plan9_b8_census_test.go
@@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) {
if len(got) < 100 {
t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root)
}
- inventory := secH3M2ScopedKeyWriteCensusInventory()
+ inventory := h3m6LeftoverWriteCensusInventory()
problems := append(censusDiff(inventory, got), censusPolicy(inventory)...)
if len(problems) > 0 {
t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n "))
diff --git a/internal/provision/provision.go b/internal/provision/provision.go
index 2a5998dba..a48ce1a18 100644
--- a/internal/provision/provision.go
+++ b/internal/provision/provision.go
@@ -1349,6 +1349,16 @@ type MoveState struct {
// Additive and omitempty.
StageBucket string `json:"stage_bucket,omitempty"`
StageRegion string `json:"stage_region,omitempty"`
+ // StageChecked is StageCheckedFor(the destination) for which the stage
+ // door's shared data-transfer rule (console datatransfer.go, hunt
+ // H3-M6) passed before this move was written: in this console's sight,
+ // with the destination's moves/<host>/ prefix empty. Only a staged move
+ // carrying it for its own destination may count that prefix as its own
+ // pre-copy at restage and start; one staged by an older console may sit
+ // on a deleted record's staging. The token is never "", the home region
+ // included, so a move without the field never matches. Additive and
+ // omitempty.
+ StageChecked string `json:"stage_checked,omitempty"`
// Seq is the record's move_seq as the transition that produced this
// state left it (self-serve moves plan 1 Task 7, offline_move.go): the
// hold's for a held row, open's for the target, the abort's for the
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 2de54575e..7df6c4391 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -320,3 +320,4 @@ plan14-root-reads-infra-floor-keys-deny.tsv 3d13ade9d1fce3bc1a7d7250d75f2cc5ea35
plan14-root-reads-sec-h3-m3-envelope.tsv 76f69ece310924c374511605d0f6c718464d6374292961ca6a53955ec36f6e21
plan14-root-reads-sec-h3-m2-scoped-key.tsv 4f307fb962a2aac71640ebc18058c02a29d6c7175b93ff1461317e37b94fca4b
plan14-root-reads-sec-h4-m11-stepup-fold.tsv 13d05e2a4038ca4978d27a38be07e96025ee6f00f39519c41a3000e2dda3b387
+plan14-root-reads-sec-h3-m6-leftover-host.tsv 8e42c8ece77bba4ec895af4d7cae0aa80aec06885b7614cc1c5c572f9ef9ebc4
diff --git a/internal/provision/testdata/plan14-root-reads-sec-h3-m6-leftover-host.tsv b/internal/provision/testdata/plan14-root-reads-sec-h3-m6-leftover-host.tsv
new file mode 100644
index 000000000..70c836188
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-sec-h3-m6-leftover-host.tsv
@@ -0,0 +1,11 @@
+# Census overlay sec-h3-m6-leftover-host, written by census-propose (#369). census-ruling-sec-h3-m6-leftover-host, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-sec-h3-m6-leftover-host.md.
+# 1 body, 1 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy b7af9ebc4afa2bca5ee77ac9f704e82bba67649fbe1a685b70c99dc2e09c5b2b internal/activator/seedplace.go ExecBackend.placeSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields.;rev3=census-ruling-sec-h3-m6-leftover-host;basis=H3-M6 round 3 (Fable P3): the cleanup after a failed post-rename identity check removes the database before its marker (was marker first), so a crash between the two leaves a marker alone, which the next wake purges and re-places, never an unmarked database the new unattributed-data refusal would keep refusing. Same two instancefs.RemoveAllBeneath calls under the instance directory; no new read, path or authority. Agent, not root. registry:Host@127,whole:Route@334 30ad935426ccb292f04d9cc7fb4624391a8d4319db77898962dfa734f12aad05
+@legacy 24d42c5aaa9513627fea5630d8c41c4662467afa67cb94bbaf7bee2a0e33b75b internal/activator/seedplace.go unattributedLocalData legacy accepted-legacy accepted-legacy;rev3=census-ruling-sec-h3-m6-leftover-host;basis=New helper (H3-M6 round 2): os.Lstat of five fixed names under the row's instance directory (dir, base from pathsFor(rt).dbPath); never opens, reads or follows anything; returns the first non-symlink entry's name, or an error, which refuses the wake. Agent, not root. file:Lstat@202 98cc77399380f84a2df63ce21bb68abbdb3aec99b01302d35ceee4d3baa09c32
+@legacy 907385b370eab8ea4bfeb7bf7de6854aff804da011dc17e2dad8a1c1b5d7e309 internal/activator/seedplace.go ExecBackend.seededRestore legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.;rev3=census-ruling-fleet-seeded-create-2;basis=Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, accepts it as this seed's only when this seed's own placement is still at the row's path: the marker naming this seed together with the database, both read through seedPlacedAt (instancefs, no symlink followed). A marker alone, another seed's, or either unreadable refuses (copy-exists) and nothing is restored. That probe runs under the start rule, after settleSeedObligation and reconcileAssignment (a labelled row's copy not kept under its assignment is set aside first), and the kept copy then passes startAllowed in the restore; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x4) are rt passed on: to placeSeed, to reportSeedFailure, and to the two start-rule calls before the own-placement probe (settleSeedObligation, reconcileAssignment), both of which it already made further down for every seed. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant.;rev3=census-ruling-sec-h3-m6-leftover-host;basis=H3-M6 round 2: on an unlabelled row with no own replica, after the placed check and before the purge, asks unattributedLocalData (Lstat of the database, WAL, SHM and both litestream meta dirs at the row's path, beside instancefs; symlinks are not data and are not followed) and refuses the wake (seedOverUnattributedData) when any is present, instead of purging it. +registry:Assigned is the new rt.Assigned == "" guard. Round 3 changed only the refusal's sentence. The agent as carlos, not root; it refuses more and deletes less; every path comes from the registry row. Copy pass (Luna, 2026-11-30, Paul's delegation) reworded that sentence again; the code is unchanged. registry:Assigned@7187,registry:Assigned@7758,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4830,whole:Route@4923,whole:Route@5218,whole:Route@5807,whole:Route@6090,whole:Route@6435,whole:Route@8304,whole:Route@8798,whole:Route@8957 dd36b56ff577046ed4b63f1eb06be6a13e690be05830e2fcd27feede7a401111
+internal/activator/seedplace.go ExecBackend.placeSeed legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-seeded-create-2;basis=Takes the route rather than the host, to name the fetch temp (seedTempName(base, id), which now carries the database's name so a purge for one flat instance cannot remove another's fetch) and to pass rt.Account, rt.App to the reader. The same fetch, check and rename; the reads are the host and route fields.;rev3=census-ruling-sec-h3-m6-leftover-host;basis=H3-M6 round 3 (Fable P3): the cleanup after a failed post-rename identity check removes the database before its marker (was marker first), so a crash between the two leaves a marker alone, which the next wake purges and re-places, never an unmarked database the new unattributed-data refusal would keep refusing. Same two instancefs.RemoveAllBeneath calls under the instance directory; no new read, path or authority. Agent, not root. registry:Host@127,whole:Route@334 30ad935426ccb292f04d9cc7fb4624391a8d4319db77898962dfa734f12aad05
+internal/activator/seedplace.go unattributedLocalData legacy accepted-legacy accepted-legacy;rev3=census-ruling-sec-h3-m6-leftover-host;basis=New helper (H3-M6 round 2): os.Lstat of five fixed names under the row's instance directory (dir, base from pathsFor(rt).dbPath); never opens, reads or follows anything; returns the first non-symlink entry's name, or an error, which refuses the wake. Agent, not root. file:Lstat@202 98cc77399380f84a2df63ce21bb68abbdb3aec99b01302d35ceee4d3baa09c32
+internal/activator/seedplace.go ExecBackend.seededRestore legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the seed fallback on the plain restore path: the host's own replica if it has one, else the file an earlier wake placed, else the snapshot; never reports fresh; every file through instancefs; fetches no snapshot under the claim flag;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 3, start rule): reconcileAssignment after settleSeedObligation; startAllowed before keeping a placed seed and before placing one; on a labelled row (rt.Assigned set) a local copy still at the path is set aside (localCopyNames, supersede) before the placement's purge; establishAssignment after placement. +registry:Assigned and +whole:Route are these calls. Unlabelled rows unchanged. Agent, not root; it refuses more and deletes less.;rev3=census-ruling-agent-start-demo-3;basis=Refuse unfinished claim seeds and check the current operation-bound destination record under its lease before wake. Census read-site delta: +whole:Route.;rev3=census-ruling-fleet-seeded-create-2;basis=Fleet file seeds: (1) refuses a flat layout for every seed (paths.layout != LayoutNested, nested only); (2) on a fleet file seed not yet placed lists moves/<host>/ through b.Mirror.List (fleetSeedStagingRefusal) before the replica question, and refuses if anything is staged or the listing fails; (3) when the host has a replica, accepts it as this seed's only when this seed's own placement is still at the row's path: the marker naming this seed together with the database, both read through seedPlacedAt (instancefs, no symlink followed). A marker alone, another seed's, or either unreadable refuses (copy-exists) and nothing is restored. That probe runs under the start rule, after settleSeedObligation and reconcileAssignment (a labelled row's copy not kept under its assignment is set aside first), and the kept copy then passes startAllowed in the restore; (4) restores with staging promotion off; (5) reports a coded failure through reportSeedFailure; (6) purges via purgeSeedTarget's held-descriptor PurgeProven. The route reads (+whole:Route x4) are rt passed on: to placeSeed, to reportSeedFailure, and to the two start-rule calls before the own-placement probe (settleSeedObligation, reconcileAssignment), both of which it already made further down for every seed. The agent as carlos, not root; every path it names comes from the registry row, not from a tenant.;rev3=census-ruling-sec-h3-m6-leftover-host;basis=H3-M6 round 2: on an unlabelled row with no own replica, after the placed check and before the purge, asks unattributedLocalData (Lstat of the database, WAL, SHM and both litestream meta dirs at the row's path, beside instancefs; symlinks are not data and are not followed) and refuses the wake (seedOverUnattributedData) when any is present, instead of purging it. +registry:Assigned is the new rt.Assigned == "" guard. Round 3 changed only the refusal's sentence. The agent as carlos, not root; it refuses more and deletes less; every path comes from the registry row. Copy pass (Luna, 2026-11-30, Paul's delegation) reworded that sentence again; the code is unchanged. registry:Assigned@7187,registry:Assigned@7758,registry:Host@121,whole:Route@1105,whole:Route@1868,whole:Route@2056,whole:Route@2826,whole:Route@342,whole:Route@4830,whole:Route@4923,whole:Route@5218,whole:Route@5807,whole:Route@6090,whole:Route@6435,whole:Route@8304,whole:Route@8798,whole:Route@8957 dd36b56ff577046ed4b63f1eb06be6a13e690be05830e2fcd27feede7a401111
+@coverage internal/activator 1bd8b945dc50c440346d7325415996c63c2478d0c73f7b1c3dea167adb713e62
+@coverage internal/provision 3d0ae235809a22ace53dcc80f97d94409accdebdef28484048f26821232f6a1b