A new instance's first process starts with its config
A new instance's config file lives in its instance directory, which only the first wake created, so the first generation booted without its app config and was then restarted for a "config change" (seen on the bdm flagship 2026-11-24: ws-techpreneurs ran ~12 s unconfigured). Before a wake plans its spawn, the activator now asks the agent for one config pass narrowed to that host, which makes the directory and writes the bundle; the spawn reads it and no restart follows. Best effort: a 5 s budget, a 30 s retry window that a lock timeout doesn't start, and on any failure the wake proceeds as before. Reviewed by Opus (round 1) and, for the census, Fable 5.2 at Paul's direction in place of Astra (#280). The ~17 s install wait on a brand-new instance is analysed in #1386. Squashed from instance-ready-before-wake into main. Co-Authored-By: Paul Campbell <paul@tito.io>
13 files changed,
+1,037
−31
.amadan/code-health.tsv+3 −3docs/superpowers/notes/census-proposal-instance-ready-before-wake.md+33 −0internal/activator/activator.go+24 −0internal/activator/configbeforewake.go+24 −0internal/activator/configbeforewake_test.go+74 −0internal/appconfig/syncexec.go+50 −1internal/appconfig/syncexec_makedir_test.go+90 −0internal/host/agent.go+6 −27internal/host/configbeforewake.go+325 −0internal/host/configbeforewake_test.go+352 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-instance-ready-before-wake.tsv+22 −0internal/rollout/wakeplan_test.go+33 −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-lN0isP
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/aws/smithy-go v1.28.1
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/config v1.32.6
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading golang.org/x/text v0.43.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/prometheus/common v0.45.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== launchctx (4 s, from +0 s)
ok amadan.net/carlos/platform.git/launchctx 0.015s
? amadan.net/carlos/platform.git/launchctx/controlname [no test files]
? amadan.net/carlos/platform.git/launchctx/wireid [no test files]
=== vet (173 s, from +0 s)
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/memory v1.11.0
=== vet-tags (181 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/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/memory v1.11.0
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (378 s, from +15 s)
ok github.com/carlosframework/platform/cmd/carlos-media 120.471s
? github.com/carlosframework/platform/cmd/changelog [no test files]
ok github.com/carlosframework/platform/cmd/console 206.321s
ok github.com/carlosframework/platform/cmd/mediaimage 41.090s
ok github.com/carlosframework/platform/cmd/moveprobe 15.925s
ok github.com/carlosframework/platform/cmd/pricebook-export 0.037s
ok github.com/carlosframework/platform/cmd/rootfswitness 0.138s
ok github.com/carlosframework/platform/cmd/runsc-assets 0.200s
ok github.com/carlosframework/platform/cmd/zddprobe 0.990s
ok github.com/carlosframework/platform/internal/agentsock 0.076s
ok github.com/carlosframework/platform/internal/alerting 0.042s
ok github.com/carlosframework/platform/internal/analytics 0.344s
ok github.com/carlosframework/platform/internal/appconfig 43.466s
ok github.com/carlosframework/platform/internal/apperr 0.541s
ok github.com/carlosframework/platform/internal/applog 0.565s
ok github.com/carlosframework/platform/internal/apppolicy 1.957s
ok github.com/carlosframework/platform/internal/assetcache 0.357s
ok github.com/carlosframework/platform/internal/awsinv 0.020s
ok github.com/carlosframework/platform/internal/awsmanaged 0.410s
ok github.com/carlosframework/platform/internal/awsregiongroup 0.152s
ok github.com/carlosframework/platform/internal/awsterminations 0.026s
ok github.com/carlosframework/platform/internal/backupswords 0.011s
ok github.com/carlosframework/platform/internal/billing 0.067s
ok github.com/carlosframework/platform/internal/billing/billingtest 0.064s
ok github.com/carlosframework/platform/internal/billingstripe 1.590s
ok github.com/carlosframework/platform/internal/boxchoice 0.028s
ok github.com/carlosframework/platform/internal/boxid 2.055s
? github.com/carlosframework/platform/internal/boxid/boxidtest [no test files]
? github.com/carlosframework/platform/internal/boxid/internal/signtest [no test files]
ok github.com/carlosframework/platform/internal/boxroles 0.009s
ok github.com/carlosframework/platform/internal/boxself 0.169s
ok github.com/carlosframework/platform/internal/boxvolumes 0.027s
ok github.com/carlosframework/platform/internal/caps 3.269s
ok github.com/carlosframework/platform/internal/certwarm 0.011s
ok github.com/carlosframework/platform/internal/cgroup 1.316s
ok github.com/carlosframework/platform/internal/changelog 3.991s
ok github.com/carlosframework/platform/internal/clamd 0.104s
? github.com/carlosframework/platform/internal/cliflag [no test files]
ok github.com/carlosframework/platform/internal/clireg 0.020s
ok github.com/carlosframework/platform/internal/codehealth 16.953s
ok github.com/carlosframework/platform/internal/compute 0.011s
ok github.com/carlosframework/platform/internal/consolefleet 0.007s
? 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 9.973s
ok github.com/carlosframework/platform/internal/dbdoor/dbdoortest 0.016s
ok github.com/carlosframework/platform/internal/dbquery 0.033s
ok github.com/carlosframework/platform/internal/dbreads 3.031s
? github.com/carlosframework/platform/internal/dbreads/dbreadstest [no test files]
ok github.com/carlosframework/platform/internal/dbverify 0.010s
ok github.com/carlosframework/platform/internal/demo 0.006s
ok github.com/carlosframework/platform/internal/demobuild 2.707s
ok github.com/carlosframework/platform/internal/democlaim 0.397s
ok github.com/carlosframework/platform/internal/devbox 16.771s
ok github.com/carlosframework/platform/internal/dnsrec 0.011s
ok github.com/carlosframework/platform/internal/docsite 0.108s
ok github.com/carlosframework/platform/internal/domainreg 0.007s
ok github.com/carlosframework/platform/internal/domains 65.450s
ok github.com/carlosframework/platform/internal/doorkey 0.035s
ok github.com/carlosframework/platform/internal/economics 0.017s
ok github.com/carlosframework/platform/internal/edgefence 0.081s
ok github.com/carlosframework/platform/internal/edgeguard 0.229s
? github.com/carlosframework/platform/internal/edgeproof [no test files]
ok github.com/carlosframework/platform/internal/edgesfile 0.075s
ok github.com/carlosframework/platform/internal/egressaddr 0.013s
ok github.com/carlosframework/platform/internal/execsandbox 102.183s
ok github.com/carlosframework/platform/internal/fileacl 0.014s
ok github.com/carlosframework/platform/internal/fleetapi 1.773s
ok github.com/carlosframework/platform/internal/fleetstore 0.013s
ok github.com/carlosframework/platform/internal/fxrate 0.022s
ok github.com/carlosframework/platform/internal/gate 5.457s
ok github.com/carlosframework/platform/internal/genselect 0.094s
ok github.com/carlosframework/platform/internal/geo 0.034s
ok github.com/carlosframework/platform/internal/geoip 0.099s
ok github.com/carlosframework/platform/internal/groupadmission 0.014s
ok github.com/carlosframework/platform/internal/grouprollaws 17.632s
ok github.com/carlosframework/platform/internal/hadeparture 0.037s
ok github.com/carlosframework/platform/internal/hafresh 0.012s
ok github.com/carlosframework/platform/internal/hairpin 0.205s
ok github.com/carlosframework/platform/internal/historyreadback 1.000s
ok github.com/carlosframework/platform/internal/hostactors 22.846s
ok github.com/carlosframework/platform/internal/hostbox 21.242s
ok github.com/carlosframework/platform/internal/hostclaim 2.424s
ok github.com/carlosframework/platform/internal/hostenv 0.032s
ok github.com/carlosframework/platform/internal/hostevidence 0.023s
ok github.com/carlosframework/platform/internal/hostexec 26.596s
ok github.com/carlosframework/platform/internal/hostfence 0.279s
ok github.com/carlosframework/platform/internal/hostfiles 28.125s
ok github.com/carlosframework/platform/internal/hostfloor 0.114s
ok github.com/carlosframework/platform/internal/hostguard 1.607s
ok github.com/carlosframework/platform/internal/hostops 7.889s
? github.com/carlosframework/platform/internal/hostops/fencerelease [no test files]
ok github.com/carlosframework/platform/internal/hostops/internal/fencerelease 0.023s
ok github.com/carlosframework/platform/internal/hostquarantine 0.013s
ok github.com/carlosframework/platform/internal/hostrelocate 1.569s
ok github.com/carlosframework/platform/internal/hostresolve 0.743s
ok github.com/carlosframework/platform/internal/hostwrite 0.010s
ok github.com/carlosframework/platform/internal/infraview 0.011s
ok github.com/carlosframework/platform/internal/ingresshealth 0.020s
ok github.com/carlosframework/platform/internal/ingresshealth/awstg 0.027s
ok github.com/carlosframework/platform/internal/instancectl 54.880s
ok github.com/carlosframework/platform/internal/instanceexec 8.388s
ok github.com/carlosframework/platform/internal/instancefs 0.035s
ok github.com/carlosframework/platform/internal/instancekey 0.012s
ok github.com/carlosframework/platform/internal/instanceupdates 0.022s
ok github.com/carlosframework/platform/internal/interactive 0.729s
ok github.com/carlosframework/platform/internal/launchd 0.010s
ok github.com/carlosframework/platform/internal/layout 26.005s
ok github.com/carlosframework/platform/internal/layout/pubclass 98.869s
ok github.com/carlosframework/platform/internal/lbhealth 0.013s
ok github.com/carlosframework/platform/internal/lease 145.795s
ok github.com/carlosframework/platform/internal/lease/leasetest 1.764s
ok github.com/carlosframework/platform/internal/lease/locktest 0.026s
ok github.com/carlosframework/platform/internal/ledger 0.073s
ok github.com/carlosframework/platform/internal/mail 1.033s
ok github.com/carlosframework/platform/internal/mailer 0.898s
ok github.com/carlosframework/platform/internal/mailsubmit 1.279s
ok github.com/carlosframework/platform/internal/mailwire 0.007s
ok github.com/carlosframework/platform/internal/maintenance 0.188s
ok github.com/carlosframework/platform/internal/maintenanceexec 8.774s
ok github.com/carlosframework/platform/internal/maintenanceguard 0.338s
ok github.com/carlosframework/platform/internal/media 1.985s
ok github.com/carlosframework/platform/internal/media/mediatest 0.008s
ok github.com/carlosframework/platform/internal/mediaaws 61.097s
ok github.com/carlosframework/platform/internal/mediahandler 42.890s
ok github.com/carlosframework/platform/internal/mediajobs 1.056s
ok github.com/carlosframework/platform/internal/medialocal 10.586s
ok github.com/carlosframework/platform/internal/metrics 0.074s
ok github.com/carlosframework/platform/internal/minorunits 0.017s
ok github.com/carlosframework/platform/internal/moves 55.722s
ok github.com/carlosframework/platform/internal/moves/archive 2.567s
ok github.com/carlosframework/platform/internal/moves/offlinerun 0.107s
ok github.com/carlosframework/platform/internal/namedunits 0.037s
ok github.com/carlosframework/platform/internal/objstore 1.832s
ok github.com/carlosframework/platform/internal/ops 16.896s
ok github.com/carlosframework/platform/internal/pageindex 4.059s
ok github.com/carlosframework/platform/internal/parity 0.153s
? github.com/carlosframework/platform/internal/parity/cmd/parity-doc [no test files]
ok github.com/carlosframework/platform/internal/park 0.645s
ok github.com/carlosframework/platform/internal/perf 0.190s
ok github.com/carlosframework/platform/internal/plans 0.085s
ok github.com/carlosframework/platform/internal/privatefile 0.018s
ok github.com/carlosframework/platform/internal/provision 237.577s
ok github.com/carlosframework/platform/internal/proxyproto 0.952s
ok github.com/carlosframework/platform/internal/publicrelease 0.047s
ok github.com/carlosframework/platform/internal/ratelimit 0.291s
ok github.com/carlosframework/platform/internal/regionlabel 0.043s
ok github.com/carlosframework/platform/internal/regionname 0.027s
ok github.com/carlosframework/platform/internal/registrar 0.015s
ok github.com/carlosframework/platform/internal/registrar/openprovider 0.620s
? github.com/carlosframework/platform/internal/registrar/registrartest [no test files]
ok github.com/carlosframework/platform/internal/registry 85.653s
ok github.com/carlosframework/platform/internal/relay 7.692s
ok github.com/carlosframework/platform/internal/release 86.531s
ok github.com/carlosframework/platform/internal/replicagen 0.046s
ok github.com/carlosframework/platform/internal/replicas 0.110s
ok github.com/carlosframework/platform/internal/reqrec 7.884s
ok github.com/carlosframework/platform/internal/rollout 12.421s
ok github.com/carlosframework/platform/internal/rolloutwords 0.021s
ok github.com/carlosframework/platform/internal/rootaws 101.089s
ok github.com/carlosframework/platform/internal/rootfsimage 0.635s
ok github.com/carlosframework/platform/internal/rootparticipation 0.086s
ok github.com/carlosframework/platform/internal/rootstate 0.063s
ok github.com/carlosframework/platform/internal/runs 1.028s
ok github.com/carlosframework/platform/internal/s3compat 0.035s
ok github.com/carlosframework/platform/internal/s3fake 1.532s
ok github.com/carlosframework/platform/internal/safefile 0.039s
ok github.com/carlosframework/platform/internal/schedule 26.801s
ok github.com/carlosframework/platform/internal/seeds 0.085s
ok github.com/carlosframework/platform/internal/sim/litestreamfacts 5.182s
ok github.com/carlosframework/platform/internal/sim/mediajobs 46.929s
ok github.com/carlosframework/platform/internal/sim/regionha 22.755s
ok github.com/carlosframework/platform/internal/status 0.655s
ok github.com/carlosframework/platform/internal/steering 0.265s
ok github.com/carlosframework/platform/internal/stopevidence 0.657s
ok github.com/carlosframework/platform/internal/storecfg 0.428s
ok github.com/carlosframework/platform/internal/svcrole 0.019s
ok github.com/carlosframework/platform/internal/systemd 6.556s
? github.com/carlosframework/platform/internal/systemdshow [no test files]
ok github.com/carlosframework/platform/internal/team 3.600s
ok github.com/carlosframework/platform/internal/teamcontract 0.223s
ok github.com/carlosframework/platform/internal/telemetry 0.043s
ok github.com/carlosframework/platform/internal/termfence 3.928s
ok github.com/carlosframework/platform/internal/timerspec 0.066s
ok github.com/carlosframework/platform/internal/tsidentity 4.219s
ok github.com/carlosframework/platform/internal/tunnelclient 0.403s
ok github.com/carlosframework/platform/internal/unixdial 0.012s
ok github.com/carlosframework/platform/internal/updatewords 0.044s
ok github.com/carlosframework/platform/internal/upstreamguard 0.017s
? github.com/carlosframework/platform/internal/upstreamguard/guardtest [no test files]
ok github.com/carlosframework/platform/internal/usage 0.040s
ok github.com/carlosframework/platform/internal/version 0.020s
ok github.com/carlosframework/platform/internal/vet 3.102s
ok github.com/carlosframework/platform/internal/zonehost 0.029s
ok github.com/carlosframework/platform/internal/zonehost/route53zones 0.066s
? 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.022s
ok github.com/carlosframework/platform/scripts/pathmapcheck 0.101s
ok github.com/carlosframework/platform/scripts/region-ha-g2/fixture 5.223s
ok github.com/carlosframework/platform/scripts/stateless-replicas-drill 1.208s
ok github.com/carlosframework/platform/scripts/witness-pointer 0.016s
=== cutover-witness (158 s, from +15 s)
ok github.com/carlosframework/platform 1.694s
=== internal_grouproll@0 (275 s, from +74 s)
ok github.com/carlosframework/platform/internal/grouproll 273.580s
=== internal_grouproll@1 (280 s, from +74 s)
ok github.com/carlosframework/platform/internal/grouproll 278.749s
=== internal_activator@0 (158 s, from +145 s)
ok github.com/carlosframework/platform/internal/activator 152.941s
=== internal_activator@1 (134 s, from +145 s)
ok github.com/carlosframework/platform/internal/activator 128.538s
=== internal_activator@2 (138 s, from +145 s)
ok github.com/carlosframework/platform/internal/activator 133.201s
=== internal_activator@3 (169 s, from +145 s)
ok github.com/carlosframework/platform/internal/activator 163.799s
=== internal_edge@0 (193 s, from +172 s)
ok github.com/carlosframework/platform/internal/edge 184.484s
=== internal_edge@1 (141 s, from +172 s)
ok github.com/carlosframework/platform/internal/edge 133.606s
=== internal_edge@2 (170 s, from +172 s)
ok github.com/carlosframework/platform/internal/edge 161.977s
=== internal_edge@3 (208 s, from +172 s)
ok github.com/carlosframework/platform/internal/edge 199.590s
=== root@0 (114 s, from +174 s)
ok github.com/carlosframework/platform 104.231s
=== root@1 (111 s, from +174 s)
ok github.com/carlosframework/platform 101.613s
=== root@2 (125 s, from +174 s)
ok github.com/carlosframework/platform 115.869s
=== root@3 (112 s, from +174 s)
ok github.com/carlosframework/platform 101.168s
=== root@4 (117 s, from +174 s)
ok github.com/carlosframework/platform 107.793s
=== internal_host@0 (144 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 138.685s
=== internal_host@1 (143 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 137.900s
=== internal_host@2 (200 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 194.701s
=== internal_host@3 (253 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 247.829s
=== internal_host@4 (148 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 142.848s
=== internal_host@5 (273 s, from +213 s)
ok github.com/carlosframework/platform/internal/host 267.941s
=== internal_console@0 (151 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 144.433s
=== internal_console@1 (174 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 165.923s
=== internal_console@2 (210 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 203.099s
=== internal_console@3 (239 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 232.059s
=== internal_console@4 (194 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 186.978s
=== internal_console@5 (210 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 202.552s
=== internal_console@6 (208 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 199.588s
=== internal_console@7 (209 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 201.936s
=== internal_console@8 (211 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 203.498s
=== internal_console@9 (211 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 203.747s
=== internal_console@10 (225 s, from +219 s)
ok github.com/carlosframework/platform/internal/console 217.272s
=== internal_console@11 (236 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 229.118s
=== internal_console@12 (281 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 275.067s
=== internal_console@13 (258 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 251.402s
=== internal_console@14 (230 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 223.165s
=== internal_console@15 (214 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 207.568s
=== internal_console@16 (232 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 226.437s
=== internal_console@17 (204 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 197.115s
=== internal_console@18 (210 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 203.466s
=== internal_console@19 (204 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 197.068s
=== internal_console@20 (208 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 201.870s
=== internal_console@21 (220 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 213.267s
=== internal_console@22 (211 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 205.070s
=== internal_console@23 (248 s, from +220 s)
ok github.com/carlosframework/platform/internal/console 240.833s
=== lists: internal_console 219 s, internal_edge 171 s, internal_activator 144 s, internal_host 212 s, root 173 s, internal_grouproll 73 s
=== cpu: the gate used 12626 cpu-seconds in 501 s, about 25.2 of 32 cores; the machine as a whole was 84% busy
=== opentofu ===
opentofu: 36 test files in 11 suites, OpenTofu v1.13.9
initialised in 15 s
ok 16 s infra/modules/box-fence-writer/tests/writer.tftest.hcl Success! 1 passed, 0 failed.
ok 31 s infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl Success! 3 passed, 0 failed.
ok 19 s infra/modules/deployment-buckets/tests/db_reads.tftest.hcl Success! 1 passed, 0 failed.
ok 15 s infra/modules/deployment-buckets/tests/evidence.tftest.hcl Success! 1 passed, 0 failed.
ok 29 s infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl Success! 3 passed, 0 failed.
ok 83 s infra/modules/media-engine/tests/media_engine.tftest.hcl Success! 24 passed, 0 failed.
ok 33 s infra/modules/pdf-host/tests/computed.tftest.hcl Success! 2 passed, 0 failed.
ok 70 s infra/modules/pdf-host/tests/pdf_host.tftest.hcl Success! 24 passed, 0 failed.
ok 44 s infra/modules/region-group-operator-document/tests/document.tftest.hcl Success! 12 passed, 0 failed.
ok 23 s infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl Success! 2 passed, 0 failed.
ok 64 s infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl Success! 30 passed, 0 failed.
ok 43 s infra/modules/region-host/tests/alert_publish.tftest.hcl Success! 18 passed, 0 failed.
ok 40 s infra/modules/region-host/tests/alerts_topic.tftest.hcl Success! 16 passed, 0 failed.
ok 12 s infra/modules/region-host/tests/analytics_prune.tftest.hcl Success! 2 passed, 0 failed.
ok 16 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 66 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 34 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 26 s infra/modules/region-host/tests/health_alarms.tftest.hcl Success! 10 passed, 0 failed.
ok 9 s infra/modules/region-host/tests/ingress_drain_read.tftest.hcl Success! 4 passed, 0 failed.
ok 4 s infra/modules/region-host/tests/instance_metadata.tftest.hcl Success! 1 passed, 0 failed.
ok 21 s infra/modules/region-host/tests/mailer.tftest.hcl Success! 6 passed, 0 failed.
ok 9 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 74 s infra/modules/region-host/tests/store_conversion.tftest.hcl Success! 27 passed, 0 failed.
ok 18 s infra/modules/region-host/tests/store_scanning.tftest.hcl Success! 4 passed, 0 failed.
ok 33 s infra/modules/region-host/tests/store_versioning.tftest.hcl Success! 11 passed, 0 failed.
ok 17 s infra/modules/region-host/tests/user_data_ignored.tftest.hcl Success! 3 passed, 0 failed.
ok 10 s infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl Success! 3 passed, 0 failed.
ok 15 s infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl Success! 5 passed, 0 failed.
ok 29 s infra/modules/scanner-host/tests/scanner_host.tftest.hcl Success! 14 passed, 0 failed.
opentofu: 36 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: 65929378 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:35883
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.02s)
--- PASS: TestDeliveredContractMinio/put (0.00s)
--- PASS: TestDeliveredContractMinio/get_round-trips_the_body (0.00s)
--- PASS: TestDeliveredContractMinio/list_shows_the_key (0.00s)
--- PASS: TestDeliveredContractMinio/head_and_list_agree_on_the_version (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/not_by_PutObjectTagging (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_its_own_object/and_not_by_x-amz-tagging_on_upload (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route (0.01s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CreateMultipartUpload (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/not_by_CopyObject_with_a_REPLACE_tagging_directive (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/but_multipart_itself_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_copy_itself_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/a_POST-policy_forged_tag_with_a_matching_version_is_still_not_a_verdict (0.00s)
--- PASS: TestDeliveredContractMinio/the_app_cannot_tag_by_any_other_route/and_an_ordinary_tagged-with-something-else_upload_is_allowed (0.00s)
--- PASS: TestDeliveredContractMinio/delete_removes_it (0.00s)
--- PASS: TestDeliveredContractMinio/cross-bucket_denial (0.00s)
PASS
ok github.com/carlosframework/platform/internal/objstore 0.036s
=== RUN TestT4StorageProbeMinio
2026/11/24 21:40:04 moves: T4: STORE: list: operation error S3: ListObjectsV2, https response error StatusCode: 403, RequestID: 18EB19096EF2585E, HostID: fe22d8ac77ac41e8d5d9f1ae81d3e6c3bfc325403f29fc65c015fc260016f9a7, api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
--- PASS: TestT4StorageProbeMinio (0.01s)
PASS
ok github.com/carlosframework/platform/internal/host 0.045s
=== RUN TestS3StoreMinioContract
=== RUN TestS3StoreMinioContract/conditional_get_and_etag_listing
=== RUN TestS3StoreMinioContract/bump_through_every_mutation_path
--- PASS: TestS3StoreMinioContract (0.04s)
--- PASS: TestS3StoreMinioContract/conditional_get_and_etag_listing (0.01s)
--- PASS: TestS3StoreMinioContract/bump_through_every_mutation_path (0.02s)
PASS
ok github.com/carlosframework/platform/internal/release 0.042s
Bucket created successfully `local/analytics-versions`.
local/analytics-versions versioning is enabled
Created policy `analytics-versions` successfully.
Added user `analyticsversions` successfully.
Attached Policies: [analytics-versions]
To User: analyticsversions
=== RUN TestS3StoreMinioVersions
--- PASS: TestS3StoreMinioVersions (0.03s)
PASS
ok github.com/carlosframework/platform/internal/release 0.040s
Bucket created successfully `local/store-versioned`.
local/store-versioned versioning is enabled
Created policy `store-versioned` successfully.
Added user `storeversioned` successfully.
Attached Policies: [store-versioned]
To User: storeversioned
=== RUN TestVersionedContractMinio
--- PASS: TestVersionedContractMinio (0.01s)
PASS
ok github.com/carlosframework/platform/internal/objstore 0.020s
=== RUN TestEndToEndMinio
=== RUN TestEndToEndMinio/plan
=== RUN TestEndToEndMinio/roll
=== RUN TestEndToEndMinio/replace
=== RUN TestEndToEndMinio/remove
--- PASS: TestEndToEndMinio (0.47s)
--- PASS: TestEndToEndMinio/plan (0.01s)
--- PASS: TestEndToEndMinio/roll (0.12s)
--- PASS: TestEndToEndMinio/replace (0.15s)
--- PASS: TestEndToEndMinio/remove (0.15s)
PASS
ok github.com/carlosframework/platform/internal/grouproll 0.473s
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/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/24 21:40:11 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000002
2026/11/24 21:40:11 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000002 maxTXID=0000000000000002 size=370
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000002
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000002 txid.db=0000000000000003
2026/11/24 21:40:11 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000003 maxTXID=0000000000000003 size=454
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000003 txid.db=0000000000000003
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000000 txid.db=0000000000000001
2026/11/24 21:40:11 INFO ltx file uploaded system=store db=source.db replica=file level=0 minTXID=0000000000000001 maxTXID=0000000000000001 size=720
2026/11/24 21:40:11 INFO replica sync system=store db=source.db replica=file txid.replica=0000000000000001 txid.db=0000000000000001
2026/11/24 21:40:12 console: CARLOS_SECRETS_PUBKEY is unset, so no region outside the home can be chosen automatically
2026/11/24 21:40:12 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%3A38667: could not determine target mailbox
agent.go:136: dbreads: dbr_l67x3tg55hz6gun725vfvmgxba: planned 3 files (1544 bytes) and restored to 3 in 13ms
agent.go:136: dbreads: dbr_l67x3tg55hz6gun725vfvmgxba: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/24 21:40:13 console: db read dbr_l67x3tg55hz6gun725vfvmgxba: relayed 1 chunks (102 bytes) in 1.005s, ended done
agent.go:136: dbreads: dbr_n6ivwjqp2knqb5igr6z2wuvszi: planned 1 files (720 bytes) and restored to 1 in 11ms
agent.go:136: dbreads: dbr_n6ivwjqp2knqb5igr6z2wuvszi: output 5 bytes in 1 confirmed chunks in 2ms
2026/11/24 21:40:14 console: db read dbr_n6ivwjqp2knqb5igr6z2wuvszi: relayed 1 chunks (102 bytes) in 1.005s, ended done
agent.go:136: dbreads: dbr_ve6ccyrcfrb3avcx7hn2q26zye: planned 3 files (1544 bytes) and held through 3 in 12ms
agent.go:136: dbreads: dbr_ve6ccyrcfrb3avcx7hn2q26zye: output 1544 bytes in 1 confirmed chunks in 1ms
2026/11/24 21:40:15 console: db read dbr_ve6ccyrcfrb3avcx7hn2q26zye: relayed 1 chunks (1641 bytes) in 1.005s, ended done
=== RUN TestDBForwardMinio/by_disconnect
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_vmztztwxzuhopxzxdk7bkq3vdy: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/24 21:40:15 console: db read dbr_vmztztwxzuhopxzxdk7bkq3vdy: relayed 0 chunks (0 bytes) in 36ms, ended client gone
agent.go:136: dbreads: dbr_vmztztwxzuhopxzxdk7bkq3vdy: output 5 bytes in 1 confirmed chunks in 104ms
=== RUN TestDBForwardMinio/by_timeout
=== NAME TestDBForwardMinio
agent.go:136: dbreads: dbr_s2lfo6cboftjaiib4imhs3cpqq: planned 3 files (1544 bytes) and restored to 3 in 13ms
2026/11/24 21:40:35 console: db read dbr_s2lfo6cboftjaiib4imhs3cpqq: relayed 0 chunks (0 bytes) in 19.543s, ended no-result
agent.go:136: dbreads: dbr_s2lfo6cboftjaiib4imhs3cpqq: output 5 bytes in 1 confirmed chunks in 19.517s
--- PASS: TestDBForwardMinio (23.22s)
--- PASS: TestDBForwardMinio/by_disconnect (0.25s)
--- PASS: TestDBForwardMinio/by_timeout (19.66s)
PASS
ok github.com/carlosframework/platform/internal/console 23.265s
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.05s)
PASS
ok github.com/carlosframework/platform/internal/mediaaws 0.059s
Bucket created successfully `local/media-local-store`.
Bucket created successfully `local/media-local-results`.
Created policy `media-local` successfully.
Added user `medialocal` successfully.
Attached Policies: [media-local]
To User: medialocal
=== RUN TestLocalEndToEndMinio
--- PASS: TestLocalEndToEndMinio (0.55s)
PASS
ok github.com/carlosframework/platform/internal/medialocal 0.551s
=== RUN TestHeldHandoverTwoBoxMinio
2026/11/24 21:40:39 edge: mesh key: minted
2026/11/24 21:40:40 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/24 21:40:40 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/24 21:40:40 tenant admission is open. accepting tenant work
2026/11/24 21:40:40 activator: HA placement host=shop-1e1a08c5.example.test kind=Place ref=annie reason=roomiest generation=2026-11-24T21:40:40Z lock_generation=0
2026/11/24 21:40:40 lease: t8-1e1a08c5/shop-1e1a08c5.example.test: HA lease acquired in 4ms (first wake)
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: started carlos-instance@shop\x2d1e1a08c5.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 0s, instance key 0s, env 6ms, control socket 0s, key gate 0s, logs 0s) 6ms, launch file 0s, gate 0s, root start 1ms)
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: carlos-instance@shop\x2d1e1a08c5.example.test.service launched in 7ms, healthy 0s later
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: woke in 21ms: checks 0s, lease 5ms, restore 0s, identity 0s, protect 0s, spawn 8ms, replicate 9ms
2026/11/24 21:40:40 lease: t8-1e1a08c5/plain-1e1a08c5.example.test: acquired in 1ms (client 0s, lock read and write 1ms)
2026/11/24 21:40:40 activator: no replica for plain-1e1a08c5.example.test in s3://contract-bucket/t8-1e1a08c5/plain-1e1a08c5.example.test — booting fresh
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test: started carlos-instance@plain\x2d1e1a08c5.example.test.service memory.max=536870912 (build 0s, prepare (dirs 0s, admin token 1ms, instance key 0s, env 4ms, control socket 0s, key gate 0s, logs 0s) 5ms, launch file 0s, gate 0s, root start 1ms)
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test: carlos-instance@plain\x2d1e1a08c5.example.test.service launched in 6ms, healthy 0s later
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test: woke in 44ms: checks 0s, lease 1ms, restore 17ms, identity 0s, protect 0s, spawn 6ms, replicate 19ms
2026/11/24 21:40:40 lease: t8-1e1a08c5/bot0.shop.bac.sidecar.internal: HA lease acquired in 3ms (first wake)
2026/11/24 21:40:40 activator: bot0.shop.bac.sidecar.internal: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/24 21:40:40 activator: bot0.shop.bac.sidecar.internal: woke in 68ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 6ms, settle 0s, replicate 56ms
2026/11/24 21:40:40 activator: next-due probe plain-1e1a08c5.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test hibernated
2026/11/24 21:40:40 activator: next-due probe shop-1e1a08c5.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/24 21:40:40 activator: bot0.shop.bac.sidecar.internal: released with a marker (clean true, txid 1, files 3:2d58ada0e4e0e11c1f77b1f607afcc4cdbd471e89c6bad8c2e458befb372c9d8) in 6ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/24 21:40:40 activator: bot0.shop.bac.sidecar.internal hibernated
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: released with a marker (clean true, txid 1, files 3:f5aadee1e5576474d0dbf2bbd95a10e3c6dec74144be4b17dcd0c96b79b6a7be) in 5ms: files 1ms, sync 2ms, record 1ms, marker 2ms
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test hibernated
2026/11/24 21:40:40 lease: t8-1e1a08c5/shop-1e1a08c5.example.test: HA lease acquired in 3ms (clean marker)
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: restored (other-box)
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: started carlos-instance@shop\x2d1e1a08c5.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/24 21:40:40 activator: shop-1e1a08c5.example.test: carlos-instance@shop\x2d1e1a08c5.example.test.service launched in 2ms, healthy 0s later
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: woke in 38ms: checks 0s, lease 3ms, restore 26ms, identity 0s, protect 0s, spawn 2ms, replicate 7ms
2026/11/24 21:40:40 edge: ha-take shop-1e1a08c5.example.test from annie (txn t8-witness, marker generation 1): holder betty, generation 2
2026/11/24 21:40:40 edge: forward shop-1e1a08c5.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:aaebba5aead1b8cb982bd724f5af7aff Step:move Result:ok Reasons:[] Fence:t8-witness StartedAt:2026-11-24 21:40:40.339632365 +0000 UTC FinishedAt:2026-11-24 21:40:40.437119642 +0000 UTC Acked:[betty carol] Departed:[] Moved:[{Host:shop-1e1a08c5.example.test Holder:betty Gen:2 Confirmed:take}] Released:[{Host:plain-1e1a08c5.example.test Kind:other Marker:true Clean:true Reason:} {Host:bot0.shop.bac.sidecar.internal Kind:worker Marker:true Clean:true Reason:}] Unclean:[] Left:[] Holds:{LongestMS:69 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-1e1a08c5.example.test <nil> stop plain-1e1a08c5.example.test marker=true clean=true <nil> releasing shop-1e1a08c5.example.test <nil> stop bot0.shop.bac.sidecar.internal marker=true clean=true <nil> stop shop-1e1a08c5.example.test marker=true clean=true <nil> taken shop-1e1a08c5.example.test betty <nil> end-moves]
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: DELETE /contract-bucket/t8-1e1a08c5/plain-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/bot0.shop.bac.sidecar.internal/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/bot0.shop.bac.sidecar.internal/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/head.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/generations/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0008/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0007/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0006/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0005/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0004/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/0009/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/files/0/manifest.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/files/0/objects/0000000000000001-592dca354bb158e9a926bdd025c8e57785883ead6dfb60e91004f86364656ac6
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/files/0/objects/0000000000000003-5eca7e090ba67e6da804a3bd42f85dc305d8afd08c11e123852a89a6abb2b1f1
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/0000/0000000000000001-0000000000000001.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0009/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/0000/0000000000000002-0000000000000002.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0002/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0003/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: GET /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/lock.json
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: PUT /contract-bucket/t8-1e1a08c5/shop-1e1a08c5.example.test/0001/0000000000000001-0000000000000002.ltx
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0001/
hadrain_twobox_minio_linux_test.go:1241: S3 during the drain: LIST /contract-bucket?t8-1e1a08c5/shop-1e1a08c5.example.test/0000/
hadrain_twobox_minio_linux_test.go:1243: drain took 145ms; S3 calls 50 (DELETE lock=1 GET files=3 GET head=1 GET lock=3 GET replica=2 LIST replica=33 PUT lock=3 PUT replica=4); deployment store calls 20 (GET edges=14 LIST edges=4 PUT edges=2)
hadrain_twobox_minio_linux_test.go:1367: the fenced A's start gate answers 503 "This service is unavailable. Try again later.\n" (Retry-After "10")
2026/11/24 21:40:40 lease: t8-1e1a08c5/plain-1e1a08c5.example.test: acquired in 1ms (client 0s, lock read and write 1ms)
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test: started carlos-instance@plain\x2d1e1a08c5.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/24 21:40:40 activator: plain-1e1a08c5.example.test: carlos-instance@plain\x2d1e1a08c5.example.test.service launched in 1ms, healthy 0s later
2026/11/24 21:40:40 lease: /tmp/carlos-minio-contract-76VBUg/g/dw241669254/data/instances/plain-1e1a08c5.example.test/plain-1e1a08c5.example.test.db: continuity with the last clean close not proven; snapshot 1-0000000000000001 written before serving
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test: woke in 10ms: checks 0s, lease 2ms, restore 0s, identity 0s, protect 1ms, spawn 1ms, replicate 6ms
2026/11/24 21:40:40 activator: next-due probe shop-1e1a08c5.example.test: decode /api/next-due: invalid character 'b' looking for beginning of value — recording none (it sleeps until a request)
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test: released with a marker (clean true, txid 2, files 3:f5aadee1e5576474d0dbf2bbd95a10e3c6dec74144be4b17dcd0c96b79b6a7be) in 4ms: files 1ms, sync 0s, record 1ms, marker 2ms
2026/11/24 21:40:40 activator: shop-1e1a08c5.example.test hibernated
2026/11/24 21:40:40 tenant admission is closed for shutdown
2026/11/24 21:40:40 activator: next-due probe plain-1e1a08c5.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/24 21:40:40 activator: plain-1e1a08c5.example.test hibernated
--- PASS: TestHeldHandoverTwoBoxMinio (0.52s)
=== RUN TestHeldHandoverLostLeaseMinio
2026/11/24 21:40:40 edge: mesh key: minted
2026/11/24 21:40:40 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/24 21:40:40 provision: minted sidecar route bot0.shop.bac.sidecar.internal (app "shop" acct "bac" args ["work"])
2026/11/24 21:40:40 tenant admission is open. accepting tenant work
2026/11/24 21:40:40 activator: HA placement host=shop-78828b89.example.test kind=Place ref=annie reason=roomiest generation=2026-11-24T21:40:40Z lock_generation=0
2026/11/24 21:40:40 lease: t8-78828b89/shop-78828b89.example.test: HA lease acquired in 3ms (first wake)
2026/11/24 21:40:40 activator: shop-78828b89.example.test: restored (no-marker): first wake, the prefix proven empty, booting fresh
2026/11/24 21:40:40 activator: shop-78828b89.example.test: started carlos-instance@shop\x2d78828b89.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/24 21:40:40 activator: shop-78828b89.example.test: carlos-instance@shop\x2d78828b89.example.test.service launched in 7ms, healthy 0s later
2026/11/24 21:40:40 activator: shop-78828b89.example.test: woke in 68ms: checks 0s, lease 4ms, restore 0s, identity 0s, protect 0s, spawn 7ms, replicate 57ms
2026/11/24 21:40:40 activator: next-due probe shop-78828b89.example.test: decode /api/next-due: invalid character 'a' looking for beginning of value — recording none (it sleeps until a request)
2026/11/24 21:40:40 activator: final checkpoint shop-78828b89.example.test: lease: release marker owed for s3://contract-bucket/t8-78828b89/shop-78828b89.example.test/lock.json (If-Match "e9a43cfef90348bc7fb3f23b613bbd17"): lease: write release marker: operation error S3: PutObject, https response error StatusCode: 503, RequestID: , HostID: , api error ServiceUnavailable: witness: refused
2026/11/24 21:40:40 activator: shop-78828b89.example.test hibernated
2026/11/24 21:40:40 activator: handover of shop-78828b89.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-78828b89.example.test client 4 "
hadrain_twobox_minio_linux_test.go:1486: driver calls: [begin shop-78828b89.example.test <nil> releasing shop-78828b89.example.test <nil> stop shop-78828b89.example.test marker=false clean=false <nil> left shop-78828b89.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/24 21:40:40 tenant admission is closed for shutdown
2026/11/24 21:40:40 http: proxy error: context canceled
--- PASS: TestHeldHandoverLostLeaseMinio (0.32s)
PASS
ok github.com/carlosframework/platform/internal/host 0.881s
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/24 21:40:42 lease: instances/gen-1795556442006588957.shop.example.com: HA lease acquired in 5ms (first wake)
2026/11/24 21:40:42 lease: instances/gen-1795556442006588957.shop.example.com: HA lease acquired in 3ms (holder terminated)
gentake_minio_test.go:308: a second create-only copy onto instances/gen-1795556442006588957.shop.example.com/g-00000000000000000002/0000/0000000000000001-0000000000000001.ltx: <nil> (destination condition honoured: false)
2026/11/24 21:40:42 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/24 21:40:42 http: proxy error: context canceled
2026/11/24 21:40:42 ERROR retention enforcement failed system=store db=w.example.com.db error="enforce snapshot retention: remove ltx files: lease: a write has waited too long to reach storage (write fence)"
2026/11/24 21:40:42 http: proxy error: context canceled
=== RUN TestGenerationTakeMinio/switch-412
2026/11/24 21:40:42 lease: instances/gen-1795556442128709664.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/24 21:40:42 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/24 21:40:42 lease: instances/gen-1795556442128709664.shop.example.com: HA lease acquired in 3ms (clean marker)
=== RUN TestGenerationTakeMinio/copy-version
=== RUN TestGenerationTakeMinio/store-time
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 3ms (first wake)
2026/11/24 21:40:42 ERROR retention enforcement failed system=store db=seed.db error="enforce snapshot retention: remove ltx files: lease: invalid or changed generation binding"
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 3ms (clean marker)
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 2ms (unclean marker)
2026/11/24 21:40:42 lease: instances/gen-1795556442228983010.shop.example.com: HA lease acquired in 2ms (unclean marker)
=== RUN TestGenerationTakeMinio/skew
--- PASS: TestGenerationTakeMinio (0.38s)
--- PASS: TestGenerationTakeMinio/take (0.12s)
--- PASS: TestGenerationTakeMinio/switch-412 (0.09s)
--- PASS: TestGenerationTakeMinio/copy-version (0.01s)
--- PASS: TestGenerationTakeMinio/store-time (0.15s)
--- PASS: TestGenerationTakeMinio/skew (0.01s)
PASS
ok github.com/carlosframework/platform/internal/lease 0.394s
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 1m47.001s
codehealth_test.go:107: line metrics (code lines, then physical):
file-lines 5471 7324 internal/activator activator_test.go
file-lines 4223 7052 internal/console server.go
file-lines 4175 6358 . apimode.go
file-lines 3785 7224 internal/activator activator.go
file-lines 3530 4459 . apimode_test.go
file-lines 3261 3864 internal/registry registry_test.go
file-lines 3188 6348 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 689 1238 internal/host runAgent
func-lines 571 908 internal/activator (*Service).doWakeOnce
func-lines 538 546 internal/host runServingParkPeerNamespace
func-lines 519 712 . runRoute
func-lines 509 569 internal/host TestPagingIsRateLimited
func-lines 494 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 402 406 internal/registry (*Registry).haJournal
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 636 cmd/console serve
func-lines 364 371 internal/host testRootMigrationBootstrap
func-lines 360 362 internal/edge TestDemoAPIAliasBoundary
func-lines 357 358 internal/registry (*Registry).dispatchRemote
func-lines 355 372 internal/host TestRootSandboxUpdateFromOldBox
func-lines 343 354 internal/analytics Prune
func-lines 340 353 internal/host newColdRootHarness
func-lines 335 557 internal/console (*Store).migrate
func-lines 334 334 internal/host TestPlan12RecoveryRestoreSourceDatabase
func-lines 330 371 internal/edge TestRegionalNameNeverLeavesItsRegion
func-lines 329 471 . runDeploy
func-lines 329 329 internal/host TestPlan12RecoveryRestoreSourceDatabase.func1
func-lines 327 369 internal/edge TestTunnelWebSocketEndToEnd
func-lines 325 455 internal/objstore TestDeliveredContractMinio
func-lines 320 654 internal/appconfig SyncExecWithCallbacks
func-lines 315 318 internal/host plan14TimerIntention
func-lines 311 314 internal/host plan14TimerIntention.func1
func-lines 310 315 internal/hostbox ColdHandover.Run
func-lines 308 309 internal/host rootFilesSeedIsolatedWitness
func-lines 305 323 internal/host hairpinKernelWitness
func-lines 304 308 internal/console TestHAP2ProductionDoors
func-lines 302 329 internal/host TestRootG2PoolIngress
release-importers: . cmd/console internal/activator internal/analytics internal/appconfig internal/apperr internal/applog internal/apppolicy internal/boxid internal/boxvolumes internal/console internal/dbreads internal/dbreads/dbreadstest internal/dbverify internal/demobuild internal/domains internal/doorkey internal/edge internal/edgeproof internal/edgesfile internal/fleetapi internal/grouproll internal/grouprollaws internal/historyreadback internal/host internal/hostactors internal/hostbox internal/hostclaim internal/hostevidence internal/hostexec internal/hostfence internal/hostfiles internal/hostfloor internal/hostguard internal/hostops internal/hostrelocate internal/hostresolve internal/instancectl internal/instanceupdates internal/interactive internal/layout internal/lease internal/ledger internal/mail internal/mailer internal/mailsubmit internal/metrics internal/moves internal/objstore internal/ops internal/park internal/plans internal/provision internal/relay internal/rollout internal/rootfsimage internal/runs internal/s3fake internal/schedule internal/seeds internal/status internal/telemetry internal/usage internal/vet scripts/pathmapcheck scripts/witness-pointer
not scanned (211 files):
cmd/carlos-media/drill_other.go: built only for other systems or tags
cmd/carlos-media/harden_other.go: built only for other systems or tags
cmd/console/fleetsocket_other.go: built only for other systems or tags
cmd/console/servelock_windows.go: built only for other systems or tags
cmd/moveprobe/detach_windows.go: built only for other systems or tags
cmd/rootfswitness/mmap_other.go: built only for other systems or tags
devbox_acl_other.go: built only for other systems or tags
devbox_envfile_darwin_test.go: built only for other systems or tags
devbox_envfile_other.go: built only for other systems or tags
domains_transfer_signals_other.go: built only for other systems or tags
interactive_term_darwin.go: built only for other systems or tags
interactive_term_other.go: built only for other systems or tags
internal/activator/claimprocess_root_other.go: built only for other systems or tags
internal/activator/escrow_stamp_other.go: built only for other systems or tags
internal/activator/fleetreserve_other.go: built only for other systems or tags
internal/activator/harecord_other.go: built only for other systems or tags
internal/activator/ownenv_other.go: built only for other systems or tags
internal/activator/pty_other.go: built only for other systems or tags
internal/activator/race_on_test.go: built only for other systems or tags
internal/activator/rolelaunch_other.go: built only for other systems or tags
internal/assetcache/statfs_other.go: built only for other systems or tags
internal/boxself/io_other.go: built only for other systems or tags
internal/cgroup/cleanup_other.go: built only for other systems or tags
internal/cgroup/cleanup_other_test.go: built only for other systems or tags
internal/cgroup/hostprocs_other.go: built only for other systems or tags
internal/cgroup/recreate_other.go: built only for other systems or tags
internal/cgroup/role_other.go: built only for other systems or tags
internal/cgroup/shim_other.go: built only for other systems or tags
internal/cgroup/strict_other.go: built only for other systems or tags
internal/cgroup/verify_other.go: built only for other systems or tags
internal/console/claim_sql_identity_other.go: built only for other systems or tags
internal/console/geoipverify_other.go: built only for other systems or tags
internal/console/hostreports_process_other.go: built only for other systems or tags
internal/console/replicaview_other.go: built only for other systems or tags
internal/console/restore_sim_nice_other_test.go: built only for other systems or tags
internal/console/scalecost_other_test.go: built only for other systems or tags
internal/console/seedscratch_windows.go: built only for other systems or tags
internal/dbreads/worker_other.go: built only for other systems or tags
internal/demobuild/security_other.go: built only for other systems or tags
internal/democlaim/source_other.go: built only for other systems or tags
internal/devbox/peer_darwin.go: built only for other systems or tags
internal/devbox/peer_darwin_test.go: built only for other systems or tags
internal/devbox/peer_other.go: built only for other systems or tags
internal/devbox/socketcheck_other.go: built only for other systems or tags
internal/edge/devboxpeer_other.go: built only for other systems or tags
internal/edge/hairpin_other.go: built only for other systems or tags
internal/edge/heldbudget_other.go: built only for other systems or tags
internal/edge/purge_listen_unix.go: built only for other systems or tags
internal/edge/purge_listen_windows.go: built only for other systems or tags
internal/edge/race_on_test.go: built only for other systems or tags
internal/edge/replicaconsole_owner_other.go: built only for other systems or tags
internal/edge/replicaconsole_peer_other.go: built only for other systems or tags
internal/edge/replicaconsole_socket_other_test.go: built only for other systems or tags
internal/edge/static_artifact_other.go: built only for other systems or tags
internal/edge/static_recordlock_other.go: built only for other systems or tags
internal/edge/static_sweep_other.go: built only for other systems or tags
internal/execsandbox/cleanup_other.go: built only for other systems or tags
internal/execsandbox/file_other.go: built only for other systems or tags
internal/execsandbox/oci_other.go: built only for other systems or tags
internal/fileacl/fileacl_darwin.go: built only for other systems or tags
internal/fileacl/fileacl_darwin_amd64.s: built only for other systems or tags
internal/fileacl/fileacl_darwin_arm64.s: built only for other systems or tags
internal/fileacl/fileacl_darwin_test.go: built only for other systems or tags
internal/grouproll/state_other.go: built only for other systems or tags
internal/grouprollaws/pty_darwin.go: built only for other systems or tags
internal/grouprollaws/pty_other.go: built only for other systems or tags
internal/hairpin/native_other.go: built only for other systems or tags
internal/host/applylock_other_test.go: built only for other systems or tags
internal/host/bootstrapfs_other.go: built only for other systems or tags
internal/host/boxroles_config_other.go: built only for other systems or tags
internal/host/claimfilesseed_delegation_other.go: built only for other systems or tags
internal/host/claimfilesseed_transport_other.go: built only for other systems or tags
internal/host/claimjournal_containment_other.go: built only for other systems or tags
internal/host/claimjournal_migration_other.go: built only for other systems or tags
internal/host/claimlaunch_kernel_other.go: built only for other systems or tags
internal/host/claimlaunch_rev2_other_test.go: built only for other systems or tags
internal/host/claimproduction_other.go: built only for other systems or tags
internal/host/claimready_other.go: built only for other systems or tags
internal/host/claimroleassembly_other.go: built only for other systems or tags
internal/host/claimservingartifact_other.go: built only for other systems or tags
internal/host/claimservinghandover_reboot_other.go: built only for other systems or tags
internal/host/claimservinghandover_reboot_other_test.go: built only for other systems or tags
internal/host/claimservingpark_other.go: built only for other systems or tags
internal/host/claimstate_other.go: built only for other systems or tags
internal/host/claimstop_kernel_other.go: built only for other systems or tags
internal/host/claimtoken_inventory_other.go: built only for other systems or tags
internal/host/claimunit_dropin_other.go: built only for other systems or tags
internal/host/claimunit_files_other.go: built only for other systems or tags
internal/host/claimunit_migrate_other.go: built only for other systems or tags
internal/host/claimunit_ready_other.go: built only for other systems or tags
internal/host/claimunit_socket_migration_other.go: built only for other systems or tags
internal/host/consolefleet_owner_other.go: built only for other systems or tags
internal/host/dbreads_other.go: built only for other systems or tags
internal/host/egress_rail_other.go: built only for other systems or tags
internal/host/fileowner_other.go: built only for other systems or tags
internal/host/flock_windows.go: built only for other systems or tags
internal/host/group_config_other.go: built only for other systems or tags
internal/host/group_maintenance_other.go: built only for other systems or tags
internal/host/group_maintenance_verbs_other.go: built only for other systems or tags
internal/host/group_receipt_other.go: built only for other systems or tags
internal/host/hadrain_call_other.go: built only for other systems or tags
internal/host/hadrain_socket_other.go: built only for other systems or tags
internal/host/hadrainfence_other.go: built only for other systems or tags
internal/host/headroom_other.go: built only for other systems or tags
internal/host/installchannel_other.go: built only for other systems or tags
internal/host/metrics_nested_other.go: built only for other systems or tags
internal/host/movesfloor_other.go: built only for other systems or tags
internal/host/movesfloorgate_other.go: built only for other systems or tags
internal/host/movesheldrelease_other.go: built only for other systems or tags
internal/host/movesmeasure_other.go: built only for other systems or tags
internal/host/offcloudcredentials_other.go: built only for other systems or tags
internal/host/registrychild_exec_other.go: built only for other systems or tags
internal/host/registrychild_other.go: built only for other systems or tags
internal/host/registryowner_chown_other.go: built only for other systems or tags
internal/host/registryowner_descriptor_unix.go: built only for other systems or tags
internal/host/replicahealth_other.go: built only for other systems or tags
internal/host/rootgeneration_census_other.go: built only for other systems or tags
internal/host/rootgeneration_kernel_other.go: built only for other systems or tags
internal/host/rootgeneration_payload_other.go: built only for other systems or tags
internal/host/rootgeneration_retired_other.go: built only for other systems or tags
internal/host/rootmigration_production_other.go: built only for other systems or tags
internal/host/runscset_other.go: built only for other systems or tags
internal/host/sandboxenv_other.go: built only for other systems or tags
internal/host/statfs_windows.go: built only for other systems or tags
internal/host/systemapply_other.go: built only for other systems or tags
internal/hostbox/census_vendor_other.go: built only for other systems or tags
internal/hostbox/inventory_identity_other.go: built only for other systems or tags
internal/hostbox/journalmigration_other.go: built only for other systems or tags
internal/hostbox/journalnamespace_other.go: built only for other systems or tags
internal/hostbox/journaltrust_other.go: built only for other systems or tags
internal/hostbox/migration_census_other.go: built only for other systems or tags
internal/hostbox/typedpark_other.go: built only for other systems or tags
internal/hostenv/group_other.go: built only for other systems or tags
internal/hostenv/write_other.go: built only for other systems or tags
internal/hostenv/write_other_test.go: built only for other systems or tags
internal/hostexec/clock_other.go: built only for other systems or tags
internal/hostexec/clock_other_test.go: built only for other systems or tags
internal/hostexec/local_other.go: built only for other systems or tags
internal/hostexec/pending_other.go: built only for other systems or tags
internal/hostexec/probe_other.go: built only for other systems or tags
internal/hostexec/rootprocess_other.go: built only for other systems or tags
internal/hostfiles/dir_other.go: built only for other systems or tags
internal/hostfiles/refuse_other.go: built only for other systems or tags
internal/hostfiles/watch_other.go: built only for other systems or tags
internal/hostfloor/controllers_other.go: built only for other systems or tags
internal/hostfloor/image_other.go: built only for other systems or tags
internal/hostguard/flock_other.go: built only for other systems or tags
internal/hostguard/flock_other_test.go: built only for other systems or tags
internal/hostguard/record_other.go: built only for other systems or tags
internal/instancectl/claimexec_other.go: built only for other systems or tags
internal/instancectl/claimexec_socket_other.go: built only for other systems or tags
internal/instancectl/claimlaunch_snapshot_other.go: built only for other systems or tags
internal/instancectl/claimnetwork_other.go: built only for other systems or tags
internal/instancectl/demo_snapshot_other.go: built only for other systems or tags
internal/instancectl/egress_cgroup_other.go: built only for other systems or tags
internal/instancectl/egress_dropin_other.go: built only for other systems or tags
internal/instancectl/fleetsize_other.go: built only for other systems or tags
internal/instancectl/gvisorprobe_other.go: built only for other systems or tags
internal/instancectl/peer_other.go: built only for other systems or tags
internal/instancectl/peer_tuple_other.go: built only for other systems or tags
internal/instancectl/rootfs_identity_other.go: built only for other systems or tags
internal/instanceexec/claimexec_other.go: built only for other systems or tags
internal/instanceexec/exec_rootfs_other.go: built only for other systems or tags
internal/instanceexec/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 18619 at 45 sites functions over 300 code lines (blank and comment-only lines not counted)
codehealth_test.go:115: file-lines 30727 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 . apimode.go -: 4175 in the code, the record allows 4184 (make code-health-record lowers it)
codehealth_test.go:119: below the record: file-lines internal/host agent.go -: 3188 in the code, the record allows 3214 (make code-health-record lowers it)
--- PASS: TestCodeHealth (107.00s)
PASS
ok github.com/carlosframework/platform/internal/codehealth 108.390s
=== code-health-record ===
go version go1.26.10 linux/arm64
code-health record: HEAD is on main; comparing with its parent 67a5b32da13c72d79b256e8b389a3f61e0ee41c2
=== RUN TestRecordAgainstBase
codehealth_test.go:186: accepted: func-lines internal/activator (*Service).doWakeOnce -: 571, up from 570: # raised: step 0.69, the one call that delivers an instance's config before its wake is planned (body in configbeforewake.go); before it, #1290 step 2c
codehealth_test.go:186: accepted: func-lines internal/host runAgent -: 689, up from 688: # raised: sets the activator's ConfigBeforeWake beside BeforeExec, where every wake hook is set before Start (body in configbeforewake.go); before it, #1290's continuity directory
codehealth_test.go:186: accepted: file-lines internal/activator activator.go -: 3785, up from 3783: # raised: the Service.ConfigBeforeWake field and doWakeOnce's one call to it (the body lives in configbeforewake.go); before it, #1290 step 2c
--- 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 +14 s)
ok github.com/carlosframework/platform/internal/systemd 12.652s
=== internal_rootaws@0 (25 s, from +35 s)
ok github.com/carlosframework/platform/internal/rootaws 24.885s
=== internal_activator@0 (266 s, from +110 s)
ok github.com/carlosframework/platform/internal/activator 263.522s
=== internal_activator@1 (262 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 260.911s
=== internal_activator@2 (276 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 274.161s
=== internal_activator@3 (416 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 414.555s
=== internal_activator@4 (275 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 273.158s
=== internal_activator@5 (310 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 308.643s
=== internal_activator@6 (316 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 314.786s
=== internal_activator@7 (409 s, from +111 s)
ok github.com/carlosframework/platform/internal/activator 407.133s
=== internal_edge@0 (83 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 80.500s
=== internal_edge@1 (144 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 141.269s
=== internal_edge@2 (198 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 195.438s
=== internal_edge@3 (169 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 165.668s
=== internal_edge@4 (155 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 151.575s
=== internal_edge@5 (233 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 229.988s
=== internal_edge@6 (236 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 233.257s
=== internal_edge@7 (231 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 228.298s
=== internal_edge@8 (225 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 221.914s
=== internal_edge@9 (250 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 246.505s
=== internal_edge@10 (219 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 216.018s
=== internal_edge@11 (211 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 207.756s
=== internal_edge@12 (232 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 229.034s
=== internal_edge@13 (265 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 261.900s
=== internal_edge@14 (173 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 169.770s
=== internal_edge@15 (243 s, from +132 s)
ok github.com/carlosframework/platform/internal/edge 239.888s
=== internal_host@0 (9 s, from +190 s)
ok github.com/carlosframework/platform/internal/host 4.893s
=== internal_host@1 (17 s, from +190 s)
ok github.com/carlosframework/platform/internal/host 12.933s
=== lists: internal_edge 131 s, internal_activator 110 s, internal_host 190 s, internal_rootaws 34 s, internal_systemd 13 s
=== cpu: the gate used 7587 cpu-seconds in 527 s, about 14.4 of 32 cores; the machine as a whole was 44% busy
=== gitleaks ===
go version go1.26.10 linux/arm64
go: downloading github.com/zricethezav/gitleaks/v8 v8.30.1
go: downloading github.com/spf13/cobra v1.9.1
go: downloading github.com/spf13/viper v1.19.0
go: downloading github.com/charmbracelet/lipgloss v0.5.0
go: downloading github.com/BobuSumisu/aho-corasick v1.0.3
go: downloading github.com/Masterminds/sprig/v3 v3.3.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/hashicorp/go-version v1.7.0
go: downloading github.com/mholt/archives v0.1.2
go: downloading golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa
go: downloading github.com/rs/zerolog v1.33.0
go: downloading dario.cat/mergo v1.0.1
go: downloading github.com/huandu/xstrings v1.5.0
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/shopspring/decimal v1.4.0
go: downloading github.com/Masterminds/semver/v3 v3.3.0
go: downloading golang.org/x/crypto v0.35.0
go: downloading github.com/spf13/cast v1.7.1
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading golang.org/x/sync v0.11.0
go: downloading github.com/spf13/pflag v1.0.6
go: downloading github.com/muesli/termenv v0.15.1
go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading github.com/mattn/go-colorable v0.1.14
go: downloading github.com/mattn/go-runewidth v0.0.14
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/magiconair/properties v1.8.9
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/pelletier/go-toml/v2 v2.2.3
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/STARRY-S/zip v0.2.1
go: downloading github.com/andybalholm/brotli v1.1.2-0.20250424173009-453214e765f3
go: downloading github.com/bodgit/sevenzip v1.6.0
go: downloading github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707
go: downloading github.com/klauspost/compress v1.17.11
go: downloading github.com/klauspost/pgzip v1.2.6
go: downloading github.com/minio/minlz v1.0.0
go: downloading github.com/nwaples/rardecode/v2 v2.1.0
go: downloading github.com/pierrec/lz4/v4 v4.1.21
go: downloading github.com/sorairolake/lzip-go v0.3.5
go: downloading github.com/therootcompany/xz v1.0.1
go: downloading github.com/ulikunitz/xz v0.5.12
go: downloading golang.org/x/text v0.22.0
go: downloading github.com/mitchellh/reflectwalk v1.0.2
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading golang.org/x/sys v0.30.0
go: downloading github.com/aymanbagabas/go-osc52/v2 v2.0.1
go: downloading github.com/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/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 97 near misses of the names notscanned.go lists
self-test: skipped the 32 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, 130 tracked files judged, 3 broken setups refused
gitleaks: scanned 11453 tracked files; 32 not scanned, by exact path (scripts/gitleaks-gate/notscanned.go)
gitleaks: clean
diff --git a/.amadan/code-health.tsv b/.amadan/code-health.tsv| index 123cdc67d..439157151 100644 |
| --- a/.amadan/code-health.tsv |
| +++ b/.amadan/code-health.tsv |
| @@ -2177,7 +2177,7 @@ func-lines . TestFleetAppServesThroughTheHub - 408 |
| func-lines . runDeploy - 329 |
| func-lines . runRoute - 519 |
| func-lines cmd/console serve - 367 |
| -func-lines internal/activator (*Service).doWakeOnce - 570 # raised: #1290 step 2c, the one call that protects the database before the seed, release commands and the process start (body in replicatebeforestart.go) |
| +func-lines internal/activator (*Service).doWakeOnce - 571 # raised: step 0.69, the one call that delivers an instance's config before its wake is planned (body in configbeforewake.go); before it, #1290 step 2c |
| func-lines internal/analytics Prune - 343 |
| func-lines internal/appconfig SyncExecWithCallbacks - 320 |
| func-lines internal/console (*Server).handleAPIInstanceCreate - 769 |
| @@ -2205,7 +2205,7 @@ func-lines internal/host plan14RequiredArtifactsRootRunner - 374 |
| func-lines internal/host plan14TimerIntention - 315 |
| func-lines internal/host plan14TimerIntention.func1 - 311 |
| func-lines internal/host rootFilesSeedIsolatedWitness - 308 |
| -func-lines internal/host runAgent - 688 # raised: #1290 sets the agent continuity directory beside the HA obligation store, where every exec-backend store is configured |
| +func-lines internal/host runAgent - 689 # raised: sets the activator's ConfigBeforeWake beside BeforeExec, where every wake hook is set before Start (body in configbeforewake.go); before it, #1290's continuity directory |
| func-lines internal/host runFilesSeedPreparationWithLive - 390 |
| func-lines internal/host runServingParkPeerNamespace - 538 |
| func-lines internal/host testRootMigrationBootstrap - 364 |
| @@ -2220,7 +2220,7 @@ func-lines internal/release adoptHost - 494 |
| func-lines internal/team TestFixture - 421 |
| file-lines . apimode.go - 4184 |
| file-lines . apimode_test.go - 3530 # raised: fdc912b (batch 2, #1123) landed before the ratchet; tests for the system update refusals |
| -file-lines internal/activator activator.go - 3783 # raised: #1290 step 2c, the call to protectBeforeStart (its body and interface live in replicatebeforestart.go) |
| +file-lines internal/activator activator.go - 3785 # raised: the Service.ConfigBeforeWake field and doWakeOnce's one call to it (the body lives in configbeforewake.go); before it, #1290 step 2c |
| file-lines internal/activator activator_test.go - 5471 |
| file-lines internal/console server.go - 4223 # raised: domain transfers Task 6, Config.LookupNS, LookupDS and DNSServer (the brief puts them on Config) and the transfer engine clock seam on Server |
| file-lines internal/host agent.go - 3214 |
diff --git a/docs/superpowers/notes/census-proposal-instance-ready-before-wake.md b/docs/superpowers/notes/census-proposal-instance-ready-before-wake.md| new file mode 100644 |
| index 000000000..6eb13dfee |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-instance-ready-before-wake.md |
| @@ -0,0 +1,33 @@ |
| +# Census approval: instance-ready-before-wake |
| + |
| +Ruling `census-ruling-instance-ready-before-wake`. The independent reviewer approves or rejects every change below, 5 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/activator/activator.go` `type Service` | body | unchanged (0) | the agent as carlos: gains the ConfigBeforeWake hook field beside Planner, a func the agent sets before Start. No read added. | |
| +| `internal/appconfig/syncexec.go` `SyncExecWithCallbacks` | body | unchanged (62) | the agent as carlos, through syncExecLocked (root never calls SyncExec): the per-host call is now syncExecHostMaking with the pass MakeInstanceDir option (false under host writes). With the option off, as every config loop pass leaves it, the body is as before. No new read site. | |
| +| `internal/host/agent.go` `runAgent` | body | unchanged (8) | the agent as carlos: sets svc.ConfigBeforeWake = configBeforeWake(reg, dd, claims.Writes) beside BeforeExec, before Start. Read sites unchanged, offsets moved. | |
| +| `internal/activator/activator.go` `Service.doWakeOnce` | sites | +whole:Route | the agent as carlos: one call, step 0.69, a.configBeforeWake(ctx, e, rt), after the held wake check and before the planner. It hands the hook the route this wake already holds (the added whole Route site). It returns nothing, so no refusal, lease, restore or spawn ordering changes. | |
| + |
| +Envelopes re-pinned: `internal/activator`, `internal/appconfig`, `internal/host`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added;rev3=census-ruling-stateless-replicas-4-drill1;basis=#511 drill 1 R20 bound (round 1: clock with start and last seen): one in-memory field, releaseConfigWaits (per host, a stateless release's config wait), under mu; no read;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 review round 2 (#511): one field, retiringCopy, an atomic pointer to the edge's in-memory retired-copy check, handed over by edge.New (SetRetiringCopy); no read, no root decision;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: four fields, fenceWatchers (sync.WaitGroup of running write-fence watchers) and three test seams nil in production (fenceWatchStarted, retainDB, wakeReturned). Declaration only, no read.;rev3=census-ruling-fleet-record-labels-m1;basis=fleet record labels R1/R2: actEntry gains checkpoint state (busy while CloseProven runs, unproven, named-once flag for C45), in-memory under a.mu; the worker gains fence pacing apart from crash backoff; Service gains test seams nil in production; declarations only, no read;rev3=census-ruling-race-activator-1249;basis=adds two test-only fields: leaseWork (a WaitGroup counting lease watches and the one-shot stops a short lease starts) and leaseWatchStop (a channel, nil in production, that a test closes to end every lease watch); no read added and production never waits on or closes either;rev3=census-ruling-fleet-restart-wake;basis=Fleet restart wake Task 1: the per-host journal note maps (wakeFailLogged, heldSeen) move into the embedded wakeNotes struct in wakefaillog.go, which adds fenceSeen. In-memory only; no read added.;rev3=census-ruling-stateless-scale-2-fleet-sizes;basis=the agent (carlos-edge.service, user carlos), not root: one embedded field (#892 S2), fleetSizeService (fleetreserve.go), which holds BoxLabel (string, the rollout's own box label, set by armRollout) and fleetReserve (fleetReservations, ready as its zero value; it reads /proc/meminfo through memAvailable only when a fleet-size overlap reserves), the box's in-memory overlap reservation for fleet sizes. Declaration only; no read added |
| +- `internal/appconfig/syncexec.go` `SyncExecWithCallbacks`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=route-and-input (J1,J4, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), through syncExecSerialized: main's body, with a nested row whose write found no instance directory named and skipped (errInstanceDirAbsent, WhenInstanceDirAbsent) instead of failing the pass, and each in-scope host reported done or not done (WithHostOutcome) once the pass has gone through every route; no new read site;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=the scoped pass's route filter (WithRouteFilter, syncOptions.kept) is checked in its three route loops, so a route the filter leaves out is out of scope before anything is read for it; three whole-Route sites added, each passing rt to kept; no bucket or file read added;rev3=census-ruling-team-scoped-credentials;basis=team-scoped credentials (#449 §3): checkOptedIn's default-bundle thunk answers no default bundle for an OWNED environment bundle, so its exec_delivery is its own and never inherited; the same bundle reads as before, no read site added;rev3=census-ruling-named-unit-delivery-114;basis=the stale-file notice loop gains the stamped case: os.Stat of ConfigEnvPath(dataDir, rt), the path the exec-addr case already stats, and a notice line; no write, no new path;rev3=census-ruling-design-console-secrets;basis=the <host>.config collision set is built by routeHostSet (shared with the classifier) instead of inline; same rows read, same skip; no read site added |
| +- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added;rev3=census-ruling-stateless-replicas-4-merge-main2;basis=Merge of main af871da0 (v0.34.49): both sides changed it. Main (178dcfe5, member-backups-2a) moves the inline duty-view closure into armDutyView/dutyView and starts verifyAssignLoop; its sites drop by registry:Host and whole:Route x2 as main recorded them. This branch keeps its replica coordinator, swap worker and drive wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-drill3;basis=drill 3 R24: makes one in-memory channel, closes it (once) inside the edge's existing shutdown-started callback after ingress.shutdownStarted, and passes it to tunnelLoop, which drains only a fleet channel name; no read added, same six sites; touches no admission, lease, ingress drain, listener or file; the agent process, no root decision;rev3=census-ruling-edge-ppv2;basis=Agent (uid carlos), not root. memwatchLoop now gets edgeProxyCounters(&demoEdge) (in-process counters, no read). The drain socket's driver is newAgentDrainSocket(ingress, e, os.Getenv), which attaches the edge trust handler only when CARLOS_INGRESS_PROXY_SOURCES in the agent's environment (from the root-owned host.env) parses to a non-empty list; the socket is served when drainSocketServed: a group member or a configured ingress drain (both as before), or a box armed for PROXY protocol (new). The socket's path and agent-user-only permissions are unchanged. Read sites unchanged (6).;rev3=census-ruling-same-box-edge-fence;basis=Agent (uid carlos), not root. One added line: armEdgeFenceStatus(ctl.EdgeFence), beside the existing armExecSandboxStatus, so the layout report can ask root's /ready for the edge fence state over the control socket client the agent already holds. No read added.;rev3=census-ruling-platform-mail-submission;basis=Task 4: sets eb.Mail = mailsubmit.SocketForwarder{} on every box, and eb.MailSwitch to a mailSwitchCache's On that opens the deploy store itself through openDeployStore, retried at most once a minute with an error line until it opens (review round 1, Task 4 P3), armed for the serial-move refresh (armedMailSwitch). Task 6: also sets the ExecBackend's ManifestOf, the same staged-manifest read as TierOf (rt.App and RouteAccount(rt), hence +registry:App and +whole:Route), for the spawn-time check of decision 10, which logs and emits an event and never refuses. Agent, not root. Fable final P2-2: eb.MailSwitch is the cache's State (three-valued: on, off, unknown) in place of On; an unreadable switch is unknown, never off. No read added.;rev3=census-ruling-fleet-drain-followups;basis=P3 (#1008 T9): one call after armChangeIndex, requestBootFullPass(v, &backstopFullDue), which stores true in the existing in-memory backstopFullDue flag only when no record view is armed, so the fast loop runs its existing full pass on its first tick instead of instancesLoop a minute later; armed boxes unchanged. No read added; read sites unchanged (8); agent, not root.;rev3=census-ruling-fleet-first-reconcile-speed;basis=Startup timing log lines only: runDuties builds a step logger (newStartupLog, which reads the in-memory agent start time) and logs one line after the wait on the activator startup latch and after each existing duty before go fastConvergeLoop. One newStartupLog().at line in the edge ready hook before go tunnelLoop. No read added; read sites unchanged (8). Agent, not root.;rev3=census-ruling-ha-1192;basis=sets the group drain driver's departed hook to armedPeerDeparted (the armed departure controller's PeerDeparted: local registry identity + departure journal); no new read;rev3=census-ruling-replica-wake-gap-r3;basis=Calls lease.SetContinuityDir(<data dir>/.continuity) beside the existing obligation store: the agent's own 0700 directory for clean records, outside every instance tree (#1290 round 3). No new read; failure is logged and every start then takes a full image.;rev3=census-ruling-fleet-restart-wake;basis=Fleet restart wake Task 2: cfg.ReplicaRecord = replicaRecordFacts(boxLifetimes, cfg.Record): hands the existing judged record read (haRecordFacts over openDeployStore and boxJudge) as the live read on a lifetime index miss. No read site added here; agent, not root.;rev3=census-ruling-alias-publish-precert-1293;basis=starts edgesFileLoop with one more argument, edgeAcmeDir(os.Getenv, peekAcmeCache(args)): the agent's own -acme-cache flag (already parsed for domainsLoop) or $CARLOS_DATA_DIR/acme; a string computed from the operator's command line and environment, no read. Same 8 read sites.;rev3=census-ruling-console-addr-from-install;basis=publishes the running edge to consoleFleetEdgeSource for the heartbeat; no read added |
| +- `internal/activator/activator.go` `Service.doWakeOnce`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged.;rev3=census-ruling-sr-followups;basis=#1061 Task 1, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): a refused plan now returns planRefusal(host, plan) instead of the inline fmt.Errorf, the text is unchanged, and when the planner marked the plan Installing the error also matches errBuildNotInstalled (installRefusal, in memory). Same refusal at the same point before the lease, read sites unchanged, no read, file, store, bucket or root call added;rev3=census-ruling-replica-wake-gap;basis=Step 2c: before the seed and the spawn, asks the lease to ProtectStart(rt.DBPath), the route's own database path already used by Restore and retainDatabase; a refusal gives the lease back and starts nothing. Agent code (user carlos); no root call, no new store or file read here.;rev3=census-ruling-replica-wake-gap-ch;basis=Step 2c's body moved unchanged into protectBeforeStart (replicatebeforestart.go); doWakeOnce passes the whole Route it already holds and returns the error. No read added; the DBPath read moved with the body. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/activator/configbeforewake.go:Service.configBeforeWake`: reads +whole:Route; written legacy, accepted-legacy, frozen |
| +- new `internal/appconfig/syncexec.go:ExecSpawned`: reads +whole:Route ×2; written legacy, accepted-legacy, frozen |
| +- new `internal/appconfig/syncexec.go:syncExecHostMaking`: reads +registry:Host, +whole:Route ×3; written legacy, accepted-legacy, frozen |
| +- new `internal/host/configbeforewake.go:configBeforeWake`: reads +whole:Route; written legacy, accepted-legacy, frozen |
| +- new `internal/host/configbeforewake.go:deliverConfigBeforeWake`: reads +file:Lstat, +registry:Host ×6, +whole:Route ×2; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `f273b5cb7bbf37b6dca4bb964a9293cbec15b14c1c0a19b9010c177f20789a86` → `aa953b1a43009c8208e44c67f5b8127ae1914b15d8b8822bcf16b19a6abdf121`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-instance-ready-before-wake.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/activator/activator.go b/internal/activator/activator.go| index c2b64e829..983a35dff 100644 |
| --- a/internal/activator/activator.go |
| +++ b/internal/activator/activator.go |
| @@ -1618,6 +1618,25 @@ type Service struct { |
| // and fail OPEN, since a read error must not stop legitimate bindings. |
| OnWake func(rt registry.Route) |
| + // ConfigBeforeWake, when set, is given each wake's route before the |
| + // wake is planned, so the agent can put the instance's config file in |
| + // place while nothing of the wake has read it: the planner snapshots |
| + // the delivered revision (WakePlan.ConfigRev) and the spawn reads the |
| + // file, both after this. Without it a new instance's first process |
| + // started before config sync had written its file, ran without its |
| + // config, and was restarted onto it seconds later. It answers nothing: |
| + // a delivery that fails leaves the wake as it was before the hook |
| + // existed, and config sync delivers and restarts as it always has. A |
| + // hold swap's pinned wake and a fallback's second pass are not asked: |
| + // the instance's file was settled before either. Nor is a wake with |
| + // host writes on (doClaimWake), which leaves doWakeOnce before this |
| + // step: such a box keeps the old first wake. It is never called with |
| + // a.mu held, so it may use Service's own locking reads (the agent's |
| + // reaches Owns, through the scheduler's ConfigDelivered); it must not |
| + // wait on this wake. Set before Start, like OnWake; nil (every unit |
| + // test, a box with no config to deliver) asks nothing. |
| + ConfigBeforeWake func(ctx context.Context, rt registry.Route) |
| + |
| // Planner, when set, says which build each wake boots (zero-downtime |
| // spec §8.2). The rollout manager sets it with CARLOS_SWAP=overlap; nil |
| // keeps today's wake from the live link. It is called without a.mu held. |
| @@ -2846,6 +2865,11 @@ func (a *Service) doWakeOnce(ctx context.Context, e *actEntry) (*wokenInstance, |
| } |
| } |
| + // 0.69. The instance's config is delivered before anything of this wake |
| + // reads it (ConfigBeforeWake): before the planner, whose plan carries |
| + // the delivered revision, and so before the lease and the spawn. |
| + a.configBeforeWake(ctx, e, rt) |
| + |
| // 0.7. Which build this wake boots (zero-downtime spec §8.2). A hold |
| // swap's pinned wake (e.pin) already knows; everything else asks the |
| // planner, off a.mu, before the lease: a refused plan takes no lease. |
diff --git a/internal/activator/configbeforewake.go b/internal/activator/configbeforewake.go| new file mode 100644 |
| index 000000000..6ada25605 |
| --- /dev/null |
| +++ b/internal/activator/configbeforewake.go |
| @@ -0,0 +1,24 @@ |
| +package activator |
| + |
| +import ( |
| + "context" |
| + |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// configBeforeWake is doWakeOnce's step 0.69: the agent's ConfigBeforeWake, |
| +// asked for every wake that reads the instance's config file afresh. A hold |
| +// swap's pinned wake (e.pin) and a fallback's second pass through doWakeOnce |
| +// (wakeFallbackKey) are not asked: the first replaces a generation that was |
| +// already running on a settled file, and the second follows a pass that |
| +// asked moments ago. Called without a.mu held; e.pin is set at the entry's |
| +// construction and never written after (holdWakeLocked). |
| +func (a *Service) configBeforeWake(ctx context.Context, e *actEntry, rt registry.Route) { |
| + if a.ConfigBeforeWake == nil || e.pin != nil { |
| + return |
| + } |
| + if _, fallback := ctx.Value(wakeFallbackKey{}).(WakePlan); fallback { |
| + return |
| + } |
| + a.ConfigBeforeWake(ctx, rt) |
| +} |
diff --git a/internal/activator/configbeforewake_test.go b/internal/activator/configbeforewake_test.go| new file mode 100644 |
| index 000000000..2291aeb78 |
| --- /dev/null |
| +++ b/internal/activator/configbeforewake_test.go |
| @@ -0,0 +1,74 @@ |
| +package activator |
| + |
| +import ( |
| + "context" |
| + "slices" |
| + "sync" |
| + "testing" |
| + |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// Production, 2026-11-24: a new instance's first generation started before |
| +// its config file was written, ran without its config, and was swapped for |
| +// a configured one seconds later. The agent is now asked before the wake is |
| +// planned (step 0.69), so the plan's delivered revision and the spawn's |
| +// read both come after the file is in place. |
| +func TestConfigIsAskedForBeforeAWakeIsPlannedOrStarted(t *testing.T) { |
| + dir := t.TempDir() |
| + good, next := stagedID(t, dir, "v1"), stagedID(t, dir, "v2") |
| + a, b, evs := planActivator(t, WakePlan{}) |
| + var mu sync.Mutex |
| + var order []string |
| + note := func(s string) { |
| + mu.Lock() |
| + defer mu.Unlock() |
| + order = append(order, s) |
| + } |
| + a.ConfigBeforeWake = func(_ context.Context, rt registry.Route) { |
| + if len(b.started()) != 0 { |
| + note("config after a start") |
| + return |
| + } |
| + note("config " + rt.Host) |
| + } |
| + a.Planner = func(context.Context, registry.Route) WakePlan { |
| + note("plan") |
| + return WakePlan{Boot: next, Mode: ModeOverlap, FirstWake: true, Fallback: &good} |
| + } |
| + done, err := a.beginRequest(context.Background(), testRoute("one.example.com")) |
| + if err != nil { |
| + t.Fatalf("the wake failed: %v", err) |
| + } |
| + done() |
| + evs.wait(t, GenHealthy) |
| + mu.Lock() |
| + got := slices.Clone(order) |
| + mu.Unlock() |
| + if want := []string{"config one.example.com", "plan"}; !slices.Equal(got, want) { |
| + t.Fatalf("order = %v, want %v: the config is delivered before the plan snapshots its revision", got, want) |
| + } |
| + if gens := b.started(); len(gens) != 1 || gens[0].Build != "v2" { |
| + t.Fatalf("spawned %+v, want v2 alone", gens) |
| + } |
| +} |
| + |
| +// A hold swap's pinned wake and a fallback's second pass are not asked: |
| +// the file was settled before either, and neither is the first read of it. |
| +func TestConfigIsNotAskedForOnAPinnedOrFallbackWake(t *testing.T) { |
| + a, _, _ := planActivator(t, WakePlan{}) |
| + asked := 0 |
| + a.ConfigBeforeWake = func(context.Context, registry.Route) { asked++ } |
| + rt := testRoute("one.example.com") |
| + a.configBeforeWake(context.Background(), &actEntry{pin: &Gen{Build: "v1"}}, rt) |
| + a.configBeforeWake(context.WithValue(context.Background(), wakeFallbackKey{}, WakePlan{}), &actEntry{}, rt) |
| + if asked != 0 { |
| + t.Fatalf("asked %d times for a pinned wake and a fallback pass", asked) |
| + } |
| + a.configBeforeWake(context.Background(), &actEntry{}, rt) |
| + if asked != 1 { |
| + t.Fatalf("asked %d times for an ordinary wake, want 1", asked) |
| + } |
| + a.ConfigBeforeWake = nil |
| + a.configBeforeWake(context.Background(), &actEntry{}, rt) // no hook: nothing to call |
| +} |
diff --git a/internal/appconfig/syncexec.go b/internal/appconfig/syncexec.go| index 3098af7e4..c24134aed 100644 |
| --- a/internal/appconfig/syncexec.go |
| +++ b/internal/appconfig/syncexec.go |
| @@ -650,7 +650,7 @@ func SyncExecWithCallbacks(ctx context.Context, reg *registry.Registry, s releas |
| hostCallbacks.Delivered = nil |
| } |
| } |
| - err := syncExecHostClaimed(ctx, selected[rt.Host], rt, m, Key(k.acct, k.app), priv, dataDir, hostBounce, header, instETag, ack, hostCallbacks) |
| + err := syncExecHostMaking(ctx, o.makeDir && !hostWrites.Enabled, selected[rt.Host], rt, m, Key(k.acct, k.app), priv, dataDir, hostBounce, header, instETag, ack, hostCallbacks) |
| // A nested row's bundle lives in its instance directory, which the |
| // activator makes at the first wake. Before then the write cannot |
| // land, so the row is named and the pass goes on to the other |
| @@ -786,6 +786,7 @@ type syncOptions struct { |
| fenced func(host string) bool |
| keep func(rt registry.Route) bool |
| dirAbsent func(host, dir string) |
| + makeDir bool |
| outcome func(host string, done bool) |
| hostWrites hostwrite.Config |
| hostWriteCount int |
| @@ -816,6 +817,23 @@ func WhenInstanceDirAbsent(dirAbsent func(host, dir string)) SyncOption { |
| return func(o *syncOptions) { o.dirAbsent = dirAbsent } |
| } |
| +// MakeInstanceDir makes SyncExec create a nested row's instance directory |
| +// when the row has a bundle to write and the directory is not there, in |
| +// place of naming the row and leaving it (WhenInstanceDirAbsent). It is for |
| +// the pass a wake runs before it plans (the agent's configBeforeWake): that |
| +// wake's prepare would make the same directory, with the same mode, a |
| +// moment later, and by then its first process has started without the |
| +// bundle. The directory is made only when the pass has a file to write: a |
| +// row with no instance overlay whose bundle renders nothing gets no file |
| +// and leaves no directory behind. A row that has an instance overlay gets |
| +// its file even when the render is empty (renderExecConfigBefore's |
| +// keepAbsent is off for it), so its directory is made for an empty file. |
| +// Every other pass leaves the directory to the activator, as before. Not |
| +// under host writes: there the row is named and left, as before. |
| +func MakeInstanceDir() SyncOption { |
| + return func(o *syncOptions) { o.makeDir = true } |
| +} |
| + |
| func WithHostWrite(cfg hostwrite.Config) SyncOption { |
| return func(o *syncOptions) { |
| o.hostWrites = cfg |
| @@ -885,6 +903,15 @@ func execSyncable(rt registry.Route) bool { |
| return execRouteBase(rt) && rt.Socket != "" |
| } |
| +// ExecSpawned reports whether rt is a route the activator spawns and this |
| +// sweep always delivers a config file for: a socket instance or a sidecar |
| +// (execSyncable, execSidecarCandidate). It is the sweep's own scope, for |
| +// the agent's pass before a wake (configBeforeWake): a route outside it is |
| +// never named by a pass, so that pass has nothing to do for it. |
| +func ExecSpawned(rt registry.Route) bool { |
| + return execSyncable(rt) || execSidecarCandidate(rt) |
| +} |
| + |
| // execAddrCandidate: the TCP-addr exec shape (issue #18) — an |
| // app-supervised instance family carlos routes to but neither spawns nor |
| // owns the process of (titogo's router fleet is the motivating case: |
| @@ -1384,6 +1411,28 @@ func syncExecHostClaimed(ctx context.Context, work hostwrite.Work, rt registry.R |
| return nil |
| } |
| +// syncExecHostMaking is syncExecHostClaimed for a pass that may make a |
| +// nested row's instance directory (MakeInstanceDir; makeDir false is |
| +// syncExecHostClaimed alone). The wake that runs such a pass is about to |
| +// make this directory itself, so it is made here, as the activator's |
| +// prepare makes it (os.MkdirAll, 0700), and the write is tried once more. |
| +// The absent answer comes back only from the write, before anything is |
| +// delivered, restarted or acknowledged, so nothing runs twice. A directory |
| +// that cannot be made leaves the absent answer standing, and the pass names |
| +// the row and goes on as it does without the option. |
| +func syncExecHostMaking(ctx context.Context, makeDir bool, work hostwrite.Work, rt registry.Route, m *Manifest, key string, priv *ecdh.PrivateKey, dataDir string, bounce func(host string) error, header, instETag string, ack func(ConfigAck), callbacks Callbacks) error { |
| + err := syncExecHostClaimed(ctx, work, rt, m, key, priv, dataDir, bounce, header, instETag, ack, callbacks) |
| + if !makeDir || !errors.Is(err, errInstanceDirAbsent) { |
| + return err |
| + } |
| + dir := filepath.Dir(ConfigEnvPath(dataDir, rt)) |
| + if mkErr := os.MkdirAll(dir, 0o700); mkErr != nil { |
| + fmt.Printf(" %s: make instance directory %s: %v\n", rt.Host, dir, mkErr) |
| + return err |
| + } |
| + return syncExecHostClaimed(ctx, work, rt, m, key, priv, dataDir, bounce, header, instETag, ack, callbacks) |
| +} |
| + |
| // errInstanceDirAbsent is a nested row's write that found no instance |
| // directory: the activator has not woken the instance here yet. |
| var errInstanceDirAbsent = errors.New("the instance directory is not made yet") |
diff --git a/internal/appconfig/syncexec_makedir_test.go b/internal/appconfig/syncexec_makedir_test.go| new file mode 100644 |
| index 000000000..337f3319b |
| --- /dev/null |
| +++ b/internal/appconfig/syncexec_makedir_test.go |
| @@ -0,0 +1,90 @@ |
| +package appconfig |
| + |
| +import ( |
| + "os" |
| + "path/filepath" |
| + "testing" |
| + |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/registry" |
| +) |
| + |
| +// MakeInstanceDir is the option of the pass a wake runs before it plans: a |
| +// nested row with a bundle to write and no instance directory gets the |
| +// directory, with the mode the activator's prepare gives it, and its file. |
| +// The same pass without the option names the row and leaves the directory |
| +// to the activator, as every other pass does. Nothing is restarted or |
| +// acknowledged twice for the write that needed a second try. |
| +func TestSyncExecMakeInstanceDirWritesANestedRowWithNoDirectory(t *testing.T) { |
| + ctx, s, reg, dd, priv, _ := execKit(t) |
| + pk, err := ParsePrivateKey(priv, "test") |
| + if err != nil { |
| + t.Fatalf("ParsePrivateKey: %v", err) |
| + } |
| + if err := SetEnv(ctx, s, "bab", "eleven", map[string]string{"LOG_LEVEL": "debug"}); err != nil { |
| + t.Fatalf("SetEnv: %v", err) |
| + } |
| + host := "inst.example.com" |
| + if err := reg.Upsert(registry.Route{ |
| + Host: host, Kind: "instance", App: "eleven", Account: "bab", |
| + Status: "ready", DBPath: provision.NestedDBPath(dd, host), Socket: provision.NestedSocket(host), |
| + }); err != nil { |
| + t.Fatalf("Upsert: %v", err) |
| + } |
| + dir := provision.InstanceDir(dd, host) |
| + var bounced, absent, acks int |
| + bounce := func(string) error { bounced++; return nil } |
| + ack := func(ConfigAck) { acks++ } |
| + waits := WhenInstanceDirAbsent(func(string, string) { absent++ }) |
| + |
| + if err := SyncExec(ctx, reg, s, pk, dd, bounce, "", ack, waits); err != nil { |
| + t.Fatalf("SyncExec: %v", err) |
| + } |
| + if _, err := os.Lstat(dir); !os.IsNotExist(err) { |
| + t.Fatalf("a pass without the option made the instance directory (err %v)", err) |
| + } |
| + if absent != 1 || bounced != 0 || acks != 0 { |
| + t.Fatalf("without the option: absent %d, bounced %d, acks %d; want the row named once and nothing else", absent, bounced, acks) |
| + } |
| + |
| + absent = 0 |
| + done := map[string]bool{} |
| + if err := SyncExec(ctx, reg, s, pk, dd, bounce, "", ack, waits, MakeInstanceDir(), |
| + WithHostOutcome(func(h string, ok bool) { done[h] = ok })); err != nil { |
| + t.Fatalf("SyncExec: %v", err) |
| + } |
| + got, err := os.ReadFile(filepath.Join(dir, host+".config.env")) |
| + if err != nil || string(got) != "LOG_LEVEL=debug\n" { |
| + t.Fatalf("config env = %q, %v, want LOG_LEVEL=debug", got, err) |
| + } |
| + if fi, err := os.Stat(dir); err != nil || fi.Mode().Perm() != 0o700 { |
| + t.Fatalf("instance directory = %v, %v, want 0700", fi, err) |
| + } |
| + if absent != 0 || bounced != 1 || acks != 1 || !done[host] { |
| + t.Fatalf("with the option: absent %d, bounced %d, acks %d, done %v; want one delivery, reported done", absent, bounced, acks, done[host]) |
| + } |
| +} |
| + |
| +// A bundle that renders nothing has nothing to put in a directory, so the |
| +// option makes none: an instance of an app with no settings leaves no |
| +// directory behind for a wake that may yet be refused. |
| +func TestSyncExecMakeInstanceDirMakesNothingForAnEmptyBundle(t *testing.T) { |
| + ctx, s, reg, dd, priv, _ := execKit(t) |
| + pk, err := ParsePrivateKey(priv, "test") |
| + if err != nil { |
| + t.Fatalf("ParsePrivateKey: %v", err) |
| + } |
| + host := "inst.example.com" |
| + if err := reg.Upsert(registry.Route{ |
| + Host: host, Kind: "instance", App: "eleven", Account: "bab", |
| + Status: "ready", DBPath: provision.NestedDBPath(dd, host), Socket: provision.NestedSocket(host), |
| + }); err != nil { |
| + t.Fatalf("Upsert: %v", err) |
| + } |
| + if err := SyncExec(ctx, reg, s, pk, dd, nil, "", nil, MakeInstanceDir()); err != nil { |
| + t.Fatalf("SyncExec: %v", err) |
| + } |
| + if _, err := os.Lstat(provision.InstanceDir(dd, host)); !os.IsNotExist(err) { |
| + t.Fatalf("a directory was made with no bundle to put in it (err %v)", err) |
| + } |
| +} |
diff --git a/internal/host/agent.go b/internal/host/agent.go| index 72ad1e95d..d7e2ab3fe 100644 |
| --- a/internal/host/agent.go |
| +++ b/internal/host/agent.go |
| @@ -771,6 +771,10 @@ func runAgent(args []string, buildClaims ClaimFactory) { |
| // store that failed to start refuses every spawn (never "run |
| // unrecorded"). Set before Start, like Routes. |
| svc.BeforeExec = sandboxExecGate(sandboxEffective, sandboxErr, reg.Get, eb.ConfigGate, demoPolicyHook(os.Getenv, reg, eb.Control, buildStateHook(bs, bsErr))) |
| + // An instance's config file is in place before its wake is planned |
| + // (configbeforewake.go), so a new instance's first process is the |
| + // configured one. Set before Start, like Routes. |
| + svc.ConfigBeforeWake = configBeforeWake(reg, dd, claims.Writes) |
| // The held wake check (settings spec §4.3 rule 3): a held instance |
| // never wakes on an installed build other than its target. The copy |
| // is refreshed before every wake that could be held (wakeTarget), and |
| @@ -2004,7 +2008,7 @@ func configSyncLoop(reg *registry.Registry, svc *activator.Service, dd string, w |
| // next hourly pass. Serializing in-process closes that outright; the root |
| // adopt path is a different process writing a different namespace |
| // (/etc/carlos/apps) and is not this mutex's problem. |
| -var configSyncMu sync.Mutex |
| +var configSyncMu = make(passLock, 1) |
| // syncExecSerialized is the one way either config loop runs SyncExec — the |
| // mutex lives in a shared wrapper, not at the call sites, so a future third |
| @@ -2020,32 +2024,7 @@ func syncExecSerialized(ctx context.Context, reg *registry.Registry, store relea |
| func syncExecSerializedFiltered(ctx context.Context, keep func(registry.Route) bool, reg *registry.Registry, store release.Store, priv *ecdh.PrivateKey, dd string, svc *activator.Service, writes ...hostwrite.Config) error { |
| configSyncMu.Lock() |
| defer configSyncMu.Unlock() |
| - pending := map[string]string{} |
| - outcomes := map[string]bool{} |
| - opts := []appconfig.SyncOption{ |
| - appconfig.SkipFenced(func(host string) bool { return layout.JournalPresent(dd, host) }), |
| - appconfig.WhenInstanceDirAbsent(func(host, dir string) { pending[host] = dir }), |
| - appconfig.WithHostOutcome(func(host string, done bool) { outcomes[host] = done }), |
| - } |
| - if keep != nil { |
| - opts = append(opts, appconfig.WithRouteFilter(keep)) |
| - } |
| - for _, cfg := range writes { |
| - opts = append(opts, appconfig.WithHostWrite(cfg)) |
| - } |
| - // CARLOS_SWAP=overlap: the scheduler restarts, paced, and acknowledges a |
| - // revision once it is active; refusing: no restart. configSyncMu above |
| - // is what makes ConfigDelivered serial per host. |
| - var err error |
| - if cb, ok := rolloutConfigCallbacks(ctx, store, configLegs{awake: managedAwake(svc, reg), restart: bounce(svc)}); ok { |
| - err = appconfig.SyncExecWithCallbacks(ctx, reg, store, priv, dd, os.Getenv("PLATFORM_APPS_DOMAIN"), cb, opts...) |
| - } else { |
| - err = appconfig.SyncExec(ctx, reg, store, priv, dd, bounce(svc), os.Getenv("PLATFORM_APPS_DOMAIN"), configAckFunc(ctx, store, "agent"), opts...) |
| - } |
| - // A filtered pass names only the routes it kept, so it is never |
| - // complete: a host it left out keeps its wait (pendingDirs.record). |
| - configDirsPending.record(pending, outcomes, err == nil && keep == nil) |
| - return err |
| + return syncExecLocked(ctx, ctx, keep, reg, store, priv, dd, configLegs{awake: managedAwake(svc, reg), restart: bounce(svc)}, nil, writes...) |
| } |
| // configDirsPending is what the last config pass could not write because a |
diff --git a/internal/host/configbeforewake.go b/internal/host/configbeforewake.go| new file mode 100644 |
| index 000000000..9500cbac6 |
| --- /dev/null |
| +++ b/internal/host/configbeforewake.go |
| @@ -0,0 +1,325 @@ |
| +package host |
| + |
| +import ( |
| + "context" |
| + "crypto/ecdh" |
| + "log" |
| + "os" |
| + "sync" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/appconfig" |
| + "github.com/carlosframework/platform/internal/hostwrite" |
| + "github.com/carlosframework/platform/internal/layout" |
| + "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// Config before the first process (production, 2026-11-24). A new instance's |
| +// first generation started without its app config and was swapped for a |
| +// configured one about twelve seconds later ("config change"): requests in |
| +// between reached a process that had none of its settings. |
| +// |
| +// Two things made that window. A nested row's <host>.config.env lives in its |
| +// instance directory, which the activator makes at the first wake (prepare), |
| +// so the config pass that ran before the wake had nowhere to write and only |
| +// came back once the directory was there (configDirsPending), after the |
| +// spawn had read the file. And a wake that beats the first config pass to a |
| +// new route, nested or flat, finds no file at all. |
| +// |
| +// So the wake asks first. The activator calls configBeforeWake before it |
| +// plans a wake (activator.Service.ConfigBeforeWake). A route whose file is |
| +// already there costs one Lstat, and one a config pass has already settled |
| +// with no file (an app with no settings) one map read more. Any other gets |
| +// a config pass of its own, narrowed to that host, which makes the instance |
| +// directory if the bundle needs it (appconfig.MakeInstanceDir). The planner |
| +// then snapshots the revision that pass delivered and the spawn reads the |
| +// file, so the first generation is the configured one and its healthy event |
| +// activates the revision: nothing is left to restart for. |
| +// |
| +// This is not the fetch-at-spawn the exec config delivery design turned |
| +// down (2026-08-02-exec-config-delivery-design.md §6: bucket latency and |
| +// availability in the wake path, no file on disk to debug). The file on |
| +// disk stays the one thing a spawn reads; the bucket is read inside a wake |
| +// only when no pass has yet settled that host's file, which is a new |
| +// instance's first wake, and a read that fails or runs long costs that wake |
| +// nothing but the old behaviour. |
| +// |
| +// A wake with host writes on is not asked (the activator's claim wake |
| +// leaves before the step), so such a box keeps the old first wake. |
| +// |
| +// Best effort, on purpose. The hook cannot refuse a wake. A pass that fails, |
| +// or does not get the config lock inside its budget, leaves the wake exactly |
| +// as it was before the hook existed, and the config loops deliver and |
| +// restart as they always have. The gate that does refuse a wake whose |
| +// config this box cannot provide is the config guard (configguard.go), asked |
| +// later, at the lease. |
| + |
| +// passLock is a mutex a caller can stop waiting for: Lock, Unlock and |
| +// TryLock as sync.Mutex has them, for the config passes, and lockContext |
| +// for a wake's own pass, which gives up when its budget ends rather than |
| +// hold a request behind a long pass. It is made with make(passLock, 1): |
| +// the zero value blocks for ever. Unlock of a lock nobody holds blocks |
| +// too, where sync.Mutex would panic; every use here is Lock with a |
| +// deferred Unlock. |
| +type passLock chan struct{} |
| + |
| +func (l passLock) Lock() { l <- struct{}{} } |
| +func (l passLock) Unlock() { <-l } |
| + |
| +func (l passLock) TryLock() bool { |
| + select { |
| + case l <- struct{}{}: |
| + return true |
| + default: |
| + return false |
| + } |
| +} |
| + |
| +// lockContext takes the lock, or returns ctx's error once ctx is done. A |
| +// ctx that is already done never takes it, free or not. |
| +func (l passLock) lockContext(ctx context.Context) error { |
| + if err := ctx.Err(); err != nil { |
| + return err |
| + } |
| + select { |
| + case l <- struct{}{}: |
| + return nil |
| + case <-ctx.Done(): |
| + return ctx.Err() |
| + } |
| +} |
| + |
| +// configBeforeWakeBudget bounds what a wake spends on its config: the wait |
| +// for the config lock and the narrowed pass's reads together. A narrowed |
| +// pass is a few bucket reads; the wait is as long as a full pass that |
| +// happens to be running. Past the budget the wake goes on without waiting. |
| +const configBeforeWakeBudget = 5 * time.Second |
| + |
| +// configBeforeWakeAckBudget bounds the config ack a wake's pass writes |
| +// after it has written the file. It is a budget of its own, not what the |
| +// reads left of the wake's: the ack is the pass's last step, no later pass |
| +// writes one for a file that is by then up to date, and so an ack cut off |
| +// by a budget the lock wait had spent would be lost for good. The config |
| +// loops write theirs under no deadline at all. |
| +// |
| +// So the two budgets add up. With the scheduler armed the ack is written |
| +// later, when the revision is active, and the hook holds a wake for |
| +// configBeforeWakeBudget at most. Without it the pass writes the ack |
| +// in line, and the most a wake can be held is the two together: about ten |
| +// seconds, when the lock wait or the reads use up the first and the ack |
| +// then runs to the end of its own. |
| +const configBeforeWakeAckBudget = 5 * time.Second |
| + |
| +// configBeforeWakeRetry is how long a wake's pass that left a host |
| +// unsettled is not run again for it: a host whose bundle will not read, or |
| +// which the config guard refuses, is asked for again by every retried |
| +// request, and each pass is a set of bucket reads. The config guard's own |
| +// refusals are remembered for as long (configGuardRefuseTTL). |
| +// |
| +// Only an attempt that ran starts the window: one that reached the store |
| +// and could not open it, or one that took the config lock. A wake that |
| +// gave up waiting for the lock read nothing and found nothing out, so it |
| +// starts none, and the next wake of that host asks again. Creating an |
| +// instance starts a config pass of its own at about the time of the first |
| +// wake, so the first wake is the likeliest to find the lock held; had it |
| +// started the window, the wake that follows seconds later (eighteen, in |
| +// the production trace above) would not have asked, and the first |
| +// generation would have started without its config after all. |
| +const configBeforeWakeRetry = configGuardRefuseTTL |
| + |
| +// wakeConfigLegs are the restart legs of a wake's own config pass. The |
| +// instance is inside the wake that asked, so nothing is restarted and |
| +// nothing counts as awake: the wake about to spawn is what reads the file, |
| +// which is exactly "delivered on wake". A managed instance does not come |
| +// through these: the scheduler hears the delivery (ConfigDelivered) and the |
| +// wake's own healthy event activates it. |
| +var wakeConfigLegs = configLegs{ |
| + awake: func(string) bool { return false }, |
| + restart: func(string) error { return appconfig.ErrDeliveredOnWake }, |
| +} |
| + |
| +// configSettled is the hosts whose config file the last pass to name them |
| +// left as it resolved it: written, up to date, or rightly absent |
| +// (appconfig.WithHostOutcome). A wake of one of them has nothing to ask the |
| +// bucket. A host a pass left undone (its instance directory not made yet, |
| +// its bundle unread) is not in it, nor is one no pass has named: those are |
| +// the wakes that run a pass of their own. |
| +var configSettled settledHosts |
| + |
| +type settledHosts struct { |
| + mu sync.Mutex |
| + hosts map[string]bool |
| + // asked is when a wake last ran a pass of its own for a host |
| + // (configBeforeWakeRetry). now is the clock; nil is time.Now. |
| + asked map[string]time.Time |
| + now func() time.Time |
| +} |
| + |
| +// due reports whether a wake may run a pass for host now, and records |
| +// that it does: false while the last one is younger than |
| +// configBeforeWakeRetry. Entries older than that are dropped as it goes, |
| +// so the map holds only the hosts asked about in the last window. |
| +func (s *settledHosts) due(host string) bool { |
| + return s.dueAt(host, true) |
| +} |
| + |
| +// askedLately is due's answer turned round, with nothing recorded: the |
| +// check a wake makes before it has an attempt to record. |
| +func (s *settledHosts) askedLately(host string) bool { |
| + return !s.dueAt(host, false) |
| +} |
| + |
| +func (s *settledHosts) dueAt(host string, record bool) bool { |
| + s.mu.Lock() |
| + defer s.mu.Unlock() |
| + now := time.Now() |
| + if s.now != nil { |
| + now = s.now() |
| + } |
| + for h, at := range s.asked { |
| + if now.Sub(at) >= configBeforeWakeRetry { |
| + delete(s.asked, h) |
| + } |
| + } |
| + if _, recent := s.asked[host]; recent { |
| + return false |
| + } |
| + if !record { |
| + return true |
| + } |
| + if s.asked == nil { |
| + s.asked = map[string]time.Time{} |
| + } |
| + s.asked[host] = now |
| + return true |
| +} |
| + |
| +// record keeps one pass's outcomes. A complete pass named every host that |
| +// takes a config file, so a host it did not name is gone (its row deleted, |
| +// or no longer a shape that takes one) and is forgotten: a host created |
| +// again under the same name is asked about afresh. A narrowed or failed |
| +// pass only updates the hosts it named. |
| +func (s *settledHosts) record(outcomes map[string]bool, complete bool) { |
| + s.mu.Lock() |
| + defer s.mu.Unlock() |
| + if complete || s.hosts == nil { |
| + s.hosts = map[string]bool{} |
| + } |
| + for host, done := range outcomes { |
| + if done { |
| + s.hosts[host] = true |
| + } else { |
| + delete(s.hosts, host) |
| + } |
| + } |
| +} |
| + |
| +func (s *settledHosts) has(host string) bool { |
| + s.mu.Lock() |
| + defer s.mu.Unlock() |
| + return s.hosts[host] |
| +} |
| + |
| +// syncExecLocked is one SyncExec pass under configSyncMu, which the caller |
| +// holds. legs are the pass's restart legs: the activator's for the config |
| +// loops, a wake's own for the pass it runs before it plans |
| +// (configBeforeWake). ackCtx is the context its config acks are written |
| +// under: the pass's own for the config loops, a budget of its own for a |
| +// wake's pass (configBeforeWakeAckBudget). more are that caller's further |
| +// options. |
| +func syncExecLocked(ctx, ackCtx context.Context, keep func(registry.Route) bool, reg *registry.Registry, store release.Store, priv *ecdh.PrivateKey, dd string, legs configLegs, more []appconfig.SyncOption, writes ...hostwrite.Config) error { |
| + pending := map[string]string{} |
| + outcomes := map[string]bool{} |
| + opts := []appconfig.SyncOption{ |
| + appconfig.SkipFenced(func(host string) bool { return layout.JournalPresent(dd, host) }), |
| + appconfig.WhenInstanceDirAbsent(func(host, dir string) { pending[host] = dir }), |
| + appconfig.WithHostOutcome(func(host string, done bool) { outcomes[host] = done }), |
| + } |
| + if keep != nil { |
| + opts = append(opts, appconfig.WithRouteFilter(keep)) |
| + } |
| + opts = append(opts, more...) |
| + for _, cfg := range writes { |
| + opts = append(opts, appconfig.WithHostWrite(cfg)) |
| + } |
| + // CARLOS_SWAP=overlap: the scheduler restarts, paced, and acknowledges a |
| + // revision once it is active; refusing: no restart. configSyncMu, which |
| + // the caller holds, is what makes ConfigDelivered serial per host. |
| + var err error |
| + if cb, ok := rolloutConfigCallbacks(ackCtx, store, legs); ok { |
| + err = appconfig.SyncExecWithCallbacks(ctx, reg, store, priv, dd, os.Getenv("PLATFORM_APPS_DOMAIN"), cb, opts...) |
| + } else { |
| + err = appconfig.SyncExec(ctx, reg, store, priv, dd, legs.restart, os.Getenv("PLATFORM_APPS_DOMAIN"), configAckFunc(ackCtx, store, "agent"), opts...) |
| + } |
| + // A filtered pass names only the routes it kept, so it is never |
| + // complete: a host it left out keeps its wait (pendingDirs.record). |
| + configDirsPending.record(pending, outcomes, err == nil && keep == nil) |
| + configSettled.record(outcomes, err == nil && keep == nil) |
| + return err |
| +} |
| + |
| +// configBeforeWake is the agent's activator.Service.ConfigBeforeWake. The |
| +// key and the store are the armed config guard's: the guard read |
| +// CARLOS_SECRETS_KEY once and keeps the deploy store it opened, and it is |
| +// asked about this same wake at the lease. A box with no guard, no usable |
| +// key or no store has no config to deliver, and the hook does nothing. |
| +func configBeforeWake(reg *registry.Registry, dd string, writes hostwrite.Config) func(context.Context, registry.Route) { |
| + return func(ctx context.Context, rt registry.Route) { |
| + g := armedConfigGuard.Load() |
| + if g == nil || g.priv == nil { |
| + return |
| + } |
| + deliverConfigBeforeWake(ctx, rt, reg, g.deployStore, g.priv, dd, writes) |
| + } |
| +} |
| + |
| +// deliverConfigBeforeWake is configBeforeWake's body, with the store and |
| +// the key handed in. A route config sync delivers no file to |
| +// (appconfig.ExecSpawned: no pass would name it), one whose file is already |
| +// there, and one a pass has settled with no file (configSettled) are left |
| +// alone: the config loops own every later change to them. So is one a |
| +// wake's pass was run for inside the last configBeforeWakeRetry and left |
| +// unsettled. That window starts only once an attempt has run: at a store |
| +// that will not open, or with the config lock in hand, never at a wait for |
| +// the lock that timed out. Lstat only: a nested row's file is on ground its |
| +// tenant can write, and nothing here follows or opens it. |
| +func deliverConfigBeforeWake(wake context.Context, rt registry.Route, reg *registry.Registry, openStore func(context.Context) (release.Store, error), priv *ecdh.PrivateKey, dd string, writes hostwrite.Config) { |
| + if !appconfig.ExecSpawned(rt) { |
| + return |
| + } |
| + if _, err := os.Lstat(appconfig.ConfigEnvPath(dd, rt)); err == nil || configSettled.has(rt.Host) || configSettled.askedLately(rt.Host) { |
| + return |
| + } |
| + ctx, cancel := context.WithTimeout(wake, configBeforeWakeBudget) |
| + defer cancel() |
| + // The ack outlives the reads' budget and the request that began the |
| + // wake (configBeforeWakeAckBudget): the file it reports is written. |
| + ackCtx, cancelAck := context.WithTimeout(context.WithoutCancel(wake), configBeforeWakeAckBudget) |
| + defer cancelAck() |
| + store, err := openStore(ctx) |
| + if err != nil { |
| + // The config guard refuses this wake at the lease if the store |
| + // stays unreadable, and says so; nothing to add here. The store |
| + // was asked, so this attempt starts the retry window. |
| + configSettled.due(rt.Host) |
| + return |
| + } |
| + if err := configSyncMu.lockContext(ctx); err != nil { |
| + log.Printf("agent: %s: its config was not checked before its wake (a config pass held the lock past the wake's budget of %s); config sync delivers it", rt.Host, configBeforeWakeBudget) |
| + return |
| + } |
| + defer configSyncMu.Unlock() |
| + host := rt.Host |
| + // The lock is this wake's, so its attempt runs and the retry window |
| + // starts here. The pass it waited behind may have settled the host, and |
| + // another wake of it may have run this pass in the meantime: either |
| + // leaves nothing to ask. |
| + if configSettled.has(host) || !configSettled.due(host) { |
| + return |
| + } |
| + only := func(r registry.Route) bool { return r.Host == host } |
| + if err := syncExecLocked(ctx, ackCtx, only, reg, store, priv, dd, wakeConfigLegs, []appconfig.SyncOption{appconfig.MakeInstanceDir()}, writes); err != nil { |
| + log.Printf("agent: %s: config before its wake: %v; config sync delivers it", host, err) |
| + } |
| +} |
diff --git a/internal/host/configbeforewake_test.go b/internal/host/configbeforewake_test.go| new file mode 100644 |
| index 000000000..d23f519ec |
| --- /dev/null |
| +++ b/internal/host/configbeforewake_test.go |
| @@ -0,0 +1,352 @@ |
| +package host |
| + |
| +import ( |
| + "context" |
| + "crypto/ecdh" |
| + "os" |
| + "path/filepath" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/appconfig" |
| + "github.com/carlosframework/platform/internal/hostwrite" |
| + "github.com/carlosframework/platform/internal/provision" |
| + "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// wakeConfigKit is a box with one app that has settings, and a nested |
| +// hibernating instance of it that has never woken: no instance directory. |
| +type wakeConfigKit struct { |
| + ctx context.Context |
| + store release.Store |
| + reg *registry.Registry |
| + dd string |
| + rt registry.Route |
| + priv *ecdh.PrivateKey |
| + opens int |
| + deliver |
| +} |
| + |
| +type deliver func(ctx context.Context, rt registry.Route) |
| + |
| +func newWakeConfigKit(t *testing.T, vars map[string]string) *wakeConfigKit { |
| + t.Helper() |
| + configDirsPending = pendingDirs{} |
| + configSettled = settledHosts{} |
| + t.Cleanup(func() { configDirsPending = pendingDirs{}; configSettled = settledHosts{} }) |
| + k := &wakeConfigKit{ctx: context.Background(), store: release.NewDirStore(t.TempDir()), reg: restartTestRegistry(t), dd: t.TempDir()} |
| + privText, _, err := appconfig.GenerateKey() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + priv, err := appconfig.ParsePrivateKey(privText, "test") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + k.priv = priv |
| + if vars != nil { |
| + if err := appconfig.SetEnv(k.ctx, k.store, "bab", "shop", vars); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + host := "shop.example.com" |
| + k.rt = registry.Route{Host: host, Kind: "instance", App: "shop", Account: "bab", Hibernate: true, |
| + Status: "ready", DBPath: provision.NestedDBPath(k.dd, host), Socket: provision.NestedSocket(host)} |
| + if err := k.reg.Upsert(k.rt); err != nil { |
| + t.Fatal(err) |
| + } |
| + open := func(context.Context) (release.Store, error) { k.opens++; return k.store, nil } |
| + k.deliver = func(ctx context.Context, rt registry.Route) { |
| + deliverConfigBeforeWake(ctx, rt, k.reg, open, priv, k.dd, hostwrite.Config{}) |
| + } |
| + return k |
| +} |
| + |
| +func (k *wakeConfigKit) cfgPath() string { |
| + return filepath.Join(provision.InstanceDir(k.dd, k.rt.Host), k.rt.Host+".config.env") |
| +} |
| + |
| +// Production, 2026-11-24: a new instance's first generation ran without its |
| +// app config and was restarted onto it twelve seconds later. Its config |
| +// file lives in its instance directory, which only the first wake made, so |
| +// the config pass before the wake had nowhere to write. Asked before the |
| +// wake is planned, the agent makes the directory as prepare would and |
| +// writes the bundle, so the spawn that follows reads it. |
| +func TestConfigBeforeWakeWritesANewNestedInstancesConfig(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + // The pass every loop runs leaves the directory to the activator and |
| + // writes nothing: the state the wake used to start from. |
| + if err := syncExecSerialized(k.ctx, k.reg, k.store, k.priv, k.dd, nil, hostwrite.Config{}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := os.Lstat(provision.InstanceDir(k.dd, k.rt.Host)); !os.IsNotExist(err) { |
| + t.Fatalf("an ordinary pass made the instance directory (err %v)", err) |
| + } |
| + |
| + k.deliver(k.ctx, k.rt) |
| + |
| + b, err := os.ReadFile(k.cfgPath()) |
| + if err != nil || string(b) != "WOODSTAR_WORLD=https://woodstar.app\n" { |
| + t.Fatalf("before the wake, the bundle = %q, %v: the first process would start without its config", b, err) |
| + } |
| + if fi, err := os.Stat(provision.InstanceDir(k.dd, k.rt.Host)); err != nil || fi.Mode().Perm() != 0o700 { |
| + t.Fatalf("the instance directory = %v, %v, want 0700 as prepare makes it", fi, err) |
| + } |
| + // Delivered, so the generation loop has nothing left to come back for: |
| + // no second pass, and so no restart onto a file the wake already read. |
| + if h, ok := configDirsPending.appeared(); ok { |
| + t.Fatalf("%s is still waited for after its config was delivered", h) |
| + } |
| + // The ack says what happened: delivered for the wake, nothing restarted. |
| + ack, err := appconfig.LatestConfigAck(k.ctx, k.store, k.rt.Host) |
| + if err != nil || ack == nil { |
| + t.Fatalf("config ack = %v, %v", ack, err) |
| + } |
| + if ack.Restarted || !ack.Hibernating || ack.RestartError != "" { |
| + t.Fatalf("config ack = %+v, want delivered on wake with no restart", *ack) |
| + } |
| +} |
| + |
| +// A file that is already there costs the wake one Lstat: no store, no lock, |
| +// no pass. The config loops own every later change to it. |
| +func TestConfigBeforeWakeLeavesAnExistingFileToTheLoops(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + if err := os.MkdirAll(provision.InstanceDir(k.dd, k.rt.Host), 0o700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(k.cfgPath(), []byte("OLD=1\n"), 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| + configSyncMu.Lock() // a pass is running: the wake must not wait for it |
| + defer configSyncMu.Unlock() |
| + k.deliver(k.ctx, k.rt) |
| + if k.opens != 0 { |
| + t.Fatalf("the store was opened %d times for a file that exists", k.opens) |
| + } |
| + if b, _ := os.ReadFile(k.cfgPath()); string(b) != "OLD=1\n" { |
| + t.Fatalf("the existing file was rewritten: %q", b) |
| + } |
| +} |
| + |
| +// An app with no settings has nothing to deliver: no file, and no |
| +// directory left behind for a wake that may yet be refused. Its file stays |
| +// absent for good, so the pass that found that out is the last one a wake |
| +// runs for it: later wakes read nothing from the bucket. |
| +func TestConfigBeforeWakeAsksOnceForAnAppWithNoConfig(t *testing.T) { |
| + k := newWakeConfigKit(t, nil) |
| + k.deliver(k.ctx, k.rt) |
| + if _, err := os.Lstat(provision.InstanceDir(k.dd, k.rt.Host)); !os.IsNotExist(err) { |
| + t.Fatalf("a directory was made for an instance with no config (err %v)", err) |
| + } |
| + if k.opens != 1 { |
| + t.Fatalf("the first wake opened the store %d times, want 1", k.opens) |
| + } |
| + k.deliver(k.ctx, k.rt) |
| + k.deliver(k.ctx, k.rt) |
| + if k.opens != 1 { |
| + t.Fatalf("later wakes of a settled host opened the store (%d opens in all)", k.opens) |
| + } |
| +} |
| + |
| +// What the config loops' own passes find out counts too. A pass that left |
| +// a host's file rightly absent settles it, so its wake asks nothing; a pass |
| +// that could not write for want of the instance directory leaves it |
| +// unsettled, and that wake is the one that asks. Once the app has settings |
| +// the settled host is unsettled again by the pass that could not write them. |
| +func TestConfigBeforeWakeFollowsWhatThePassesSettled(t *testing.T) { |
| + k := newWakeConfigKit(t, nil) |
| + pass := func() { |
| + t.Helper() |
| + if err := syncExecSerialized(k.ctx, k.reg, k.store, k.priv, k.dd, nil, hostwrite.Config{}); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + pass() |
| + k.deliver(k.ctx, k.rt) |
| + if k.opens != 0 { |
| + t.Fatalf("a host the boot pass settled cost its wake %d store opens", k.opens) |
| + } |
| + if err := appconfig.SetEnv(k.ctx, k.store, "bab", "shop", map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + pass() // no instance directory: named, left undone |
| + k.deliver(k.ctx, k.rt) |
| + if b, err := os.ReadFile(k.cfgPath()); err != nil || string(b) != "WOODSTAR_WORLD=https://woodstar.app\n" { |
| + t.Fatalf("the bundle = %q, %v: a host a pass left undone was not asked about at its wake", b, err) |
| + } |
| +} |
| + |
| +// A complete pass that no longer names a host forgets it, so an instance |
| +// deleted and created again under the same name is asked about afresh. |
| +func TestConfigSettledForgetsAHostACompletePassDoesNotName(t *testing.T) { |
| + var s settledHosts |
| + s.record(map[string]bool{"a": true, "b": true}, true) |
| + s.record(map[string]bool{"c": true, "b": false}, false) // narrowed: only what it named |
| + if !s.has("a") || s.has("b") || !s.has("c") { |
| + t.Fatalf("after a narrowed pass: a %v, b %v, c %v; want a and c settled, b not", s.has("a"), s.has("b"), s.has("c")) |
| + } |
| + s.record(map[string]bool{"c": true}, true) |
| + if s.has("a") || !s.has("c") { |
| + t.Fatalf("after a complete pass without a: a %v, c %v", s.has("a"), s.has("c")) |
| + } |
| +} |
| + |
| +// A route config sync delivers no file to is not looked at, on any wake: a |
| +// unit-backed route's config is the root pass's, and a row that names its |
| +// own unit, or is not ready, is one no pass would name, so a pass for it |
| +// could never settle it. |
| +func TestConfigBeforeWakeSkipsARouteConfigSyncDoesNotDeliverTo(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + for name, change := range map[string]func(*registry.Route){ |
| + "unit-backed": func(rt *registry.Route) { rt.Backing = registry.BackingUnit }, |
| + "names its unit": func(rt *registry.Route) { rt.Unit = "shop.service" }, |
| + "not ready": func(rt *registry.Route) { rt.Status = "moving" }, |
| + "platform": func(rt *registry.Route) { rt.Platform = true }, |
| + } { |
| + rt := k.rt |
| + change(&rt) |
| + k.deliver(k.ctx, rt) |
| + if k.opens != 0 { |
| + t.Fatalf("%s: the store was opened %d times", name, k.opens) |
| + } |
| + } |
| +} |
| + |
| +// A host whose bundle will not read stays unsettled, and every retried |
| +// request for it reaches the hook. One pass is run for it, then none until |
| +// configBeforeWakeRetry has gone by: the bucket is not read once per |
| +// request for a host that keeps failing. |
| +func TestConfigBeforeWakeDoesNotAskAgainInsideItsRetryWindow(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + blip := &blipStore{Store: k.store, key: appconfig.Key("bab", "shop"), fail: true} |
| + k.store = blip |
| + now := time.Unix(1_800_000_000, 0) |
| + configSettled.now = func() time.Time { return now } |
| + for range 3 { |
| + k.deliver(k.ctx, k.rt) |
| + } |
| + if k.opens != 1 { |
| + t.Fatalf("three wakes inside the window opened the store %d times, want 1", k.opens) |
| + } |
| + if _, err := os.Lstat(k.cfgPath()); !os.IsNotExist(err) { |
| + t.Fatalf("a bundle that did not read was written (err %v)", err) |
| + } |
| + // The window over and the bucket back: the next wake delivers. |
| + now = now.Add(configBeforeWakeRetry) |
| + blip.fail = false |
| + k.deliver(k.ctx, k.rt) |
| + if b, err := os.ReadFile(k.cfgPath()); err != nil || string(b) != "WOODSTAR_WORLD=https://woodstar.app\n" { |
| + t.Fatalf("after the window, the bundle = %q, %v", b, err) |
| + } |
| +} |
| + |
| +// ackCutStore ends the wake's context at the moment the pass first reads |
| +// the config ack's key, which is after the file is written, and from then |
| +// on answers every call the way a real store does for a context that is |
| +// done. |
| +type ackCutStore struct { |
| + release.Store |
| + ackKey string |
| + cut context.CancelFunc |
| +} |
| + |
| +func (s *ackCutStore) Get(ctx context.Context, key string) ([]byte, string, error) { |
| + if key == s.ackKey { |
| + s.cut() |
| + } |
| + if err := ctx.Err(); err != nil { |
| + return nil, "", err |
| + } |
| + return s.Store.Get(ctx, key) |
| +} |
| + |
| +func (s *ackCutStore) Put(ctx context.Context, key string, body []byte, ifMatch string) (string, error) { |
| + if err := ctx.Err(); err != nil { |
| + return "", err |
| + } |
| + return s.Store.Put(ctx, key, body, ifMatch) |
| +} |
| + |
| +// The ack is the pass's last step, and no later pass writes one for a file |
| +// that is by then up to date. It is written under a budget of its own, so |
| +// a wake whose request went away, or whose budget the lock wait spent, |
| +// still leaves the ack for the file it wrote. |
| +func TestConfigBeforeWakeAcksAFileItWroteThoughItsWakeEnded(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + wake, cancel := context.WithCancel(k.ctx) |
| + defer cancel() |
| + plain := k.store |
| + k.store = &ackCutStore{Store: plain, ackKey: appconfig.ConfigAckKey(BoxLabel(), k.rt.Host), cut: cancel} |
| + k.deliver(wake, k.rt) |
| + if wake.Err() == nil { |
| + t.Fatal("the ack's key was never read: the test no longer cuts the wake where it means to") |
| + } |
| + if _, err := os.Lstat(k.cfgPath()); err != nil { |
| + t.Fatalf("the file was not written: %v", err) |
| + } |
| + ack, err := appconfig.LatestConfigAck(k.ctx, plain, k.rt.Host) |
| + if err != nil || ack == nil { |
| + t.Fatalf("config ack = %v, %v: the ack of a written file was lost with the wake's context", ack, err) |
| + } |
| +} |
| + |
| +// The hook never holds a wake behind a config pass past its budget: with |
| +// the lock held and the wake's context done, it returns having written |
| +// nothing, and the wake goes on as it did before the hook existed. |
| +func TestConfigBeforeWakeGivesUpWhenAPassHoldsTheLock(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + configSyncMu.Lock() |
| + defer configSyncMu.Unlock() |
| + ctx, cancel := context.WithCancel(k.ctx) |
| + cancel() |
| + k.deliver(ctx, k.rt) |
| + if _, err := os.Lstat(provision.InstanceDir(k.dd, k.rt.Host)); !os.IsNotExist(err) { |
| + t.Fatalf("the hook wrote without the config lock (err %v)", err) |
| + } |
| +} |
| + |
| +// Production, 2026-11-24: creating an instance starts a config pass at about |
| +// the time of its first wake, and the wake that went on to start came |
| +// eighteen seconds after the first one. A first wake that gives up waiting |
| +// for that pass's lock has read nothing and found nothing out, so it does |
| +// not start the retry window: the next wake asks again and delivers. Had |
| +// the timed-out wait started the window, the later wake would have been |
| +// kept from asking for thirty seconds, and the first generation would have |
| +// started without its config after all. |
| +func TestConfigBeforeWakeALockTimeoutDoesNotStartTheRetryWindow(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + now := time.Unix(1_800_000_000, 0) |
| + configSettled.now = func() time.Time { return now } |
| + |
| + configSyncMu.Lock() // the config pass the instance's creation started |
| + gone, cancel := context.WithCancel(k.ctx) |
| + cancel() // the first wake's budget, spent |
| + k.deliver(gone, k.rt) |
| + configSyncMu.Unlock() |
| + if _, err := os.Lstat(k.cfgPath()); !os.IsNotExist(err) { |
| + t.Fatalf("the wake that never had the lock wrote the file (err %v)", err) |
| + } |
| + |
| + // The wake that follows, inside what would have been the window. |
| + now = now.Add(18 * time.Second) |
| + k.deliver(k.ctx, k.rt) |
| + if b, err := os.ReadFile(k.cfgPath()); err != nil || string(b) != "WOODSTAR_WORLD=https://woodstar.app\n" { |
| + t.Fatalf("after a wake that timed out on the config lock, the next wake's bundle = %q, %v: the timeout kept it from asking, and the first process would start without its config", b, err) |
| + } |
| +} |
| + |
| +// With no armed guard, or a guard with no usable key, the agent's hook does |
| +// nothing: such a box has no config to deliver. |
| +func TestConfigBeforeWakeNeedsTheArmedGuardsKey(t *testing.T) { |
| + k := newWakeConfigKit(t, map[string]string{"WOODSTAR_WORLD": "https://woodstar.app"}) |
| + armConfigGuard(nil) |
| + t.Cleanup(func() { armConfigGuard(nil) }) |
| + hook := configBeforeWake(k.reg, k.dd, hostwrite.Config{}) |
| + hook(k.ctx, k.rt) |
| + armConfigGuard(newConfigGuard(func(string) string { return "" }, func(context.Context) (release.Store, error) { return k.store, nil })) |
| + hook(k.ctx, k.rt) |
| + if _, err := os.Lstat(provision.InstanceDir(k.dd, k.rt.Host)); !os.IsNotExist(err) { |
| + t.Fatalf("a keyless box delivered config (err %v)", err) |
| + } |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 00010a1bb..90ce7d6d8 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -288,3 +288,4 @@ plan14-root-reads-parent-delegation-1383.tsv 841361b89e20c3763149e8784cdebb037dc |
| plan14-root-reads-alias-publish-precert-1293.tsv c25a6eac6ece70098b052b6451deff684c29ff8cfcd24ba37625f01028dedf88 |
| plan14-root-reads-domain-transfers.tsv c25a6eac6ece70098b052b6451deff684c29ff8cfcd24ba37625f01028dedf88 |
| plan14-root-reads-console-addr-from-install.tsv f273b5cb7bbf37b6dca4bb964a9293cbec15b14c1c0a19b9010c177f20789a86 |
| +plan14-root-reads-instance-ready-before-wake.tsv aa953b1a43009c8208e44c67f5b8127ae1914b15d8b8822bcf16b19a6abdf121 |
diff --git a/internal/provision/testdata/plan14-root-reads-instance-ready-before-wake.tsv b/internal/provision/testdata/plan14-root-reads-instance-ready-before-wake.tsv| new file mode 100644 |
| index 000000000..d6e72c112 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-instance-ready-before-wake.tsv |
| @@ -0,0 +1,22 @@ |
| +# Census overlay instance-ready-before-wake, written by census-propose (#369). census-ruling-instance-ready-before-wake, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-instance-ready-before-wake.md. |
| +# 3 body, 1 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 5 new dispositions: 0 reads re-frozen at their disposition with the claim, 5 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@legacy 1b8cf4b8b83b40404ca9652d9515bf2f8752c214fd80cee72d949c5663afe5a6 internal/appconfig/syncexec.go SyncExecWithCallbacks legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=route-and-input (J1,J4, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), through syncExecSerialized: main's body, with a nested row whose write found no instance directory named and skipped (errInstanceDirAbsent, WhenInstanceDirAbsent) instead of failing the pass, and each in-scope host reported done or not done (WithHostOutcome) once the pass has gone through every route; no new read site;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=the scoped pass's route filter (WithRouteFilter, syncOptions.kept) is checked in its three route loops, so a route the filter leaves out is out of scope before anything is read for it; three whole-Route sites added, each passing rt to kept; no bucket or file read added;rev3=census-ruling-team-scoped-credentials;basis=team-scoped credentials (#449 §3): checkOptedIn's default-bundle thunk answers no default bundle for an OWNED environment bundle, so its exec_delivery is its own and never inherited; the same bundle reads as before, no read site added;rev3=census-ruling-named-unit-delivery-114;basis=the stale-file notice loop gains the stamped case: os.Stat of ConfigEnvPath(dataDir, rt), the path the exec-addr case already stats, and a notice line; no write, no new path;rev3=census-ruling-design-console-secrets;basis=the <host>.config collision set is built by routeHostSet (shared with the classifier) instead of inline; same rows read, same skip; no read site added;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos, through syncExecLocked (root never calls SyncExec): the per-host call is now syncExecHostMaking with the pass MakeInstanceDir option (false under host writes). With the option off, as every config loop pass leaves it, the body is as before. No new read site. file:Stat@28864,file:Stat@30093,registry:App@10524,registry:App@10739,registry:App@16285,registry:App@28744,registry:Environment@10532,registry:Environment@10747,registry:Environment@16293,registry:Environment@28752,registry:Host@1031,registry:Host@1066,registry:Host@15793,registry:Host@16120,registry:Host@16218,registry:Host@17050,registry:Host@17401,registry:Host@18336,registry:Host@18877,registry:Host@21804,registry:Host@22021,registry:Host@22599,registry:Host@22779,registry:Host@22788,registry:Host@22807,registry:Host@25741,registry:Host@26358,registry:Host@26410,registry:Host@26566,registry:Host@29261,registry:Host@30411,registry:Host@866,registry:Host@937,whole:Route@10294,whole:Route@10352,whole:Route@10417,whole:Route@10478,whole:Route@10519,whole:Route@10636,whole:Route@10670,whole:Route@10734,whole:Route@1434,whole:Route@15705,whole:Route@15755,whole:Route@16280,whole:Route@25304,whole:Route@25751,whole:Route@26455,whole:Route@28612,whole:Route@28634,whole:Route@28692,whole:Route@28739,whole:Route@28844,whole:Route@29302,whole:Route@30073,whole:Route@30652,whole:Route@30725,whole:Route@693,whole:Route@721,whole:Route@750,whole:Route@776,whole:Route@811 fd973880272eb949a799ff2b447290ba922c3a70f6fc691ae41405232507deb7 |
| +@legacy c678d81e80f6592471c9eb6541dbd0b12df9b0f2f60e6e104641027a54e93bd3 internal/activator/configbeforewake.go Service.configBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: calls the ConfigBeforeWake hook with the wake route, unless the hook is nil, the wake is a hold swap pinned wake (e.pin) or a fallback second pass (wakeFallbackKey). Reads only in-memory state and the route already in hand. whole:Route@258 6399df728bf3a5703f46d56e0bcda13a3b2490f39b6d9d57637658ef7136e3ec |
| +@legacy 63e058cea5b592631e05edc06c2f9ee6a78e179a59de3dc0b29996c5c5e572e3 internal/appconfig/syncexec.go ExecSpawned legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, pure: execSyncable or execSidecarCandidate over the route handed in, the sweep own scope test exported for the agent pass before a wake. Reads only that route. whole:Route@64,whole:Route@92 88a6489c054186890d32d32d53da14c222fa2588fc7413e550924bd7417e0396 |
| +@legacy 2c39ad99c9e89191d44291ffbc3f8bdfd0d2849f6aaaea089eb56900f2ade531 internal/appconfig/syncexec.go syncExecHostMaking legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: syncExecHostClaimed, and when the pass asked for it (MakeInstanceDir, set only by the agent own pass before a wake) and the write found no instance directory, os.MkdirAll of provision.InstanceDir(dataDir, host) at 0700, the same call and mode the activator prepare makes at that wake, then the same write once more. A write under /data by the agent, never root. The registry Host and Route reads are the row the pass already holds. registry:Host@607,whole:Route@309,whole:Route@494,whole:Route@683 7aed70f5c1f2cfbf428e1cea4a0f19bd9f5b315bdfb9b2854741b6b56575d60b |
| +@legacy 63832e4201c26a585011e3be94e893685adaea7313302f1d66c135f11862fb42 internal/host/configbeforewake.go configBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: the hook runAgent sets. Takes the key and the deploy store from the armed config guard (the same key the config loops parse from CARLOS_SECRETS_KEY) and calls deliverConfigBeforeWake. Does nothing without a guard or a usable key. whole:Route@286 f8f7bf9e9f39049554cffab1069675efffd18f27968bdfad9d582f5f0753528f |
| +@legacy 03aa016aacd19744dda0ac77249f8b07304c5ce2fde1d3a25be1211e3f432365 internal/host/configbeforewake.go deliverConfigBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: for a route config sync delivers a file to (appconfig.ExecSpawned), one os.Lstat of its own config path under /data (appconfig.ConfigEnvPath, never followed or opened). When the file is absent, no pass has settled the host and no attempt ran for it in the last 30s, one SyncExec pass narrowed to that host under configSyncMu, its lock wait and reads bounded by a 5s budget and its config ack by 5s more (so up to about 10s on a box that acks in line), with MakeInstanceDir and no restart leg. The 30s window starts only when an attempt ran: at a store that would not open, or once the lock is held, where the settled and window checks are made again (in-memory, configSettled); a wait for the lock that timed out starts none, so the next wake asks again (census review P3, #280). That change adds one registry Host site (rt.Host handed to the window at the store failure), the route the activator handed in; no file or bucket read is added: the same one Lstat, before the lock. The registry Host reads are the route the activator handed in. Not reachable from root: only the agent wake path calls it. file:Lstat@270,registry:Host@1002,registry:Host@1232,registry:Host@1315,registry:Host@1680,registry:Host@345,registry:Host@383,whole:Route@238,whole:Route@307 63bcbc5945dafd3263864d7b616c36b89d71a401163733fd1cc81b3b10eca206 |
| +@legacy 5b0b3da8648fed2cc1fd2323209a1d2aadad19cc7bb60da32fc83150e86495a8 internal/activator/activator.go Service.doWakeOnce legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged.;rev3=census-ruling-sr-followups;basis=#1061 Task 1, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): a refused plan now returns planRefusal(host, plan) instead of the inline fmt.Errorf, the text is unchanged, and when the planner marked the plan Installing the error also matches errBuildNotInstalled (installRefusal, in memory). Same refusal at the same point before the lease, read sites unchanged, no read, file, store, bucket or root call added;rev3=census-ruling-replica-wake-gap;basis=Step 2c: before the seed and the spawn, asks the lease to ProtectStart(rt.DBPath), the route's own database path already used by Restore and retainDatabase; a refusal gives the lease back and starts nothing. Agent code (user carlos); no root call, no new store or file read here.;rev3=census-ruling-replica-wake-gap-ch;basis=Step 2c's body moved unchanged into protectBeforeStart (replicatebeforestart.go); doWakeOnce passes the whole Route it already holds and returns the error. No read added; the DBPath read moved with the body.;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos: one call, step 0.69, a.configBeforeWake(ctx, e, rt), after the held wake check and before the planner. It hands the hook the route this wake already holds (the added whole Route site). It returns nothing, so no refusal, lease, restore or spawn ordering changes. registry:DBPath@2071,registry:DBPath@2087,registry:DBPath@2214,registry:DBPath@2225,registry:FleetBoxes@12276,registry:GoodVersion@18566,registry:Host@1900,registry:Host@1975,registry:Host@2053,registry:Host@2205,registry:Host@2539,registry:Host@4556,registry:Host@6813,registry:Host@949,registry:Replication@17193,registry:Replication@17322,registry:Replication@17341,registry:Replication@17422,registry:Replication@33794,registry:Seed@22478,registry:SeedSource@35254,registry:Socket@2100,registry:Socket@2116,registry:Socket@2239,registry:Socket@2250,registry:Stateless@10336,registry:Stateless@10622,registry:Stateless@11994,registry:Stateless@12324,registry:Stateless@20975,registry:Stateless@9879,registry:Stateless@9970,whole:Route@10408,whole:Route@10567,whole:Route@10946,whole:Route@11044,whole:Route@11135,whole:Route@11267,whole:Route@11390,whole:Route@11444,whole:Route@11716,whole:Route@11892,whole:Route@11896,whole:Route@12683,whole:Route@12958,whole:Route@13276,whole:Route@142,whole:Route@14737,whole:Route@15414,whole:Route@16295,whole:Route@17173,whole:Route@17424,whole:Route@18769,whole:Route@19360,whole:Route@19525,whole:Route@1998,whole:Route@20461,whole:Route@21257,whole:Route@21532,whole:Route@21728,whole:Route@22579,whole:Route@22650,whole:Route@2434,whole:Route@2439,whole:Route@2493,whole:Route@2499,whole:Route@25144,whole:Route@2565,whole:Route@2573,whole:Route@2629,whole:Route@27002,whole:Route@27648,whole:Route@28955,whole:Route@29109,whole:Route@29608,whole:Route@29678,whole:Route@30265,whole:Route@31350,whole:Route@31781,whole:Route@31989,whole:Route@32043,whole:Route@32972,whole:Route@33157,whole:Route@333,whole:Route@33957,whole:Route@34028,whole:Route@34746,whole:Route@34795,whole:Route@35189,whole:Route@35371,whole:Route@3591,whole:Route@36623,whole:Route@36718,whole:Route@3685,whole:Route@3752,whole:Route@37559,whole:Route@4446,whole:Route@6182,whole:Route@6441,whole:Route@6703,whole:Route@6708,whole:Route@6765,whole:Route@6771,whole:Route@6840,whole:Route@6848,whole:Route@7164,whole:Route@7225,whole:Route@729,whole:Route@7323,whole:Route@7633,whole:Route@8534,whole:Route@934,whole:Route@9483,whole:Route@9707,whole:Route@9771,whole:Route@9815 72ca438f2e11c7a6eb14e09c895b481898b0162c786180e1c3fc61272b3392ce |
| +internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added;rev3=census-ruling-stateless-replicas-4-drill1;basis=#511 drill 1 R20 bound (round 1: clock with start and last seen): one in-memory field, releaseConfigWaits (per host, a stateless release's config wait), under mu; no read;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 review round 2 (#511): one field, retiringCopy, an atomic pointer to the edge's in-memory retired-copy check, handed over by edge.New (SetRetiringCopy); no read, no root decision;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: four fields, fenceWatchers (sync.WaitGroup of running write-fence watchers) and three test seams nil in production (fenceWatchStarted, retainDB, wakeReturned). Declaration only, no read.;rev3=census-ruling-fleet-record-labels-m1;basis=fleet record labels R1/R2: actEntry gains checkpoint state (busy while CloseProven runs, unproven, named-once flag for C45), in-memory under a.mu; the worker gains fence pacing apart from crash backoff; Service gains test seams nil in production; declarations only, no read;rev3=census-ruling-race-activator-1249;basis=adds two test-only fields: leaseWork (a WaitGroup counting lease watches and the one-shot stops a short lease starts) and leaseWatchStop (a channel, nil in production, that a test closes to end every lease watch); no read added and production never waits on or closes either;rev3=census-ruling-fleet-restart-wake;basis=Fleet restart wake Task 1: the per-host journal note maps (wakeFailLogged, heldSeen) move into the embedded wakeNotes struct in wakefaillog.go, which adds fenceSeen. In-memory only; no read added.;rev3=census-ruling-stateless-scale-2-fleet-sizes;basis=the agent (carlos-edge.service, user carlos), not root: one embedded field (#892 S2), fleetSizeService (fleetreserve.go), which holds BoxLabel (string, the rollout's own box label, set by armRollout) and fleetReserve (fleetReservations, ready as its zero value; it reads /proc/meminfo through memAvailable only when a fleet-size overlap reserves), the box's in-memory overlap reservation for fleet sizes. Declaration only; no read added;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos: gains the ConfigBeforeWake hook field beside Planner, a func the agent sets before Start. No read added. e7ccecb623a17e4997d4522352721273aec318985704dd2d20827b2d615a04bc |
| +internal/appconfig/syncexec.go SyncExecWithCallbacks legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=route-and-input (J1,J4, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), through syncExecSerialized: main's body, with a nested row whose write found no instance directory named and skipped (errInstanceDirAbsent, WhenInstanceDirAbsent) instead of failing the pass, and each in-scope host reported done or not done (WithHostOutcome) once the pass has gone through every route; no new read site;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=the scoped pass's route filter (WithRouteFilter, syncOptions.kept) is checked in its three route loops, so a route the filter leaves out is out of scope before anything is read for it; three whole-Route sites added, each passing rt to kept; no bucket or file read added;rev3=census-ruling-team-scoped-credentials;basis=team-scoped credentials (#449 §3): checkOptedIn's default-bundle thunk answers no default bundle for an OWNED environment bundle, so its exec_delivery is its own and never inherited; the same bundle reads as before, no read site added;rev3=census-ruling-named-unit-delivery-114;basis=the stale-file notice loop gains the stamped case: os.Stat of ConfigEnvPath(dataDir, rt), the path the exec-addr case already stats, and a notice line; no write, no new path;rev3=census-ruling-design-console-secrets;basis=the <host>.config collision set is built by routeHostSet (shared with the classifier) instead of inline; same rows read, same skip; no read site added;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos, through syncExecLocked (root never calls SyncExec): the per-host call is now syncExecHostMaking with the pass MakeInstanceDir option (false under host writes). With the option off, as every config loop pass leaves it, the body is as before. No new read site. file:Stat@28864,file:Stat@30093,registry:App@10524,registry:App@10739,registry:App@16285,registry:App@28744,registry:Environment@10532,registry:Environment@10747,registry:Environment@16293,registry:Environment@28752,registry:Host@1031,registry:Host@1066,registry:Host@15793,registry:Host@16120,registry:Host@16218,registry:Host@17050,registry:Host@17401,registry:Host@18336,registry:Host@18877,registry:Host@21804,registry:Host@22021,registry:Host@22599,registry:Host@22779,registry:Host@22788,registry:Host@22807,registry:Host@25741,registry:Host@26358,registry:Host@26410,registry:Host@26566,registry:Host@29261,registry:Host@30411,registry:Host@866,registry:Host@937,whole:Route@10294,whole:Route@10352,whole:Route@10417,whole:Route@10478,whole:Route@10519,whole:Route@10636,whole:Route@10670,whole:Route@10734,whole:Route@1434,whole:Route@15705,whole:Route@15755,whole:Route@16280,whole:Route@25304,whole:Route@25751,whole:Route@26455,whole:Route@28612,whole:Route@28634,whole:Route@28692,whole:Route@28739,whole:Route@28844,whole:Route@29302,whole:Route@30073,whole:Route@30652,whole:Route@30725,whole:Route@693,whole:Route@721,whole:Route@750,whole:Route@776,whole:Route@811 fd973880272eb949a799ff2b447290ba922c3a70f6fc691ae41405232507deb7 |
| +internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-stateless-replicas-4-task1;basis=Arms the fleet-only replica swap worker next to the placement worker: same console URL and fleet token as the existing replicaCoordinatorAPI, the existing activator Service; stops and joins at shutdown. No new read site, credential or bucket reader.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: sets deployWorker.step to the rollout scheduler answer for the record permit (replicaStepOf over armedRollout), an in-memory callback; no read site, credential or bucket reader added.;rev3=census-ruling-stateless-replicas-4-task2-fix2;basis=Task 2 fix round 2: the swap worker step is armedReplicaStep, the same lazy scheduler lookup as before as a named function; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (01d6ca78, linked-deployments-slice1) starts linkLoop beside tunnelLoop; this branch keeps its replica coordinator wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 2: wires the swap worker's drive (armedReplicaDrive, the armed rollout manager's DriveReplicaRelease); no read added;rev3=census-ruling-stateless-replicas-4-merge-main2;basis=Merge of main af871da0 (v0.34.49): both sides changed it. Main (178dcfe5, member-backups-2a) moves the inline duty-view closure into armDutyView/dutyView and starts verifyAssignLoop; its sites drop by registry:Host and whole:Route x2 as main recorded them. This branch keeps its replica coordinator, swap worker and drive wiring. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-drill3;basis=drill 3 R24: makes one in-memory channel, closes it (once) inside the edge's existing shutdown-started callback after ingress.shutdownStarted, and passes it to tunnelLoop, which drains only a fleet channel name; no read added, same six sites; touches no admission, lease, ingress drain, listener or file; the agent process, no root decision;rev3=census-ruling-edge-ppv2;basis=Agent (uid carlos), not root. memwatchLoop now gets edgeProxyCounters(&demoEdge) (in-process counters, no read). The drain socket's driver is newAgentDrainSocket(ingress, e, os.Getenv), which attaches the edge trust handler only when CARLOS_INGRESS_PROXY_SOURCES in the agent's environment (from the root-owned host.env) parses to a non-empty list; the socket is served when drainSocketServed: a group member or a configured ingress drain (both as before), or a box armed for PROXY protocol (new). The socket's path and agent-user-only permissions are unchanged. Read sites unchanged (6).;rev3=census-ruling-same-box-edge-fence;basis=Agent (uid carlos), not root. One added line: armEdgeFenceStatus(ctl.EdgeFence), beside the existing armExecSandboxStatus, so the layout report can ask root's /ready for the edge fence state over the control socket client the agent already holds. No read added.;rev3=census-ruling-platform-mail-submission;basis=Task 4: sets eb.Mail = mailsubmit.SocketForwarder{} on every box, and eb.MailSwitch to a mailSwitchCache's On that opens the deploy store itself through openDeployStore, retried at most once a minute with an error line until it opens (review round 1, Task 4 P3), armed for the serial-move refresh (armedMailSwitch). Task 6: also sets the ExecBackend's ManifestOf, the same staged-manifest read as TierOf (rt.App and RouteAccount(rt), hence +registry:App and +whole:Route), for the spawn-time check of decision 10, which logs and emits an event and never refuses. Agent, not root. Fable final P2-2: eb.MailSwitch is the cache's State (three-valued: on, off, unknown) in place of On; an unreadable switch is unknown, never off. No read added.;rev3=census-ruling-fleet-drain-followups;basis=P3 (#1008 T9): one call after armChangeIndex, requestBootFullPass(v, &backstopFullDue), which stores true in the existing in-memory backstopFullDue flag only when no record view is armed, so the fast loop runs its existing full pass on its first tick instead of instancesLoop a minute later; armed boxes unchanged. No read added; read sites unchanged (8); agent, not root.;rev3=census-ruling-fleet-first-reconcile-speed;basis=Startup timing log lines only: runDuties builds a step logger (newStartupLog, which reads the in-memory agent start time) and logs one line after the wait on the activator startup latch and after each existing duty before go fastConvergeLoop. One newStartupLog().at line in the edge ready hook before go tunnelLoop. No read added; read sites unchanged (8). Agent, not root.;rev3=census-ruling-ha-1192;basis=sets the group drain driver's departed hook to armedPeerDeparted (the armed departure controller's PeerDeparted: local registry identity + departure journal); no new read;rev3=census-ruling-replica-wake-gap-r3;basis=Calls lease.SetContinuityDir(<data dir>/.continuity) beside the existing obligation store: the agent's own 0700 directory for clean records, outside every instance tree (#1290 round 3). No new read; failure is logged and every start then takes a full image.;rev3=census-ruling-fleet-restart-wake;basis=Fleet restart wake Task 2: cfg.ReplicaRecord = replicaRecordFacts(boxLifetimes, cfg.Record): hands the existing judged record read (haRecordFacts over openDeployStore and boxJudge) as the live read on a lifetime index miss. No read site added here; agent, not root.;rev3=census-ruling-alias-publish-precert-1293;basis=starts edgesFileLoop with one more argument, edgeAcmeDir(os.Getenv, peekAcmeCache(args)): the agent's own -acme-cache flag (already parsed for domainsLoop) or $CARLOS_DATA_DIR/acme; a string computed from the operator's command line and environment, no read. Same 8 read sites.;rev3=census-ruling-console-addr-from-install;basis=publishes the running edge to consoleFleetEdgeSource for the heartbeat; no read added;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos: sets svc.ConfigBeforeWake = configBeforeWake(reg, dd, claims.Writes) beside BeforeExec, before Start. Read sites unchanged, offsets moved. file:Exec@22002,file:Open@2191,file:Statfs@58829,registry:App@13299,registry:App@13677,whole:Route@13291,whole:Route@13669,whole:Route@51925 9e8b2a5a0b91360dbcca3d90817b55349b1f5287bf444bbfff3ed7a1a33ca213 |
| +internal/activator/configbeforewake.go Service.configBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: calls the ConfigBeforeWake hook with the wake route, unless the hook is nil, the wake is a hold swap pinned wake (e.pin) or a fallback second pass (wakeFallbackKey). Reads only in-memory state and the route already in hand. whole:Route@258 6399df728bf3a5703f46d56e0bcda13a3b2490f39b6d9d57637658ef7136e3ec |
| +internal/appconfig/syncexec.go ExecSpawned legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, pure: execSyncable or execSidecarCandidate over the route handed in, the sweep own scope test exported for the agent pass before a wake. Reads only that route. whole:Route@64,whole:Route@92 88a6489c054186890d32d32d53da14c222fa2588fc7413e550924bd7417e0396 |
| +internal/appconfig/syncexec.go syncExecHostMaking legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: syncExecHostClaimed, and when the pass asked for it (MakeInstanceDir, set only by the agent own pass before a wake) and the write found no instance directory, os.MkdirAll of provision.InstanceDir(dataDir, host) at 0700, the same call and mode the activator prepare makes at that wake, then the same write once more. A write under /data by the agent, never root. The registry Host and Route reads are the row the pass already holds. registry:Host@607,whole:Route@309,whole:Route@494,whole:Route@683 7aed70f5c1f2cfbf428e1cea4a0f19bd9f5b315bdfb9b2854741b6b56575d60b |
| +internal/host/configbeforewake.go configBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: the hook runAgent sets. Takes the key and the deploy store from the armed config guard (the same key the config loops parse from CARLOS_SECRETS_KEY) and calls deliverConfigBeforeWake. Does nothing without a guard or a usable key. whole:Route@286 f8f7bf9e9f39049554cffab1069675efffd18f27968bdfad9d582f5f0753528f |
| +internal/host/configbeforewake.go deliverConfigBeforeWake legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-ready-before-wake;basis=new, the agent as carlos: for a route config sync delivers a file to (appconfig.ExecSpawned), one os.Lstat of its own config path under /data (appconfig.ConfigEnvPath, never followed or opened). When the file is absent, no pass has settled the host and no attempt ran for it in the last 30s, one SyncExec pass narrowed to that host under configSyncMu, its lock wait and reads bounded by a 5s budget and its config ack by 5s more (so up to about 10s on a box that acks in line), with MakeInstanceDir and no restart leg. The 30s window starts only when an attempt ran: at a store that would not open, or once the lock is held, where the settled and window checks are made again (in-memory, configSettled); a wait for the lock that timed out starts none, so the next wake asks again (census review P3, #280). That change adds one registry Host site (rt.Host handed to the window at the store failure), the route the activator handed in; no file or bucket read is added: the same one Lstat, before the lock. The registry Host reads are the route the activator handed in. Not reachable from root: only the agent wake path calls it. file:Lstat@270,registry:Host@1002,registry:Host@1232,registry:Host@1315,registry:Host@1680,registry:Host@345,registry:Host@383,whole:Route@238,whole:Route@307 63bcbc5945dafd3263864d7b616c36b89d71a401163733fd1cc81b3b10eca206 |
| +internal/activator/activator.go Service.doWakeOnce legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged.;rev3=census-ruling-sr-followups;basis=#1061 Task 1, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): a refused plan now returns planRefusal(host, plan) instead of the inline fmt.Errorf, the text is unchanged, and when the planner marked the plan Installing the error also matches errBuildNotInstalled (installRefusal, in memory). Same refusal at the same point before the lease, read sites unchanged, no read, file, store, bucket or root call added;rev3=census-ruling-replica-wake-gap;basis=Step 2c: before the seed and the spawn, asks the lease to ProtectStart(rt.DBPath), the route's own database path already used by Restore and retainDatabase; a refusal gives the lease back and starts nothing. Agent code (user carlos); no root call, no new store or file read here.;rev3=census-ruling-replica-wake-gap-ch;basis=Step 2c's body moved unchanged into protectBeforeStart (replicatebeforestart.go); doWakeOnce passes the whole Route it already holds and returns the error. No read added; the DBPath read moved with the body.;rev3=census-ruling-instance-ready-before-wake;basis=the agent as carlos: one call, step 0.69, a.configBeforeWake(ctx, e, rt), after the held wake check and before the planner. It hands the hook the route this wake already holds (the added whole Route site). It returns nothing, so no refusal, lease, restore or spawn ordering changes. registry:DBPath@2071,registry:DBPath@2087,registry:DBPath@2214,registry:DBPath@2225,registry:FleetBoxes@12276,registry:GoodVersion@18566,registry:Host@1900,registry:Host@1975,registry:Host@2053,registry:Host@2205,registry:Host@2539,registry:Host@4556,registry:Host@6813,registry:Host@949,registry:Replication@17193,registry:Replication@17322,registry:Replication@17341,registry:Replication@17422,registry:Replication@33794,registry:Seed@22478,registry:SeedSource@35254,registry:Socket@2100,registry:Socket@2116,registry:Socket@2239,registry:Socket@2250,registry:Stateless@10336,registry:Stateless@10622,registry:Stateless@11994,registry:Stateless@12324,registry:Stateless@20975,registry:Stateless@9879,registry:Stateless@9970,whole:Route@10408,whole:Route@10567,whole:Route@10946,whole:Route@11044,whole:Route@11135,whole:Route@11267,whole:Route@11390,whole:Route@11444,whole:Route@11716,whole:Route@11892,whole:Route@11896,whole:Route@12683,whole:Route@12958,whole:Route@13276,whole:Route@142,whole:Route@14737,whole:Route@15414,whole:Route@16295,whole:Route@17173,whole:Route@17424,whole:Route@18769,whole:Route@19360,whole:Route@19525,whole:Route@1998,whole:Route@20461,whole:Route@21257,whole:Route@21532,whole:Route@21728,whole:Route@22579,whole:Route@22650,whole:Route@2434,whole:Route@2439,whole:Route@2493,whole:Route@2499,whole:Route@25144,whole:Route@2565,whole:Route@2573,whole:Route@2629,whole:Route@27002,whole:Route@27648,whole:Route@28955,whole:Route@29109,whole:Route@29608,whole:Route@29678,whole:Route@30265,whole:Route@31350,whole:Route@31781,whole:Route@31989,whole:Route@32043,whole:Route@32972,whole:Route@33157,whole:Route@333,whole:Route@33957,whole:Route@34028,whole:Route@34746,whole:Route@34795,whole:Route@35189,whole:Route@35371,whole:Route@3591,whole:Route@36623,whole:Route@36718,whole:Route@3685,whole:Route@3752,whole:Route@37559,whole:Route@4446,whole:Route@6182,whole:Route@6441,whole:Route@6703,whole:Route@6708,whole:Route@6765,whole:Route@6771,whole:Route@6840,whole:Route@6848,whole:Route@7164,whole:Route@7225,whole:Route@729,whole:Route@7323,whole:Route@7633,whole:Route@8534,whole:Route@934,whole:Route@9483,whole:Route@9707,whole:Route@9771,whole:Route@9815 72ca438f2e11c7a6eb14e09c895b481898b0162c786180e1c3fc61272b3392ce |
| +@coverage internal/activator f57026b611e24808473a4f3a71707b727ea36f279716857d68f77288adb3310e |
| +@coverage internal/appconfig 14dfd320d677064e2b5713d02e1282bb92cdf391bf928ef11947ec821a3c2cc3 |
| +@coverage internal/host 0bddb2e2a64b7d28ac355dc09c2aa4804ca5e5faae0b385fb5ab7f0d52f1f555 |
diff --git a/internal/rollout/wakeplan_test.go b/internal/rollout/wakeplan_test.go| index b1115d6e3..0544c92a8 100644 |
| --- a/internal/rollout/wakeplan_test.go |
| +++ b/internal/rollout/wakeplan_test.go |
| @@ -345,6 +345,39 @@ func TestAWakeActivatesTheConfigItStartedWith(t *testing.T) { |
| } |
| } |
| +// Production, 2026-11-24: a new instance's first generation ran without its |
| +// config and was swapped for a configured one seconds later ("config |
| +// change"). The agent now delivers the file inside the wake, before the |
| +// wake is planned (activator.Service.ConfigBeforeWake). The scheduler hears |
| +// that delivery while the instance is waking, so it queues a config |
| +// attempt; the plan made right after carries the revision, and the wake's |
| +// healthy event activates it. Nothing is left pending, so no swap follows. |
| +func TestAConfigDeliveredBeforeItsWakeIsPlannedLeavesNoAttempt(t *testing.T) { |
| + h := newHarness(t, "a") |
| + h.pass() |
| + h.act.mu.Lock() |
| + delete(h.act.gens, "a") |
| + h.act.owned["a"] = true // waking: the activator has an entry, nothing serves yet |
| + h.act.mu.Unlock() |
| + h.m.ConfigDelivered("a", "sha256:c1") |
| + if !h.m.Status().Hosts["a"].ConfigPending { |
| + t.Fatal("a delivery to a waking instance queued nothing: the test no longer models the wake") |
| + } |
| + rt := h.rows.get("a") |
| + p := h.m.Plan(context.Background(), rt) |
| + if p.ConfigRev != "sha256:c1" { |
| + t.Fatalf("plan.ConfigRev = %q: the plan made after the delivery does not carry it", p.ConfigRev) |
| + } |
| + h.m.OnGen(activator.GenEvent{Kind: activator.GenHealthy, Route: rt, Gen: activator.Gen{Build: "v1", Digest: "sha-v1"}, |
| + Token: p.Token, ConfigRev: p.ConfigRev}) |
| + if h.m.Status().Hosts["a"].ConfigPending { |
| + t.Fatal("the config the wake started with is still pending: a swap would restart the instance onto it") |
| + } |
| + if calls, _, _ := h.act.snapshot(); len(calls) != 0 { |
| + t.Fatalf("attempts %+v: the wake's own config got a restart", calls) |
| + } |
| +} |
| + |
| // Spec §8.1: a sleeping instance needs no config attempt. Its next wake |
| // starts with the delivered file, and config sync's ack goes out at |
| // delivery, as today, marked Hibernating. |