Merge remote-tracking branch 'origin/main' into fleet-client-address-1348
# Conflicts: # internal/provision/testdata/plan14-root-reads-chain.tsv
docs/superpowers/notes/census-proposal-fleet-client-address-1348.md+1 −1docs/superpowers/notes/census-proposal-precert-dns01-1293.md+19 −0docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md+44 −0docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R2.md+32 −0docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R1.md+113 −0docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md+136 −0internal/edge/certsync_e2e_test.go+16 −1internal/edge/edge.go+7 −0internal/edge/precert.go+464 −0internal/edge/precert_test.go+608 −0internal/edge/wildcard.go+105 −44internal/host/agent.go+6 −0internal/hostenv/hostenv.go+2 −0internal/provision/plan9_b8_census_test.go+6 −2internal/provision/testdata/plan14-root-reads-chain.tsv+2 −1internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv+1 −1internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv+7 −0
CI passed — run details
CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
tofu: downloaded, digest verified
aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
aws: downloaded, digest verified
archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
archive: downloaded, digest verified
installed in /tmp/carlos-opentofu-sM47tW
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/superfly/ltx v0.5.1
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/service/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/aws/aws-sdk-go-v2/service/sts v1.45.6
go: downloading github.com/oschwald/maxminddb-golang v1.13.1
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.38
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.40
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/pion/randutil v0.1.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
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/libc v1.74.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
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 (171 s, from +0 s)
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
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 github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== vet-tags (188 s, from +0 s)
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/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
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (379 s, from +14 s)
ok github.com/carlosframework/platform/cmd/carlos-media 122.197s
? github.com/carlosframework/platform/cmd/changelog [no test files]
ok github.com/carlosframework/platform/cmd/console 206.189s
ok github.com/carlosframework/platform/cmd/mediaimage 45.221s
ok github.com/carlosframework/platform/cmd/moveprobe 16.249s
ok github.com/carlosframework/platform/cmd/pricebook-export 0.051s
ok github.com/carlosframework/platform/cmd/rootfswitness 0.170s
ok github.com/carlosframework/platform/cmd/runsc-assets 0.136s
ok github.com/carlosframework/platform/cmd/zddprobe 0.981s
ok github.com/carlosframework/platform/internal/agentsock 0.099s
ok github.com/carlosframework/platform/internal/alerting 0.037s
ok github.com/carlosframework/platform/internal/analytics 0.288s
ok github.com/carlosframework/platform/internal/appconfig 45.772s
ok github.com/carlosframework/platform/internal/apperr 0.337s
ok github.com/carlosframework/platform/internal/applog 0.891s
ok github.com/carlosframework/platform/internal/apppolicy 2.372s
ok github.com/carlosframework/platform/internal/assetcache 0.425s
ok github.com/carlosframework/platform/internal/awsinv 0.022s
ok github.com/carlosframework/platform/internal/awsmanaged 0.562s
ok github.com/carlosframework/platform/internal/awsregiongroup 0.298s
ok github.com/carlosframework/platform/internal/awsterminations 0.034s
ok github.com/carlosframework/platform/internal/backupswords 0.029s
ok github.com/carlosframework/platform/internal/billing 0.106s
ok github.com/carlosframework/platform/internal/billing/billingtest 0.094s
ok github.com/carlosframework/platform/internal/billingstripe 2.103s
ok github.com/carlosframework/platform/internal/boxchoice 0.051s
ok github.com/carlosframework/platform/internal/boxid 2.520s
? 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.018s
ok github.com/carlosframework/platform/internal/boxself 0.230s
ok github.com/carlosframework/platform/internal/boxvolumes 0.056s
ok github.com/carlosframework/platform/internal/caps 0.151s
ok github.com/carlosframework/platform/internal/certwarm 0.012s
ok github.com/carlosframework/platform/internal/cgroup 1.397s
ok github.com/carlosframework/platform/internal/changelog 4.756s
ok github.com/carlosframework/platform/internal/clamd 0.083s
? github.com/carlosframework/platform/internal/cliflag [no test files]
ok github.com/carlosframework/platform/internal/clireg 0.010s
ok github.com/carlosframework/platform/internal/codehealth 19.590s
ok github.com/carlosframework/platform/internal/compute 0.022s
? 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.206s
ok github.com/carlosframework/platform/internal/dbdoor/dbdoortest 0.061s
ok github.com/carlosframework/platform/internal/dbquery 0.044s
ok github.com/carlosframework/platform/internal/dbreads 3.006s
? github.com/carlosframework/platform/internal/dbreads/dbreadstest [no test files]
ok github.com/carlosframework/platform/internal/dbverify 0.036s
ok github.com/carlosframework/platform/internal/demo 0.010s
ok github.com/carlosframework/platform/internal/demobuild 3.153s
ok github.com/carlosframework/platform/internal/democlaim 0.660s
ok github.com/carlosframework/platform/internal/devbox 18.820s
ok github.com/carlosframework/platform/internal/dnsrec 0.030s
ok github.com/carlosframework/platform/internal/docsite 0.083s
ok github.com/carlosframework/platform/internal/domainreg 0.027s
ok github.com/carlosframework/platform/internal/domains 69.387s
ok github.com/carlosframework/platform/internal/doorkey 0.020s
ok github.com/carlosframework/platform/internal/economics 0.034s
ok github.com/carlosframework/platform/internal/edgefence 0.088s
ok github.com/carlosframework/platform/internal/edgeguard 0.302s
? github.com/carlosframework/platform/internal/edgeproof [no test files]
ok github.com/carlosframework/platform/internal/edgesfile 0.098s
ok github.com/carlosframework/platform/internal/egressaddr 0.010s
ok github.com/carlosframework/platform/internal/execsandbox 103.141s
ok github.com/carlosframework/platform/internal/fileacl 0.012s
ok github.com/carlosframework/platform/internal/fleetapi 1.579s
ok github.com/carlosframework/platform/internal/fleetstore 0.026s
ok github.com/carlosframework/platform/internal/fxrate 0.045s
ok github.com/carlosframework/platform/internal/gate 5.090s
ok github.com/carlosframework/platform/internal/genselect 0.068s
ok github.com/carlosframework/platform/internal/geo 0.040s
ok github.com/carlosframework/platform/internal/geoip 0.168s
ok github.com/carlosframework/platform/internal/groupadmission 0.021s
ok github.com/carlosframework/platform/internal/grouprollaws 17.449s
ok github.com/carlosframework/platform/internal/hadeparture 0.017s
ok github.com/carlosframework/platform/internal/hafresh 0.014s
ok github.com/carlosframework/platform/internal/hairpin 0.215s
ok github.com/carlosframework/platform/internal/historyreadback 0.920s
ok github.com/carlosframework/platform/internal/hostactors 22.028s
ok github.com/carlosframework/platform/internal/hostbox 23.197s
ok github.com/carlosframework/platform/internal/hostclaim 3.805s
ok github.com/carlosframework/platform/internal/hostenv 0.042s
ok github.com/carlosframework/platform/internal/hostevidence 0.023s
ok github.com/carlosframework/platform/internal/hostexec 25.109s
ok github.com/carlosframework/platform/internal/hostfence 0.253s
ok github.com/carlosframework/platform/internal/hostfiles 27.201s
ok github.com/carlosframework/platform/internal/hostfloor 0.054s
ok github.com/carlosframework/platform/internal/hostguard 1.728s
ok github.com/carlosframework/platform/internal/hostops 8.112s
? 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.007s
ok github.com/carlosframework/platform/internal/hostrelocate 2.588s
ok github.com/carlosframework/platform/internal/hostresolve 0.777s
ok github.com/carlosframework/platform/internal/hostwrite 0.007s
ok github.com/carlosframework/platform/internal/infraview 0.027s
ok github.com/carlosframework/platform/internal/ingresshealth 0.021s
ok github.com/carlosframework/platform/internal/ingresshealth/awstg 0.025s
ok github.com/carlosframework/platform/internal/instancectl 55.855s
ok github.com/carlosframework/platform/internal/instanceexec 9.240s
ok github.com/carlosframework/platform/internal/instancefs 0.039s
ok github.com/carlosframework/platform/internal/instancekey 0.017s
ok github.com/carlosframework/platform/internal/instanceupdates 0.046s
ok github.com/carlosframework/platform/internal/interactive 0.809s
ok github.com/carlosframework/platform/internal/launchd 0.011s
ok github.com/carlosframework/platform/internal/layout 25.083s
ok github.com/carlosframework/platform/internal/layout/pubclass 99.812s
ok github.com/carlosframework/platform/internal/lbhealth 0.038s
ok github.com/carlosframework/platform/internal/lease 147.077s
ok github.com/carlosframework/platform/internal/lease/leasetest 1.761s
ok github.com/carlosframework/platform/internal/lease/locktest 0.016s
ok github.com/carlosframework/platform/internal/ledger 0.066s
ok github.com/carlosframework/platform/internal/mail 1.268s
ok github.com/carlosframework/platform/internal/mailer 0.829s
ok github.com/carlosframework/platform/internal/mailsubmit 1.732s
ok github.com/carlosframework/platform/internal/mailwire 0.019s
ok github.com/carlosframework/platform/internal/maintenance 0.236s
ok github.com/carlosframework/platform/internal/maintenanceexec 8.884s
ok github.com/carlosframework/platform/internal/maintenanceguard 0.562s
ok github.com/carlosframework/platform/internal/media 2.182s
ok github.com/carlosframework/platform/internal/media/mediatest 0.009s
ok github.com/carlosframework/platform/internal/mediaaws 63.084s
ok github.com/carlosframework/platform/internal/mediahandler 44.699s
ok github.com/carlosframework/platform/internal/mediajobs 1.029s
ok github.com/carlosframework/platform/internal/medialocal 9.891s
ok github.com/carlosframework/platform/internal/metrics 0.152s
ok github.com/carlosframework/platform/internal/minorunits 0.006s
ok github.com/carlosframework/platform/internal/moves 53.980s
ok github.com/carlosframework/platform/internal/moves/archive 3.583s
ok github.com/carlosframework/platform/internal/moves/offlinerun 0.114s
ok github.com/carlosframework/platform/internal/namedunits 0.059s
ok github.com/carlosframework/platform/internal/objstore 1.001s
ok github.com/carlosframework/platform/internal/ops 15.096s
ok github.com/carlosframework/platform/internal/pageindex 3.850s
ok github.com/carlosframework/platform/internal/parity 0.106s
? github.com/carlosframework/platform/internal/parity/cmd/parity-doc [no test files]
ok github.com/carlosframework/platform/internal/park 1.005s
ok github.com/carlosframework/platform/internal/perf 0.206s
ok github.com/carlosframework/platform/internal/plans 0.149s
ok github.com/carlosframework/platform/internal/privatefile 0.013s
ok github.com/carlosframework/platform/internal/provision 238.061s
ok github.com/carlosframework/platform/internal/proxyproto 0.980s
ok github.com/carlosframework/platform/internal/publicrelease 0.042s
ok github.com/carlosframework/platform/internal/ratelimit 0.196s
ok github.com/carlosframework/platform/internal/regionlabel 0.075s
ok github.com/carlosframework/platform/internal/regionname 0.046s
ok github.com/carlosframework/platform/internal/registrar 0.009s
ok github.com/carlosframework/platform/internal/registrar/openprovider 0.205s
? github.com/carlosframework/platform/internal/registrar/registrartest [no test files]
ok github.com/carlosframework/platform/internal/registry 85.351s
ok github.com/carlosframework/platform/internal/relay 7.691s
ok github.com/carlosframework/platform/internal/release 83.713s
ok github.com/carlosframework/platform/internal/replicagen 0.016s
ok github.com/carlosframework/platform/internal/replicas 0.074s
ok github.com/carlosframework/platform/internal/reqrec 8.069s
ok github.com/carlosframework/platform/internal/rollout 12.985s
ok github.com/carlosframework/platform/internal/rolloutwords 0.024s
ok github.com/carlosframework/platform/internal/rootaws 101.573s
ok github.com/carlosframework/platform/internal/rootfsimage 0.931s
ok github.com/carlosframework/platform/internal/rootparticipation 0.084s
ok github.com/carlosframework/platform/internal/rootstate 0.040s
ok github.com/carlosframework/platform/internal/runs 0.689s
ok github.com/carlosframework/platform/internal/s3compat 0.015s
ok github.com/carlosframework/platform/internal/s3fake 1.246s
ok github.com/carlosframework/platform/internal/safefile 0.019s
ok github.com/carlosframework/platform/internal/schedule 24.304s
ok github.com/carlosframework/platform/internal/seeds 0.070s
ok github.com/carlosframework/platform/internal/sim/litestreamfacts 5.557s
ok github.com/carlosframework/platform/internal/sim/mediajobs 46.865s
ok github.com/carlosframework/platform/internal/sim/regionha 25.698s
ok github.com/carlosframework/platform/internal/status 0.803s
ok github.com/carlosframework/platform/internal/steering 0.511s
ok github.com/carlosframework/platform/internal/stopevidence 0.542s
ok github.com/carlosframework/platform/internal/storecfg 0.524s
ok github.com/carlosframework/platform/internal/svcrole 0.020s
ok github.com/carlosframework/platform/internal/systemd 6.766s
? github.com/carlosframework/platform/internal/systemdshow [no test files]
ok github.com/carlosframework/platform/internal/team 4.435s
ok github.com/carlosframework/platform/internal/teamcontract 0.254s
ok github.com/carlosframework/platform/internal/telemetry 0.054s
ok github.com/carlosframework/platform/internal/termfence 3.829s
ok github.com/carlosframework/platform/internal/timerspec 0.039s
ok github.com/carlosframework/platform/internal/tsidentity 4.206s
ok github.com/carlosframework/platform/internal/tunnelclient 0.496s
ok github.com/carlosframework/platform/internal/unixdial 0.020s
ok github.com/carlosframework/platform/internal/updatewords 0.051s
ok github.com/carlosframework/platform/internal/upstreamguard 0.028s
? github.com/carlosframework/platform/internal/upstreamguard/guardtest [no test files]
ok github.com/carlosframework/platform/internal/usage 0.035s
ok github.com/carlosframework/platform/internal/version 0.010s
ok github.com/carlosframework/platform/internal/vet 3.197s
ok github.com/carlosframework/platform/internal/zonehost 0.021s
ok github.com/carlosframework/platform/internal/zonehost/route53zones 0.091s
? 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.020s
ok github.com/carlosframework/platform/scripts/pathmapcheck 0.113s
ok github.com/carlosframework/platform/scripts/region-ha-g2/fixture 5.210s
ok github.com/carlosframework/platform/scripts/stateless-replicas-drill 1.154s
ok github.com/carlosframework/platform/scripts/witness-pointer 0.058s
=== cutover-witness (161 s, from +14 s)
ok github.com/carlosframework/platform 1.937s
=== internal_grouproll@0 (274 s, from +73 s)
ok github.com/carlosframework/platform/internal/grouproll 273.119s
=== internal_grouproll@1 (282 s, from +73 s)
ok github.com/carlosframework/platform/internal/grouproll 280.931s
=== internal_activator@0 (146 s, from +143 s)
ok github.com/carlosframework/platform/internal/activator 141.914s
=== internal_activator@1 (134 s, from +143 s)
ok github.com/carlosframework/platform/internal/activator 129.956s
=== internal_activator@2 (144 s, from +143 s)
ok github.com/carlosframework/platform/internal/activator 139.052s
=== internal_activator@3 (163 s, from +143 s)
ok github.com/carlosframework/platform/internal/activator 158.602s
=== internal_edge@0 (204 s, from +162 s)
ok github.com/carlosframework/platform/internal/edge 192.922s
=== internal_edge@1 (196 s, from +162 s)
ok github.com/carlosframework/platform/internal/edge 185.590s
=== internal_edge@2 (165 s, from +162 s)
ok github.com/carlosframework/platform/internal/edge 154.673s
=== internal_edge@3 (163 s, from +162 s)
ok github.com/carlosframework/platform/internal/edge 152.735s
=== root@0 (116 s, from +176 s)
ok github.com/carlosframework/platform 106.375s
=== root@1 (110 s, from +176 s)
ok github.com/carlosframework/platform 100.233s
=== root@2 (116 s, from +176 s)
ok github.com/carlosframework/platform 106.940s
=== root@3 (110 s, from +176 s)
ok github.com/carlosframework/platform 101.245s
=== root@4 (96 s, from +176 s)
ok github.com/carlosframework/platform 87.230s
=== internal_host@0 (135 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 129.416s
=== internal_host@1 (142 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 136.462s
=== internal_host@2 (281 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 275.494s
=== internal_host@3 (195 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 189.931s
=== internal_host@4 (213 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 207.406s
=== internal_host@5 (207 s, from +214 s)
ok github.com/carlosframework/platform/internal/host 201.359s
=== internal_console@0 (185 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 178.195s
=== internal_console@1 (195 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 187.849s
=== internal_console@2 (193 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 186.178s
=== internal_console@3 (245 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 238.952s
=== internal_console@4 (181 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 174.207s
=== internal_console@5 (195 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 187.941s
=== internal_console@6 (199 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 192.381s
=== internal_console@7 (194 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 187.256s
=== internal_console@8 (203 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 196.671s
=== internal_console@9 (203 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 196.020s
=== internal_console@10 (212 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 206.245s
=== internal_console@11 (222 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 215.452s
=== internal_console@12 (276 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 269.323s
=== internal_console@13 (192 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 185.294s
=== internal_console@14 (188 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 181.318s
=== internal_console@15 (239 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 232.922s
=== internal_console@16 (223 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 216.972s
=== internal_console@17 (197 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 190.870s
=== internal_console@18 (198 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 191.690s
=== internal_console@19 (199 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 192.038s
=== internal_console@20 (199 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 192.344s
=== internal_console@21 (218 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 211.195s
=== internal_console@22 (214 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 207.480s
=== internal_console@23 (211 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 203.451s
=== lists: internal_console 218 s, internal_edge 161 s, internal_activator 142 s, internal_host 213 s, root 174 s, internal_grouproll 72 s
=== cpu: the gate used 12434 cpu-seconds in 497 s, about 25.0 of 32 cores; the machine as a whole was 84% busy
=== opentofu ===
opentofu: 35 test files in 11 suites, OpenTofu v1.13.9
initialised in 14 s
ok 17 s infra/modules/box-fence-writer/tests/writer.tftest.hcl Success! 1 passed, 0 failed.
ok 27 s infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl Success! 3 passed, 0 failed.
ok 11 s infra/modules/deployment-buckets/tests/db_reads.tftest.hcl Success! 1 passed, 0 failed.
ok 14 s infra/modules/deployment-buckets/tests/evidence.tftest.hcl Success! 1 passed, 0 failed.
ok 28 s infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl Success! 3 passed, 0 failed.
ok 84 s infra/modules/media-engine/tests/media_engine.tftest.hcl Success! 24 passed, 0 failed.
ok 35 s infra/modules/pdf-host/tests/computed.tftest.hcl Success! 2 passed, 0 failed.
ok 72 s infra/modules/pdf-host/tests/pdf_host.tftest.hcl Success! 24 passed, 0 failed.
ok 50 s infra/modules/region-group-operator-document/tests/document.tftest.hcl Success! 12 passed, 0 failed.
ok 26 s infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl Success! 2 passed, 0 failed.
ok 67 s infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl Success! 30 passed, 0 failed.
ok 47 s infra/modules/region-host/tests/alert_publish.tftest.hcl Success! 18 passed, 0 failed.
ok 43 s infra/modules/region-host/tests/alerts_topic.tftest.hcl Success! 16 passed, 0 failed.
ok 14 s infra/modules/region-host/tests/analytics_prune.tftest.hcl Success! 2 passed, 0 failed.
ok 18 s infra/modules/region-host/tests/console_mail.tftest.hcl Success! 4 passed, 0 failed.
ok 10 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 9 s infra/modules/region-host/tests/group_alarms.tftest.hcl Success! 4 passed, 0 failed.
ok 10 s infra/modules/region-host/tests/group_iam.tftest.hcl Success! 4 passed, 0 failed.
ok 5 s infra/modules/region-host/tests/group_isolation.tftest.hcl Success! 1 passed, 0 failed.
ok 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 24 s infra/modules/region-host/tests/health_alarms.tftest.hcl Success! 10 passed, 0 failed.
ok 10 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 8 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 108 s infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl Success! 46 passed, 0 failed.
ok 76 s infra/modules/region-host/tests/store_conversion.tftest.hcl Success! 27 passed, 0 failed.
ok 19 s infra/modules/region-host/tests/store_scanning.tftest.hcl Success! 4 passed, 0 failed.
ok 19 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 14 s infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl Success! 5 passed, 0 failed.
ok 28 s infra/modules/scanner-host/tests/scanner_host.tftest.hcl Success! 14 passed, 0 failed.
opentofu: 35 files in 207 s
opentofu: PASS
=== cross ===
--- shard 0 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/arm64
--- shard 1 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling darwin/amd64
--- shard 2 of 5 ---
go version go1.26.10 linux/arm64
cross-compiling linux/arm64
linux/arm64 carlos binary: 65732770 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:31608
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.040s
=== RUN TestT4StorageProbeMinio
2026/11/22 14:08:11 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18EA63379544880A, HostID: a8653f9ec0f75d22d4d14004d8d858e3de7e0320dd1ebf204dd0e02f0f5efa4b, 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.041s
=== RUN TestS3StoreMinioContract
=== RUN TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.04s)
--- PASS: TestS3StoreMinioContract/conditional_get_and_etag_listing (0.01s)
--- PASS: TestS3StoreMinioContract/bump_through_every_mutation_path (0.02s)
PASS
ok github.com/carlosframework/platform/internal/release 0.044s
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.04s)
PASS
ok github.com/carlosframework/platform/internal/release 0.043s
=== RUN TestEndToEndMinio
=== RUN TestEndToEndMinio/plan
=== RUN TestEndToEndMinio/roll
=== RUN TestEndToEndMinio/replace
=== RUN TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.49s)
--- PASS: TestEndToEndMinio/plan (0.01s)
--- PASS: TestEndToEndMinio/roll (0.13s)
--- PASS: TestEndToEndMinio/replace (0.16s)
--- PASS: TestEndToEndMinio/remove (0.16s)
PASS
ok github.com/carlosframework/platform/internal/grouproll 0.495s
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/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/22 14:08:17 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/22 14:08:17 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/22 14:08:17 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/22 14:08:17 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/22 14:08:17 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/22 14:08:18 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/22 14:08:18 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%3A44789: could not determine target mailbox
agent.go:136: dbreads: dbr_aouivxcqajpa22ldgw6akrqdk4: planned 1 files (720 bytes) and restored to 1 in 13ms
agent.go:136: dbreads: dbr_aouivxcqajpa22ldgw6akrqdk4: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/22 14:08:19 console: db read dbr_aouivxcqajpa22ldgw6akrqdk4: relayed 1 chunks (102 bytes) in 1.006s, ended done
agent.go:136: dbreads: dbr_7fqqa57vq2iq6hze7rj3fwujg4: planned 3 files (1544 bytes) and restored to 3 in 13ms
agent.go:136: dbreads: dbr_7fqqa57vq2iq6hze7rj3fwujg4: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/22 14:08:20 console: db read dbr_7fqqa57vq2iq6hze7rj3fwujg4: relayed 1 chunks (102 bytes) in 1.006s, ended done
agent.go:136: dbreads: dbr_la3fihtq5ja2hhgv5bbv7bshti: planned 3 files (1544 bytes) and held through 3 in 12ms
agent.go:136: dbreads: dbr_la3fihtq5ja2hhgv5bbv7bshti: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/22 14:08:21 console: db read dbr_la3fihtq5ja2hhgv5bbv7bshti: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN TestDBForwardMinio/by_disconnect
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_z7hmd5fgacopq4em2xpyslbpiq: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/22 14:08:21 console: db read dbr_z7hmd5fgacopq4em2xpyslbpiq: relayed 0 chunks (0 bytes) in 29ms, ended client gone
agent.go:136: dbreads: dbr_z7hmd5fgacopq4em2xpyslbpiq: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN TestDBForwardMinio/by_timeout
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_5quc5z3p4gfyez5uuvipu76p4u: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/22 14:08:41 console: db read dbr_5quc5z3p4gfyez5uuvipu76p4u: relayed 0 chunks (0 bytes) in 19.529s, ended no-result
agent.go:136: dbreads: dbr_5quc5z3p4gfyez5uuvipu76p4u: output 5 bytes in 1 confirmed chunks in 19.503s
--- PASS: TestDBForwardMinio (23.21s)
--- PASS: TestDBForwardMinio/by_disconnect (0.24s)
--- PASS: TestDBForwardMinio/by_timeout (19.64s)
PASS
ok github.com/carlosframework/platform/internal/console 23.255s
Bucket created successfully `local/media-transfers`.
Bucket created successfully `local/media-transfer-results`.
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.06s)
PASS
ok github.com/carlosframework/platform/internal/mediaaws 0.061s
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.576s
=== RUN TestHeldHandoverTwoBoxMinio
2026/11/22 14:08:46 edge: mesh key: minted
2026/11/22 14:08:46 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/22 14:08:46 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/22 14:08:46 tenant admission is open. accepting tenant work
2026/11/22 14:08:46 activator: HA placement host=shop-2f4c5794.example.test kind=Place ref=annie reason=roomiest generation=2026-11-22T14:08:46Z lock_generation=0
2026/11/22 14:08:46 lease: t8-2f4c5794/shop-2f4c5794.example.test: HA lease acquired in 4ms (first wake)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: started carlos-instance@shop\x2d2f4c5794.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) 7ms, launch file 0s, gate 0s, root start 1ms)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: carlos-instance@shop\x2d2f4c5794.example.test.service launched in 8ms, healthy 0s later
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: woke in 22ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 9ms
2026/11/22 14:08:46 lease: t8-2f4c5794/plain-2f4c5794.example.test: acquired in 2ms (client 0s, lock read and write 2ms)
2026/11/22 14:08:46 activator: no replica for plain-2f4c5794.example.test in s3://contract-bucket/t8-2f4c5794/plain-2f4c5794.example.test — booting fresh
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test: started carlos-instance@plain\x2d2f4c5794.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 4ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test: carlos-instance@plain\x2d2f4c5794.example.test.service launched in 7ms, healthy 0s later
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test: woke in 102ms: checks 0s, lease 2ms, restore 21ms, identity 0s, protect 0s, spawn 8ms, replicate 71ms
2026/11/22 14:08:46 lease: t8-2f4c5794/bot0.shop.bac.sidecar.internal: HA lease acquired in 4ms (first wake)
2026/11/22 14:08:46 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/22 14:08:46 activator: bot0.shop.bac.sidecar.internal: woke in 70ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 7ms, settle 0s, replicate 58ms
2026/11/22 14:08:46 activator: next-due probe plain-2f4c5794.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/22 14:08:46 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:83d88cebe90d5cbca946b2a470193e44898686b83793dec7700795fe8a941ee7) in 9ms: files 1ms, sync 5ms, record 1ms, marker 2ms
2026/11/22 14:08:46 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test hibernated
2026/11/22 14:08:46 activator: next-due probe shop-2f4c5794.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: released with a marker (clean true, txid 1, files 3:5d5f228defc402f563949adb58942beb8c6cdb8eaaf99af5e1f80ccf60f28c41) in 6ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test hibernated
2026/11/22 14:08:46 lease: t8-2f4c5794/shop-2f4c5794.example.test: HA lease acquired in 3ms (clean marker)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: restored (other-box)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: started carlos-instance@shop\x2d2f4c5794.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/22 14:08:46 activator: shop-2f4c5794.example.test: carlos-instance@shop\x2d2f4c5794.example.test.service launched in 2ms, healthy 0s later
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: woke in 38ms: checks 0s, lease 4ms, restore 25ms, identity 0s, protect 0s, spawn 2ms, replicate 6ms
2026/11/22 14:08:46 edge: ha-take shop-2f4c5794.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/22 14:08:46 edge: forward shop-2f4c5794.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:f4d6849b8f4b1d8f9ae9f9e8403a674c Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-22 14:08:46.538498997 +0000 UTC FinishedAt:2026-11-22 14:08:46.686717224 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-2f4c5794.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:} {Host:plain-2f4c5794.example.test Kind:other Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:103 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-2f4c5794.example.test <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> stop plain-2f4c5794.example.test marker=true clean=true <nil> releasing shop-2f4c5794.example.test <nil> stop shop-2f4c5794.example.test marker=true clean=true <nil> taken shop-2f4c5794.example.test betty <nil> end-moves]
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/bot0.shop.bac.sidecar.internal/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-2f4c5794/plain-2f4c5794.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/head.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/generations/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/files/0/manifest.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/files/0/objects/0000000000000001-bc7bf4219c43043bfc654825d762b727b276c3dda848a1ee69d405728f8a03f5
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/files/0/objects/0000000000000003-06725e84a564990598e74b1390e5944ff3589459491ee44182370e1a76e4ab32
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/0000/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/0000/0000000000000002-0000000000000002.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-2f4c5794/shop-2f4c5794.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-2f4c5794/shop-2f4c5794.example.test/0003/
hadrain_twobox_minio_linux_test.go:1243: drain took 183ms; S3 calls 45 (DELETE lock=1 GET files=3 GET head=1 GET lock=2 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/22 14:08:46 lease: t8-2f4c5794/plain-2f4c5794.example.test: acquired in 2ms (client 0s, lock read and write 1ms)
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test: started carlos-instance@plain\x2d2f4c5794.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/22 14:08:46 activator: plain-2f4c5794.example.test: carlos-instance@plain\x2d2f4c5794.example.test.service launched in 1ms, healthy 0s later
2026/11/22 14:08:46 lease: /tmp/carlos-minio-contract-zqzYAK/g/dw811796311/data/instances/plain-2f4c5794.example.test/plain-2f4c5794.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test: woke in 10ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 1ms, spawn 1ms, replicate 6ms
2026/11/22 14:08:46 activator: next-due probe shop-2f4c5794.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test: released with a marker (clean true, txid 2, files 3:5d5f228defc402f563949adb58942beb8c6cdb8eaaf99af5e1f80ccf60f28c41) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/22 14:08:46 activator: shop-2f4c5794.example.test hibernated
2026/11/22 14:08:46 tenant admission is closed for shutdown
2026/11/22 14:08:46 activator: next-due probe plain-2f4c5794.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/22 14:08:46 activator: plain-2f4c5794.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.62s)
=== RUN TestHeldHandoverLostLeaseMinio
2026/11/22 14:08:46 edge: mesh key: minted
2026/11/22 14:08:46 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/22 14:08:46 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/22 14:08:46 tenant admission is open. accepting tenant work
2026/11/22 14:08:46 activator: HA placement host=shop-6e51aeba.example.test kind=Place ref=annie reason=roomiest generation=2026-11-22T14:08:46Z lock_generation=0
2026/11/22 14:08:46 lease: t8-6e51aeba/shop-6e51aeba.example.test: HA lease acquired in 3ms (first wake)
2026/11/22 14:08:46 activator: shop-6e51aeba.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/22 14:08:46 activator: shop-6e51aeba.example.test: started carlos-instance@shop\x2d6e51aeba.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 5ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/22 14:08:46 activator: shop-6e51aeba.example.test: carlos-instance@shop\x2d6e51aeba.example.test.service launched in 7ms, healthy 0s later
2026/11/22 14:08:46 activator: shop-6e51aeba.example.test: woke in 18ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 6ms
2026/11/22 14:08:46 activator: next-due probe shop-6e51aeba.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/22 14:08:46 activator: final checkpoint shop-6e51aeba.example.test: lease: release marker owed for s3://contract-bucket/t8-6e51aeba/shop-6e51aeba.example.test/lock.json (If-Match "ac80270ca63f39375df57c37d3abb87c"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/22 14:08:46 activator: shop-6e51aeba.example.test hibernated
2026/11/22 14:08:46 activator: handover of shop-6e51aeba.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-6e51aeba.example.test client 4 "
hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-6e51aeba.example.test <nil> releasing shop-6e51aeba.example.test <nil> stop shop-6e51aeba.example.test marker=false clean=false <nil> left shop-6e51aeba.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/22 14:08:47 tenant admission is closed for shutdown
2026/11/22 14:08:47 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.27s)
PASS
ok github.com/carlosframework/platform/internal/host 0.940s
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/22 14:08:48 lease: instances/gen-1795356528266709229.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/22 14:08:48 lease: instances/gen-1795356528266709229.shop.example.com: HA lease acquired in 3ms (holder terminated)
gentake_minio_test.go:308: a second create-only copy onto instances/gen-1795356528266709229.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/22 14:08:48 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/22 14:08:48 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/22 14:08:48 lease: instances/gen-1795356528395416118.shop.example.com: HA lease acquired in 4ms (first wake)
2026/11/22 14:08:48 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/22 14:08:48 lease: instances/gen-1795356528395416118.shop.example.com: HA lease acquired in 3ms (clean marker)
=== RUN TestGenerationTakeMinio/copy-version
=== RUN TestGenerationTakeMinio/store-time
2026/11/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/22 14:08:48 http: proxy error: context canceled
2026/11/22 14:08:48 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/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (clean marker)
2026/11/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (unclean marker)
2026/11/22 14:08:48 lease: instances/gen-1795356528496282734.shop.example.com: HA lease acquired in 3ms (unclean marker)
=== RUN TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.35s)
--- PASS: TestGenerationTakeMinio/take (0.13s)
--- PASS: TestGenerationTakeMinio/switch-412 (0.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.363s
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
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 1m49.575s
codehealth_test.go:107: line metrics (code lines, then physical):
file-lines 5471 7324 internal/activator activator_test.go
file-lines 4219 7040 internal/console server.go
file-lines 4184 6365 . apimode.go
file-lines 3782 7198 internal/activator activator.go
file-lines 3530 4459 . apimode_test.go
file-lines 3261 3864 internal/registry registry_test.go
file-lines 3211 6362 internal/host agent.go
file-lines 3094 3992 internal/provision reconcile_test.go
func-lines 870 891 internal/host plan14InstalledClaimLaunch
func-lines 811 1275 internal/provision Reconcile
func-lines 769 1242 internal/console (*Server).handleAPIInstanceCreate
func-lines 688 1232 internal/host runAgent
func-lines 570 903 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 809 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 400 868 internal/provision rootReadArchivedChain
func-lines 399 732 internal/release PassFilter
func-lines 390 398 internal/host runFilesSeedPreparationWithLive
func-lines 383 406 internal/console TestDemoSourceToLiveAndUpdate
func-lines 379 898 internal/edge (*Edge).ServeHTTP
func-lines 378 600 internal/console (*Server).handleAPIShip
func-lines 374 377 internal/host plan14RequiredArtifactsRootRunner
func-lines 371 417 internal/host TestRootEgressKernelProof
func-lines 367 635 cmd/console serve
func-lines 364 371 internal/host testRootMigrationBootstrap
func-lines 360 362 internal/edge TestDemoAPIAliasBoundary
func-lines 358 362 internal/registry (*Registry).haJournal
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 (203 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/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
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/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/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/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/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/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/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/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/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 1094 at 474 sites log.Fatal*, (*log.Logger).Fatal* and os.Exit in the root package's production files
codehealth_test.go:115: sleep 1005 at 811 sites time.Sleep in test files
codehealth_test.go:115: db-no-context 885 at 703 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 18573 at 45 sites functions over 300 code lines (blank and comment-only lines not counted)
codehealth_test.go:115: file-lines 30752 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: file-lines internal/activator activator.go -: 3782 in the code, the record allows 3783 (make code-health-record lowers it)
codehealth_test.go:119: below the record: file-lines internal/host agent.go -: 3211 in the code, the record allows 3214 (make code-health-record lowers it)
--- PASS: TestCodeHealth (109.58s)
PASS
ok github.com/carlosframework/platform/internal/codehealth 110.655s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: comparing with the merge base 042e1af6b8acad6a7b0f050584c0951544fef962 (main is 042e1af6b8acad6a7b0f050584c0951544fef962)
=== RUN TestRecordAgainstBase
--- PASS: TestRecordAgainstBase (0.01s)
PASS
ok github.com/carlosframework/platform/internal/codehealth 0.008s
code-health record: no line went up without a reason
=== race ===
go version go1.26.10 linux/arm64
GATE_RACE=1 .amadan/test-gate.sh
=== internal_systemd@0 (13 s, from +13 s)
ok github.com/carlosframework/platform/internal/systemd 12.530s
=== internal_rootaws@0 (26 s, from +33 s)
ok github.com/carlosframework/platform/internal/rootaws 25.224s
=== internal_activator@0 (279 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 277.195s
=== internal_activator@1 (270 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 268.087s
=== internal_activator@2 (292 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 289.546s
=== internal_activator@3 (383 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 381.237s
=== internal_activator@4 (284 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 281.391s
=== internal_activator@5 (292 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 289.906s
=== internal_activator@6 (304 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 301.446s
=== internal_activator@7 (435 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 433.045s
=== internal_edge@0 (85 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 81.853s
=== internal_edge@1 (64 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 60.488s
=== internal_edge@2 (189 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 185.555s
=== internal_edge@3 (150 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 146.485s
=== internal_edge@4 (171 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 167.464s
=== internal_edge@5 (237 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 233.291s
=== internal_edge@6 (217 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 213.751s
=== internal_edge@7 (225 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 221.805s
=== internal_edge@8 (215 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 211.007s
=== internal_edge@9 (320 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 316.506s
=== internal_edge@10 (210 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 206.272s
=== internal_edge@11 (249 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 245.033s
=== internal_edge@12 (247 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 243.127s
=== internal_edge@13 (247 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 243.259s
=== internal_edge@14 (199 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 194.825s
=== internal_edge@15 (261 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 257.660s
=== internal_host@0 (15 s, from +192 s)
ok github.com/carlosframework/platform/internal/host 11.301s
=== internal_host@1 (9 s, from +192 s)
ok github.com/carlosframework/platform/internal/host 5.602s
=== lists: internal_edge 132 s, internal_activator 111 s, internal_host 192 s, internal_rootaws 33 s, internal_systemd 13 s
=== cpu: the gate used 7618 cpu-seconds in 546 s, about 14.0 of 32 cores; the machine as a whole was 43% busy
=== gitleaks ===
go version go1.26.10 linux/arm64
go: downloading github.com/zricethezav/gitleaks/v8 v8.30.1
go: downloading github.com/rs/zerolog v1.33.0
go: downloading github.com/fatih/semgroup v1.2.0
go: downloading github.com/gitleaks/go-gitdiff v0.9.1
go: downloading github.com/h2non/filetype v1.1.3
go: downloading github.com/mholt/archives v0.1.2
go: downloading github.com/charmbracelet/lipgloss v0.5.0
go: downloading github.com/Masterminds/sprig/v3 v3.3.0
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/hashicorp/go-version v1.7.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/spf13/viper v1.19.0
go: downloading golang.org/x/sync v0.11.0
go: downloading golang.org/x/text v0.22.0
go: downloading github.com/nwaples/rardecode/v2 v2.1.0
go: downloading github.com/klauspost/compress v1.17.11
go: downloading github.com/sorairolake/lzip-go v0.3.5
go: downloading github.com/minio/minlz v1.0.0
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/bodgit/sevenzip v1.6.0
go: downloading github.com/STARRY-S/zip v0.2.1
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
go: downloading github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
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/muesli/termenv v0.15.1
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading dario.cat/mergo v1.0.1
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver/v3 v3.3.0
go: downloading github.com/huandu/xstrings v1.5.0
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading github.com/shopspring/decimal v1.4.0
go: downloading github.com/spf13/cast v1.7.1
go: downloading golang.org/x/crypto v0.35.0
go: downloading github.com/fsnotify/fsnotify v1.8.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/spf13/afero v1.12.0
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.9
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/bodgit/plumbing v1.3.0
go: downloading github.com/bodgit/windows v1.0.1
go: downloading github.com/hashicorp/go-multierror v1.1.1
go: downloading go4.org v0.0.0-20230225012048-214862532bf5
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading golang.org/x/sys v0.30.0
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 94 near misses of the names notscanned.go lists
self-test: skipped the 31 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, 126 tracked files judged, 3 broken setups refused
gitleaks: scanned 11258 tracked files; 31 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
gitleaks: clean
Intent
<task-notification> <task-id>bftg1n731</task-id> <tool-use-id>toolu_015SgPGRGUCkULQqz3ZkRKiz</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/92b455b5-5f98-4e74-88b4-5388c3c18f62/tasks/bftg1n731.output</output-file> <status>completed</status> <summary>Background command "Poll CI on the new tip until it finishes" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 14.3 g CO₂e (1,844,738 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on fleet-client-address-1348, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/notes/census-proposal-fleet-client-address-1348.md b/docs/superpowers/notes/census-proposal-fleet-client-address-1348.md| index d5ce2c126..117e168cb 100644 |
| --- a/docs/superpowers/notes/census-proposal-fleet-client-address-1348.md |
| +++ b/docs/superpowers/notes/census-proposal-fleet-client-address-1348.md |
| @@ -14,6 +14,6 @@ Recorded dispositions, which each change must still satisfy: |
| - `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read);rev3=census-ruling-fleet-unrouted-503;basis=a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added;rev3=census-ruling-fleet-seeded-create-2;basis=The hub's door routing asks boxConsolePath(r) instead of the inline /api/fleet/replicas/ test, so POST /api/fleet/seeds/ goes to the local console by the same rule (POST only, clean path, no RawPath) as the replica doors. Serving only; no read of a path a tenant names; the same 65 read sites.;rev3=census-ruling-path-routes-across-boxes;basis=#186: selection returns requestSelection; a Remote selection is dispatched by servePathRemote (one signed hop, never from a verified hop, door call or pin); the ownership block moved to serveNameOwner/nameOwnerVerdict (pathhop.go), so its route reads left; login re-selection via loginLookupPath plus refuseLoginAcross; LRU also requires pathLRUAllowed; no read added |
| -Seal: `47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132` → `23cc63cd73452798f0fcf0800b63b909b055f2e52b48f3a09f9ca2fd9b3be427`. |
| +Seal: `b2f039a12bb284c9a36b391339e25e3f77ec94a3d4e38389ec9ef75261d7873f` → `9fb6041c2fe2f33edf7cc2a0fb6dc05092015414b89cab3610ebcfc04c21d5b0`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/notes/census-proposal-precert-dns01-1293.md b/docs/superpowers/notes/census-proposal-precert-dns01-1293.md| new file mode 100644 |
| index 000000000..5f74fa03f |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-precert-dns01-1293.md |
| @@ -0,0 +1,19 @@ |
| +# Census approval: precert-dns01-1293 |
| + |
| +Ruling `census-ruling-precert-dns01-1293`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. | |
| + |
| +Envelopes re-pinned: `internal/edge`, `internal/host`, `internal/hostenv`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/edge/edge.go` `RunWithActivatorReady`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added. |
| + |
| +Seal: `47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132` → `b2f039a12bb284c9a36b391339e25e3f77ec94a3d4e38389ec9ef75261d7873f`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md| new file mode 100644 |
| index 000000000..23066f4e5 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md |
| @@ -0,0 +1,44 @@ |
| +Reviewed `b823417eb6e95be0f6febdb87bb081c2bea6445d` against `origin/main`, merge base `d3266e8e`. |
| + |
| +1. **P1 — Non-pending claims do not establish ownership for DNS-01 issuance.** |
| + |
| + [precert.go:223](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert.go:223) accepts any non-pending, routed claim inside a listed zone. However, [domainpolicy.go:302](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/console/domainpolicy.go:302) returns “proven” without checking DNS when `CONSOLE_DOMAIN_PROOF` is off—the default. `AttachClaimProven` then stores `Pending=false`. |
| + |
| + **Failure scenario:** configure `CARLOS_DNS01_ZONES=example.com`, leave domain proof off, and leave that zone available to ordinary member attaches. A member attaches an unclaimed `billing.example.com` to their app without controlling its DNS. The issuer publishes the challenge using the operator’s credentials and obtains the certificate. Previously, the member’s attach alone could not satisfy ACME validation against the domain’s existing servers. |
| + |
| + **Fix:** require positive DNS-01 authorization from a trusted path: actual ownership proof or an operator-authorized attach. Legacy/proof-disabled claims must not qualify solely through `Pending=false`. Add a regression covering a member attach with domain proof disabled. |
| + |
| + **Fault family:** tenant claim data must not substitute for authorization to use the operator’s DNS authority. |
| + |
| +2. **P1 — Concurrent apex and wildcard orders overwrite each other’s Route 53 challenge.** |
| + |
| + The wildcard and pre-issuer loops start independently at [edge.go:5106](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/edge.go:5106) and line 5142. Orders for `*.example.com` and `example.com` both publish `_acme-challenge.example.com`. The account mutex ends before challenge handling; [wildcard.go:821](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/wildcard.go:821) has no shared challenge lock. [route53dns.go:106](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/route53dns.go:106) UPSERTs a record set containing exactly one value. |
| + |
| + **Failure scenario:** both certificates are missing or due. One order replaces the other’s TXT before validation, causing that order to fail and back off for an hour. An initial apex pre-issuance can therefore fail precisely when preparing a DNS switch. |
| + |
| + **Fix:** serialize publication through validation and cleanup by challenge FQDN, shared across both managers and provider instances. Add a deterministic concurrent apex/wildcard test using Route 53 replacement semantics. The current fake provider appends values at [precert_test.go:87](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert_test.go:87), masking this collision. |
| + |
| + **Fault family:** an active DNS challenge must retain its TXT value until validation completes. |
| + |
| +3. **P2 — Repeated failures can permanently starve later hostnames.** |
| + |
| + Candidates are sorted at [precert.go:236](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert.go:236), every pass restarts at the beginning, and budget exhaustion returns immediately at line 275. Failed names become eligible again after the same hour that releases their budget slots. |
| + |
| + **Failure scenario:** the first 20 names repeatedly fail with ordinary errors. They consume every hourly slot, so a later, issuable name never receives an attempt. An in-memory simulation of this scheduling logic over 180 minute passes produced three attempts for each failing name and zero for the final healthy name. |
| + |
| + **Fix:** retain a rotating cursor or prioritize the least recently attempted eligible name. Add a mixed failure/success regression proving eventual progress while preserving both caps. |
| + |
| + **Fault family:** bounded retry scheduling must preserve progress for other eligible claims. |
| + |
| +No P3 findings. The fake CA does check the expected DNS-01 digest. Targeted Go tests could not run: Go attempted to update `go.mod`, which the read-only sandbox refused. `git diff --check` passed; no files were edited. |
| + |
| +The census verdicts below address the root-read criteria; they do not clear the issuance defects above. |
| + |
| +| Census item | Verdict | Lines read and basis | |
| +|---|---|---| |
| +| `internal/edge/edge.go:RunWithActivatorReady` | **APPROVE** | Lines 5020–5150, especially 5138–5144. Starts the optional loop in the edge process; no added root read or weakened root check. | |
| +| `internal/edge` envelope | **APPROVE** | `precert.go` 1–412; `wildcard.go` 691–898; changed test code and serving/provider paths cited above. New certificate work runs as `carlos`; `carlos-edge.service` lines 28–46 confirm the environment source and execution identity. | |
| +| `internal/host` envelope | **APPROVE** | `agent.go` 139–148. Comment-only configuration documentation; no runtime change. | |
| +| `internal/hostenv` envelope | **APPROVE** | `hostenv.go` 56–95, 129–132, 391–434. Adds an operator-supplied variable to the allowlist; existing value validation remains intact. No tenant-controlled root path or command is introduced. | |
| + |
| +**NOT READY** |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R2.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R2.md| new file mode 100644 |
| index 000000000..e062ff9bf |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R2.md |
| @@ -0,0 +1,32 @@ |
| +R1 P1-1 — **Resolved:** issuance now requires both an operator-listed account and zone. |
| +R1 P1-2 — **Resolved:** the shared challenge lock covers TXT publication, validation, and cleanup. |
| +R1 P2 — **Resolved:** least-recently-tried ordering prevents failing names from starving untried names. |
| + |
| +Reviewed `ec7b62d2261e9f854a953d28cfcf2022edd80a7c`, diff `origin/main...HEAD`, merge base `d3266e8e`. |
| + |
| +No P1 findings. |
| + |
| +**P2 — First-route claims are incorrectly excluded from pre-issuance.** |
| + |
| +[precert.go:263](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert.go:263) skips every nonregional claim with an empty `Route`. That shape also represents a legitimate first-route attach: [domainattach.go:205](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/console/domainattach.go:205) constructs the claim, and lines 248–324 retain its empty `Route` while creating the static instance record at `Host`. [apidomains.go:520](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/console/apidomains.go:520) explicitly preserves that representation on re-attach. |
| + |
| +**Failure scenario:** an allowed account attaches a hostname inside an allowed zone as its first static route, before moving DNS. Even after provisioning succeeds, every pre-issuer pass skips it. It still depends on HTTP-01 after the switch. |
| + |
| +**Fix:** distinguish a reservation from a first-route claim backed by its matching instance record. Admit the latter while retaining the pending, account, zone, and catch-all exclusions. Add a regression covering this first-route shape alongside an unbacked reservation. |
| + |
| +**Fault family:** candidate selection must recognize every supported representation of a served claim. |
| + |
| +No P3 findings. |
| + |
| +The cache format and serving fallback support pre-issued certificates on both issuer and non-issuer edges. Autocert renewal checks the refreshed cache before ordering. The fake CA’s DNS-01 mode checks the expected TXT digest. |
| + |
| +`git diff --check` and formatting checks passed. Targeted tests could not start: the read-only sandbox prevented Go from creating its work directory. Census execution was therefore not verified. No files were edited. |
| + |
| +| Census item | Verdict | Lines read and basis | |
| +|---|---|---| |
| +| `edge.go:RunWithActivatorReady` | **APPROVE** | [edge.go:5020](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/edge.go:5020), lines 5020–5150. Optional edge-process loop; no added root read or weakened root check. | |
| +| `internal/edge` envelope | **APPROVE** | `precert.go` 1–461; `wildcard.go` 693–926; changed tests and reached serving/provider paths. [carlos-edge.service:28](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/host/units/carlos-edge.service:28), lines 28–46, confirms execution as `carlos` using the protected environment. | |
| +| `internal/host` envelope | **APPROVE** | [agent.go:139](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/host/agent.go:139), lines 139–147. Comment-only configuration additions. | |
| +| `internal/hostenv` envelope | **APPROVE** | [hostenv.go:56](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/hostenv/hostenv.go:56), lines 56–95, 129–144, 386–434. Operator configuration allowlist additions preserve value validation and introduce no tenant-controlled root path. | |
| + |
| +**READY AFTER FIXES** |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R1.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R1.md| new file mode 100644 |
| index 000000000..cc040314a |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R1.md |
| @@ -0,0 +1,113 @@ |
| +# Review brief: branch precert-dns01-1293 (#1293), round 1 of 3 |
| + |
| +Repo carlos/platform, branch `precert-dns01-1293`, commit named in the prompt. |
| +Under review: the diff `origin/main...HEAD` (merge base d3266e8e). |
| +Authorities on main: `internal/edge/certsync.go` (issuer gate, publishing |
| +cache, mirror), `internal/edge/wildcard.go` (DNS-01 wildcards), |
| +`internal/edge/certwarm.go` (HTTP-01 warm), `internal/edge/certsweep.go`, |
| +`internal/domains/claims.go` and `claimcache.go`, AGENTS.md ("Stopping |
| +rules", "The census"). |
| + |
| +You are an independent reviewer. Read the diff, then the code it reaches, |
| +and check every claim in the comments against that code. |
| + |
| +## The problem (amadan discussion #1293) |
| + |
| +A production switch on 2026-11-19 moved a custom hostname's DNS to a |
| +multi-edge CARLOS deployment. The home box (not the issuer) had no |
| +certificate, refused every handshake with "acme: not available here" |
| +for ~4 minutes, and was rolled back. Root cause: an attached alias that |
| +does not point at the deployment yet is never published to |
| +control/edges/, so the issuer never orders it until the home box's DNS |
| +sweep stamps it "pointing" (5-7 min), and HTTP-01 could not succeed |
| +before the switch anyway. |
| + |
| +## The change |
| + |
| +`internal/edge/precert.go`: with `CARLOS_DNS01_ZONES` set, the issuer |
| +(only) lists the claims (domains/) through a ClaimCache every minute, |
| +and for each proven, served claim whose host is in a listed zone, not |
| +covered by a usable wildcard, and without a current published cert, |
| +orders a certificate over DNS-01 through the existing DNS provider seam |
| +and stores it under the host's autocert cache name through the |
| +publishing cache (local disk, then control/certs/<host>). Renews ahead |
| +of autocert's window. Caps: 5 orders/pass, 20/hour; backoff 1h per name, |
| +12h on no-zone. A current local cert missing from the bucket is |
| +republished instead of reordered. `wildcard.go`: the order is factored |
| +into `dns01Order` + free `solveDNS01`, shared with wildcards; the account |
| +key load-or-mint is serialized. `edge.go` wires it after the cert warm. |
| +`hostenv` allows the variable. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Scope is operator-listed zones only (not "any zone the provider |
| + holds"), and the feature is off when the variable is unset. |
| +- Only the issuer orders; non-issuers serve via the existing mirror. |
| +- No console or CLI change in this branch. |
| + |
| +## What to check |
| + |
| +1. Correctness of serving: will a non-issuer edge (and the issuer |
| + itself, whose autocert HostPolicy refuses a name that is not yet a |
| + deployment host) actually serve the pre-issued cert for SNI = host, |
| + before and after the name points? Trace wrapGetCertificate, the |
| + mirror snapshot, syncLocal, autocert's cache format and key name. |
| +2. Interaction with the existing machinery once the name points: |
| + certwarm (could it order HTTP-01 anyway, or duplicate), autocert |
| + renewal timers, certmirror backfill/ownsCertName, certsweep, the |
| + home box's cert_expires_at stamp. Any path that deletes, overwrites |
| + with something worse, or fights the pre-issued entry? |
| +3. The refactor in wildcard.go: behaviour-preserving for wildcards |
| + (identifiers, CSR, challenge FQDN incl. delegation, log text, |
| + errNoZone wrapping, account key semantics)? |
| +4. Trust boundary: can a tenant, member or app cause the issuer to |
| + order (or publish a TXT in the operator's zone for) a name the |
| + operator did not intend? Consider pending claims, claims written via |
| + the fleet store door, IDN/uppercase/trailing-dot hosts, a claim for |
| + the zone apex, hosts that are a suffix-trick of a zone, regional and |
| + instance catch-all claims. Route 53 IAM is scoped to |
| + `_acme-challenge.*` TXT records (infra/modules/region-host/main.tf). |
| +5. Rate limits and cost: the per-pass/hourly caps, backoff, the claims |
| + listing cadence (issuer only), the publish repair path. Can anything |
| + loop orders against Let's Encrypt or write the bucket every pass? |
| +6. Concurrency: shared account key with the wildcard manager, the |
| + mutex, the preIssuer's maps, the held-gate context. |
| +7. Tests: does `TestPreIssueE2E` prove what it claims (the fake CA's |
| + new dns-01 mode really checks the TXT value)? Missing cases? |
| +8. Census: `make census-card` lists unit `internal/edge/edge.go` |
| + `RunWithActivatorReady` (body) and re-pinned envelopes |
| + `internal/edge`, `internal/host`, `internal/hostenv`. The card is |
| + `docs/superpowers/notes/census-proposal-precert-dns01-1293.md`. Give a |
| + verdict for the unit and each envelope per AGENTS.md "Getting a |
| + change approved" step 4: 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, or weakens a |
| + check root relies on. Note carlos-edge runs as user carlos, not root. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. |
| + Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for |
| + another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not |
| +raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the problem, the evidence |
| +(file:line, verified), the failure scenario, a concrete fix and the |
| +invariant or trust boundary it breaks (its fault family). Then the |
| +census verdicts (unit + three envelopes, each APPROVE or REJECT with the |
| +lines read). End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another |
| + round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of |
| +your own. Do not run the full test suites (targeted `go test -run` on |
| +internal/edge is fine; leave GOCACHE unset). |
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md| new file mode 100644 |
| index 000000000..350585229 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md |
| @@ -0,0 +1,136 @@ |
| +# Review brief: branch precert-dns01-1293 (#1293), round 2 of 3 |
| + |
| +Repo carlos/platform, branch `precert-dns01-1293`, commit named in the prompt. |
| +Under review: the diff `origin/main...HEAD` (merge base d3266e8e). |
| +Authorities on main: `internal/edge/certsync.go` (issuer gate, publishing |
| +cache, mirror), `internal/edge/wildcard.go` (DNS-01 wildcards), |
| +`internal/edge/certwarm.go` (HTTP-01 warm), `internal/edge/certsweep.go`, |
| +`internal/domains/claims.go` and `claimcache.go`, AGENTS.md ("Stopping |
| +rules", "The census"). |
| + |
| +You are an independent reviewer. Read the diff, then the code it reaches, |
| +and check every claim in the comments against that code. |
| + |
| +## The problem (amadan discussion #1293) |
| + |
| +A production switch on 2026-11-19 moved a custom hostname's DNS to a |
| +multi-edge CARLOS deployment. The home box (not the issuer) had no |
| +certificate, refused every handshake with "acme: not available here" |
| +for ~4 minutes, and was rolled back. Root cause: an attached alias that |
| +does not point at the deployment yet is never published to |
| +control/edges/, so the issuer never orders it until the home box's DNS |
| +sweep stamps it "pointing" (5-7 min), and HTTP-01 could not succeed |
| +before the switch anyway. |
| + |
| +## The change |
| + |
| +`internal/edge/precert.go`: with `CARLOS_DNS01_ZONES` set, the issuer |
| +(only) lists the claims (domains/) through a ClaimCache every minute, |
| +and for each proven, served claim whose host is in a listed zone, not |
| +covered by a usable wildcard, and without a current published cert, |
| +orders a certificate over DNS-01 through the existing DNS provider seam |
| +and stores it under the host's autocert cache name through the |
| +publishing cache (local disk, then control/certs/<host>). Renews ahead |
| +of autocert's window. Caps: 5 orders/pass, 20/hour; backoff 1h per name, |
| +12h on no-zone. A current local cert missing from the bucket is |
| +republished instead of reordered. `wildcard.go`: the order is factored |
| +into `dns01Order` + free `solveDNS01`, shared with wildcards; the account |
| +key load-or-mint is serialized. `edge.go` wires it after the cert warm. |
| +`hostenv` allows the variable. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Scope is operator-listed zones only (not "any zone the provider |
| + holds"), and the feature is off when the variable is unset. |
| +- Only the issuer orders; non-issuers serve via the existing mirror. |
| +- No console or CLI change in this branch. |
| + |
| +## What to check |
| + |
| +1. Correctness of serving: will a non-issuer edge (and the issuer |
| + itself, whose autocert HostPolicy refuses a name that is not yet a |
| + deployment host) actually serve the pre-issued cert for SNI = host, |
| + before and after the name points? Trace wrapGetCertificate, the |
| + mirror snapshot, syncLocal, autocert's cache format and key name. |
| +2. Interaction with the existing machinery once the name points: |
| + certwarm (could it order HTTP-01 anyway, or duplicate), autocert |
| + renewal timers, certmirror backfill/ownsCertName, certsweep, the |
| + home box's cert_expires_at stamp. Any path that deletes, overwrites |
| + with something worse, or fights the pre-issued entry? |
| +3. The refactor in wildcard.go: behaviour-preserving for wildcards |
| + (identifiers, CSR, challenge FQDN incl. delegation, log text, |
| + errNoZone wrapping, account key semantics)? |
| +4. Trust boundary: can a tenant, member or app cause the issuer to |
| + order (or publish a TXT in the operator's zone for) a name the |
| + operator did not intend? Consider pending claims, claims written via |
| + the fleet store door, IDN/uppercase/trailing-dot hosts, a claim for |
| + the zone apex, hosts that are a suffix-trick of a zone, regional and |
| + instance catch-all claims. Route 53 IAM is scoped to |
| + `_acme-challenge.*` TXT records (infra/modules/region-host/main.tf). |
| +5. Rate limits and cost: the per-pass/hourly caps, backoff, the claims |
| + listing cadence (issuer only), the publish repair path. Can anything |
| + loop orders against Let's Encrypt or write the bucket every pass? |
| +6. Concurrency: shared account key with the wildcard manager, the |
| + mutex, the preIssuer's maps, the held-gate context. |
| +7. Tests: does `TestPreIssueE2E` prove what it claims (the fake CA's |
| + new dns-01 mode really checks the TXT value)? Missing cases? |
| +8. Census: `make census-card` lists unit `internal/edge/edge.go` |
| + `RunWithActivatorReady` (body) and re-pinned envelopes |
| + `internal/edge`, `internal/host`, `internal/hostenv`. The card is |
| + `docs/superpowers/notes/census-proposal-precert-dns01-1293.md`. Give a |
| + verdict for the unit and each envelope per AGENTS.md "Getting a |
| + change approved" step 4: 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, or weakens a |
| + check root relies on. Note carlos-edge runs as user carlos, not root. |
| + |
| +## Round 2 |
| + |
| +Earlier rounds: R1 by Astra (`CODEX-FINDINGS-R1.md`, NOT READY: two P1s, |
| +one P2; census items all APPROVE). The fixes: |
| + |
| +- R1 P1-1 (claims are not authorization): refused up front. A second |
| + required setting, `CARLOS_DNS01_ACCOUNTS` (account sqids), names whose |
| + claims may use the zones; claims of any other account never qualify, |
| + and with no account named the feature stays off. |
| +- R1 P1-2 (same challenge name): `solveDNS01` takes a per-FQDN lock |
| + (`lockChallenge`, process-wide, context-aware) from publication through |
| + validation and cleanup, shared by the wildcard manager and the |
| + pre-issuer. `TestSameChallengeNameOrdersDoNotCollide` uses a |
| + replace-semantics provider and fails without the lock (checked). |
| +- R1 P2 (starvation): a pass offers the least recently tried names first |
| + (`tried`); `TestPreIssueFailuresDoNotStarveOthers`. |
| + |
| +First give one line per R1 P1 and P2: resolved, partly, or not. Carry |
| +every unresolved or partly resolved finding forward at its current |
| +severity, then add only new findings. The census card was re-proposed |
| +for the new tip (unit claim updated); re-check the unit and the |
| +`internal/edge`, `internal/host`, `internal/hostenv` envelopes. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. |
| + Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for |
| + another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not |
| +raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the problem, the evidence |
| +(file:line, verified), the failure scenario, a concrete fix and the |
| +invariant or trust boundary it breaks (its fault family). Then the |
| +census verdicts (unit + three envelopes, each APPROVE or REJECT with the |
| +lines read). End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another |
| + round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of |
| +your own. Do not run the full test suites (targeted `go test -run` on |
| +internal/edge is fine; leave GOCACHE unset). |
diff --git a/internal/edge/certsync_e2e_test.go b/internal/edge/certsync_e2e_test.go| index 3dedbe096..a0aa92fb5 100644 |
| --- a/internal/edge/certsync_e2e_test.go |
| +++ b/internal/edge/certsync_e2e_test.go |
| @@ -110,6 +110,12 @@ type fakeACME struct { |
| // handlers run on the server's goroutines and, for deactivatePendingAuthz, |
| // can outlive the test. |
| faults []string |
| + // dns01TXT, when set, switches the CA to offering ONLY a dns-01 |
| + // challenge (precert_test.go): validation reads the TXT records at |
| + // _acme-challenge.<identifier, "*." stripped> through it and wants the |
| + // RFC 8555 §8.4 digest of the key authorization among them. Set before |
| + // the first order; read without the lock. |
| + dns01TXT func(name string) []string |
| } |
| type fakeACMEOrder struct { |
| @@ -776,12 +782,16 @@ func (ca *fakeACME) serveAuthorization(w http.ResponseWriter, r *http.Request) { |
| http.Error(w, "no such authz", http.StatusNotFound) |
| return |
| } |
| + chalType := "http-01" |
| + if ca.dns01TXT != nil { |
| + chalType = "dns-01" |
| + } |
| ca.mu.Lock() |
| body := map[string]any{ |
| "identifier": map[string]string{"type": "dns", "value": o.domain}, |
| "status": o.authz, |
| "challenges": []map[string]string{{ |
| - "type": "http-01", |
| + "type": chalType, |
| "url": ca.url("/chal/" + id), |
| "token": o.token, |
| "status": o.authz, |
| @@ -806,6 +816,11 @@ func (ca *fakeACME) serveChallengeAccept(w http.ResponseWriter, r *http.Request) |
| base, thumb, domain, token := ca.validateVia, ca.thumb, o.domain, o.token |
| ca.mu.Unlock() |
| + if ca.dns01TXT != nil { |
| + ca.validateDNS01(w, id, o, domain, token, thumb) |
| + return |
| + } |
| + |
| url := base + acmeChallengePrefix + token |
| got, ferr := ca.fetchChallenge(url, domain) |
| want := token + "." + thumb |
diff --git a/internal/edge/edge.go b/internal/edge/edge.go| index 4f8ecad05..52501ce1c 100644 |
| --- a/internal/edge/edge.go |
| +++ b/internal/edge/edge.go |
| @@ -5150,6 +5150,13 @@ func RunWithActivatorReady(args []string, act Activator, cache *Cache, ready fun |
| warm := e.newIssuerWarm(appsDomain, parents, perHostCert, warmResolver, edgeIPs, store) |
| go warm.run() |
| log.Printf("edge: cert warm on (%s pass) — custom domains are ordered and renewed proactively, not on first handshake", warmInterval) |
| + // Certificates before DNS moves (precert.go, #1293): attached names |
| + // in the operator's CARLOS_DNS01_ZONES are issued over DNS-01 from |
| + // the claim, before they point here. nil = not configured. |
| + if p := e.newPreIssuerFromEnv(certCache, mirror, wm); p != nil { |
| + go p.run() |
| + log.Printf("edge: certificates before DNS moves on for %v (DNS-01, %s pass, issuer only)", p.zones, preIssueInterval) |
| + } |
| } |
| tlsCfg.GetCertificate = getCert |
| if mirror != nil { |
diff --git a/internal/edge/precert.go b/internal/edge/precert.go| new file mode 100644 |
| index 000000000..9198c71de |
| --- /dev/null |
| +++ b/internal/edge/precert.go |
| @@ -0,0 +1,464 @@ |
| +package edge |
| + |
| +// Pre-issued certificates (#1293): a certificate for an attached hostname |
| +// BEFORE its DNS moves to the deployment, for hostnames in zones the |
| +// operator names and the deployment's own DNS provider writes. |
| +// |
| +// Why the ordinary path cannot do it. A custom domain's certificate is |
| +// ordered over HTTP-01 by the deployment's issuer, and only once the home |
| +// box's DNS check has stamped the name "pointing" and published it in its |
| +// edges file (certwarm.go's set, edgesfile.go's withholding). A name that |
| +// does not point at us yet is not published at all, so the issuer has never |
| +// heard of it; and HTTP-01 could not succeed before the switch anyway, |
| +// because the CA would ask the old servers. So the switch itself opens a gap: |
| +// the next DNS check (five to seven minutes), then the order. On 2026-11-19 a |
| +// production switch spent four minutes of it failing every handshake on the |
| +// home box ("acme: not available here") and was rolled back. |
| +// |
| +// DNS-01 does not care where the name points. When the deployment's DNS |
| +// provider can write the hostname's zone, the issuer can prove control and |
| +// hold a certificate before a single record moves. That is all this file |
| +// adds: |
| +// |
| +// - The source is the CLAIMS (domains/<host>.json, the deployment-wide |
| +// record every attach writes), not the edges files: a claim exists from |
| +// the moment of the attach, whatever DNS says. Read through a ClaimCache, |
| +// so the steady state is one listing per pass and a body read only for a |
| +// claim that changed. Pending (unproven, #215) claims and catch-all |
| +// claims are skipped. A claim with no Route is NOT skipped: a first |
| +// static route's attach stores exactly that shape (domainattach.go), |
| +// and inside the operator's accounts and zones a certificate ahead of |
| +// the route costs nothing (Astra R2). |
| +// - The scope is named by the operator twice over: CARLOS_DNS01_ZONES (the |
| +// zones) and CARLOS_DNS01_ACCOUNTS (the account sqids whose claims may |
| +// use them). Either unset, nothing here runs. Zones, rather than |
| +// "anything the provider happens to hold", because the provider's |
| +// account may hold zones members can attach names in. Accounts, because |
| +// a claim is not proof of control: with domain proof off (the console's |
| +// default) any member's attach is written proven, and before this file |
| +// that attach alone could never get a certificate for a name whose DNS |
| +// points elsewhere. Using the operator's DNS authority on a name is the |
| +// operator's decision, so it is refused up front for every account the |
| +// operator did not name (Astra R1, #1293). |
| +// - Only the issuer orders, under the same election as every other order |
| +// (certsync.go), and only it reads the claims: a non-issuer's pass ends |
| +// at the gate and costs nothing. |
| +// - The result is an ORDINARY per-host entry under the host's own cache |
| +// name, in autocert's format, written through the publishing cache. So |
| +// it lands in control/certs/<host>, every edge's mirror serves it, the |
| +// home box's DNS sweep stamps its expiry, the cert sweep ages it out like |
| +// any other, and once the name points autocert finds it in its cache and |
| +// orders nothing. Nothing downstream knows how it was issued. |
| +// - Renewal: the same pass renews the certificate over DNS-01 a week (or a |
| +// twelfth of its lifetime, if shorter) before autocert's own HTTP-01 |
| +// renewal would start, so autocert's timer finds a fresh cache and stands |
| +// aside. If DNS-01 renewal breaks, HTTP-01 is still there behind it. |
| +// - Bounds: preIssueOrdersPerPass orders per pass, preIssueOrdersPerHour |
| +// orders an hour across all names (the DNS-01 account is shared with the |
| +// wildcards, and the CA's rate limits are per account and per registered |
| +// domain), a one-hour backoff per name after a failure, twelve hours when |
| +// the provider does not hold the zone. |
| +// |
| +// A name covered by a wildcard this box can serve is left to the wildcard. |
| + |
| +import ( |
| + "context" |
| + "crypto/ecdsa" |
| + "crypto/tls" |
| + "crypto/x509" |
| + "errors" |
| + "fmt" |
| + "log" |
| + "os" |
| + "slices" |
| + "strings" |
| + "sync" |
| + "time" |
| + |
| + "golang.org/x/crypto/acme/autocert" |
| + |
| + "github.com/carlosframework/platform/internal/domains" |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +const ( |
| + // preIssueInterval is the pass cadence: the time from an attach to the |
| + // order, at worst. A pass on a quiet deployment is one bucket listing on |
| + // the issuer. |
| + preIssueInterval = time.Minute |
| + // preIssueOrdersPerPass bounds one pass's ACME work, so a newly listed |
| + // zone with many attached names drains over several passes rather than |
| + // in one burst. |
| + preIssueOrdersPerPass = 5 |
| + // preIssueOrdersPerHour bounds the orders this box places in any hour. |
| + preIssueOrdersPerHour = 20 |
| + // preIssueRetry is a name's backoff after a failed order: Let's Encrypt |
| + // allows five failed validations per account, hostname and hour. |
| + preIssueRetry = time.Hour |
| + // preIssueOrderTimeout budgets one order, the TXT wait included. |
| + preIssueOrderTimeout = 10 * time.Minute |
| +) |
| + |
| +// preIssueDue reports whether leaf should be replaced now: ahead of the |
| +// moment autocert's own renewal would start (min(lifetime/3, 30 days) before |
| +// expiry, renewal.go's next()), by a week or a twelfth of the lifetime, |
| +// whichever is less. Ahead, so that autocert's timer, once the name points, |
| +// finds a fresh certificate and orders nothing. |
| +func preIssueDue(leaf *x509.Certificate, now time.Time) bool { |
| + life := leaf.NotAfter.Sub(leaf.NotBefore) |
| + ahead := min(life/3, 30*24*time.Hour) + min(life/12, 7*24*time.Hour) |
| + return !now.Before(leaf.NotAfter.Add(-ahead)) |
| +} |
| + |
| +// parseDNS01Zones reads CARLOS_DNS01_ZONES: comma-separated zone names, |
| +// lowercased, trailing dot dropped, deduplicated. An entry that is not a |
| +// hostname is dropped with a log line. nil when nothing valid is listed, |
| +// which is "off". |
| +func parseDNS01Zones(raw string) []string { |
| + var out []string |
| + for _, z := range strings.Split(raw, ",") { |
| + z = strings.TrimSuffix(strings.ToLower(strings.TrimSpace(z)), ".") |
| + if z == "" { |
| + continue |
| + } |
| + if !provision.ValidHostShape(z) { |
| + log.Printf("edge: CARLOS_DNS01_ZONES entry %q is not a zone name, ignored", z) |
| + continue |
| + } |
| + if !slices.Contains(out, z) { |
| + out = append(out, z) |
| + } |
| + } |
| + return out |
| +} |
| + |
| +// parseDNS01Accounts reads CARLOS_DNS01_ACCOUNTS: comma-separated account |
| +// sqids, as claims record them. An entry that is not a sqid is dropped with a |
| +// log line. nil when none is valid, which is "off". |
| +func parseDNS01Accounts(raw string) []string { |
| + var out []string |
| + for _, a := range strings.Split(raw, ",") { |
| + a = strings.TrimSpace(a) |
| + if a == "" { |
| + continue |
| + } |
| + if !domains.ValidSqid(a) { |
| + log.Printf("edge: CARLOS_DNS01_ACCOUNTS entry %q is not an account sqid, ignored", a) |
| + continue |
| + } |
| + if !slices.Contains(out, a) { |
| + out = append(out, a) |
| + } |
| + } |
| + return out |
| +} |
| + |
| +// preIssuer is the pass. Every input is a field so the decisions are |
| +// testable without an ACME server; newPreIssuerFromEnv wires the real ones. |
| +type preIssuer struct { |
| + zones []string |
| + // accounts are the sqids whose claims qualify; nothing else does. |
| + accounts []string |
| + // cache is the PUBLISHING cache (certsync.go): its Get reads this box's |
| + // own disk, its Put writes the disk and then the bucket. |
| + cache autocert.Cache |
| + // store is the deployment bucket, for republishing a local certificate |
| + // whose bucket copy is missing. |
| + store release.Store |
| + issuer IssuerGate |
| + claims func(context.Context) ([]domains.Claim, error) |
| + // published reads the mirror's copy of control/certs/<name>. |
| + published func(name string) ([]byte, bool) |
| + // covered reports whether a wildcard this box can serve covers host. nil |
| + // = no wildcard manager. |
| + covered func(host string) bool |
| + // order runs one DNS-01 order for host (dns01OrderFunc in production). |
| + order func(ctx context.Context, host string) (*tls.Certificate, *ecdsa.PrivateKey, error) |
| + now func() time.Time |
| + |
| + mu sync.Mutex |
| + nextAttempt map[string]time.Time |
| + // tried is when each name's last order started. A pass offers the |
| + // least recently tried names first, so names that keep failing cannot |
| + // spend the hourly budget ahead of a name never tried. |
| + tried map[string]time.Time |
| + // ordered is when each order of the last hour started, oldest first. |
| + ordered []time.Time |
| + // putAt is when this box last wrote each name to the bucket, so a pass |
| + // that runs before the mirror has seen the write does not write it again. |
| + putAt map[string]time.Time |
| + lastClaimLog time.Time |
| +} |
| + |
| +func newPreIssuer(zones, accounts []string, cache autocert.Cache, store release.Store, issuer IssuerGate, |
| + claims func(context.Context) ([]domains.Claim, error), published func(string) ([]byte, bool), |
| + covered func(string) bool, order func(context.Context, string) (*tls.Certificate, *ecdsa.PrivateKey, error)) *preIssuer { |
| + return &preIssuer{ |
| + zones: zones, accounts: accounts, cache: cache, store: store, issuer: issuer, claims: claims, |
| + published: published, covered: covered, order: order, now: time.Now, |
| + nextAttempt: map[string]time.Time{}, tried: map[string]time.Time{}, putAt: map[string]time.Time{}, |
| + } |
| +} |
| + |
| +// dns01OrderFunc is the production order: a DNS-01 order for exactly host, |
| +// its challenge published directly at _acme-challenge.<host> in the |
| +// provider, under the deployment's DNS-01 account kept in cache. |
| +func dns01OrderFunc(cache autocert.Cache, directory string, dns dnsProvider) func(context.Context, string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| + return func(ctx context.Context, host string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| + return dns01Order(ctx, cache, directory, dns, host, "_acme-challenge."+host, "pre-issue "+host) |
| + } |
| +} |
| + |
| +// newPreIssuerFromEnv arms the pre-issuer, or returns nil: CARLOS_DNS01_ZONES |
| +// unset (silent, the default), or set with no account named in |
| +// CARLOS_DNS01_ACCOUNTS or no DNS provider to publish through (logged). Called only on a box with a deployment store, so the mirror and |
| +// the issuer gate exist. |
| +func (e *Edge) newPreIssuerFromEnv(cache autocert.Cache, mirror *certMirror, wm *wildcardManager) *preIssuer { |
| + zones := parseDNS01Zones(os.Getenv("CARLOS_DNS01_ZONES")) |
| + if len(zones) == 0 || e.staticStore == nil || mirror == nil { |
| + return nil |
| + } |
| + accounts := parseDNS01Accounts(os.Getenv("CARLOS_DNS01_ACCOUNTS")) |
| + if len(accounts) == 0 { |
| + log.Printf("edge: CARLOS_DNS01_ZONES is set but CARLOS_DNS01_ACCOUNTS names no account — certificates are not issued before DNS moves") |
| + return nil |
| + } |
| + dns, reason := dnsProviderFromEnv() |
| + if dns == nil { |
| + log.Printf("edge: CARLOS_DNS01_ZONES is set but there is no DNS provider (%s) — certificates are not issued before DNS moves", reason) |
| + return nil |
| + } |
| + store := e.staticStore |
| + cc := &domains.ClaimCache{} |
| + claims := func(ctx context.Context) ([]domains.Claim, error) { return cc.List(ctx, store) } |
| + var covered func(string) bool |
| + if wm != nil { |
| + covered = func(h string) bool { return wm.certFor(h) != nil } |
| + } |
| + directory := envOr("CARLOS_ACME_DIRECTORY", letsEncryptDirectory) |
| + return newPreIssuer(zones, accounts, cache, store, e.issuerGate, claims, mirror.Cert, covered, dns01OrderFunc(cache, directory, dns)) |
| +} |
| + |
| +func (p *preIssuer) run() { |
| + for { |
| + p.pass(context.Background()) |
| + time.Sleep(preIssueInterval) |
| + } |
| +} |
| + |
| +// inZone reports whether host is a listed zone or a name under one. |
| +func (p *preIssuer) inZone(host string) bool { |
| + for _, z := range p.zones { |
| + if host == z || strings.HasSuffix(host, "."+z) { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +// candidates is the sorted set of hostnames the pass looks after. |
| +func (p *preIssuer) candidates(claims []domains.Claim) []string { |
| + var out []string |
| + for _, c := range claims { |
| + host := strings.TrimSuffix(strings.ToLower(c.Host), ".") |
| + switch { |
| + case c.Pending, strings.HasPrefix(host, "*."): |
| + continue |
| + case !p.inZone(host), !slices.Contains(p.accounts, c.Account): |
| + continue |
| + case p.covered != nil && p.covered(host): |
| + continue |
| + } |
| + if !slices.Contains(out, host) { |
| + out = append(out, host) |
| + } |
| + } |
| + slices.Sort(out) |
| + return out |
| +} |
| + |
| +// current reports whether body is a certificate for host that is not yet due. |
| +func current(body []byte, host string, now time.Time) bool { |
| + cert, err := parseCertEntry(body) |
| + return err == nil && cert.Leaf.VerifyHostname(host) == nil && !preIssueDue(cert.Leaf, now) |
| +} |
| + |
| +// pass is one sweep: nothing unless this box is the issuer, then every |
| +// candidate without a current published certificate gets one, within the |
| +// bounds. |
| +func (p *preIssuer) pass(ctx context.Context) { |
| + held, ok := p.issuer() |
| + if !ok { |
| + return |
| + } |
| + cctx, cancel := context.WithTimeout(held, time.Minute) |
| + claims, err := p.claims(cctx) |
| + cancel() |
| + if err != nil { |
| + p.logClaimsFailure(err) |
| + return |
| + } |
| + hosts := p.candidates(claims) |
| + p.forget(hosts) |
| + p.mu.Lock() |
| + slices.SortStableFunc(hosts, func(a, b string) int { return p.tried[a].Compare(p.tried[b]) }) |
| + p.mu.Unlock() |
| + orders := 0 |
| + for _, host := range hosts { |
| + now := p.now() |
| + if body, ok := p.published(host); ok && current(body, host, now) { |
| + continue |
| + } |
| + if p.republish(ctx, host, now) { |
| + continue |
| + } |
| + if p.backingOff(host, now) { |
| + continue |
| + } |
| + if orders >= preIssueOrdersPerPass || !p.spend(now) { |
| + return |
| + } |
| + orders++ |
| + p.mu.Lock() |
| + p.tried[host] = now |
| + p.mu.Unlock() |
| + if err := p.issue(held, host); err != nil { |
| + retry := preIssueRetry |
| + if errors.Is(err, errNoZone) { |
| + retry = noZoneRetry |
| + } |
| + log.Printf("edge: pre-issue %s: %v — retrying in %s; HTTP-01 still covers it once it points here", host, err, retry) |
| + p.mu.Lock() |
| + p.nextAttempt[host] = now.Add(retry) |
| + p.mu.Unlock() |
| + continue |
| + } |
| + p.mu.Lock() |
| + delete(p.nextAttempt, host) |
| + p.mu.Unlock() |
| + } |
| +} |
| + |
| +// issue orders host's certificate and writes it through the publishing |
| +// cache: this box's disk, then control/certs/<host>. |
| +func (p *preIssuer) issue(held context.Context, host string) error { |
| + ctx, cancel := context.WithTimeout(held, preIssueOrderTimeout) |
| + defer cancel() |
| + cert, key, err := p.order(ctx, host) |
| + if err != nil { |
| + return err |
| + } |
| + // Never store what would not serve: the right name, the matching key. |
| + if cert.Leaf == nil || cert.Leaf.VerifyHostname(host) != nil { |
| + return fmt.Errorf("issued certificate does not cover %s", host) |
| + } |
| + if !key.PublicKey.Equal(cert.Leaf.PublicKey) { |
| + return fmt.Errorf("issued certificate's key does not match") |
| + } |
| + // autocert's own cache format for an ECDSA entry: the key block, then |
| + // the chain (encodeWildcardPEM writes exactly that). |
| + raw, err := encodeWildcardPEM(cert, key) |
| + if err != nil { |
| + return fmt.Errorf("encode: %v", err) |
| + } |
| + if err := p.cache.Put(ctx, host, raw); err != nil { |
| + return fmt.Errorf("persist: %v", err) |
| + } |
| + p.mu.Lock() |
| + p.putAt[host] = p.now() |
| + p.mu.Unlock() |
| + log.Printf("edge: pre-issue %s: certificate issued over DNS-01 (valid until %s) and published for every edge", host, cert.Leaf.NotAfter.Format(time.RFC3339)) |
| + return nil |
| +} |
| + |
| +// republish handles a name whose published copy is missing or due while this |
| +// box's own disk holds a current certificate: a bucket publish that failed |
| +// after an order succeeded (publishingCache logs and swallows those). It |
| +// writes the local copy to the bucket instead of ordering again, and reports |
| +// whether the local copy was current (in which case there is nothing to |
| +// order, whether or not the write landed). A name this box wrote within the |
| +// mirror's reach of now is left alone: the mirror has not caught up yet. |
| +func (p *preIssuer) republish(ctx context.Context, host string, now time.Time) bool { |
| + gctx, cancel := context.WithTimeout(ctx, 30*time.Second) |
| + defer cancel() |
| + body, err := p.cache.Get(gctx, host) |
| + if err != nil || !current(body, host, now) { |
| + return false |
| + } |
| + p.mu.Lock() |
| + at, recent := p.putAt[host] |
| + p.mu.Unlock() |
| + if recent && now.Sub(at) < 5*time.Minute { |
| + return true |
| + } |
| + if err := putCert(gctx, p.store, host, body); err != nil { |
| + log.Printf("edge: pre-issue %s: republishing this box's certificate failed: %v — retrying next pass", host, err) |
| + return true |
| + } |
| + p.mu.Lock() |
| + p.putAt[host] = now |
| + p.mu.Unlock() |
| + log.Printf("edge: pre-issue %s: republished this box's current certificate to %s", host, certPrefix) |
| + return true |
| +} |
| + |
| +func (p *preIssuer) backingOff(host string, now time.Time) bool { |
| + p.mu.Lock() |
| + defer p.mu.Unlock() |
| + next, ok := p.nextAttempt[host] |
| + return ok && now.Before(next) |
| +} |
| + |
| +// spend takes one order from the hourly budget, or reports that it is spent. |
| +func (p *preIssuer) spend(now time.Time) bool { |
| + p.mu.Lock() |
| + defer p.mu.Unlock() |
| + cut := 0 |
| + for cut < len(p.ordered) && now.Sub(p.ordered[cut]) >= time.Hour { |
| + cut++ |
| + } |
| + p.ordered = p.ordered[cut:] |
| + if len(p.ordered) >= preIssueOrdersPerHour { |
| + return false |
| + } |
| + p.ordered = append(p.ordered, now) |
| + return true |
| +} |
| + |
| +// forget drops bookkeeping for names that are no longer candidates, so the |
| +// maps track the claim set rather than every name ever attached. |
| +func (p *preIssuer) forget(hosts []string) { |
| + p.mu.Lock() |
| + defer p.mu.Unlock() |
| + for h := range p.nextAttempt { |
| + if !slices.Contains(hosts, h) { |
| + delete(p.nextAttempt, h) |
| + } |
| + } |
| + for h := range p.putAt { |
| + if !slices.Contains(hosts, h) { |
| + delete(p.putAt, h) |
| + } |
| + } |
| + for h := range p.tried { |
| + if !slices.Contains(hosts, h) { |
| + delete(p.tried, h) |
| + } |
| + } |
| +} |
| + |
| +// logClaimsFailure says a failed claims read at most hourly: it repeats every |
| +// minute for as long as the bucket is unreachable. |
| +func (p *preIssuer) logClaimsFailure(err error) { |
| + now := p.now() |
| + p.mu.Lock() |
| + quiet := now.Sub(p.lastClaimLog) < time.Hour |
| + if !quiet { |
| + p.lastClaimLog = now |
| + } |
| + p.mu.Unlock() |
| + if !quiet { |
| + log.Printf("edge: pre-issue: reading the domain claims failed: %v — no certificates are issued before DNS moves until it reads again", err) |
| + } |
| +} |
diff --git a/internal/edge/precert_test.go b/internal/edge/precert_test.go| new file mode 100644 |
| index 000000000..3f888451f |
| --- /dev/null |
| +++ b/internal/edge/precert_test.go |
| @@ -0,0 +1,608 @@ |
| +package edge |
| + |
| +import ( |
| + "context" |
| + "crypto/ecdsa" |
| + "crypto/sha256" |
| + "crypto/tls" |
| + "encoding/base64" |
| + "errors" |
| + "fmt" |
| + "net/http" |
| + "slices" |
| + "strings" |
| + "sync" |
| + "testing" |
| + "time" |
| + |
| + "golang.org/x/crypto/acme/autocert" |
| + |
| + "github.com/carlosframework/platform/internal/domains" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// ---- the fake CA's dns-01 mode ----------------------------------------------- |
| + |
| +// validateDNS01 is the fake CA's dns-01 check (fakeACME.dns01TXT): the TXT |
| +// at _acme-challenge.<identifier> must carry base64url(sha256(keyAuth)), the |
| +// key authorization being token + "." + the ordering account's thumbprint. |
| +// Like the http-01 check it is a proof, not a narration: the value can only |
| +// be right if the account that ordered published it where the CA looks. |
| +func (ca *fakeACME) validateDNS01(w http.ResponseWriter, id string, o *fakeACMEOrder, domain, token, thumb string) { |
| + sum := sha256.Sum256([]byte(token + "." + thumb)) |
| + want := base64.RawURLEncoding.EncodeToString(sum[:]) |
| + name := "_acme-challenge." + strings.TrimPrefix(domain, "*.") |
| + valid := slices.Contains(ca.dns01TXT(name), want) |
| + |
| + ca.mu.Lock() |
| + ca.validations = append(ca.validations, fakeACMEValidation{url: "dns:" + name, host: domain, token: token, ok: valid}) |
| + if valid { |
| + o.authz, o.status = "valid", "ready" |
| + } else { |
| + o.authz, o.status = "invalid", "invalid" |
| + ca.faults = append(ca.faults, fmt.Sprintf("dns-01 for %s: no TXT %q at %s", domain, want, name)) |
| + } |
| + ca.mu.Unlock() |
| + |
| + writeJSON(w, http.StatusOK, map[string]string{ |
| + "type": "dns-01", "url": ca.url("/chal/" + id), "token": token, "status": "valid", |
| + }) |
| +} |
| + |
| +// liveDNS is a DNS provider whose records the fake CA can read: present adds |
| +// a TXT, cleanup removes it, and checkZone answers from a fixed zone list. |
| +type liveDNS struct { |
| + mu sync.Mutex |
| + zones []string |
| + txt map[string][]string |
| + presented []string // fqdn, in order |
| + cleaned []string // fqdn, in order |
| +} |
| + |
| +func newLiveDNS(zones ...string) *liveDNS { |
| + return &liveDNS{zones: zones, txt: map[string][]string{}} |
| +} |
| + |
| +func (d *liveDNS) holds(fqdn string) bool { |
| + for _, z := range d.zones { |
| + if fqdn == z || strings.HasSuffix(fqdn, "."+z) { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +func (d *liveDNS) checkZone(_ context.Context, fqdn string) error { |
| + if !d.holds(fqdn) { |
| + return errNoZone |
| + } |
| + return nil |
| +} |
| + |
| +func (d *liveDNS) present(_ context.Context, fqdn, value string) (func(context.Context) error, error) { |
| + if !d.holds(fqdn) { |
| + return nil, errNoZone |
| + } |
| + d.mu.Lock() |
| + d.txt[fqdn] = append(d.txt[fqdn], value) |
| + d.presented = append(d.presented, fqdn) |
| + d.mu.Unlock() |
| + return func(context.Context) error { |
| + d.mu.Lock() |
| + defer d.mu.Unlock() |
| + d.txt[fqdn] = slices.DeleteFunc(d.txt[fqdn], func(v string) bool { return v == value }) |
| + d.cleaned = append(d.cleaned, fqdn) |
| + return nil |
| + }, nil |
| +} |
| + |
| +func (d *liveDNS) lookup(name string) []string { |
| + d.mu.Lock() |
| + defer d.mu.Unlock() |
| + return append([]string(nil), d.txt[name]...) |
| +} |
| + |
| +// noTXTWait skips the real-resolver wait for a test's duration: the records |
| +// live in liveDNS, which no resolver can see. |
| +func noTXTWait(t *testing.T) { |
| + t.Helper() |
| + prev := dns01TXTWait |
| + dns01TXTWait = func(context.Context, string, string, time.Duration) {} |
| + t.Cleanup(func() { dns01TXTWait = prev }) |
| +} |
| + |
| +// ---- fixtures ------------------------------------------------------------------ |
| + |
| +// proven is a served, proven claim: what an attach writes once the hostname |
| +// is verified. |
| +func proven(host string) domains.Claim { |
| + return domains.Claim{Schema: 1, Host: host, Account: "acct", App: "shop", Route: "shop.acct.apps.example.net"} |
| +} |
| + |
| +func staticClaims(cs ...domains.Claim) func(context.Context) ([]domains.Claim, error) { |
| + return func(context.Context) ([]domains.Claim, error) { return cs, nil } |
| +} |
| + |
| +// fakeOrder is an order seam that mints a self-signed leaf for the host (a |
| +// real CA round trip is TestPreIssueE2E's job) and counts what it was asked. |
| +type fakeOrder struct { |
| + mu sync.Mutex |
| + asked []string |
| + fail error |
| + life time.Duration |
| +} |
| + |
| +func (f *fakeOrder) order(t *testing.T) func(context.Context, string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| + return func(_ context.Context, host string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| + f.mu.Lock() |
| + f.asked = append(f.asked, host) |
| + fail, life := f.fail, f.life |
| + f.mu.Unlock() |
| + if fail != nil { |
| + return nil, nil, fail |
| + } |
| + if life == 0 { |
| + life = 90 * 24 * time.Hour |
| + } |
| + cert, key := selfSignedLeaf(t, host, time.Now().Add(life)) |
| + return cert, key, nil |
| + } |
| +} |
| + |
| +func (f *fakeOrder) count() int { |
| + f.mu.Lock() |
| + defer f.mu.Unlock() |
| + return len(f.asked) |
| +} |
| + |
| +// testPreIssuer is a pre-issuer over a DirStore bucket and a publishing cache |
| +// on a held gate, with the claims and order seams given. |
| +func testPreIssuer(t *testing.T, zones []string, claims func(context.Context) ([]domains.Claim, error), order func(context.Context, string) (*tls.Certificate, *ecdsa.PrivateKey, error)) (*preIssuer, release.Store, autocert.Cache) { |
| + t.Helper() |
| + store := release.NewDirStore(t.TempDir()) |
| + local := autocert.DirCache(t.TempDir()) |
| + held := func() (context.Context, bool) { return context.Background(), true } |
| + cache := &publishingCache{inner: local, s: store, issuer: held} |
| + published := func(name string) ([]byte, bool) { |
| + b, err := certStoreGet(t, store, certKey(name)) |
| + return b, err == nil |
| + } |
| + p := newPreIssuer(zones, []string{"acct"}, cache, store, held, claims, published, nil, order) |
| + return p, store, local |
| +} |
| + |
| +// ---- the end-to-end proof: certificate before DNS ------------------------------ |
| + |
| +// TestPreIssueE2E is #1293's scenario. A hostname is attached under a zone |
| +// the deployment's DNS provider writes, and nothing points at the deployment |
| +// yet. The issuer orders over dns-01 through a real ACME exchange (the fake |
| +// CA checks the TXT value against the ordering account), the certificate |
| +// lands in control/certs/<host>, and ANOTHER edge, one that is not the |
| +// issuer, serves it for the hostname straight from its mirror. That last |
| +// step is the one that failed on 11-19. |
| +func TestPreIssueE2E(t *testing.T) { |
| + e2eQuietLogs(t) |
| + noTXTWait(t) |
| + const host = "billing.example.com" |
| + dns := newLiveDNS("example.com") |
| + ca := newFakeACME(t) |
| + ca.dns01TXT = dns.lookup |
| + |
| + p, store, _ := testPreIssuer(t, []string{"example.com"}, staticClaims(proven(host)), nil) |
| + p.order = dns01OrderFunc(p.cache, ca.directoryURL(), dns) |
| + |
| + p.pass(context.Background()) |
| + ca.checkFaults(t) |
| + |
| + if _, orders := ca.counts(); orders != 1 { |
| + t.Fatalf("CA saw %d orders, want 1", orders) |
| + } |
| + if got := dns.presented; !slices.Equal(got, []string{"_acme-challenge." + host}) { |
| + t.Fatalf("challenge published at %v, want only _acme-challenge.%s", got, host) |
| + } |
| + if got := dns.cleaned; !slices.Equal(got, []string{"_acme-challenge." + host}) { |
| + t.Fatalf("challenge cleanup %v: the TXT must not outlive the order", got) |
| + } |
| + body, err := certStoreGet(t, store, certKey(host)) |
| + if err != nil { |
| + t.Fatalf("control/certs/%s: %v — the certificate must be published for every edge", host, err) |
| + } |
| + cert, err := parseCertEntry(body) |
| + if err != nil || cert.Leaf.VerifyHostname(host) != nil { |
| + t.Fatalf("published entry does not cover %s: %v", host, err) |
| + } |
| + if cert.Leaf.Issuer.CommonName != ca.root.Subject.CommonName { |
| + t.Fatalf("published leaf issued by %q, want the CA's", cert.Leaf.Issuer.CommonName) |
| + } |
| + |
| + // The home box: a gated mirror on another disk, whose autocert refuses |
| + // exactly as IE's did on 11-19. |
| + home := newCertMirror(store, autocert.DirCache(t.TempDir())) |
| + if err := home.Refresh(context.Background()); err != nil { |
| + t.Fatal(err) |
| + } |
| + refuse := func(*tls.ClientHelloInfo) (*tls.Certificate, error) { return nil, errNotIssuer } |
| + got, err := home.wrapGetCertificate(refuse)(&tls.ClientHelloInfo{ServerName: host}) |
| + if err != nil || got == nil || got.Leaf.VerifyHostname(host) != nil { |
| + t.Fatalf("home box handshake for %s: cert %v, err %v — want the pre-issued certificate", host, got != nil, err) |
| + } |
| + |
| + // A second pass finds the published certificate current and orders |
| + // nothing. |
| + p.pass(context.Background()) |
| + if _, orders := ca.counts(); orders != 1 { |
| + t.Fatalf("second pass ordered again: CA saw %d orders", orders) |
| + } |
| +} |
| + |
| +// The wildcard manager's orders run through the same dns01Order after the |
| +// refactor; this pins that a *.<parent> order still completes and covers. |
| +func TestWildcardObtainOverDNS01(t *testing.T) { |
| + e2eQuietLogs(t) |
| + noTXTWait(t) |
| + dns := newLiveDNS("example.com") |
| + ca := newFakeACME(t) |
| + ca.dns01TXT = dns.lookup |
| + w := newWildcardManager([]string{"go.example.com"}, "", func() []string { return nil }, nil, "", autocert.DirCache(t.TempDir()), dns) |
| + w.directory = ca.directoryURL() |
| + w.refresh() |
| + if err := w.obtain(context.Background(), "go.example.com"); err != nil { |
| + t.Fatal(err) |
| + } |
| + ca.checkFaults(t) |
| + if c := w.certFor("x.go.example.com"); c == nil { |
| + t.Fatal("wildcard not serving after obtain") |
| + } |
| + if got := dns.presented; !slices.Equal(got, []string{"_acme-challenge.go.example.com"}) { |
| + t.Fatalf("challenge published at %v", got) |
| + } |
| +} |
| + |
| +// ---- which names -------------------------------------------------------------- |
| + |
| +func TestPreIssueCandidates(t *testing.T) { |
| + pending := proven("pending.example.com") |
| + pending.Pending, pending.PendingUntil = true, time.Now().Add(time.Hour).UTC().Format(time.RFC3339) |
| + // A first static route's claim has no Route (domainattach.go): kept. |
| + firstRoute := proven("firstroute.example.com") |
| + firstRoute.Route = "" |
| + regional := proven("regional.example.com") |
| + regional.Route = "" |
| + regional.Schema = 2 |
| + regional.Placements = []domains.Placement{{Region: "ie", Host: "shop-ie.acct.apps.example.net"}} |
| + catchall := proven("*.example.com") |
| + stranger := proven("stranger.example.com") |
| + stranger.Account = "other" |
| + |
| + claims := []domains.Claim{ |
| + proven("Billing.Example.com"), // case folds |
| + proven("billing.example.com"), // and dedupes |
| + proven("example.com"), // the zone apex is inside the zone |
| + proven("deep.a.b.example.com"), |
| + proven("badexample.com"), // a suffix, not a subdomain |
| + proven("shop.other.test"), |
| + proven("x.covered.example.com"), |
| + pending, |
| + firstRoute, |
| + regional, |
| + catchall, |
| + stranger, // an account the operator did not name |
| + } |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, nil, nil) |
| + p.covered = func(h string) bool { return strings.HasSuffix(h, ".covered.example.com") } |
| + got := p.candidates(claims) |
| + want := []string{"billing.example.com", "deep.a.b.example.com", "example.com", "firstroute.example.com", "regional.example.com"} |
| + if !slices.Equal(got, want) { |
| + t.Fatalf("candidates = %v, want %v", got, want) |
| + } |
| +} |
| + |
| +func TestDNS01AccountsFromEnv(t *testing.T) { |
| + got := parseDNS01Accounts(" abc ,,not a sqid,abc,xyz") |
| + if want := []string{"abc", "xyz"}; !slices.Equal(got, want) { |
| + t.Fatalf("parseDNS01Accounts = %v, want %v", got, want) |
| + } |
| + if parseDNS01Accounts("") != nil { |
| + t.Fatal("unset must be nil: the feature is off") |
| + } |
| +} |
| + |
| +func TestDNS01ZonesFromEnv(t *testing.T) { |
| + got := parseDNS01Zones(" Example.com. ,,ti.example ,not a zone, example.com,*.wild.test") |
| + want := []string{"example.com", "ti.example"} |
| + if !slices.Equal(got, want) { |
| + t.Fatalf("parseDNS01Zones = %v, want %v", got, want) |
| + } |
| + if parseDNS01Zones("") != nil { |
| + t.Fatal("unset must be nil: the feature is off") |
| + } |
| +} |
| + |
| +// ---- when to order -------------------------------------------------------------- |
| + |
| +func TestPreIssueDue(t *testing.T) { |
| + now := time.Now() |
| + leaf := func(life, left time.Duration) *tls.Certificate { |
| + c, _ := selfSignedLeaf(t, "h.example.com", now.Add(left)) |
| + c.Leaf.NotBefore = now.Add(left - life) |
| + return c |
| + } |
| + day := 24 * time.Hour |
| + // 90-day: autocert renews at 30 days left; we go a week before that. |
| + if preIssueDue(leaf(90*day, 38*day).Leaf, now) { |
| + t.Fatal("90-day cert, 38 days left: not due yet") |
| + } |
| + if !preIssueDue(leaf(90*day, 36*day).Leaf, now) { |
| + t.Fatal("90-day cert, 36 days left: due (ahead of autocert's 30)") |
| + } |
| + // 45-day: autocert's threshold is lifetime/3 = 15 days; ours stays ahead. |
| + if preIssueDue(leaf(45*day, 20*day).Leaf, now) { |
| + t.Fatal("45-day cert, 20 days left: not due yet") |
| + } |
| + if !preIssueDue(leaf(45*day, 17*day).Leaf, now) { |
| + t.Fatal("45-day cert, 17 days left: due") |
| + } |
| +} |
| + |
| +func TestPreIssueOrdersOnlyWhatLacksACurrentCert(t *testing.T) { |
| + e2eQuietLogs(t) |
| + fo := &fakeOrder{} |
| + p, store, _ := testPreIssuer(t, []string{"example.com"}, |
| + staticClaims(proven("fresh.example.com"), proven("stale.example.com"), proven("none.example.com")), fo.order(t)) |
| + ctx := context.Background() |
| + day := 24 * time.Hour |
| + now := time.Now() |
| + for name, raw := range map[string][]byte{ |
| + // 90-day certificates: 80 days left, and 10 left (inside the window). |
| + "fresh.example.com": e2eDatedCertPEM(t, "fresh.example.com", now.Add(-10*day), now.Add(80*day)), |
| + "stale.example.com": e2eDatedCertPEM(t, "stale.example.com", now.Add(-80*day), now.Add(10*day)), |
| + } { |
| + if err := putCert(ctx, store, name, raw); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + p.pass(ctx) |
| + got := append([]string(nil), fo.asked...) |
| + slices.Sort(got) |
| + if want := []string{"none.example.com", "stale.example.com"}; !slices.Equal(got, want) { |
| + t.Fatalf("ordered %v, want %v", got, want) |
| + } |
| + for _, h := range got { |
| + body, err := certStoreGet(t, store, certKey(h)) |
| + if err != nil { |
| + t.Fatalf("%s not published: %v", h, err) |
| + } |
| + if c, err := parseCertEntry(body); err != nil || preIssueDue(c.Leaf, time.Now()) { |
| + t.Fatalf("%s: published entry not current (%v)", h, err) |
| + } |
| + } |
| +} |
| + |
| +// ---- who orders --------------------------------------------------------------- |
| + |
| +// A box that is not the issuer reads no claims and orders nothing: the claim |
| +// listing is the issuer's cost alone. |
| +func TestPreIssueNonIssuerDoesNothing(t *testing.T) { |
| + fo := &fakeOrder{} |
| + read := 0 |
| + claims := func(context.Context) ([]domains.Claim, error) { |
| + read++ |
| + return []domains.Claim{proven("billing.example.com")}, nil |
| + } |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, claims, fo.order(t)) |
| + p.issuer = func() (context.Context, bool) { return nil, false } |
| + p.pass(context.Background()) |
| + if read != 0 || fo.count() != 0 { |
| + t.Fatalf("non-issuer read claims %d times and ordered %d", read, fo.count()) |
| + } |
| +} |
| + |
| +// ---- failure and bounds --------------------------------------------------------- |
| + |
| +func TestPreIssueBackoff(t *testing.T) { |
| + e2eQuietLogs(t) |
| + fo := &fakeOrder{fail: errors.New("CA said no")} |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, staticClaims(proven("a.example.com")), fo.order(t)) |
| + now := time.Now() |
| + p.now = func() time.Time { return now } |
| + ctx := context.Background() |
| + p.pass(ctx) |
| + p.pass(ctx) |
| + if fo.count() != 1 { |
| + t.Fatalf("failed name retried inside its backoff: %d orders", fo.count()) |
| + } |
| + now = now.Add(preIssueRetry + time.Second) |
| + p.pass(ctx) |
| + if fo.count() != 2 { |
| + t.Fatalf("failed name not retried after the backoff: %d orders", fo.count()) |
| + } |
| + |
| + // A zone the provider does not hold waits the long retry. |
| + fo.mu.Lock() |
| + fo.fail = fmt.Errorf("cannot publish the DNS-01 challenge: %w", errNoZone) |
| + fo.mu.Unlock() |
| + now = now.Add(preIssueRetry + time.Second) |
| + p.pass(ctx) |
| + now = now.Add(preIssueRetry + time.Second) |
| + p.pass(ctx) |
| + if fo.count() != 3 { |
| + t.Fatalf("no-zone name retried after an hour: %d orders", fo.count()) |
| + } |
| + now = now.Add(noZoneRetry) |
| + p.pass(ctx) |
| + if fo.count() != 4 { |
| + t.Fatalf("no-zone name never retried: %d orders", fo.count()) |
| + } |
| +} |
| + |
| +func TestPreIssueCaps(t *testing.T) { |
| + e2eQuietLogs(t) |
| + fo := &fakeOrder{} |
| + var cs []domains.Claim |
| + for i := range 3 * preIssueOrdersPerHour { |
| + cs = append(cs, proven(fmt.Sprintf("h%02d.example.com", i))) |
| + } |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, staticClaims(cs...), fo.order(t)) |
| + now := time.Now() |
| + p.now = func() time.Time { return now } |
| + ctx := context.Background() |
| + p.pass(ctx) |
| + if fo.count() != preIssueOrdersPerPass { |
| + t.Fatalf("one pass placed %d orders, want the per-pass cap %d", fo.count(), preIssueOrdersPerPass) |
| + } |
| + for range 2 * preIssueOrdersPerHour { |
| + now = now.Add(preIssueInterval) |
| + p.pass(ctx) |
| + } |
| + if fo.count() > preIssueOrdersPerHour+preIssueOrdersPerPass { |
| + t.Fatalf("%d orders inside about an hour, want at most the hourly cap %d", fo.count(), preIssueOrdersPerHour) |
| + } |
| + now = now.Add(2 * time.Hour) |
| + before := fo.count() |
| + p.pass(ctx) |
| + if fo.count() == before { |
| + t.Fatal("hourly cap never released") |
| + } |
| +} |
| + |
| +// A certificate this box holds locally but the bucket lacks (a publish that |
| +// failed) is republished, not ordered again. |
| +func TestPreIssueRepublishesALocalCert(t *testing.T) { |
| + e2eQuietLogs(t) |
| + fo := &fakeOrder{} |
| + const host = "billing.example.com" |
| + p, store, local := testPreIssuer(t, []string{"example.com"}, staticClaims(proven(host)), fo.order(t)) |
| + ctx := context.Background() |
| + c, _ := selfSignedLeaf(t, host, time.Now().Add(80*24*time.Hour)) |
| + raw, err := encodeWildcardPEM(c, c.PrivateKey.(*ecdsa.PrivateKey)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := local.Put(ctx, host, raw); err != nil { |
| + t.Fatal(err) |
| + } |
| + p.pass(ctx) |
| + if fo.count() != 0 { |
| + t.Fatalf("ordered %d times for a name with a current local cert", fo.count()) |
| + } |
| + if got, err := certStoreGet(t, store, certKey(host)); err != nil || string(got) != string(raw) { |
| + t.Fatalf("local cert not republished to the bucket: %v", err) |
| + } |
| +} |
| + |
| +// The claims read failing is logged and the pass ends: nothing is ordered on |
| +// a partial picture. |
| +func TestPreIssueClaimsReadFailure(t *testing.T) { |
| + e2eQuietLogs(t) |
| + fo := &fakeOrder{} |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, |
| + func(context.Context) ([]domains.Claim, error) { return nil, errors.New("bucket down") }, fo.order(t)) |
| + p.pass(context.Background()) |
| + if fo.count() != 0 { |
| + t.Fatal("ordered after a failed claims read") |
| + } |
| +} |
| + |
| +// Names that keep failing must not spend the hourly budget ahead of a name |
| +// that was never tried (Astra R1 P2). |
| +func TestPreIssueFailuresDoNotStarveOthers(t *testing.T) { |
| + e2eQuietLogs(t) |
| + var cs []domains.Claim |
| + for i := range preIssueOrdersPerHour + 5 { |
| + cs = append(cs, proven(fmt.Sprintf("a%02d.example.com", i))) |
| + } |
| + cs = append(cs, proven("zz.example.com")) |
| + var mu sync.Mutex |
| + var asked []string |
| + order := func(_ context.Context, host string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| + mu.Lock() |
| + asked = append(asked, host) |
| + mu.Unlock() |
| + if host != "zz.example.com" { |
| + return nil, nil, errors.New("CA said no") |
| + } |
| + cert, key := selfSignedLeaf(t, host, time.Now().Add(90*24*time.Hour)) |
| + return cert, key, nil |
| + } |
| + p, _, _ := testPreIssuer(t, []string{"example.com"}, staticClaims(cs...), order) |
| + now := time.Now() |
| + p.now = func() time.Time { return now } |
| + for range 180 { |
| + p.pass(context.Background()) |
| + now = now.Add(preIssueInterval) |
| + } |
| + if !slices.Contains(asked, "zz.example.com") { |
| + t.Fatalf("zz.example.com never tried in three hours of passes (%d orders, all for failing names)", len(asked)) |
| + } |
| +} |
| + |
| +// replaceDNS keeps ONE value per name, as Route 53's UPSERT does, and holds |
| +// the first publication open briefly so that a second order for the same |
| +// name, if nothing serializes them, overwrites it before the CA looks. |
| +type replaceDNS struct { |
| + mu sync.Mutex |
| + txt map[string]string |
| + second chan struct{} |
| + calls int |
| +} |
| + |
| +func (d *replaceDNS) checkZone(context.Context, string) error { return nil } |
| + |
| +func (d *replaceDNS) present(_ context.Context, fqdn, value string) (func(context.Context) error, error) { |
| + d.mu.Lock() |
| + d.calls++ |
| + n := d.calls |
| + d.txt[fqdn] = value |
| + d.mu.Unlock() |
| + if n == 1 { |
| + select { |
| + case <-d.second: |
| + case <-time.After(300 * time.Millisecond): |
| + } |
| + } else { |
| + close(d.second) |
| + } |
| + return func(context.Context) error { |
| + d.mu.Lock() |
| + defer d.mu.Unlock() |
| + if d.txt[fqdn] == value { |
| + delete(d.txt, fqdn) |
| + } |
| + return nil |
| + }, nil |
| +} |
| + |
| +func (d *replaceDNS) lookup(name string) []string { |
| + d.mu.Lock() |
| + defer d.mu.Unlock() |
| + if v, ok := d.txt[name]; ok { |
| + return []string{v} |
| + } |
| + return nil |
| +} |
| + |
| +// An apex pre-issue and the wildcard for the same parent answer at the same |
| +// challenge name; both must complete (Astra R1 P1). |
| +func TestSameChallengeNameOrdersDoNotCollide(t *testing.T) { |
| + e2eQuietLogs(t) |
| + noTXTWait(t) |
| + dns := &replaceDNS{txt: map[string]string{}, second: make(chan struct{})} |
| + ca := newFakeACME(t) |
| + ca.dns01TXT = dns.lookup |
| + cache := autocert.DirCache(t.TempDir()) |
| + w := newWildcardManager([]string{"go.example.com"}, "", func() []string { return nil }, nil, "", cache, dns) |
| + w.directory = ca.directoryURL() |
| + w.refresh() |
| + apex := dns01OrderFunc(cache, ca.directoryURL(), dns) |
| + |
| + var wg sync.WaitGroup |
| + var werr, aerr error |
| + wg.Add(2) |
| + go func() { defer wg.Done(); werr = w.obtain(context.Background(), "go.example.com") }() |
| + go func() { defer wg.Done(); _, _, aerr = apex(context.Background(), "go.example.com") }() |
| + wg.Wait() |
| + if werr != nil || aerr != nil { |
| + t.Fatalf("wildcard: %v; apex: %v — one order overwrote the other's challenge", werr, aerr) |
| + } |
| + ca.checkFaults(t) |
| +} |
diff --git a/internal/edge/wildcard.go b/internal/edge/wildcard.go| index 161bc14fb..7b2bbd9c8 100644 |
| --- a/internal/edge/wildcard.go |
| +++ b/internal/edge/wildcard.go |
| @@ -691,6 +691,35 @@ const noZoneRetry = 12 * time.Hour |
| // obtain runs one full ACME DNS-01 issuance for *.parent and swaps the |
| // result in. |
| func (w *wildcardManager) obtain(ctx context.Context, parent string) error { |
| + cert, certKey, err := dns01Order(ctx, w.cache, w.directory, w.dns, "*."+parent, w.challengeFQDN(parent), "wildcard *."+parent) |
| + if err != nil { |
| + return err |
| + } |
| + // Paranoia: never store what certFor would refuse to serve. |
| + if !coversParent(cert, parent) { |
| + return fmt.Errorf("issued cert does not cover *.%s", parent) |
| + } |
| + raw, err := encodeWildcardPEM(cert, certKey) |
| + if err != nil { |
| + return fmt.Errorf("encode: %v", err) |
| + } |
| + if err := w.cache.Put(ctx, wildcardPEMKey(parent), raw); err != nil { |
| + return fmt.Errorf("persist: %v", err) |
| + } |
| + w.mu.Lock() |
| + w.certs[parent] = cert |
| + w.mu.Unlock() |
| + return nil |
| +} |
| + |
| +// dns01Order runs one ACME order for a single identifier over DNS-01 and |
| +// returns the issued chain with its fresh key. It is the CA conversation and |
| +// nothing else: the caller decides what the result must cover and where it |
| +// is kept. Two callers share it, and with it the deployment's one DNS-01 ACME |
| +// account: the wildcard manager above (identifier "*.<parent>") and the |
| +// pre-issuer (precert.go, an exact hostname). label names the work in log |
| +// lines ("wildcard *.<parent>", "pre-issue <host>"). |
| +func dns01Order(ctx context.Context, cache autocert.Cache, directory string, dns dnsProvider, identifier, challengeFQDN, label string) (*tls.Certificate, *ecdsa.PrivateKey, error) { |
| // Before the CA hears anything: can the provider publish the challenge |
| // at all? A parent whose zone lives elsewhere (per-account platform |
| // parents on a deployment whose apps domain is not in the provider's |
| @@ -699,70 +728,61 @@ func (w *wildcardManager) obtain(ctx context.Context, parent string) error { |
| // rate limits, since the authorization is deactivated and never |
| // validated, but a pointless round trip to the CA and a journal line per |
| // parent per hour. The lookup is the one present would make first. |
| - if zc, ok := w.dns.(zoneChecker); ok { |
| - if err := zc.checkZone(ctx, w.challengeFQDN(parent)); err != nil { |
| - return fmt.Errorf("cannot publish the DNS-01 challenge: %w", err) |
| + if zc, ok := dns.(zoneChecker); ok { |
| + if err := zc.checkZone(ctx, challengeFQDN); err != nil { |
| + return nil, nil, fmt.Errorf("cannot publish the DNS-01 challenge: %w", err) |
| } |
| } |
| - acctKey, err := w.accountKey(ctx) |
| + acctKey, err := dns01AccountKey(ctx, cache) |
| if err != nil { |
| - return fmt.Errorf("account key: %v", err) |
| + return nil, nil, fmt.Errorf("account key: %v", err) |
| } |
| - client := &acme.Client{Key: acctKey, DirectoryURL: w.directory} |
| + client := &acme.Client{Key: acctKey, DirectoryURL: directory} |
| if _, err := client.Register(ctx, &acme.Account{}, acme.AcceptTOS); err != nil && err != acme.ErrAccountAlreadyExists { |
| - return fmt.Errorf("acme register: %v", err) |
| + return nil, nil, fmt.Errorf("acme register: %v", err) |
| } |
| - order, err := client.AuthorizeOrder(ctx, []acme.AuthzID{{Type: "dns", Value: "*." + parent}}) |
| + order, err := client.AuthorizeOrder(ctx, []acme.AuthzID{{Type: "dns", Value: identifier}}) |
| if err != nil { |
| - return fmt.Errorf("authorize order: %v", err) |
| + return nil, nil, fmt.Errorf("authorize order: %v", err) |
| } |
| for _, zurl := range order.AuthzURLs { |
| - if err := w.solveDNS01(ctx, client, parent, zurl); err != nil { |
| - return err |
| + if err := solveDNS01(ctx, client, dns, label, challengeFQDN, zurl); err != nil { |
| + return nil, nil, err |
| } |
| } |
| certKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) |
| if err != nil { |
| - return err |
| + return nil, nil, err |
| } |
| csr, err := x509.CreateCertificateRequest(rand.Reader, &x509.CertificateRequest{ |
| - Subject: pkix.Name{CommonName: "*." + parent}, |
| - DNSNames: []string{"*." + parent}, |
| + Subject: pkix.Name{CommonName: identifier}, |
| + DNSNames: []string{identifier}, |
| }, certKey) |
| if err != nil { |
| - return fmt.Errorf("csr: %v", err) |
| + return nil, nil, fmt.Errorf("csr: %v", err) |
| } |
| ders, _, err := client.CreateOrderCert(ctx, order.FinalizeURL, csr, true) |
| if err != nil { |
| - return fmt.Errorf("finalize: %v", err) |
| + return nil, nil, fmt.Errorf("finalize: %v", err) |
| } |
| leaf, err := x509.ParseCertificate(ders[0]) |
| if err != nil { |
| - return fmt.Errorf("parse issued cert: %v", err) |
| - } |
| - cert := &tls.Certificate{Certificate: ders, PrivateKey: certKey, Leaf: leaf} |
| - // Paranoia: never store what certFor would refuse to serve. |
| - if !coversParent(cert, parent) { |
| - return fmt.Errorf("issued cert does not cover *.%s", parent) |
| - } |
| - raw, err := encodeWildcardPEM(cert, certKey) |
| - if err != nil { |
| - return fmt.Errorf("encode: %v", err) |
| + return nil, nil, fmt.Errorf("parse issued cert: %v", err) |
| } |
| - if err := w.cache.Put(ctx, wildcardPEMKey(parent), raw); err != nil { |
| - return fmt.Errorf("persist: %v", err) |
| - } |
| - w.mu.Lock() |
| - w.certs[parent] = cert |
| - w.mu.Unlock() |
| - return nil |
| + return &tls.Certificate{Certificate: ders, PrivateKey: certKey, Leaf: leaf}, certKey, nil |
| } |
| -// solveDNS01 answers one authorization: publish the challenge TXT record, |
| -// wait for the CA to see it, and always clean the record up afterwards. |
| -func (w *wildcardManager) solveDNS01(ctx context.Context, client *acme.Client, parent, authzURL string) (retErr error) { |
| +// dns01TXTWait is waitForTXT, held in a variable so a test whose challenge |
| +// records live in a fake provider (and so never reach a real resolver) need |
| +// not sit out its minute. |
| +var dns01TXTWait = waitForTXT |
| + |
| +// solveDNS01 answers one authorization: publish the challenge TXT record at |
| +// challengeFQDN, wait for the CA to see it, and always clean the record up |
| +// afterwards. |
| +func solveDNS01(ctx context.Context, client *acme.Client, dns dnsProvider, label, challengeFQDN, authzURL string) (retErr error) { |
| authz, err := client.GetAuthorization(ctx, authzURL) |
| if err != nil { |
| return fmt.Errorf("get authorization: %v", err) |
| @@ -780,7 +800,7 @@ func (w *wildcardManager) solveDNS01(ctx context.Context, client *acme.Client, p |
| dctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| defer cancel() |
| if err := client.RevokeAuthorization(dctx, authz.URI); err != nil { |
| - log.Printf("edge: wildcard *.%s: deactivate abandoned authorization: %v", parent, err) |
| + log.Printf("edge: %s: deactivate abandoned authorization: %v", label, err) |
| } |
| }() |
| var chal *acme.Challenge |
| @@ -798,8 +818,17 @@ func (w *wildcardManager) solveDNS01(ctx context.Context, client *acme.Client, p |
| return err |
| } |
| - challengeFQDN := w.challengeFQDN(parent) |
| - cleanup, err := w.dns.present(ctx, challengeFQDN, txt) |
| + // One order per challenge name at a time, from publication to cleanup: |
| + // an apex pre-issue (precert.go) and the wildcard for the same parent |
| + // both answer at _acme-challenge.<parent>, and a provider that replaces |
| + // the record set (Route 53's UPSERT) would let one order overwrite the |
| + // other's value before the CA looks. |
| + unlock, err := lockChallenge(ctx, challengeFQDN) |
| + if err != nil { |
| + return fmt.Errorf("wait for another order's challenge at %s: %v", challengeFQDN, err) |
| + } |
| + defer unlock() |
| + cleanup, err := dns.present(ctx, challengeFQDN, txt) |
| if err != nil { |
| return fmt.Errorf("publish challenge TXT: %v", err) |
| } |
| @@ -809,14 +838,14 @@ func (w *wildcardManager) solveDNS01(ctx context.Context, client *acme.Client, p |
| cctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| defer cancel() |
| if err := cleanup(cctx); err != nil { |
| - log.Printf("edge: wildcard *.%s: cleanup of challenge TXT failed: %v", parent, err) |
| + log.Printf("edge: %s: cleanup of challenge TXT failed: %v", label, err) |
| } |
| }() |
| // Best-effort: give the record a moment to reach the authoritative NS |
| // before telling the CA to look. Proceed on timeout — the CA does its own |
| // retries, and a hard failure just comes back through the retry loop. |
| - waitForTXT(ctx, challengeFQDN, txt, time.Minute) |
| + dns01TXTWait(ctx, challengeFQDN, txt, time.Minute) |
| if _, err := client.Accept(ctx, chal); err != nil { |
| return fmt.Errorf("accept challenge: %v", err) |
| @@ -827,14 +856,46 @@ func (w *wildcardManager) solveDNS01(ctx context.Context, client *acme.Client, p |
| return nil |
| } |
| +// challengeLocks holds one single-slot channel per challenge FQDN: the lock |
| +// solveDNS01 takes around a challenge's whole life (see there). Keyed by |
| +// name, so it grows with the names this process has ever answered for, |
| +// which is bounded by the deployment's parents and pre-issued hosts. |
| +var challengeLocks sync.Map |
| + |
| +// lockChallenge takes fqdn's challenge lock, or gives up when ctx ends. |
| +func lockChallenge(ctx context.Context, fqdn string) (unlock func(), err error) { |
| + v, _ := challengeLocks.LoadOrStore(fqdn, make(chan struct{}, 1)) |
| + slot := v.(chan struct{}) |
| + select { |
| + case slot <- struct{}{}: |
| + return func() { <-slot }, nil |
| + case <-ctx.Done(): |
| + return nil, ctx.Err() |
| + } |
| +} |
| + |
| // wildcardAccountKeyName is the ACME account key's cache key — Eleven's file |
| -// name, for the same no-migration reason as wildcardPEMKey. |
| +// name, for the same no-migration reason as wildcardPEMKey. Every DNS-01 |
| +// order in the deployment, wildcard or pre-issued host, runs under it. |
| const wildcardAccountKeyName = "wildcard-account.key" |
| // accountKey loads (or mints) the ACME account key. Separate from autocert's |
| // account on purpose: this flow manages its own registration lifecycle. |
| func (w *wildcardManager) accountKey(ctx context.Context) (*ecdsa.PrivateKey, error) { |
| - raw, err := w.cache.Get(ctx, wildcardAccountKeyName) |
| + return dns01AccountKey(ctx, w.cache) |
| +} |
| + |
| +// dns01AccountMu serializes the load-or-mint below. The wildcard manager and |
| +// the pre-issuer order on separate goroutines over one cache, and two first |
| +// orders racing a miss would each mint and register an account, the second |
| +// Put orphaning the first's registration. |
| +var dns01AccountMu sync.Mutex |
| + |
| +// dns01AccountKey loads (or mints) the DNS-01 ACME account key held in cache. |
| +func dns01AccountKey(ctx context.Context, cache autocert.Cache) (*ecdsa.PrivateKey, error) { |
| + dns01AccountMu.Lock() |
| + defer dns01AccountMu.Unlock() |
| + raw, err := cache.Get(ctx, wildcardAccountKeyName) |
| if err == nil { |
| block, _ := pem.Decode(raw) |
| if block == nil { |
| @@ -859,7 +920,7 @@ func (w *wildcardManager) accountKey(ctx context.Context) (*ecdsa.PrivateKey, er |
| // Crash-safety (temp + rename, 0600) is the cache backend's contract — |
| // the dir backend inherits it from autocert.DirCache. |
| raw = pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: der}) |
| - if err := w.cache.Put(ctx, wildcardAccountKeyName, raw); err != nil { |
| + if err := cache.Put(ctx, wildcardAccountKeyName, raw); err != nil { |
| return nil, err |
| } |
| return key, nil |
diff --git a/internal/host/agent.go b/internal/host/agent.go| index 81206e544..e9a823c91 100644 |
| --- a/internal/host/agent.go |
| +++ b/internal/host/agent.go |
| @@ -139,6 +139,12 @@ |
| // - CARLOS_ACME_DELEGATION_ZONE — our own zone that delegated wildcard |
| // parents' challenge TXTs publish into (spec §4); unset or an invalid |
| // shape = delegation off, per-host and direct DNS-01 continue |
| +// - CARLOS_DNS01_ZONES — comma list of zones the DNS-01 backend writes |
| +// (tito: tito.io) whose attached hostnames the issuer certifies over |
| +// DNS-01 from the claim, before their DNS points here (edge precert.go, |
| +// #1293); unset = off, custom domains wait for HTTP-01 as before |
| +// - CARLOS_DNS01_ACCOUNTS — comma list of account sqids whose claims may |
| +// use CARLOS_DNS01_ZONES; required with it (no account = off) |
| // - PLATFORM_EDGE_IPS — comma-separated edge IPs custom-domain DNS checks |
| // compare against. Default: this box's public IPv4 from IMDS |
| // (best-effort). It is no longer the WHOLE comparison set: each pass |
diff --git a/internal/hostenv/hostenv.go b/internal/hostenv/hostenv.go| index 55da6ecba..ad540ef08 100644 |
| --- a/internal/hostenv/hostenv.go |
| +++ b/internal/hostenv/hostenv.go |
| @@ -91,6 +91,8 @@ var Optional = []string{ |
| "CARLOS_DEMO_API_ORIGIN", |
| "CARLOS_DEPLOYMENT_REGION", |
| "CARLOS_DEPLOYMENT_SINGLE_TENANT", |
| + "CARLOS_DNS01_ACCOUNTS", |
| + "CARLOS_DNS01_ZONES", |
| "CARLOS_DNS_PROVIDER", |
| "CARLOS_EDGE_GZIP", |
| "CARLOS_EDGE_PROTECT", |
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go| index f267413cc..c31e9e42e 100644 |
| --- a/internal/provision/plan9_b8_census_test.go |
| +++ b/internal/provision/plan9_b8_census_test.go |
| @@ -767,9 +767,13 @@ var plan9B8CensusInventory = []censusEntry{ |
| // Calls the in-memory edge Cache.Put, not a deployment store writer. |
| {"internal/edge/edge.go", "Edge.maybeStore", "nonrecord", "sel:Put", "89231cd6ebfa293c307f502a7bf7236373199489e6846e0c3b8ccf281594b9ab"}, |
| {"internal/edge/mesh.go", "mintMeshKey", "nonrecord", "sel:Put", "bfb55866660051d4c55b2a1be96e7f997c76042119a8f57472fbc41908a2dcc0"}, |
| + // #1293: writes a pre-issued per-host certificate to the cert cache (local acme dir, then control/certs/<host>); no record. |
| + {"internal/edge/precert.go", "preIssuer.issue", "nonrecord", "sel:Put", "281db1f336345758dc4846d0da9392b60ec850e3c67a88a643ca5295cb444bda"}, |
| {"internal/edge/storedoor.go", "storeDoor.serveObject", "record-transport", "sel:Put", "95fef5f91ed7a5f07a3818b1a55baded4209e97d43d48ba21cb69be3d2c7299d"}, |
| - {"internal/edge/wildcard.go", "wildcardManager.obtain", "nonrecord", "sel:Put", "752840841afb596cba318e5c7ece964c5146a7a24edde91f9c9dc0024753dc3b"}, |
| - {"internal/edge/wildcard.go", "wildcardManager.accountKey", "nonrecord", "sel:Put", "77f7da94e302045eff8cbbb1be311bdcbaf75cc4cdd8f794d474e508fbf35a51"}, |
| + // #1293: the CA conversation moved to dns01Order; obtain still writes only the wildcard PEM to the cert cache. |
| + {"internal/edge/wildcard.go", "wildcardManager.obtain", "nonrecord", "sel:Put", "314c68830f5f5ea7393b2c09d390b868bcecf92a63e3eb66067b5335ac74e97e"}, |
| + // #1293: wildcardManager.accountKey's load-or-mint, moved here unchanged and serialized; writes the DNS-01 ACME account key to the cert cache. |
| + {"internal/edge/wildcard.go", "dns01AccountKey", "nonrecord", "sel:Put", "86ce92c43ab7581764bfb5db91239b3ecb40388ac6e6c14b41a40a1242ecc50d"}, |
| {"internal/fleetapi/fleetapi.go", "store.Put", "record-transport", "def:Put", "68f7424cbbaf8fffde48429ae29198cf6e4fcf768c512657b305224febc11186"}, |
| {"internal/genselect/select.go", "requestLocation", "key-site", "lit:instances", "12ef5b8f94be7575ec7ab5f169736320ee6938440387fe5ea99b96f2a528cca0"}, |
| {"internal/host/bootstrap.go", "const tmpfilesConf", "key-site", "lit:instances", "71d83f240cb1c3ab6f9dd2954b1f3e93b90133362ec12193746f60e75aeced7d"}, |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index e4b5192e1..721bc6e11 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -276,4 +276,5 @@ plan14-root-reads-path-routes-across-boxes.tsv f959a3626e83650aaad1880eecc3fedde |
| plan14-root-reads-headers-security-allowlist.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6 |
| plan14-root-reads-stateless-scale-1-memory-env.tsv 47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132 |
| plan14-root-reads-group-revoke-readback-1255.tsv 47ebd73418bcbe1bdf9cf34a2b94e3393a1279aea58f9ee0aca3f0cfe42b9132 |
| -plan14-root-reads-fleet-client-address-1348.tsv 23cc63cd73452798f0fcf0800b63b909b055f2e52b48f3a09f9ca2fd9b3be427 |
| +plan14-root-reads-precert-dns01-1293.tsv b2f039a12bb284c9a36b391339e25e3f77ec94a3d4e38389ec9ef75261d7873f |
| +plan14-root-reads-fleet-client-address-1348.tsv 9fb6041c2fe2f33edf7cc2a0fb6dc05092015414b89cab3610ebcfc04c21d5b0 |
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv b/internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv| index 445201310..6683186c4 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-fleet-client-address-1348.tsv |
| @@ -2,5 +2,5 @@ |
| # 1 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| @legacy 19e4b3a3e14be4028f087fd216f52fb871bf0d59bcd9ba1c6efd5934897d5a67 internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read);rev3=census-ruling-fleet-unrouted-503;basis=a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added;rev3=census-ruling-fleet-seeded-create-2;basis=The hub's door routing asks boxConsolePath(r) instead of the inline /api/fleet/replicas/ test, so POST /api/fleet/seeds/ goes to the local console by the same rule (POST only, clean path, no RawPath) as the replica doors. Serving only; no read of a path a tenant names; the same 65 read sites.;rev3=census-ruling-path-routes-across-boxes;basis=#186: selection returns requestSelection; a Remote selection is dispatched by servePathRemote (one signed hop, never from a verified hop, door call or pin); the ownership block moved to serveNameOwner/nameOwnerVerdict (pathhop.go), so its route reads left; login re-selection via loginLookupPath plus refuseLoginAcross; LRU also requires pathLRUAllowed; no read added;rev3=census-ruling-fleet-client-address-1348;basis=hop acceptance moved into acceptIngress (pinned: dropHopHeaders; else acceptHop), which then, for a request a tunnel delivered (tunnelclient mark) whose X-Forwarded-For hubVisitor accepts (every entry an IP), carries its last entry as the gate attempt key (gate.WithClientAddr), as ServeLinked does (#1348); a context value on the request, memory only, no read, dial or store access added; no check weakened file:ReadAll@19091,registry:App@26368,registry:Gate@18065,registry:Gate@30759,registry:Gate@30819,registry:Gate@30877,registry:HA@13809,registry:HA@14151,registry:Host@14190,registry:Host@30862,registry:ImportGate@39754,registry:Kind@23402,registry:Kind@25230,registry:Kind@28668,registry:Kind@39696,registry:Kind@39725,whole:Route@13812,whole:Route@13906,whole:Route@14154,whole:Route@14193,whole:Route@17960,whole:Route@18071,whole:Route@20370,whole:Route@21154,whole:Route@21612,whole:Route@21804,whole:Route@23405,whole:Route@25233,whole:Route@26294,whole:Route@26360,whole:Route@26371,whole:Route@26624,whole:Route@26719,whole:Route@26795,whole:Route@26839,whole:Route@27141,whole:Route@27171,whole:Route@28671,whole:Route@28956,whole:Route@30762,whole:Route@30822,whole:Route@30865,whole:Route@30880,whole:Route@32091,whole:Route@34379,whole:Route@39699,whole:Route@39728,whole:Route@39757,whole:Route@39789,whole:Route@42256,whole:Route@8405,whole:Route@8504,whole:Route@8610 3b450b21a2e2b49ccac127eb9917fdc5a2dfdec1c490ccf89151f443f8b37825 |
| internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read);rev3=census-ruling-fleet-unrouted-503;basis=a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added;rev3=census-ruling-fleet-seeded-create-2;basis=The hub's door routing asks boxConsolePath(r) instead of the inline /api/fleet/replicas/ test, so POST /api/fleet/seeds/ goes to the local console by the same rule (POST only, clean path, no RawPath) as the replica doors. Serving only; no read of a path a tenant names; the same 65 read sites.;rev3=census-ruling-path-routes-across-boxes;basis=#186: selection returns requestSelection; a Remote selection is dispatched by servePathRemote (one signed hop, never from a verified hop, door call or pin); the ownership block moved to serveNameOwner/nameOwnerVerdict (pathhop.go), so its route reads left; login re-selection via loginLookupPath plus refuseLoginAcross; LRU also requires pathLRUAllowed; no read added;rev3=census-ruling-fleet-client-address-1348;basis=hop acceptance moved into acceptIngress (pinned: dropHopHeaders; else acceptHop), which then, for a request a tunnel delivered (tunnelclient mark) whose X-Forwarded-For hubVisitor accepts (every entry an IP), carries its last entry as the gate attempt key (gate.WithClientAddr), as ServeLinked does (#1348); a context value on the request, memory only, no read, dial or store access added; no check weakened file:ReadAll@19091,registry:App@26368,registry:Gate@18065,registry:Gate@30759,registry:Gate@30819,registry:Gate@30877,registry:HA@13809,registry:HA@14151,registry:Host@14190,registry:Host@30862,registry:ImportGate@39754,registry:Kind@23402,registry:Kind@25230,registry:Kind@28668,registry:Kind@39696,registry:Kind@39725,whole:Route@13812,whole:Route@13906,whole:Route@14154,whole:Route@14193,whole:Route@17960,whole:Route@18071,whole:Route@20370,whole:Route@21154,whole:Route@21612,whole:Route@21804,whole:Route@23405,whole:Route@25233,whole:Route@26294,whole:Route@26360,whole:Route@26371,whole:Route@26624,whole:Route@26719,whole:Route@26795,whole:Route@26839,whole:Route@27141,whole:Route@27171,whole:Route@28671,whole:Route@28956,whole:Route@30762,whole:Route@30822,whole:Route@30865,whole:Route@30880,whole:Route@32091,whole:Route@34379,whole:Route@39699,whole:Route@39728,whole:Route@39757,whole:Route@39789,whole:Route@42256,whole:Route@8405,whole:Route@8504,whole:Route@8610 3b450b21a2e2b49ccac127eb9917fdc5a2dfdec1c490ccf89151f443f8b37825 |
| -@coverage internal/edge 49f213dddaa3a722c2ae43aa97e3271084b6a93594fc6732e95628369afb48e8 |
| +@coverage internal/edge 13acd10c5bca7a338a898c90d1677fcddd35b4a5d0f58d64d9b18a59f27d15c3 |
| @coverage internal/gate 7b140d60ca2a8c62fa47279c0a747c076bc755595680c97037736f555ae40fbf |
diff --git a/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv b/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv| new file mode 100644 |
| index 000000000..4eb1c30de |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv |
| @@ -0,0 +1,7 @@ |
| +# Census overlay precert-dns01-1293, written by census-propose (#369). census-ruling-precert-dns01-1293, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-precert-dns01-1293.md. |
| +# 1 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy e2f9aff7fc89e6f5d85c811489416b8961496c0d29550f52852948b90a1fb8a4 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162 |
| +internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162 |
| +@coverage internal/edge 88c47565ad69fe60fb5f26acee99b338d8534e3fc419dcf2be3465eddfcc809b |
| +@coverage internal/host d3e30f0432b1fb8a0c4affe1e1cd7cccf39d181f47ed44b2832d0465b7f22ddb |
| +@coverage internal/hostenv 42dfd4b787b820301c75ee2a5c158a31b8db4fedd748b32140bd0cfc565fb411 |