carlos / platform Public

cert import (#1429): census re-check 1 fixes

The portable opener refuses every entry; the spec, docs and the unconfirmed-import message say what actually happens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev bd4a20a5abea4fd111e340284cf4a3e0d53d2d58 parent 54fb2e5
11 files changed, +81 −81
  • docs/site/cli.md +2 −2
  • docs/superpowers/notes/census-proposal-cert-import-1429.md +2 −3
  • docs/superpowers/reviews/cert-import-1429/ASTRA-CENSUS-RECHECK-1.md +45 −0
  • docs/superpowers/reviews/cert-import-1429/CENSUS-RECHECK-BRIEF-2.md +7 −0
  • docs/superpowers/specs/2026-11-25-cert-import-1429-design.md +13 −4
  • internal/console/domaincert_copy.go +1 −1
  • internal/domains/certimport_read.go +1 −30
  • internal/domains/certimport_read_portable.go +6 −2
  • internal/domains/certimport_read_test.go +1 −34
  • internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv +2 −4
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1

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-W5z1xI
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/superfly/ltx v0.5.1
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/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 golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/lmittmann/tint v1.1.3
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 google.golang.org/protobuf v1.36.10
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/klauspost/compress v1.20.2
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/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 modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1

amadan: job cancelled — a newer push superseded it
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 549024fff..483643f7f 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -2036,8 +2036,8 @@ carlos domains cert remove --app shop shop.example.com
```
This stops serving the imported certificate. Edges usually stop serving it
-within seconds, and at worst within 30 minutes. Detaching the hostname also
-removes its import within minutes.
+within seconds, and within 30 minutes while the platform's storage is
+working. Detaching the hostname also removes its import within minutes.
### carlos features
diff --git a/docs/superpowers/notes/census-proposal-cert-import-1429.md b/docs/superpowers/notes/census-proposal-cert-import-1429.md
index 5b2c33d79..483baca28 100644
--- a/docs/superpowers/notes/census-proposal-cert-import-1429.md
+++ b/docs/superpowers/notes/census-proposal-cert-import-1429.md
@@ -1,6 +1,6 @@
# Census approval: cert-import-1429
-Ruling `census-ruling-cert-import-1429`. The independent reviewer approves or rejects every change below, 6 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-cert-import-1429`. 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 |
|---|---|---|---|
@@ -22,11 +22,10 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `domains_cert_cli.go:readCertFile`: reads +file:Open, +file:ReadAll; written legacy, accepted-legacy, frozen
- new `internal/domains/certimport_read.go:ReadImportedCert`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
-- new `internal/domains/certimport_read.go:openImportEntryPortable`: reads +file:Lstat, +file:Open, +file:Stat; written legacy, accepted-legacy, frozen
- new `internal/domains/certimport_read_nofollow.go:openImportEntry`: reads +file:Open, +file:Stat; written legacy, accepted-legacy, frozen
- new `internal/edge/certimport.go:certMirror.pruneLocalImports`: reads +file:ReadDir; written legacy, accepted-legacy, frozen
- new `internal/edge/certimport.go:certMirror.reconcileLocalImport`: reads +file:Lstat; written legacy, accepted-legacy, frozen
-Seal: `0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1` → `aac62dd4a123188fcb422f8219a940e7257773362c861a8fc72d56d36183a775`.
+Seal: `0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1` → `f8456c51c3a939da8642127aa5daffe5c892ade4e35dc6845d6bcd2c2aa19742`.
Overlay: `internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/cert-import-1429/ASTRA-CENSUS-RECHECK-1.md b/docs/superpowers/reviews/cert-import-1429/ASTRA-CENSUS-RECHECK-1.md
new file mode 100644
index 000000000..29402bed9
--- /dev/null
+++ b/docs/superpowers/reviews/cert-import-1429/ASTRA-CENSUS-RECHECK-1.md
@@ -0,0 +1,45 @@
+Reviewed `a7952ca8c9216cb8f72576f2bee123c4b2f9dae8`, within round 3’s budget.
+
+| Census unit | Verdict | Basis |
+|---|---|---|
+| [`certMirror.backfill`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certsync.go:1346) | APPROVED | Imports are excluded before disk reads and publication. |
+| [`RunWithActivatorReady`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/edge.go:5172) | APPROVED | Wires in-memory selection and issuer-gated reconciliation; no additional root authority. |
+| [`edgesFileWriteClaims`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/host/edgesfile.go:887) | APPROVED | Publication checks usability, account and app through one bounded read. |
+| [`readCertFile`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/domains_cert_cli.go:95) | APPROVED | Bounded operator-selected CLI input. |
+| [`UsableImportedCert`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport.go:126) | APPROVED | Delegates to the single validated read; checks its returned account. |
+| [`ReadImportedCert`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_read.go:23) | APPROVED | Linux path validates one descriptor’s bytes, capped at 64 KiB. |
+| [`openImportEntry`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_read_nofollow.go:13) | APPROVED | `O_NOFOLLOW`, `O_NONBLOCK`, descriptor type and size checks enforce the Linux basis. |
+| [`openImportEntryPortable`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_read.go:58) | REJECTED | Submitted symlink-swap refusal guarantee is false; explanation below. |
+| [`certMirror.pruneLocalImports`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certimport.go:186) | APPROVED | Removes regular cache entries absent from a successful listing. |
+| [`certMirror.reconcileLocalImport`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certimport.go:226) | APPROVED | Removes nonregular entries without reading them; cache writes use temporary-file replacement. |
+| [`importBoundTo`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/host/edgesfile_import.go:19) | APPROVED | Account and app come from the same entry whose usability was checked. |
+
+The portable opener’s [recorded basis](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv:16) claims a swapped symlink is refused. After `Lstat(p)`, rename that file to `saved` and replace `p` with a symlink to `saved`. `Open(p)` follows the link; `SameFile(before, after)` succeeds because both identify the original inode. This rejects the submitted basis, not the separate Linux production opener.
+
+| Re-pinned envelope | Verdict | Basis |
+|---|---|---|
+| `.` | APPROVED | CLI registration, bounded file reads and API calls preserve the authority boundary. |
+| `internal/domains` | REJECTED | Portable opener’s recorded refusal guarantee is not established. |
+| `internal/edge` | APPROVED | Cache replacement, wildcard selection and conditional reconciliation preserve their census boundaries. |
+| `internal/host` | APPROVED | Early publication now uses one validated entry with account/app binding. |
+
+| Record-write entry | Verdict | Basis |
+|---|---|---|
+| [`routeDecls`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/console/routedecls.go:909) | APPROVED | Existing key-site classification retained; person-only, host-claim-gated routes. |
+| [`linkedPolicies`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/console/linkedpolicy.go:92) | APPROVED | Existing classification retained; linked credentials refused. |
+| [`WriteImport`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_invariant.go:139) | APPROVED | `nonrecord`: writes only the certificate import object. |
+| [`reconcileLocalImport`](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certimport.go:226) | APPROVED | `nonrecord`: writes only the local certificate cache. |
+
+**Overall census verdict: REJECTED.**
+
+- **R3 P1 — resolved:** wildcard-covered imported names reach compatible-certificate selection; deterministic whole-chain coverage exists at [certimport_test.go:1275](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certimport_test.go:1275). The console refuses known wildcard overlap; static wildcard parents are handled by the edge guard.
+- **R3 P2-2 — partly:** unsupported-store refusal, detached bounded completion, distinct withdrawal errors and failure simulation are implemented. The [spec’s unconditional claim](/home/paulca/amadan.net/carlos/platform-cert-import-1429/docs/superpowers/specs/2026-11-25-cert-import-1429-design.md:156) remains inconsistent with permitted failed withdrawal.
+- **R3 P2-3 — partly:** Linux reads and remove-and-rewrite are fixed; the portable opener’s claimed symlink refusal remains unproven as detailed above.
+- **R3 P2-4 — resolved:** [cursor rotation](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/edge/certimport.go:375) advances past failures while retaining the five-attempt limit.
+- **R3 P2-5 — partly:** [removal documentation](/home/paulca/amadan.net/carlos/platform-cert-import-1429/docs/site/cli.md:2038) includes 30 minutes but still presents it as an unconditional maximum and omits storage-failure delays.
+
+**New P2 — failed-confirmation response promises removal that may never happen.** At this commit, [certWithdrawFailed](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/console/domaincert_copy.go:55) promises issuer removal within minutes. If confirmation reads fail and withdrawal fails while the claim remains unchanged, [finishImport](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_invariant.go:198) returns that error. After storage recovers, [StaleImport](/home/paulca/amadan.net/carlos/platform-cert-import-1429/internal/domains/certimport_invariant.go:310) preserves the matching entry. An operator is therefore promised withdrawal while the certificate can remain served. Fault family: acquisition-bound authority and withdrawal recovery.
+
+Targeted domains tests and the record-write census passed. Edge, host, console and root-read census checks were blocked by the read-only default Go cache. No files edited; concurrent copy edits were excluded from this commit-specific review.
+
+**FIXES NOT CONFIRMED**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/cert-import-1429/CENSUS-RECHECK-BRIEF-2.md b/docs/superpowers/reviews/cert-import-1429/CENSUS-RECHECK-BRIEF-2.md
new file mode 100644
index 000000000..40fa37ad0
--- /dev/null
+++ b/docs/superpowers/reviews/cert-import-1429/CENSUS-RECHECK-BRIEF-2.md
@@ -0,0 +1,7 @@
+# Census re-check 2: cert-import-1429 (within round 3's budget)
+
+Your re-check 1 (ASTRA-CENSUS-RECHECK-1.md) rejected only `openImportEntryPortable` and the `internal/domains` envelope, said R3 P2-2 and P2-5 were partly resolved, and raised one new P2 (the 500 message promised removal of an import that may legitimately stay). Read the delta `git diff a7952ca8c9216cb8f72576f2bee123c4b2f9dae8 HEAD -- . ':!docs/superpowers/reviews'`.
+
+Changes: the opener for systems without O_NOFOLLOW now refuses every entry and reads nothing (internal/domains/certimport_read_portable.go; openImportEntryPortable is gone, so the census retires it); the spec's simulation paragraph states the failed-withdraw and unconfirmed-but-valid cases; docs/site/cli.md bounds the 30 minutes to "while the platform's storage is working"; the 500 message now says the certificate was written but not confirmed, and to import again or remove it. The copy files and docs also carry Luna pass 2's wording.
+
+Give: verdicts for the `internal/domains` envelope and any unit the card now lists as changed or removed in docs/superpowers/notes/census-proposal-cert-import-1429.md (the others you approved stand unless this delta touches them); one line each for P2-2, P2-5 and your new P2 (resolved / partly / not); then one overall census verdict (APPROVED / REJECTED) and one line FIXES CONFIRMED or FIXES NOT CONFIRMED. A new finding only if this delta introduced it. Do not edit files; targeted tests only.
diff --git a/docs/superpowers/specs/2026-11-25-cert-import-1429-design.md b/docs/superpowers/specs/2026-11-25-cert-import-1429-design.md
index f69516a5d..5f34e00d8 100644
--- a/docs/superpowers/specs/2026-11-25-cert-import-1429-design.md
+++ b/docs/superpowers/specs/2026-11-25-cert-import-1429-design.md
@@ -153,13 +153,22 @@ reconcile removes it.
(`internal/domains/certimport_sim_test.go`). Over thousands of seeds it
interleaves writes by two accounts and apps, detaches, re-attaches
(including same-second ones), removes, reconcile passes, and injected
-read, list and CAS failures. After every step it checks: a successful
-write leaves its own binding matching the claim; no write leaves a
-non-matching binding of its own behind; a reconcile never removes an
+read, list, Put and delete failures, cancelled contexts and a store
+without conditional delete. After every step it checks: a successful
+write leaves its own binding matching the claim; a write leaves a
+non-matching binding of its own behind only when it returned
+`ErrImportWithdrawFailed`, and the next clean reconcile removes it; a
+write whose confirm failed but whose claim still matches leaves a valid
+import, which stays (the operator is told to import again or remove it);
+a store without conditional delete is never written; a reconcile never removes an
in-date import bound to the current claim; after a clean pass every
remaining import matches; nothing but the holder's own write or remove
replaces or deletes an import bound to the current claim. Each rule is
-mutation-checked (blind retry, unconditional delete, unread as absent).
+mutation-checked (ten weakenings, listed on the branch).
+
+The opener that reads an import from a box's cert cache uses
+`O_NOFOLLOW|O_NONBLOCK` and an `fstat` of that descriptor (linux,
+darwin). Elsewhere it refuses every entry: no edge or agent runs there.
## Invariant 2: each hello gets a certificate it supports
diff --git a/internal/console/domaincert_copy.go b/internal/console/domaincert_copy.go
index cde7a5ce5..9eb45ccfd 100644
--- a/internal/console/domaincert_copy.go
+++ b/internal/console/domaincert_copy.go
@@ -52,7 +52,7 @@ const (
// certWithdrawFailed: the entry was written, could not be confirmed
// against the claim, and could not be withdrawn. Reviewed by Luna,
// pass 2.
- certWithdrawFailed = "the certificate was written but could not be confirmed; the issuer's cleanup removes it within minutes. Try again"
+ certWithdrawFailed = "the certificate was written but could not be confirmed. Import it again to confirm it, or remove it with carlos domains cert remove"
// The Activity rows. %s are the host, the leaf's SHA-256 (hex), the
// issuer's common name and the expiry (RFC 3339).
diff --git a/internal/domains/certimport_read.go b/internal/domains/certimport_read.go
index 76dfbf988..4467619de 100644
--- a/internal/domains/certimport_read.go
+++ b/internal/domains/certimport_read.go
@@ -40,37 +40,8 @@ func ReadImportedCert(acmeDir, host string, now time.Time) (ImportBinding, *tls.
return b, cert, true
}
-// importEntryOK is the descriptor check both openers apply: a regular file
+// importEntryOK is the descriptor check the opener applies: a regular file
// no larger than the bound.
func importEntryOK(fi os.FileInfo) bool {
return fi.Mode().IsRegular() && fi.Size() <= maxImportEntry
}
-
-// importOpenSwapHook, when set (tests only), runs between the portable
-// opener's Lstat and its Open: the window a swap would use.
-var importOpenSwapHook func()
-
-// openImportEntryPortable is the opener for systems without O_NOFOLLOW:
-// Lstat (a regular file), Open, then Fstat, and the two must be the same
-// file, so a symlink or another file swapped in between is refused. It
-// cannot stop a FIFO swapped in between the Lstat and the Open from
-// blocking that Open; the systems that use it have no O_NONBLOCK open.
-func openImportEntryPortable(path string) (*os.File, bool) {
- before, err := os.Lstat(path)
- if err != nil || !importEntryOK(before) {
- return nil, false
- }
- if importOpenSwapHook != nil {
- importOpenSwapHook()
- }
- f, err := os.Open(path)
- if err != nil {
- return nil, false
- }
- after, err := f.Stat()
- if err != nil || !importEntryOK(after) || !os.SameFile(before, after) {
- f.Close()
- return nil, false
- }
- return f, true
-}
diff --git a/internal/domains/certimport_read_portable.go b/internal/domains/certimport_read_portable.go
index 8838794ae..5f8d560d1 100644
--- a/internal/domains/certimport_read_portable.go
+++ b/internal/domains/certimport_read_portable.go
@@ -4,5 +4,9 @@ package domains
import "os"
-// openImportEntry is the portable opener where O_NOFOLLOW is not used.
-func openImportEntry(path string) (*os.File, bool) { return openImportEntryPortable(path) }
+// openImportEntry refuses every entry on systems without O_NOFOLLOW and
+// O_NONBLOCK. No box agent or edge runs on them (only the CLI does, and it
+// never reads an edge's cert cache), and an Lstat-then-Open opener cannot
+// refuse a file renamed away and replaced by a symlink to it (Astra, census
+// re-check, #1429). So no imported certificate is ever read here.
+func openImportEntry(string) (*os.File, bool) { return nil, false }
diff --git a/internal/domains/certimport_read_test.go b/internal/domains/certimport_read_test.go
index 8d9e06d30..ac097f38a 100644
--- a/internal/domains/certimport_read_test.go
+++ b/internal/domains/certimport_read_test.go
@@ -35,7 +35,7 @@ func TestReadImportedCert(t *testing.T) {
t.Fatal("an expired entry reads as usable")
}
- // A symlink to a good entry is refused, by both openers.
+ // A symlink to a good entry is refused.
link := filepath.Join(dir, ImportName("link.example.com"))
if err := os.Symlink(filepath.Join(dir, ImportName(simHost)), link); err != nil {
t.Fatal(err)
@@ -43,10 +43,6 @@ func TestReadImportedCert(t *testing.T) {
if _, _, ok := ReadImportedCert(dir, "link.example.com", now); ok {
t.Fatal("a symlink was followed")
}
- if f, ok := openImportEntryPortable(link); ok {
- f.Close()
- t.Fatal("the portable opener followed a symlink")
- }
// Over 64 KiB is refused before it is parsed.
big := filepath.Join(dir, ImportName("big.example.com"))
@@ -56,33 +52,4 @@ func TestReadImportedCert(t *testing.T) {
if _, _, ok := ReadImportedCert(dir, "big.example.com", now); ok {
t.Fatal("an oversized entry was read")
}
- if f, ok := openImportEntryPortable(big); ok {
- f.Close()
- t.Fatal("the portable opener took an oversized entry")
- }
-}
-
-// TestReadImportedCertPortableDetectsASwap: a file swapped in between the
-// portable opener's Lstat and its Open is not the file it checked.
-func TestReadImportedCertPortableDetectsASwap(t *testing.T) {
- dir := t.TempDir()
- b := ImportBinding{Host: simHost, Account: "acca", App: "web", ClaimCreated: "2026-11-20T10:00:00Z"}
- p := writeImportFile(t, dir, simHost, b)
- other := writeImportFile(t, t.TempDir(), simHost, ImportBinding{Host: simHost, Account: "accb", App: "web", ClaimCreated: b.ClaimCreated})
-
- if f, ok := openImportEntryPortable(p); !ok {
- t.Fatal("the portable opener refused a good entry")
- } else {
- f.Close()
- }
- importOpenSwapHook = func() {
- if err := os.Rename(other, p); err != nil {
- t.Error(err)
- }
- }
- t.Cleanup(func() { importOpenSwapHook = nil })
- if f, ok := openImportEntryPortable(p); ok {
- f.Close()
- t.Fatal("the portable opener took a file swapped in after its Lstat")
- }
}
diff --git a/internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv b/internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv
index 7724c95d6..8ac85feb5 100644
--- a/internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv
+++ b/internal/provision/testdata/plan14-root-reads-cert-import-1429.tsv
@@ -1,11 +1,10 @@
# Census overlay cert-import-1429, written by census-propose (#369). census-ruling-cert-import-1429, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-cert-import-1429.md.
# 2 body, 1 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 6 new dispositions: 0 reads re-frozen at their disposition with the claim, 6 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+# 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 5e2c501ab3ebfdc3cce687d3af1d1ed7b03ab0a0aa45675438d49e6a31095254 internal/edge/certsync.go certMirror.backfill legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-cert-import-1429;basis=#1429: skips cache entries whose name ends in +import (an imported certificate is the console's to write and the issuer reconcile's to delete, never republished from a box's disk). Publishes less, never more; no read added, same 2 sites. file:ReadDir@402,file:ReadFile@1805 8e370214bd191cdfb86349a307d151371d7b1bdc743ed3533b67ae1e9657b6d5
@legacy 992b8781c2669a00d5b0a7775251140bc7d3c707ad398eccde590024dbf7d3a3 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.;rev3=census-ruling-alias-publish-precert-1293;basis=the edge process (carlos-edge.service, user carlos), not root: the pre-issuer start log now reads its zones from p.scope.Zones (the zones and accounts moved into the shared edge.DNS01Scope); no behaviour change, no read added, the existing 5 read sites unchanged.;rev3=census-ruling-cert-import-1429;basis=#1429: the edge process (carlos-edge.service, user carlos), not root: inserts mirror.wrapImported between perHostCert's capture and the wildcard wrap (a handshake for a name with a usable imported certificate in the mirror's memory, for a deployment host, returns chooseCert's answer over the wildcard covering the name, the <host> and <host>+rsa entries and the import: a supported CARLOS certificate first, else the import; every other name unchanged); the wildcard wrap becomes wrapGetCertificateImports, which passes exactly those imported names down instead of answering with the wildcard (in-memory predicates only: deploymentHost and the mirror snapshot); and starts the issuer-only import reconcile beside the pre-issuer (a ClaimCache.ListWithUnread prefilter rotated by a cursor across passes, then domains.ReconcileImport per host: entry revision, then claim, then DeleteIfMatch on control/certs/<host>+import only, at most 5 a pass, nothing on a failed listing). No root read; the existing 5 read sites unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 3cbb0fc582dd1c8703bb3b3549ca66ccf80284dae139a8e7d1d75c0e2aaae676
@legacy 0fe4545748df674a3eaa4e5d3fb7f94aca93be6c2ea348219b530ab5078eb958 domains_cert_cli.go readCertFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the carlos CLI on the operator's own machine reads the --cert/--key files the operator names (Open, ReadAll capped at 64 KiB) to send them to the console over HTTPS; not a root path on a box. file:Open@70,file:ReadAll@194 060973fd2e67dac557a69bfde974dd15220b74716eda83c6eaf84f5e11761cc4
@legacy 1196384d744fbc1bc5aa4b8b0daa4c8bd52d3d3d386cc8f78599d1ddf6a607de internal/domains/certimport_read.go ReadImportedCert legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: one bounded read of a cached import: <acmeDir>/<host>+import with host passing validHostShape (one file directly under acmeDir), opened once through openImportEntry (no symlink followed, no blocking on a FIFO, the descriptor Fstat'd as a regular file of at most 64 KiB), ReadAll capped at 64 KiB+1 and refused over 64 KiB; the binding, key pair, name and dates are validated from those same bytes (ParseImport, ImportUsable) and returned; never executed, followed or written. Callers: the agent's edges-file writer (importBoundTo, UsableImportedCert) over the edge's cert cache (written by carlos-edge, user carlos). file:ReadAll@334 2f391db58b070ba79a4212ce23cbfc97394baafd6ff676b67e01af73a5955204
-@legacy 61fbf7d477f5c121c146e18c1472dab4ea03a939fcd293e007376e42bd0890c1 internal/domains/certimport_read.go openImportEntryPortable legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429 (systems without O_NOFOLLOW, not linux or darwin): Lstat (a regular file of at most 64 KiB), Open, Fstat, and os.SameFile between the Lstat and the descriptor; a symlink or another file swapped in between is refused. Not compiled into the linux box binaries. file:Lstat@77,file:Open@227,file:Stat@296 92663ac43893dfcc46464aaa3667c1995395be1c5c663da05e7de378cb793e02
@legacy 7839735bbd6df795c56ddf0af114c12e5f2cce855275708d72ce30a521be8abc internal/domains/certimport_read_nofollow.go openImportEntry legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429 (linux, darwin): a single syscall.Open of the path with O_RDONLY|O_NOFOLLOW|O_NONBLOCK|O_CLOEXEC (a symlink at the last component is refused, a FIFO does not block the open), then Fstat on that descriptor: a regular file of at most 64 KiB, else closed and refused. file:Open@65,file:Stat@249 6e5ffb0ecf4591f3832f0a3dc5e899ede6e11c709d429d5f9a91eb3268a5bfeb
@legacy e81c6cb7e09d530a91fa04bde019e71aa2cba5dbf80ad4f79f415ee5a2278b88 internal/edge/certimport.go certMirror.pruneLocalImports legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the edge (user carlos) lists its own cert cache directory and deletes regular files ending in +import whose key a successful control/certs listing did not return; touches only its own cache dir, nothing on a failed listing. file:ReadDir@144 c3a2466d1313f810d82e43dba35f29f2babbdc0e13d15a0000b6ff378a8df398
@legacy a514e95669a88ae22370b0dbbe8f55010189e6d1b64b67a03651bf46106009aa internal/edge/certimport.go certMirror.reconcileLocalImport legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the edge (user carlos), its own cert cache only: Lstats <host>+import; a non-regular entry (symlink, FIFO) is removed with os.Remove, which takes the entry itself and never follows it; then the bucket's bytes are written through the cache's Put (autocert.DirCache: a 0600 temp file renamed over the name). The entry is never opened or read: no symlink followed, no FIFO opened. Called only for bucket bytes this process has not yet reconciled. file:Lstat@202 44f9e6d6fa1ca0e4d681ea6bfcff385050a9cbeb169de00fe8261ca3882aae52
@@ -13,12 +12,11 @@ internal/edge/certsync.go certMirror.backfill legacy accepted-legacy accepted-le
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.;rev3=census-ruling-alias-publish-precert-1293;basis=the edge process (carlos-edge.service, user carlos), not root: the pre-issuer start log now reads its zones from p.scope.Zones (the zones and accounts moved into the shared edge.DNS01Scope); no behaviour change, no read added, the existing 5 read sites unchanged.;rev3=census-ruling-cert-import-1429;basis=#1429: the edge process (carlos-edge.service, user carlos), not root: inserts mirror.wrapImported between perHostCert's capture and the wildcard wrap (a handshake for a name with a usable imported certificate in the mirror's memory, for a deployment host, returns chooseCert's answer over the wildcard covering the name, the <host> and <host>+rsa entries and the import: a supported CARLOS certificate first, else the import; every other name unchanged); the wildcard wrap becomes wrapGetCertificateImports, which passes exactly those imported names down instead of answering with the wildcard (in-memory predicates only: deploymentHost and the mirror snapshot); and starts the issuer-only import reconcile beside the pre-issuer (a ClaimCache.ListWithUnread prefilter rotated by a cursor across passes, then domains.ReconcileImport per host: entry revision, then claim, then DeleteIfMatch on control/certs/<host>+import only, at most 5 a pass, nothing on a failed listing). No root read; the existing 5 read sites unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 3cbb0fc582dd1c8703bb3b3549ca66ccf80284dae139a8e7d1d75c0e2aaae676
domains_cert_cli.go readCertFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the carlos CLI on the operator's own machine reads the --cert/--key files the operator names (Open, ReadAll capped at 64 KiB) to send them to the console over HTTPS; not a root path on a box. file:Open@70,file:ReadAll@194 060973fd2e67dac557a69bfde974dd15220b74716eda83c6eaf84f5e11761cc4
internal/domains/certimport_read.go ReadImportedCert legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: one bounded read of a cached import: <acmeDir>/<host>+import with host passing validHostShape (one file directly under acmeDir), opened once through openImportEntry (no symlink followed, no blocking on a FIFO, the descriptor Fstat'd as a regular file of at most 64 KiB), ReadAll capped at 64 KiB+1 and refused over 64 KiB; the binding, key pair, name and dates are validated from those same bytes (ParseImport, ImportUsable) and returned; never executed, followed or written. Callers: the agent's edges-file writer (importBoundTo, UsableImportedCert) over the edge's cert cache (written by carlos-edge, user carlos). file:ReadAll@334 2f391db58b070ba79a4212ce23cbfc97394baafd6ff676b67e01af73a5955204
-internal/domains/certimport_read.go openImportEntryPortable legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429 (systems without O_NOFOLLOW, not linux or darwin): Lstat (a regular file of at most 64 KiB), Open, Fstat, and os.SameFile between the Lstat and the descriptor; a symlink or another file swapped in between is refused. Not compiled into the linux box binaries. file:Lstat@77,file:Open@227,file:Stat@296 92663ac43893dfcc46464aaa3667c1995395be1c5c663da05e7de378cb793e02
internal/domains/certimport_read_nofollow.go openImportEntry legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429 (linux, darwin): a single syscall.Open of the path with O_RDONLY|O_NOFOLLOW|O_NONBLOCK|O_CLOEXEC (a symlink at the last component is refused, a FIFO does not block the open), then Fstat on that descriptor: a regular file of at most 64 KiB, else closed and refused. file:Open@65,file:Stat@249 6e5ffb0ecf4591f3832f0a3dc5e899ede6e11c709d429d5f9a91eb3268a5bfeb
internal/edge/certimport.go certMirror.pruneLocalImports legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the edge (user carlos) lists its own cert cache directory and deletes regular files ending in +import whose key a successful control/certs listing did not return; touches only its own cache dir, nothing on a failed listing. file:ReadDir@144 c3a2466d1313f810d82e43dba35f29f2babbdc0e13d15a0000b6ff378a8df398
internal/edge/certimport.go certMirror.reconcileLocalImport legacy accepted-legacy accepted-legacy;rev3=census-ruling-cert-import-1429;basis=#1429: the edge (user carlos), its own cert cache only: Lstats <host>+import; a non-regular entry (symlink, FIFO) is removed with os.Remove, which takes the entry itself and never follows it; then the bucket's bytes are written through the cache's Put (autocert.DirCache: a 0600 temp file renamed over the name). The entry is never opened or read: no symlink followed, no FIFO opened. Called only for bucket bytes this process has not yet reconciled. file:Lstat@202 44f9e6d6fa1ca0e4d681ea6bfcff385050a9cbeb169de00fe8261ca3882aae52
internal/host/edgesfile.go edgesFileWriteClaims authority F,J1 rev3=census-ruling-self-serve-moves-1;basis=root-route;kept=F;scope=protected-decision-only; the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): region-ha-2a's body, which with the box's lifetimes switch on also publishes each served row's lifetime pair (registry:Incarnation and registry:ServingSeq, two new sites on the rows it already lists) and an alias's or served catch-all's primary's pair, and names that primary as target_host whatever the switch; a report the edge orders unstamped entries by, not a decision; no record, /data, release or claim read added; F,J1 authority retained; self-serve moves 1 Task 8;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 8: takes a localAddrs reader (instancectl.LocalAddresses in production, which reads /proc/net/fib_trie and /proc/net/if_inet6 in the agent) and publishes its non-loopback entries as the edges file's addrs before the write gate (boxAddrs, no read of its own), so an address change writes once. The same 44 sites, offsets moved; no record, /data, release or claim read added; a report the console's egress grant check reads, not a root decision; F,J1 authority retained.;rev3=census-ruling-edge-asset-cache-3;basis=starts with assets = assets.active(), so a policy whose box has not opened its asset store publishes no assets blocks and reads no manifests, and copies the decision's Primary (the route host the block was decided for, drift D4) into the published assets block; read sites unchanged (44); no read added. Merged onto main's #328 body, which takes the localAddrs reader: the assets.active() line sits after that signature and the loop passes pub and instancectl.LocalAddresses;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the claims argument (*edgesClaims) becomes addrs (AddressSource) and the applyEdgesClaims(ctx, claims, routes, hosts) call is deleted with edgesclaims.go, which is the one whole:Route site removed: no host claim is read and every served row publishes as with region HA off; the box-address publication is the same code reading addrs.BoxAddresses() instead of claims.addrs; a report the edge reads, not a root decision; no read added; merge of origin/main d7ae1d76: main's edge asset cache plan 3 body is kept (census-ruling-edge-asset-cache-3): the first line is assets = assets.active(), so a policy whose store has not opened publishes no assets blocks and reads no manifests, and edgesFileLoop passes pub (assets.active() for that tick) in the assets argument; main's claims *edgesClaims argument is this branch's addrs AddressSource, and no edgesClaims, applyEdgesClaims or hostclaim reference remains;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: skips publishing a platform alias edge.PlatformAliasFold refuses (and so anything attached to it); reads the same route listing;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 and its fix rounds: publishes by FleetArmVerdict (via fleetRefusedFor): withheld rows left out; a forward host's path rows left out of its owner; no assets for forward rows; the alias loop replays Reload's alias fold from the served rows so a chained alias carries its root primary's owner; certRefused and parentRefused leave out a refused claim's wildcard parent (+registry:Alias x5, +registry:Host x4, +whole:Route, +whole:RouteAlias x2, +whole:RoutePath x7, +whole:WildcardDomain). Rows already read in the pass; keeps authority F,J1; publishes less, never more.;rev3=census-ruling-probe-burst-limit;basis=sets the constant BurstNotices=true on the box's own edges file (this build's edge answers probe-burst notices, so peers may send them); not from config or any read; the same 65 sites; a report other edges read, not a root decision; F,J1 authority retained; no new root read or write kind;rev3=census-ruling-region-ha-p3a;basis=Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged.;rev3=census-ruling-region-ha-p2b;basis=region HA P2b-1 T0 (Q1 ruling): before building the comparison copy and the body, a nil NamedPools on the identity becomes []string{} so the additive named_pools field is always an explicit array; the list itself is computed once at arm by edgesFileEligibility from the same provisionTickConfig(os.Getenv) parse as serves_shared_pool (CARLOS_POOLS through provision.ParseBoxPools, filtered to nonempty provision.ValidPool names, sorted, unique). A report the console reads for create admission, not a root decision; no record, /data, release or claim read added; read sites unchanged (65); F,J1 authority retained. One-off cost: the first pass after the upgrade writes once per box (seeded gate null vs []).;rev3=census-ruling-region-ha-p3b;basis=Require cached GroupReadersReady before first group publication and append additive names-2 capability even for supplied identities. Agent writes the same edges object/index with existing registry reads; known readers come from root boot configuration, snapshot from existing fold, no added GET/LIST or root authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Omit non-forward, non-platform-alias rows outside local served pools from home publication; added Host/Pool field reads and local configuration use, existing registry/store operations retained.;rev3=census-ruling-edge-page-cache-1;basis=prunes the manifest cache through the new atomic pointer (assets.manifests.Load().prune(...), nil-safe); nothing else changes; read sites unchanged (67); no read added;rev3=census-ruling-region-ha-held-build;basis=writes also when DrainPublishRequired, and reports the written drain state, its ha_drain mark (transaction and publication id) and generation to DrainSource (in-memory); the file gains ha_drained and ha_drain beside the existing draining; no read added. held-requests Task 4: sets the constant ha_take=1 on the box's own file when its in-memory capabilities include region-ha-1 (this build's edge answers take requests); not from config or any read; a report other edges read, not a root decision; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the agent as carlos: reads PLATFORM_APPS_DOMAIN from the environment once per pass (the variable domainsLoop already reads) and sets an additive dns_pointing mark on each published custom name through dnsPointingMark: true on a published alias (registry:Alias, already published only when its dns_status is pointing), and on a route with a hostname outside the apps domain whether its registry:DNSStatus is pointing (registry:Host, registry:DNSStatus on rows the pass already lists). No mark under the apps domain, on a wildcard row, or with no apps domain set. A report the issuer cert warm reads to leave a not-yet-pointing custom name out of its set, not a root decision; it publishes the same names as before. No record, /data, release or claim read added; no new registry query; F,J1 authority retained. One-off cost: the first pass after the upgrade writes once on a box homing a custom name.;rev3=census-ruling-held-floor-capability;basis=held floor capability (region HA §25.9, agent manager 8a3d302, 2026-11-10): sets the constant ha_handover=1 on the box's own edges file on every pass, whatever its capabilities (this build understands the held-requests headers and the drain acknowledgement); the group roll floor reads it. Not from config or any read; ha_take unchanged; a report other tools read, not a root decision; no read added; F,J1 authority retained. One-off cost: the first pass after the upgrade writes once per box.;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: fleetArmInputs now returns edge.ForwardOwners (this box's fleets table and its active links, registry LinkOwners, read only where tunnels are on), passed to edge.FleetArmVerdict as before, so the hub's eligible link-placed forward rows are published for backhaul like fleet rows; same listing and verdict, no read added in the unit;rev3=census-ruling-path-routes-across-boxes;basis=#186 spec 5.1: publishes route_account, route_app, path_front, path_target (registry.PathFront/PathTarget over the route row) on exact real route rows only (never a platform alias or a '*.' row); additive omitempty fields read from the registry route rows already loaded; adds reads of Route.Host and Route.App;rev3=census-ruling-alias-publish-precert-1293;basis=the box agent (root) writing its own control/edges/<box>.json: an alias not yet stamped pointing is also published (marked dns_pointing false) when edge.DNS01Scope allows its name and account and domains.UsablePerHostCert finds a usable per-host certificate for it. New inputs: CARLOS_DNS01_ZONES and CARLOS_DNS01_ACCOUNTS from the agent environment (root-owned host.env, operator-only), and ident.AcmeDir, set once at arm by runAgent from edgeAcmeDir (the agent's own -acme-cache flag, else $CARLOS_DATA_DIR/acme, the same derivation the domains sweep uses); empty publishes nothing early. New read, via domains.UsablePerHostCert: <AcmeDir>/<alias> for an alias inside the operator scope only, where the name must pass validHostShape (lowercase DNS labels, so one file directly under acme/, no separators or dot segments); Lstat first and only a regular file under 64 KiB is opened (a symlink is not followed); the bytes are only parsed by tls.X509KeyPair and reduced to a boolean, never executed, followed or written. That directory is the edge cache (written by carlos-edge, user carlos) the agent already reads as root in domains hostCertExpiry; same read sites otherwise.;rev3=census-ruling-cert-import-1429;basis=#1429: the box agent writing its own control/edges/<box>.json: an alias not yet stamped pointing is also published (marked dns_pointing false) when importBoundTo finds a usable <AcmeDir>/<alias>+import whose binding's account AND app equal the alias row's (+registry:Account, +registry:Alias, +registry:App on rows the pass already lists). The read is domains.ReadImportedCert's, called once by importBoundTo: one no-follow, non-blocking open (O_NOFOLLOW|O_NONBLOCK on linux and darwin), Fstat a regular file of at most 64 KiB, the binding, key, name and dates validated from those same bytes and reduced to a boolean, never executed, followed or written; the directory is the edge's cert cache (written by carlos-edge, user carlos) that the agent already reads in hostCertExpiry and UsablePerHostCert. Publishes more only for an operator-imported name bound to the alias's own account and app; the issuer's HostPolicy refuses to order for it until pointing. registry:Account@11918,registry:Account@12020,registry:Account@19145,registry:Alias@11292,registry:Alias@11311,registry:Alias@11410,registry:Alias@11689,registry:Alias@11724,registry:Alias@11786,registry:Alias@11909,registry:Alias@11967,registry:Alias@12011,registry:Alias@12372,registry:Alias@12529,registry:Alias@12599,registry:Alias@12631,registry:Alias@13535,registry:Alias@13626,registry:Alias@16618,registry:Alias@16668,registry:App@12031,registry:App@19157,registry:App@6228,registry:DNSStatus@11840,registry:DNSStatus@12538,registry:DNSStatus@5744,registry:Host@11337,registry:Host@11385,registry:Host@16521,registry:Host@16541,registry:Host@16806,registry:Host@16886,registry:Host@16921,registry:Host@16970,registry:Host@17432,registry:Host@17467,registry:Host@18575,registry:Host@4189,registry:Host@4292,registry:Host@4338,registry:Host@4397,registry:Host@5736,registry:Host@6155,registry:Host@6323,registry:Host@7293,registry:Incarnation@5943,registry:Platform@5251,registry:Pool@4252,registry:Provisioned@5265,registry:Replica@5289,registry:ServingSeq@5958,registry:Status@2953,whole:Route@1026,whole:Route@1839,whole:Route@20615,whole:Route@21440,whole:Route@21615,whole:Route@2323,whole:Route@6224,whole:Route@6284,whole:Route@6308,whole:Route@7378,whole:Route@750,whole:RouteAlias@11175,whole:RouteAlias@11257,whole:RouteAlias@11674,whole:RouteAlias@16572,whole:RouteAlias@20637,whole:RouteAlias@21630,whole:RoutePath@20630,whole:RoutePath@21623,whole:RoutePath@7162,whole:RoutePath@7194,whole:RoutePath@7241,whole:RoutePath@7269,whole:RoutePath@7307,whole:RoutePath@7327,whole:RoutePath@7339,whole:RoutePath@7393,whole:WildcardDomain@16499,whole:WildcardDomain@16875 6a48f1b5a95a0fabed37c265926f3cf6f80f8ecd54fada6cbf2c0777b36e0577
@coverage . 1acba188f1992e34b967f6f171f94fa525749adcf369a7955edd5dfbad805364
-@coverage internal/domains 6a8593e52f6cc3ca6aaee39351b9ae2587f6319eea2f6a18d5ee2a134e04bc6d
+@coverage internal/domains 90ff948caefc634ccb499907ce1a25554f7800d4adad36a1a96931697a6a1632
@coverage internal/edge 87d558aa452df6e6b357afc5b3ff8e5d4611c0a514282dfc9169722e7b7274f7
@coverage internal/host d34419988573237f081339b6a2845513a6c6046afc296f03ed7392fe30449112
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 25ec3ec13..bb09e3e4c 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -295,4 +295,4 @@ plan14-root-reads-rootfs-etc-hosts-1349.tsv 892cf87db700600490e3ec9e944f9dbe7151
plan14-root-reads-managed-fleets-2b2.tsv 4bb3547d064b71134612e74b3b8269e16356d2832a8e579ace150349e55c6a27
plan14-root-reads-store-write-credential.tsv 8b8e269938a575bfaeb8f0c9a5be508b4b22a10b7b5bd19d74fa511e5f15a302
plan14-root-reads-rootfs-netlink-route-1419.tsv 0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1
-plan14-root-reads-cert-import-1429.tsv aac62dd4a123188fcb422f8219a940e7257773362c861a8fc72d56d36183a775
+plan14-root-reads-cert-import-1429.tsv f8456c51c3a939da8642127aa5daffe5c892ade4e35dc6845d6bcd2c2aa19742