carlos / platform Public

appconfig: seal every secret v2; refuse a copied v1 envelope (H3-M3)

A v1 secret envelope opens under any account's config, and every
deployment still wrote v1, so a bucket reader could copy another
tenant's secret into their own app and have a box decrypt it there.

Seal now always writes v2 (account and app as GCM associated data);
the console names the account for every app, so the CLI and the
settings page seal v2, and CONSOLE_SECRETS_ENVELOPE_V2 is retired.
The config store accepts a v1 envelope only as the value already in
that slot, so a copy is refused at every door (sealed-old) while
stored v1 secrets keep rendering for their own app. The v1 sunset
(re-seal sweep, then a box-side floor) is in
docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 578c69136440b953ab9649b78a3a5635d9c012fc parent 4799995
30 files changed, +612 −217
  • .amadan/code-health.tsv +0 −1
  • appconfig_cli.go +6 −22
  • appconfig_cli_fleet_test.go +1 −2
  • cmd/console/main.go +10 −18
  • docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md +79 −0
  • docs/superpowers/notes/census-proposal-sec-h3-m3-envelope.md +11 −0
  • internal/appconfig/crypto.go +56 −45
  • internal/appconfig/crypto_bind_test.go +13 −24
  • internal/appconfig/hunt_H3-M3_test.go +141 −0
  • internal/appconfig/owned.go +3 −0
  • internal/appconfig/owned_test.go +13 −4
  • internal/appconfig/sealer_test.go +2 −6
  • internal/appconfig/store.go +40 −0
  • internal/appconfig/unboundsets_test.go +95 −0
  • internal/console/apiconfig.go +6 −8
  • internal/console/apiconfig_test.go +6 −18
  • internal/console/configwrite.go +13 −2
  • internal/console/envform_test.go +5 −20
  • internal/console/envsave_test.go +0 −2
  • internal/console/fleetsecrets_mint_test.go +2 −5
  • internal/console/fleetsecrets_relay_test.go +0 −4
  • internal/console/hunt_h3m3_test.go +78 −0
  • internal/console/sealkey.go +2 −2
  • internal/console/sealkey_test.go +19 −28
  • internal/host/replicahomekeys_test.go +1 −1
  • internal/mail/sealer_helper_test.go +1 −1
  • internal/moves/archive/seal.go +2 −3
  • internal/objstore/walk_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-sec-h3-m3-envelope.tsv +5 −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-4dnJzE
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
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 golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading golang.org/x/text v0.43.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading 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/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== launchctx (4 s, from +0 s)
ok  	amadan.net/carlos/platform.git/launchctx	0.015s
?   	amadan.net/carlos/platform.git/launchctx/controlname	[no test files]
?   	amadan.net/carlos/platform.git/launchctx/wireid	[no test files]
=== vet (173 s, from +0 s)
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
=== vet-tags (175 s, from +0 s)
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pierrec/lz4/v4 v4.1.22
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 modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (380 s, from +15 s)
ok  	github.com/carlosframework/platform/cmd/carlos-media	123.809s
?   	github.com/carlosframework/platform/cmd/changelog	[no test files]
ok  	github.com/carlosframework/platform/cmd/console	203.546s
ok  	github.com/carlosframework/platform/cmd/mediaimage	40.770s
ok  	github.com/carlosframework/platform/cmd/moveprobe	16.389s
ok  	github.com/carlosframework/platform/cmd/pricebook-export	0.034s
ok  	github.com/carlosframework/platform/cmd/rootfswitness	0.199s
ok  	github.com/carlosframework/platform/cmd/runsc-assets	0.182s
ok  	github.com/carlosframework/platform/cmd/zddprobe	1.111s
ok  	github.com/carlosframework/platform/internal/agentsock	0.068s
ok  	github.com/carlosframework/platform/internal/alerting	0.041s
ok  	github.com/carlosframework/platform/internal/analytics	0.342s
ok  	github.com/carlosframework/platform/internal/appconfig	42.330s
ok  	github.com/carlosframework/platform/internal/apperr	0.329s
ok  	github.com/carlosframework/platform/internal/applog	4.636s
ok  	github.com/carlosframework/platform/internal/apppolicy	3.534s
ok  	github.com/carlosframework/platform/internal/assetcache	0.545s
ok  	github.com/carlosframework/platform/internal/awsinv	0.029s
ok  	github.com/carlosframework/platform/internal/awsmanaged	11.134s
ok  	github.com/carlosframework/platform/internal/awsregiongroup	0.081s
ok  	github.com/carlosframework/platform/internal/awsterminations	0.024s
ok  	github.com/carlosframework/platform/internal/backupswords	0.021s
ok  	github.com/carlosframework/platform/internal/billing	0.073s
ok  	github.com/carlosframework/platform/internal/billing/billingtest	0.047s
ok  	github.com/carlosframework/platform/internal/billingstripe	2.447s
ok  	github.com/carlosframework/platform/internal/boxchoice	0.027s
ok  	github.com/carlosframework/platform/internal/boxid	3.332s
?   	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.019s
ok  	github.com/carlosframework/platform/internal/boxself	0.237s
ok  	github.com/carlosframework/platform/internal/boxvolumes	0.131s
ok  	github.com/carlosframework/platform/internal/caps	5.380s
ok  	github.com/carlosframework/platform/internal/certwarm	0.038s
ok  	github.com/carlosframework/platform/internal/cgroup	1.526s
ok  	github.com/carlosframework/platform/internal/changelog	4.573s
ok  	github.com/carlosframework/platform/internal/clamd	0.064s
?   	github.com/carlosframework/platform/internal/cliflag	[no test files]
ok  	github.com/carlosframework/platform/internal/clireg	0.007s
ok  	github.com/carlosframework/platform/internal/codehealth	16.094s
ok  	github.com/carlosframework/platform/internal/compute	0.007s
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.086s
ok  	github.com/carlosframework/platform/internal/dbdoor/dbdoortest	0.041s
ok  	github.com/carlosframework/platform/internal/dbquery	0.037s
ok  	github.com/carlosframework/platform/internal/dbreads	3.219s
?   	github.com/carlosframework/platform/internal/dbreads/dbreadstest	[no test files]
ok  	github.com/carlosframework/platform/internal/dbverify	0.020s
ok  	github.com/carlosframework/platform/internal/demo	0.013s
ok  	github.com/carlosframework/platform/internal/demobuild	5.568s
ok  	github.com/carlosframework/platform/internal/democlaim	0.455s
ok  	github.com/carlosframework/platform/internal/devbox	16.042s
ok  	github.com/carlosframework/platform/internal/dnsrec	0.004s
ok  	github.com/carlosframework/platform/internal/docsite	0.154s
ok  	github.com/carlosframework/platform/internal/domainreg	0.017s
ok  	github.com/carlosframework/platform/internal/domains	69.651s
ok  	github.com/carlosframework/platform/internal/doorkey	0.016s
ok  	github.com/carlosframework/platform/internal/economics	0.009s
ok  	github.com/carlosframework/platform/internal/edgefence	0.196s
ok  	github.com/carlosframework/platform/internal/edgeguard	0.573s
?   	github.com/carlosframework/platform/internal/edgeproof	[no test files]
ok  	github.com/carlosframework/platform/internal/edgesfile	0.094s
ok  	github.com/carlosframework/platform/internal/egressaddr	0.012s
ok  	github.com/carlosframework/platform/internal/execsandbox	98.806s
ok  	github.com/carlosframework/platform/internal/fileacl	0.008s
ok  	github.com/carlosframework/platform/internal/fleetapi	2.695s
ok  	github.com/carlosframework/platform/internal/fleetstore	0.008s
ok  	github.com/carlosframework/platform/internal/fxrate	0.024s
ok  	github.com/carlosframework/platform/internal/gate	5.880s
ok  	github.com/carlosframework/platform/internal/genselect	0.144s
ok  	github.com/carlosframework/platform/internal/geo	0.047s
ok  	github.com/carlosframework/platform/internal/geoip	0.145s
ok  	github.com/carlosframework/platform/internal/groupadmission	0.022s
ok  	github.com/carlosframework/platform/internal/grouprollaws	17.069s
ok  	github.com/carlosframework/platform/internal/hadeparture	0.022s
ok  	github.com/carlosframework/platform/internal/hafresh	0.032s
ok  	github.com/carlosframework/platform/internal/hairpin	0.272s
ok  	github.com/carlosframework/platform/internal/historyreadback	1.303s
ok  	github.com/carlosframework/platform/internal/hostactors	21.125s
ok  	github.com/carlosframework/platform/internal/hostbox	20.251s
ok  	github.com/carlosframework/platform/internal/hostclaim	3.111s
ok  	github.com/carlosframework/platform/internal/hostenv	0.077s
ok  	github.com/carlosframework/platform/internal/hostevidence	0.024s
ok  	github.com/carlosframework/platform/internal/hostexec	22.565s
ok  	github.com/carlosframework/platform/internal/hostfence	0.395s
ok  	github.com/carlosframework/platform/internal/hostfiles	25.202s
ok  	github.com/carlosframework/platform/internal/hostfloor	0.580s
ok  	github.com/carlosframework/platform/internal/hostguard	1.781s
ok  	github.com/carlosframework/platform/internal/hostops	7.355s
?   	github.com/carlosframework/platform/internal/hostops/fencerelease	[no test files]
ok  	github.com/carlosframework/platform/internal/hostops/internal/fencerelease	0.016s
ok  	github.com/carlosframework/platform/internal/hostquarantine	0.010s
ok  	github.com/carlosframework/platform/internal/hostrelocate	2.080s
ok  	github.com/carlosframework/platform/internal/hostresolve	0.768s
ok  	github.com/carlosframework/platform/internal/hostwrite	0.008s
ok  	github.com/carlosframework/platform/internal/infraview	0.008s
ok  	github.com/carlosframework/platform/internal/ingresshealth	0.008s
ok  	github.com/carlosframework/platform/internal/ingresshealth/awstg	0.011s
ok  	github.com/carlosframework/platform/internal/instancectl	66.144s
ok  	github.com/carlosframework/platform/internal/instanceexec	10.168s
ok  	github.com/carlosframework/platform/internal/instancefs	15.763s
ok  	github.com/carlosframework/platform/internal/instancekey	0.011s
ok  	github.com/carlosframework/platform/internal/instanceupdates	0.029s
ok  	github.com/carlosframework/platform/internal/interactive	0.710s
ok  	github.com/carlosframework/platform/internal/launchd	0.012s
ok  	github.com/carlosframework/platform/internal/layout	19.580s
ok  	github.com/carlosframework/platform/internal/layout/pubclass	95.055s
ok  	github.com/carlosframework/platform/internal/lbhealth	0.014s
ok  	github.com/carlosframework/platform/internal/lease	142.092s
ok  	github.com/carlosframework/platform/internal/lease/leasetest	1.520s
ok  	github.com/carlosframework/platform/internal/lease/locktest	0.027s
ok  	github.com/carlosframework/platform/internal/ledger	0.107s
ok  	github.com/carlosframework/platform/internal/mail	1.263s
ok  	github.com/carlosframework/platform/internal/mailer	0.932s
ok  	github.com/carlosframework/platform/internal/mailsubmit	1.893s
ok  	github.com/carlosframework/platform/internal/mailwire	0.012s
ok  	github.com/carlosframework/platform/internal/maintenance	0.192s
ok  	github.com/carlosframework/platform/internal/maintenanceexec	8.750s
ok  	github.com/carlosframework/platform/internal/maintenanceguard	0.475s
ok  	github.com/carlosframework/platform/internal/managedboot	3.243s
?   	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.723s
ok  	github.com/carlosframework/platform/internal/media/mediatest	0.011s
ok  	github.com/carlosframework/platform/internal/mediaaws	61.686s
ok  	github.com/carlosframework/platform/internal/mediahandler	40.195s
ok  	github.com/carlosframework/platform/internal/mediajobs	0.810s
ok  	github.com/carlosframework/platform/internal/medialocal	9.758s
ok  	github.com/carlosframework/platform/internal/metrics	0.097s
ok  	github.com/carlosframework/platform/internal/minorunits	0.009s
ok  	github.com/carlosframework/platform/internal/moves	51.753s
ok  	github.com/carlosframework/platform/internal/moves/archive	3.190s
ok  	github.com/carlosframework/platform/internal/moves/offlinerun	0.098s
ok  	github.com/carlosframework/platform/internal/namedunits	0.016s
ok  	github.com/carlosframework/platform/internal/objstore	2.173s
ok  	github.com/carlosframework/platform/internal/ops	14.048s
ok  	github.com/carlosframework/platform/internal/pageindex	4.182s
ok  	github.com/carlosframework/platform/internal/parity	0.134s
?   	github.com/carlosframework/platform/internal/parity/cmd/parity-doc	[no test files]
ok  	github.com/carlosframework/platform/internal/park	0.592s
ok  	github.com/carlosframework/platform/internal/perf	0.186s
ok  	github.com/carlosframework/platform/internal/plans	0.125s
ok  	github.com/carlosframework/platform/internal/privatefile	0.026s
ok  	github.com/carlosframework/platform/internal/provision	231.479s
ok  	github.com/carlosframework/platform/internal/proxyproto	0.935s
ok  	github.com/carlosframework/platform/internal/publicrelease	0.044s
ok  	github.com/carlosframework/platform/internal/ratelimit	0.225s
ok  	github.com/carlosframework/platform/internal/regionlabel	0.057s
ok  	github.com/carlosframework/platform/internal/regionname	0.044s
ok  	github.com/carlosframework/platform/internal/registrar	0.019s
ok  	github.com/carlosframework/platform/internal/registrar/openprovider	0.608s
?   	github.com/carlosframework/platform/internal/registrar/registrartest	[no test files]
ok  	github.com/carlosframework/platform/internal/registry	82.526s
ok  	github.com/carlosframework/platform/internal/relay	7.448s
ok  	github.com/carlosframework/platform/internal/release	124.393s
?   	github.com/carlosframework/platform/internal/release/requestwitness	[no test files]
ok  	github.com/carlosframework/platform/internal/replicagen	0.041s
ok  	github.com/carlosframework/platform/internal/replicas	0.081s
ok  	github.com/carlosframework/platform/internal/reqrec	5.788s
ok  	github.com/carlosframework/platform/internal/rollout	10.216s
ok  	github.com/carlosframework/platform/internal/rolloutwords	0.025s
ok  	github.com/carlosframework/platform/internal/rootaws	95.640s
ok  	github.com/carlosframework/platform/internal/rootfsimage	1.173s
ok  	github.com/carlosframework/platform/internal/rootparticipation	0.110s
ok  	github.com/carlosframework/platform/internal/rootstate	0.035s
ok  	github.com/carlosframework/platform/internal/runs	0.642s
ok  	github.com/carlosframework/platform/internal/s3compat	0.024s
ok  	github.com/carlosframework/platform/internal/s3fake	1.407s
ok  	github.com/carlosframework/platform/internal/s3meter	0.531s
ok  	github.com/carlosframework/platform/internal/safefile	0.033s
ok  	github.com/carlosframework/platform/internal/schedule	22.347s
ok  	github.com/carlosframework/platform/internal/seeds	0.133s
ok  	github.com/carlosframework/platform/internal/share	0.027s
ok  	github.com/carlosframework/platform/internal/sim/litestreamfacts	4.469s
ok  	github.com/carlosframework/platform/internal/sim/mediajobs	49.788s
ok  	github.com/carlosframework/platform/internal/sim/regionha	22.268s
ok  	github.com/carlosframework/platform/internal/status	0.341s
ok  	github.com/carlosframework/platform/internal/steering	0.139s
ok  	github.com/carlosframework/platform/internal/stopevidence	0.391s
ok  	github.com/carlosframework/platform/internal/storecfg	0.322s
ok  	github.com/carlosframework/platform/internal/svcrole	0.025s
ok  	github.com/carlosframework/platform/internal/systemd	5.894s
?   	github.com/carlosframework/platform/internal/systemdshow	[no test files]
ok  	github.com/carlosframework/platform/internal/team	2.754s
ok  	github.com/carlosframework/platform/internal/teamcontract	0.233s
ok  	github.com/carlosframework/platform/internal/telemetry	0.037s
ok  	github.com/carlosframework/platform/internal/termfence	4.272s
ok  	github.com/carlosframework/platform/internal/timerspec	0.016s
ok  	github.com/carlosframework/platform/internal/tsidentity	4.219s
ok  	github.com/carlosframework/platform/internal/tunnelclient	0.360s
ok  	github.com/carlosframework/platform/internal/unixdial	0.013s
ok  	github.com/carlosframework/platform/internal/updatewords	0.041s
ok  	github.com/carlosframework/platform/internal/upstreamguard	0.014s
?   	github.com/carlosframework/platform/internal/upstreamguard/guardtest	[no test files]
ok  	github.com/carlosframework/platform/internal/usage	0.039s
ok  	github.com/carlosframework/platform/internal/version	0.014s
ok  	github.com/carlosframework/platform/internal/vet	3.000s
ok  	github.com/carlosframework/platform/internal/zonehost	0.024s
ok  	github.com/carlosframework/platform/internal/zonehost/route53zones	0.037s
?   	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.018s
ok  	github.com/carlosframework/platform/scripts/pathmapcheck	0.119s
ok  	github.com/carlosframework/platform/scripts/region-ha-g2/fixture	5.208s
ok  	github.com/carlosframework/platform/scripts/stateless-replicas-drill	1.179s
ok  	github.com/carlosframework/platform/scripts/witness-pointer	0.022s
=== cutover-witness (160 s, from +15 s)
ok  	github.com/carlosframework/platform	2.060s
=== internal_grouproll@0 (269 s, from +74 s)
ok  	github.com/carlosframework/platform/internal/grouproll	267.760s
=== internal_grouproll@1 (275 s, from +74 s)
ok  	github.com/carlosframework/platform/internal/grouproll	273.945s
=== internal_activator@0 (149 s, from +146 s)
ok  	github.com/carlosframework/platform/internal/activator	144.145s
=== internal_activator@1 (132 s, from +146 s)
ok  	github.com/carlosframework/platform/internal/activator	127.838s
=== internal_activator@2 (136 s, from +146 s)
ok  	github.com/carlosframework/platform/internal/activator	131.378s
=== internal_activator@3 (163 s, from +146 s)
ok  	github.com/carlosframework/platform/internal/activator	158.095s
=== internal_edge@0 (255 s, from +166 s)
ok  	github.com/carlosframework/platform/internal/edge	245.075s
=== internal_edge@1 (134 s, from +166 s)
ok  	github.com/carlosframework/platform/internal/edge	124.122s
=== internal_edge@2 (175 s, from +166 s)
ok  	github.com/carlosframework/platform/internal/edge	165.331s
=== internal_edge@3 (154 s, from +166 s)
ok  	github.com/carlosframework/platform/internal/edge	143.932s
=== root@0 (117 s, from +175 s)
ok  	github.com/carlosframework/platform	107.554s
=== root@1 (114 s, from +175 s)
ok  	github.com/carlosframework/platform	104.885s
=== root@2 (119 s, from +175 s)
ok  	github.com/carlosframework/platform	108.968s
=== root@3 (107 s, from +175 s)
ok  	github.com/carlosframework/platform	97.865s
=== root@4 (103 s, from +175 s)
ok  	github.com/carlosframework/platform	93.413s
=== internal_host@0 (155 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	150.019s
=== internal_host@1 (283 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	277.838s
=== internal_host@2 (201 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	196.278s
=== internal_host@3 (171 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	165.929s
=== internal_host@4 (217 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	212.358s
=== internal_host@5 (142 s, from +218 s)
ok  	github.com/carlosframework/platform/internal/host	137.224s
=== internal_console@0 (174 s, from +225 s)
ok  	github.com/carlosframework/platform/internal/console	166.785s
=== internal_console@1 (183 s, from +225 s)
ok  	github.com/carlosframework/platform/internal/console	176.608s
=== internal_console@2 (230 s, from +225 s)
ok  	github.com/carlosframework/platform/internal/console	224.586s
=== internal_console@3 (288 s, from +225 s)
ok  	github.com/carlosframework/platform/internal/console	280.797s
=== internal_console@4 (204 s, from +225 s)
ok  	github.com/carlosframework/platform/internal/console	196.445s
=== internal_console@5 (230 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	223.515s
=== internal_console@6 (245 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	238.540s
=== internal_console@7 (214 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	208.271s
=== internal_console@8 (244 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	238.124s
=== internal_console@9 (245 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	238.099s
=== internal_console@10 (233 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	226.602s
=== internal_console@11 (236 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	230.050s
=== internal_console@12 (313 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	308.149s
=== internal_console@13 (224 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	218.418s
=== internal_console@14 (203 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	196.500s
=== internal_console@15 (225 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	218.916s
=== internal_console@16 (206 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	200.281s
=== internal_console@17 (240 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	234.337s
=== internal_console@18 (275 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	268.655s
=== internal_console@19 (277 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	271.700s
=== internal_console@20 (218 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	211.168s
=== internal_console@21 (235 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	228.307s
=== internal_console@22 (230 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	224.232s
=== internal_console@23 (243 s, from +226 s)
ok  	github.com/carlosframework/platform/internal/console	236.384s
=== lists: internal_console 225 s, internal_edge 165 s, internal_activator 144 s, internal_host 217 s, root 174 s, internal_grouproll 73 s
=== cpu: the gate used 12916 cpu-seconds in 539 s, about 24.0 of 32 cores; the machine as a whole was 80% busy
=== opentofu ===
opentofu: 39 test files in 11 suites, OpenTofu v1.13.9
  initialised in 14 s
  ok      18 s  infra/modules/box-fence-writer/tests/writer.tftest.hcl  Success! 1 passed, 0 failed.
  ok      18 s  infra/modules/deployment-buckets/tests/console_floors.tftest.hcl  Success! 1 passed, 0 failed.
  ok      31 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      18 s  infra/modules/deployment-buckets/tests/evidence.tftest.hcl  Success! 1 passed, 0 failed.
  ok      30 s  infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl  Success! 3 passed, 0 failed.
  ok      24 s  infra/modules/deployment-buckets/tests/media_results.tftest.hcl  Success! 2 passed, 0 failed.
  ok      90 s  infra/modules/media-engine/tests/media_engine.tftest.hcl  Success! 24 passed, 0 failed.
  ok      27 s  infra/modules/pdf-host/tests/computed.tftest.hcl  Success! 2 passed, 0 failed.
  ok      59 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      20 s  infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl  Success! 2 passed, 0 failed.
  ok      69 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      43 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      14 s  infra/modules/region-host/tests/console_mail.tftest.hcl  Success! 4 passed, 0 failed.
  ok       7 s  infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl  Success! 1 passed, 0 failed.
  ok      73 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      12 s  infra/modules/region-host/tests/group_iam.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/group_isolation.tftest.hcl  Success! 1 passed, 0 failed.
  ok      36 s  infra/modules/region-host/tests/group_operator.tftest.hcl  Success! 13 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/group_user_data.tftest.hcl  Success! 3 passed, 0 failed.
  ok      32 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       8 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      13 s  infra/modules/region-host/tests/mailer_group.tftest.hcl  Success! 2 passed, 0 failed.
  ok      13 s  infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl  Success! 2 passed, 0 failed.
  ok     101 s  infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl  Success! 46 passed, 0 failed.
  ok      69 s  infra/modules/region-host/tests/store_conversion.tftest.hcl  Success! 27 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/store_scanning.tftest.hcl  Success! 4 passed, 0 failed.
  ok      27 s  infra/modules/region-host/tests/store_versioning.tftest.hcl  Success! 11 passed, 0 failed.
  ok      16 s  infra/modules/region-host/tests/store_write_credentials.tftest.hcl  Success! 4 passed, 0 failed.
  ok      17 s  infra/modules/region-host/tests/user_data_ignored.tftest.hcl  Success! 3 passed, 0 failed.
  ok      10 s  infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      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: 39 files in 207 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: 66650274 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:36718
Added `local` successfully.
Bucket created successfully `local/contract-bucket`.
Bucket created successfully `local/denied-bucket`.
Created policy `contract-only` successfully.
Added user `scopeduser` successfully.
Attached Policies: [contract-only]
To User: scopeduser
  buckets and scoped user ready
=== RUN   TestDeliveredContractMinio
=== RUN   TestDeliveredContractMinio/put
=== RUN   TestDeliveredContractMinio/get_round-trips_the_body
=== RUN   TestDeliveredContractMinio/list_shows_the_key
=== RUN   TestDeliveredContractMinio/head_and_list_agree_on_the_version
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict
=== RUN   TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed
=== RUN   TestDeliveredContractMinio/delete_removes_it
=== RUN   TestDeliveredContractMinio/cross-bucket_denial
--- PASS: TestDeliveredContractMinio (0.03s)
    --- PASS: TestDeliveredContractMinio/put (0.00s)
    --- PASS: TestDeliveredContractMinio/get_round-trips_the_body (0.00s)
    --- PASS: TestDeliveredContractMinio/list_shows_the_key (0.00s)
    --- PASS: TestDeliveredContractMinio/head_and_list_agree_on_the_version (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload (0.00s)
    --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route (0.01s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict (0.00s)
        --- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed (0.00s)
    --- PASS: TestDeliveredContractMinio/delete_removes_it (0.00s)
    --- PASS: TestDeliveredContractMinio/cross-bucket_denial (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.039s
=== RUN   TestT4StorageProbeMinio
2026/11/30 00:39:19 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18ECABB84DBB5021, HostID: 81914778212a71c929b56084fa10823df2ebd6cdc9039b3b86b7590bfb0182e3, 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.048s
=== RUN   TestS3StoreMinioContract
=== RUN   TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN   TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.04s)
    --- 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.041s
Bucket created successfully `local/store-versioned`.
local/store-versioned versioning is enabled
Created policy `store-versioned` successfully.
Added user `storeversioned` successfully.
Attached Policies: [store-versioned]
To User: storeversioned
=== RUN   TestVersionedContractMinio
--- PASS: TestVersionedContractMinio (0.01s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.020s
Bucket created successfully `local/wc-bucket`.
Created policy `writer` successfully.
Added user `wcwriter` successfully.
Attached Policies: [writer]
To User: wcwriter
=== RUN   TestWriteCredentialContractMinio
=== RUN   TestWriteCredentialContractMinio/put_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/multipart_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_read_elsewhere
=== RUN   TestWriteCredentialContractMinio/refused:_head
=== RUN   TestWriteCredentialContractMinio/refused:_list_uploads
=== RUN   TestWriteCredentialContractMinio/refused:_tag
=== RUN   TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag
=== RUN   TestWriteCredentialContractMinio/refused:_put_outside_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_put_beside_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_read_under_the_prefix
=== RUN   TestWriteCredentialContractMinio/refused:_list
=== RUN   TestWriteCredentialContractMinio/refused:_delete
=== RUN   TestWriteCredentialContractMinio/refused:_put_tagged
=== RUN   TestWriteCredentialContractMinio/refused:_put_to_another_bucket
=== RUN   TestWriteCredentialContractMinio/refused:_copy_from_the_store
=== RUN   TestWriteCredentialContractMinio/refused:_bucket_settings
--- PASS: TestWriteCredentialContractMinio (0.04s)
    --- PASS: TestWriteCredentialContractMinio/put_under_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/multipart_under_the_prefix (0.01s)
    --- PASS: TestWriteCredentialContractMinio/refused:_read_elsewhere (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_head (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: TestWriteCredentialContractMinio/refused:_put_beside_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_read_under_the_prefix (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_list (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:_copy_from_the_store (0.00s)
    --- PASS: TestWriteCredentialContractMinio/refused:_bucket_settings (0.00s)
PASS
ok  	github.com/carlosframework/platform/internal/objstore	0.048s
=== RUN   TestEndToEndMinio
=== RUN   TestEndToEndMinio/plan
=== RUN   TestEndToEndMinio/roll
=== RUN   TestEndToEndMinio/replace
=== RUN   TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.48s)
    --- PASS: TestEndToEndMinio/plan (0.01s)
    --- PASS: TestEndToEndMinio/roll (0.13s)
    --- PASS: TestEndToEndMinio/replace (0.15s)
    --- PASS: TestEndToEndMinio/remove (0.16s)
PASS
ok  	github.com/carlosframework/platform/internal/grouproll	0.491s
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 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 00:39:28 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/30 00:39:28 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/30 00:39:28 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 00:39:28 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 00:39:28 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 00:39:28 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/30 00:39:28 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%3A35925: could not determine target mailbox
    agent.go:136: dbreads: dbr_hpdb4bveh6sli4hbm3wd6lityy: planned 3 files (1544 bytes) and restored to 3 in 14ms
    agent.go:136: dbreads: dbr_hpdb4bveh6sli4hbm3wd6lityy: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 00:39:29 console: db read dbr_hpdb4bveh6sli4hbm3wd6lityy: relayed 1 chunks (102 bytes) in 1.005s, ended done
    agent.go:136: dbreads: dbr_i4cac5zjnxb5lmrec6o4hcfdk4: planned 1 files (720 bytes) and restored to 1 in 12ms
    agent.go:136: dbreads: dbr_i4cac5zjnxb5lmrec6o4hcfdk4: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 00:39:30 console: db read dbr_i4cac5zjnxb5lmrec6o4hcfdk4: relayed 1 chunks (102 bytes) in 1.006s, ended done
    agent.go:136: dbreads: dbr_uopatk4mzfk3gukt2zs3jx4v7u: planned 3 files (1544 bytes) and held through 3 in 12ms
    agent.go:136: dbreads: dbr_uopatk4mzfk3gukt2zs3jx4v7u: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/30 00:39:31 console: db read dbr_uopatk4mzfk3gukt2zs3jx4v7u: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN   TestDBForwardMinio/by_disconnect
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_snevdbvn2x5gq26ggjs52runum: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/30 00:39:31 console: db read dbr_snevdbvn2x5gq26ggjs52runum: relayed 0 chunks (0 bytes) in 21ms, ended client gone
    agent.go:136: dbreads: dbr_snevdbvn2x5gq26ggjs52runum: output 5 bytes in 1 confirmed chunks in 105ms
=== RUN   TestDBForwardMinio/by_timeout
=== NAME  TestDBForwardMinio
    agent.go:136: dbreads: dbr_6kccnqz2p7uil6do75ddcvjlw4: planned 3 files (1544 bytes) and restored to 3 in 14ms
2026/11/30 00:39:51 console: db read dbr_6kccnqz2p7uil6do75ddcvjlw4: relayed 0 chunks (0 bytes) in 19.251s, ended no-result
    agent.go:136: dbreads: dbr_6kccnqz2p7uil6do75ddcvjlw4: output 5 bytes in 1 confirmed chunks in 19.224s
--- PASS: TestDBForwardMinio (22.94s)
    --- PASS: TestDBForwardMinio/by_disconnect (0.23s)
    --- PASS: TestDBForwardMinio/by_timeout (19.36s)
PASS
ok  	github.com/carlosframework/platform/internal/console	22.984s
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.077s
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.56s)
PASS
ok  	github.com/carlosframework/platform/internal/medialocal	0.566s
=== RUN   TestHeldHandoverTwoBoxMinio
2026/11/30 00:39:56 edge: mesh key: minted
2026/11/30 00:39:56 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 00:39:56 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 00:39:56 tenant admission is open. accepting tenant work
2026/11/30 00:39:56 activator: HA placement host=shop-b0194107.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T00:39:56Z lock_generation=0
2026/11/30 00:39:56 lease: t8-b0194107/shop-b0194107.example.test: HA lease acquired in 4ms (first wake)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 00:39:56 activator: shop-b0194107.example.test: started carlos-instance@shop\x2db0194107.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 00:39:56 activator: shop-b0194107.example.test: carlos-instance@shop\x2db0194107.example.test.service launched in 7ms, healthy 0s later
2026/11/30 00:39:56 activator: shop-b0194107.example.test: woke in 21ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 8ms
2026/11/30 00:39:56 lease: t8-b0194107/plain-b0194107.example.test: acquired in 2ms (client 0s, lock read and write 2ms)
2026/11/30 00:39:56 activator: no replica for plain-b0194107.example.test in s3://contract-bucket/t8-b0194107/plain-b0194107.example.test — booting fresh
2026/11/30 00:39:56 activator: plain-b0194107.example.test: started carlos-instance@plain\x2db0194107.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 5ms, control socket 0s, key gate 0s, logs 0s) 7ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 00:39:56 activator: plain-b0194107.example.test: carlos-instance@plain\x2db0194107.example.test.service launched in 8ms, healthy 0s later
2026/11/30 00:39:56 activator: plain-b0194107.example.test: woke in 97ms: checks 0s, lease 2ms, restore 19ms, identity 0s, protect 0s, spawn 8ms, replicate 68ms
2026/11/30 00:39:56 lease: t8-b0194107/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/30 00:39:56 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 00:39:56 activator: bot0.shop.bac.sidecar.internal: woke in 20ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 7ms
2026/11/30 00:39:56 activator: next-due probe plain-b0194107.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 00:39:56 activator: plain-b0194107.example.test hibernated
2026/11/30 00:39:56 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:585ab9f1103cc3185e65bed4cc2bfaa64c53599a67e2decb9e4e7c1c88f487e3) in 9ms: files 1ms, sync 5ms, record 1ms, marker 2ms
2026/11/30 00:39:56 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/30 00:39:56 activator: next-due probe shop-b0194107.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: released with a marker (clean true, txid 1, files 3:f81156e6aa7d469cf7183549142de4993e45843ec138a4ada302ef7f5f0d4c81) in 6ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/30 00:39:56 activator: shop-b0194107.example.test hibernated
2026/11/30 00:39:56 lease: t8-b0194107/shop-b0194107.example.test: HA lease acquired in 3ms (clean marker)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: restored (other-box)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: started carlos-instance@shop\x2db0194107.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 1ms, control socket 0s, key gate 0s, logs 0s) 1ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: carlos-instance@shop\x2db0194107.example.test.service launched in 2ms, healthy 0s later
2026/11/30 00:39:56 activator: shop-b0194107.example.test: woke in 87ms: checks 0s, lease 4ms, restore 25ms, identity 0s, protect 0s, spawn 2ms, replicate 56ms
2026/11/30 00:39:56 edge: ha-take shop-b0194107.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/30 00:39:56 edge: forward shop-b0194107.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:4a9633ca9d652e54c6e992dfee301536 Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-30 00:39:56.56048415 +0000 UTC FinishedAt:2026-11-30 00:39:56.707834778 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-b0194107.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:plain-b0194107.example.test Kind:other Marker:true Clean:true Reason:} {Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:118 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-b0194107.example.test <nil> stop plain-b0194107.example.test marker=true clean=true <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> releasing shop-b0194107.example.test <nil> stop shop-b0194107.example.test marker=true clean=true <nil> taken shop-b0194107.example.test betty <nil> end-moves]
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/bot0.shop.bac.sidecar.internal/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/bot0.shop.bac.sidecar.internal/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/bot0.shop.bac.sidecar.internal/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-b0194107/plain-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/bot0.shop.bac.sidecar.internal/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/shop-b0194107.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/shop-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/shop-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/head.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/generations/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0008/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0007/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0006/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0005/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0004/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/0009/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/files/0/manifest.json
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/files/0/objects/0000000000000001-5672df491a30b9e261a84986bcb8ce1faac063d6567b73d13ca556a9e0f02b59
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/files/0/objects/0000000000000003-d71d8253bef8c63b58b0b62cc840a5d1c1932475ef3f83cc90be115aca05f497
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0009/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0001/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/0000/0000000000000001-0000000000000001.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0003/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0000/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-b0194107/shop-b0194107.example.test/0002/
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-b0194107/shop-b0194107.example.test/0000/0000000000000002-0000000000000002.ltx
    hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-b0194107/shop-b0194107.example.test/lock.json
    hadrain_twobox_minio_linux_test.go:1243: drain took 190ms; S3 calls 48 (DELETE lock=1 GET files=3 GET head=1 GET lock=3 GET replica=2 LIST replica=32 PUT lock=3 PUT replica=3); deployment store calls 20 (GET edges=14 LIST edges=4 PUT edges=2)
    hadrain_twobox_minio_linux_test.go:1367: the fenced A's start gate answers 503 "This service is unavailable. Try again later.\n" (Retry-After "10")
2026/11/30 00:39:56 lease: t8-b0194107/plain-b0194107.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/30 00:39:56 activator: plain-b0194107.example.test: started carlos-instance@plain\x2db0194107.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 00:39:56 activator: plain-b0194107.example.test: carlos-instance@plain\x2db0194107.example.test.service launched in 1ms, healthy 0s later
2026/11/30 00:39:56 lease: /tmp/carlos-minio-contract-npKCNn/g/dw3032895699/data/instances/plain-b0194107.example.test/plain-b0194107.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/30 00:39:56 activator: plain-b0194107.example.test: woke in 10ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 1ms, spawn 2ms, replicate 6ms
2026/11/30 00:39:56 activator: next-due probe shop-b0194107.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 00:39:56 activator: shop-b0194107.example.test: released with a marker (clean true, txid 2, files 3:f81156e6aa7d469cf7183549142de4993e45843ec138a4ada302ef7f5f0d4c81) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/30 00:39:56 activator: shop-b0194107.example.test hibernated
2026/11/30 00:39:56 tenant admission is closed for shutdown
2026/11/30 00:39:56 activator: next-due probe plain-b0194107.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 00:39:56 activator: plain-b0194107.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.57s)
=== RUN   TestHeldHandoverLostLeaseMinio
2026/11/30 00:39:56 edge: mesh key: minted
2026/11/30 00:39:56 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 00:39:56 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 00:39:56 tenant admission is open. accepting tenant work
2026/11/30 00:39:56 activator: HA placement host=shop-34cbcd15.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T00:39:56Z lock_generation=0
2026/11/30 00:39:56 lease: t8-34cbcd15/shop-34cbcd15.example.test: HA lease acquired in 3ms (first wake)
2026/11/30 00:39:56 activator: shop-34cbcd15.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 00:39:56 activator: shop-34cbcd15.example.test: started carlos-instance@shop\x2d34cbcd15.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 00:39:56 activator: shop-34cbcd15.example.test: carlos-instance@shop\x2d34cbcd15.example.test.service launched in 7ms, healthy 0s later
2026/11/30 00:39:57 activator: shop-34cbcd15.example.test: woke in 65ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 53ms
2026/11/30 00:39:57 activator: next-due probe shop-34cbcd15.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 00:39:57 activator: final checkpoint shop-34cbcd15.example.test: lease: release marker owed for s3://contract-bucket/t8-34cbcd15/shop-34cbcd15.example.test/lock.json (If-Match "3ba31a8a8dcd459d35579627550466c9"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/30 00:39:57 activator: shop-34cbcd15.example.test hibernated
2026/11/30 00:39:57 activator: handover of shop-34cbcd15.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-34cbcd15.example.test client 4 "
    hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-34cbcd15.example.test <nil> releasing shop-34cbcd15.example.test <nil> stop shop-34cbcd15.example.test marker=false clean=false <nil> left shop-34cbcd15.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 00:39:57 tenant admission is closed for shutdown
2026/11/30 00:39:57 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.32s)
PASS
ok  	github.com/carlosframework/platform/internal/host	0.937s
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 00:39:58 lease: instances/gen-1795999198313618518.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/30 00:39:58 lease: instances/gen-1795999198313618518.shop.example.com: HA lease acquired in 3ms (holder terminated)
    gentake_minio_test.go:308: a second create-only copy onto instances/gen-1795999198313618518.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/30 00:39:58 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 00:39:58 http: proxy error: context canceled
2026/11/30 00:39:58 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: a write has waited too long to reach storage (write fence)"
=== RUN   TestGenerationTakeMinio/switch-412
2026/11/30 00:39:58 lease: instances/gen-1795999198486324049.shop.example.com: HA lease acquired in 4ms (first wake)
2026/11/30 00:39:58 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: fetch ltx files: lease: a write has waited too long to reach storage (write fence)"
2026/11/30 00:39:58 http: proxy error: context canceled
2026/11/30 00:39:58 lease: instances/gen-1795999198486324049.shop.example.com: HA lease acquired in 3ms (clean marker)
=== RUN   TestGenerationTakeMinio/copy-version
=== RUN   TestGenerationTakeMinio/store-time
2026/11/30 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 00:39:58 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 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 3ms (clean marker)
2026/11/30 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/30 00:39:58 lease: instances/gen-1795999198537786085.shop.example.com: HA lease acquired in 2ms (unclean marker)
=== RUN   TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.39s)
    --- PASS: TestGenerationTakeMinio/take (0.17s)
    --- PASS: TestGenerationTakeMinio/switch-412 (0.04s)
    --- 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.402s
minio contract: PASS
=== staticcheck ===
go version go1.26.10 linux/arm64
go: downloading honnef.co/go/tools v0.8.2
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/sync v0.23.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
staticcheck: clean
=== govulncheck ===
go version go1.26.10 linux/arm64
go: downloading golang.org/x/vuln v1.8.0
go: downloading golang.org/x/telemetry v0.0.0-20260908163034-4bcc4b2ee518
go: downloading golang.org/x/tools v0.50.0
govulncheck: scanned github.com/carlosframework/platform, amadan.net/carlos/platform.git/launchctx, carlos-vulnscan
GO-2026-6859  called  stdlib@v1.26.10, fixed in v1.26.11
    HTTP/1 server crash due to MaxBytesReader header race in net/http
    excepted until 2027-01-31 (.amadan/govulncheck-exceptions.tsv:9): net/http MaxBytesReader header race, fixed in go1.26.11. CI and releases stay on go1.26.10 because 1.26.11 deadlocks the edge's Expect: 100-continue path (#897, .amadan/go-toolchain.sh); #904 checked every production MaxBytesReader site and found it unreachable.
GO-2026-5932  required  golang.org/x/crypto@v0.58.0, fixed in v0.58.1-0.20261009181718-2f1f834330b2
    The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues
    not fatal: no call path to the vulnerable code
govulncheck: clean (2 finding(s), none called outside .amadan/govulncheck-exceptions.tsv)
=== code-health ===
go version go1.26.10 linux/arm64
    codehealth_test.go:42: scanned in 1m54.012s
    codehealth_test.go:107: line metrics (code lines, then physical):
          file-lines  5471  7324  internal/activator activator_test.go
          file-lines  4191  7043  internal/console server.go
          file-lines  4147  6311  . 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  3204  6398  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   362   630  cmd/console serve
          func-lines   360   362  internal/edge TestDemoAPIAliasBoundary
          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               1092 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         18586 at   45 sites  functions over 300 code lines (blank and comment-only lines not counted)
    codehealth_test.go:115: file-lines         30683 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
--- PASS: TestCodeHealth (114.02s)
PASS
ok  	github.com/carlosframework/platform/internal/codehealth	115.034s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: comparing with the merge base 4799995f73519e17658758951f597e603a5a00df (main is d668a77cdde81e31c09b9ccc1043c9b493d62563)
=== 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 (13 s, from +15 s)
ok  	github.com/carlosframework/platform/internal/systemd	13.394s
=== internal_rootaws@0 (26 s, from +34 s)
ok  	github.com/carlosframework/platform/internal/rootaws	25.504s
=== internal_activator@0 (279 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	276.823s
=== internal_activator@1 (245 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	243.159s
=== internal_activator@2 (273 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	271.333s
=== internal_activator@3 (398 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	396.552s
=== internal_activator@4 (286 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	284.071s
=== internal_activator@5 (299 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	297.036s
=== internal_activator@6 (321 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	319.230s
=== internal_activator@7 (439 s, from +113 s)
ok  	github.com/carlosframework/platform/internal/activator	437.423s
=== internal_edge@0 (86 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	82.209s
=== internal_edge@1 (76 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	72.539s
=== internal_edge@2 (204 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	200.908s
=== internal_edge@3 (154 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	150.680s
=== internal_edge@4 (147 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	143.348s
=== internal_edge@5 (287 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	283.197s
=== internal_edge@6 (224 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	220.896s
=== internal_edge@7 (246 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	242.612s
=== internal_edge@8 (225 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	221.054s
=== internal_edge@9 (289 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	285.856s
=== internal_edge@10 (243 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	239.733s
=== internal_edge@11 (239 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	235.841s
=== internal_edge@12 (243 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	239.727s
=== internal_edge@13 (270 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	266.207s
=== internal_edge@14 (172 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	168.307s
=== internal_edge@15 (258 s, from +135 s)
ok  	github.com/carlosframework/platform/internal/edge	254.502s
=== internal_host@0 (8 s, from +197 s)
ok  	github.com/carlosframework/platform/internal/host	4.829s
=== internal_host@1 (17 s, from +197 s)
ok  	github.com/carlosframework/platform/internal/host	13.338s
=== lists: internal_edge 135 s, internal_activator 112 s, internal_host 196 s, internal_rootaws 34 s, internal_systemd 14 s
=== cpu: the gate used 7727 cpu-seconds in 552 s, about 14.0 of 32 cores; the machine as a whole was 43% 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/gitleaks/go-gitdiff v0.9.1
go: downloading github.com/h2non/filetype v1.1.3
go: downloading github.com/mholt/archives v0.1.2
go: downloading github.com/fatih/semgroup v1.2.0
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/spf13/viper v1.19.0
go: downloading github.com/Masterminds/sprig/v3 v3.3.0
go: downloading github.com/charmbracelet/lipgloss v0.5.0
go: downloading golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa
go: downloading github.com/BobuSumisu/aho-corasick v1.0.3
go: downloading github.com/hashicorp/go-version v1.7.0
go: downloading github.com/fsnotify/fsnotify v1.8.0
go: downloading github.com/spf13/afero v1.12.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading github.com/magiconair/properties v1.8.9
go: downloading github.com/spf13/cast v1.7.1
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/mattn/go-runewidth v0.0.14
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/Masterminds/goutils v1.1.1
go: downloading dario.cat/mergo v1.0.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/STARRY-S/zip v0.2.1
go: downloading github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3
go: downloading github.com/bodgit/sevenzip v1.6.0
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
go: downloading github.com/klauspost/compress v1.17.11
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/minio/minlz v1.0.0
go: downloading github.com/nwaples/rardecode/v2 v2.1.0
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/sorairolake/lzip-go v0.3.5
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading golang.org/x/text v0.22.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading golang.org/x/sys v0.30.0
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading golang.org/x/sync v0.11.0
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/bodgit/plumbing v1.3.0
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading go4.org v0.0.0-20230225012048-214862532bf5
go: downloading github.com/hashicorp/golang-lru/v2 v2.0.7
go: downloading github.com/bodgit/windows v1.0.1
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 12019 tracked files; 33 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
gitleaks: clean
diff --git a/.amadan/code-health.tsv b/.amadan/code-health.tsv
index 41304e256..997a648d6 100644
--- a/.amadan/code-health.tsv
+++ b/.amadan/code-health.tsv
@@ -492,7 +492,6 @@ fatal . runVersionTarget log.Fatal 7
fatal . scanTarget log.Fatalf 1
fatal . scheduleCommand log.Fatal 1
fatal . secretsCommand os.Exit 1
-fatal . secretsEnvelopeV2Env log.Fatalf 1
fatal . secretsPubKey log.Fatal 1
fatal . secretsPubKeyAPI log.Fatal 3
fatal . servicesCommand os.Exit 1
diff --git a/appconfig_cli.go b/appconfig_cli.go
index 36960c9c4..9d8bdafc0 100644
--- a/appconfig_cli.go
+++ b/appconfig_cli.go
@@ -15,7 +15,6 @@ import (
"os"
"slices"
"sort"
- "strconv"
"strings"
"github.com/carlosframework/platform/internal/appconfig"
@@ -1320,25 +1319,11 @@ func secretsKeyFromConfig(cfg apiConfig, app string) (*ecdh.PublicKey, error) {
return appconfig.ParsePublicKey(cfg.SecretsPubkey, "console secrets_pubkey")
}
-// secretsEnvelopeV2Env reads CONSOLE_SECRETS_ENVELOPE_V2 for direct-bucket
-// `secrets set`, with the console's own rule: unset is false, and a value
-// that is not a boolean stops rather than guessing.
-func secretsEnvelopeV2Env() bool {
- v := strings.TrimSpace(os.Getenv("CONSOLE_SECRETS_ENVELOPE_V2"))
- if v == "" {
- return false
- }
- b, err := strconv.ParseBool(v)
- if err != nil {
- log.Fatalf("CONSOLE_SECRETS_ENVELOPE_V2 %q is not a boolean (use true or false)", v)
- }
- return b
-}
-
// sealSecretAPI seals one value for API-mode `secrets set`: bound to
-// (account, app) when the console named the account — which it does only
-// while its deployment writes v2 (CONSOLE_SECRETS_ENVELOPE_V2) — and v1
-// otherwise, which every box and every console door accepts.
+// (account, app) when the console named the account, which a current
+// console does for every app, and v1 otherwise. Only a console from before
+// hunt H3-M3 leaves the account out, and that console takes v1; a current
+// one refuses a new v1 envelope, because one opens in any tenant's config.
func sealSecretAPI(pub *ecdh.PublicKey, account, app string, v []byte) (string, error) {
if account == "" {
return appconfig.SealUnbound(pub, v)
@@ -1446,9 +1431,8 @@ func runSecretsSet(args []string) {
if err := directSealRefusal(context.Background(), store, acct, pub); err != nil {
log.Fatal(strings.ReplaceAll(err.Error(), "<app>", *app))
}
- // Direct-bucket mode has no console to ask, so the deployment's switch
- // comes from the operator's environment under the console's own name.
- sealer := appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: *app}, secretsEnvelopeV2Env())
+ // Bound, as every seal is: the config store refuses a new v1 envelope.
+ sealer := appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: *app}, true)
sealed := make(map[string]appconfig.Var, len(kv))
for k, v := range kv {
sv, err := sealer.Seal(appconfig.Binding{Account: acct, App: *app}, []byte(v))
diff --git a/appconfig_cli_fleet_test.go b/appconfig_cli_fleet_test.go
index 180b399a4..460f340ab 100644
--- a/appconfig_cli_fleet_test.go
+++ b/appconfig_cli_fleet_test.go
@@ -162,7 +162,6 @@ func directSetEnv(t *testing.T, dir, pubB64 string) {
clearDeploymentEnv(t)
t.Setenv("CARLOS_DEPLOYMENT_DIR", dir)
t.Setenv("CARLOS_SECRETS_PUBKEY", pubB64)
- t.Setenv("CONSOLE_SECRETS_ENVELOPE_V2", "1")
}
func TestDirectSecretsSetPlatformAppStillWorks(t *testing.T) {
@@ -192,7 +191,7 @@ func TestDirectSecretsSetPlatformAppStillWorks(t *testing.T) {
t.Fatalf("sealed_to = %q, want the terminal key's %s", v.SealedTo, fp)
}
if !appconfig.EnvelopeBound(v.Envelope) {
- t.Fatal("direct mode with the v2 switch on sealed v1")
+ t.Fatal("direct mode sealed v1")
}
priv, _ := appconfig.ParsePrivateKey(privB64, "test")
if got, err := appconfig.Open(priv, appconfig.Binding{Account: "bab", App: "shop"}, v.Envelope); err != nil || string(got) != "hunter2" {
diff --git a/cmd/console/main.go b/cmd/console/main.go
index b3cd4b954..f05278437 100644
--- a/cmd/console/main.go
+++ b/cmd/console/main.go
@@ -548,8 +548,7 @@ func serve() {
seedData = console.TimeS3Store(sd, rec)
}
}
- // Before the server exists: every door that seals reads this switch.
- appconfig.SetBoundSealing(secretsEnvelopeV2())
+ retiredSecretsEnvelopeV2()
// Every background loop the console runs, from the GeoIP reader's on,
// runs on work's context, so a stop cancels them together and waits for
// them (stop.go).
@@ -1801,23 +1800,16 @@ func redirectHosts() []string {
return out
}
-// secretsEnvelopeV2 parses CONSOLE_SECRETS_ENVELOPE_V2: whether secrets this
-// console seals (relay, mail, object storage) and the CLI seals through it
-// are bound v2 envelopes (appconfig.Binding, discussion #220). Off by
-// default, because a box on a binary that predates v2 cannot open one and
-// its whole config render for that app stalls. Turn it on once every box
-// runs a build that reads v2. A value strconv.ParseBool cannot read stops
-// the boot, as for the other boolean settings.
-func secretsEnvelopeV2() bool {
- v := strings.TrimSpace(os.Getenv("CONSOLE_SECRETS_ENVELOPE_V2"))
- if v == "" {
- return false
- }
- b, err := strconv.ParseBool(v)
- if err != nil {
- log.Fatalf("console: CONSOLE_SECRETS_ENVELOPE_V2 %q is not a boolean (use true or false)", v)
+// retiredSecretsEnvelopeV2 notes a CONSOLE_SECRETS_ENVELOPE_V2 left in the
+// environment. It used to choose whether secrets were sealed bound to their
+// account and app (v2) or not (v1), off by default. Every seal is v2 now
+// (hunt H3-M3: a v1 envelope opens in any tenant's config), so the setting
+// does nothing, whatever its value, and a leftover one does not stop the
+// boot.
+func retiredSecretsEnvelopeV2() {
+ if strings.TrimSpace(os.Getenv("CONSOLE_SECRETS_ENVELOPE_V2")) != "" {
+ log.Printf("console: CONSOLE_SECRETS_ENVELOPE_V2 is no longer read: every secret is sealed to its own account and app")
}
- return b
}
// dbForward parses CARLOS_DB_FORWARD: "1" turns on forwarding a carlos db
diff --git a/docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md b/docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md
new file mode 100644
index 000000000..3cda875b9
--- /dev/null
+++ b/docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md
@@ -0,0 +1,79 @@
+# Secret envelopes: retiring v1 (hunt H3-M3)
+
+Branch `sec-h3-m3-envelope`, 2026-11-29.
+
+## The problem
+
+A v1 secret envelope carries no binding, so a box opens it under any
+account's config. Anyone who can read the bucket and write their own app's
+config could copy another tenant's v1 envelope into their app, and the box
+would decrypt it into their environment. v2 (bound to account and app with
+GCM associated data) has existed since v0.23.0, but every deployment still
+wrote v1: the switch (`CONSOLE_SECRETS_ENVELOPE_V2`) was on nowhere.
+
+## What this branch does
+
+1. **Every seal is v2.** `appconfig.Seal` always binds. The console names the
+ account on every app (`secrets_account`), so the CLI and the settings page
+ seal v2 too. CLI direct-bucket mode seals v2. The console switch is
+ retired: a value left in the environment is logged and ignored.
+2. **The config store keeps a v1 envelope only where it already sits.** Every
+ manifest write (`applyAtExpecting`, `applyEnvironmentOwned`) refuses a
+ secret whose envelope `Open` would read as v1, unless it is byte for byte
+ the value already stored under that name in that bundle. A copy into
+ another app, another bundle, another name or an instance layer is
+ refused, and so is a fresh v1 from an old CLI. The console door answers
+ with its existing `sealed-old` refusal.
+3. **Boxes still open stored v1 envelopes** for the config they sit in. No
+ secret is lost.
+
+This closes the finding's attacker: after the console rolls, no door accepts
+a v1 envelope it did not already hold.
+
+## What is left
+
+- v1 envelopes already stored stay v1 until their owners set them again.
+- A v1 envelope copied into another app **before** the console rolls is
+ indistinguishable from that app's own.
+- Someone with direct bucket write can still plant a v1. They are past every
+ door anyway.
+
+Closing these needs boxes to refuse v1, which needs every stored v1 gone
+first.
+
+## Options for the sunset
+
+| Option | Data loss | Closes the residual | Cost |
+|---|---|---|---|
+| A. Refuse v1 on boxes now | Every v1 secret stops rendering, and each app's whole config stalls | Yes | Unacceptable |
+| B. Wait for owners to re-set secrets, then refuse v1 | None, if we wait until the count is zero | Eventually; may never reach zero | A keyless count of v1 envelopes per app |
+| C. One-time re-seal sweep, then refuse v1 | None | Yes | A tool run where the deployment private key already lives (a box) |
+| D. Pin each stored v1 with a MAC keyed from the private key | None | Yes | Same key handling as C plus a new format; no benefit over C |
+
+## Recommendation
+
+**C, after this branch has rolled.** A sweep, run once on a box that holds
+`CARLOS_SECRETS_KEY`, walks every bundle (default, environments, instance
+layers). For each v1 envelope sealed to the deployment key it opens the
+envelope and writes the v2 re-seal for that same (account, app) at the
+bundle's etag. A re-seal renders identical bytes, so no unit restarts.
+
+The sweep first lists any v1 envelope found byte for byte in more than one
+(account, app), and **does not re-seal those**. v1 envelopes come from fresh
+randomness, so a duplicate is a copy, which makes the list the forensic
+answer to "was this exploited before the fix". Paul decides what happens to
+those secrets.
+
+When a keyless count shows no v1 left, the next release refuses v1 in
+`appconfig.Open` and deletes `SealUnbound` and the CLI's v1 fallback.
+
+Implemented now: steps 1 to 3 above (the safe part, which needs no
+decision). Not implemented: the sweep and the floor. Both need Paul to
+decide who runs a tool with the deployment private key, and when.
+
+## Not bound: the variable name
+
+v2's associated data is (account, app). Binding the name as well needs a
+v3, and boxes would have to read v3 before anything writes it, the same
+two-step rollout v2 needed. Within one app a name swap crosses no tenant
+boundary, so this branch leaves it out. It is a separate decision.
diff --git a/docs/superpowers/notes/census-proposal-sec-h3-m3-envelope.md b/docs/superpowers/notes/census-proposal-sec-h3-m3-envelope.md
new file mode 100644
index 000000000..518679d6f
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-sec-h3-m3-envelope.md
@@ -0,0 +1,11 @@
+# Census approval: sec-h3-m3-envelope
+
+Ruling `census-ruling-sec-h3-m3-envelope`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+Envelopes re-pinned: `.`, `internal/appconfig`, `internal/moves/archive`.
+
+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.
+
+Seal: `0fdff597ef83fb9966e07c70b4283001eb97f7dfa71a83a19bde92382192eb6b` → `0fdff597ef83fb9966e07c70b4283001eb97f7dfa71a83a19bde92382192eb6b`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-sec-h3-m3-envelope.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/appconfig/crypto.go b/internal/appconfig/crypto.go
index 93fabc53f..00aec625e 100644
--- a/internal/appconfig/crypto.go
+++ b/internal/appconfig/crypto.go
@@ -7,9 +7,11 @@
//
// v2 authenticates the (account, app) it was sealed for as GCM associated
// data, so a box opens it only while rendering that app's config — see
-// Binding. v1 is what every envelope written before v2 existed looks like,
-// and still opens anywhere; an uncompressed point always starts 0x04, so the
-// two can never be mistaken for each other. Mirrors the shape the framework's crypto core plans for its own
+// Binding. Every seal for a current console is v2. v1 is what envelopes
+// written before that look like: it still opens anywhere, so the config store
+// keeps one only where it already sits (checkUnboundSets) and a copied one is
+// refused at the write. An uncompressed point always starts 0x04, so the two
+// can never be mistaken for each other. Mirrors the shape the framework's crypto core plans for its own
// Seal/Open (docs/superpowers/specs/2026-08-01-carlos-framework-design.md
// §6), reimplemented natively here since platform cannot import the
// framework repo (platform is the substrate the framework builds on).
@@ -33,7 +35,6 @@ import (
"fmt"
"io"
"strings"
- "sync/atomic"
"golang.org/x/crypto/hkdf"
@@ -130,41 +131,21 @@ func ParsePublicKey(b64, src string) (*ecdh.PublicKey, error) {
return k, nil
}
-// boundSealing is whether Seal writes v2. Off by default, and that default is
-// the rollout guard: a box on a binary from before v2 cannot open one, and a
-// single unopenable secret stalls the app's whole config render on that box.
-// So reading v2 ships first and writing it is a separate, deliberate step —
-// the console turns it on from CONSOLE_SECRETS_ENVELOPE_V2 once every box
-// runs a build that reads v2 (cmd/console). Deployment-wide by nature, which
-// is why it is process state rather than a parameter threaded through every
-// door that seals.
-var boundSealing atomic.Bool
-
-// SetBoundSealing switches Seal between v1 (false, the default) and v2.
-func SetBoundSealing(on bool) { boundSealing.Store(on) }
-
-// BoundSealing reports whether Seal writes v2 in this process. The console
-// advertises it to the CLI (handleAPIConfigGet's secrets_account), so a
-// client-side seal follows the same switch.
-func BoundSealing() bool { return boundSealing.Load() }
-
// Seal encrypts plaintext for pub as the config of b: a v2 envelope bound to
-// b when bound sealing is on (SetBoundSealing), else a v1 envelope. b is
-// validated either way, so a caller passing the wrong binding fails now and
-// not on the day the switch flips.
+// b, which only a render of b's own config opens. It is SealBound; the name
+// stays for the callers that seal an app's config.
+//
+// Until hunt H3-M3 it wrote v1 unless a deployment switch
+// (CONSOLE_SECRETS_ENVELOPE_V2) said otherwise, and the switch was on in no
+// deployment, so every new secret could be copied into another tenant's
+// config and opened there. Every box has read v2 since v0.23.0, which is
+// why the switch could go.
func Seal(pub *ecdh.PublicKey, b Binding, plaintext []byte) (string, error) {
- if _, err := b.aad(); err != nil {
- return "", err
- }
- if !BoundSealing() {
- return SealUnbound(pub, plaintext)
- }
return SealBound(pub, b, plaintext)
}
-// SealBound writes a v2 envelope bound to b regardless of the switch: only a
-// render of b's own config opens it. For callers that already know every
-// reader takes v2 — the CLI once the console has said so.
+// SealBound writes a v2 envelope bound to b: only a render of b's own config
+// opens it.
func SealBound(pub *ecdh.PublicKey, b Binding, plaintext []byte) (string, error) {
aad, err := b.aad()
if err != nil {
@@ -178,9 +159,10 @@ func SealBound(pub *ecdh.PublicKey, b Binding, plaintext []byte) (string, error)
}
// SealUnbound writes the v1 envelope: no binding, opens under any account's
-// config. What Seal writes until bound sealing is on, and what the CLI writes
-// for a console that has not said it takes v2 (an older console's
-// CheckEnvelope reads the v2 prefix as a bad point and refuses it).
+// config. Only the CLI calls it, for a console from before v2 that does not
+// name the account (an older console's CheckEnvelope reads the v2 prefix as
+// a bad point and refuses it). A current console names the account on every
+// app, and its config store refuses a new v1 (UnboundEnvelopeError).
func SealUnbound(pub *ecdh.PublicKey, plaintext []byte) (string, error) {
eph, nonce, err := freshEphemeral()
if err != nil {
@@ -233,7 +215,8 @@ func splitVersion(raw []byte) (bool, []byte) {
// EnvelopeBound reports whether envelopeB64 is a v2 (bound) envelope, read
// off its prefix without any key. Bad base64 reads as false. The console's
// config door uses it to refuse a v1 envelope for an app on a fleet, whose
-// envelopes are always v2.
+// envelopes are always v2; the config store refuses one anywhere it is not
+// already stored (checkUnboundSets).
func EnvelopeBound(envelopeB64 string) bool {
raw, err := base64.StdEncoding.DecodeString(envelopeB64)
if err != nil {
@@ -243,18 +226,46 @@ func EnvelopeBound(envelopeB64 string) bool {
return bound
}
+// UnboundEnvelopeError is the config store's refusal of a v1 envelope that is
+// not already the value stored under Var in the bundle being written
+// (checkUnboundSets). A v1 envelope opens under any binding, so a new one is
+// either a copy of another config's secret or the work of a sealer from
+// before v2; both are refused. It names the var and never the envelope.
+type UnboundEnvelopeError struct{ Var string }
+
+func (e *UnboundEnvelopeError) Error() string {
+ return fmt.Sprintf("config: var %s: sealed in the old unbound format, which is accepted only where it is already stored; seal it again", e.Var)
+}
+
+// envelopeUnbound reports whether Open would read envelopeB64 as a v1
+// envelope: it decodes, with the same decoder Open uses, and carries no v2
+// prefix. Anything that does not decode Open refuses outright, so it opens
+// nowhere and is not this question.
+func envelopeUnbound(envelopeB64 string) bool {
+ raw, err := base64.StdEncoding.DecodeString(envelopeB64)
+ if err != nil {
+ return false
+ }
+ bound, _ := splitVersion(raw)
+ return !bound
+}
+
// Open decrypts an envelope with priv, for the config named by b. A v2
// envelope opens only if it was sealed for b. A v1 envelope opens regardless
// of b: those were written before the binding existed and are most of every
// production bucket today.
//
-// That v1 path is the residual the binding cannot close by itself. Anyone
-// who can write one tenant's config can copy another tenant's v1 envelope
-// into it and have a box decrypt it there. Stripping a v2 envelope down to
-// v1 does not get there (see boundInfo), so the exposure is the fixed set of
-// v1 envelopes already stored plus every one written while bound sealing is
-// off. Once it is on, each write re-seals as v2. Sunset: once no stored
-// envelope is v1, refuse v1 here.
+// That v1 path is the residual the binding cannot close by itself: a v1
+// envelope carries nothing that says whose it is. So the write side holds
+// it (hunt H3-M3). Nothing seals v1 for a current console (Seal), and the
+// config store accepts a v1 envelope only as the value already stored under
+// that name in that bundle (checkUnboundSets), so one copied from another
+// tenant's config is refused at every door. Stripping a v2 envelope down to
+// v1 does not get past this either (see boundInfo). What is left is the
+// fixed set of v1 envelopes already stored, which open here for the config
+// they sit in, and a writer with direct bucket access, who is past every
+// door. Sunset: re-seal those as v2, then refuse v1 here
+// (docs/superpowers/notes/2026-11-29-secret-envelope-v1-sunset.md).
func Open(priv *ecdh.PrivateKey, b Binding, envelopeB64 string) ([]byte, error) {
raw, err := base64.StdEncoding.DecodeString(envelopeB64)
if err != nil {
diff --git a/internal/appconfig/crypto_bind_test.go b/internal/appconfig/crypto_bind_test.go
index 2baaf10ca..c4819d840 100644
--- a/internal/appconfig/crypto_bind_test.go
+++ b/internal/appconfig/crypto_bind_test.go
@@ -162,43 +162,32 @@ func TestSyncRefusesAnEnvelopeSealedForAnotherAccount(t *testing.T) {
}
}
-// The rollout guard: until a deployment turns bound sealing on, Seal writes
-// v1, which every box can open — a box on a binary from before v2 would
-// stall the app's whole config render on a v2 envelope. It still validates
-// the binding, so a wrong caller fails before the switch ever flips.
+// Seal writes v2, bound to the config it is given, and validates that
+// binding (hunt H3-M3: it used to write v1 unless a deployment switch said
+// otherwise, and a v1 envelope opens in any tenant's config).
//
-// Mutation-mindedness: default boundSealing to true, or have Seal ignore it,
-// and the first assertion fails.
-func TestSealWritesV1UntilBoundSealingIsOn(t *testing.T) {
+// Mutation-mindedness: have Seal call SealUnbound again and the first
+// assertion fails.
+func TestSealWritesBoundEnvelopes(t *testing.T) {
priv, pub := bindKeys(t)
- t.Cleanup(func() { SetBoundSealing(false) })
b := Binding{Account: "aaa", App: "blog"}
-
- SetBoundSealing(false)
env, err := Seal(pub, b, []byte("shh"))
if err != nil {
t.Fatal(err)
}
raw, _ := base64.StdEncoding.DecodeString(env)
- if raw[0] != 0x04 {
- t.Fatalf("with bound sealing off Seal wrote a non-v1 envelope (first byte %#x)", raw[0])
- }
- if _, err := Seal(pub, Binding{}, []byte("shh")); err == nil {
- t.Fatal("Seal with bound sealing off accepted an empty binding")
- }
-
- SetBoundSealing(true)
- env, err = Seal(pub, b, []byte("shh"))
- if err != nil {
- t.Fatal(err)
- }
- raw, _ = base64.StdEncoding.DecodeString(env)
if !bytes.HasPrefix(raw, []byte(boundPrefix)) {
- t.Fatal("with bound sealing on Seal did not write v2")
+ t.Fatalf("Seal did not write v2 (first byte %#x)", raw[0])
+ }
+ if got, err := Open(priv, b, env); err != nil || string(got) != "shh" {
+ t.Fatalf("Open under its own binding = %q, %v", got, err)
}
if _, err := Open(priv, Binding{Account: "bbb", App: "blog"}, env); err == nil {
t.Fatal("v2 envelope from Seal opened under another account")
}
+ if _, err := Seal(pub, Binding{}, []byte("shh")); err == nil {
+ t.Fatal("Seal accepted an empty binding")
+ }
}
// EnvelopeBound reads the version off the prefix: v2 from SealBound, v1
diff --git a/internal/appconfig/hunt_H3-M3_test.go b/internal/appconfig/hunt_H3-M3_test.go
new file mode 100644
index 000000000..4ba61b41b
--- /dev/null
+++ b/internal/appconfig/hunt_H3-M3_test.go
@@ -0,0 +1,141 @@
+package appconfig
+
+import (
+ "context"
+ "crypto/ecdh"
+ "errors"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// hunt H3-M3 (Opus verifier). Tenant aaa's secret is sealed the way the
+// console and the CLI seal it. Someone who can READ the bucket copies that
+// envelope into an app they control (bbb/blog), either straight into the
+// bucket or through the config door, which can only run the keyless
+// CheckEnvelope (console/apiconfig.go). The box's real Sync renders bbb's
+// config under bbb's binding (sync.go). SECURE: aaa's plaintext never
+// reaches bbb's env file.
+//
+// When the hunt ran, Seal wrote v1 unless a deployment switch said
+// otherwise, and this test failed at its last line. Seal writes v2 now, so
+// the copy is stored and does not open under bbb's binding.
+func TestHunt_H3_M3_V1EnvelopeOpensInAnotherTenantsRender(t *testing.T) {
+ ctx := context.Background()
+ priv, pub := bindKeys(t)
+
+ s := release.NewDirStore(t.TempDir())
+ victim, err := Seal(pub, Binding{Account: "aaa", App: "shop"}, []byte("aaa-stripe-live-key"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := SetSecret(ctx, s, "aaa", "shop", map[string]Var{"STRIPE_KEY": {Envelope: victim}}); err != nil {
+ t.Fatal(err)
+ }
+ // The read: the envelope as it sits in aaa's config.
+ m, err := Get(ctx, s, "aaa", "shop")
+ if err != nil {
+ t.Fatal(err)
+ }
+ stolen := m.Vars["STRIPE_KEY"].Envelope
+ if err := CheckEnvelope(stolen); err != nil {
+ t.Fatalf("the config door would refuse it: %v", err)
+ }
+ // The write, into the attacker's own app.
+ if err := SetSecret(ctx, s, "bbb", "blog", map[string]Var{"LOOT": {Envelope: stolen}}); err != nil {
+ t.Fatal(err)
+ }
+ got := huntH3M3RenderBlog(t, s, priv)
+ if strings.Contains(got, "aaa-stripe-live-key") {
+ t.Fatalf("H3-M3: aaa/shop's secret rendered into bbb/blog's env file:\n%s", got)
+ }
+}
+
+// The same theft with an envelope written before every seal was v2: a v1
+// envelope already stored in aaa's config, which opens under any binding.
+// The config store accepts a v1 envelope only as the value already stored
+// in that slot, so the copy into bbb/blog is refused at the write, by name,
+// and nothing of it reaches bbb's env file. aaa's own render still opens
+// it: no stored secret is lost.
+//
+// Mutation-mindedness: drop checkUnboundSets from applyAtExpecting and the
+// copy is stored and rendered into bbb's env file.
+func TestHunt_H3_M3_LegacyV1EnvelopeCopyIsRefused(t *testing.T) {
+ ctx := context.Background()
+ priv, pub := bindKeys(t)
+ s := release.NewDirStore(t.TempDir())
+
+ legacy, err := SealUnbound(pub, []byte("aaa-stripe-live-key"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ // As the bucket holds it today: written before the store refused v1.
+ if _, _, err := putManifestAt(ctx, s, Key("aaa", "shop"), "shop",
+ &Manifest{Vars: map[string]Var{"STRIPE_KEY": {Kind: "secret", Envelope: legacy}}}, ""); err != nil {
+ t.Fatal(err)
+ }
+ m, err := Get(ctx, s, "aaa", "shop")
+ if err != nil {
+ t.Fatal(err)
+ }
+ stolen := m.Vars["STRIPE_KEY"].Envelope
+ if err := CheckEnvelope(stolen); err != nil {
+ t.Fatalf("the config door would refuse it: %v", err)
+ }
+
+ err = SetSecret(ctx, s, "bbb", "blog", map[string]Var{"LOOT": {Envelope: stolen}})
+ var unbound *UnboundEnvelopeError
+ if !errors.As(err, &unbound) || unbound.Var != "LOOT" {
+ t.Fatalf("copying aaa's v1 envelope into bbb/blog: err = %v, want UnboundEnvelopeError for LOOT", err)
+ }
+ if strings.Contains(err.Error(), stolen) {
+ t.Fatal("the refusal echoes the envelope")
+ }
+ // Every other bundle of bbb's refuses it too: a named environment and
+ // one an owner scope holds.
+ if _, err := ApplyEnvironment(ctx, s, "bbb", "blog", "staging", map[string]Var{"LOOT": {Kind: "secret", Envelope: stolen}}, nil); !errors.As(err, &unbound) {
+ t.Fatalf("copy into bbb/blog staging: err = %v, want UnboundEnvelopeError", err)
+ }
+ if _, err := ApplyEnvironmentOwned(ctx, s, "bbb", "blog", "preview", "team-1", map[string]Var{"LOOT": {Kind: "secret", Envelope: stolen}}, nil); !errors.As(err, &unbound) {
+ t.Fatalf("copy into bbb/blog's owned preview: err = %v, want UnboundEnvelopeError", err)
+ }
+ if got := huntH3M3RenderBlog(t, s, priv); strings.Contains(got, "aaa-stripe-live-key") {
+ t.Fatalf("H3-M3: aaa/shop's v1 secret rendered into bbb/blog's env file:\n%s", got)
+ }
+
+ // aaa's own route still renders its legacy secret.
+ reg := testRegistry(t)
+ if err := reg.Upsert(registry.Route{Host: "shop.example.com", Kind: "instance", App: "shop", Account: "aaa",
+ Status: "ready", Backing: registry.BackingUnit}); err != nil {
+ t.Fatal(err)
+ }
+ envDir := t.TempDir()
+ if err := Sync(ctx, reg, s, priv, envDir, func(string) error { return nil }, nil); err != nil {
+ t.Fatalf("Sync: %v", err)
+ }
+ own, _ := os.ReadFile(filepath.Join(envDir, "shop.example.com.env"))
+ if !strings.Contains(string(own), "STRIPE_KEY=aaa-stripe-live-key") {
+ t.Fatalf("aaa/shop lost its own legacy secret:\n%s", own)
+ }
+}
+
+// huntH3M3RenderBlog runs the box's real Sync for bbb/blog's route and
+// returns the env file it wrote ("" when it wrote none).
+func huntH3M3RenderBlog(t *testing.T, s release.Store, priv *ecdh.PrivateKey) string {
+ t.Helper()
+ reg := testRegistry(t)
+ if err := reg.Upsert(registry.Route{Host: "blog.example.com", Kind: "instance", App: "blog", Account: "bbb",
+ Status: "ready", Backing: registry.BackingUnit}); err != nil {
+ t.Fatal(err)
+ }
+ envDir := t.TempDir()
+ if err := Sync(context.Background(), reg, s, priv, envDir, func(string) error { return nil }, nil); err != nil {
+ t.Fatalf("Sync: %v", err)
+ }
+ got, _ := os.ReadFile(filepath.Join(envDir, "blog.example.com.env"))
+ return string(got)
+}
diff --git a/internal/appconfig/owned.go b/internal/appconfig/owned.go
index 8f0efa3a7..3fd9a2906 100644
--- a/internal/appconfig/owned.go
+++ b/internal/appconfig/owned.go
@@ -169,6 +169,9 @@ func applyEnvironmentOwned(ctx context.Context, s release.Store, acct, app, envN
if expect != "" && expect != before {
return Receipt{}, ErrVersionMismatch
}
+ if err := checkUnboundSets(&m, sets); err != nil {
+ return Receipt{}, err
+ }
r := applyToManifest(&m, sets, unsets)
raw, _, err := putManifestAt(ctx, s, key, app, &m, etag)
if err != nil {
diff --git a/internal/appconfig/owned_test.go b/internal/appconfig/owned_test.go
index 8c8797a76..4c5918688 100644
--- a/internal/appconfig/owned_test.go
+++ b/internal/appconfig/owned_test.go
@@ -358,13 +358,22 @@ func TestForkEnvironmentCopiesOwnKeysVerbatim(t *testing.T) {
}
smtp, _ := SealUnbound(pub, []byte("smtp-pass"))
if err := SaveEnvironment(ctx, s, "bab", "docs", "lagged", map[string]Var{
- "OWN": {Kind: "env", Value: "1"},
- "S1": {Kind: "secret", Envelope: v1},
- "S2": {Kind: "secret", Envelope: v2},
- "DOCS_SMTP_PASS": {Kind: "secret", Envelope: smtp},
+ "OWN": {Kind: "env", Value: "1"},
+ "S2": {Kind: "secret", Envelope: v2},
}, nil); err != nil {
t.Fatal(err)
}
+ // The v1 envelopes as a bundle holds them from before the store refused
+ // a new one (hunt H3-M3).
+ lagged, etag, _, err := getIfExistsAtETag(ctx, s, EnvironmentKey("bab", "docs", "lagged"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ lagged.Vars["S1"] = Var{Kind: "secret", Envelope: v1}
+ lagged.Vars["DOCS_SMTP_PASS"] = Var{Kind: "secret", Envelope: smtp}
+ if _, _, err := putManifestAt(ctx, s, EnvironmentKey("bab", "docs", "lagged"), "docs", lagged, etag); err != nil {
+ t.Fatal(err)
+ }
if err := ForkEnvironment(ctx, s, "bab", "docs", "lagged", "lagged-team", "alta", []string{"DOCS_SMTP_PASS"}); err != nil {
t.Fatal(err)
}
diff --git a/internal/appconfig/sealer_test.go b/internal/appconfig/sealer_test.go
index 558f6445b..3c49f3551 100644
--- a/internal/appconfig/sealer_test.go
+++ b/internal/appconfig/sealer_test.go
@@ -55,14 +55,10 @@ func TestSealerRefusesAnotherBinding(t *testing.T) {
}
}
-// A sealer's bound flag is fixed at construction: the deployment-wide switch
-// (SetBoundSealing) does not change what it writes.
-func TestSealerBoundIgnoresTheDeploymentSwitch(t *testing.T) {
+// A sealer's bound flag is fixed at construction and decides what it writes.
+func TestSealerBoundDecidesTheFormat(t *testing.T) {
_, pub := bindKeys(t)
b := Binding{Account: "bab", App: "shop"}
- prev := BoundSealing()
- SetBoundSealing(false)
- t.Cleanup(func() { SetBoundSealing(prev) })
prefix := func(bound bool) string {
v, err := NewSealer(pub, b, bound).Seal(b, []byte("x"))
diff --git a/internal/appconfig/store.go b/internal/appconfig/store.go
index 90b0ea89c..54754d84b 100644
--- a/internal/appconfig/store.go
+++ b/internal/appconfig/store.go
@@ -11,6 +11,7 @@ import (
"errors"
"fmt"
"os"
+ "sort"
"github.com/carlosframework/platform/internal/release"
)
@@ -228,6 +229,9 @@ func applyAtExpecting(ctx context.Context, s release.Store, key, app, bundle str
if expect != "" && expect != before {
return Receipt{}, "", false, ErrVersionMismatch
}
+ if err := checkUnboundSets(&m, sets); err != nil {
+ return Receipt{}, "", false, err
+ }
r := applyToManifest(&m, sets, unsets)
if want != nil && len(sets) == 0 && len(r.Unset) == 0 {
r.VersionBefore, r.VersionAfter = before, before
@@ -245,6 +249,42 @@ func applyAtExpecting(ctx context.Context, s release.Store, key, app, bundle str
return r, newETag, true, nil
}
+// checkUnboundSets refuses a secret set whose envelope Open would read as v1
+// (unbound), unless it is byte for byte the envelope m already holds under
+// that name (hunt H3-M3). m is the bundle as read for this write, so the
+// check and the write rest on the same read. A value that is not base64 at
+// all opens nowhere and is left to the doors' CheckEnvelope, as before.
+//
+// A v1 envelope opens under any account's config (Open), so the only
+// evidence of where one belongs is where it already sits. One that sits in
+// this very slot may go on sitting there: rewriting it unchanged reveals
+// nothing it did not already. Anything else is refused: a v1 copied from
+// another tenant's config (the finding: anyone who can read the bucket and
+// write their own app's config), the same value moved to another name or
+// bundle, and a fresh v1 from a sealer that predates v2. Every current
+// client seals v2 (Seal), so none of them is refused.
+//
+// Names are checked sorted, so a write with several refused vars always
+// names the same one.
+func checkUnboundSets(m *Manifest, sets map[string]Var) error {
+ keys := make([]string, 0, len(sets))
+ for k := range sets {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ for _, k := range keys {
+ v := sets[k]
+ if v.Kind != "secret" || !envelopeUnbound(v.Envelope) {
+ continue
+ }
+ if old, ok := m.Vars[k]; ok && old.Kind == "secret" && old.Envelope == v.Envelope {
+ continue
+ }
+ return &UnboundEnvelopeError{Var: k}
+ }
+ return nil
+}
+
// conditionalPutErr is a manifest write's error as a conditional caller
// must see it. The write was made at the etag of the read whose version
// matched expect, so a CAS conflict means another writer moved the layer in
diff --git a/internal/appconfig/unboundsets_test.go b/internal/appconfig/unboundsets_test.go
new file mode 100644
index 000000000..468e9ac25
--- /dev/null
+++ b/internal/appconfig/unboundsets_test.go
@@ -0,0 +1,95 @@
+package appconfig
+
+import (
+ "context"
+ "errors"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// The config store keeps a v1 (unbound) envelope only where it already sits
+// (checkUnboundSets, hunt H3-M3). Each case writes through the real store
+// doors over a bundle that already holds a legacy v1 under STRIPE_KEY.
+func TestStoreAcceptsV1OnlyWhereItAlreadySits(t *testing.T) {
+ ctx := context.Background()
+ _, pub := bindKeys(t)
+ legacy, err := SealUnbound(pub, []byte("old"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ fresh, err := SealUnbound(pub, []byte("new"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ bound, err := Seal(pub, Binding{Account: "aaa", App: "shop"}, []byte("new"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ world := func(t *testing.T) release.Store {
+ t.Helper()
+ s := release.NewDirStore(t.TempDir())
+ m := &Manifest{Vars: map[string]Var{"STRIPE_KEY": {Kind: "secret", Envelope: legacy}}}
+ if _, _, err := putManifestAt(ctx, s, Key("aaa", "shop"), "shop", m, ""); err != nil {
+ t.Fatal(err)
+ }
+ if _, _, err := putManifestAt(ctx, s, EnvironmentKey("aaa", "shop", "staging"), "shop", m, ""); err != nil {
+ t.Fatal(err)
+ }
+ return s
+ }
+ secret := func(env string) map[string]Var { return map[string]Var{"STRIPE_KEY": {Envelope: env}} }
+
+ for _, c := range []struct {
+ name string
+ write func(release.Store) error
+ refused string // the var named in the refusal, "" for accepted
+ }{
+ {"unchanged in its own slot", func(s release.Store) error { return SetSecret(ctx, s, "aaa", "shop", secret(legacy)) }, ""},
+ {"unchanged in its own environment slot", func(s release.Store) error {
+ _, err := ApplyEnvironment(ctx, s, "aaa", "shop", "staging", map[string]Var{"STRIPE_KEY": {Kind: "secret", Envelope: legacy}}, nil)
+ return err
+ }, ""},
+ {"replaced by v2", func(s release.Store) error { return SetSecret(ctx, s, "aaa", "shop", secret(bound)) }, ""},
+ {"replaced by a fresh v1", func(s release.Store) error { return SetSecret(ctx, s, "aaa", "shop", secret(fresh)) }, "STRIPE_KEY"},
+ {"moved to another name", func(s release.Store) error {
+ return SetSecret(ctx, s, "aaa", "shop", map[string]Var{"OTHER": {Envelope: legacy}})
+ }, "OTHER"},
+ {"copied to a bundle it is not in", func(s release.Store) error {
+ _, err := ApplyEnvironment(ctx, s, "aaa", "shop", "prod", map[string]Var{"STRIPE_KEY": {Kind: "secret", Envelope: legacy}}, nil)
+ return err
+ }, "STRIPE_KEY"},
+ {"as an instance layer", func(s release.Store) error {
+ _, _, err := ApplyInstance(ctx, s, "aaa", "shop", "shop-1.example.com", map[string]Var{"STRIPE_KEY": {Kind: "secret", Envelope: legacy}}, nil)
+ return err
+ }, "STRIPE_KEY"},
+ {"at a version", func(s release.Store) error {
+ m, etag, found, err := getIfExistsAtETag(ctx, s, Key("aaa", "shop"))
+ if err != nil || !found || m == nil {
+ t.Fatalf("read: %v %v", found, err)
+ }
+ _, err = ApplyAtVersion(ctx, s, "aaa", "shop", "", BundleVersion{Found: true, ETag: etag}, map[string]Var{"NEW": {Kind: "secret", Envelope: fresh}}, nil)
+ return err
+ }, "NEW"},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ s := world(t)
+ before, _ := Get(ctx, s, "aaa", "shop")
+ err := c.write(s)
+ if c.refused == "" {
+ if err != nil {
+ t.Fatalf("refused: %v", err)
+ }
+ return
+ }
+ var unbound *UnboundEnvelopeError
+ if !errors.As(err, &unbound) || unbound.Var != c.refused {
+ t.Fatalf("err = %v, want UnboundEnvelopeError for %s", err, c.refused)
+ }
+ after, _ := Get(ctx, s, "aaa", "shop")
+ if len(after.Vars) != len(before.Vars) || after.Vars["STRIPE_KEY"] != before.Vars["STRIPE_KEY"] {
+ t.Fatalf("a refused write changed the default bundle: %+v", after.Vars)
+ }
+ })
+ }
+}
diff --git a/internal/console/apiconfig.go b/internal/console/apiconfig.go
index c89f695f4..df30abf3e 100644
--- a/internal/console/apiconfig.go
+++ b/internal/console/apiconfig.go
@@ -247,10 +247,10 @@ func (s *Server) handleAPIConfigGet(w http.ResponseWriter, r *http.Request) {
// secrets_account is the account a secret for this app is bound to
// (appconfig.Binding), as the sqid this console resolved the request to;
// the CLI may only know the account by name. Its presence is how the CLI
- // learns to seal v2. For a fleet app it is always present, because a
- // fleet's envelopes are always v2. For a platform app it follows the
- // deployment switch (CONSOLE_SECRETS_ENVELOPE_V2): absent, the CLI seals
- // v1, which every box can open (discussion #220).
+ // learns to seal v2, and it is present for every app (hunt H3-M3: the
+ // config store refuses a new v1 envelope, which would open in any
+ // tenant's config). Only a console from before that omits it for a
+ // platform app, and the CLI then seals v1 (discussion #220).
//
// On a keyless fleet both are omitted and secrets_keyless_fleet names the
// caller's own fleet, so the CLI can name the fix (B8). Not a refusal:
@@ -275,13 +275,11 @@ func (s *Server) handleAPIConfigGet(w http.ResponseWriter, r *http.Request) {
case errors.Is(err, errNoDeploymentKey), errors.Is(err, errDeploymentKeyUnreadable):
// A platform app on a console without a usable key: the terminal's
// own CARLOS_SECRETS_PUBKEY is the only key, as before, and the
- // account still follows the switch.
+ // account is named all the same, so the CLI seals v2.
if errors.Is(err, errDeploymentKeyUnreadable) {
log.Printf("console: api config get %s/%s: %v", acct.Sqid, app, err)
}
- if appconfig.BoundSealing() {
- out["secrets_account"] = acct.Sqid
- }
+ out["secrets_account"] = acct.Sqid
default:
log.Printf("console: api config get %s/%s: seal key: %v", acct.Sqid, app, err)
jsonError(w, http.StatusBadGateway, "could not read the config — try again")
diff --git a/internal/console/apiconfig_test.go b/internal/console/apiconfig_test.go
index b9ccde7f0..aa26d58cf 100644
--- a/internal/console/apiconfig_test.go
+++ b/internal/console/apiconfig_test.go
@@ -269,29 +269,17 @@ func TestAPIConfigGetSecretsPubkey(t *testing.T) {
}
}
-// The GET names the account sqid a secret for this app is bound to — the
-// CLI may only know the account by name — and only while the deployment
-// writes bound (v2) envelopes: its presence is what makes the CLI seal v2,
-// so with CONSOLE_SECRETS_ENVELOPE_V2 off (the default) it must be absent
-// and the CLI keeps writing v1 that every box can open (discussion #220).
-func TestAPIConfigGetNamesTheSecretsAccountOnlyWhenV2IsOn(t *testing.T) {
+// The GET names the account sqid a secret for this app is bound to (the
+// CLI may only know the account by name), for every app: its presence is
+// what makes the CLI seal v2, and the config store refuses a new v1 envelope
+// (hunt H3-M3). It used to be absent unless CONSOLE_SECRETS_ENVELOPE_V2 was
+// on (discussion #220).
+func TestAPIConfigGetNamesTheSecretsAccount(t *testing.T) {
fx, token := configFixture(t, "code-config-secrets-account")
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
-
- appconfig.SetBoundSealing(false)
status, out := getJSON(t, configURL(fx, "titogo"), token)
if status != http.StatusOK {
t.Fatalf("GET = %d %v", status, out)
}
- if _, ok := out["secrets_account"]; ok {
- t.Fatalf("secrets_account served with bound sealing off: %v", out["secrets_account"])
- }
-
- appconfig.SetBoundSealing(true)
- status, out = getJSON(t, configURL(fx, "titogo"), token)
- if status != http.StatusOK {
- t.Fatalf("GET = %d %v", status, out)
- }
if got := str(t, out, "secrets_account"); got != release.OpsAccount {
t.Fatalf("secrets_account = %q, want %q", got, release.OpsAccount)
}
diff --git a/internal/console/configwrite.go b/internal/console/configwrite.go
index a942d111e..7a22a17e5 100644
--- a/internal/console/configwrite.go
+++ b/internal/console/configwrite.go
@@ -9,8 +9,9 @@
// JSON door's exact status and sentence (byte-identical to what that door
// has always answered) and a closed code another door can render in its
// own words. Every refusal still comes back before the first store call;
-// the only store-shaped refusals (conflict, nothing-to-remove, store) are
-// the write's own outcome.
+// the only store-shaped refusals (conflict, nothing-to-remove, store, and
+// sealed-old for a v1 envelope the store will not take) are the write's own
+// outcome.
//
// NOTHING IN A REFUSAL OR A LOG LINE CARRIES CONTENT. Var names appear
// (the caller has to learn which var was refused, and names are not
@@ -274,6 +275,16 @@ func (s *Server) configWriteStore(ctx context.Context, unlock func(), acct *Acco
// environment gets (§3, §4), with no log line.
return 0, &configRefusal{Code: configRefusalNotFound, Status: http.StatusNotFound, Msg: notFoundBody}
}
+ var unbound *appconfig.UnboundEnvelopeError
+ if errors.As(err, &unbound) {
+ // The store's refusal of a v1 envelope that is not already the
+ // value in that slot (hunt H3-M3): one opens in any tenant's
+ // config, so it is either a copy or the work of a CLI from before
+ // every seal was v2. configCheckSealedTo words the same case for an app
+ // on a fleet.
+ k := unbound.Var
+ return 0, badConfig(configRefusalSealedOld, k, fmt.Sprintf("%s was sealed in an older format that %s's boxes do not accept. upgrade the carlos CLI and set %s again", k, app, k))
+ }
var fromErr *envFromError
if errors.As(err, &fromErr) {
// The environment was written; a switched app's From was not
diff --git a/internal/console/envform_test.go b/internal/console/envform_test.go
index fa9345db2..34ca4e076 100644
--- a/internal/console/envform_test.go
+++ b/internal/console/envform_test.go
@@ -136,7 +136,8 @@ func (e *envFx) seal(t *testing.T, plaintext string) string {
if err != nil {
t.Fatal(err)
}
- env, err := appconfig.SealUnbound(pub, []byte(plaintext))
+ // v2, as the page's script seals it (data-seal-version="2").
+ env, err := appconfig.SealBound(pub, appconfig.Binding{Account: e.fx.sqid, App: "shop"}, []byte(plaintext))
if err != nil {
t.Fatal(err)
}
@@ -592,33 +593,19 @@ func TestEnvSealAttributes(t *testing.T) {
return envFields(t, body).Get("sealed_to")
}
- t.Run("platform app v1", func(t *testing.T) {
- appconfig.SetBoundSealing(false)
+ t.Run("platform app", func(t *testing.T) {
e := newEnvFx(t)
body := e.page(t)
a := formTag(t, body)
fp, _ := appconfig.PublicFingerprint(e.pub)
- if a["data-seal-pub"] != e.pub || a["data-seal-version"] != "1" || sealedTo(t, body) != fp {
- t.Fatalf("form = %v sealed_to %q, want v1 to the deployment key %s", a, sealedTo(t, body), fp)
- }
- if _, ok := a["data-account"]; ok {
- t.Fatalf("v1 form carries data-account: %v", a)
+ if a["data-seal-pub"] != e.pub || a["data-seal-version"] != "2" || a["data-account"] != e.fx.sqid || a["data-app"] != "shop" || sealedTo(t, body) != fp {
+ t.Fatalf("form = %v sealed_to %q, want v2 bound to %s/shop, to the deployment key %s", a, sealedTo(t, body), e.fx.sqid, fp)
}
if a["data-msg-chars"] != envCopyDraft.MsgChars || a["data-msg-changed"] != envCopyDraft.MsgChanged {
t.Fatalf("the script's refusals are not the copy's: %v", a)
}
})
- t.Run("platform app v2", func(t *testing.T) {
- appconfig.SetBoundSealing(true)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
- e := newEnvFx(t)
- a := formTag(t, e.page(t))
- if a["data-seal-version"] != "2" || a["data-account"] != e.fx.sqid || a["data-app"] != "shop" {
- t.Fatalf("form = %v, want v2 bound to %s/shop", a, e.fx.sqid)
- }
- })
t.Run("fleet app", func(t *testing.T) {
- appconfig.SetBoundSealing(false)
fx, _, k := skFleetShop(t, "code-env-fleet", true)
c := signInPaul(t, fx)
_, _, body := get(t, c, fx.u("/apps/shop/settings/environments"))
@@ -706,8 +693,6 @@ func TestEnvFormChromium(t *testing.T) {
t.Skip("no installed headless browser")
}
node := nodeOrSkip(t)
- appconfig.SetBoundSealing(true)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
e := newEnvFx(t)
if _, err := appconfig.ApplyEnvironment(context.Background(), e.fx.rel, e.fx.sqid, "shop", "staging",
map[string]appconfig.Var{"LOG_LEVEL": {Kind: "env", Value: "debug"}}, nil); err != nil {
diff --git a/internal/console/envsave_test.go b/internal/console/envsave_test.go
index 4b7bdb3a1..54a5d0270 100644
--- a/internal/console/envsave_test.go
+++ b/internal/console/envsave_test.go
@@ -261,7 +261,6 @@ func TestEnvSaveRefusalsPersonCopy(t *testing.T) {
// sealed bound; a keyless fleet takes none.
fleet := func(t *testing.T, code string, withKey bool, edit func(url.Values, skFleetKey, *consoleFixture)) (int, string, *consoleFixture) {
t.Helper()
- appconfig.SetBoundSealing(false)
fx, _, k := skFleetShop(t, code, withKey)
c := signInPaul(t, fx)
_, _, page := get(t, c, fx.u("/apps/shop/settings/environments"))
@@ -316,7 +315,6 @@ func TestEnvSaveRefusalsPersonCopy(t *testing.T) {
}
func TestEnvSaveSealedToChecked(t *testing.T) {
- appconfig.SetBoundSealing(false)
fx, _, k := skFleetShop(t, "code-envsave-sealedto", true)
c := signInPaul(t, fx)
_, _, page := get(t, c, fx.u("/apps/shop/settings/environments"))
diff --git a/internal/console/fleetsecrets_mint_test.go b/internal/console/fleetsecrets_mint_test.go
index f2917fafa..65e127a72 100644
--- a/internal/console/fleetsecrets_mint_test.go
+++ b/internal/console/fleetsecrets_mint_test.go
@@ -48,8 +48,6 @@ func fcmFleetShop(t *testing.T, code string, withKey bool) *fcmWorld {
skRegister(t, fx, token, "home", k)
}
fskPlaceShop(t, fx, token, "home")
- appconfig.SetBoundSealing(false)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
return &fcmWorld{fx: fx, token: token, fleet: k, depPriv: dep.priv}
}
@@ -378,8 +376,7 @@ func TestTeamEnvironmentCreateOnFleetDoesNotDeadlock(t *testing.T) {
}
// consoleTestSealer is the sealer a test hands a walk or a delivery helper
-// directly: pub for acct/app, bound as the deployment switch says, which
-// is what those took before they took a sealer.
+// directly: pub for acct/app, bound as every sealer is.
func consoleTestSealer(pub *ecdh.PublicKey, acct, app string) appconfig.Sealer {
- return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, appconfig.BoundSealing())
+ return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, true)
}
diff --git a/internal/console/fleetsecrets_relay_test.go b/internal/console/fleetsecrets_relay_test.go
index fbe67f6c1..287dc202f 100644
--- a/internal/console/fleetsecrets_relay_test.go
+++ b/internal/console/fleetsecrets_relay_test.go
@@ -303,8 +303,6 @@ func fsrLegacyShop(t *testing.T, code string, withKey bool) (*fcmWorld, *objstor
if _, err := fx.st.CreateAppIn(OpsAccountID, "shop", "paul@keymail.dev", time.Now()); err != nil {
t.Fatal(err)
}
- appconfig.SetBoundSealing(false)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
w := &fcmWorld{fx: fx, token: token, fleet: k, depPriv: dep.priv}
fake := w.armStore(t, "shop")
if status, out := postJSON(t, storeURL(fx, "shop")+"/grant", map[string]any{}, token); status != http.StatusOK {
@@ -606,8 +604,6 @@ func fsrRelayPlatformShop(t *testing.T, code string, withKey bool) *fcmWorld {
if _, err := fx.st.CreateAppIn(OpsAccountID, "shop", "paul@keymail.dev", time.Now()); err != nil {
t.Fatal(err)
}
- appconfig.SetBoundSealing(false)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
fx.srv.cfg.RelayRegions = []string{"eu-west-1"}
fx.srv.cfg.PlatformDomain = "oncarlos.com"
t.Setenv(relayMastersEnv("eu-west-1"), "k1:"+relayTestMaster(1))
diff --git a/internal/console/hunt_h3m3_test.go b/internal/console/hunt_h3m3_test.go
new file mode 100644
index 000000000..cb7fba934
--- /dev/null
+++ b/internal/console/hunt_h3m3_test.go
@@ -0,0 +1,78 @@
+package console
+
+import (
+ "context"
+ "encoding/json"
+ "net/http"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/appconfig"
+)
+
+// hunt H3-M3 at the console's config doors. A v1 envelope already stored in
+// shop's config (written before every seal was v2) opens under any binding.
+// Someone who can read the bucket copies it into an app they can write
+// (blog): the JSON door the CLI uses, and writeConfig, the settings form's
+// door, both refuse it by name before anything is stored. Sent back
+// unchanged into its own slot it is accepted, so a client that round-trips
+// a stored value loses nothing.
+//
+// Mutation-mindedness: drop checkUnboundSets from appconfig's write and
+// both copies are stored (the JSON door answers 200).
+func TestHunt_H3_M3_ConfigDoorsRefuseACopiedV1Envelope(t *testing.T) {
+ fx, token, _ := fskFixture(t, "code-h3m3-door")
+ for _, app := range []string{"shop", "blog"} {
+ if _, err := fx.st.CreateAppIn(OpsAccountID, app, "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ }
+ depPub, depFP := mustTestSecretsKey()
+ pub, err := appconfig.ParsePublicKey(depPub, "test")
+ if err != nil {
+ t.Fatal(err)
+ }
+ legacy, err := appconfig.SealUnbound(pub, []byte("shop-live-key"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ body, err := json.Marshal(appconfig.Manifest{Schema: 1, App: "shop", Vars: map[string]appconfig.Var{
+ "STRIPE_KEY": {Kind: "secret", Envelope: legacy, SealedTo: depFP},
+ }})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err := fx.rel.Put(context.Background(), appconfig.Key(fx.sqid, "shop"), body, ""); err != nil {
+ t.Fatal(err)
+ }
+
+ secret := map[string]string{"kind": "secret", "envelope": legacy, "sealed_to": depFP}
+ status, out := putJSON(t, configURL(fx, "blog"), map[string]any{"set": map[string]any{"LOOT": secret}}, token)
+ want := "LOOT was sealed in an older format that blog's boxes do not accept. upgrade the carlos CLI and set LOOT again"
+ if status != http.StatusBadRequest || out["error"] != want {
+ t.Fatalf("JSON door copy into blog = %d %v, want 400 %q", status, out, want)
+ }
+ acct, err := fx.st.AccountBySqid(fx.sqid)
+ if err != nil || acct == nil {
+ t.Fatalf("account: %v %v", acct, err)
+ }
+ _, ref := fx.srv.writeConfig(context.Background(), acct, "blog", "staging", nil,
+ map[string]configVarIn{"LOOT": {Kind: "secret", Envelope: legacy, SealedTo: depFP}}, nil)
+ if ref == nil || ref.Code != configRefusalSealedOld || ref.Var != "LOOT" {
+ t.Fatalf("form door copy into blog staging = %+v, want sealed-old for LOOT", ref)
+ }
+ if m, err := appconfig.Get(context.Background(), fx.rel, fx.sqid, "blog"); err != nil || len(m.Vars) != 0 {
+ t.Fatalf("blog's config after the refusals = %+v, %v; want nothing stored", m, err)
+ }
+ if _, _, found, err := appconfig.GetEnvironment(context.Background(), fx.rel, fx.sqid, "blog", "staging"); err != nil || found {
+ t.Fatalf("blog staging after the refusal: found %v, %v; want no bundle", found, err)
+ }
+
+ status, out = putJSON(t, configURL(fx, "shop"), map[string]any{"set": map[string]any{"STRIPE_KEY": secret}}, token)
+ if status != http.StatusOK {
+ t.Fatalf("unchanged in its own slot = %d %v, want 200", status, out)
+ }
+ if got := skStored(t, fx).Vars["STRIPE_KEY"].Envelope; got != legacy {
+ t.Fatal("shop's legacy envelope changed")
+ }
+}
diff --git a/internal/console/sealkey.go b/internal/console/sealkey.go
index e7ec9f29b..78b9d8f02 100644
--- a/internal/console/sealkey.go
+++ b/internal/console/sealkey.go
@@ -132,7 +132,7 @@ func (s *Server) chooseSealKey(ctx context.Context, acctSqid, app string) (sealC
if err != nil {
return sealChoice{}, err
}
- return sealChoice{sqid: acct.Sqid, pub: pub, bound: appconfig.BoundSealing()}, nil
+ return sealChoice{sqid: acct.Sqid, pub: pub, bound: true}, nil
}
if row.SecretsPub == "" {
return sealChoice{}, errFleetNoSecretsKey{Fleet: name}
@@ -146,7 +146,7 @@ func (s *Server) chooseSealKey(ctx context.Context, acctSqid, app string) (sealC
// not written by it, and its key is not the one registered.
return sealChoice{}, fmt.Errorf("console: seal key: fleet %s's key is %s but its row records %s", name, fp, row.SecretsKeyFP)
}
- // Fleet-key envelopes are always v2, whatever the deployment switch says.
+ // Envelopes are always v2, fleet key or deployment key (hunt H3-M3).
return sealChoice{sqid: acct.Sqid, pub: pub, bound: true, fleet: name}, nil
}
diff --git a/internal/console/sealkey_test.go b/internal/console/sealkey_test.go
index 4242a430d..5ba75840e 100644
--- a/internal/console/sealkey_test.go
+++ b/internal/console/sealkey_test.go
@@ -107,8 +107,6 @@ func skStored(t *testing.T, fx *consoleFixture) *appconfig.Manifest {
func TestSealKeyForFleetApp(t *testing.T) {
fx, _, k := skFleetShop(t, "code-sk-fleet", true)
- appconfig.SetBoundSealing(false)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
sl, err := fx.srv.sealKeyFor(context.Background(), fx.sqid, "shop")
if err != nil {
@@ -117,9 +115,8 @@ func TestSealKeyForFleetApp(t *testing.T) {
if sl.Fingerprint() != k.fp || sl.PublicKeyB64() != k.pub {
t.Fatalf("sealer key = %s, want home's %s", sl.Fingerprint(), k.fp)
}
- // Fleet-key envelopes are always v2, whatever the deployment switch says.
if !sl.Bound() {
- t.Fatal("a fleet sealer is unbound with the deployment switch off")
+ t.Fatal("a fleet sealer is unbound")
}
b := appconfig.Binding{Account: fx.sqid, App: "shop"}
if sl.Binding() != b {
@@ -144,19 +141,16 @@ func TestSealKeyForPlatformApp(t *testing.T) {
t.Fatal(err)
}
depPub, depFP := mustTestSecretsKey()
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
- for _, on := range []bool{false, true} {
- appconfig.SetBoundSealing(on)
- sl, err := fx.srv.sealKeyFor(context.Background(), fx.sqid, "shop")
- if err != nil {
- t.Fatalf("switch %v: sealKeyFor = %v", on, err)
- }
- if sl.Fingerprint() != depFP || sl.PublicKeyB64() != depPub {
- t.Fatalf("switch %v: sealer = %s, want the deployment key %s", on, sl.Fingerprint(), depFP)
- }
- if sl.Bound() != on {
- t.Fatalf("switch %v: Bound = %v, want the deployment switch", on, sl.Bound())
- }
+ sl, err := fx.srv.sealKeyFor(context.Background(), fx.sqid, "shop")
+ if err != nil {
+ t.Fatalf("sealKeyFor = %v", err)
+ }
+ if sl.Fingerprint() != depFP || sl.PublicKeyB64() != depPub {
+ t.Fatalf("sealer = %s, want the deployment key %s", sl.Fingerprint(), depFP)
+ }
+ // Bound, as every sealer is (hunt H3-M3).
+ if !sl.Bound() {
+ t.Fatal("the deployment sealer is unbound")
}
// Today's refusals: no deployment key, and one that does not parse.
@@ -249,8 +243,6 @@ func TestSealKeyForOtherAccountsFleetRefuses(t *testing.T) {
func TestConfigGetServesTheFleetKey(t *testing.T) {
fx, token, k := skFleetShop(t, "code-sk-get", true)
- appconfig.SetBoundSealing(false)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
status, out := getJSON(t, configURL(fx, "shop"), token)
if status != http.StatusOK {
@@ -261,7 +253,7 @@ func TestConfigGetServesTheFleetKey(t *testing.T) {
}
// Always for a fleet app: its envelopes are always v2.
if out["secrets_account"] != fx.sqid {
- t.Fatalf("secrets_account = %v, want %s with the switch off", out["secrets_account"], fx.sqid)
+ t.Fatalf("secrets_account = %v, want %s", out["secrets_account"], fx.sqid)
}
if _, ok := out["secrets_keyless_fleet"]; ok {
t.Fatalf("secrets_keyless_fleet = %v on a fleet with a key", out["secrets_keyless_fleet"])
@@ -273,15 +265,14 @@ func TestConfigGetServesTheFleetKey(t *testing.T) {
if status != http.StatusOK || out["secrets_pubkey"] != depPub {
t.Fatalf("platform GET = %d %v, want the deployment key", status, out)
}
- if _, ok := out["secrets_account"]; ok {
- t.Fatalf("platform secrets_account = %v with the switch off", out["secrets_account"])
+ // Named for a platform app too: every seal is v2 (hunt H3-M3).
+ if out["secrets_account"] != fx.sqid {
+ t.Fatalf("platform secrets_account = %v, want %s", out["secrets_account"], fx.sqid)
}
}
func TestConfigGetOmitsKeyOnKeylessFleet(t *testing.T) {
fx, token, _ := skFleetShop(t, "code-sk-get-keyless", false)
- appconfig.SetBoundSealing(true)
- t.Cleanup(func() { appconfig.SetBoundSealing(false) })
if err := appconfig.SetEnv(context.Background(), fx.rel, fx.sqid, "shop", map[string]string{"PORT": "8080"}); err != nil {
t.Fatal(err)
}
@@ -378,11 +369,11 @@ func TestConfigPutAcceptsOldCLIOnPlatformApp(t *testing.T) {
depPub, depFP := mustTestSecretsKey()
// An older CLI: no sealed_to. Accepted, and stored without one.
- if status, out := skPutSecret(t, fx, token, "OLD", skSeal(t, fx, depPub, false), ""); status != http.StatusOK {
+ if status, out := skPutSecret(t, fx, token, "OLD", skSeal(t, fx, depPub, true), ""); status != http.StatusOK {
t.Fatalf("old CLI PUT = %d %v", status, out)
}
// This CLI: sealed_to the deployment key. Accepted and kept.
- if status, out := skPutSecret(t, fx, token, "NEW", skSeal(t, fx, depPub, false), depFP); status != http.StatusOK {
+ if status, out := skPutSecret(t, fx, token, "NEW", skSeal(t, fx, depPub, true), depFP); status != http.StatusOK {
t.Fatalf("new CLI PUT = %d %v", status, out)
}
m := skStored(t, fx)
@@ -391,7 +382,7 @@ func TestConfigPutAcceptsOldCLIOnPlatformApp(t *testing.T) {
}
// Present and not the deployment key: refused.
other := skNewKey(t)
- status, out := skPutSecret(t, fx, token, "WRONG", skSeal(t, fx, other.pub, false), other.fp)
+ status, out := skPutSecret(t, fx, token, "WRONG", skSeal(t, fx, other.pub, true), other.fp)
want := "WRONG was sealed to a key that this app's boxes do not hold. unset CARLOS_SECRETS_PUBKEY in your terminal and set WRONG again"
if status != http.StatusBadRequest || out["error"] != want {
t.Fatalf("PUT = %d %v, want 400 %q", status, out, want)
@@ -403,7 +394,7 @@ func TestConfigPutAcceptsOldCLIOnPlatformApp(t *testing.T) {
// A console with no deployment key has nothing to compare: accepted, as
// today (the terminal's own key is the only one there is).
fx.srv.cfg.SecretsPub = ""
- if status, out := skPutSecret(t, fx, token, "TERMINAL", skSeal(t, fx, other.pub, false), other.fp); status != http.StatusOK {
+ if status, out := skPutSecret(t, fx, token, "TERMINAL", skSeal(t, fx, other.pub, true), other.fp); status != http.StatusOK {
t.Fatalf("no deployment key PUT = %d %v", status, out)
}
}
diff --git a/internal/host/replicahomekeys_test.go b/internal/host/replicahomekeys_test.go
index 68873fa21..5d24835e7 100644
--- a/internal/host/replicahomekeys_test.go
+++ b/internal/host/replicahomekeys_test.go
@@ -123,7 +123,7 @@ func TestConfiguredKeyReadsTheBucketNow(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- envelope, err := appconfig.SealUnbound(pub, []byte("x"))
+ envelope, err := appconfig.SealBound(pub, appconfig.Binding{Account: "acct", App: "shop"}, []byte("x"))
if err != nil {
t.Fatal(err)
}
diff --git a/internal/mail/sealer_helper_test.go b/internal/mail/sealer_helper_test.go
index 5b26b2099..3eef1e00c 100644
--- a/internal/mail/sealer_helper_test.go
+++ b/internal/mail/sealer_helper_test.go
@@ -10,5 +10,5 @@ import (
// 6): pub for acct/app, bound or not as the deployment switch says, which is
// what appconfig.Seal chose before the walks took a sealer.
func mailTestSealer(pub *ecdh.PublicKey, acct, app string) appconfig.Sealer {
- return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, appconfig.BoundSealing())
+ return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, true)
}
diff --git a/internal/moves/archive/seal.go b/internal/moves/archive/seal.go
index a4a2c5c92..e7f5372a3 100644
--- a/internal/moves/archive/seal.go
+++ b/internal/moves/archive/seal.go
@@ -47,9 +47,8 @@ func nonceFor(index uint64, last bool) ([]byte, []byte) {
// Seal encrypts plain into w under a fresh 256-bit data key and returns
// the data key sealed with appconfig.SealBound (a v2 envelope bound to b,
// with its own fresh ephemeral key and nonce) and the sha256 of what it
-// wrote. Never deterministic. SealBound, not appconfig.Seal: Seal writes
-// unbound v1 envelopes unless the process turned bound sealing on, and the
-// host agent never does (F4).
+// wrote. Never deterministic. SealBound by name (F4): when this was written
+// appconfig.Seal still wrote unbound v1 envelopes by default.
func Seal(plain io.Reader, pub *ecdh.PublicKey, b appconfig.Binding, w io.Writer) (sealedDataKey, sealedSHA string, err error) {
key := make([]byte, 32)
if _, err := rand.Read(key); err != nil {
diff --git a/internal/objstore/walk_test.go b/internal/objstore/walk_test.go
index f05c7265f..8a1a11a8a 100644
--- a/internal/objstore/walk_test.go
+++ b/internal/objstore/walk_test.go
@@ -38,7 +38,7 @@ func testSealKeypair(t *testing.T) (*ecdh.PrivateKey, *ecdh.PublicKey) {
// 6): pub for acct/app, bound or not as the deployment switch says, which is
// what appconfig.Seal chose before the walks took a sealer.
func storeTestSealer(pub *ecdh.PublicKey, acct, app string) appconfig.Sealer {
- return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, appconfig.BoundSealing())
+ return appconfig.NewSealer(pub, appconfig.Binding{Account: acct, App: app}, true)
}
// failingStore fails the FIRST Put to failKeyOnce, then behaves normally —
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 6e51bfc67..9160fce0d 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -312,3 +312,4 @@ plan14-root-reads-moved-at-floor-v0-44-1.tsv ed1957bc7d18714e39984e757b73b8c590f
plan14-root-reads-gvisor-slice2-explicit-mode.tsv ed1957bc7d18714e39984e757b73b8c590f1a2a924ca35e20e9041fc09f2ca78
plan14-root-reads-public-share.tsv ed1957bc7d18714e39984e757b73b8c590f1a2a924ca35e20e9041fc09f2ca78
plan14-root-reads-gvisor-slice3-containment.tsv 0fdff597ef83fb9966e07c70b4283001eb97f7dfa71a83a19bde92382192eb6b
+plan14-root-reads-sec-h3-m3-envelope.tsv 0fdff597ef83fb9966e07c70b4283001eb97f7dfa71a83a19bde92382192eb6b
diff --git a/internal/provision/testdata/plan14-root-reads-sec-h3-m3-envelope.tsv b/internal/provision/testdata/plan14-root-reads-sec-h3-m3-envelope.tsv
new file mode 100644
index 000000000..e024b4cbe
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-sec-h3-m3-envelope.tsv
@@ -0,0 +1,5 @@
+# Census overlay sec-h3-m3-envelope, written by census-propose (#369). census-ruling-sec-h3-m3-envelope, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-sec-h3-m3-envelope.md.
+# 0 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@coverage . 0791f4feaebe313bfebefba2077a8cd7b340624722d9435b9b3fcca1038c0954
+@coverage internal/appconfig ba2e0817fc5ba542139f3b24a684dc83488b6a1a489d86d282eece9d8d5f6a4e
+@coverage internal/moves/archive e457ed3b644ef8d821e0ad3c739a52febe8cf1c504e1d56c2a186bec40c379ee