carlos / platform Public

edge: pre-issue fixes from Astra R1 (accounts, challenge lock, fairness)

- CARLOS_DNS01_ACCOUNTS: only claims of operator-named accounts use the
  operator's DNS authority; none named = off.
- solveDNS01 holds a per-FQDN lock from publish to cleanup, so an apex
  pre-issue and its parent's wildcard cannot overwrite each other's TXT.
- Least recently tried names go first, so failing names cannot starve
  the hourly budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ec7b62d2261e9f854a953d28cfcf2022edd80a7c parent b823417
10 files changed, +398 −21
  • docs/superpowers/notes/census-proposal-precert-dns01-1293.md +2 −2
  • docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md +44 −0
  • docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md +136 −0
  • internal/edge/precert.go +61 −12
  • internal/edge/precert_test.go +118 −1
  • internal/edge/wildcard.go +28 −0
  • internal/host/agent.go +2 −0
  • internal/hostenv/hostenv.go +1 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv +5 −5

CI cancelled — superseded by a newer push — 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-YS5IbN
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/superfly/ltx v0.5.1
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/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/route53 v1.64.1
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.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/aws/aws-sdk-go-v2/service/signin v1.0.4
go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading golang.org/x/text v0.43.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/notes/census-proposal-precert-dns01-1293.md b/docs/superpowers/notes/census-proposal-precert-dns01-1293.md
index dc916425d..f384a6c1e 100644
--- a/docs/superpowers/notes/census-proposal-precert-dns01-1293.md
+++ b/docs/superpowers/notes/census-proposal-precert-dns01-1293.md
@@ -4,7 +4,7 @@ Ruling `census-ruling-precert-dns01-1293`. The independent reviewer approves or
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES from the edge environment (the root-owned host.env); unset or no valid zone = nil, nothing else read. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. |
+| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. |
Envelopes re-pinned: `internal/edge`, `internal/host`, `internal/hostenv`.
@@ -14,6 +14,6 @@ Recorded dispositions, which each change must still satisfy:
- `internal/edge/edge.go` `RunWithActivatorReady`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.
-Seal: `f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6` → `5995679a84b942fe25a6a8190642793c830d856783eebe5984c2a3b0ed667256`.
+Seal: `f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6` → `2ddc949f4e27e0e652da34c52801f3d32fd0b8f06165c55efe2ee2f3d3885a69`.
Overlay: `internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md
new file mode 100644
index 000000000..23066f4e5
--- /dev/null
+++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-FINDINGS-R1.md
@@ -0,0 +1,44 @@
+Reviewed `b823417eb6e95be0f6febdb87bb081c2bea6445d` against `origin/main`, merge base `d3266e8e`.
+
+1. **P1 — Non-pending claims do not establish ownership for DNS-01 issuance.**
+
+ [precert.go:223](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert.go:223) accepts any non-pending, routed claim inside a listed zone. However, [domainpolicy.go:302](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/console/domainpolicy.go:302) returns “proven” without checking DNS when `CONSOLE_DOMAIN_PROOF` is off—the default. `AttachClaimProven` then stores `Pending=false`.
+
+ **Failure scenario:** configure `CARLOS_DNS01_ZONES=example.com`, leave domain proof off, and leave that zone available to ordinary member attaches. A member attaches an unclaimed `billing.example.com` to their app without controlling its DNS. The issuer publishes the challenge using the operator’s credentials and obtains the certificate. Previously, the member’s attach alone could not satisfy ACME validation against the domain’s existing servers.
+
+ **Fix:** require positive DNS-01 authorization from a trusted path: actual ownership proof or an operator-authorized attach. Legacy/proof-disabled claims must not qualify solely through `Pending=false`. Add a regression covering a member attach with domain proof disabled.
+
+ **Fault family:** tenant claim data must not substitute for authorization to use the operator’s DNS authority.
+
+2. **P1 — Concurrent apex and wildcard orders overwrite each other’s Route 53 challenge.**
+
+ The wildcard and pre-issuer loops start independently at [edge.go:5106](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/edge.go:5106) and line 5142. Orders for `*.example.com` and `example.com` both publish `_acme-challenge.example.com`. The account mutex ends before challenge handling; [wildcard.go:821](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/wildcard.go:821) has no shared challenge lock. [route53dns.go:106](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/route53dns.go:106) UPSERTs a record set containing exactly one value.
+
+ **Failure scenario:** both certificates are missing or due. One order replaces the other’s TXT before validation, causing that order to fail and back off for an hour. An initial apex pre-issuance can therefore fail precisely when preparing a DNS switch.
+
+ **Fix:** serialize publication through validation and cleanup by challenge FQDN, shared across both managers and provider instances. Add a deterministic concurrent apex/wildcard test using Route 53 replacement semantics. The current fake provider appends values at [precert_test.go:87](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert_test.go:87), masking this collision.
+
+ **Fault family:** an active DNS challenge must retain its TXT value until validation completes.
+
+3. **P2 — Repeated failures can permanently starve later hostnames.**
+
+ Candidates are sorted at [precert.go:236](/home/paulca/amadan.net/carlos/platform-precert-dns01-1293/internal/edge/precert.go:236), every pass restarts at the beginning, and budget exhaustion returns immediately at line 275. Failed names become eligible again after the same hour that releases their budget slots.
+
+ **Failure scenario:** the first 20 names repeatedly fail with ordinary errors. They consume every hourly slot, so a later, issuable name never receives an attempt. An in-memory simulation of this scheduling logic over 180 minute passes produced three attempts for each failing name and zero for the final healthy name.
+
+ **Fix:** retain a rotating cursor or prioritize the least recently attempted eligible name. Add a mixed failure/success regression proving eventual progress while preserving both caps.
+
+ **Fault family:** bounded retry scheduling must preserve progress for other eligible claims.
+
+No P3 findings. The fake CA does check the expected DNS-01 digest. Targeted Go tests could not run: Go attempted to update `go.mod`, which the read-only sandbox refused. `git diff --check` passed; no files were edited.
+
+The census verdicts below address the root-read criteria; they do not clear the issuance defects above.
+
+| Census item | Verdict | Lines read and basis |
+|---|---|---|
+| `internal/edge/edge.go:RunWithActivatorReady` | **APPROVE** | Lines 5020–5150, especially 5138–5144. Starts the optional loop in the edge process; no added root read or weakened root check. |
+| `internal/edge` envelope | **APPROVE** | `precert.go` 1–412; `wildcard.go` 691–898; changed test code and serving/provider paths cited above. New certificate work runs as `carlos`; `carlos-edge.service` lines 28–46 confirm the environment source and execution identity. |
+| `internal/host` envelope | **APPROVE** | `agent.go` 139–148. Comment-only configuration documentation; no runtime change. |
+| `internal/hostenv` envelope | **APPROVE** | `hostenv.go` 56–95, 129–132, 391–434. Adds an operator-supplied variable to the allowlist; existing value validation remains intact. No tenant-controlled root path or command is introduced. |
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md
new file mode 100644
index 000000000..350585229
--- /dev/null
+++ b/docs/superpowers/reviews/precert-dns01-1293/CODEX-REVIEW-BRIEF-R2.md
@@ -0,0 +1,136 @@
+# Review brief: branch precert-dns01-1293 (#1293), round 2 of 3
+
+Repo carlos/platform, branch `precert-dns01-1293`, commit named in the prompt.
+Under review: the diff `origin/main...HEAD` (merge base d3266e8e).
+Authorities on main: `internal/edge/certsync.go` (issuer gate, publishing
+cache, mirror), `internal/edge/wildcard.go` (DNS-01 wildcards),
+`internal/edge/certwarm.go` (HTTP-01 warm), `internal/edge/certsweep.go`,
+`internal/domains/claims.go` and `claimcache.go`, AGENTS.md ("Stopping
+rules", "The census").
+
+You are an independent reviewer. Read the diff, then the code it reaches,
+and check every claim in the comments against that code.
+
+## The problem (amadan discussion #1293)
+
+A production switch on 2026-11-19 moved a custom hostname's DNS to a
+multi-edge CARLOS deployment. The home box (not the issuer) had no
+certificate, refused every handshake with "acme: not available here"
+for ~4 minutes, and was rolled back. Root cause: an attached alias that
+does not point at the deployment yet is never published to
+control/edges/, so the issuer never orders it until the home box's DNS
+sweep stamps it "pointing" (5-7 min), and HTTP-01 could not succeed
+before the switch anyway.
+
+## The change
+
+`internal/edge/precert.go`: with `CARLOS_DNS01_ZONES` set, the issuer
+(only) lists the claims (domains/) through a ClaimCache every minute,
+and for each proven, served claim whose host is in a listed zone, not
+covered by a usable wildcard, and without a current published cert,
+orders a certificate over DNS-01 through the existing DNS provider seam
+and stores it under the host's autocert cache name through the
+publishing cache (local disk, then control/certs/<host>). Renews ahead
+of autocert's window. Caps: 5 orders/pass, 20/hour; backoff 1h per name,
+12h on no-zone. A current local cert missing from the bucket is
+republished instead of reordered. `wildcard.go`: the order is factored
+into `dns01Order` + free `solveDNS01`, shared with wildcards; the account
+key load-or-mint is serialized. `edge.go` wires it after the cert warm.
+`hostenv` allows the variable.
+
+## Fixed: do not re-argue
+
+- Scope is operator-listed zones only (not "any zone the provider
+ holds"), and the feature is off when the variable is unset.
+- Only the issuer orders; non-issuers serve via the existing mirror.
+- No console or CLI change in this branch.
+
+## What to check
+
+1. Correctness of serving: will a non-issuer edge (and the issuer
+ itself, whose autocert HostPolicy refuses a name that is not yet a
+ deployment host) actually serve the pre-issued cert for SNI = host,
+ before and after the name points? Trace wrapGetCertificate, the
+ mirror snapshot, syncLocal, autocert's cache format and key name.
+2. Interaction with the existing machinery once the name points:
+ certwarm (could it order HTTP-01 anyway, or duplicate), autocert
+ renewal timers, certmirror backfill/ownsCertName, certsweep, the
+ home box's cert_expires_at stamp. Any path that deletes, overwrites
+ with something worse, or fights the pre-issued entry?
+3. The refactor in wildcard.go: behaviour-preserving for wildcards
+ (identifiers, CSR, challenge FQDN incl. delegation, log text,
+ errNoZone wrapping, account key semantics)?
+4. Trust boundary: can a tenant, member or app cause the issuer to
+ order (or publish a TXT in the operator's zone for) a name the
+ operator did not intend? Consider pending claims, claims written via
+ the fleet store door, IDN/uppercase/trailing-dot hosts, a claim for
+ the zone apex, hosts that are a suffix-trick of a zone, regional and
+ instance catch-all claims. Route 53 IAM is scoped to
+ `_acme-challenge.*` TXT records (infra/modules/region-host/main.tf).
+5. Rate limits and cost: the per-pass/hourly caps, backoff, the claims
+ listing cadence (issuer only), the publish repair path. Can anything
+ loop orders against Let's Encrypt or write the bucket every pass?
+6. Concurrency: shared account key with the wildcard manager, the
+ mutex, the preIssuer's maps, the held-gate context.
+7. Tests: does `TestPreIssueE2E` prove what it claims (the fake CA's
+ new dns-01 mode really checks the TXT value)? Missing cases?
+8. Census: `make census-card` lists unit `internal/edge/edge.go`
+ `RunWithActivatorReady` (body) and re-pinned envelopes
+ `internal/edge`, `internal/host`, `internal/hostenv`. The card is
+ `docs/superpowers/notes/census-proposal-precert-dns01-1293.md`. Give a
+ verdict for the unit and each envelope per AGENTS.md "Getting a
+ change approved" step 4: reject if the change lets root open, run,
+ query or follow anything it did not before from a path or input a
+ tenant, an app or a box agent can create, write or name, or weakens a
+ check root relies on. Note carlos-edge runs as user carlos, not root.
+
+## Round 2
+
+Earlier rounds: R1 by Astra (`CODEX-FINDINGS-R1.md`, NOT READY: two P1s,
+one P2; census items all APPROVE). The fixes:
+
+- R1 P1-1 (claims are not authorization): refused up front. A second
+ required setting, `CARLOS_DNS01_ACCOUNTS` (account sqids), names whose
+ claims may use the zones; claims of any other account never qualify,
+ and with no account named the feature stays off.
+- R1 P1-2 (same challenge name): `solveDNS01` takes a per-FQDN lock
+ (`lockChallenge`, process-wide, context-aware) from publication through
+ validation and cleanup, shared by the wildcard manager and the
+ pre-issuer. `TestSameChallengeNameOrdersDoNotCollide` uses a
+ replace-semantics provider and fails without the lock (checked).
+- R1 P2 (starvation): a pass offers the least recently tried names first
+ (`tried`); `TestPreIssueFailuresDoNotStarveOthers`.
+
+First give one line per R1 P1 and P2: resolved, partly, or not. Carry
+every unresolved or partly resolved finding forward at its current
+severity, then add only new findings. The census card was re-proposed
+for the new tip (unit claim updated); re-check the unit and the
+`internal/edge`, `internal/host`, `internal/hostenv` envelopes.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+ Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for
+ another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not
+raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the problem, the evidence
+(file:line, verified), the failure scenario, a concrete fix and the
+invariant or trust boundary it breaks (its fault family). Then the
+census verdicts (unit + three envelopes, each APPROVE or REJECT with the
+lines read). End with exactly one verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another
+ round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites (targeted `go test -run` on
+internal/edge is fine; leave GOCACHE unset).
diff --git a/internal/edge/precert.go b/internal/edge/precert.go
index 0f506a115..e45104eb3 100644
--- a/internal/edge/precert.go
+++ b/internal/edge/precert.go
@@ -26,11 +26,17 @@ package edge
// so the steady state is one listing per pass and a body read only for a
// claim that changed. Pending (unproven, #215) claims, catch-all claims
// and claims that name nothing to serve are skipped.
-// - The scope is CARLOS_DNS01_ZONES, named by the operator. Unset, nothing
-// here runs. A zone list rather than "anything the provider happens to
-// hold" because the provider's account may hold zones whose names
-// members can attach, and a certificate is an act in the operator's
-// zone that the operator should have asked for.
+// - The scope is named by the operator twice over: CARLOS_DNS01_ZONES (the
+// zones) and CARLOS_DNS01_ACCOUNTS (the account sqids whose claims may
+// use them). Either unset, nothing here runs. Zones, rather than
+// "anything the provider happens to hold", because the provider's
+// account may hold zones members can attach names in. Accounts, because
+// a claim is not proof of control: with domain proof off (the console's
+// default) any member's attach is written proven, and before this file
+// that attach alone could never get a certificate for a name whose DNS
+// points elsewhere. Using the operator's DNS authority on a name is the
+// operator's decision, so it is refused up front for every account the
+// operator did not name (Astra R1, #1293).
// - Only the issuer orders, under the same election as every other order
// (certsync.go), and only it reads the claims: a non-issuer's pass ends
// at the gate and costs nothing.
@@ -124,10 +130,33 @@ func parseDNS01Zones(raw string) []string {
return out
}
+// parseDNS01Accounts reads CARLOS_DNS01_ACCOUNTS: comma-separated account
+// sqids, as claims record them. An entry that is not a sqid is dropped with a
+// log line. nil when none is valid, which is "off".
+func parseDNS01Accounts(raw string) []string {
+ var out []string
+ for _, a := range strings.Split(raw, ",") {
+ a = strings.TrimSpace(a)
+ if a == "" {
+ continue
+ }
+ if !domains.ValidSqid(a) {
+ log.Printf("edge: CARLOS_DNS01_ACCOUNTS entry %q is not an account sqid, ignored", a)
+ continue
+ }
+ if !slices.Contains(out, a) {
+ out = append(out, a)
+ }
+ }
+ return out
+}
+
// preIssuer is the pass. Every input is a field so the decisions are
// testable without an ACME server; newPreIssuerFromEnv wires the real ones.
type preIssuer struct {
zones []string
+ // accounts are the sqids whose claims qualify; nothing else does.
+ accounts []string
// cache is the PUBLISHING cache (certsync.go): its Get reads this box's
// own disk, its Put writes the disk and then the bucket.
cache autocert.Cache
@@ -147,6 +176,10 @@ type preIssuer struct {
mu sync.Mutex
nextAttempt map[string]time.Time
+ // tried is when each name's last order started. A pass offers the
+ // least recently tried names first, so names that keep failing cannot
+ // spend the hourly budget ahead of a name never tried.
+ tried map[string]time.Time
// ordered is when each order of the last hour started, oldest first.
ordered []time.Time
// putAt is when this box last wrote each name to the bucket, so a pass
@@ -155,13 +188,13 @@ type preIssuer struct {
lastClaimLog time.Time
}
-func newPreIssuer(zones []string, cache autocert.Cache, store release.Store, issuer IssuerGate,
+func newPreIssuer(zones, accounts []string, cache autocert.Cache, store release.Store, issuer IssuerGate,
claims func(context.Context) ([]domains.Claim, error), published func(string) ([]byte, bool),
covered func(string) bool, order func(context.Context, string) (*tls.Certificate, *ecdsa.PrivateKey, error)) *preIssuer {
return &preIssuer{
- zones: zones, cache: cache, store: store, issuer: issuer, claims: claims,
+ zones: zones, accounts: accounts, cache: cache, store: store, issuer: issuer, claims: claims,
published: published, covered: covered, order: order, now: time.Now,
- nextAttempt: map[string]time.Time{}, putAt: map[string]time.Time{},
+ nextAttempt: map[string]time.Time{}, tried: map[string]time.Time{}, putAt: map[string]time.Time{},
}
}
@@ -175,14 +208,19 @@ func dns01OrderFunc(cache autocert.Cache, directory string, dns dnsProvider) fun
}
// newPreIssuerFromEnv arms the pre-issuer, or returns nil: CARLOS_DNS01_ZONES
-// unset (silent, the default), or set with no DNS provider to publish through
-// (logged). Called only on a box with a deployment store, so the mirror and
+// unset (silent, the default), or set with no account named in
+// CARLOS_DNS01_ACCOUNTS or no DNS provider to publish through (logged). Called only on a box with a deployment store, so the mirror and
// the issuer gate exist.
func (e *Edge) newPreIssuerFromEnv(cache autocert.Cache, mirror *certMirror, wm *wildcardManager) *preIssuer {
zones := parseDNS01Zones(os.Getenv("CARLOS_DNS01_ZONES"))
if len(zones) == 0 || e.staticStore == nil || mirror == nil {
return nil
}
+ accounts := parseDNS01Accounts(os.Getenv("CARLOS_DNS01_ACCOUNTS"))
+ if len(accounts) == 0 {
+ log.Printf("edge: CARLOS_DNS01_ZONES is set but CARLOS_DNS01_ACCOUNTS names no account — certificates are not issued before DNS moves")
+ return nil
+ }
dns, reason := dnsProviderFromEnv()
if dns == nil {
log.Printf("edge: CARLOS_DNS01_ZONES is set but there is no DNS provider (%s) — certificates are not issued before DNS moves", reason)
@@ -196,7 +234,7 @@ func (e *Edge) newPreIssuerFromEnv(cache autocert.Cache, mirror *certMirror, wm
covered = func(h string) bool { return wm.certFor(h) != nil }
}
directory := envOr("CARLOS_ACME_DIRECTORY", letsEncryptDirectory)
- return newPreIssuer(zones, cache, store, e.issuerGate, claims, mirror.Cert, covered, dns01OrderFunc(cache, directory, dns))
+ return newPreIssuer(zones, accounts, cache, store, e.issuerGate, claims, mirror.Cert, covered, dns01OrderFunc(cache, directory, dns))
}
func (p *preIssuer) run() {
@@ -224,7 +262,7 @@ func (p *preIssuer) candidates(claims []domains.Claim) []string {
switch {
case c.Pending, strings.HasPrefix(host, "*."), c.Route == "" && !c.Regional():
continue
- case !p.inZone(host):
+ case !p.inZone(host), !slices.Contains(p.accounts, c.Account):
continue
case p.covered != nil && p.covered(host):
continue
@@ -260,6 +298,9 @@ func (p *preIssuer) pass(ctx context.Context) {
}
hosts := p.candidates(claims)
p.forget(hosts)
+ p.mu.Lock()
+ slices.SortStableFunc(hosts, func(a, b string) int { return p.tried[a].Compare(p.tried[b]) })
+ p.mu.Unlock()
orders := 0
for _, host := range hosts {
now := p.now()
@@ -276,6 +317,9 @@ func (p *preIssuer) pass(ctx context.Context) {
return
}
orders++
+ p.mu.Lock()
+ p.tried[host] = now
+ p.mu.Unlock()
if err := p.issue(held, host); err != nil {
retry := preIssueRetry
if errors.Is(err, errNoZone) {
@@ -394,6 +438,11 @@ func (p *preIssuer) forget(hosts []string) {
delete(p.putAt, h)
}
}
+ for h := range p.tried {
+ if !slices.Contains(hosts, h) {
+ delete(p.tried, h)
+ }
+ }
}
// logClaimsFailure says a failed claims read at most hourly: it repeats every
diff --git a/internal/edge/precert_test.go b/internal/edge/precert_test.go
index c2f0ba8c4..f8a418caf 100644
--- a/internal/edge/precert_test.go
+++ b/internal/edge/precert_test.go
@@ -167,7 +167,7 @@ func testPreIssuer(t *testing.T, zones []string, claims func(context.Context) ([
b, err := certStoreGet(t, store, certKey(name))
return b, err == nil
}
- p := newPreIssuer(zones, cache, store, held, claims, published, nil, order)
+ p := newPreIssuer(zones, []string{"acct"}, cache, store, held, claims, published, nil, order)
return p, store, local
}
@@ -270,6 +270,8 @@ func TestPreIssueCandidates(t *testing.T) {
regional.Schema = 2
regional.Placements = []domains.Placement{{Region: "ie", Host: "shop-ie.acct.apps.example.net"}}
catchall := proven("*.example.com")
+ stranger := proven("stranger.example.com")
+ stranger.Account = "other"
claims := []domains.Claim{
proven("Billing.Example.com"), // case folds
@@ -283,6 +285,7 @@ func TestPreIssueCandidates(t *testing.T) {
noRoute,
regional,
catchall,
+ stranger, // an account the operator did not name
}
p, _, _ := testPreIssuer(t, []string{"example.com"}, nil, nil)
p.covered = func(h string) bool { return strings.HasSuffix(h, ".covered.example.com") }
@@ -293,6 +296,16 @@ func TestPreIssueCandidates(t *testing.T) {
}
}
+func TestDNS01AccountsFromEnv(t *testing.T) {
+ got := parseDNS01Accounts(" abc ,,not a sqid,abc,xyz")
+ if want := []string{"abc", "xyz"}; !slices.Equal(got, want) {
+ t.Fatalf("parseDNS01Accounts = %v, want %v", got, want)
+ }
+ if parseDNS01Accounts("") != nil {
+ t.Fatal("unset must be nil: the feature is off")
+ }
+}
+
func TestDNS01ZonesFromEnv(t *testing.T) {
got := parseDNS01Zones(" Example.com. ,,ti.example ,not a zone, example.com,*.wild.test")
want := []string{"example.com", "ti.example"}
@@ -488,3 +501,107 @@ func TestPreIssueClaimsReadFailure(t *testing.T) {
t.Fatal("ordered after a failed claims read")
}
}
+
+// Names that keep failing must not spend the hourly budget ahead of a name
+// that was never tried (Astra R1 P2).
+func TestPreIssueFailuresDoNotStarveOthers(t *testing.T) {
+ e2eQuietLogs(t)
+ var cs []domains.Claim
+ for i := range preIssueOrdersPerHour + 5 {
+ cs = append(cs, proven(fmt.Sprintf("a%02d.example.com", i)))
+ }
+ cs = append(cs, proven("zz.example.com"))
+ var mu sync.Mutex
+ var asked []string
+ order := func(_ context.Context, host string) (*tls.Certificate, *ecdsa.PrivateKey, error) {
+ mu.Lock()
+ asked = append(asked, host)
+ mu.Unlock()
+ if host != "zz.example.com" {
+ return nil, nil, errors.New("CA said no")
+ }
+ cert, key := selfSignedLeaf(t, host, time.Now().Add(90*24*time.Hour))
+ return cert, key, nil
+ }
+ p, _, _ := testPreIssuer(t, []string{"example.com"}, staticClaims(cs...), order)
+ now := time.Now()
+ p.now = func() time.Time { return now }
+ for range 180 {
+ p.pass(context.Background())
+ now = now.Add(preIssueInterval)
+ }
+ if !slices.Contains(asked, "zz.example.com") {
+ t.Fatalf("zz.example.com never tried in three hours of passes (%d orders, all for failing names)", len(asked))
+ }
+}
+
+// replaceDNS keeps ONE value per name, as Route 53's UPSERT does, and holds
+// the first publication open briefly so that a second order for the same
+// name, if nothing serializes them, overwrites it before the CA looks.
+type replaceDNS struct {
+ mu sync.Mutex
+ txt map[string]string
+ second chan struct{}
+ calls int
+}
+
+func (d *replaceDNS) checkZone(context.Context, string) error { return nil }
+
+func (d *replaceDNS) present(_ context.Context, fqdn, value string) (func(context.Context) error, error) {
+ d.mu.Lock()
+ d.calls++
+ n := d.calls
+ d.txt[fqdn] = value
+ d.mu.Unlock()
+ if n == 1 {
+ select {
+ case <-d.second:
+ case <-time.After(300 * time.Millisecond):
+ }
+ } else {
+ close(d.second)
+ }
+ return func(context.Context) error {
+ d.mu.Lock()
+ defer d.mu.Unlock()
+ if d.txt[fqdn] == value {
+ delete(d.txt, fqdn)
+ }
+ return nil
+ }, nil
+}
+
+func (d *replaceDNS) lookup(name string) []string {
+ d.mu.Lock()
+ defer d.mu.Unlock()
+ if v, ok := d.txt[name]; ok {
+ return []string{v}
+ }
+ return nil
+}
+
+// An apex pre-issue and the wildcard for the same parent answer at the same
+// challenge name; both must complete (Astra R1 P1).
+func TestSameChallengeNameOrdersDoNotCollide(t *testing.T) {
+ e2eQuietLogs(t)
+ noTXTWait(t)
+ dns := &replaceDNS{txt: map[string]string{}, second: make(chan struct{})}
+ ca := newFakeACME(t)
+ ca.dns01TXT = dns.lookup
+ cache := autocert.DirCache(t.TempDir())
+ w := newWildcardManager([]string{"go.example.com"}, "", func() []string { return nil }, nil, "", cache, dns)
+ w.directory = ca.directoryURL()
+ w.refresh()
+ apex := dns01OrderFunc(cache, ca.directoryURL(), dns)
+
+ var wg sync.WaitGroup
+ var werr, aerr error
+ wg.Add(2)
+ go func() { defer wg.Done(); werr = w.obtain(context.Background(), "go.example.com") }()
+ go func() { defer wg.Done(); _, _, aerr = apex(context.Background(), "go.example.com") }()
+ wg.Wait()
+ if werr != nil || aerr != nil {
+ t.Fatalf("wildcard: %v; apex: %v — one order overwrote the other's challenge", werr, aerr)
+ }
+ ca.checkFaults(t)
+}
diff --git a/internal/edge/wildcard.go b/internal/edge/wildcard.go
index 6d9855194..7b2bbd9c8 100644
--- a/internal/edge/wildcard.go
+++ b/internal/edge/wildcard.go
@@ -818,6 +818,16 @@ func solveDNS01(ctx context.Context, client *acme.Client, dns dnsProvider, label
return err
}
+ // One order per challenge name at a time, from publication to cleanup:
+ // an apex pre-issue (precert.go) and the wildcard for the same parent
+ // both answer at _acme-challenge.<parent>, and a provider that replaces
+ // the record set (Route 53's UPSERT) would let one order overwrite the
+ // other's value before the CA looks.
+ unlock, err := lockChallenge(ctx, challengeFQDN)
+ if err != nil {
+ return fmt.Errorf("wait for another order's challenge at %s: %v", challengeFQDN, err)
+ }
+ defer unlock()
cleanup, err := dns.present(ctx, challengeFQDN, txt)
if err != nil {
return fmt.Errorf("publish challenge TXT: %v", err)
@@ -846,6 +856,24 @@ func solveDNS01(ctx context.Context, client *acme.Client, dns dnsProvider, label
return nil
}
+// challengeLocks holds one single-slot channel per challenge FQDN: the lock
+// solveDNS01 takes around a challenge's whole life (see there). Keyed by
+// name, so it grows with the names this process has ever answered for,
+// which is bounded by the deployment's parents and pre-issued hosts.
+var challengeLocks sync.Map
+
+// lockChallenge takes fqdn's challenge lock, or gives up when ctx ends.
+func lockChallenge(ctx context.Context, fqdn string) (unlock func(), err error) {
+ v, _ := challengeLocks.LoadOrStore(fqdn, make(chan struct{}, 1))
+ slot := v.(chan struct{})
+ select {
+ case slot <- struct{}{}:
+ return func() { <-slot }, nil
+ case <-ctx.Done():
+ return nil, ctx.Err()
+ }
+}
+
// wildcardAccountKeyName is the ACME account key's cache key — Eleven's file
// name, for the same no-migration reason as wildcardPEMKey. Every DNS-01
// order in the deployment, wildcard or pre-issued host, runs under it.
diff --git a/internal/host/agent.go b/internal/host/agent.go
index 376025ecb..e9a823c91 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -143,6 +143,8 @@
// (tito: tito.io) whose attached hostnames the issuer certifies over
// DNS-01 from the claim, before their DNS points here (edge precert.go,
// #1293); unset = off, custom domains wait for HTTP-01 as before
+// - CARLOS_DNS01_ACCOUNTS — comma list of account sqids whose claims may
+// use CARLOS_DNS01_ZONES; required with it (no account = off)
// - PLATFORM_EDGE_IPS — comma-separated edge IPs custom-domain DNS checks
// compare against. Default: this box's public IPv4 from IMDS
// (best-effort). It is no longer the WHOLE comparison set: each pass
diff --git a/internal/hostenv/hostenv.go b/internal/hostenv/hostenv.go
index 7a8698941..ad540ef08 100644
--- a/internal/hostenv/hostenv.go
+++ b/internal/hostenv/hostenv.go
@@ -91,6 +91,7 @@ var Optional = []string{
"CARLOS_DEMO_API_ORIGIN",
"CARLOS_DEPLOYMENT_REGION",
"CARLOS_DEPLOYMENT_SINGLE_TENANT",
+ "CARLOS_DNS01_ACCOUNTS",
"CARLOS_DNS01_ZONES",
"CARLOS_DNS_PROVIDER",
"CARLOS_EDGE_GZIP",
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 3091dcab0..e121fc839 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -274,4 +274,4 @@ plan14-root-reads-media-spike-fixes.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad
plan14-root-reads-media-spike-values.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad84525e065893a8c14cdb3138
plan14-root-reads-path-routes-across-boxes.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
plan14-root-reads-headers-security-allowlist.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
-plan14-root-reads-precert-dns01-1293.tsv 5995679a84b942fe25a6a8190642793c830d856783eebe5984c2a3b0ed667256
+plan14-root-reads-precert-dns01-1293.tsv 2ddc949f4e27e0e652da34c52801f3d32fd0b8f06165c55efe2ee2f3d3885a69
diff --git a/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv b/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv
index 32241cc30..68031d5dc 100644
--- a/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv
+++ b/internal/provision/testdata/plan14-root-reads-precert-dns01-1293.tsv
@@ -1,7 +1,7 @@
# Census overlay precert-dns01-1293, written by census-propose (#369). census-ruling-precert-dns01-1293, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-precert-dns01-1293.md.
# 1 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@legacy a895803f2b82d6dd142f1853ba5a1098d51aec6ad0100b5084da88df478763bc internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES from the edge environment (the root-owned host.env); unset or no valid zone = nil, nothing else read. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162
-internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES from the edge environment (the root-owned host.env); unset or no valid zone = nil, nothing else read. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162
-@coverage internal/edge 6e046973e5766fc1808c378175255ccf805e4a2f2c2501cca529920cd6edd721
-@coverage internal/host 0952dedf3ade93a279ea3c54793faf0a9b843bba4143ae52768c3262070b7d68
-@coverage internal/hostenv 98d6fa36a9c07aacbd18f9c13487e79aa304dc79e2b018db65f12eb6a8e16875
+@legacy e2f9aff7fc89e6f5d85c811489416b8961496c0d29550f52852948b90a1fb8a4 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162
+internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside. It is a different source, not a subset: an attached name not yet published as pointing is no longer listed, while a name the route table has already dropped stays listed until this box's next edges file write and the home map's next poll catch up (HostPolicy still refuses an order for a name the registry no longer holds). A name published not pointing is not a warm candidate at all, whether or not its certificate is cached: the warm neither looks it up, orders it nor re-arms its renewal until its home box publishes it pointing again (a cached certificate keeps serving and re-arms on a handshake at the issuer). The warm reads the set only after the issuer gate, and the read is in memory (route table and the home map's last snapshot); it also drops a DNS-miss entry for a name that has left the set before probing it. It keeps a failure record while any box publishes the exact name (the home map DeployedHosts: every box's file, own included, pointing or not, the same in-memory snapshot) or the name is a regional route-table name, and prunes it only once no box publishes it. That retention set has no apps-domain or wildcard filter (those stay on candidacy only), so a name published not pointing, or one a wildcard parent starts covering, keeps the record that explains its backoff; the set is never a source of candidates. No read site added in this unit, same 5 sites.;rev3=census-ruling-w6-ingress-drain;basis=the two public servers are built by e.publicServers (internal/edge/ingressdrain.go): :443 as before (same handler, TLS config and ReadHeaderTimeout 10 s), :80 now wrapped by plainTracked so the ingress drain can count and close its requests (its barrier is never §25's); Serve's error test is listenerFailed(err) = err != nil && !errors.Is(err, http.ErrServerClosed) (was err != ErrServerClosed), so a graceful Shutdown by the drain is not fatal. New Edge.plain connDrain field. Same flags, addresses and listeners; read sites unchanged (5); no read added.;rev3=census-ruling-edge-ppv2;basis=Edge process (uid carlos), not root. Edge gains the proxy atomic.Pointer. Outside dev mode, before either public listener binds and before the ready hook hands the Edge to the agent, calls e.loadProxyIngress(os.Getenv, dataDir): CARLOS_INGRESS_PROXY_SOURCES from the edge's own environment (carlos-edge.service loads the root-owned 0600 host.env) through hostenv.ParseProxySources; blank leaves the edge unarmed with nothing read; a non-empty list arms it and Lstats <dataDir>/edge/trust-barrier (armProxyIngress); a value that does not parse is log.Fatal. After the hairpin configuration, wrapProxyIngress wraps both public listeners outermost (returns them untouched when unarmed); when armed it logs the armed line and starts runProxyJournal (counters to the journal, no reads). The existing 5 read sites are unchanged.;rev3=census-ruling-audit-request-path;basis=the dev-mode http.Server gains IdleTimeout: publicIdleTimeout (120 s) beside its ReadHeaderTimeout; comment updated. Same 5 read sites, no read added.;rev3=census-ruling-precert-dns01-1293;basis=the edge process (carlos-edge.service, user carlos), not root: after the cert warm starts, calls e.newPreIssuerFromEnv(certCache, mirror, wm) and, when it returns non-nil, starts its loop and logs one line. newPreIssuerFromEnv (precert.go) reads CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the edge environment (the root-owned host.env); either unset or invalid = nil, nothing else read. Only claims of the named accounts qualify. Armed, the loop runs only while this box holds the issuer gate: it lists domains/ claims in the deployment bucket through a ClaimCache, and for proven claims under the listed zones orders a certificate over DNS-01 through the existing DNS provider seam (dnsProviderFromEnv, same IAM-scoped _acme-challenge TXT writes the wildcard manager already makes), writing the result through the existing publishing cache (local acme dir + control/certs/<host>). No root read; the existing 5 read sites are unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 50e87b602c51b69fbe19d43e67210ca878e2ba0acb003eb326ab16e4619ad162
+@coverage internal/edge bd2687218d3fd9be8c701f7b548871479f224151a87b6e7f710a16d460aed0c4
+@coverage internal/host d3e30f0432b1fb8a0c4affe1e1cd7cccf39d181f47ed44b2832d0465b7f22ddb
+@coverage internal/hostenv 42dfd4b787b820301c75ee2a5c158a31b8db4fedd748b32140bd0cfc565fb411