release: a scoped key signs for its grant's account only (H3-M2)
Fixes hunt finding H3-M2: a scoped release key could sign channel pointers and promotion records for any account. Key grants now name one account; signers refuse another account before any write; boxes refuse heads signed for another account or under an unbound grant; the digests REPAIR listing names every record a box refuses across all accounts. The lapsed-grant half stays open (notes/2026-11-29-scoped-key-expiry.md). Review: Astra + Fable R1-R2, both READY AFTER FIXES, fixes applied; census APPROVE (H3M2-R2-astra, H3M2-R2census-astra); copy pass applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from sec-h3-m2-scoped-key into main.
36 files changed,
+1,837
−140
apimode.go+0 −9channels_digests.go+177 −37channels_digests_test.go+178 −2cli.go+16 −8docs/site/cli.md+4 −3docs/superpowers/notes/2026-11-29-scoped-key-expiry.md+110 −0docs/superpowers/notes/2026-11-30-scoped-key-account-rollout.md+196 −0docs/superpowers/notes/census-proposal-sec-h3-m2-scoped-key.md+19 −0internal/console/apicli.go+2 −2internal/console/apidigests.go+52 −11internal/console/apidigests_test.go+134 −0internal/console/deployscope.go+6 −5internal/console/deploysign_test.go+6 −1internal/dbreads/envelope_test.go+1 −1internal/provision/plan9_b8_census_test.go+1 −1internal/provision/sec_h3_m2_scoped_key_census_test.go+43 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-sec-h3-m2-scoped-key.tsv+6 −0internal/release/authorize_record_test.go+1 −1internal/release/digestmarker_test.go+1 −1internal/release/digests.go+103 −5internal/release/grant.go+71 −3internal/release/grant_test.go+29 −21internal/release/hunt_H3-M2_test.go+116 −0internal/release/production_test.go+1 −1internal/release/promotion.go+9 −3internal/release/promotion_test.go+1 −1internal/release/release.go+23 −7internal/release/release_test.go+1 −1internal/release/resign.go+12 −2internal/release/scopedaccount_test.go+475 −0internal/release/scopedverify_test.go+1 −0internal/release/signer.go+10 −5internal/release/writers_test.go+1 −1scopedkeys_e2e_test.go+25 −3testdata/clireg-golden.jsonl+5 −5
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-7PliKp
.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/smithy-go v1.28.1
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading golang.org/x/net v0.62.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
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/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/pierrec/lz4/v4 v4.1.22
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pion/dtls/v3 v3.1.4
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 github.com/pion/randutil v0.1.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/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/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/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== vet-tags (194 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 modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (381 s, from +15 s)
ok github.com/carlosframework/platform/cmd/carlos-media 124.779s
? github.com/carlosframework/platform/cmd/changelog [no test files]
ok github.com/carlosframework/platform/cmd/console 215.211s
ok github.com/carlosframework/platform/cmd/mediaimage 44.802s
ok github.com/carlosframework/platform/cmd/moveprobe 15.806s
ok github.com/carlosframework/platform/cmd/pricebook-export 0.057s
ok github.com/carlosframework/platform/cmd/rootfswitness 0.173s
ok github.com/carlosframework/platform/cmd/runsc-assets 0.110s
ok github.com/carlosframework/platform/cmd/zddprobe 0.966s
ok github.com/carlosframework/platform/internal/agentsock 0.072s
ok github.com/carlosframework/platform/internal/alerting 0.040s
ok github.com/carlosframework/platform/internal/analytics 0.310s
ok github.com/carlosframework/platform/internal/appconfig 44.229s
ok github.com/carlosframework/platform/internal/apperr 0.390s
ok github.com/carlosframework/platform/internal/applog 3.085s
ok github.com/carlosframework/platform/internal/apppolicy 2.759s
ok github.com/carlosframework/platform/internal/assetcache 0.979s
ok github.com/carlosframework/platform/internal/awsinv 0.017s
ok github.com/carlosframework/platform/internal/awsmanaged 5.773s
ok github.com/carlosframework/platform/internal/awsregiongroup 0.302s
ok github.com/carlosframework/platform/internal/awsterminations 0.048s
ok github.com/carlosframework/platform/internal/backupswords 0.011s
ok github.com/carlosframework/platform/internal/billing 0.086s
ok github.com/carlosframework/platform/internal/billing/billingtest 0.046s
ok github.com/carlosframework/platform/internal/billingstripe 1.746s
ok github.com/carlosframework/platform/internal/boxchoice 0.019s
ok github.com/carlosframework/platform/internal/boxid 2.834s
? github.com/carlosframework/platform/internal/boxid/boxidtest [no test files]
? github.com/carlosframework/platform/internal/boxid/internal/signtest [no test files]
ok github.com/carlosframework/platform/internal/boxroles 0.010s
ok github.com/carlosframework/platform/internal/boxself 0.204s
ok github.com/carlosframework/platform/internal/boxvolumes 0.057s
ok github.com/carlosframework/platform/internal/caps 4.784s
ok github.com/carlosframework/platform/internal/certwarm 0.010s
ok github.com/carlosframework/platform/internal/cgroup 1.472s
ok github.com/carlosframework/platform/internal/changelog 5.494s
ok github.com/carlosframework/platform/internal/clamd 0.061s
? github.com/carlosframework/platform/internal/cliflag [no test files]
ok github.com/carlosframework/platform/internal/clireg 0.006s
ok github.com/carlosframework/platform/internal/codehealth 17.749s
ok github.com/carlosframework/platform/internal/compute 0.021s
ok github.com/carlosframework/platform/internal/consolefleet 0.013s
? 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.458s
ok github.com/carlosframework/platform/internal/dbdoor/dbdoortest 0.040s
ok github.com/carlosframework/platform/internal/dbquery 0.019s
ok github.com/carlosframework/platform/internal/dbreads 3.091s
? github.com/carlosframework/platform/internal/dbreads/dbreadstest [no test files]
ok github.com/carlosframework/platform/internal/dbverify 0.017s
ok github.com/carlosframework/platform/internal/demo 0.014s
ok github.com/carlosframework/platform/internal/demobuild 5.054s
ok github.com/carlosframework/platform/internal/democlaim 0.401s
ok github.com/carlosframework/platform/internal/devbox 19.203s
ok github.com/carlosframework/platform/internal/dnsrec 0.009s
ok github.com/carlosframework/platform/internal/docsite 0.141s
ok github.com/carlosframework/platform/internal/domainreg 0.016s
ok github.com/carlosframework/platform/internal/domains 72.944s
ok github.com/carlosframework/platform/internal/doorkey 0.027s
ok github.com/carlosframework/platform/internal/economics 0.015s
ok github.com/carlosframework/platform/internal/edgefence 0.090s
ok github.com/carlosframework/platform/internal/edgeguard 0.290s
? github.com/carlosframework/platform/internal/edgeproof [no test files]
ok github.com/carlosframework/platform/internal/edgesfile 0.085s
ok github.com/carlosframework/platform/internal/egressaddr 0.004s
ok github.com/carlosframework/platform/internal/execsandbox 108.660s
ok github.com/carlosframework/platform/internal/fileacl 0.013s
ok github.com/carlosframework/platform/internal/fleetapi 3.195s
ok github.com/carlosframework/platform/internal/fleetstore 0.012s
ok github.com/carlosframework/platform/internal/fxrate 0.036s
ok github.com/carlosframework/platform/internal/gate 5.206s
ok github.com/carlosframework/platform/internal/genselect 0.101s
ok github.com/carlosframework/platform/internal/geo 0.055s
ok github.com/carlosframework/platform/internal/geoip 0.159s
ok github.com/carlosframework/platform/internal/groupadmission 0.006s
ok github.com/carlosframework/platform/internal/grouprollaws 17.234s
ok github.com/carlosframework/platform/internal/hadeparture 0.014s
ok github.com/carlosframework/platform/internal/hafresh 0.014s
ok github.com/carlosframework/platform/internal/hairpin 0.162s
ok github.com/carlosframework/platform/internal/historyreadback 1.306s
ok github.com/carlosframework/platform/internal/hostactors 24.367s
ok github.com/carlosframework/platform/internal/hostbox 22.932s
ok github.com/carlosframework/platform/internal/hostclaim 2.412s
ok github.com/carlosframework/platform/internal/hostenv 0.080s
ok github.com/carlosframework/platform/internal/hostevidence 0.017s
ok github.com/carlosframework/platform/internal/hostexec 27.402s
ok github.com/carlosframework/platform/internal/hostfence 0.100s
ok github.com/carlosframework/platform/internal/hostfiles 28.998s
ok github.com/carlosframework/platform/internal/hostfloor 0.818s
ok github.com/carlosframework/platform/internal/hostguard 1.467s
ok github.com/carlosframework/platform/internal/hostops 9.937s
? github.com/carlosframework/platform/internal/hostops/fencerelease [no test files]
ok github.com/carlosframework/platform/internal/hostops/internal/fencerelease 0.008s
ok github.com/carlosframework/platform/internal/hostquarantine 0.008s
ok github.com/carlosframework/platform/internal/hostrelocate 1.850s
ok github.com/carlosframework/platform/internal/hostresolve 0.804s
ok github.com/carlosframework/platform/internal/hostwrite 0.008s
ok github.com/carlosframework/platform/internal/infraview 0.022s
ok github.com/carlosframework/platform/internal/ingresshealth 0.010s
ok github.com/carlosframework/platform/internal/ingresshealth/awstg 0.013s
ok github.com/carlosframework/platform/internal/instancectl 67.017s
ok github.com/carlosframework/platform/internal/instanceexec 10.092s
ok github.com/carlosframework/platform/internal/instancefs 18.203s
ok github.com/carlosframework/platform/internal/instancekey 0.009s
ok github.com/carlosframework/platform/internal/instanceupdates 0.022s
ok github.com/carlosframework/platform/internal/interactive 0.702s
ok github.com/carlosframework/platform/internal/launchd 0.008s
ok github.com/carlosframework/platform/internal/layout 25.776s
ok github.com/carlosframework/platform/internal/layout/pubclass 105.249s
ok github.com/carlosframework/platform/internal/lbhealth 0.009s
ok github.com/carlosframework/platform/internal/lease 146.514s
ok github.com/carlosframework/platform/internal/lease/leasetest 1.789s
ok github.com/carlosframework/platform/internal/lease/locktest 0.022s
ok github.com/carlosframework/platform/internal/ledger 0.115s
ok github.com/carlosframework/platform/internal/mail 1.065s
ok github.com/carlosframework/platform/internal/mailer 0.835s
ok github.com/carlosframework/platform/internal/mailsubmit 1.259s
ok github.com/carlosframework/platform/internal/mailwire 0.019s
ok github.com/carlosframework/platform/internal/maintenance 0.195s
ok github.com/carlosframework/platform/internal/maintenanceexec 7.823s
ok github.com/carlosframework/platform/internal/maintenanceguard 0.321s
ok github.com/carlosframework/platform/internal/managedboot 4.386s
? 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 2.453s
ok github.com/carlosframework/platform/internal/media/mediatest 0.010s
ok github.com/carlosframework/platform/internal/mediaaws 63.256s
ok github.com/carlosframework/platform/internal/mediahandler 44.756s
ok github.com/carlosframework/platform/internal/mediajobs 1.191s
ok github.com/carlosframework/platform/internal/medialocal 10.152s
ok github.com/carlosframework/platform/internal/metrics 0.126s
ok github.com/carlosframework/platform/internal/minorunits 0.007s
ok github.com/carlosframework/platform/internal/moves 55.724s
ok github.com/carlosframework/platform/internal/moves/archive 3.337s
ok github.com/carlosframework/platform/internal/moves/offlinerun 0.137s
ok github.com/carlosframework/platform/internal/namedunits 0.041s
ok github.com/carlosframework/platform/internal/objstore 3.444s
ok github.com/carlosframework/platform/internal/ops 16.247s
ok github.com/carlosframework/platform/internal/pageindex 3.955s
ok github.com/carlosframework/platform/internal/parity 0.162s
? github.com/carlosframework/platform/internal/parity/cmd/parity-doc [no test files]
ok github.com/carlosframework/platform/internal/park 0.819s
ok github.com/carlosframework/platform/internal/perf 0.199s
ok github.com/carlosframework/platform/internal/plans 0.177s
ok github.com/carlosframework/platform/internal/privatefile 0.015s
ok github.com/carlosframework/platform/internal/provision 237.913s
ok github.com/carlosframework/platform/internal/proxyproto 0.965s
ok github.com/carlosframework/platform/internal/publicrelease 0.078s
ok github.com/carlosframework/platform/internal/ratelimit 0.244s
ok github.com/carlosframework/platform/internal/regionlabel 0.133s
ok github.com/carlosframework/platform/internal/regionname 0.056s
ok github.com/carlosframework/platform/internal/registrar 0.009s
ok github.com/carlosframework/platform/internal/registrar/openprovider 0.604s
? github.com/carlosframework/platform/internal/registrar/registrartest [no test files]
ok github.com/carlosframework/platform/internal/registry 85.775s
ok github.com/carlosframework/platform/internal/relay 7.551s
ok github.com/carlosframework/platform/internal/release 132.902s
? github.com/carlosframework/platform/internal/release/requestwitness [no test files]
ok github.com/carlosframework/platform/internal/replicagen 0.052s
ok github.com/carlosframework/platform/internal/replicas 0.082s
ok github.com/carlosframework/platform/internal/reqrec 9.044s
ok github.com/carlosframework/platform/internal/rollout 11.928s
ok github.com/carlosframework/platform/internal/rolloutwords 0.021s
ok github.com/carlosframework/platform/internal/rootaws 105.071s
ok github.com/carlosframework/platform/internal/rootfsimage 0.801s
ok github.com/carlosframework/platform/internal/rootparticipation 0.097s
ok github.com/carlosframework/platform/internal/rootstate 0.043s
ok github.com/carlosframework/platform/internal/runs 0.828s
ok github.com/carlosframework/platform/internal/s3compat 0.022s
ok github.com/carlosframework/platform/internal/s3fake 1.220s
ok github.com/carlosframework/platform/internal/s3meter 0.421s
ok github.com/carlosframework/platform/internal/safefile 0.048s
ok github.com/carlosframework/platform/internal/schedule 23.253s
ok github.com/carlosframework/platform/internal/seeds 0.122s
ok github.com/carlosframework/platform/internal/share 0.050s
ok github.com/carlosframework/platform/internal/sim/litestreamfacts 5.470s
ok github.com/carlosframework/platform/internal/sim/mediajobs 52.378s
ok github.com/carlosframework/platform/internal/sim/regionha 22.470s
ok github.com/carlosframework/platform/internal/status 0.390s
ok github.com/carlosframework/platform/internal/steering 0.259s
ok github.com/carlosframework/platform/internal/stopevidence 0.284s
ok github.com/carlosframework/platform/internal/storecfg 0.352s
ok github.com/carlosframework/platform/internal/svcrole 0.015s
ok github.com/carlosframework/platform/internal/systemd 6.638s
? github.com/carlosframework/platform/internal/systemdshow [no test files]
ok github.com/carlosframework/platform/internal/team 2.962s
ok github.com/carlosframework/platform/internal/teamcontract 0.251s
ok github.com/carlosframework/platform/internal/telemetry 0.017s
ok github.com/carlosframework/platform/internal/termfence 3.370s
ok github.com/carlosframework/platform/internal/timerspec 0.014s
ok github.com/carlosframework/platform/internal/tsidentity 4.152s
ok github.com/carlosframework/platform/internal/tunnelclient 0.449s
ok github.com/carlosframework/platform/internal/unixdial 0.012s
ok github.com/carlosframework/platform/internal/updatewords 0.021s
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.196s
ok github.com/carlosframework/platform/internal/version 0.005s
ok github.com/carlosframework/platform/internal/vet 3.043s
ok github.com/carlosframework/platform/internal/zonehost 0.020s
ok github.com/carlosframework/platform/internal/zonehost/route53zones 0.047s
? 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.031s
ok github.com/carlosframework/platform/scripts/pathmapcheck 0.089s
ok github.com/carlosframework/platform/scripts/region-ha-g2/fixture 5.292s
ok github.com/carlosframework/platform/scripts/stateless-replicas-drill 1.221s
ok github.com/carlosframework/platform/scripts/witness-pointer 0.042s
=== cutover-witness (160 s, from +15 s)
ok github.com/carlosframework/platform 2.623s
=== internal_grouproll@0 (276 s, from +73 s)
ok github.com/carlosframework/platform/internal/grouproll 275.228s
=== internal_grouproll@1 (275 s, from +73 s)
ok github.com/carlosframework/platform/internal/grouproll 274.405s
=== internal_activator@0 (155 s, from +142 s)
ok github.com/carlosframework/platform/internal/activator 150.607s
=== internal_activator@1 (138 s, from +142 s)
ok github.com/carlosframework/platform/internal/activator 133.968s
=== internal_activator@2 (138 s, from +142 s)
ok github.com/carlosframework/platform/internal/activator 134.939s
=== internal_activator@3 (173 s, from +142 s)
ok github.com/carlosframework/platform/internal/activator 169.084s
=== internal_edge@0 (196 s, from +174 s)
ok github.com/carlosframework/platform/internal/edge 186.371s
=== internal_edge@1 (144 s, from +174 s)
ok github.com/carlosframework/platform/internal/edge 133.762s
=== internal_edge@2 (147 s, from +174 s)
ok github.com/carlosframework/platform/internal/edge 136.618s
=== internal_edge@3 (216 s, from +174 s)
ok github.com/carlosframework/platform/internal/edge 205.831s
=== root@0 (114 s, from +181 s)
ok github.com/carlosframework/platform 105.247s
=== root@1 (104 s, from +181 s)
ok github.com/carlosframework/platform 95.898s
=== root@2 (150 s, from +181 s)
ok github.com/carlosframework/platform 139.691s
=== root@3 (112 s, from +181 s)
ok github.com/carlosframework/platform 103.585s
=== root@4 (98 s, from +181 s)
ok github.com/carlosframework/platform 89.741s
=== internal_host@0 (174 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 169.819s
=== internal_host@1 (158 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 153.462s
=== internal_host@2 (168 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 163.716s
=== internal_host@3 (194 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 189.692s
=== internal_host@4 (234 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 229.844s
=== internal_host@5 (272 s, from +218 s)
ok github.com/carlosframework/platform/internal/host 267.424s
=== internal_console@0 (173 s, from +223 s)
ok github.com/carlosframework/platform/internal/console 166.600s
=== internal_console@1 (174 s, from +223 s)
ok github.com/carlosframework/platform/internal/console 166.045s
=== internal_console@2 (207 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 201.109s
=== internal_console@3 (254 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 246.911s
=== internal_console@4 (209 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 202.401s
=== internal_console@5 (258 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 251.086s
=== internal_console@6 (224 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 217.936s
=== internal_console@7 (230 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 223.163s
=== internal_console@8 (238 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 231.838s
=== internal_console@9 (245 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 238.680s
=== internal_console@10 (273 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 266.726s
=== internal_console@11 (247 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 241.602s
=== internal_console@12 (343 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 336.477s
=== internal_console@13 (215 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 206.936s
=== internal_console@14 (223 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 216.053s
=== internal_console@15 (237 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 230.483s
=== internal_console@16 (216 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 209.432s
=== internal_console@17 (255 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 249.310s
=== internal_console@18 (262 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 255.172s
=== internal_console@19 (240 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 233.600s
=== internal_console@20 (206 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 198.505s
=== internal_console@21 (237 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 229.738s
=== internal_console@22 (235 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 228.949s
=== internal_console@23 (250 s, from +224 s)
ok github.com/carlosframework/platform/internal/console 242.639s
=== lists: internal_console 222 s, internal_edge 172 s, internal_activator 140 s, internal_host 216 s, root 180 s, internal_grouproll 72 s
=== cpu: the gate used 13012 cpu-seconds in 568 s, about 22.9 of 32 cores; the machine as a whole was 76% busy
=== opentofu ===
opentofu: 40 test files in 11 suites, OpenTofu v1.13.9
initialised in 14 s
ok 16 s infra/modules/box-fence-writer/tests/writer.tftest.hcl Success! 1 passed, 0 failed.
ok 20 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 20 s infra/modules/deployment-buckets/tests/db_reads.tftest.hcl Success! 1 passed, 0 failed.
ok 19 s infra/modules/deployment-buckets/tests/evidence.tftest.hcl Success! 1 passed, 0 failed.
ok 29 s infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl Success! 3 passed, 0 failed.
ok 27 s infra/modules/deployment-buckets/tests/media_results.tftest.hcl Success! 2 passed, 0 failed.
ok 28 s infra/modules/deployment-buckets/tests/published_floors.tftest.hcl Success! 3 passed, 0 failed.
ok 82 s infra/modules/media-engine/tests/media_engine.tftest.hcl Success! 24 passed, 0 failed.
ok 27 s infra/modules/pdf-host/tests/computed.tftest.hcl Success! 2 passed, 0 failed.
ok 56 s infra/modules/pdf-host/tests/pdf_host.tftest.hcl Success! 24 passed, 0 failed.
ok 40 s infra/modules/region-group-operator-document/tests/document.tftest.hcl Success! 12 passed, 0 failed.
ok 17 s infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl Success! 2 passed, 0 failed.
ok 64 s infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl Success! 30 passed, 0 failed.
ok 45 s infra/modules/region-host/tests/alert_publish.tftest.hcl Success! 18 passed, 0 failed.
ok 41 s infra/modules/region-host/tests/alerts_topic.tftest.hcl Success! 16 passed, 0 failed.
ok 11 s infra/modules/region-host/tests/analytics_prune.tftest.hcl Success! 2 passed, 0 failed.
ok 13 s infra/modules/region-host/tests/console_mail.tftest.hcl Success! 4 passed, 0 failed.
ok 6 s infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl Success! 1 passed, 0 failed.
ok 70 s infra/modules/region-host/tests/group.tftest.hcl Success! 32 passed, 0 failed.
ok 11 s infra/modules/region-host/tests/group_alarms.tftest.hcl Success! 4 passed, 0 failed.
ok 11 s infra/modules/region-host/tests/group_iam.tftest.hcl Success! 4 passed, 0 failed.
ok 6 s infra/modules/region-host/tests/group_isolation.tftest.hcl Success! 1 passed, 0 failed.
ok 35 s infra/modules/region-host/tests/group_operator.tftest.hcl Success! 13 passed, 0 failed.
ok 9 s infra/modules/region-host/tests/group_user_data.tftest.hcl Success! 3 passed, 0 failed.
ok 29 s infra/modules/region-host/tests/health_alarms.tftest.hcl Success! 10 passed, 0 failed.
ok 16 s infra/modules/region-host/tests/ingress_drain_read.tftest.hcl Success! 4 passed, 0 failed.
ok 6 s infra/modules/region-host/tests/instance_metadata.tftest.hcl Success! 1 passed, 0 failed.
ok 22 s infra/modules/region-host/tests/mailer.tftest.hcl Success! 6 passed, 0 failed.
ok 14 s infra/modules/region-host/tests/mailer_group.tftest.hcl Success! 2 passed, 0 failed.
ok 12 s infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl Success! 2 passed, 0 failed.
ok 102 s infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl Success! 46 passed, 0 failed.
ok 73 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 29 s infra/modules/region-host/tests/store_versioning.tftest.hcl Success! 11 passed, 0 failed.
ok 14 s infra/modules/region-host/tests/store_write_credentials.tftest.hcl Success! 4 passed, 0 failed.
ok 17 s infra/modules/region-host/tests/user_data_ignored.tftest.hcl Success! 3 passed, 0 failed.
ok 13 s infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl Success! 3 passed, 0 failed.
ok 13 s infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl Success! 5 passed, 0 failed.
ok 33 s infra/modules/scanner-host/tests/scanner_host.tftest.hcl Success! 14 passed, 0 failed.
opentofu: 40 files in 210 s
opentofu: PASS
=== cross ===
--- shard 0 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/arm64
--- shard 1 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/amd64
--- shard 2 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling linux/arm64
linux/arm64 carlos binary: 66781346 bytes (ceiling 70000000)
--- shard 3 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/amd64
--- shard 4 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling windows/arm64
=== minio-contract ===
go version go1.26.10 linux/arm64
minio contract: arm64, minio RELEASE.2025-09-07T16-13-09Z, mc RELEASE.2025-08-13T08-35-41Z
minio: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/minio.linux-arm64.RELEASE.2025-09-07T16-13-09Z
minio: downloaded, digest verified
mc: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/minio/mc.linux-arm64.RELEASE.2025-08-13T08-35-41Z
mc: downloaded, digest verified
minio healthy on 127.0.0.1:37905
Added `local` successfully.
Bucket created successfully `local/contract-bucket`.
Bucket created successfully `local/denied-bucket`.
Created policy `contract-only` successfully.
Added user `scopeduser` successfully.
Attached Policies: [contract-only]
To User: scopeduser
buckets and scoped user ready
=== RUN TestDeliveredContractMinio
=== RUN TestDeliveredContractMinio/put
=== RUN TestDeliveredContractMinio/get_round-trips_the_body
=== RUN TestDeliveredContractMinio/list_shows_the_key
=== RUN TestDeliveredContractMinio/head_and_list_agree_on_the_version
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_its_own_object
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict
=== RUN TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed
=== RUN TestDeliveredContractMinio/delete_removes_it
=== RUN TestDeliveredContractMinio/cross-bucket_denial
--- PASS: TestDeliveredContractMinio (0.03s)
--- PASS: TestDeliveredContractMinio/put (0.00s)
--- PASS: TestDeliveredContractMinio/get_round-trips_the_body (0.00s)
--- PASS: TestDeliveredContractMinio/list_shows_the_key (0.00s)
--- PASS: TestDeliveredContractMinio/head_and_list_agree_on_the_version (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route (0.02s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/delete_removes_it (0.00s)
--- PASS: TestDeliveredContractMinio/cross-bucket_denial (0.00s)
PASS
ok github.com/carlosframework/platform/internal/objstore 0.039s
=== RUN TestT4StorageProbeMinio
2026/11/30 21:57:52 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18ECF17D57BCD420, HostID: 42be3204202bb67336aea021e47f019fbb1b215a66d5028cdccdefb690c1983f, 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.044s
=== RUN TestS3StoreMinioContract
=== RUN TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.03s)
--- PASS: TestS3StoreMinioContract/conditional_get_and_etag_listing (0.01s)
--- PASS: TestS3StoreMinioContract/bump_through_every_mutation_path (0.02s)
PASS
ok github.com/carlosframework/platform/internal/release 0.043s
Bucket created successfully `local/analytics-versions`.
local/analytics-versions versioning is enabled
Created policy `analytics-versions` successfully.
Added user `analyticsversions` successfully.
Attached Policies: [analytics-versions]
To User: analyticsversions
=== RUN TestS3StoreMinioVersions
--- PASS: TestS3StoreMinioVersions (0.03s)
PASS
ok github.com/carlosframework/platform/internal/release 0.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:_bucket_settings
=== RUN TestWriteCredentialContractMinio/refused:_read_under_the_prefix
=== RUN TestWriteCredentialContractMinio/refused:_read_elsewhere
=== RUN TestWriteCredentialContractMinio/refused:_list
=== RUN TestWriteCredentialContractMinio/refused:_delete
=== RUN TestWriteCredentialContractMinio/refused:_tag
=== RUN TestWriteCredentialContractMinio/refused:_put_tagged
=== RUN TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag
=== RUN TestWriteCredentialContractMinio/refused:_put_outside_the_prefix
=== RUN TestWriteCredentialContractMinio/refused:_head
=== RUN TestWriteCredentialContractMinio/refused:_list_uploads
=== RUN TestWriteCredentialContractMinio/refused:_put_beside_the_prefix
=== RUN TestWriteCredentialContractMinio/refused:_put_to_another_bucket
=== RUN TestWriteCredentialContractMinio/refused:_copy_from_the_store
--- PASS: TestWriteCredentialContractMinio (0.04s)
--- PASS: TestWriteCredentialContractMinio/put_under_the_prefix (0.00s)
--- PASS: TestWriteCredentialContractMinio/multipart_under_the_prefix (0.01s)
--- PASS: TestWriteCredentialContractMinio/refused:_bucket_settings (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_read_under_the_prefix (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_read_elsewhere (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_list (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_delete (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_tag (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_put_tagged (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_put_with_a_platform_tag (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_put_outside_the_prefix (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_head (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_list_uploads (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_put_beside_the_prefix (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_put_to_another_bucket (0.00s)
--- PASS: TestWriteCredentialContractMinio/refused:_copy_from_the_store (0.00s)
PASS
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.46s)
--- PASS: TestEndToEndMinio/plan (0.01s)
--- PASS: TestEndToEndMinio/roll (0.12s)
--- PASS: TestEndToEndMinio/replace (0.15s)
--- PASS: TestEndToEndMinio/remove (0.15s)
PASS
ok github.com/carlosframework/platform/internal/grouproll 0.471s
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 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 21:58:00 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/30 21:58:00 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/30 21:58:00 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/30 21:58:00 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/30 21:58:00 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/30 21:58:00 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/30 21:58:00 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%3A35763: could not determine target mailbox
agent.go:136: dbreads: dbr_4ybdevg2764rwqimnyovzjsldm: planned 3 files (1544 bytes) and restored to 3 in 14ms
agent.go:136: dbreads: dbr_4ybdevg2764rwqimnyovzjsldm: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 21:58:01 console: db read dbr_4ybdevg2764rwqimnyovzjsldm: relayed 1 chunks (102 bytes) in 1.006s, ended done
agent.go:136: dbreads: dbr_xczw3swtabjnh4otdcykl725ey: planned 1 files (720 bytes) and restored to 1 in 12ms
agent.go:136: dbreads: dbr_xczw3swtabjnh4otdcykl725ey: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/30 21:58:02 console: db read dbr_xczw3swtabjnh4otdcykl725ey: relayed 1 chunks (102 bytes) in 1.005s, ended done
agent.go:136: dbreads: dbr_nhi2vshpx3ozvhquygrklj3foi: planned 3 files (1544 bytes) and held through 3 in 12ms
agent.go:136: dbreads: dbr_nhi2vshpx3ozvhquygrklj3foi: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/30 21:58:03 console: db read dbr_nhi2vshpx3ozvhquygrklj3foi: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN TestDBForwardMinio/by_disconnect
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_ksbq56khz57qvtdtm76bk7y6oa: planned 3 files (1544 bytes) and restored to 3 in 12ms
2026/11/30 21:58:04 console: db read dbr_ksbq56khz57qvtdtm76bk7y6oa: relayed 0 chunks (0 bytes) in 33ms, ended client gone
agent.go:136: dbreads: dbr_ksbq56khz57qvtdtm76bk7y6oa: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN TestDBForwardMinio/by_timeout
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_rq6imz6fblxzpgkgiip2q7p7em: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/30 21:58:24 console: db read dbr_rq6imz6fblxzpgkgiip2q7p7em: relayed 0 chunks (0 bytes) in 19.766s, ended no-result
agent.go:136: dbreads: dbr_rq6imz6fblxzpgkgiip2q7p7em: output 5 bytes in 1 confirmed chunks in 19.739s
--- PASS: TestDBForwardMinio (23.46s)
--- PASS: TestDBForwardMinio/by_disconnect (0.24s)
--- PASS: TestDBForwardMinio/by_timeout (19.88s)
PASS
ok github.com/carlosframework/platform/internal/console 23.510s
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.076s
Bucket created successfully `local/media-local-store`.
Bucket created successfully `local/media-local-results`.
Created policy `media-local` successfully.
Added user `medialocal` successfully.
Attached Policies: [media-local]
To User: medialocal
=== RUN TestLocalEndToEndMinio
--- PASS: TestLocalEndToEndMinio (0.57s)
PASS
ok github.com/carlosframework/platform/internal/medialocal 0.575s
=== RUN TestHeldHandoverTwoBoxMinio
2026/11/30 21:58:29 edge: mesh key: minted
2026/11/30 21:58:29 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 21:58:29 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 21:58:29 tenant admission is open. accepting tenant work
2026/11/30 21:58:29 activator: HA placement host=shop-60ebadea.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T21:58:29Z lock_generation=0
2026/11/30 21:58:29 lease: t8-60ebadea/shop-60ebadea.example.test: HA lease acquired in 4ms (first wake)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: started carlos-instance@shop\x2d60ebadea.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 21:58:29 activator: shop-60ebadea.example.test: carlos-instance@shop\x2d60ebadea.example.test.service launched in 7ms, healthy 0s later
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: woke in 67ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 54ms
2026/11/30 21:58:29 lease: t8-60ebadea/plain-60ebadea.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/30 21:58:29 activator: no replica for plain-60ebadea.example.test in s3://contract-bucket/t8-60ebadea/plain-60ebadea.example.test — booting fresh
2026/11/30 21:58:29 activator: plain-60ebadea.example.test: started carlos-instance@plain\x2d60ebadea.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 4ms, control socket 0s, key gate 0s, logs 0s) 5ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 21:58:29 activator: plain-60ebadea.example.test: carlos-instance@plain\x2d60ebadea.example.test.service launched in 6ms, healthy 0s later
2026/11/30 21:58:29 activator: plain-60ebadea.example.test: woke in 40ms: checks 0s, lease 2ms, restore 18ms, identity 0s, protect 0s, spawn 7ms, replicate 14ms
2026/11/30 21:58:29 lease: t8-60ebadea/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/30 21:58:29 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 21:58:29 activator: bot0.shop.bac.sidecar.internal: woke in 69ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 57ms
2026/11/30 21:58:29 activator: next-due probe plain-60ebadea.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 21:58:29 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:3ace46b7f3746ef08506b6e6da24b28073ac06818218dc8e0b7ea0084091a8ad) in 8ms: files 1ms, sync 4ms, record 1ms, marker 2ms
2026/11/30 21:58:29 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/30 21:58:29 activator: plain-60ebadea.example.test hibernated
2026/11/30 21:58:29 activator: next-due probe shop-60ebadea.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: released with a marker (clean true, txid 1, files 3:b582b6456df60824888623ca89455c6916ff4e793a722f010aca48956fc501d4) in 6ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/30 21:58:29 activator: shop-60ebadea.example.test hibernated
2026/11/30 21:58:29 lease: t8-60ebadea/shop-60ebadea.example.test: HA lease acquired in 3ms (clean marker)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: restored (other-box)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: started carlos-instance@shop\x2d60ebadea.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 0s, control socket 0s, key gate 0s, logs 0s) 1ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: carlos-instance@shop\x2d60ebadea.example.test.service launched in 2ms, healthy 0s later
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: woke in 40ms: checks 0s, lease 3ms, restore 26ms, identity 0s, protect 0s, spawn 2ms, replicate 8ms
2026/11/30 21:58:29 edge: ha-take shop-60ebadea.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/30 21:58:29 edge: forward shop-60ebadea.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:dd56fbfc7eb1f3e681c3b77cc63f2d11 Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-30 21:58:29.597767634 +0000 UTC FinishedAt:2026-11-30 21:58:29.695600754 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-60ebadea.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:} {Host:plain-60ebadea.example.test Kind:other Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:82 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-60ebadea.example.test <nil> releasing shop-60ebadea.example.test <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> stop plain-60ebadea.example.test marker=true clean=true <nil> stop shop-60ebadea.example.test marker=true clean=true <nil> taken shop-60ebadea.example.test betty <nil> end-moves]
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/bot0.shop.bac.sidecar.internal/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-60ebadea/plain-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/head.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/generations/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/files/0/manifest.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/files/0/objects/0000000000000001-6c02c4ee12eb8cdf76f8daf7b5a3497099d0e50d3700704bba1998d1ca903a11
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/files/0/objects/0000000000000003-7e8a7ca04505e94dd640b44de5459006a982a6d33e528753268a26dc3bdb3965
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/0000/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/0000/0000000000000002-0000000000000002.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-60ebadea/shop-60ebadea.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-60ebadea/shop-60ebadea.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1243: drain took 150ms; S3 calls 46 (DELETE lock=1 GET files=3 GET head=1 GET lock=3 GET replica=2 LIST replica=30 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 21:58:29 lease: t8-60ebadea/plain-60ebadea.example.test: acquired in 1ms (client 0s, lock read and write 1ms)
2026/11/30 21:58:29 activator: plain-60ebadea.example.test: started carlos-instance@plain\x2d60ebadea.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 21:58:29 activator: plain-60ebadea.example.test: carlos-instance@plain\x2d60ebadea.example.test.service launched in 1ms, healthy 0s later
2026/11/30 21:58:29 lease: /tmp/carlos-minio-contract-PKOm4l/g/dw3978537781/data/instances/plain-60ebadea.example.test/plain-60ebadea.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/30 21:58:29 activator: plain-60ebadea.example.test: woke in 8ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 1ms, spawn 1ms, replicate 4ms
2026/11/30 21:58:29 activator: next-due probe shop-60ebadea.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 21:58:29 activator: shop-60ebadea.example.test: released with a marker (clean true, txid 2, files 3:b582b6456df60824888623ca89455c6916ff4e793a722f010aca48956fc501d4) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/30 21:58:29 activator: shop-60ebadea.example.test hibernated
2026/11/30 21:58:29 tenant admission is closed for shutdown
2026/11/30 21:58:29 activator: next-due probe plain-60ebadea.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 21:58:29 activator: plain-60ebadea.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.55s)
=== RUN TestHeldHandoverLostLeaseMinio
2026/11/30 21:58:29 edge: mesh key: minted
2026/11/30 21:58:29 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 21:58:29 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/30 21:58:29 tenant admission is open. accepting tenant work
2026/11/30 21:58:29 activator: HA placement host=shop-eb64d4be.example.test kind=Place ref=annie reason=roomiest generation=2026-11-30T21:58:29Z lock_generation=0
2026/11/30 21:58:29 lease: t8-eb64d4be/shop-eb64d4be.example.test: HA lease acquired in 3ms (first wake)
2026/11/30 21:58:29 activator: shop-eb64d4be.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/30 21:58:29 activator: shop-eb64d4be.example.test: started carlos-instance@shop\x2deb64d4be.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 7ms, control socket 0s, key gate 0s, logs 0s) 7ms, launch file 0s, gate 0s, root start 1ms)
2026/11/30 21:58:29 activator: shop-eb64d4be.example.test: carlos-instance@shop\x2deb64d4be.example.test.service launched in 8ms, healthy 0s later
2026/11/30 21:58:29 activator: shop-eb64d4be.example.test: woke in 19ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 6ms
2026/11/30 21:58:29 activator: next-due probe shop-eb64d4be.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/30 21:58:29 activator: final checkpoint shop-eb64d4be.example.test: lease: release marker owed for s3://contract-bucket/t8-eb64d4be/shop-eb64d4be.example.test/lock.json (If-Match "111dd3dd8200f8f441bd4d2a91c75aa0"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/30 21:58:29 activator: shop-eb64d4be.example.test hibernated
2026/11/30 21:58:29 activator: handover of shop-eb64d4be.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-eb64d4be.example.test client 4 "
hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-eb64d4be.example.test <nil> releasing shop-eb64d4be.example.test <nil> stop shop-eb64d4be.example.test marker=false clean=false <nil> left shop-eb64d4be.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 21:58:29 tenant admission is closed for shutdown
2026/11/30 21:58:29 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.27s)
PASS
ok github.com/carlosframework/platform/internal/host 0.866s
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 21:58:31 lease: instances/gen-1796075911234648142.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/30 21:58:31 lease: instances/gen-1796075911234648142.shop.example.com: HA lease acquired in 3ms (holder terminated)
gentake_minio_test.go:308: a second create-only copy onto instances/gen-1796075911234648142.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/30 21:58:31 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 21:58:31 http: proxy error: context canceled
2026/11/30 21:58:31 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 21:58:31 lease: instances/gen-1796075911364550389.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 21:58:31 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 21:58:31 lease: instances/gen-1796075911364550389.shop.example.com: HA lease acquired in 3ms (clean marker)
=== RUN TestGenerationTakeMinio/copy-version
=== RUN TestGenerationTakeMinio/store-time
2026/11/30 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/30 21:58:31 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 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (clean marker)
2026/11/30 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/30 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/30 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/30 21:58:31 lease: instances/gen-1796075911461870088.shop.example.com: HA lease acquired in 3ms (unclean marker)
=== RUN TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.34s)
--- PASS: TestGenerationTakeMinio/take (0.13s)
--- PASS: TestGenerationTakeMinio/switch-412 (0.09s)
--- PASS: TestGenerationTakeMinio/copy-version (0.01s)
--- PASS: TestGenerationTakeMinio/store-time (0.11s)
--- PASS: TestGenerationTakeMinio/skew (0.01s)
PASS
ok github.com/carlosframework/platform/internal/lease 0.357s
minio contract: PASS
=== staticcheck ===
go version go1.26.10 linux/arm64
go: downloading honnef.co/go/tools v0.8.2
go: downloading golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678
go: downloading github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
go: downloading golang.org/x/sync v0.23.0
go: downloading golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
staticcheck: clean
=== govulncheck ===
go version go1.26.10 linux/arm64
go: downloading golang.org/x/vuln v1.8.0
go: downloading golang.org/x/telemetry v0.0.0-20260908163034-4bcc4b2ee518
go: downloading golang.org/x/tools v0.50.0
govulncheck: scanned github.com/carlosframework/platform, amadan.net/carlos/platform.git/launchctx, carlos-vulnscan
GO-2026-6859 called stdlib@v1.26.10, fixed in v1.26.11
HTTP/1 server crash due to MaxBytesReader header race in net/http
excepted until 2027-01-31 (.amadan/govulncheck-exceptions.tsv:9): net/http MaxBytesReader header race, fixed in go1.26.11. CI and releases stay on go1.26.10 because 1.26.11 deadlocks the edge's Expect: 100-continue path (#897, .amadan/go-toolchain.sh); #904 checked every production MaxBytesReader site and found it unreachable.
GO-2026-5932 required golang.org/x/crypto@v0.58.0, fixed in v0.58.1-0.20261009181718-2f1f834330b2
The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues
not fatal: no call path to the vulnerable code
govulncheck: clean (2 finding(s), none called outside .amadan/govulncheck-exceptions.tsv)
=== code-health ===
go version go1.26.10 linux/arm64
codehealth_test.go:42: scanned in 1m55.746s
codehealth_test.go:107: line metrics (code lines, then physical):
file-lines 5471 7324 internal/activator activator_test.go
file-lines 4179 7018 internal/console server.go
file-lines 4120 6283 . apimode.go
file-lines 3785 7224 internal/activator activator.go
file-lines 3530 4459 . apimode_test.go
file-lines 3261 3864 internal/registry registry_test.go
file-lines 3175 6342 internal/host agent.go
file-lines 3094 3992 internal/provision reconcile_test.go
func-lines 870 891 internal/host plan14InstalledClaimLaunch
func-lines 810 1277 internal/provision Reconcile
func-lines 769 1242 internal/console (*Server).handleAPIInstanceCreate
func-lines 683 1238 internal/host runAgent
func-lines 571 908 internal/activator (*Service).doWakeOnce
func-lines 538 546 internal/host runServingParkPeerNamespace
func-lines 519 712 . runRoute
func-lines 509 569 internal/host TestPagingIsRateLimited
func-lines 494 817 internal/release adoptHost
func-lines 441 500 internal/host TestRootInstanceStopExecStop
func-lines 421 436 internal/host (*ClaimWakeAssembly).Build
func-lines 421 437 internal/team TestFixture
func-lines 412 414 internal/console TestDemoProtectionsSourceToLimitAndTakedown
func-lines 408 485 . TestFleetAppServesThroughTheHub
func-lines 402 406 internal/registry (*Registry).haJournal
func-lines 400 868 internal/provision rootReadArchivedChain
func-lines 399 733 internal/release PassFilter
func-lines 390 398 internal/host runFilesSeedPreparationWithLive
func-lines 383 406 internal/console TestDemoSourceToLiveAndUpdate
func-lines 374 377 internal/host plan14RequiredArtifactsRootRunner
func-lines 371 417 internal/host TestRootEgressKernelProof
func-lines 369 883 internal/edge (*Edge).ServeHTTP
func-lines 367 584 internal/console (*Server).handleAPIShip
func-lines 364 371 internal/host testRootMigrationBootstrap
func-lines 360 362 internal/edge TestDemoAPIAliasBoundary
func-lines 358 628 cmd/console serve
func-lines 357 358 internal/registry (*Registry).dispatchRemote
func-lines 355 372 internal/host TestRootSandboxUpdateFromOldBox
func-lines 343 354 internal/analytics Prune
func-lines 340 353 internal/host newColdRootHarness
func-lines 335 557 internal/console (*Store).migrate
func-lines 334 334 internal/host TestPlan12RecoveryRestoreSourceDatabase
func-lines 330 371 internal/edge TestRegionalNameNeverLeavesItsRegion
func-lines 329 471 . runDeploy
func-lines 329 329 internal/host TestPlan12RecoveryRestoreSourceDatabase.func1
func-lines 327 369 internal/edge TestTunnelWebSocketEndToEnd
func-lines 325 455 internal/objstore TestDeliveredContractMinio
func-lines 320 654 internal/appconfig SyncExecWithCallbacks
func-lines 315 318 internal/host plan14TimerIntention
func-lines 311 314 internal/host plan14TimerIntention.func1
func-lines 310 315 internal/hostbox ColdHandover.Run
func-lines 308 309 internal/host rootFilesSeedIsolatedWitness
func-lines 305 323 internal/host hairpinKernelWitness
func-lines 304 308 internal/console TestHAP2ProductionDoors
func-lines 302 329 internal/host TestRootG2PoolIngress
release-importers: . cmd/console internal/activator internal/analytics internal/appconfig internal/apperr internal/applog internal/apppolicy internal/boxid internal/boxvolumes internal/console internal/dbreads internal/dbreads/dbreadstest internal/dbverify internal/demobuild internal/domains internal/doorkey internal/edge internal/edgeproof internal/edgesfile internal/fleetapi internal/grouproll internal/grouprollaws internal/historyreadback internal/host internal/hostactors internal/hostbox internal/hostclaim internal/hostevidence internal/hostexec internal/hostfence internal/hostfiles internal/hostfloor internal/hostguard internal/hostops internal/hostrelocate internal/hostresolve internal/instancectl internal/instanceupdates internal/interactive internal/layout internal/lease internal/ledger internal/mail internal/mailer internal/mailsubmit internal/metrics internal/moves internal/objstore internal/ops internal/park internal/plans internal/provision internal/relay internal/rollout internal/rootfsimage internal/runs internal/s3fake internal/schedule internal/seeds internal/status internal/telemetry internal/usage internal/vet scripts/pathmapcheck scripts/witness-pointer
not scanned (216 files):
cmd/carlos-media/drill_other.go: built only for other systems or tags
cmd/carlos-media/harden_other.go: built only for other systems or tags
cmd/console/fleetsocket_other.go: built only for other systems or tags
cmd/console/servelock_windows.go: built only for other systems or tags
cmd/moveprobe/detach_windows.go: built only for other systems or tags
cmd/rootfswitness/mmap_other.go: built only for other systems or tags
devbox_acl_other.go: built only for other systems or tags
devbox_envfile_darwin_test.go: built only for other systems or tags
devbox_envfile_other.go: built only for other systems or tags
domains_transfer_signals_other.go: built only for other systems or tags
interactive_term_darwin.go: built only for other systems or tags
interactive_term_other.go: built only for other systems or tags
internal/activator/claimprocess_root_other.go: built only for other systems or tags
internal/activator/escrow_stamp_other.go: built only for other systems or tags
internal/activator/fleetreserve_other.go: built only for other systems or tags
internal/activator/harecord_other.go: built only for other systems or tags
internal/activator/ownenv_other.go: built only for other systems or tags
internal/activator/pty_other.go: built only for other systems or tags
internal/activator/race_on_test.go: built only for other systems or tags
internal/activator/rolelaunch_other.go: built only for other systems or tags
internal/assetcache/statfs_other.go: built only for other systems or tags
internal/boxself/io_other.go: built only for other systems or tags
internal/cgroup/cleanup_other.go: built only for other systems or tags
internal/cgroup/cleanup_other_test.go: built only for other systems or tags
internal/cgroup/hostprocs_other.go: built only for other systems or tags
internal/cgroup/recreate_other.go: built only for other systems or tags
internal/cgroup/role_other.go: built only for other systems or tags
internal/cgroup/shim_other.go: built only for other systems or tags
internal/cgroup/strict_other.go: built only for other systems or tags
internal/cgroup/verify_other.go: built only for other systems or tags
internal/console/claim_sql_identity_other.go: built only for other systems or tags
internal/console/geoipverify_other.go: built only for other systems or tags
internal/console/hostreports_process_other.go: built only for other systems or tags
internal/console/replicaview_other.go: built only for other systems or tags
internal/console/restore_sim_nice_other_test.go: built only for other systems or tags
internal/console/scalecost_other_test.go: built only for other systems or tags
internal/console/seedscratch_windows.go: built only for other systems or tags
internal/dbreads/worker_other.go: built only for other systems or tags
internal/demobuild/security_other.go: built only for other systems or tags
internal/democlaim/source_other.go: built only for other systems or tags
internal/devbox/peer_darwin.go: built only for other systems or tags
internal/devbox/peer_darwin_test.go: built only for other systems or tags
internal/devbox/peer_other.go: built only for other systems or tags
internal/devbox/socketcheck_other.go: built only for other systems or tags
internal/domains/certimport_read_portable.go: built only for other systems or tags
internal/edge/devboxpeer_other.go: built only for other systems or tags
internal/edge/hairpin_other.go: built only for other systems or tags
internal/edge/heldbudget_other.go: built only for other systems or tags
internal/edge/purge_listen_unix.go: built only for other systems or tags
internal/edge/purge_listen_windows.go: built only for other systems or tags
internal/edge/race_on_test.go: built only for other systems or tags
internal/edge/replicaconsole_owner_other.go: built only for other systems or tags
internal/edge/replicaconsole_peer_other.go: built only for other systems or tags
internal/edge/replicaconsole_socket_other_test.go: built only for other systems or tags
internal/edge/static_artifact_other.go: built only for other systems or tags
internal/edge/static_recordlock_other.go: built only for other systems or tags
internal/edge/static_sweep_other.go: built only for other systems or tags
internal/execsandbox/cleanup_other.go: built only for other systems or tags
internal/execsandbox/file_other.go: built only for other systems or tags
internal/execsandbox/oci_other.go: built only for other systems or tags
internal/fileacl/fileacl_darwin.go: built only for other systems or tags
internal/fileacl/fileacl_darwin_amd64.s: built only for other systems or tags
internal/fileacl/fileacl_darwin_arm64.s: built only for other systems or tags
internal/fileacl/fileacl_darwin_test.go: built only for other systems or tags
internal/grouproll/state_other.go: built only for other systems or tags
internal/grouprollaws/pty_darwin.go: built only for other systems or tags
internal/grouprollaws/pty_other.go: built only for other systems or tags
internal/hairpin/native_other.go: built only for other systems or tags
internal/host/applylock_other_test.go: built only for other systems or tags
internal/host/bootstrapfs_other.go: built only for other systems or tags
internal/host/boxroles_config_other.go: built only for other systems or tags
internal/host/claimfilesseed_delegation_other.go: built only for other systems or tags
internal/host/claimfilesseed_transport_other.go: built only for other systems or tags
internal/host/claimjournal_containment_other.go: built only for other systems or tags
internal/host/claimjournal_migration_other.go: built only for other systems or tags
internal/host/claimlaunch_kernel_other.go: built only for other systems or tags
internal/host/claimlaunch_rev2_other_test.go: built only for other systems or tags
internal/host/claimproduction_other.go: built only for other systems or tags
internal/host/claimready_other.go: built only for other systems or tags
internal/host/claimroleassembly_other.go: built only for other systems or tags
internal/host/claimservingartifact_other.go: built only for other systems or tags
internal/host/claimservinghandover_reboot_other.go: built only for other systems or tags
internal/host/claimservinghandover_reboot_other_test.go: built only for other systems or tags
internal/host/claimservingpark_other.go: built only for other systems or tags
internal/host/claimstate_other.go: built only for other systems or tags
internal/host/claimstop_kernel_other.go: built only for other systems or tags
internal/host/claimtoken_inventory_other.go: built only for other systems or tags
internal/host/claimunit_dropin_other.go: built only for other systems or tags
internal/host/claimunit_files_other.go: built only for other systems or tags
internal/host/claimunit_migrate_other.go: built only for other systems or tags
internal/host/claimunit_ready_other.go: built only for other systems or tags
internal/host/claimunit_socket_migration_other.go: built only for other systems or tags
internal/host/consolefleet_owner_other.go: built only for other systems or tags
internal/host/dbreads_other.go: built only for other systems or tags
internal/host/egress_rail_other.go: built only for other systems or tags
internal/host/fileowner_other.go: built only for other systems or tags
internal/host/flock_windows.go: built only for other systems or tags
internal/host/group_config_other.go: built only for other systems or tags
internal/host/group_maintenance_other.go: built only for other systems or tags
internal/host/group_maintenance_verbs_other.go: built only for other systems or tags
internal/host/group_receipt_other.go: built only for other systems or tags
internal/host/hadrain_call_other.go: built only for other systems or tags
internal/host/hadrain_socket_other.go: built only for other systems or tags
internal/host/hadrainfence_other.go: built only for other systems or tags
internal/host/headroom_other.go: built only for other systems or tags
internal/host/installchannel_other.go: built only for other systems or tags
internal/host/managedboot_other.go: built only for other systems or tags
internal/host/metrics_nested_other.go: built only for other systems or tags
internal/host/movesfloor_other.go: built only for other systems or tags
internal/host/movesfloorgate_other.go: built only for other systems or tags
internal/host/movesheldrelease_other.go: built only for other systems or tags
internal/host/movesmeasure_other.go: built only for other systems or tags
internal/host/offcloudcredentials_other.go: built only for other systems or tags
internal/host/registrychild_exec_other.go: built only for other systems or tags
internal/host/registrychild_other.go: built only for other systems or tags
internal/host/registryowner_chown_other.go: built only for other systems or tags
internal/host/registryowner_descriptor_unix.go: built only for other systems or tags
internal/host/replicahealth_other.go: built only for other systems or tags
internal/host/rootgeneration_census_other.go: built only for other systems or tags
internal/host/rootgeneration_kernel_other.go: built only for other systems or tags
internal/host/rootgeneration_payload_other.go: built only for other systems or tags
internal/host/rootgeneration_retired_other.go: built only for other systems or tags
internal/host/rootmigration_production_other.go: built only for other systems or tags
internal/host/runscset_other.go: built only for other systems or tags
internal/host/sandboxenv_other.go: built only for other systems or tags
internal/host/statfs_windows.go: built only for other systems or tags
internal/host/systemapply_other.go: built only for other systems or tags
internal/hostbox/census_vendor_other.go: built only for other systems or tags
internal/hostbox/inventory_identity_other.go: built only for other systems or tags
internal/hostbox/journalmigration_other.go: built only for other systems or tags
internal/hostbox/journalnamespace_other.go: built only for other systems or tags
internal/hostbox/journaltrust_other.go: built only for other systems or tags
internal/hostbox/migration_census_other.go: built only for other systems or tags
internal/hostbox/typedpark_other.go: built only for other systems or tags
internal/hostenv/group_other.go: built only for other systems or tags
internal/hostenv/write_other.go: built only for other systems or tags
internal/hostenv/write_other_test.go: built only for other systems or tags
internal/hostexec/clock_other.go: built only for other systems or tags
internal/hostexec/clock_other_test.go: built only for other systems or tags
internal/hostexec/local_other.go: built only for other systems or tags
internal/hostexec/pending_other.go: built only for other systems or tags
internal/hostexec/probe_other.go: built only for other systems or tags
internal/hostexec/rootprocess_other.go: built only for other systems or tags
internal/hostfiles/dir_other.go: built only for other systems or tags
internal/hostfiles/refuse_other.go: built only for other systems or tags
internal/hostfiles/watch_other.go: built only for other systems or tags
internal/hostfloor/controllers_other.go: built only for other systems or tags
internal/hostfloor/image_other.go: built only for other systems or tags
internal/hostguard/flock_other.go: built only for other systems or tags
internal/hostguard/flock_other_test.go: built only for other systems or tags
internal/hostguard/record_other.go: built only for other systems or tags
internal/instancectl/claimexec_other.go: built only for other systems or tags
internal/instancectl/claimexec_socket_other.go: built only for other systems or tags
internal/instancectl/claimlaunch_snapshot_other.go: built only for other systems or tags
internal/instancectl/claimnetwork_other.go: built only for other systems or tags
internal/instancectl/demo_snapshot_other.go: built only for other systems or tags
internal/instancectl/egress_cgroup_other.go: built only for other systems or tags
internal/instancectl/egress_dropin_other.go: built only for other systems or tags
internal/instancectl/fleetsize_other.go: built only for other systems or tags
internal/instancectl/gvisorprobe_other.go: built only for other systems or tags
internal/instancectl/peer_other.go: built only for other systems or tags
internal/instancectl/peer_tuple_other.go: built only for other systems or tags
internal/instancectl/rootfs_identity_other.go: built only for other systems or tags
internal/instanceexec/claimexec_other.go: built only for other systems or tags
internal/instanceexec/exec_rootfs_other.go: built only for other systems or tags
internal/instanceexec/netlink_route_other.go: built only for other systems or tags
internal/instanceexec/probe_gvisor_other.go: built only for other systems or tags
internal/instanceexec/probe_hardening_other.go: built only for other systems or tags
internal/instanceexec/probe_other.go: built only for other systems or tags
internal/instanceexec/probe_rootfs_other.go: built only for other systems or tags
internal/instanceexec/sandbox_other.go: built only for other systems or tags
internal/instanceexec/scope_other.go: built only for other systems or tags
internal/instanceexec/stop_other.go: built only for other systems or tags
internal/instanceexec/tty_other.go: built only for other systems or tags
internal/instancefs/instancefs_other.go: built only for other systems or tags
internal/launchd/activate_darwin.go: built only for other systems or tags
internal/launchd/activate_darwin_amd64.s: built only for other systems or tags
internal/launchd/activate_darwin_arm64.s: built only for other systems or tags
internal/launchd/activate_darwin_test.go: built only for other systems or tags
internal/layout/journal_other.go: built only for other systems or tags
internal/layout/links_other.go: built only for other systems or tags
internal/mailer/keys_other.go: built only for other systems or tags
internal/maintenanceexec/run_other.go: built only for other systems or tags
internal/managedboot/admission_other.go: built only for other systems or tags
internal/managedboot/identity_other.go: built only for other systems or tags
internal/mediahandler/collect_other.go: built only for other systems or tags
internal/mediahandler/procs_other.go: built only for other systems or tags
internal/medialocal/runner_other.go: built only for other systems or tags
internal/moves/archive/open_other.go: built only for other systems or tags
internal/moves/archive/sync_other.go: built only for other systems or tags
internal/ops/flock_windows.go: built only for other systems or tags
internal/park/local_other.go: built only for other systems or tags
internal/privatefile/io_other.go: built only for other systems or tags
internal/proxyproto/peek_other.go: built only for other systems or tags
internal/relay/race_on_test.go: built only for other systems or tags
internal/release/consumedfence_other.go: built only for other systems or tags
internal/release/digestcache_other.go: built only for other systems or tags
internal/rootaws/credentials_other.go: built only for other systems or tags
internal/rootaws/open_darwin.go: built only for other systems or tags
internal/rootfsimage/dir_other.go: built only for other systems or tags
internal/rootstate/authoritydir_other.go: built only for other systems or tags
internal/rootstate/authorityfile_other.go: built only for other systems or tags
internal/rootstate/file_other.go: built only for other systems or tags
internal/rootstate/link_other.go: built only for other systems or tags
internal/rootstate/persistent_other.go: built only for other systems or tags
internal/rootstate/state_other.go: built only for other systems or tags
internal/safefile/file_other.go: built only for other systems or tags
internal/safefile/reap_other.go: built only for other systems or tags
internal/stopevidence/fds_other.go: built only for other systems or tags
internal/stopevidence/fds_other_test.go: built only for other systems or tags
internal/stopevidence/holders_other.go: built only for other systems or tags
internal/stopevidence/reconstruct_other.go: built only for other systems or tags
internal/team/storelock_other.go: built only for other systems or tags
internal/team/storelock_windows.go: built only for other systems or tags
move_offline_run_other.go: built only for other systems or tags
system_group_other.go: built only for other systems or tags
codehealth_test.go:115: fatal 1090 at 473 sites log.Fatal*, (*log.Logger).Fatal* and os.Exit in the root package's production files
codehealth_test.go:115: sleep 1006 at 812 sites time.Sleep in test files
codehealth_test.go:115: db-no-context 873 at 696 sites database calls with no context (dbOpWithoutContext) in production files
codehealth_test.go:115: host-context 188 at 142 sites context.Background and context.TODO in internal/host production files
codehealth_test.go:115: func-lines 18582 at 45 sites functions over 300 code lines (blank and comment-only lines not counted)
codehealth_test.go:115: file-lines 30615 at 8 sites files over 3,000 code lines, counted the same way
codehealth_test.go:115: release-importers 66 at 1 sites packages whose production files import internal/release
codehealth_test.go:119: below the record: func-lines cmd/console serve -: 358 in the code, the record allows 362 (make code-health-record lowers it)
codehealth_test.go:119: below the record: file-lines . apimode.go -: 4120 in the code, the record allows 4147 (make code-health-record lowers it)
codehealth_test.go:119: below the record: file-lines internal/console server.go -: 4179 in the code, the record allows 4191 (make code-health-record lowers it)
codehealth_test.go:119: below the record: file-lines internal/host agent.go -: 3175 in the code, the record allows 3204 (make code-health-record lowers it)
--- PASS: TestCodeHealth (115.75s)
PASS
ok github.com/carlosframework/platform/internal/codehealth 117.087s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: HEAD is on main; comparing with its parent 9d294ace6fab2e2be5546a26025259b96827e04c
=== RUN TestRecordAgainstBase
--- PASS: TestRecordAgainstBase (0.01s)
PASS
ok github.com/carlosframework/platform/internal/codehealth 0.008s
code-health record: no line went up without a reason
=== race ===
go version go1.26.10 linux/arm64
GATE_RACE=1 .amadan/test-gate.sh
=== internal_systemd@0 (14 s, from +14 s)
ok github.com/carlosframework/platform/internal/systemd 13.721s
=== internal_rootaws@0 (26 s, from +34 s)
ok github.com/carlosframework/platform/internal/rootaws 25.581s
=== internal_activator@0 (270 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 267.443s
=== internal_activator@1 (251 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 248.524s
=== internal_activator@2 (289 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 286.163s
=== internal_activator@3 (428 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 425.013s
=== internal_activator@4 (286 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 283.283s
=== internal_activator@5 (313 s, from +112 s)
ok github.com/carlosframework/platform/internal/activator 310.563s
=== internal_activator@6 (295 s, from +113 s)
ok github.com/carlosframework/platform/internal/activator 293.892s
=== internal_activator@7 (421 s, from +113 s)
ok github.com/carlosframework/platform/internal/activator 419.542s
=== internal_edge@0 (84 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 80.528s
=== internal_edge@1 (102 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 98.565s
=== internal_edge@2 (211 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 207.719s
=== internal_edge@3 (164 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 160.860s
=== internal_edge@4 (190 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 187.061s
=== internal_edge@5 (227 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 224.262s
=== internal_edge@6 (204 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 201.342s
=== internal_edge@7 (214 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 211.298s
=== internal_edge@8 (266 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 262.486s
=== internal_edge@9 (286 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 282.585s
=== internal_edge@10 (226 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 222.994s
=== internal_edge@11 (223 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 219.661s
=== internal_edge@12 (253 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 249.541s
=== internal_edge@13 (257 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 254.222s
=== internal_edge@14 (176 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 172.391s
=== internal_edge@15 (255 s, from +136 s)
ok github.com/carlosframework/platform/internal/edge 252.163s
=== internal_host@0 (16 s, from +196 s)
ok github.com/carlosframework/platform/internal/host 12.312s
=== internal_host@1 (10 s, from +196 s)
ok github.com/carlosframework/platform/internal/host 5.473s
=== 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 7701 cpu-seconds in 540 s, about 14.3 of 32 cores; the machine as a whole was 44% busy
=== gitleaks ===
go version go1.26.10 linux/arm64
go: downloading github.com/zricethezav/gitleaks/v8 v8.30.1
go: downloading github.com/rs/zerolog v1.33.0
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/spf13/viper v1.19.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/charmbracelet/lipgloss v0.5.0
go: downloading github.com/fatih/semgroup v1.2.0
go: downloading github.com/hashicorp/go-version v1.7.0
go: downloading github.com/Masterminds/sprig/v3 v3.3.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 golang.org/x/sync v0.11.0
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading github.com/muesli/termenv v0.15.1
go: downloading github.com/mattn/go-runewidth v0.0.14
go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
go: downloading github.com/fsnotify/fsnotify v1.8.0
go: downloading github.com/spf13/cast v1.7.1
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/spf13/afero v1.12.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.9
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading github.com/huandu/xstrings v1.5.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.3.0
go: downloading dario.cat/mergo v1.0.1
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/klauspost/compress v1.17.11
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
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/rivo/uniseg v0.2.0
go: downloading golang.org/x/sys v0.30.0
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/bodgit/plumbing v1.3.0
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading github.com/bodgit/windows v1.0.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/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 12120 tracked files; 33 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
gitleaks: clean
landed from sec-h3-m2-scoped-key
diff --git a/apimode.go b/apimode.go| index 82023b9ba..ef4205816 100644 |
| --- a/apimode.go |
| +++ b/apimode.go |
| @@ -1588,15 +1588,6 @@ func (s *apiSession) channels(ctx context.Context, a apiAcct, app string) (apiCh |
| return out, nil |
| } |
| -type apiResignPlan struct { |
| - Channel string `json:"channel"` |
| - Version string `json:"version"` |
| - Digest string `json:"digest"` |
| - History []string `json:"history"` |
| - HistoryDigests []string `json:"history_digests"` |
| - Computed []bool `json:"computed"` |
| -} |
| - |
| // resignPlan asks the console what `channels resign` would sign. Nothing is |
| // written. |
| func (s *apiSession) resignPlan(ctx context.Context, a apiAcct, app, channel string) (apiResignPlan, error) { |
diff --git a/channels_digests.go b/channels_digests.go| index 820827fc5..6df405694 100644 |
| --- a/channels_digests.go |
| +++ b/channels_digests.go |
| @@ -8,6 +8,7 @@ import ( |
| "io" |
| "log" |
| "os" |
| + "slices" |
| "strings" |
| "time" |
| @@ -41,26 +42,50 @@ const ( |
| textUnknownAccount = "no account %s on this console, so nothing was changed for it" |
| ) |
| -// The repair listing (hunt H3-M8 and H3-M1, fix round 1). Not yet through |
| -// copy review. |
| +// The resign plan's warning over a head signed under a key grant that names |
| +// no account (hunt H3-M2, fix round 2). Not yet through copy review. |
| +const textResignUnboundGrant = "This head was signed with key %s, minted %s, which is not bound to an account. Before you sign, check that the key is this account's own builder or deploy credential, and that this account promoted the head and every version in its history. If you cannot tell, stop." |
| + |
| +// The repair listing (hunt H3-M8 and H3-M1, fix round 1; hunt H3-M2, fix |
| +// round 2). Not yet through copy review. |
| const ( |
| - textRepairHeader = "ACCOUNT\tAPP\tCHANNEL\tVERSION\tREPAIR" |
| - textRepairUnbound = "no account: promote this version again" |
| - textRepairNoRecord = "no promotion record: carlos releases authorize" |
| - textRepairNone = "no channel needs a repair: a new or replaced box accepts every head" |
| - textRepairUnknown = "this console does not list repairs: upgrade it, or ask the bucket directly" |
| + textRepairHeader = "ACCOUNT\tAPP\tCHANNEL\tVERSION\tREPAIR\tSIGNED UNDER" |
| + textRepairUnbound = "not bound to its account: promote this version again" |
| + textRepairNoRecord = "no promotion record: carlos releases authorize" |
| + textRepairRecordUnbound = "promotion record not bound to its account: carlos releases authorize" |
| + textRepairRecordRefused = "promotion record refused (%s): carlos releases authorize" |
| + textRepairRecordRetry = "promotion record could not be read (%s): run carlos channels digests again" |
| + textRepairRecordNoBuild = "promotion record for a build that is gone: restore the build and authorize it, or finish deleting that version" |
| + textRepairSignedBy = "key %s, minted %s" |
| + textRepairCheckGrant = "Before repairing a line signed with a key that is not bound to an account, check that the key is the account's own builder or deploy credential, and that the account promoted the head and every version in its history. If you cannot tell, stop and verify them first: promoting another version over a planted head keeps its history." |
| + textRepairNone = "nothing to repair: every head and promotion record in the bucket verifies and is signed for its own account" |
| + textRepairNoneFor = "nothing to repair in %s: every head and promotion record there verifies and is signed for its own account" |
| + textRepairUnknown = "this console does not list repairs: upgrade it, or ask the bucket directly" |
| ) |
| // apiDigestRepair is a channel whose head a fresh or replaced box would |
| -// refuse: Unbound (signed before the account binding) or NoRecord (no digest |
| -// and no promotion record to bind it). |
| +// refuse: Unbound (not bound to its account: the pointer names none, or the |
| +// key grant it was signed under names none) or NoRecord (no digest and no |
| +// promotion record to bind it). Record is instead a promotion record a box |
| +// refuses, whichever head names its version (no Channel): signed under a |
| +// key grant that names no account, refused for another reason (Error), or |
| +// not read at all (Unread, with Error); NoBuild is a refused one whose |
| +// build is gone, which authorize cannot replace. Grant and |
| +// GrantMintedAt name a grant that names no account, so the operator can |
| +// check it was the account's own before re-signing what it signed. |
| type apiDigestRepair struct { |
| - Account string `json:"account"` |
| - App string `json:"app"` |
| - Channel string `json:"channel"` |
| - Version string `json:"version"` |
| - Unbound bool `json:"unbound"` |
| - NoRecord bool `json:"no_record"` |
| + Account string `json:"account"` |
| + App string `json:"app"` |
| + Channel string `json:"channel"` |
| + Version string `json:"version"` |
| + Unbound bool `json:"unbound"` |
| + NoRecord bool `json:"no_record"` |
| + Record bool `json:"record,omitempty"` |
| + Error string `json:"error,omitempty"` |
| + Unread bool `json:"unread,omitempty"` |
| + NoBuild bool `json:"no_build,omitempty"` |
| + Grant string `json:"grant,omitempty"` |
| + GrantMintedAt string `json:"grant_minted_at,omitempty"` |
| } |
| // apiPointerDigests is the pointer-digest report: the console's, or one |
| @@ -73,36 +98,124 @@ type apiPointerDigests struct { |
| Repairs *[]apiDigestRepair `json:"repairs"` |
| } |
| -// repairCell is the repair a channel needs. A head can need both: the |
| +// repairCell is the repair a line needs. A head can need both: the |
| // account first, since an unbound pointer is refused before its bytes are. |
| +// A record is repaired by authorizing its version: promoting a head's |
| +// version again writes no record. |
| func repairCell(r apiDigestRepair) string { |
| - if r.Unbound { |
| + switch { |
| + case r.Record && r.Unread: |
| + return fmt.Sprintf(textRepairRecordRetry, r.Error) |
| + case r.Record && r.NoBuild: |
| + return textRepairRecordNoBuild |
| + case r.Record && r.Error != "": |
| + return fmt.Sprintf(textRepairRecordRefused, r.Error) |
| + case r.Record: |
| + return textRepairRecordUnbound |
| + case r.Unbound: |
| return textRepairUnbound |
| } |
| return textRepairNoRecord |
| } |
| -// printRepairs lists the channels whose heads a fresh or replaced box would |
| -// refuse, whatever the marker says. The account binding's rollout gate is |
| -// this list being empty on every deployment. |
| -func printRepairs(rep apiPointerDigests, failed bool) { |
| +// signedUnderCell names the key grant that names no account a line was |
| +// signed under, or nothing. |
| +func signedUnderCell(r apiDigestRepair) string { |
| + if r.Grant == "" { |
| + return "" |
| + } |
| + return fmt.Sprintf(textRepairSignedBy, r.Grant, signedUnderDate(r.GrantMintedAt)) |
| +} |
| + |
| +// signedUnderDate is a grant's mint time from the wire as a date, or the |
| +// text as sent when it is not a time. |
| +func signedUnderDate(minted string) string { |
| + if t, err := time.Parse(time.RFC3339, minted); err == nil { |
| + return t.UTC().Format(time.DateOnly) |
| + } |
| + return minted |
| +} |
| + |
| +// repairRows is one app's lines in the repair listing: each head a box |
| +// refuses, then each promotion record. A record that was not read is a |
| +// line and leaves the account unknown (unknown is its error), so the gate |
| +// never reads clean over it. |
| +func repairRows(acct, app string, states []release.ChannelDigestState, recs []release.RecordState) (rows []apiDigestRepair, unknown string) { |
| + for _, st := range states { |
| + if st.Err == "" && st.NeedsRepair() { |
| + r := apiDigestRepair{Account: acct, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord, Grant: st.Grant} |
| + if st.Grant != "" { |
| + r.GrantMintedAt = st.GrantMintedAt.UTC().Format(time.RFC3339) |
| + } |
| + rows = append(rows, r) |
| + } |
| + } |
| + for _, rec := range recs { |
| + r := apiDigestRepair{Account: acct, App: app, Version: rec.Version, Record: true, Error: rec.Err, |
| + Unread: rec.Unread, NoBuild: rec.NoBuild, Grant: rec.Grant} |
| + if rec.Grant != "" { |
| + r.GrantMintedAt = rec.GrantMintedAt.UTC().Format(time.RFC3339) |
| + } |
| + if rec.Unread && unknown == "" { |
| + unknown = rec.Err |
| + } |
| + rows = append(rows, r) |
| + } |
| + return rows, unknown |
| +} |
| + |
| +// printRepairs lists the heads and promotion records a fresh or replaced |
| +// box would refuse, whatever the marker says. The account binding's rollout |
| +// gate is this list being empty on every deployment. scope names the |
| +// accounts the report covers when it is not the whole bucket, and the clean |
| +// line says only that much. |
| +func printRepairs(rep apiPointerDigests, failed bool, scope string) { |
| switch { |
| case rep.Repairs == nil: |
| fmt.Fprintln(stdout, textRepairUnknown) |
| case len(*rep.Repairs) == 0: |
| - if !failed { |
| + switch { |
| + case failed: |
| + case scope != "": |
| + fmt.Fprintf(stdout, textRepairNoneFor+"\n", scope) |
| + default: |
| fmt.Fprintln(stdout, textRepairNone) |
| } |
| default: |
| w := newTable(stdout) |
| fmt.Fprintln(w, textRepairHeader) |
| for _, r := range *rep.Repairs { |
| - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", r.Account, r.App, r.Channel, r.Version, repairCell(r)) |
| + ch := r.Channel |
| + if r.Record { |
| + ch = "-" |
| + } |
| + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", r.Account, r.App, ch, r.Version, repairCell(r), signedUnderCell(r)) |
| } |
| w.Flush() |
| + // The name and date identify a key; they do not prove whose it |
| + // was, and a repair re-signs the head's whole history (Astra |
| + // round 2, P2-2). |
| + if slices.ContainsFunc(*rep.Repairs, func(r apiDigestRepair) bool { return r.Grant != "" }) { |
| + fmt.Fprintln(stdout, textRepairCheckGrant) |
| + } |
| } |
| } |
| +// apiResignPlan is the console's answer to a resign plan request |
| +// (apiSession.resignPlan). Grant and GrantMintedAt name the key grant the |
| +// head was signed under when that grant names no account (hunt H3-M2, fix |
| +// round 2); an older console sends neither. |
| +type apiResignPlan struct { |
| + Channel string `json:"channel"` |
| + Version string `json:"version"` |
| + Digest string `json:"digest"` |
| + History []string `json:"history"` |
| + HistoryDigests []string `json:"history_digests"` |
| + Computed []bool `json:"computed"` |
| + Grant string `json:"grant,omitempty"` |
| + GrantMintedAt string `json:"grant_minted_at,omitempty"` |
| +} |
| + |
| // resignInput is where resign reads its confirmation; tests swap it. |
| var resignInput io.Reader = os.Stdin |
| @@ -136,7 +249,10 @@ func runChannelsResign(args []string) { |
| log.Fatal(usage) |
| } |
| channel := pos[0] |
| - confirm := func(version, digest string, history, hd []string, computed []bool) bool { |
| + confirm := func(version, digest string, history, hd []string, computed []bool, grant, minted string) bool { |
| + if grant != "" { |
| + fmt.Fprintf(stdout, textResignUnboundGrant+"\n", grant, minted) |
| + } |
| fmt.Fprintf(stdout, textResignIntro+"\n", *app, channel) |
| row := func(v, d string, c bool) { |
| src := textResignKept |
| @@ -177,7 +293,8 @@ func runChannelsResign(args []string) { |
| if err != nil { |
| log.Fatal(err) |
| } |
| - if !confirm(plan.Version, plan.Digest, plan.History, plan.HistoryDigests, plan.Computed) { |
| + if !confirm(plan.Version, plan.Digest, plan.History, plan.HistoryDigests, plan.Computed, |
| + plan.Grant, signedUnderDate(plan.GrantMintedAt)) { |
| return |
| } |
| if err := sess.resignSign(ctx, acct, *app, channel, plan.Digest, plan.HistoryDigests); err != nil { |
| @@ -195,7 +312,11 @@ func runChannelsResign(args []string) { |
| if err != nil { |
| log.Fatal(err) |
| } |
| - if !confirm(plan.Version, plan.Digest, plan.History, plan.HistoryDigests, plan.Computed) { |
| + minted := "" |
| + if plan.Grant != "" { |
| + minted = plan.GrantMintedAt.UTC().Format(time.DateOnly) |
| + } |
| + if !confirm(plan.Version, plan.Digest, plan.History, plan.HistoryDigests, plan.Computed, plan.Grant, minted) { |
| return |
| } |
| if err := sg.Resign(ctx, s, plan, promoteActor()); err != nil { |
| @@ -207,13 +328,14 @@ func runChannelsResign(args []string) { |
| // runChannelsDigests is `carlos channels digests [on|off] [--account-id <sqid>]...`. |
| // Bare, it reports; on and off write or remove the emission marker. Through a |
| // console these are platform-operator doors; direct-store they need the root |
| -// key in CARLOS_RELEASE_KEY and name each account. An account it could not |
| +// key in CARLOS_RELEASE_KEY and name each account. A bare direct-store report |
| +// with no account reads every account in the bucket. An account it could not |
| // read still prints, and ends the command with exit 1 so a scripted rollout |
| // gate fails closed. |
| func runChannelsDigests(args []string) error { |
| fs := flag.NewFlagSet("channels digests", flag.ExitOnError) |
| var ids multiFlag |
| - fs.Var(&ids, "account-id", "an account sqid; repeat for several (direct-store: required)") |
| + fs.Var(&ids, "account-id", "an account sqid; repeat for several (direct-store: required for on and off; without it, checks every account in the bucket)") |
| consoleFlag := consoleOption(fs, "console origin (API mode only; default: the only logged-in one)") |
| fs.Usage = flagUsage(fs, "") |
| usage := "usage: carlos channels digests [on|off] [--account-id <sqid>]..." |
| @@ -234,14 +356,25 @@ func runChannelsDigests(args []string) error { |
| log.Fatal(err) |
| } |
| var rep apiPointerDigests |
| - if sess != nil { |
| + scope := "" // the whole bucket: the console's report, or a bare direct-store one |
| + switch { |
| + case sess != nil: |
| printUsing(stdout, sess) |
| rep, err = sess.pointerDigests(ctx, verb, ids) |
| - } else { |
| - if len(ids) == 0 { |
| - log.Fatal(usage) |
| - } |
| + case len(ids) > 0: |
| + scope = strings.Join(ids, ", ") |
| rep, err = localPointerDigests(ctx, openStore(), verb, ids) |
| + case verb != "": |
| + log.Fatal(usage) // a marker is written or removed only for accounts named |
| + default: |
| + // Bare, every account directory in the bucket, as the console's |
| + // door walks them (Fable round 2, P2-a): the rollout gate's clean |
| + // line then covers the bucket, not only the accounts typed. |
| + s := openStore() |
| + var all []string |
| + if all, err = release.BucketAccounts(ctx, s); err == nil { |
| + rep, err = localPointerDigests(ctx, s, verb, all) |
| + } |
| } |
| if err != nil { |
| log.Fatal(err) |
| @@ -275,7 +408,7 @@ func runChannelsDigests(args []string) error { |
| fmt.Fprintf(stdout, textStatusOff+"\n", a.Account) |
| } |
| } |
| - printRepairs(rep, failed) |
| + printRepairs(rep, failed, scope) |
| switch { |
| case len(rep.Channels) > 0: |
| w := newTable(stdout) |
| @@ -364,9 +497,16 @@ func localPointerDigests(ctx context.Context, s release.Store, verb string, ids |
| if st.Err == "" && st.RecordErr != "" && row.Error == "" { |
| row.Error = st.RecordErr // unknown whether it needs a repair |
| } |
| - if st.Err == "" && st.NeedsRepair() { |
| - *rep.Repairs = append(*rep.Repairs, apiDigestRepair{Account: acct, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord}) |
| - } |
| + } |
| + recs, err := release.RecordReport(ctx, s, pub, acct, app) |
| + if err != nil { |
| + row.Error = err.Error() |
| + break |
| + } |
| + rows, unknown := repairRows(acct, app, states, recs) |
| + *rep.Repairs = append(*rep.Repairs, rows...) |
| + if unknown != "" && row.Error == "" { |
| + row.Error = unknown |
| } |
| } |
| rep.Accounts = append(rep.Accounts, row) |
diff --git a/channels_digests_test.go b/channels_digests_test.go| index 732b9e5ed..e3949620b 100644 |
| --- a/channels_digests_test.go |
| +++ b/channels_digests_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "bytes" |
| "context" |
| "crypto/ed25519" |
| + "encoding/base64" |
| "encoding/json" |
| "errors" |
| "fmt" |
| @@ -458,14 +459,189 @@ func TestChannelsDigestsListsRepairsWithTheMarkerOff(t *testing.T) { |
| if !strings.Contains(out, fmt.Sprintf(textStatusOff, "bab")) || !strings.Contains(out, "REPAIR") || !strings.Contains(out, textRepairNoRecord) { |
| t.Fatalf("record-less head not listed for repair with the marker off:\n%s", out) |
| } |
| - if strings.Contains(out, textRepairNone) { |
| + if strings.Contains(out, fmt.Sprintf(textRepairNoneFor, "bab")) { |
| t.Fatalf("said nothing needs a repair:\n%s", out) |
| } |
| if _, err := s.Put(ctx, release.PromotionRecordKey("bab", "km", "v1"), rec, ""); err != nil { |
| t.Fatal(err) |
| } |
| - if out := runDigests(t, "--account-id", "bab"); !strings.Contains(out, textRepairNone) || strings.Contains(out, textRepairNoRecord) { |
| + if out := runDigests(t, "--account-id", "bab"); !strings.Contains(out, fmt.Sprintf(textRepairNoneFor, "bab")) || strings.Contains(out, textRepairNoRecord) { |
| t.Fatalf("with the record back:\n%s", out) |
| } |
| _ = pub |
| } |
| + |
| +// plantAccountlessRecord signs, as the holder of a scoped key minted before |
| +// grants named an account can, a promotion record for bab/km version under |
| +// a genuine root grant ("old-ci") that names no account. It returns the |
| +// grant's mint time. |
| +func plantAccountlessRecord(t *testing.T, s release.Store, version string) time.Time { |
| + t.Helper() |
| + ctx := context.Background() |
| + root, err := release.ParseSigningKey(os.Getenv("CARLOS_RELEASE_KEY"), "test") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + pub, key, _ := ed25519.GenerateKey(nil) |
| + minted := time.Now().UTC().Add(-time.Hour).Truncate(time.Second) |
| + g, _ := json.Marshal(release.Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(pub), Rungs: []string{release.RungEdge}, |
| + Name: "old-ci", MintedAt: minted, ExpiresAt: minted.Add(48 * time.Hour)}) |
| + g64 := base64.StdEncoding.EncodeToString(g) |
| + raw, _, err := s.Get(ctx, release.ManifestKey("bab", "km", version)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + rec, _ := json.Marshal(release.PromotionRecord{Schema: 1, Account: "bab", App: "km", Version: version, |
| + ManifestDigest: release.ManifestDigest(raw), Channel: "edge", At: time.Now().UTC().Truncate(time.Second)}) |
| + r64 := base64.StdEncoding.EncodeToString(rec) |
| + wire, _ := json.Marshal(map[string]any{"payload": r64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(key, []byte(r64))), |
| + "grant": map[string]string{"payload": g64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(root, []byte(g64)))}}) |
| + k := release.PromotionRecordKey("bab", "km", version) |
| + _, etag, _ := s.Get(ctx, k) |
| + if _, err := s.Put(ctx, k, wire, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := release.ReadPromotionRecord(ctx, s, publicKey(), "bab", "km", version); !errors.Is(err, release.ErrGrantUnbound) { |
| + t.Fatalf("control: the planted record reads %v, want ErrGrantUnbound", err) |
| + } |
| + return minted |
| +} |
| + |
| +// The rollout listing, direct-store, lists every promotion record a box |
| +// refuses (fix round 2, Astra P1), each with its own remedy: one signed |
| +// under a grant that names no account, with the grant's name and mint date |
| +// (Fable P2-a) and the check to make before repairing it; and a refused one |
| +// whose build is gone, which authorize cannot replace. Neither is an |
| +// unknown, so the command ends 0, but neither lets the listing read clean. |
| +// The head over the unbound record is not listed a second time. |
| +// Authorizing the version and removing the junk clears the listing, and the |
| +// clean line names only the account it was asked about. |
| +func TestChannelsDigestsListsEveryRecordABoxRefuses(t *testing.T) { |
| + s, _ := directDigestStore(t) // bab: km/stable at v1, no digest, root record |
| + ctx := context.Background() |
| + minted := plantAccountlessRecord(t, s, "v1") |
| + junk := release.PromotionRecordKey("bab", "km", "v7") // no build v7 |
| + if _, err := s.Put(ctx, junk, []byte("junk"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + out, err := runDigestsErr(t, "--account-id", "bab") |
| + if err != nil { |
| + t.Fatalf("records that were read ended the command with %v:\n%s", err, out) |
| + } |
| + want := fmt.Sprintf(textRepairSignedBy, "old-ci", minted.Format(time.DateOnly)) |
| + for _, w := range []string{textRepairRecordUnbound, want, textRepairCheckGrant, textRepairRecordNoBuild} { |
| + if !strings.Contains(out, w) { |
| + t.Fatalf("output lacks %q:\n%s", w, out) |
| + } |
| + } |
| + if strings.Contains(out, textRepairNoRecord) || strings.Contains(out, fmt.Sprintf(textRepairNoneFor, "bab")) { |
| + t.Fatalf("listed the head as record-less, or said nothing needs a repair:\n%s", out) |
| + } |
| + |
| + if err := s.Delete(ctx, junk); err != nil { |
| + t.Fatal(err) |
| + } |
| + root, _ := release.ParseSigningKey(os.Getenv("CARLOS_RELEASE_KEY"), "test") |
| + plan, err := release.PlanAuthorize(ctx, s, "bab", "km", "v1") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := release.RootSigner(root).Authorize(ctx, s, plan, "op"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if out := runDigests(t, "--account-id", "bab"); !strings.Contains(out, fmt.Sprintf(textRepairNoneFor, "bab")) || strings.Contains(out, textRepairCheckGrant) { |
| + t.Fatalf("after authorize:\n%s", out) |
| + } |
| +} |
| + |
| +// getFails is a store whose Get of one key fails as a bucket outage would. |
| +type getFails struct { |
| + release.Store |
| + key string |
| +} |
| + |
| +func (s getFails) Get(ctx context.Context, key string) ([]byte, string, error) { |
| + if key == s.key { |
| + return nil, "", errors.New("503 slow down") |
| + } |
| + return s.Store.Get(ctx, key) |
| +} |
| + |
| +// A record a store error kept from being read is not a refusal: its line |
| +// says to run the report again, and the account is unknown, so the gate |
| +// never reads clean over it (Fable P2-c). The record is of a version no |
| +// head names, so only the record sweep can see it. |
| +func TestChannelsDigestsUnreadRecordLeavesTheAccountUnknown(t *testing.T) { |
| + s, _ := directDigestStore(t) |
| + key := release.PromotionRecordKey("bab", "km", "v0") |
| + if _, err := s.Put(context.Background(), key, []byte("whatever"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + rep, err := localPointerDigests(context.Background(), getFails{Store: s, key: key}, "", []string{"bab"}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(rep.Accounts) != 1 || rep.Accounts[0].Error == "" { |
| + t.Fatalf("accounts = %+v, want bab unknown", rep.Accounts) |
| + } |
| + var cell string |
| + for _, r := range *rep.Repairs { |
| + if r.Record && r.Version == "v0" { |
| + cell = repairCell(r) |
| + } |
| + } |
| + if !strings.HasPrefix(cell, strings.SplitN(textRepairRecordRetry, "(", 2)[0]) || !strings.HasSuffix(cell, "run carlos channels digests again") { |
| + t.Fatalf("v0's line = %q, want the run-again advice", cell) |
| + } |
| +} |
| + |
| +// Bare, direct-store `channels digests` with no account walks every account |
| +// directory in the bucket, as the console's door does (Fable P2-a round 2), |
| +// so its clean line covers the bucket. Named accounts scope both the walk |
| +// and the clean line. |
| +func TestChannelsDigestsDirectStoreWalksEveryAccount(t *testing.T) { |
| + s, _ := directDigestStore(t) // bab is clean |
| + ctx := context.Background() |
| + root, _ := release.ParseSigningKey(os.Getenv("CARLOS_RELEASE_KEY"), "test") |
| + legacy := release.ChannelPointer{Schema: 1, App: "web", Channel: "stable", Version: "v1", PromotedAt: time.Date(2026, 6, 1, 0, 0, 0, 0, time.UTC)} |
| + payload, _ := json.MarshalIndent(legacy, "", " ") |
| + b64 := base64.StdEncoding.EncodeToString(payload) |
| + wire, _ := json.Marshal(map[string]string{"payload": b64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(root, []byte(b64)))}) |
| + if _, err := s.Put(ctx, release.ChannelKey("bah", "web", "stable"), wire, ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + out := runDigests(t) |
| + if !strings.Contains(out, "bah") || !strings.Contains(out, textRepairUnbound) || strings.Contains(out, textRepairNone) { |
| + t.Fatalf("a bare run did not list the other account's unbound head:\n%s", out) |
| + } |
| + out = runDigests(t, "--account-id", "bab") |
| + if !strings.Contains(out, fmt.Sprintf(textRepairNoneFor, "bab")) || strings.Contains(out, textRepairNone) { |
| + t.Fatalf("named run's clean line is not scoped to bab:\n%s", out) |
| + } |
| +} |
| + |
| +// A resign plan over a head signed under a key grant that names no account |
| +// names that grant and its mint date before asking (hunt H3-M2 fix round 2, |
| +// Fable P2-a), so the operator checks it was the account's own builder or |
| +// deploy credential before the root key re-signs the head. |
| +func TestResignAPIModeNamesAnUnboundGrant(t *testing.T) { |
| + useTempCredentials(t) |
| + clearDeploymentEnv(t) |
| + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + json.NewEncoder(w).Encode(map[string]any{ |
| + "channel": "beta", "version": "v2", "digest": strings.Repeat("a", 64), |
| + "history": []string{}, "history_digests": []string{}, "computed": []bool{false}, |
| + "grant": "old-ci", "grant_minted_at": "2026-10-01T09:30:00Z", |
| + }) |
| + })) |
| + defer ts.Close() |
| + loginTo(t, ts.URL, "vicky@keymail.dev") |
| + prevIn := resignInput |
| + t.Cleanup(func() { resignInput = prevIn }) |
| + captured := captureStdout(t) |
| + resignInput = strings.NewReader("no\n") |
| + runChannelsResign([]string{"--app", "titogo", "--account", apiTestAccount, "beta"}) |
| + if want := fmt.Sprintf(textResignUnboundGrant, "old-ci", "2026-10-01"); !strings.Contains(captured.String(), want) { |
| + t.Fatalf("output lacks %q:\n%s", want, captured.String()) |
| + } |
| +} |
diff --git a/cli.go b/cli.go| index a3666090c..fe2ce948a 100644 |
| --- a/cli.go |
| +++ b/cli.go |
| @@ -3891,6 +3891,7 @@ func runKeygen(args []string) { |
| fs := flag.NewFlagSet("release-keygen", flag.ExitOnError) |
| scope := fs.String("scope", "", "mint a SCOPED key for these rungs, comma separated (canary,edge,beta) — stable is never delegable") |
| name := fs.String("name", "", "label for the scoped key; it appears in every refusal it causes") |
| + account := fs.String("account", "", "the only account the scoped key signs for") |
| expires := fs.Duration("expires", defaultGrantTTL, "how long the scoped key may sign for (max 8760h)") |
| fs.Usage = flagUsage(fs, "") |
| fs.Parse(args) |
| @@ -3910,8 +3911,8 @@ func runKeygen(args []string) { |
| return |
| } |
| - if *name == "" { |
| - log.Fatal("usage: carlos release-keygen --scope <rungs> --name <label> [--expires <dur>]") |
| + if *name == "" || *account == "" { |
| + log.Fatal("usage: carlos release-keygen --scope <rungs> --name <label> --account <sqid> [--expires <dur>]") |
| } |
| if release.IsScopedSeed(os.Getenv("CARLOS_RELEASE_KEY")) { |
| log.Fatal("CARLOS_RELEASE_KEY holds a scoped key: only the ROOT key can mint a grant, which is what makes a scoped key unable to widen itself") |
| @@ -3922,22 +3923,29 @@ func runKeygen(args []string) { |
| rungs = append(rungs, r) |
| } |
| } |
| - seed, grant, err := release.MintKeyGrant(signingKey(), *name, rungs, *expires) |
| + seed, grant, err := release.MintKeyGrant(signingKey(), *account, *name, rungs, *expires) |
| if err != nil { |
| log.Fatal(err) |
| } |
| fmt.Printf("CARLOS_RELEASE_KEY=%s\nCARLOS_RELEASE_GRANT=%s\n", seed, grant) |
| - fmt.Fprintf(os.Stderr, `scoped key %q for %s, expiring %s |
| + fmt.Fprintf(os.Stderr, `scoped key %q for %s of account %s, expiring %s |
| The KEY is the secret — store it wherever the builder's secrets live. |
| The GRANT is not secret (public material only) but must travel WITH the |
| key: a scoped key alone signs pointers nothing will accept. |
| CARLOS_RELEASE_PUBKEY does not change; the fleet still trusts one key. |
| - Deploy order: fleet binaries that understand grants FIRST, this key |
| - second. An older binary reads a grant-signed pointer as a bad signature, |
| - which is the right way round to fail but will stop that box adopting. |
| -`, *name, strings.Join(rungs, ", "), time.Now().UTC().Add(*expires).Format(time.RFC3339)) |
| + First scoped key on this deployment: deploy fleet binaries that understand |
| + grants FIRST, then this key. An older binary reads a grant-signed |
| + pointer as a bad signature. That is the right way to fail, but it stops |
| + that box adopting. |
| + |
| + Replacing a key minted before keys named an account: every box that |
| + understands grants accepts this key. Switch the builder to it and stop |
| + using the old key before you make the final repair, since upgraded consoles |
| + and boxes refuse whatever the old key signs. Then run carlos channels digests |
| + against the bucket and repair every line it lists before rollout. |
| +`, *name, strings.Join(rungs, ", "), *account, time.Now().UTC().Add(*expires).Format(time.RFC3339)) |
| } |
| // statusUsage is shared between "no flag given" and "-h/--help" so an |
diff --git a/docs/site/cli.md b/docs/site/cli.md| index 809907a22..f3ef78dba 100644 |
| --- a/docs/site/cli.md |
| +++ b/docs/site/cli.md |
| @@ -3413,14 +3413,15 @@ Mints the deployment's root signing key, or a scoped key that can sign only |
| certain rungs of the ladder. |
| ```sh |
| -carlos release-keygen --scope canary,edge --name builder |
| +carlos release-keygen --scope canary,edge --name builder --account <sqid> |
| ``` |
| With no flags it prints a fresh root pair: the key goes into your secret |
| manager, the public half into host config. With `--scope` it prints a key and |
| a grant. The grant carries no secret material but has to travel with the key, |
| -because a scoped key on its own signs pointers nothing will accept. Only the |
| -root key can mint a grant, which is what stops a scoped key widening itself. |
| +because a scoped key on its own signs pointers nothing will accept. A scoped |
| +key signs for the one account named by `--account`. Only the root key can mint |
| +a grant, which is what stops a scoped key widening itself. |
| ### carlos proof |
diff --git a/docs/superpowers/notes/2026-11-29-scoped-key-expiry.md b/docs/superpowers/notes/2026-11-29-scoped-key-expiry.md| new file mode 100644 |
| index 000000000..eb84c4d3b |
| --- /dev/null |
| +++ b/docs/superpowers/notes/2026-11-29-scoped-key-expiry.md |
| @@ -0,0 +1,110 @@ |
| +# Scoped release keys: expiry and revocation on boxes (hunt H3-M2, second half) |
| + |
| +Status: open, for Paul. Branch `sec-h3-m2-scoped-key` fixes the first half |
| +(a scoped key now signs for one account) and leaves this half alone. |
| + |
| +## The problem |
| + |
| +A grant's expiry is checked against the pointer's own `promoted_at` |
| +(`Grant.allowsRung`, spec §5), and the key's holder writes `promoted_at`. A box |
| +cannot tell when a signature was made. So the holder of a lapsed or leaked |
| +scoped key can still sign today a pointer dated inside the grant's old |
| +window, and it verifies on every box for good. The hunt witness is |
| +`TestHunt_H3_M2_LapsedScopedKeyStillSigns` (skipped on this branch, pointing |
| +here). |
| + |
| +What limits it today: |
| + |
| +- Since this branch, the key reaches only its own account, and never stable. |
| +- A box's floor (watermark, hunt H3-M5) refuses a pointer not newer than the |
| + one it last took. A backdated pointer has to be dated after the channel's |
| + current head, so any promote made after the grant lapsed shuts it out on |
| + boxes that saw that promote. A fresh or replaced box has no floor. |
| + |
| +What any fix has to respect: |
| + |
| +- Console deploy credentials mint a 5-minute grant per request |
| + (`deployGrantTTL`), and their pointers must keep verifying for as long as |
| + they are heads. A wall-clock expiry would take them dark after 5 minutes. |
| +- Adoption checks the head again on every pass, so a pointer that stops |
| + verifying takes running routes dark. |
| +- No new per-box polling (the S3 request-cost rule). |
| +- A bucket writer can delete or roll back anything a box does not hold a |
| + floor for. |
| + |
| +## Options |
| + |
| +None is built. Paul decides. |
| + |
| +**A. Wall-clock expiry plus a root re-sign.** Boxes refuse a scoped pointer |
| +or record once `now > expires_at` plus a grace period. This does enforce |
| +expiry on boxes. Its costs: |
| + |
| +- Before each grant runs out, the root key has to re-sign every head that |
| + grant signed, and every promotion record a box still needs (records of |
| + versions in a head's history, or launched by rootfs, proof binding, |
| + console copies or fleet create), not only heads. |
| +- A re-sign has to stamp later than the head it replaces (strict |
| + ordering), which moves bake and floor reasoning. |
| +- It needs a plan for a missed renewal. If the sweep does not run in time, |
| + heads and records go dark and running routes lose their channel. |
| +- A direct-mode deployment with no console has nothing to run the sweep, |
| + so its scoped heads go dark. |
| + |
| +**B. A revocation list in a root-signed object boxes already read.** Add |
| +`revoked_grants` (scoped public keys) to an object every box already |
| +verifies and holds a floor for each pass (the system pointer, say). Boxes |
| +refuse any pointer or record signed by a listed key, whatever its date. No |
| +new reads. This enforces explicit revocation, but only if every admission |
| +path checks it. A design would have to say, for each path: |
| + |
| +- rollback of the object carrying the list (its floor must stop a writer |
| + replaying an older list without the key); |
| +- what a box does when the object is missing or unreadable (refuse, or |
| + keep its last list); |
| +- a fresh box's bootstrap, which has no floor and no last list; |
| +- old verifiers, which ignore the field and keep accepting a revoked key |
| + until they upgrade. |
| + |
| +It does not expire anything: a lapsed key nobody listed keeps signing. |
| +Other costs: a box sees a revocation only when that object is next |
| +published; app trust starts depending on the system channel; and heads |
| +under a revoked key must be repaired before it is listed, or they go dark. |
| + |
| +**C. Scoped keys stay inside the console.** Customers' CI uses deploy |
| +credentials (console service tokens with rungs, revocable in the console |
| +database, in use since v0.24.2) instead of `release-keygen --scope` keys, |
| +and boxes cap a grant's life (`expires_at` minus `minted_at`) at a few |
| +minutes on verification. Today `maxGrantTTL` is 365 days. |
| + |
| +C does **not** close the lapsed-key finding on boxes. The cap bounds the |
| +length of a grant's window and nothing else; it says nothing about when a |
| +signature was made. Anyone who copies a 5-minute seed can sign tomorrow |
| +with a `promoted_at` inside yesterday's window, and a fresh box accepts it. |
| +Deleting the deploy credential does not invalidate what its seed signs. |
| +Nor can boxes tell that a short grant came from the console: a short grant |
| +minted by hand with the root key verifies the same. |
| + |
| +What C does is reduce exposure. It assumes the per-request seeds never |
| +leave the console's request (they are not stored or logged); if that holds, |
| +no long-lived scoped secret exists to lapse or leak. Costs: `release-keygen |
| +--scope` stops working for CI (self-hosted direct mode would sign with the |
| +root key or run a console), and heads and records signed under long grants |
| +need the same repair as this branch's account-less grants before boxes |
| +roll. If C is chosen, that repair can run together with this branch's so |
| +it is done once. |
| + |
| +## In short |
| + |
| +- A enforces expiry, at the cost of a re-sign sweep over heads and records |
| + and a plan for when it misses. |
| +- B enforces revocation of keys someone lists, if every admission path |
| + checks it; it does not expire unlisted keys. |
| +- C removes the long-lived secret but enforces nothing on boxes by itself. |
| + |
| +## Questions for Paul |
| + |
| +1. Can customers' CI move to deploy credentials (C), or do scoped keys have |
| + to keep working outside the console? |
| +2. Is box-enforced expiry (A) or revocation (B) needed on top, and if B, is |
| + a revocation that lands with the next system publish fast enough? |
diff --git a/docs/superpowers/notes/2026-11-30-scoped-key-account-rollout.md b/docs/superpowers/notes/2026-11-30-scoped-key-account-rollout.md| new file mode 100644 |
| index 000000000..6d9e5f35b |
| --- /dev/null |
| +++ b/docs/superpowers/notes/2026-11-30-scoped-key-account-rollout.md |
| @@ -0,0 +1,196 @@ |
| +# Scoped keys bound to one account: rollout (hunt H3-M2) |
| + |
| +Status: for the controller. Branch `sec-h3-m2-scoped-key`, fix round 2. |
| + |
| +## What changes |
| + |
| +A key grant now names one account. Every binary on this branch (CLI, |
| +console, box) refuses a channel pointer or promotion record signed under a |
| +grant that names no account (`ErrGrantUnbound`), on every read that acts on |
| +it. Writers mint only bound grants. Older binaries ignore the field, so a |
| +bound grant works on them as before. |
| + |
| +Two kinds of signer produced grants that name no account: |
| + |
| +- every console deploy-credential promote and rollback since v0.24.2 |
| + (`deploy.<credential>`, a 5-minute grant per request); |
| +- every `carlos release-keygen --scope` key minted before this branch. |
| + |
| +## Why the console cannot simply go first |
| + |
| +The console uses the same verifiers as boxes. The moment a console on this |
| +branch rolls, it refuses every head and record last signed by one of those |
| +grants: channel reads, the ladder check (edge to beta), pins, console |
| +copies, fleet create, and API rollback (strict `Channel`). The next deploy to |
| +a channel heals its head; idle channels and old records stay broken until an |
| +operator repairs them. So the listing has to be run, and emptied, before the |
| +console rolls as well as before boxes do. |
| + |
| +## How big it is |
| + |
| +Every console deploy-credential promote since v0.24.2 wrote a promotion |
| +record under an account-less grant. So the listing is roughly every |
| +retained version of every console-deployed app, plus the heads they lead. |
| +Each record needs one root-key `carlos releases authorize`, and each line |
| +whose grant is not obviously the account's own needs checking first (see |
| +"Before you re-sign anything" below). |
| + |
| +Choose the two-release split (last section; it would have to be built |
| +first) instead of this order if step |
| +1 lists more lines than the operators can check and repair inside one |
| +maintenance window, or if any account has lines whose grant nobody can |
| +identify quickly. Otherwise follow the order below. |
| + |
| +## Order |
| + |
| +Every scan below uses a CLI built from this branch in direct-store mode, |
| +bare, with no `--account-id`. In that mode it reads every account directory |
| +in the bucket, as the console's door does, and its clean line ("nothing to |
| +repair: every head and promotion record in the bucket...") covers the |
| +whole bucket. With `--account-id` it reads only the accounts named, and its |
| +clean line names them; that is fine for a repair loop on one account, but |
| +it is never the gate. Do not scan through a console that is not on this |
| +branch: it lists neither records nor heads under account-less grants. |
| + |
| +```sh |
| +CARLOS_DEPLOYMENT_BUCKET=<bucket> CARLOS_RELEASE_PUBKEY=<pub> carlos channels digests |
| +``` |
| + |
| +A bare report only reads and needs no key. Do dev first, then flagship. |
| + |
| +1. **Size it, before anything rolls (the controller, live).** Run the bare |
| + scan. Its lines: |
| + |
| + - a head not bound to its account (the pointer names none, or the grant |
| + it was signed under names none): promote that version again, after |
| + the check below; |
| + - a promotion record not bound to its account, for any version, whether |
| + or not a channel names it: `carlos releases authorize`. Promoting the |
| + head again does not repair a record: the head is re-signed, but no |
| + record is written for an unchanged head; |
| + - a promotion record refused for another reason (another account's |
| + grant, a bad signature, outside its grant's window, an invalid |
| + payload): `carlos releases authorize`; |
| + - a promotion record whose build is gone: see "Records with no build"; |
| + - a promotion record that could not be read (a store error): run the |
| + scan again. It ends the command with exit 1, and the scan reads clean |
| + only when every record was read. |
| + |
| + For lines signed under an account-less grant, the SIGNED UNDER column |
| + names the grant and its mint date. |
| + |
| +2. **Replace or pause every old writer.** Anything still signing under an |
| + account-less grant after the final scan creates new lines that consoles |
| + and boxes then refuse. |
| + - Builders on a pre-branch `--scope` key: mint a replacement with `carlos |
| + release-keygen --scope ... --account <sqid>` and switch the builder to |
| + it, or pause the builder. Every box that understands grants accepts a |
| + bound grant, so the switch can happen now. A CLI from this branch |
| + refuses to load an account-less key at all. |
| + - Console deploy credentials: an old console mints an account-less grant |
| + on every deploy, and nothing but the console's upgrade changes that. |
| + From step 3 until consoles have rolled in step 4, pause |
| + deploy-credential deploys (the maintenance window). |
| + |
| +3. **Final repair and clean scan.** With every old writer replaced or |
| + paused, repair what the bare scan lists, from the branch CLI in |
| + direct-store mode with the root key. (An older CLI's ladder promote |
| + treats a repeat onto a head that names an account as a no-op, so it does |
| + not repair a grant-unbound head.) Repeat until the bare scan reads clean. |
| + |
| +4. **Roll consoles**, then end the deploy pause. From here the console |
| + mints bound grants. Run the bare scan again (direct-store, or now the |
| + rolled console's door, which also reads every account). It should still |
| + be clean; a new line means a writer step 2 missed. Find it, replace or |
| + pause it, and repair the line. |
| + |
| +5. **Roll boxes** on a deployment only once its bare scan is clean (dev |
| + first). Boxes refuse what the scan lists. |
| + |
| +## Before you re-sign anything |
| + |
| +The SIGNED UNDER name and mint date identify a grant; they do not prove |
| +whose it was. `deploy.<name>` is the deploy credential's own name |
| +(`deploySigner`), not unique across accounts, so another account's |
| +credential with the same name looks the same. Telling a planted head apart |
| +by it rests on the console's per-request seeds never leaving the request. |
| + |
| +A repair re-signs more than the head. Promote inherits the old head's |
| +history and history digests, a rollback takes its `History[0]`, and resign |
| +re-signs all of it. Promoting a version you trust over a planted head does |
| +not remove the plant: the planted version becomes the root-signed rollback |
| +target. |
| + |
| +So for any line whose grant is not plainly the account's own builder or |
| +one of its deploy credentials, or that nobody can identify: stop. Do not |
| +promote, roll back, resign or authorize on that channel or version. First |
| +verify the whole head and every version in its history: that the account |
| +shipped each one (the version's manifest and its digest are the account's |
| +own build) and that the account promoted each one (its audit trail and the |
| +console's activity log). Re-sign only once all of it checks out. If any of |
| +it does not, treat it as an incident, not a repair. |
| + |
| +The listing and the resign plan show the grant. Promote and `releases |
| +authorize` do not show it at signing time, so the listing is the check for |
| +those. |
| + |
| +## Records with no build |
| + |
| +A line "promotion record for a build that is gone" stays in the listing, |
| +and blocks the gate, until it is resolved. `carlos releases authorize` |
| +cannot replace it, since there is no manifest to authorize. Two cases: |
| + |
| +- **The build is needed** (a channel head or any history entry names the |
| + version, or someone expects to launch it): restore the build from where |
| + it was shipped from, then run `carlos releases authorize`. |
| +- **The build was being deleted.** Version deletion (box retention's |
| + `DeleteVersion`) removes the manifest first and the promotion record |
| + last, so a record with no manifest is a half-finished delete. No CLI verb |
| + deletes a version, so finish it the way the delete would have: once you |
| + have checked that no channel head or history names the version, remove |
| + the object `releases/<account>/<app>/promoted/<version>` from the bucket. |
| + |
| +## What stays open until the listing is empty |
| + |
| +The write verbs' read of the head they replace (`verifyPredecessor`) still |
| +accepts a head under a grant that names no account. This is what lets |
| +promote, rollback and resign repair such a head, and it stays until the |
| +listing is empty on dev and flagship. Remove it then, in a follow-up (Fable |
| +P3). |
| + |
| +Until then, or until a root key rotation, anyone holding a scoped key |
| +minted before this branch (a lapsed one too, by backdating `promoted_at`) |
| +keeps this path. With bucket write access they can plant a head in another |
| +account. Boxes and consoles refuse to act on it, but the write verbs copy |
| +from it: resign, fast-track and `accounts migrate` re-sign its version and |
| +history; an ordinary promote inherits its history and history digests; a |
| +rollback takes its `History[0]`. The check in "Before you re-sign anything" |
| +is the operator's defence meanwhile. |
| + |
| +Inventory of those keys: the SIGNED UNDER names in the step 1 scan on |
| +dev and flagship, plus whatever the operators recorded when they minted |
| +`--scope` keys. Nothing in the bucket lists a grant that no longer signs |
| +any object there, so a key that signed nothing still present is known |
| +only from the operators' own records. |
| + |
| +## A two-release split (described, not built) |
| + |
| +The refusal is one branch in one function: `Grant.allowsAccount` returning |
| +`GrantUnboundError` when `g.Account == ""` (plus the matching check in |
| +`ScopedSigner`). A split would be: |
| + |
| +- **Release N:** that branch accepts. Writers mint bound grants, bound |
| + grants are checked for their account everywhere, and the listing ships. |
| + The listing must still name account-less grants, so it needs its own |
| + predicate, separate from the refusal. |
| +- **Release N+1:** the branch refuses, as this branch does now. |
| + |
| +The switch has to be compiled in. It must not be an environment variable |
| +or config a box reads, since that would give a way to weaken the check. |
| + |
| +The cost is that the cross-account hole stays open through all of release |
| +N, for every pre-branch scoped key and every old deploy-credential head: |
| +an old key, lapsed or leaked, still signs for any account. It also takes a |
| +second release and a second full roll. The gain is that no console ever |
| +refuses a live head. Once N is on consoles, deploys mint only bound grants, |
| +so the listing only shrinks and can be emptied at leisure before N+1. |
diff --git a/docs/superpowers/notes/census-proposal-sec-h3-m2-scoped-key.md b/docs/superpowers/notes/census-proposal-sec-h3-m2-scoped-key.md| new file mode 100644 |
| index 000000000..5b7a9f224 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-sec-h3-m2-scoped-key.md |
| @@ -0,0 +1,19 @@ |
| +# Census approval: sec-h3-m2-scoped-key |
| + |
| +Ruling `census-ruling-sec-h3-m2-scoped-key`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `channels_digests.go` `runChannelsResign` | body | unchanged (1) | before asking, prints the plan's grant name and mint date when the head was signed under a key grant that names no account (fix round 2, Fable P2-a); same plan read and same Resign call, no new read; copy pass, literals only | |
| + |
| +Envelopes re-pinned: `.`, `internal/release`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `channels_digests.go` `runChannelsResign`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input |
| + |
| +Seal: `76f69ece310924c374511605d0f6c718464d6374292961ca6a53955ec36f6e21` → `4f307fb962a2aac71640ebc18058c02a29d6c7175b93ff1461317e37b94fca4b`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-sec-h3-m2-scoped-key.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/console/apicli.go b/internal/console/apicli.go| index bbc6436fe..c891aaa25 100644 |
| --- a/internal/console/apicli.go |
| +++ b/internal/console/apicli.go |
| @@ -1197,7 +1197,7 @@ func (s *Server) handleAPIPromote(w http.ResponseWriter, r *http.Request) { |
| signer := release.RootSigner(s.cfg.Key) |
| var authorize func(*release.Pipeline) error |
| if p.Kind == PrincipalService && p.Role == svcrole.Deploy { |
| - sg, serr := s.deploySigner(p) |
| + sg, serr := s.deploySigner(p, acct.Sqid) |
| if serr != nil { |
| log.Printf("console: deploy signer for %s/%s: %v", acct.Sqid, app, serr) |
| jsonError(w, http.StatusServiceUnavailable, "could not prepare a signing key for this deploy credential. Nothing was promoted.") |
| @@ -1482,7 +1482,7 @@ func (s *Server) handleAPIRollback(w http.ResponseWriter, r *http.Request) { |
| signer := release.RootSigner(s.cfg.Key) |
| var authorize func(*release.Pipeline) error |
| if p.Kind == PrincipalService && p.Role == svcrole.Deploy { |
| - sg, serr := s.deploySigner(p) |
| + sg, serr := s.deploySigner(p, acct.Sqid) |
| if serr != nil { |
| log.Printf("console: deploy signer for %s/%s: %v", acct.Sqid, app, serr) |
| jsonError(w, http.StatusServiceUnavailable, "could not prepare a signing key for this deploy credential. Nothing was rolled back.") |
diff --git a/internal/console/apidigests.go b/internal/console/apidigests.go| index d2e9cfed9..1c3cff878 100644 |
| --- a/internal/console/apidigests.go |
| +++ b/internal/console/apidigests.go |
| @@ -85,10 +85,16 @@ func (s *Server) handleAPIChannelResign(w http.ResponseWriter, r *http.Request) |
| return |
| } |
| if req.Digest == "" { |
| - writeJSON(w, http.StatusOK, map[string]any{ |
| + body := map[string]any{ |
| "channel": plan.Channel, "version": plan.Version, "digest": plan.Digest, |
| "history": plan.History, "history_digests": plan.HistoryDigests, "computed": plan.Computed, |
| - }) |
| + } |
| + // A head signed under a grant that names no account: the CLI |
| + // names it before asking (hunt H3-M2, fix round 2). |
| + if plan.Grant != "" { |
| + body["grant"], body["grant_minted_at"] = plan.Grant, grantMinted(plan.Grant, plan.GrantMintedAt) |
| + } |
| + writeJSON(w, http.StatusOK, body) |
| return |
| } |
| if req.Digest != plan.Digest || !slices.Equal(req.HistoryDigests, plan.HistoryDigests) { |
| @@ -281,15 +287,34 @@ type digestChRow struct { |
| } |
| // digestRepRow is a channel whose head a fresh or replaced box would refuse |
| -// (release.ChannelDigestState.NeedsRepair), listed whatever the |
| -// account's marker says: the account binding's rollout waits on none. |
| +// (release.ChannelDigestState.NeedsRepair), or with Record a promotion |
| +// record one refuses (release.RecordReport: no channel; Error when refused |
| +// for a reason other than an account-less grant, Unread when it was not |
| +// read at all, NoBuild when its build is gone), listed whatever the |
| +// account's marker says: the account |
| +// binding's rollout waits on none. Grant and GrantMintedAt name a key grant |
| +// that names no account the line was signed under. |
| type digestRepRow struct { |
| - Account string `json:"account"` |
| - App string `json:"app"` |
| - Channel string `json:"channel"` |
| - Version string `json:"version"` |
| - Unbound bool `json:"unbound,omitempty"` |
| - NoRecord bool `json:"no_record,omitempty"` |
| + Account string `json:"account"` |
| + App string `json:"app"` |
| + Channel string `json:"channel"` |
| + Version string `json:"version"` |
| + Unbound bool `json:"unbound,omitempty"` |
| + NoRecord bool `json:"no_record,omitempty"` |
| + Record bool `json:"record,omitempty"` |
| + Error string `json:"error,omitempty"` |
| + Unread bool `json:"unread,omitempty"` |
| + NoBuild bool `json:"no_build,omitempty"` |
| + Grant string `json:"grant,omitempty"` |
| + GrantMintedAt string `json:"grant_minted_at,omitempty"` |
| +} |
| + |
| +// grantMinted is a grant's mint time on the wire, or "" for no grant. |
| +func grantMinted(grant string, at time.Time) string { |
| + if grant == "" { |
| + return "" |
| + } |
| + return at.UTC().Format(time.RFC3339) |
| } |
| // digestAccountWalk is one account's part of the pointer digests report. |
| @@ -339,8 +364,24 @@ func (s *Server) walkDigestAccount(ctx context.Context, sqid string, bucketOnly |
| row.Error = st.RecordErr // unknown whether it needs a repair |
| } |
| if st.Err == "" && st.NeedsRepair() { |
| - wk.repairs = append(wk.repairs, digestRepRow{Account: sqid, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord}) |
| + wk.repairs = append(wk.repairs, digestRepRow{Account: sqid, App: app, Channel: st.Channel, Version: st.Version, Unbound: st.Unbound, NoRecord: st.NoRecord, |
| + Grant: st.Grant, GrantMintedAt: grantMinted(st.Grant, st.GrantMintedAt)}) |
| + } |
| + } |
| + // Every record a box refuses, whichever head names its version: one |
| + // that was not read at all is a line and leaves the account |
| + // unknown, so the gate never reads clean over it. |
| + recs, err := release.RecordReport(ctx, s.cfg.Releases, s.cfg.ReleasePub, sqid, app) |
| + if err != nil { |
| + row.Error = err.Error() |
| + break |
| + } |
| + for _, rec := range recs { |
| + if rec.Unread && row.Error == "" { |
| + row.Error = rec.Err |
| } |
| + wk.repairs = append(wk.repairs, digestRepRow{Account: sqid, App: app, Version: rec.Version, Record: true, Error: rec.Err, |
| + Unread: rec.Unread, NoBuild: rec.NoBuild, Grant: rec.Grant, GrantMintedAt: grantMinted(rec.Grant, rec.GrantMintedAt)}) |
| } |
| } |
| return wk |
diff --git a/internal/console/apidigests_test.go b/internal/console/apidigests_test.go| index 327af57da..fc2cff07c 100644 |
| --- a/internal/console/apidigests_test.go |
| +++ b/internal/console/apidigests_test.go |
| @@ -660,3 +660,137 @@ func TestSystemDigestsDoorWalksAccountsInParallelInOrder(t *testing.T) { |
| t.Fatalf("at most %d account walks ran at once, want 2 to 4", slow.most) |
| } |
| } |
| + |
| +// The rollout listing through the console lists every promotion record a |
| +// box refuses (hunt H3-M2, fix round 2): one signed under a key grant that |
| +// names no account, whichever head names its version, with the grant's name |
| +// and mint date; junk whose build is gone (no_build); and one a store error |
| +// kept from being read (unread), which alone leaves the account's row |
| +// unknown. |
| +func TestSystemDigestsDoorListsEveryRecordABoxRefuses(t *testing.T) { |
| + fx := newDigestsFixture(t) |
| + ctx := context.Background() |
| + pub, key, _ := ed25519.GenerateKey(nil) |
| + minted := time.Now().UTC().Add(-time.Hour).Truncate(time.Second) |
| + g, _ := json.Marshal(release.Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(pub), Rungs: []string{release.RungEdge}, |
| + Name: "old-ci", MintedAt: minted, ExpiresAt: minted.Add(48 * time.Hour)}) |
| + g64 := base64.StdEncoding.EncodeToString(g) |
| + raw, _, err := fx.store.Get(ctx, release.ManifestKey(release.OpsAccount, "km", "v1")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + rec, _ := json.Marshal(release.PromotionRecord{Schema: 1, Account: release.OpsAccount, App: "km", Version: "v1", |
| + ManifestDigest: release.ManifestDigest(raw), Channel: "edge", At: time.Now().UTC().Truncate(time.Second)}) |
| + r64 := base64.StdEncoding.EncodeToString(rec) |
| + wire, _ := json.Marshal(map[string]any{"payload": r64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(key, []byte(r64))), |
| + "grant": map[string]string{"payload": g64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(fx.priv, []byte(g64)))}}) |
| + k := release.PromotionRecordKey(release.OpsAccount, "km", "v1") |
| + _, etag, _ := fx.store.Get(ctx, k) |
| + if _, err := fx.store.Put(ctx, k, wire, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := fx.store.Put(ctx, release.PromotionRecordKey(release.OpsAccount, "km", "v7"), []byte("junk"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + unread := release.PromotionRecordKey(release.OpsAccount, "km", "v6") |
| + if _, err := fx.store.Put(ctx, unread, []byte("whatever"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + fx.srv.cfg.Releases = recordGetFails{Store: fx.srv.cfg.Releases, key: unread} |
| + st, out := getRaw(t, fx.ts.URL+"/api/cli/system/pointer-digests", fx.operator) |
| + if st != http.StatusOK { |
| + t.Fatalf("report: %d %s", st, out) |
| + } |
| + var rep struct { |
| + Accounts []struct{ Account, Error string } `json:"accounts"` |
| + Repairs []struct { |
| + Account, App, Channel, Version, Error, Grant string |
| + Record bool `json:"record"` |
| + Unread bool `json:"unread"` |
| + NoBuild bool `json:"no_build"` |
| + GrantMintedAt string `json:"grant_minted_at"` |
| + } `json:"repairs"` |
| + } |
| + if err := json.Unmarshal([]byte(out), &rep); err != nil { |
| + t.Fatalf("report body %s: %v", out, err) |
| + } |
| + got := map[string]string{} |
| + for _, r := range rep.Repairs { |
| + if r.Record { |
| + got[r.Version] = fmt.Sprintf("grant=%s minted=%s err=%t unread=%t nobuild=%t", r.Grant, r.GrantMintedAt, r.Error != "", r.Unread, r.NoBuild) |
| + } |
| + } |
| + want := map[string]string{ |
| + "v1": "grant=old-ci minted=" + minted.Format(time.RFC3339) + " err=false unread=false nobuild=false", |
| + "v6": "grant= minted= err=true unread=true nobuild=false", |
| + "v7": "grant= minted= err=true unread=false nobuild=true", |
| + } |
| + if fmt.Sprint(got) != fmt.Sprint(want) { |
| + t.Fatalf("record repairs = %v, want %v\n%s", got, want, out) |
| + } |
| + for _, a := range rep.Accounts { |
| + if a.Account == release.OpsAccount && !strings.Contains(a.Error, "promotion record could not be read") { |
| + t.Fatalf("bab's row error = %q, want the unread record's:\n%s", a.Error, out) |
| + } |
| + } |
| +} |
| + |
| +// recordGetFails is a store whose Get of one key fails as a bucket outage |
| +// would. |
| +type recordGetFails struct { |
| + release.Store |
| + key string |
| +} |
| + |
| +func (s recordGetFails) Get(ctx context.Context, key string) ([]byte, string, error) { |
| + if key == s.key { |
| + return nil, "", errors.New("503 slow down") |
| + } |
| + return s.Store.Get(ctx, key) |
| +} |
| + |
| +// The resign door's plan names the key grant a head was signed under when |
| +// that grant names no account, with its mint date (hunt H3-M2 fix round 2, |
| +// Fable P2-a): the root key is about to re-sign that head, and the operator |
| +// checks first that the grant was this account's own. |
| +func TestResignDoorPlanNamesAnUnboundGrant(t *testing.T) { |
| + fx := newDigestsFixture(t) |
| + ctx := context.Background() |
| + pub, key, _ := ed25519.GenerateKey(nil) |
| + minted := time.Now().UTC().Add(-time.Hour).Truncate(time.Second) |
| + g, _ := json.Marshal(release.Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(pub), Rungs: []string{release.RungBeta}, |
| + Name: "old-ci", MintedAt: minted, ExpiresAt: minted.Add(48 * time.Hour)}) |
| + g64 := base64.StdEncoding.EncodeToString(g) |
| + k := release.ChannelKey(release.OpsAccount, "km", "beta") |
| + cur, err := release.Channel(ctx, fx.store, fx.pub, release.OpsAccount, "km", "beta") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + p := *cur |
| + p.PromotedAt = p.PromotedAt.Add(time.Second) |
| + payload, _ := json.Marshal(p) |
| + p64 := base64.StdEncoding.EncodeToString(payload) |
| + wire, _ := json.Marshal(map[string]any{"payload": p64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(key, []byte(p64))), |
| + "grant": map[string]string{"payload": g64, "sig": base64.StdEncoding.EncodeToString(ed25519.Sign(fx.priv, []byte(g64)))}}) |
| + _, etag, _ := fx.store.Get(ctx, k) |
| + if _, err := fx.store.Put(ctx, k, wire, etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := release.Channel(ctx, fx.store, fx.pub, release.OpsAccount, "km", "beta"); !errors.Is(err, release.ErrGrantUnbound) { |
| + t.Fatalf("control: the planted head reads %v, want ErrGrantUnbound", err) |
| + } |
| + st, out := postRaw(t, fx.ts.URL+"/api/cli/apps/bab/km/channels/resign", map[string]string{"channel": "beta"}, fx.member) |
| + if st != http.StatusOK { |
| + t.Fatalf("plan: %d %s", st, out) |
| + } |
| + var plan struct { |
| + Grant string `json:"grant"` |
| + GrantMintedAt string `json:"grant_minted_at"` |
| + } |
| + if err := json.Unmarshal([]byte(out), &plan); err != nil { |
| + t.Fatal(err) |
| + } |
| + if plan.Grant != "old-ci" || plan.GrantMintedAt != minted.Format(time.RFC3339) { |
| + t.Fatalf("plan names grant %q minted %q, want old-ci minted %s\n%s", plan.Grant, plan.GrantMintedAt, minted.Format(time.RFC3339), out) |
| + } |
| +} |
diff --git a/internal/console/deployscope.go b/internal/console/deployscope.go| index 0d88784a4..f77ebc007 100644 |
| --- a/internal/console/deployscope.go |
| +++ b/internal/console/deployscope.go |
| @@ -152,14 +152,15 @@ func (s *Server) writeDeployRefusal(w http.ResponseWriter, err error) { |
| const deployGrantTTL = 5 * time.Minute |
| // deploySigner mints a scoped key and a root-signed grant for exactly the |
| -// credential's rungs, for one request. Boxes then verify the rung limit as |
| -// they do for a scoped CI key today. Nothing is stored. Any failure refuses |
| -// the request: a deploy write never falls back to the root signer. |
| -func (s *Server) deploySigner(p Principal) (release.Signer, error) { |
| +// credential's rungs and the request's account, for one request. Boxes then |
| +// verify the rung limit and the account as they do for a scoped CI key |
| +// today. Nothing is stored. Any failure refuses the request: a deploy write |
| +// never falls back to the root signer. |
| +func (s *Server) deploySigner(p Principal, acct string) (release.Signer, error) { |
| if len(p.Rungs) == 0 { |
| return release.Signer{}, errors.New("deploy credential carries no rungs") |
| } |
| - seed, grant, err := release.MintKeyGrant(s.cfg.Key, "deploy."+p.Name, p.Rungs, deployGrantTTL) |
| + seed, grant, err := release.MintKeyGrant(s.cfg.Key, acct, "deploy."+p.Name, p.Rungs, deployGrantTTL) |
| if err != nil { |
| return release.Signer{}, err |
| } |
diff --git a/internal/console/deploysign_test.go b/internal/console/deploysign_test.go| index ed555b856..2f7c11ca5 100644 |
| --- a/internal/console/deploysign_test.go |
| +++ b/internal/console/deploysign_test.go |
| @@ -155,7 +155,7 @@ func TestDeployRepeatIsANoOp(t *testing.T) { |
| func TestDeploySignerRefusesWithoutTheScopeFunction(t *testing.T) { |
| fx, _, _ := deployFixture(t) |
| - sg, err := fx.srv.deploySigner(Principal{Kind: PrincipalService, Role: svcrole.Deploy, Name: "ci", App: "hello", Rungs: []string{"edge"}}) |
| + sg, err := fx.srv.deploySigner(Principal{Kind: PrincipalService, Role: svcrole.Deploy, Name: "ci", App: "hello", Rungs: []string{"edge"}}, "bab") |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -165,6 +165,11 @@ func TestDeploySignerRefusesWithoutTheScopeFunction(t *testing.T) { |
| t.Errorf("signer promoted %s with no Authorize hook", ch) |
| } |
| } |
| + // The request's grant names the request's account (hunt H3-M2): even |
| + // on its own rung it signs for no other. |
| + if _, err := sg.PromoteOnLadder(ctx, fx.rel, "bae", "hello", "edge", "v1", release.PromoteOptions{Hotfix: true}); err == nil || !strings.Contains(err.Error(), "account bab") { |
| + t.Errorf("a deploy signer for bab promoted bae's edge: err = %v", err) |
| + } |
| } |
| func TestDeploySignerFailureFailsClosed(t *testing.T) { |
diff --git a/internal/dbreads/envelope_test.go b/internal/dbreads/envelope_test.go| index aa26621dc..b2d82a2ea 100644 |
| --- a/internal/dbreads/envelope_test.go |
| +++ b/internal/dbreads/envelope_test.go |
| @@ -99,7 +99,7 @@ func TestEnvelopeRefusesForgeryAndReplay(t *testing.T) { |
| func TestEnvelopeScopedKeyCannotSign(t *testing.T) { |
| t.Parallel() |
| rootPub, rootPriv := rootKeys(t) |
| - seed, grant, err := release.MintKeyGrant(rootPriv, "ci", []string{"canary"}, time.Hour) |
| + seed, grant, err := release.MintKeyGrant(rootPriv, "bab", "ci", []string{"canary"}, time.Hour) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go| index dcd64b8c9..d039c9ede 100644 |
| --- a/internal/provision/plan9_b8_census_test.go |
| +++ b/internal/provision/plan9_b8_census_test.go |
| @@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) { |
| if len(got) < 100 { |
| t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root) |
| } |
| - inventory := instanceUsageWriteCensusInventory() |
| + inventory := secH3M2ScopedKeyWriteCensusInventory() |
| problems := append(censusDiff(inventory, got), censusPolicy(inventory)...) |
| if len(problems) > 0 { |
| t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n ")) |
diff --git a/internal/provision/sec_h3_m2_scoped_key_census_test.go b/internal/provision/sec_h3_m2_scoped_key_census_test.go| new file mode 100644 |
| index 000000000..42c819de2 |
| --- /dev/null |
| +++ b/internal/provision/sec_h3_m2_scoped_key_census_test.go |
| @@ -0,0 +1,43 @@ |
| +package provision |
| + |
| +// secH3M2ScopedKeyWriteCensusInventory is the record-write census for branch |
| +// sec-h3-m2-scoped-key (hunt H3-M2: a scoped release key signs only for the |
| +// account its grant names), layered on instanceUsageWriteCensusInventory. |
| +// Reviewed by the branch author against the source. No record write is |
| +// added, moved or reclassified; four units are re-pinned: |
| +// |
| +// - Signer.WritePromotionRecord (promotion.go): the scope check passes the |
| +// record's account to sg.allows, so a scoped key refuses a record for |
| +// another account before its one Put of the same PromotionRecordKey. |
| +// - ReadPromotionRecord (promotion.go): a comment and the record's account |
| +// passed to the grant's scope check; in fix round 2, a store error on |
| +// the one Get is wrapped in ErrRecordUnread so the repair listing tells |
| +// an unread record from a refused one. The read of PromotionRecordKey is |
| +// unchanged. |
| +// - Signer.claimRawPromote and Signer.claimRawRollbackAuthorized |
| +// (release.go): the early scope check names the account; each is still |
| +// one conditional Put of the same signed channel pointer key. |
| +func secH3M2ScopedKeyWriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), instanceUsageWriteCensusInventory()...) |
| + repins := []censusEntry{ |
| + {"internal/release/promotion.go", "ReadPromotionRecord", "key-site", "key:PromotionRecordKey", "7cfc50ec38b44db87f22299b1fc2e00e2c0b084684c600c2ba9d41f68bccb2f9"}, |
| + {"internal/release/promotion.go", "Signer.WritePromotionRecord", "foreign-recordkey", "key:PromotionRecordKey,sel:Put", "23af3631344974377e4c3f2d64b93908f56a2c7a5949511da28a745e085a567c"}, |
| + {"internal/release/release.go", "Signer.claimRawPromote", "nonrecord", "sel:Put", "0c1481d9b6bb26ba3524c2fb3c9e7a5676a0bfec8225d7598ea17769379e7b52"}, |
| + {"internal/release/release.go", "Signer.claimRawRollbackAuthorized", "nonrecord", "sel:Put", "3b658b62eae3e919d801137992b96d66a818df655f2fc1e8dcf25c4d7d6b05d1"}, |
| + } |
| + for _, r := range repins { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + if e.Class != r.Class || e.Kinds != r.Kinds { |
| + panic("sec-h3-m2-scoped-key re-pin changes the class or kinds of " + r.File + ":" + r.Unit) |
| + } |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("sec-h3-m2-scoped-key re-pin of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + return entries |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index ea1753789..98bf34d05 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -318,3 +318,4 @@ plan14-root-reads-instance-usage.tsv e3c8bc6a560e863ed44c7ab2f9367a4347ec767d8da |
| plan14-root-reads-sec-h5-m8-fleet-hostnames.tsv a6a19c800d55f99ed1c70068e38ffa66aef7af8f55199e97e986d9bbb0e0d80d |
| plan14-root-reads-infra-floor-keys-deny.tsv 3d13ade9d1fce3bc1a7d7250d75f2cc5ea3563ca6426401f428ca3a86af19619 |
| plan14-root-reads-sec-h3-m3-envelope.tsv 76f69ece310924c374511605d0f6c718464d6374292961ca6a53955ec36f6e21 |
| +plan14-root-reads-sec-h3-m2-scoped-key.tsv 4f307fb962a2aac71640ebc18058c02a29d6c7175b93ff1461317e37b94fca4b |
diff --git a/internal/provision/testdata/plan14-root-reads-sec-h3-m2-scoped-key.tsv b/internal/provision/testdata/plan14-root-reads-sec-h3-m2-scoped-key.tsv| new file mode 100644 |
| index 000000000..07c44bc03 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-sec-h3-m2-scoped-key.tsv |
| @@ -0,0 +1,6 @@ |
| +# Census overlay sec-h3-m2-scoped-key, written by census-propose (#369). census-ruling-sec-h3-m2-scoped-key, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-sec-h3-m2-scoped-key.md. |
| +# 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy 7ee23b3e31161d4564df522d0ebd3212493454373f256af24e036a298354d1cc channels_digests.go runChannelsResign legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sec-h3-m2-scoped-key;basis=before asking, prints the plan's grant name and mint date when the head was signed under a key grant that names no account (fix round 2, Fable P2-a); same plan read and same Resign call, no new read; copy pass, literals only file:ReadString@1300 53f6cda6f4410e1cc46f432239460ddefbc5d355454fbca7e68de46dfbfbbb61 |
| +channels_digests.go runChannelsResign legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sec-h3-m2-scoped-key;basis=before asking, prints the plan's grant name and mint date when the head was signed under a key grant that names no account (fix round 2, Fable P2-a); same plan read and same Resign call, no new read; copy pass, literals only file:ReadString@1300 53f6cda6f4410e1cc46f432239460ddefbc5d355454fbca7e68de46dfbfbbb61 |
| +@coverage . 46466c12842597caa7e3a0d0998d288a27688c84f770d309166a6b414a09ef0e |
| +@coverage internal/release 9e4fa8578ce9848992c7cd81f2d31c046a2517d0963fb226bb4b6ca4aa101b0e |
diff --git a/internal/release/authorize_record_test.go b/internal/release/authorize_record_test.go| index 5377638e7..8eb3b49b3 100644 |
| --- a/internal/release/authorize_record_test.go |
| +++ b/internal/release/authorize_record_test.go |
| @@ -70,7 +70,7 @@ func TestAuthorizeIsRootOnly(t *testing.T) { |
| s := NewDirStore(t.TempDir()) |
| ctx := context.Background() |
| root, pub := testKeys(t) |
| - seed, grant, _ := MintKeyGrant(root, "ci", []string{"canary"}, time.Hour) |
| + seed, grant, _ := MintKeyGrant(root, "bab", "ci", []string{"canary"}, time.Hour) |
| key, _ := ParseSigningKey(seed, "test") |
| sg, err := ScopedSigner(key, grant, pub) |
| if err != nil { |
diff --git a/internal/release/digestmarker_test.go b/internal/release/digestmarker_test.go| index 3b9ed045a..1fccf0221 100644 |
| --- a/internal/release/digestmarker_test.go |
| +++ b/internal/release/digestmarker_test.go |
| @@ -52,7 +52,7 @@ func TestDigestMarkerIsRootOnly(t *testing.T) { |
| s := NewDirStore(t.TempDir()) |
| ctx := context.Background() |
| root, pub := testKeys(t) |
| - seed, grant, err := MintKeyGrant(root, "ci", []string{"canary"}, time.Hour) |
| + seed, grant, err := MintKeyGrant(root, "bab", "ci", []string{"canary"}, time.Hour) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/release/digests.go b/internal/release/digests.go| index 3e0c03d53..b94287e88 100644 |
| --- a/internal/release/digests.go |
| +++ b/internal/release/digests.go |
| @@ -6,6 +6,7 @@ import ( |
| "crypto/sha256" |
| "errors" |
| "fmt" |
| + "os" |
| "slices" |
| "strings" |
| "time" |
| @@ -145,9 +146,14 @@ type ChannelDigestState struct { |
| Err string `json:"error,omitempty"` |
| // Unbound is a pointer signed before the account binding: it names no |
| // account, and every box that acts on a pointer refuses it |
| - // (ErrPointerUnbound, hunt H3-M8). The line is still filled in from the |
| - // pointer, so the channel can be repaired by name. |
| + // (ErrPointerUnbound, hunt H3-M8), or it was signed under a key grant |
| + // that names no account (ErrGrantUnbound, hunt H3-M2). The line is still |
| + // filled in from the pointer, so the channel can be repaired by name. |
| Unbound bool `json:"unbound,omitempty"` |
| + // Grant and GrantMintedAt name the key grant an Unbound head was signed |
| + // under when that grant names no account, and are empty otherwise. |
| + Grant string `json:"grant,omitempty"` |
| + GrantMintedAt time.Time `json:"grant_minted_at,omitzero"` |
| // NoRecord is a head that signs no digest and has no promotion record |
| // with one: a fresh or replaced box refuses to stage it, since nothing |
| // binds its bytes (stagePointerHead, hunt H3-M1). RecordErr is a record |
| @@ -220,7 +226,8 @@ func bucketDirNames(ctx context.Context, s Store, prefix string, valid func(stri |
| // without the marker, the heads a fresh or replaced box would refuse |
| // (NeedsRepair): an account-less pointer, and a digestless head with no |
| // promotion record. The rollout of the account binding (hunt H3-M8) waits |
| -// on none being left. |
| +// on none being left. A record a box refuses, behind any head or none, is |
| +// RecordReport's line, not this one's (hunt H3-M2, fix round 2). |
| func DigestReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app string) ([]ChannelDigestState, *DigestMarker, error) { |
| marker, err := ReadDigestMarker(ctx, s, pub, acct) |
| if err != nil { |
| @@ -249,7 +256,12 @@ func DigestReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app |
| continue |
| } |
| st := DigestStateOf(p, marker) |
| - st.Unbound = p.Account == "" |
| + // A head signed under a grant that names no account (hunt H3-M2) |
| + // is refused like one that names none, and repaired the same way. |
| + st.Unbound = p.Account == "" || p.unboundGrant != nil |
| + if g := p.unboundGrant; g != nil { |
| + st.Grant, st.GrantMintedAt = g.Name, g.MintedAt |
| + } |
| if !st.HeadDigest { |
| // The record recordBinding would bind the head to: none, or |
| // one without a digest, is a repair; one that cannot be read |
| @@ -259,11 +271,97 @@ func DigestReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app |
| case recErr == nil && rec.ManifestDigest != "": |
| case recErr == nil || errors.Is(recErr, ErrNoPromotionRecord): |
| st.NoRecord = true |
| - default: |
| + case errors.Is(recErr, ErrRecordUnread): |
| st.RecordErr = fmt.Sprintf("%s: promotion record for %s: %v", ChannelKey(acct, app, name), p.Version, recErr) |
| + default: |
| + // Read and refused: signed under a grant that names no |
| + // account (hunt H3-M2) or for any other reason. It binds |
| + // nothing on a box, and RecordReport lists it, as it lists |
| + // every such record whatever the heads say, so it is one |
| + // line, with its own remedy. |
| } |
| } |
| out = append(out, st) |
| } |
| return out, marker, nil |
| } |
| + |
| +// RecordState is a promotion record a box refuses, and why, since each |
| +// reason has its own remedy: |
| +// |
| +// - signed under a key grant that names no account: Grant and |
| +// GrantMintedAt name it; |
| +// - read and refused for any other reason (another account's grant, a bad |
| +// signature, outside its grant's window, an invalid payload): Err; |
| +// - not read at all, a store error (ErrRecordUnread): Err and Unread. Its |
| +// state is unknown, so the report is incomplete until it is run again. |
| +// |
| +// NoBuild marks a refused or unbound record whose build's manifest is gone: |
| +// `carlos releases authorize` cannot replace it, since there is nothing to |
| +// authorize. |
| +type RecordState struct { |
| + Version string `json:"version"` |
| + Grant string `json:"grant,omitempty"` |
| + GrantMintedAt time.Time `json:"grant_minted_at,omitzero"` |
| + Err string `json:"error,omitempty"` |
| + Unread bool `json:"unread,omitempty"` |
| + NoBuild bool `json:"no_build,omitempty"` |
| +} |
| + |
| +// RecordReport is every promotion record of one app that a box refuses or |
| +// that could not be read, whichever versions the channel heads name (hunt |
| +// H3-M2, fix round 2, Astra P1): one signed under a key grant that names no |
| +// account, one refused for any other reason, and one a store error kept |
| +// from being read. Proof binding, rootfs launch, the held stage, console |
| +// copies and fleet create read a record for any version, head or not, so a |
| +// head that verifies says nothing about the records behind it. Promoting a |
| +// head's version again writes no record, so a refused line is repaired by |
| +// `carlos releases authorize`, unless its build is gone (NoBuild); an Unread |
| +// line needs the report run again. It reads every record once, and the |
| +// manifest of each refused one, at an operator's request: a one-time sweep, |
| +// never a box's poll. A listing that fails is an error, never a shorter |
| +// inventory. A record that vanished between the listing and its read is |
| +// skipped, as nothing refuses an absent record that the heads' own lines |
| +// (NoRecord) do not report. |
| +func RecordReport(ctx context.Context, s Store, pub ed25519.PublicKey, acct, app string) ([]RecordState, error) { |
| + prefix := PromotedPrefix(acct, app) |
| + keys, err := s.List(ctx, prefix) |
| + if err != nil { |
| + return nil, err |
| + } |
| + slices.Sort(keys) |
| + var out []RecordState |
| + for _, k := range keys { |
| + version := strings.TrimPrefix(k, prefix) |
| + // No reader builds a record key from a name that is not a version |
| + // (PromotionRecordKey's callers validate it first). |
| + if !ValidVersion(version) || version == "dev" { |
| + continue |
| + } |
| + _, err := ReadPromotionRecord(ctx, s, pub, acct, app, version) |
| + var ug *GrantUnboundError |
| + var st RecordState |
| + switch { |
| + case err == nil, errors.Is(err, ErrNoPromotionRecord): |
| + continue |
| + case errors.Is(err, ErrRecordUnread): |
| + out = append(out, RecordState{Version: version, Err: fmt.Sprintf("%s: %v", k, err), Unread: true}) |
| + continue |
| + case errors.As(err, &ug): |
| + st = RecordState{Version: version, Grant: ug.Name, GrantMintedAt: ug.MintedAt} |
| + default: |
| + st = RecordState{Version: version, Err: fmt.Sprintf("%s: %v", k, err)} |
| + } |
| + // Authorizing replaces the record from the build's manifest, so a |
| + // record whose build is gone needs another remedy; a manifest that |
| + // could not be read leaves that unknown. |
| + switch _, _, merr := s.Get(ctx, ManifestKey(acct, app, version)); { |
| + case errors.Is(merr, os.ErrNotExist): |
| + st.NoBuild = true |
| + case merr != nil: |
| + st.Unread, st.Err = true, fmt.Sprintf("%s: %v", ManifestKey(acct, app, version), merr) |
| + } |
| + out = append(out, st) |
| + } |
| + return out, nil |
| +} |
diff --git a/internal/release/grant.go b/internal/release/grant.go| index 59df20a95..b117896d2 100644 |
| --- a/internal/release/grant.go |
| +++ b/internal/release/grant.go |
| @@ -22,6 +22,7 @@ import ( |
| "crypto/rand" |
| "encoding/base64" |
| "encoding/json" |
| + "errors" |
| "fmt" |
| "regexp" |
| "strings" |
| @@ -58,6 +59,13 @@ func IsScopedSeed(seed string) bool { |
| type Grant struct { |
| Schema int `json:"schema"` // 1 |
| Pub string `json:"pub"` // base64 Ed25519 public key of the scoped key |
| + // Account is the one account whose channels and promotion records the |
| + // key may sign (hunt H3-M2). A grant minted before the field existed |
| + // names none, and verification refuses it on every read that acts on |
| + // what it signed (ErrGrantUnbound): without it a key minted for one |
| + // account's builder signed for every account. Old verifiers ignore the |
| + // field, so a bound grant is honoured there exactly as before. |
| + Account string `json:"account,omitempty"` |
| // Rungs uses the frozen ladder vocabulary (RungCanary, RungEdge, |
| // RungBeta). "canary" covers every canary/<branch> channel. RungStable |
| // may never appear. |
| @@ -85,10 +93,16 @@ var grantNameRe = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$`) |
| // secret store, as CARLOS_RELEASE_KEY) and the base64 grant blob (not secret, |
| // as CARLOS_RELEASE_GRANT). The deployment's CARLOS_RELEASE_PUBKEY does not |
| // change: the fleet still trusts exactly one key, and this one chains to it. |
| -func MintKeyGrant(root ed25519.PrivateKey, name string, rungs []string, ttl time.Duration) (seed, grantB64 string, err error) { |
| +// |
| +// acct is the account the key signs for, and the only one: a grant is |
| +// minted for one account's builder. |
| +func MintKeyGrant(root ed25519.PrivateKey, acct, name string, rungs []string, ttl time.Duration) (seed, grantB64 string, err error) { |
| if len(root) != ed25519.PrivateKeySize { |
| return "", "", fmt.Errorf("mint key grant: need the root signing key") |
| } |
| + if !ValidAccount(acct) { |
| + return "", "", fmt.Errorf("mint key grant: invalid account %q", acct) |
| + } |
| if !grantNameRe.MatchString(name) { |
| return "", "", fmt.Errorf("mint key grant: invalid name %q (letters, digits, . _ - ; up to 64)", name) |
| } |
| @@ -122,6 +136,7 @@ func MintKeyGrant(root ed25519.PrivateKey, name string, rungs []string, ttl time |
| g := Grant{ |
| Schema: 1, |
| Pub: base64.StdEncoding.EncodeToString(pub), |
| + Account: acct, |
| Rungs: append([]string(nil), rungs...), |
| Name: name, |
| MintedAt: now, |
| @@ -212,6 +227,11 @@ func validateGrant(g *Grant) error { |
| if _, err := ParsePublicKey(g.Pub, "key grant pub"); err != nil { |
| return err |
| } |
| + // Absent is a grant from before the binding, refused where it is used |
| + // (allowsAccount); present must be a real account. |
| + if g.Account != "" && !ValidAccount(g.Account) { |
| + return fmt.Errorf("key grant %q names invalid account %q", g.Name, g.Account) |
| + } |
| if len(g.Rungs) == 0 { |
| return fmt.Errorf("key grant %q names no rungs", g.Name) |
| } |
| @@ -238,7 +258,53 @@ func validateGrant(g *Grant) error { |
| return nil |
| } |
| -// allows reports whether this grant covers a channel at a given moment. |
| +// ErrGrantUnbound is a key grant that names no account: minted before the |
| +// binding (hunt H3-M2), so it cannot say whose channels its key may sign. |
| +// Every read that acts on what such a key signed refuses it; the write |
| +// verbs' read of the pointer they replace accepts it, so promoting, rolling |
| +// back or resigning the channel with the root key or a bound grant repairs |
| +// it. |
| +var ErrGrantUnbound = errors.New("release: key grant names no account") |
| + |
| +// GrantUnboundError is ErrGrantUnbound with the grant it was raised for: its |
| +// name and mint date, which the repair listing and the resign plan show |
| +// (fix round 2, Fable P2-a). Nothing tells a grant that names no account |
| +// apart by account, so the operator checks that the name is the account's |
| +// own builder or deploy credential before re-signing what it signed. |
| +type GrantUnboundError struct { |
| + Name string |
| + MintedAt time.Time |
| +} |
| + |
| +func (e *GrantUnboundError) Error() string { |
| + return fmt.Sprintf("%v: key grant %q was minted before grants named an account; mint a new key for the account it builds for", |
| + ErrGrantUnbound, e.Name) |
| +} |
| + |
| +func (e *GrantUnboundError) Unwrap() error { return ErrGrantUnbound } |
| + |
| +// allows reports whether this grant covers a channel of an account at a |
| +// given moment: allowsAccount, then allowsRung. |
| +func (g *Grant) allows(acct, channel string, at time.Time) error { |
| + if err := g.allowsAccount(acct); err != nil { |
| + return err |
| + } |
| + return g.allowsRung(channel, at) |
| +} |
| + |
| +// allowsAccount reports whether this grant may sign for acct. acct is always |
| +// the account the SIGNED payload names, never a caller's argument. |
| +func (g *Grant) allowsAccount(acct string) error { |
| + if g.Account == "" { |
| + return &GrantUnboundError{Name: g.Name, MintedAt: g.MintedAt} |
| + } |
| + if g.Account != acct { |
| + return fmt.Errorf("key grant %q is for account %s and cannot sign for account %s", g.Name, g.Account, acct) |
| + } |
| + return nil |
| +} |
| + |
| +// allowsRung reports whether this grant covers a channel at a given moment. |
| // |
| // `at` is passed in rather than read from the clock, and that is the whole |
| // design of expiry (spec §5): at verification it is the pointer's OWN |
| @@ -251,7 +317,9 @@ func validateGrant(g *Grant) error { |
| // controls promoted_at, so it can backdate a pointer to evade its own expiry. |
| // Expiry is hygiene, not revocation. Revoking a key that is being actively |
| // misused means rotating the ROOT key, which kills every grant at once. |
| -func (g *Grant) allows(channel string, at time.Time) error { |
| +// (Hunt H3-M2's second half; the options for a box-enforced expiry or |
| +// revocation are in docs/superpowers/notes/2026-11-29-scoped-key-expiry.md.) |
| +func (g *Grant) allowsRung(channel string, at time.Time) error { |
| rung, ok := Rung(channel) |
| if !ok { |
| return fmt.Errorf("key grant %q covers rungs (%s); %q is not a rung at all — point it with the root key", |
diff --git a/internal/release/grant_test.go b/internal/release/grant_test.go| index ff762cbbe..c88230bb0 100644 |
| --- a/internal/release/grant_test.go |
| +++ b/internal/release/grant_test.go |
| @@ -10,10 +10,17 @@ import ( |
| ) |
| // mintGrant mints a scoped key + grant with the root key, failing the test on |
| -// error — the happy path most cases start from. |
| +// error — the happy path most cases start from. The grant is for account |
| +// bab, the account the scoped tests sign for. |
| func mintGrant(t *testing.T, root ed25519.PrivateKey, name string, rungs []string, ttl time.Duration) (ed25519.PrivateKey, string) { |
| t.Helper() |
| - seed, blob, err := MintKeyGrant(root, name, rungs, ttl) |
| + return mintGrantFor(t, root, "bab", name, rungs, ttl) |
| +} |
| + |
| +// mintGrantFor is mintGrant for a named account. |
| +func mintGrantFor(t *testing.T, root ed25519.PrivateKey, acct, name string, rungs []string, ttl time.Duration) (ed25519.PrivateKey, string) { |
| + t.Helper() |
| + seed, blob, err := MintKeyGrant(root, acct, name, rungs, ttl) |
| if err != nil { |
| t.Fatalf("MintKeyGrant(%v): %v", rungs, err) |
| } |
| @@ -52,6 +59,7 @@ func goodGrant(pub ed25519.PublicKey) Grant { |
| return Grant{ |
| Schema: 1, |
| Pub: base64.StdEncoding.EncodeToString(pub), |
| + Account: "bab", |
| Rungs: []string{RungCanary, RungEdge}, |
| Name: "edge-builder", |
| MintedAt: now, |
| @@ -73,7 +81,7 @@ func TestMintRefusesStable(t *testing.T) { |
| {RungEdge, RungStable}, |
| {RungCanary, RungStable, RungBeta}, |
| } { |
| - _, _, err := MintKeyGrant(root, "edge-builder", rungs, 30*24*time.Hour) |
| + _, _, err := MintKeyGrant(root, "bab", "edge-builder", rungs, 30*24*time.Hour) |
| if err == nil { |
| t.Fatalf("MintKeyGrant(%v) succeeded; stable must never be delegable", rungs) |
| } |
| @@ -121,7 +129,7 @@ func TestGrantAllowsRefusesStableChannel(t *testing.T) { |
| _, scopedPub := testKeys(t) |
| g := goodGrant(scopedPub) |
| g.Rungs = []string{RungEdge, RungStable} // as if validateGrant had let it by |
| - err := g.allows("stable", g.MintedAt) |
| + err := g.allowsRung("stable", g.MintedAt) |
| if err == nil { |
| t.Fatal("grant.allows permitted stable") |
| } |
| @@ -143,22 +151,22 @@ func TestGrantScopeMatchesTheLadderVocabulary(t *testing.T) { |
| g := goodGrant(scopedPub) // canary, edge |
| at := g.MintedAt |
| for _, ch := range []string{"canary", "canary/platform-adoption", "canary/keymail", "canary/console", "canary/rehearsal", "edge"} { |
| - if err := g.allows(ch, at); err != nil { |
| + if err := g.allowsRung(ch, at); err != nil { |
| t.Errorf("grant covering %v refused %q: %v", g.Rungs, ch, err) |
| } |
| } |
| for _, ch := range []string{"beta", "stable", "wip"} { |
| - if err := g.allows(ch, at); err == nil { |
| + if err := g.allowsRung(ch, at); err == nil { |
| t.Errorf("grant covering %v allowed %q", g.Rungs, ch) |
| } |
| } |
| // A grant that names beta reaches beta and nothing above it. |
| b := goodGrant(scopedPub) |
| b.Rungs = []string{RungBeta} |
| - if err := b.allows("beta", at); err != nil { |
| + if err := b.allowsRung("beta", at); err != nil { |
| t.Errorf("beta grant refused beta: %v", err) |
| } |
| - if err := b.allows("edge", at); err == nil { |
| + if err := b.allowsRung("edge", at); err == nil { |
| t.Error("beta-only grant allowed edge") |
| } |
| } |
| @@ -173,13 +181,13 @@ func TestGrantScopeMatchesTheLadderVocabulary(t *testing.T) { |
| func TestGrantExpiryIsComparedAgainstTheGivenMoment(t *testing.T) { |
| _, scopedPub := testKeys(t) |
| g := goodGrant(scopedPub) |
| - if err := g.allows("edge", g.ExpiresAt.Add(-time.Second)); err != nil { |
| + if err := g.allowsRung("edge", g.ExpiresAt.Add(-time.Second)); err != nil { |
| t.Errorf("grant refused a moment inside its window: %v", err) |
| } |
| - if err := g.allows("edge", g.ExpiresAt); err != nil { |
| + if err := g.allowsRung("edge", g.ExpiresAt); err != nil { |
| t.Errorf("grant refused its exact expiry instant: %v", err) |
| } |
| - err := g.allows("edge", g.ExpiresAt.Add(time.Second)) |
| + err := g.allowsRung("edge", g.ExpiresAt.Add(time.Second)) |
| if err == nil { |
| t.Fatal("grant allowed a moment past its expiry") |
| } |
| @@ -197,16 +205,16 @@ func TestGrantExpiryIsComparedAgainstTheGivenMoment(t *testing.T) { |
| // corresponding half of this test goes green when it must not. |
| func TestGrantLifetimeIsCappedAtOneYear(t *testing.T) { |
| root, rootPub := testKeys(t) |
| - if _, _, err := MintKeyGrant(root, "edge-builder", []string{RungEdge}, maxGrantTTL+time.Hour); err == nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{RungEdge}, maxGrantTTL+time.Hour); err == nil { |
| t.Error("MintKeyGrant accepted a lifetime over the cap") |
| } |
| - if _, _, err := MintKeyGrant(root, "edge-builder", []string{RungEdge}, maxGrantTTL); err != nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{RungEdge}, maxGrantTTL); err != nil { |
| t.Errorf("MintKeyGrant refused exactly the cap: %v", err) |
| } |
| - if _, _, err := MintKeyGrant(root, "edge-builder", []string{RungEdge}, 0); err == nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{RungEdge}, 0); err == nil { |
| t.Error("MintKeyGrant accepted a zero lifetime") |
| } |
| - if _, _, err := MintKeyGrant(root, "edge-builder", []string{RungEdge}, -time.Hour); err == nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{RungEdge}, -time.Hour); err == nil { |
| t.Error("MintKeyGrant accepted a negative lifetime") |
| } |
| @@ -229,10 +237,10 @@ func TestGrantLifetimeIsCappedAtOneYear(t *testing.T) { |
| // rung nothing matches, which is a scope nobody can reason about. |
| func TestGrantRejectsUnknownRungs(t *testing.T) { |
| root, rootPub := testKeys(t) |
| - if _, _, err := MintKeyGrant(root, "edge-builder", []string{"prod"}, time.Hour); err == nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{"prod"}, time.Hour); err == nil { |
| t.Error("MintKeyGrant accepted an unknown rung") |
| } |
| - if _, _, err := MintKeyGrant(root, "edge-builder", nil, time.Hour); err == nil { |
| + if _, _, err := MintKeyGrant(root, "bab", "edge-builder", nil, time.Hour); err == nil { |
| t.Error("MintKeyGrant accepted an empty rung list") |
| } |
| _, scopedPub := testKeys(t) |
| @@ -317,7 +325,7 @@ func TestMintedGrantRoundTrips(t *testing.T) { |
| if got := g.ExpiresAt.Sub(g.MintedAt); got != 30*24*time.Hour { |
| t.Fatalf("grant lifetime = %v, want 720h", got) |
| } |
| - if err := g.allows("edge", g.MintedAt); err != nil { |
| + if err := g.allowsRung("edge", g.MintedAt); err != nil { |
| t.Fatalf("minted edge grant refuses edge: %v", err) |
| } |
| } |
| @@ -332,7 +340,7 @@ func TestMintedGrantRoundTrips(t *testing.T) { |
| // promote-side "grant is missing" refusal loses the only signal it has. |
| func TestScopedSeedIsTaggedAndStillParses(t *testing.T) { |
| root, _ := testKeys(t) |
| - seed, _, err := MintKeyGrant(root, "edge-builder", []string{RungEdge}, time.Hour) |
| + seed, _, err := MintKeyGrant(root, "bab", "edge-builder", []string{RungEdge}, time.Hour) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -387,14 +395,14 @@ func TestGrantBlobParseErrorsNameTheSource(t *testing.T) { |
| func TestGrantRefusesAPointerPredatingTheGrant(t *testing.T) { |
| _, scopedPub := testKeys(t) |
| g := goodGrant(scopedPub) |
| - err := g.allows("edge", g.MintedAt.Add(-time.Second)) |
| + err := g.allowsRung("edge", g.MintedAt.Add(-time.Second)) |
| if err == nil { |
| t.Fatal("grant honoured a pointer dated before the grant was minted") |
| } |
| if !strings.Contains(err.Error(), "predates") { |
| t.Errorf("refusal %q does not say the pointer predates the key", err) |
| } |
| - if err := g.allows("edge", g.MintedAt); err != nil { |
| + if err := g.allowsRung("edge", g.MintedAt); err != nil { |
| t.Errorf("grant refused its own mint instant: %v", err) |
| } |
| } |
diff --git a/internal/release/hunt_H3-M2_test.go b/internal/release/hunt_H3-M2_test.go| new file mode 100644 |
| index 000000000..1788db22f |
| --- /dev/null |
| +++ b/internal/release/hunt_H3-M2_test.go |
| @@ -0,0 +1,116 @@ |
| +package release |
| + |
| +import ( |
| + "bytes" |
| + "context" |
| + "crypto/ed25519" |
| + "encoding/base64" |
| + "encoding/json" |
| + "errors" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// hunt H3-M2 (Opus verifier). A scoped key the operator minted for one |
| +// account's builder ("ci-for-cdf") is used against another account ("dee"). |
| +// Grant (grant.go:58) has no account or app, Grant.allows (grant.go:254) |
| +// checks rung and promoted_at only, and verifyPointer (release.go:465) checks |
| +// the payload's account against the KEY's account, which the signer chose. |
| + |
| +func TestHunt_H3_M2_ScopedKeyMovesAnotherAccountsChannel(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + key, blob := mintGrantFor(t, root, "cdf", "ci-for-cdf", []string{RungCanary, RungEdge}, 30*24*time.Hour) |
| + sg, err := ScopedSigner(key, blob, rootPub) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + s := NewDirStore(t.TempDir()) |
| + // The victim account's build, shipped by the victim. |
| + shipRelease(t, s, "dee", "victim", "v1", adoptPlatform, []byte("dee's build")) |
| + |
| + // The production promote verb (claim_app_writes.go:31), as the CLI runs |
| + // it with CARLOS_RELEASE_KEY + CARLOS_RELEASE_GRANT. |
| + _, perr := sg.PromoteOnLadder(ctx, s, "dee", "victim", "edge", "v1", PromoteOptions{Hotfix: true, Actor: "ci-for-cdf"}) |
| + |
| + opt := t.TempDir() |
| + reg := testRegistry(t) |
| + if err := reg.Upsert(registry.Route{Host: "victim.example.com", Kind: "instance", App: "victim", Channel: "edge", Account: "dee"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + var out bytes.Buffer |
| + withCapturedStdout(t, &out, func() { |
| + if err := Pass(ctx, reg, s, rootPub, opt, func(string) error { return nil }, |
| + BakeDir(t.TempDir()), WithDigestRatchet(NewDigestRatchet(t.TempDir(), nil, false))); err != nil { |
| + t.Fatalf("Pass: %v", err) |
| + } |
| + }) |
| + ptr, cerr := Channel(ctx, s, rootPub, "dee", "victim", "edge") |
| + live, _ := LiveVersion(opt, "victim.example.com") |
| + if perr == nil || (cerr == nil && ptr.Version == "v1") || live == "v1" { |
| + t.Fatalf("H3-M2: grant %q (minted for cdf) moved dee/victim edge: promote err=%v, Channel=%+v err=%v, box live=%q; pass log:\n%s", |
| + "ci-for-cdf", perr, ptr, cerr, live, out.String()) |
| + } |
| +} |
| + |
| +// lapsedFixtureHead puts on the bucket a dee/victim edge pointer to v9, |
| +// stamped at promotedAt and signed by a scoped key under a genuine root |
| +// grant for dee covering edge from minted to expires: a grant the operator |
| +// minted for dee's own builder. The grant names the pointer's account, so |
| +// the only thing that can refuse the pointer is the grant's window (fix |
| +// round 2, Astra P2-3: without the account it fails as ErrGrantUnbound and |
| +// the witness would pass for the wrong reason). |
| +func lapsedFixtureHead(t *testing.T, minted, expires, promotedAt time.Time) (Store, ed25519.PublicKey) { |
| + t.Helper() |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + _, priv, _ := ed25519.GenerateKey(nil) |
| + g := Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(priv.Public().(ed25519.PublicKey)), |
| + Account: "dee", Rungs: []string{RungEdge}, Name: "ci-for-dee", MintedAt: minted, ExpiresAt: expires} |
| + sub := forgeGrantSub(t, root, g) |
| + |
| + s := NewDirStore(t.TempDir()) |
| + shipRelease(t, s, "dee", "victim", "v9", adoptPlatform, []byte("dee's build")) |
| + p := ChannelPointer{Schema: 1, Account: "dee", App: "victim", Channel: "edge", Version: "v9", PromotedAt: promotedAt} |
| + payload, _ := json.MarshalIndent(p, "", " ") |
| + b64 := base64.StdEncoding.EncodeToString(payload) |
| + wire, _ := json.MarshalIndent(signedWrapper{Payload: b64, |
| + Sig: base64.StdEncoding.EncodeToString(ed25519.Sign(priv, []byte(b64))), Grant: sub}, "", " ") |
| + if _, err := s.Put(ctx, ChannelKey("dee", "victim", "edge"), wire, ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + return s, rootPub |
| +} |
| + |
| +// The control for the lapsed witness below: the same fixture under a grant |
| +// whose window covers today verifies. So when the witness's pointer is |
| +// refused, the grant's lapse is the only difference that can refuse it. |
| +func TestHunt_H3_M2_LapsedFixtureControlVerifies(t *testing.T) { |
| + now := time.Now().UTC().Truncate(time.Second) |
| + s, rootPub := lapsedFixtureHead(t, now.Add(-time.Hour), now.Add(time.Hour), now.Add(-time.Minute)) |
| + if got, err := Channel(context.Background(), s, rootPub, "dee", "victim", "edge"); err != nil || got.Version != "v9" { |
| + t.Fatalf("control: a pointer from dee's own builder, inside its grant's window, does not verify: %+v, %v", got, err) |
| + } |
| +} |
| + |
| +// Expiry is not revocation (grant.go, allowsRung): a key whose grant lapsed |
| +// in 2025 still signs, today, a pointer dated inside its old window. SECURE: |
| +// a lapsed key signs nothing that verifies. |
| +func TestHunt_H3_M2_LapsedScopedKeyStillSigns(t *testing.T) { |
| + // Open: a box cannot tell when a scoped signature was made, since the |
| + // signer sets promoted_at. The options are a design decision for Paul: |
| + // docs/superpowers/notes/2026-11-29-scoped-key-expiry.md. Unskip only |
| + // with a refusal that names the grant's lapse. |
| + t.Skip("H3-M2 lapsed-grant half open: docs/superpowers/notes/2026-11-29-scoped-key-expiry.md") |
| + s, rootPub := lapsedFixtureHead(t, // the operator's genuine 2025 grant for dee |
| + time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC), |
| + time.Date(2025, 2, 1, 0, 0, 0, 0, time.UTC), |
| + time.Date(2025, 1, 15, 0, 0, 0, 0, time.UTC)) |
| + if got, err := Channel(context.Background(), s, rootPub, "dee", "victim", "edge"); err == nil { |
| + t.Fatalf("H3-M2: a grant that expired 2025-02-01 signed, today, a pointer for dee/victim edge -> %s that verifies", got.Version) |
| + } else if errors.Is(err, ErrGrantUnbound) { |
| + t.Fatalf("refused for naming no account, not for the lapse: %v", err) |
| + } |
| +} |
diff --git a/internal/release/production_test.go b/internal/release/production_test.go| index e1a0959f6..f5986e08a 100644 |
| --- a/internal/release/production_test.go |
| +++ b/internal/release/production_test.go |
| @@ -93,7 +93,7 @@ func TestProductionFlagRefusesScopedAndForeignKeys(t *testing.T) { |
| // A wrapper WITH a grant is refused outright — even a grant the root |
| // really signed. Mint a real scoped key and have it sign the flag. |
| - seed, grantB64, err := MintKeyGrant(priv, "builder", []string{RungEdge}, maxGrantTTL) |
| + seed, grantB64, err := MintKeyGrant(priv, "bab", "builder", []string{RungEdge}, maxGrantTTL) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/release/promotion.go b/internal/release/promotion.go| index 25bdc721e..56c06ce95 100644 |
| --- a/internal/release/promotion.go |
| +++ b/internal/release/promotion.go |
| @@ -37,6 +37,11 @@ type PromotionRecord struct { |
| At time.Time `json:"at"` |
| } |
| +// ErrRecordUnread is a promotion record the store did not return: the read |
| +// failed, so whether the record verifies is unknown. Every refusal of a |
| +// record that was read is some other error. |
| +var ErrRecordUnread = errors.New("release: promotion record could not be read") |
| + |
| // ErrNoPromotionRecord is a build with no record: promoted before records |
| // existed, or never promoted. It wraps os.ErrNotExist. |
| var ErrNoPromotionRecord = fmt.Errorf("release: no promotion record: %w", os.ErrNotExist) |
| @@ -84,7 +89,7 @@ func (sg Signer) WritePromotionRecord(ctx context.Context, s Store, rec Promotio |
| if sg.scope != nil { |
| return fmt.Errorf("promotion record: an authorization needs the deployment's root key") |
| } |
| - } else if err := sg.allows(rec.Channel, rec.At); err != nil { |
| + } else if err := sg.allows(rec.Account, rec.Channel, rec.At); err != nil { |
| return fmt.Errorf("promotion record: %w", err) |
| } |
| key := PromotionRecordKey(rec.Account, rec.App, rec.Version) |
| @@ -126,7 +131,7 @@ func ReadPromotionRecord(ctx context.Context, s Store, pub ed25519.PublicKey, ac |
| return nil, fmt.Errorf("%s/%s: %w", app, version, ErrNoPromotionRecord) |
| } |
| if err != nil { |
| - return nil, err |
| + return nil, fmt.Errorf("%w: %s/%s: %w", ErrRecordUnread, app, version, err) |
| } |
| var sw signedWrapper |
| if err := json.Unmarshal(raw, &sw); err != nil { |
| @@ -163,7 +168,8 @@ func ReadPromotionRecord(ctx context.Context, s Store, pub ed25519.PublicKey, ac |
| if rec.Channel == "" || rec.Authorized { |
| return nil, fmt.Errorf("promotion record %s/%s: an authorization signed by a scoped key", app, version) |
| } |
| - if err := scope.allows(rec.Channel, rec.At); err != nil { |
| + // rec.Account is the signed payload's, matched to acct above. |
| + if err := scope.allows(rec.Account, rec.Channel, rec.At); err != nil { |
| return nil, fmt.Errorf("promotion record %s/%s: %w", app, version, err) |
| } |
| } |
diff --git a/internal/release/promotion_test.go b/internal/release/promotion_test.go| index 525b74276..8faf2c034 100644 |
| --- a/internal/release/promotion_test.go |
| +++ b/internal/release/promotion_test.go |
| @@ -98,7 +98,7 @@ func TestScopedRecordsFollowTheGrant(t *testing.T) { |
| s := NewDirStore(t.TempDir()) |
| ctx := context.Background() |
| root, pub := testKeys(t) |
| - seed, grant, err := MintKeyGrant(root, "ci", []string{"canary"}, time.Hour) |
| + seed, grant, err := MintKeyGrant(root, "bab", "ci", []string{"canary"}, time.Hour) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/release/release.go b/internal/release/release.go| index 20041aacc..bd7359c3c 100644 |
| --- a/internal/release/release.go |
| +++ b/internal/release/release.go |
| @@ -255,6 +255,11 @@ type ChannelPointer struct { |
| // verified from (signedIdentity), set by the one parse site and nowhere |
| // else: PointerIdentity. A pointer built in memory has none. |
| identity string |
| + // unboundGrant is the key grant that names no account the pointer was |
| + // signed under (ErrGrantUnbound), nil for any other. Only |
| + // verifyPredecessor returns such a pointer; the repair listing and the |
| + // resign plan read the grant's name and mint date from here. |
| + unboundGrant *GrantUnboundError |
| } |
| // Promotion is one entry in a channel pointer's audit trail. It rides inside |
| @@ -548,7 +553,7 @@ func signPointer(sg Signer, p *ChannelPointer) ([]byte, error) { |
| if err := validatePointer(p, p.Account, p.App, p.Channel); err != nil { |
| return nil, err |
| } |
| - if err := sg.allows(p.Channel, p.PromotedAt); err != nil { |
| + if err := sg.allows(p.Account, p.Channel, p.PromotedAt); err != nil { |
| return nil, err |
| } |
| if p.FastTrack && sg.scope != nil { |
| @@ -674,11 +679,20 @@ func verifyPointerBinding(pub ed25519.PublicKey, wrapper []byte, wantAcct, wantA |
| return nil, fmt.Errorf("channel pointer %s/%s: fast_track is root-key-only — a scoped key cannot waive the bake window", p.App, p.Channel) |
| } |
| if scope != nil { |
| + // The account the SIGNED payload names, which validatePointer has |
| + // just matched to the key's (hunt H3-M2). A grant that names no |
| + // account is refused like a pointer that names none, and accepted |
| + // only by the write verbs' read of the head they replace. |
| + err := scope.allowsAccount(p.Account) |
| + errors.As(err, &p.unboundGrant) |
| + if err != nil && !(acceptUnbound && p.unboundGrant != nil) { |
| + return nil, fmt.Errorf("channel pointer %s/%s: %w", p.App, p.Channel, err) |
| + } |
| // promoted_at, not the wall clock: adoption re-verifies every pass, so |
| // comparing expiry against now would make an expired grant take a |
| // running route's channel resolution dark long after the promotion it |
| // was meant to gate (spec §5). |
| - if err := scope.allows(p.Channel, p.PromotedAt); err != nil { |
| + if err := scope.allowsRung(p.Channel, p.PromotedAt); err != nil { |
| return nil, fmt.Errorf("channel pointer %s/%s: %w", p.App, p.Channel, err) |
| } |
| } |
| @@ -961,7 +975,7 @@ func (sg Signer) claimRawPromote(ctx context.Context, s Store, acct, app, channe |
| // above all no write. The ladder refuses in the same style, and for the |
| // same reason — an operator finding out from a verifier three machines |
| // away has already been told the wrong thing about what happened. |
| - if err := sg.allows(channel, time.Now().UTC()); err != nil { |
| + if err := sg.allows(acct, channel, time.Now().UTC()); err != nil { |
| return fmt.Errorf("promote: %w", err) |
| } |
| // A channel only ever points at a version that was actually shipped. The |
| @@ -1268,7 +1282,7 @@ func (sg Signer) claimRawPromoteOnLadder(ctx context.Context, s Store, acct, app |
| } |
| // Before the no-op read, before the prefix listing, before anything: a key |
| // that may not sign this channel is told so without touching the bucket. |
| - if err := sg.allows(channel, time.Now().UTC()); err != nil { |
| + if err := sg.allows(acct, channel, time.Now().UTC()); err != nil { |
| return res, fmt.Errorf("promote: %w", err) |
| } |
| // The target, named: its RUNG when the channel is one of the frozen |
| @@ -1304,8 +1318,10 @@ func (sg Signer) claimRawPromoteOnLadder(ctx context.Context, s Store, acct, app |
| // A repeat onto a pointer from before the account binding is not |
| // a no-op: nothing that acts on the pointer reads it any more |
| // (hunt H3-M8), the ladder included, so this re-signs it bound, |
| - // as a retry renews it. It is the repair such a channel gets. |
| - if opt.Retry || p.Account == "" { |
| + // as a retry renews it. It is the repair such a channel gets. A |
| + // pointer signed under a grant that names no account is the same |
| + // (hunt H3-M2). |
| + if opt.Retry || p.Account == "" || p.unboundGrant != nil { |
| res.From = res.To |
| var rec []Promotion |
| if opt.Retry { |
| @@ -1490,7 +1506,7 @@ func (sg Signer) claimRawRollbackAuthorized(ctx context.Context, s Store, acct, |
| if !ValidApp(app) || !ValidChannel(channel) { |
| return fmt.Errorf("rollback: invalid app/channel %s/%s", app, channel) |
| } |
| - if err := sg.allows(channel, time.Now().UTC()); err != nil { |
| + if err := sg.allows(acct, channel, time.Now().UTC()); err != nil { |
| return fmt.Errorf("rollback: %w", err) |
| } |
| pub := sg.verifyPub() |
diff --git a/internal/release/release_test.go b/internal/release/release_test.go| index d5e6a5995..f7f9a4786 100644 |
| --- a/internal/release/release_test.go |
| +++ b/internal/release/release_test.go |
| @@ -718,7 +718,7 @@ func TestFastTrackIsRootOnly(t *testing.T) { |
| if err := Promote(ctx, s, priv, "bab", "kass", "edge", "v1"); err != nil { |
| t.Fatal(err) |
| } |
| - seed, grantB64, err := MintKeyGrant(priv, "builder", []string{RungEdge}, maxGrantTTL) |
| + seed, grantB64, err := MintKeyGrant(priv, "bab", "builder", []string{RungEdge}, maxGrantTTL) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/release/resign.go b/internal/release/resign.go| index 1b976c9e5..14e71311e 100644 |
| --- a/internal/release/resign.go |
| +++ b/internal/release/resign.go |
| @@ -21,7 +21,14 @@ type ResignPlan struct { |
| History []string |
| HistoryDigests []string |
| Computed []bool |
| - etag string |
| + // Grant and GrantMintedAt name the key grant the head was signed under |
| + // when that grant names no account (ErrGrantUnbound), and are empty |
| + // otherwise: the operator checks it is the account's own builder or |
| + // deploy credential before the root key re-signs its head (fix round |
| + // 2, Fable P2-a). |
| + Grant string |
| + GrantMintedAt time.Time |
| + etag string |
| } |
| // PlanResign reads the channel's verified pointer and fills in a digest for |
| @@ -33,7 +40,7 @@ func (sg Signer) PlanResign(ctx context.Context, s Store, acct, app, channel str |
| if !ValidAccount(acct) || !ValidApp(app) || !ValidChannel(channel) { |
| return nil, fmt.Errorf("resign: invalid %s/%s/%s", acct, app, channel) |
| } |
| - if err := sg.allows(channel, time.Now().UTC()); err != nil { |
| + if err := sg.allows(acct, channel, time.Now().UTC()); err != nil { |
| return nil, fmt.Errorf("resign: %w", err) |
| } |
| if err := resignMarker(ctx, s, sg, acct); err != nil { |
| @@ -51,6 +58,9 @@ func (sg Signer) PlanResign(ctx context.Context, s Store, acct, app, channel str |
| plan := &ResignPlan{Account: acct, App: app, Channel: channel, Version: old.Version, |
| History: old.History, HistoryDigests: alignedHistoryDigests(old), |
| Computed: make([]bool, len(old.History)+1), etag: etag} |
| + if g := old.unboundGrant; g != nil { |
| + plan.Grant, plan.GrantMintedAt = g.Name, g.MintedAt |
| + } |
| plan.Digest = old.Digest |
| if plan.Digest == "" { |
| _, raw, err := GetManifestRaw(ctx, s, acct, app, old.Version) |
diff --git a/internal/release/scopedaccount_test.go b/internal/release/scopedaccount_test.go| new file mode 100644 |
| index 000000000..27981aa5c |
| --- /dev/null |
| +++ b/internal/release/scopedaccount_test.go |
| @@ -0,0 +1,475 @@ |
| +package release |
| + |
| +import ( |
| + "bytes" |
| + "context" |
| + "crypto/ed25519" |
| + "encoding/base64" |
| + "encoding/json" |
| + "errors" |
| + "fmt" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// A scoped key signs for the one account its grant names (hunt H3-M2). These |
| +// tests put on the bucket what a key HOLDER can sign, not what signPointer |
| +// would write, so they witness the box's refusal rather than the signer's |
| +// politeness. |
| + |
| +// accountlessGrant is a genuine root-signed grant from before grants named |
| +// an account, valid now: the shape every scoped key minted before the |
| +// binding carries. |
| +func accountlessGrant(t *testing.T, root ed25519.PrivateKey) (ed25519.PrivateKey, *signedGrant) { |
| + t.Helper() |
| + pub, priv, err := ed25519.GenerateKey(nil) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + now := time.Now().UTC().Truncate(time.Second) |
| + return priv, forgeGrantSub(t, root, Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(pub), |
| + Rungs: []string{RungCanary, RungEdge}, Name: "old-ci", MintedAt: now.Add(-time.Hour), ExpiresAt: now.Add(24 * time.Hour)}) |
| +} |
| + |
| +// boundGrant is a grant minted today for acct. |
| +func boundGrant(t *testing.T, root ed25519.PrivateKey, acct string) (ed25519.PrivateKey, *signedGrant) { |
| + t.Helper() |
| + key, blob := mintGrantFor(t, root, acct, "ci-for-"+acct, []string{RungCanary, RungEdge}, 30*24*time.Hour) |
| + sub, err := parseGrantBlob(blob, "test") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return key, sub |
| +} |
| + |
| +// holderSigned wraps v as the key's holder can: any payload, signed by the |
| +// scoped key, with its grant attached. |
| +func holderSigned(t *testing.T, key ed25519.PrivateKey, sub *signedGrant, v any) []byte { |
| + t.Helper() |
| + payload, err := json.MarshalIndent(v, "", " ") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + b64 := base64.StdEncoding.EncodeToString(payload) |
| + return mustJSON(t, signedWrapper{Payload: b64, Sig: base64.StdEncoding.EncodeToString(ed25519.Sign(key, []byte(b64))), Grant: sub}) |
| +} |
| + |
| +// plantEdgeHead ships bab/web v1 and puts an edge pointer to it signed by |
| +// key under sub. The pointer carries v1's digest, so the only thing a box |
| +// can refuse it for is who signed it. |
| +func plantEdgeHead(t *testing.T, s Store, key ed25519.PrivateKey, sub *signedGrant) { |
| + t.Helper() |
| + ctx := context.Background() |
| + shipRelease(t, s, "bab", "web", "v1", adoptPlatform, []byte("bab's build")) |
| + raw, _, err := s.Get(ctx, ManifestKey("bab", "web", "v1")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + p := ChannelPointer{Schema: 1, Account: "bab", App: "web", Channel: "edge", Version: "v1", |
| + PromotedAt: time.Now().UTC().Truncate(pointerStampGrain), Digest: ManifestDigest(raw)} |
| + if _, err := s.Put(ctx, ChannelKey("bab", "web", "edge"), holderSigned(t, key, sub, p), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// boxAdopts runs a production adoption pass over a box routing bab/web edge |
| +// and reports the version it went live on ("" for none) and the pass log. |
| +func boxAdopts(t *testing.T, s Store, rootPub ed25519.PublicKey) (string, string) { |
| + t.Helper() |
| + opt := t.TempDir() |
| + reg := testRegistry(t) |
| + if err := reg.Upsert(registry.Route{Host: "web.example.com", Kind: "instance", App: "web", Channel: "edge", Account: "bab"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + var out bytes.Buffer |
| + withCapturedStdout(t, &out, func() { |
| + if err := Pass(context.Background(), reg, s, rootPub, opt, func(string) error { return nil }, |
| + BakeDir(t.TempDir()), WithDigestRatchet(NewDigestRatchet(t.TempDir(), nil, false))); err != nil { |
| + t.Fatalf("Pass: %v", err) |
| + } |
| + }) |
| + live, _ := LiveVersion(opt, "web.example.com") |
| + return live, out.String() |
| +} |
| + |
| +// The box half: a pointer for bab signed under a grant for bab is adopted; |
| +// the same pointer signed under a grant for another account, or under a |
| +// grant that names none, is refused by Channel and never goes live. |
| +// |
| +// Mutation-mindedness: drop the allowsAccount call from verifyPointerBinding |
| +// and both refusals go live as v1. |
| +func TestBoxesRefuseAScopedPointerOutsideItsGrantsAccount(t *testing.T) { |
| + ctx := context.Background() |
| + for _, tc := range []struct { |
| + name string |
| + grant func(t *testing.T, root ed25519.PrivateKey) (ed25519.PrivateKey, *signedGrant) |
| + refusal string // "" adopts |
| + unbound bool |
| + }{ |
| + {"the grant's own account", func(t *testing.T, root ed25519.PrivateKey) (ed25519.PrivateKey, *signedGrant) { |
| + return boundGrant(t, root, "bab") |
| + }, "", false}, |
| + {"another account's grant", func(t *testing.T, root ed25519.PrivateKey) (ed25519.PrivateKey, *signedGrant) { |
| + return boundGrant(t, root, "cdf") |
| + }, "is for account cdf and cannot sign for account bab", false}, |
| + {"a grant that names no account", accountlessGrant, "minted before grants named an account", true}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + root, rootPub := testKeys(t) |
| + s := NewDirStore(t.TempDir()) |
| + key, sub := tc.grant(t, root) |
| + plantEdgeHead(t, s, key, sub) |
| + |
| + _, cerr := Channel(ctx, s, rootPub, "bab", "web", "edge") |
| + live, log := boxAdopts(t, s, rootPub) |
| + if tc.refusal == "" { |
| + if cerr != nil || live != "v1" { |
| + t.Fatalf("in-account scoped pointer: Channel err = %v, live = %q; pass log:\n%s", cerr, live, log) |
| + } |
| + return |
| + } |
| + if cerr == nil || !strings.Contains(cerr.Error(), tc.refusal) { |
| + t.Fatalf("Channel err = %v, want it to say %q", cerr, tc.refusal) |
| + } |
| + if errors.Is(cerr, ErrGrantUnbound) != tc.unbound { |
| + t.Fatalf("Channel err = %v; errors.Is(ErrGrantUnbound) = %v, want %v", cerr, !tc.unbound, tc.unbound) |
| + } |
| + if live != "" { |
| + t.Fatalf("box went live on %q; pass log:\n%s", live, log) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// A head under a grant that names no account is a repair, not a mystery: |
| +// the listing names it, and promoting the same version again with the root |
| +// key re-signs it (the write verbs read the head they replace with |
| +// verifyPredecessor, which accepts it), after which boxes adopt it. |
| +func TestAccountlessGrantHeadIsListedAndRepaired(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + s := NewDirStore(t.TempDir()) |
| + key, sub := accountlessGrant(t, root) |
| + plantEdgeHead(t, s, key, sub) |
| + |
| + report, _, err := DigestReport(ctx, s, rootPub, "bab", "web") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(report) != 1 || report[0].Err != "" || !report[0].Unbound || !report[0].NeedsRepair() { |
| + t.Fatalf("report = %+v, want edge listed as an unbound head to repair", report) |
| + } |
| + // The grant is named with its mint date (fix round 2, Fable P2-a), so |
| + // the operator can tell the account's own builder from a planted head |
| + // before re-signing it. |
| + g, err := verifyGrant(rootPub, sub) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if report[0].Grant != "old-ci" || !report[0].GrantMintedAt.Equal(g.MintedAt) { |
| + t.Fatalf("report names grant %q minted %s, want %q minted %s", report[0].Grant, report[0].GrantMintedAt, "old-ci", g.MintedAt) |
| + } |
| + |
| + // The account signs digests, as every deployment's does since #253, so |
| + // the re-signed head keeps the digest that binds its bytes. |
| + if err := WriteDigestMarker(ctx, s, RootSigner(root), "bab", "op"); err != nil { |
| + t.Fatal(err) |
| + } |
| + plan, err := RootSigner(root).PlanResign(ctx, s, "bab", "web", "edge") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if plan.Grant != "old-ci" || !plan.GrantMintedAt.Equal(g.MintedAt) { |
| + t.Fatalf("resign plan names grant %q minted %s, want %q minted %s", plan.Grant, plan.GrantMintedAt, "old-ci", g.MintedAt) |
| + } |
| + res, err := RootSigner(root).PromoteOnLadder(ctx, s, "bab", "web", "edge", "v1", PromoteOptions{Hotfix: true, Actor: "op"}) |
| + if err != nil || res.NoOp { |
| + t.Fatalf("repeat root promote = %+v, %v; want a re-sign", res, err) |
| + } |
| + if p, err := Channel(ctx, s, rootPub, "bab", "web", "edge"); err != nil || p.Version != "v1" { |
| + t.Fatalf("after the repair Channel = %+v, %v", p, err) |
| + } |
| + if live, log := boxAdopts(t, s, rootPub); live != "v1" { |
| + t.Fatalf("after the repair the box is on %q; pass log:\n%s", live, log) |
| + } |
| +} |
| + |
| +// The signer half: a bound key refuses another account before writing, and |
| +// a key whose grant names no account cannot be loaded at all. |
| +func TestScopedSignerKeepsToItsAccount(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + key, blob := mintGrantFor(t, root, "cdf", "ci-for-cdf", []string{RungEdge}, time.Hour) |
| + sg, err := ScopedSigner(key, blob, rootPub) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + s := NewDirStore(t.TempDir()) |
| + shipRelease(t, s, "bab", "web", "v1", adoptPlatform, []byte("bab's build")) |
| + if _, err := sg.PromoteOnLadder(ctx, s, "bab", "web", "edge", "v1", PromoteOptions{Hotfix: true}); err == nil { |
| + t.Fatal("a key for cdf promoted bab's edge") |
| + } |
| + if _, _, err := s.Get(ctx, ChannelKey("bab", "web", "edge")); err == nil { |
| + t.Fatal("a refused cross-account promote wrote a pointer") |
| + } |
| + if _, err := signPointer(sg, &ChannelPointer{Account: "bab", App: "web", Channel: "edge", Version: "v1"}); err == nil { |
| + t.Fatal("signPointer signed for another account") |
| + } |
| + |
| + oldKey, oldSub := accountlessGrant(t, root) |
| + oldBlob := base64.StdEncoding.EncodeToString(mustJSON(t, oldSub)) |
| + if _, err := ScopedSigner(oldKey, oldBlob, rootPub); !errors.Is(err, ErrGrantUnbound) { |
| + t.Fatalf("ScopedSigner over a grant naming no account = %v, want ErrGrantUnbound", err) |
| + } |
| + |
| + if _, _, err := MintKeyGrant(root, "", "ci", []string{RungEdge}, time.Hour); err == nil { |
| + t.Fatal("MintKeyGrant minted a grant for no account") |
| + } |
| + if _, _, err := MintKeyGrant(root, "../x", "ci", []string{RungEdge}, time.Hour); err == nil { |
| + t.Fatal("MintKeyGrant minted a grant for an invalid account") |
| + } |
| + pub, _, _ := ed25519.GenerateKey(nil) |
| + bad := Grant{Schema: 1, Pub: base64.StdEncoding.EncodeToString(pub), Account: "../x", Rungs: []string{RungEdge}, Name: "ci", |
| + MintedAt: time.Now().UTC(), ExpiresAt: time.Now().UTC().Add(time.Hour)} |
| + if err := validateGrant(&bad); err == nil { |
| + t.Fatal("validateGrant accepted an invalid account") |
| + } |
| +} |
| + |
| +// The second kind a scoped key signs, the promotion record, follows the |
| +// same rule on every reader: a record for bab under a grant for cdf, or |
| +// under one that names none, does not verify, and neither reads as absent. |
| +// A record binds a digestless head's bytes (hunt H3-M1), so a foreign one |
| +// would choose what a box stages. |
| +func TestPromotionRecordsKeepToTheGrantsAccount(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + s := NewDirStore(t.TempDir()) |
| + shipRelease(t, s, "bab", "web", "v1", adoptPlatform, []byte("bab's build")) |
| + raw, _, _ := s.Get(ctx, ManifestKey("bab", "web", "v1")) |
| + rec := PromotionRecord{Schema: 1, Account: "bab", App: "web", Version: "v1", ManifestDigest: ManifestDigest(raw), |
| + Channel: "edge", At: time.Now().UTC().Truncate(time.Second)} |
| + |
| + own, ownSub := boundGrant(t, root, "bab") |
| + foreign, foreignSub := boundGrant(t, root, "cdf") |
| + old, oldSub := accountlessGrant(t, root) |
| + for _, tc := range []struct { |
| + name string |
| + key ed25519.PrivateKey |
| + sub *signedGrant |
| + ok bool |
| + unbound bool |
| + }{ |
| + {"own account", own, ownSub, true, false}, |
| + {"another account's grant", foreign, foreignSub, false, false}, |
| + {"a grant that names no account", old, oldSub, false, true}, |
| + } { |
| + _, etag, _ := s.Get(ctx, PromotionRecordKey("bab", "web", "v1")) |
| + if _, err := s.Put(ctx, PromotionRecordKey("bab", "web", "v1"), holderSigned(t, tc.key, tc.sub, rec), etag); err != nil { |
| + t.Fatal(err) |
| + } |
| + _, err := ReadPromotionRecord(ctx, s, rootPub, "bab", "web", "v1") |
| + switch { |
| + case tc.ok && err != nil: |
| + t.Errorf("%s: %v", tc.name, err) |
| + case !tc.ok && (err == nil || errors.Is(err, ErrNoPromotionRecord)): |
| + t.Errorf("%s: record read = %v, want a refusal that is not 'absent'", tc.name, err) |
| + case !tc.ok && errors.Is(err, ErrGrantUnbound) != tc.unbound: |
| + t.Errorf("%s: %v; errors.Is(ErrGrantUnbound) want %v", tc.name, err, tc.unbound) |
| + } |
| + } |
| + |
| + key, blob := mintGrantFor(t, root, "cdf", "ci-for-cdf", []string{RungEdge}, time.Hour) |
| + sg, err := ScopedSigner(key, blob, rootPub) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := sg.WritePromotionRecord(ctx, s, PromotionRecord{Account: "bab", App: "web", Version: "v1", ManifestDigest: rec.ManifestDigest, Channel: "edge"}); err == nil { |
| + t.Fatal("a key for cdf wrote a record for bab") |
| + } |
| +} |
| + |
| +// plantRecord puts a promotion record for bab/web version, naming the edge |
| +// channel, signed by key under sub as its holder can sign one. |
| +func plantRecord(t *testing.T, s Store, key ed25519.PrivateKey, sub *signedGrant, version string) { |
| + t.Helper() |
| + ctx := context.Background() |
| + raw, _, err := s.Get(ctx, ManifestKey("bab", "web", version)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + rec := PromotionRecord{Schema: 1, Account: "bab", App: "web", Version: version, ManifestDigest: ManifestDigest(raw), |
| + Channel: "edge", At: time.Now().UTC().Truncate(time.Second)} |
| + _, etag, _ := s.Get(ctx, PromotionRecordKey("bab", "web", version)) |
| + if _, err := s.Put(ctx, PromotionRecordKey("bab", "web", version), holderSigned(t, key, sub, rec), etag); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// Every promotion record a box refuses is listed, whatever the channel |
| +// heads say (fix round 2; Astra P1, Fable P2-c and P2-d): a record behind a |
| +// head that carries its digest, a record of a version no channel names, and |
| +// a record that cannot be read at all. Promoting the head's version again |
| +// re-signs the head but writes no record (a record is written only for a |
| +// new head), so the record stays listed, and the version stays refused by |
| +// AuthorizedManifest, until `carlos releases authorize` replaces it. |
| +// |
| +// Mutation-mindedness: inventory records only through the channel heads, |
| +// as round 1 did, and v0 and v1 drop out of the first listing; take v1's |
| +// line away once its head is bound, and the regression check fails. |
| +func TestRecordReportListsEveryRecordABoxRefuses(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + s := NewDirStore(t.TempDir()) |
| + key, sub := accountlessGrant(t, root) |
| + g, err := verifyGrant(rootPub, sub) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + plantEdgeHead(t, s, key, sub) // ships v1; edge heads it with its digest |
| + for _, v := range []string{"v0", "v2", "v3"} { |
| + shipRelease(t, s, "bab", "web", v, adoptPlatform, []byte("bab's build "+v)) |
| + } |
| + plantRecord(t, s, key, sub, "v1") // behind the head |
| + plantRecord(t, s, key, sub, "v0") // no channel names v0 |
| + if _, err := s.Put(ctx, PromotionRecordKey("bab", "web", "v2"), []byte("junk"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + own, ownSub := boundGrant(t, root, "bab") |
| + plantRecord(t, s, own, ownSub, "v3") // the account's own bound key: fine |
| + |
| + listed := func() map[string]RecordState { |
| + t.Helper() |
| + recs, err := RecordReport(ctx, s, rootPub, "bab", "web") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + out := map[string]RecordState{} |
| + for _, r := range recs { |
| + out[r.Version] = r |
| + } |
| + return out |
| + } |
| + got := listed() |
| + if len(got) != 3 { |
| + t.Fatalf("records listed = %+v, want v0, v1 and v2", got) |
| + } |
| + for _, v := range []string{"v0", "v1"} { |
| + r := got[v] |
| + if r.Err != "" || r.Grant != "old-ci" || !r.GrantMintedAt.Equal(g.MintedAt) { |
| + t.Fatalf("%s listed as %+v, want grant old-ci minted %s and no error", v, r, g.MintedAt) |
| + } |
| + } |
| + if got["v2"].Err == "" || got["v2"].Grant != "" { |
| + t.Fatalf("the unreadable record is listed as %+v, want its read error", got["v2"]) |
| + } |
| + |
| + // Repair the head as its line says: promote the same version again. |
| + if err := WriteDigestMarker(ctx, s, RootSigner(root), "bab", "op"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := RootSigner(root).PromoteOnLadder(ctx, s, "bab", "web", "edge", "v1", PromoteOptions{Hotfix: true, Actor: "op"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + report, _, err := DigestReport(ctx, s, rootPub, "bab", "web") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, st := range report { |
| + if st.NeedsRepair() || st.Err != "" || st.RecordErr != "" { |
| + t.Fatalf("after the head's repair it still reads %+v", st) |
| + } |
| + } |
| + // The regression: the head is bound, the record behind it is not. |
| + if r, ok := listed()["v1"]; !ok || r.Grant != "old-ci" { |
| + t.Fatalf("v1's record left the listing when its head was repaired: %+v", listed()) |
| + } |
| + if _, err := AuthorizedManifest(ctx, s, rootPub, "bab", "web", "v1"); !errors.Is(err, ErrGrantUnbound) { |
| + t.Fatalf("control: v1's record still unbound, AuthorizedManifest = %v", err) |
| + } |
| + |
| + for _, v := range []string{"v0", "v1", "v2"} { |
| + plan, err := PlanAuthorize(ctx, s, "bab", "web", v) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := RootSigner(root).Authorize(ctx, s, plan, "op"); err != nil { |
| + t.Fatalf("authorize %s: %v", v, err) |
| + } |
| + } |
| + if got := listed(); len(got) != 0 { |
| + t.Fatalf("after authorizing every listed version: %+v", got) |
| + } |
| + if _, err := AuthorizedManifest(ctx, s, rootPub, "bab", "web", "v1"); err != nil { |
| + t.Fatalf("after authorize, v1: %v", err) |
| + } |
| +} |
| + |
| +// recordGetFails is a store whose Get of one key fails as a bucket outage |
| +// would: the object exists, but this read of it did not happen. |
| +type recordGetFails struct { |
| + Store |
| + key string |
| +} |
| + |
| +func (s recordGetFails) Get(ctx context.Context, key string) ([]byte, string, error) { |
| + if key == s.key { |
| + return nil, "", errors.New("503 slow down") |
| + } |
| + return s.Store.Get(ctx, key) |
| +} |
| + |
| +// RecordReport tells the three kinds of failing record apart (fix round 2 |
| +// follow-up; Fable P2-c, Astra P2-3), since each has a different remedy: |
| +// a record that was read and refused (here, signed under another account's |
| +// grant, and junk) is replaced by `carlos releases authorize`; a record a |
| +// store error kept from being read is unknown and needs the report run |
| +// again; and a refused record whose build is gone (NoBuild) cannot be |
| +// authorized at all, so it says so rather than offer a command that fails. |
| +func TestRecordReportSplitsRefusedFromUnreadAndBuildless(t *testing.T) { |
| + ctx := context.Background() |
| + root, rootPub := testKeys(t) |
| + dir := NewDirStore(t.TempDir()) |
| + for _, v := range []string{"v1", "v2", "v3", "v4"} { |
| + shipRelease(t, dir, "bab", "web", v, adoptPlatform, []byte("bab's build "+v)) |
| + } |
| + foreign, foreignSub := boundGrant(t, root, "cdf") |
| + plantRecord(t, dir, foreign, foreignSub, "v1") // refused: another account's grant |
| + if _, err := dir.Put(ctx, PromotionRecordKey("bab", "web", "v2"), []byte("junk"), ""); err != nil { |
| + t.Fatal(err) |
| + } |
| + old, oldSub := accountlessGrant(t, root) |
| + plantRecord(t, dir, old, oldSub, "v3") // unread below |
| + plantRecord(t, dir, old, oldSub, "v4") // unbound, then its build is deleted |
| + if err := dir.Delete(ctx, ManifestKey("bab", "web", "v4")); err != nil { |
| + t.Fatal(err) |
| + } |
| + s := recordGetFails{Store: dir, key: PromotionRecordKey("bab", "web", "v3")} |
| + |
| + recs, err := RecordReport(ctx, s, rootPub, "bab", "web") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + got := map[string]string{} |
| + for _, r := range recs { |
| + got[r.Version] = fmt.Sprintf("unread=%t refused=%t nobuild=%t grant=%s", r.Unread, r.Err != "" && !r.Unread, r.NoBuild, r.Grant) |
| + } |
| + want := map[string]string{ |
| + "v1": "unread=false refused=true nobuild=false grant=", |
| + "v2": "unread=false refused=true nobuild=false grant=", |
| + "v3": "unread=true refused=false nobuild=false grant=", |
| + "v4": "unread=false refused=false nobuild=true grant=old-ci", |
| + } |
| + if fmt.Sprint(got) != fmt.Sprint(want) { |
| + t.Fatalf("records = %v\nwant %v", got, want) |
| + } |
| + if _, err := ReadPromotionRecord(ctx, s, rootPub, "bab", "web", "v3"); !errors.Is(err, ErrRecordUnread) { |
| + t.Fatalf("a store error on the record read = %v, want ErrRecordUnread", err) |
| + } |
| + if _, err := ReadPromotionRecord(ctx, s, rootPub, "bab", "web", "v2"); err == nil || errors.Is(err, ErrRecordUnread) { |
| + t.Fatalf("junk record = %v, want a refusal that is not ErrRecordUnread", err) |
| + } |
| +} |
diff --git a/internal/release/scopedverify_test.go b/internal/release/scopedverify_test.go| index e6cb64d0d..58f57e40c 100644 |
| --- a/internal/release/scopedverify_test.go |
| +++ b/internal/release/scopedverify_test.go |
| @@ -215,6 +215,7 @@ func TestExpiryGatesPromotionNotAdoption(t *testing.T) { |
| g := Grant{ |
| Schema: 1, |
| Pub: base64.StdEncoding.EncodeToString(pub), |
| + Account: "bab", |
| Rungs: []string{RungEdge}, |
| Name: "edge-builder", |
| MintedAt: time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC), |
diff --git a/internal/release/signer.go b/internal/release/signer.go| index 9c411f711..4243e5e2b 100644 |
| --- a/internal/release/signer.go |
| +++ b/internal/release/signer.go |
| @@ -58,6 +58,11 @@ func ScopedSigner(key ed25519.PrivateKey, grantB64 string, root ed25519.PublicKe |
| if g.Pub != base64.StdEncoding.EncodeToString(pub) { |
| return Signer{}, fmt.Errorf("key grant %q is for a different key than CARLOS_RELEASE_KEY holds", g.Name) |
| } |
| + // Refused here as boxes refuse it, so a builder holding a pre-binding |
| + // grant learns at the first command, not from pointers no box adopts. |
| + if g.Account == "" { |
| + return Signer{}, fmt.Errorf("%w: key grant %q was minted before grants named an account; mint a new key with carlos release-keygen --scope ... --account <sqid>", ErrGrantUnbound, g.Name) |
| + } |
| return Signer{key: key, grant: sg, scope: g, root: root}, nil |
| } |
| @@ -65,14 +70,14 @@ func ScopedSigner(key ed25519.PrivateKey, grantB64 string, root ed25519.PublicKe |
| // root public key, whether this signer is the root or a delegate of it. |
| func (s Signer) verifyPub() ed25519.PublicKey { return s.root } |
| -// allows reports whether this signer may sign for a channel at a moment. A |
| -// root signer may sign anything, which is the property scoped keys exist to |
| -// take away from everything else. |
| -func (s Signer) allows(channel string, at time.Time) error { |
| +// allows reports whether this signer may sign for a channel of an account |
| +// at a moment. A root signer may sign anything, which is the property scoped |
| +// keys exist to take away from everything else. |
| +func (s Signer) allows(acct, channel string, at time.Time) error { |
| if s.scope == nil { |
| return nil |
| } |
| - return s.scope.allows(channel, at) |
| + return s.scope.allows(acct, channel, at) |
| } |
| // usable rejects a zero Signer before it reaches ed25519.Sign, which panics |
diff --git a/internal/release/writers_test.go b/internal/release/writers_test.go| index ea88ae196..248f30418 100644 |
| --- a/internal/release/writers_test.go |
| +++ b/internal/release/writers_test.go |
| @@ -145,7 +145,7 @@ func TestScopedPromoteCarriesDigests(t *testing.T) { |
| ctx := context.Background() |
| root, pub := testKeys(t) |
| markerOn(t, s, root, "bab") |
| - seed, grant, err := MintKeyGrant(root, "ci", []string{"canary"}, time.Hour) |
| + seed, grant, err := MintKeyGrant(root, "bab", "ci", []string{"canary"}, time.Hour) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/scopedkeys_e2e_test.go b/scopedkeys_e2e_test.go| index cb9cdf358..1dcc1272d 100644 |
| --- a/scopedkeys_e2e_test.go |
| +++ b/scopedkeys_e2e_test.go |
| @@ -96,7 +96,12 @@ func TestScopedKeysCLI(t *testing.T) { |
| } |
| // -- scoped keygen --------------------------------------------------- |
| - out, err = run(rootEnv, "release-keygen", "-scope", "canary,edge", "-name", "edge-builder") |
| + // A scoped key signs for one account (hunt H3-M2), so minting one |
| + // without naming it is refused. |
| + if out, err := run(rootEnv, "release-keygen", "-scope", "canary,edge", "-name", "edge-builder"); err == nil { |
| + t.Fatalf("release-keygen --scope without --account minted a key:\n%s", out) |
| + } |
| + out, err = run(rootEnv, "release-keygen", "-scope", "canary,edge", "-name", "edge-builder", "-account", release.OpsAccount) |
| if err != nil { |
| t.Fatalf("release-keygen --scope: %v\n%s", err, out) |
| } |
| @@ -120,7 +125,7 @@ func TestScopedKeysCLI(t *testing.T) { |
| } |
| // stable is refused at mint, by the verb, naming stable. |
| - if out, err := run(rootEnv, "release-keygen", "-scope", "edge,stable", "-name", "bad"); err == nil { |
| + if out, err := run(rootEnv, "release-keygen", "-scope", "edge,stable", "-name", "bad", "-account", release.OpsAccount); err == nil { |
| t.Fatalf("release-keygen --scope edge,stable succeeded:\n%s", out) |
| } else if !strings.Contains(out, "stable") { |
| t.Fatalf("refusal does not name stable:\n%s", out) |
| @@ -128,7 +133,7 @@ func TestScopedKeysCLI(t *testing.T) { |
| // Minting needs the ROOT key: a scoped key cannot widen itself. |
| scopedOnly := []string{"CARLOS_RELEASE_KEY=" + scopedKey, "CARLOS_RELEASE_PUBKEY=" + rootPub} |
| - if out, err := run(scopedOnly, "release-keygen", "-scope", "beta", "-name", "wider"); err == nil { |
| + if out, err := run(scopedOnly, "release-keygen", "-scope", "beta", "-name", "wider", "-account", release.OpsAccount); err == nil { |
| t.Fatalf("a scoped key minted a grant:\n%s", out) |
| } |
| @@ -173,6 +178,23 @@ func TestScopedKeysCLI(t *testing.T) { |
| t.Fatalf("a stable pointer exists after a refused promote (stat err = %v)", err) |
| } |
| + // A key minted for another account signs nothing in this one, and |
| + // nothing is written (hunt H3-M2). |
| + out, err = run(rootEnv, "release-keygen", "-scope", "canary,edge", "-name", "other-builder", "-account", "bae") |
| + if err != nil { |
| + t.Fatalf("release-keygen --account bae: %v\n%s", err, out) |
| + } |
| + otherEnv := []string{"CARLOS_RELEASE_KEY=" + envValue(t, out, "CARLOS_RELEASE_KEY"), "CARLOS_RELEASE_PUBKEY=" + rootPub, |
| + "CARLOS_RELEASE_GRANT=" + envValue(t, out, "CARLOS_RELEASE_GRANT")} |
| + if out, err := run(otherEnv, "promote", "-app", "kass", "9f3c1ad", "canary/x"); err == nil { |
| + t.Fatalf("a key minted for account bae promoted in %s:\n%s", release.OpsAccount, out) |
| + } else if !strings.Contains(out, "other-builder") || !strings.Contains(out, "bae") { |
| + t.Errorf("cross-account refusal does not name the key and its account:\n%s", out) |
| + } |
| + if _, err := os.Stat(filepath.Join(bucket, filepath.FromSlash(release.ChannelKey(release.OpsAccount, "kass", "canary/x")))); !os.IsNotExist(err) { |
| + t.Fatalf("a canary pointer exists after a refused cross-account promote (stat err = %v)", err) |
| + } |
| + |
| // -hotfix bypasses the ladder, never the grant. |
| if out, err := run(scopedEnv, "promote", "-app", "kass", "-hotfix", "9f3c1ad", "stable"); err == nil { |
| t.Fatalf("--hotfix let the edge key reach stable:\n%s", out) |
diff --git a/testdata/clireg-golden.jsonl b/testdata/clireg-golden.jsonl| index 3f7f941db..c380c8bde 100644 |
| --- a/testdata/clireg-golden.jsonl |
| +++ b/testdata/clireg-golden.jsonl |
| @@ -148,10 +148,10 @@ |
| {"case":"canary | help","argv":["canary","help"],"exit":1,"stdout":"","stderr":"not in a git repository — pass --version\n"} |
| {"case":"canary | zz-unknown","argv":["canary","zz-unknown"],"exit":1,"stdout":"","stderr":"not in a git repository — pass --version\n"} |
| {"case":"channels digests --account-id x on | extra","argv":["channels","digests","--account-id","x","on"],"exit":1,"stdout":"","stderr":"usage: carlos channels digests [on|off] [--account-id <sqid>]...\n"} |
| -{"case":"channels digests on -h | extra","argv":["channels","digests","on","-h"],"exit":0,"stdout":"","stderr":"usage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| +{"case":"channels digests on -h | extra","argv":["channels","digests","on","-h"],"exit":0,"stdout":"","stderr":"usage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required for on and off; without it, checks every account in the bucket)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| {"case":"channels digests zz --zz | extra","argv":["channels","digests","zz","--zz"],"exit":1,"stdout":"","stderr":"usage: carlos channels digests [on|off] [--account-id <sqid>]...\n"} |
| -{"case":"channels digests | --zz-unknown-flag","argv":["channels","digests","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| -{"case":"channels digests | -h","argv":["channels","digests","-h"],"exit":0,"stdout":"","stderr":"usage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| +{"case":"channels digests | --zz-unknown-flag","argv":["channels","digests","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required for on and off; without it, checks every account in the bucket)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| +{"case":"channels digests | -h","argv":["channels","digests","-h"],"exit":0,"stdout":"","stderr":"usage: carlos channels digests [flags]\nflags:\n --account-id <value> an account sqid; repeat for several (direct-store: required for on and off; without it, checks every account in the bucket)\n --console <string> console origin (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n"} |
| {"case":"channels resign | --zz-unknown-flag","argv":["channels","resign","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos channels resign [flags]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to resign through (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n --yes sign without asking\n"} |
| {"case":"channels resign | -h","argv":["channels","resign","-h"],"exit":0,"stdout":"","stderr":"usage: carlos channels resign [flags]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to resign through (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n --yes sign without asking\n"} |
| {"case":"channels | --help","argv":["channels","--help"],"exit":0,"stdout":"","stderr":"usage: carlos channels [flags]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to read through (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n"} |
| @@ -735,8 +735,8 @@ |
| {"case":"relay | bare","argv":["relay"],"exit":2,"stdout":"","stderr":"usage: carlos relay <enable|status|disable|adopted|rotate|keygen|serve> [flags]\n\n enable --app <a> [--regions <r1,r2>]\n turn the relay on for one app and deliver CARLOS_RELAY to its\n config. Regions default to every one this deployment arms, in the\n console's order — the order every browser tries them in.\n status --app <a>\n what was issued per region, what each route has done about it,\n and each region relay's heartbeat, lease and loaded masters. The\n only sight of any of that without box access.\n disable --app <a>\n remove the key. Every allocation the app holds ends on the\n relays' next authority read, within a minute.\n adopted --app <a> --host <route>\n tell the platform that a TCP-address route you restarted by hand\n now runs the issued key. The one route shape this platform cannot\n restart for you, so the acknowledgement has to come from you.\n rotate --region <r>\n operator: move the region's issuer pointer onto the newly staged\n master and re-issue every app enabled there. Needs an address on\n CARLOS_RELAY_OPERATORS; anyone else meets the same 404 as an\n unknown console door, never a 403.\n keygen mint a region master: one \"<kid> <base64 key> -\" line for\n /etc/carlos/relay-masters and the same pair for the console's\n CARLOS_RELAY_MASTERS_<REGION> secret, which holds every master the\n console may need as <kid>:<key>[,<kid>:<key>].\n serve run the relay (what carlos-relay.service execs; not typed by hand)\n\n --account <sqid|name> account the app belongs to (default: your only\n account, or the configured/chosen one)\n --account-id <sqid> account sqid, matched as a sqid ONLY.\n --console <origin> which logged-in console to use (only needed with\n several)\n\nenable, status, disable, adopted and rotate are signed-in only\n(carlos auth login): the relay's keys are derived from a master the console\nholds and sealed with the deployment's secrets key, so there is no\ndirect-bucket equivalent.\n"} |
| {"case":"relay | help","argv":["relay","help"],"exit":0,"stdout":"usage: carlos relay <enable|status|disable|adopted|rotate|keygen|serve> [flags]\n\n enable --app <a> [--regions <r1,r2>]\n turn the relay on for one app and deliver CARLOS_RELAY to its\n config. Regions default to every one this deployment arms, in the\n console's order — the order every browser tries them in.\n status --app <a>\n what was issued per region, what each route has done about it,\n and each region relay's heartbeat, lease and loaded masters. The\n only sight of any of that without box access.\n disable --app <a>\n remove the key. Every allocation the app holds ends on the\n relays' next authority read, within a minute.\n adopted --app <a> --host <route>\n tell the platform that a TCP-address route you restarted by hand\n now runs the issued key. The one route shape this platform cannot\n restart for you, so the acknowledgement has to come from you.\n rotate --region <r>\n operator: move the region's issuer pointer onto the newly staged\n master and re-issue every app enabled there. Needs an address on\n CARLOS_RELAY_OPERATORS; anyone else meets the same 404 as an\n unknown console door, never a 403.\n keygen mint a region master: one \"<kid> <base64 key> -\" line for\n /etc/carlos/relay-masters and the same pair for the console's\n CARLOS_RELAY_MASTERS_<REGION> secret, which holds every master the\n console may need as <kid>:<key>[,<kid>:<key>].\n serve run the relay (what carlos-relay.service execs; not typed by hand)\n\n --account <sqid|name> account the app belongs to (default: your only\n account, or the configured/chosen one)\n --account-id <sqid> account sqid, matched as a sqid ONLY.\n --console <origin> which logged-in console to use (only needed with\n several)\n\nenable, status, disable, adopted and rotate are signed-in only\n(carlos auth login): the relay's keys are derived from a master the console\nholds and sealed with the deployment's secrets key, so there is no\ndirect-bucket equivalent.\n","stderr":""} |
| {"case":"relay | zz-unknown","argv":["relay","zz-unknown"],"exit":2,"stdout":"","stderr":"usage: carlos relay <enable|status|disable|adopted|rotate|keygen|serve> [flags]\n\n enable --app <a> [--regions <r1,r2>]\n turn the relay on for one app and deliver CARLOS_RELAY to its\n config. Regions default to every one this deployment arms, in the\n console's order — the order every browser tries them in.\n status --app <a>\n what was issued per region, what each route has done about it,\n and each region relay's heartbeat, lease and loaded masters. The\n only sight of any of that without box access.\n disable --app <a>\n remove the key. Every allocation the app holds ends on the\n relays' next authority read, within a minute.\n adopted --app <a> --host <route>\n tell the platform that a TCP-address route you restarted by hand\n now runs the issued key. The one route shape this platform cannot\n restart for you, so the acknowledgement has to come from you.\n rotate --region <r>\n operator: move the region's issuer pointer onto the newly staged\n master and re-issue every app enabled there. Needs an address on\n CARLOS_RELAY_OPERATORS; anyone else meets the same 404 as an\n unknown console door, never a 403.\n keygen mint a region master: one \"<kid> <base64 key> -\" line for\n /etc/carlos/relay-masters and the same pair for the console's\n CARLOS_RELAY_MASTERS_<REGION> secret, which holds every master the\n console may need as <kid>:<key>[,<kid>:<key>].\n serve run the relay (what carlos-relay.service execs; not typed by hand)\n\n --account <sqid|name> account the app belongs to (default: your only\n account, or the configured/chosen one)\n --account-id <sqid> account sqid, matched as a sqid ONLY.\n --console <origin> which logged-in console to use (only needed with\n several)\n\nenable, status, disable, adopted and rotate are signed-in only\n(carlos auth login): the relay's keys are derived from a master the console\nholds and sealed with the deployment's secrets key, so there is no\ndirect-bucket equivalent.\n"} |
| -{"case":"release-keygen | --zz-unknown-flag","argv":["release-keygen","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos release-keygen [flags]\nflags:\n --expires <duration> how long the scoped key may sign for (max 8760h) (default: 2160h0m0s)\n --name <string> label for the scoped key; it appears in every refusal it causes\n --scope <string> mint a SCOPED key for these rungs, comma separated (canary,edge,beta) — stable is never delegable\n"} |
| -{"case":"release-keygen | -h","argv":["release-keygen","-h"],"exit":0,"stdout":"","stderr":"usage: carlos release-keygen [flags]\nflags:\n --expires <duration> how long the scoped key may sign for (max 8760h) (default: 2160h0m0s)\n --name <string> label for the scoped key; it appears in every refusal it causes\n --scope <string> mint a SCOPED key for these rungs, comma separated (canary,edge,beta) — stable is never delegable\n"} |
| +{"case":"release-keygen | --zz-unknown-flag","argv":["release-keygen","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos release-keygen [flags]\nflags:\n --account <string> the only account the scoped key signs for\n --expires <duration> how long the scoped key may sign for (max 8760h) (default: 2160h0m0s)\n --name <string> label for the scoped key; it appears in every refusal it causes\n --scope <string> mint a SCOPED key for these rungs, comma separated (canary,edge,beta) — stable is never delegable\n"} |
| +{"case":"release-keygen | -h","argv":["release-keygen","-h"],"exit":0,"stdout":"","stderr":"usage: carlos release-keygen [flags]\nflags:\n --account <string> the only account the scoped key signs for\n --expires <duration> how long the scoped key may sign for (max 8760h) (default: 2160h0m0s)\n --name <string> label for the scoped key; it appears in every refusal it causes\n --scope <string> mint a SCOPED key for these rungs, comma separated (canary,edge,beta) — stable is never delegable\n"} |
| {"case":"releases authorize | --zz-unknown-flag","argv":["releases","authorize","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos releases authorize [flags]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to authorize through (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n --yes sign without asking\n"} |
| {"case":"releases authorize | -h","argv":["releases","authorize","-h"],"exit":0,"stdout":"","stderr":"usage: carlos releases authorize [flags]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to authorize through (API mode only; default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n --yes sign without asking\n"} |
| {"case":"releases pull | --zz-unknown-flag","argv":["releases","pull","--zz-unknown-flag"],"exit":2,"stdout":"","stderr":"flag provided but not defined: -zz-unknown-flag\nusage: carlos releases pull <version> --app <a> --out <dir> [--account <sqid-or-name>] [--account-id <sqid>] [--console <origin>]\nflags:\n --account <string> account (sqid or name) the app belongs to (default: your only account, or the configured/chosen one; ops in direct mode)\n --account-id <string> account sqid, matched as a sqid ONLY — supersedes --account; this is the flag an ambiguity error tells you to use\n --app, -a <string> app name\n --console <string> console origin to read the release from (default: the only logged-in one)\n --destination, -d <name> use the named block from .carlos/config's destinations (default: CARLOS_DESTINATION, else the file's default or only one)\n --out <string> directory to write the manifest and artifacts into (created if missing)\n --registry <string> registry database (resolves --account) (default: $DIR/data/registry.db)\n"} |