carlos / platform Public

census: re-propose member-backups-2a after census round 1 (#898)

Claims for hibernateRun.run (refuses root first), readStrict (exactly
one value), Read, ReadFresh, ReadVerify and writeFile now state the
root guards. Seal 40c84595 -> 3c417644. For census round 2 on #280.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 132dc89a94d71a248780c46569fa0b48d4ec50c9 parent 8590369
4 files changed, +27 −23
  • docs/superpowers/notes/census-claims-member-backups-2a.tsv +10 −6
  • docs/superpowers/notes/census-proposal-member-backups-2a.md +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv +15 −15

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-claims-member-backups-2a.tsv b/docs/superpowers/notes/census-claims-member-backups-2a.tsv
index 056e638d7..5edcd4533 100644
--- a/docs/superpowers/notes/census-claims-member-backups-2a.tsv
+++ b/docs/superpowers/notes/census-claims-member-backups-2a.tsv
@@ -6,25 +6,29 @@
# <data>/monitor/{self.json,verify-assign.json,verify.json} follows no symlink in any component,
# reads only a regular single-link file under a cap and writes through a random staging name,
# so it is safe even for a process running as root. Elsewhere than Linux all of it is refused.
+# Census round 1 (P1, ls284 fault family) and the controller ruling: root takes no input or authority
+# from <data>/monitor. The drill refuses to run as euid 0 before reading any monitor file or touching
+# the store or registry, and a root-run agent neither writes self.json/verify-assign.json nor reads
+# verify.json (drillRecordsArmed, as restartWatchFile/engineBeatArmed). P2: readStrict takes exactly one value.
internal/host/movespass.go:armPhase1 the agent (user carlos): RemoveVerifyEntry is now a closure calling dbverify.RemoveHost(ctx, s, cfg.Box, h), so a landing move clears the host only from this box's own drill record control/verify/<cfg.Box>.json in the deployment bucket instead of the one shared control/restore-verify.json. cfg.Box is metricsBoxLabel, the same label haself.go gives lease.SetSelf and so the same ref the agent writes to self.json. KeyFor refuses a ref boxself.ValidRef refuses (one key segment, no slash), and then nothing is read or written. No read site added, the same five sites, B2,C authority retained.
internal/host/units/carlos-hibernate-verify.service:external comment lines only: the header now describes the per-box record control/verify/<ref>.json, the on-disk scratch dir, the drill reading <data>/monitor/self.json and (group box) <data>/monitor/verify-assign.json, and that bootstrap arms the timer on every box. Every directive is byte-for-byte unchanged (User=carlos, EnvironmentFile=-/etc/carlos/host.env, ExecStart=/opt/carlos/carlos ops hibernate-verify, CacheDirectory/TMPDIR, ReadWritePaths=/data, the sandboxing and MemoryMax). The arming itself is bootstrap.go (enabledUnits gains carlos-hibernate-verify.timer, inertUnits drops it), in the internal/host envelope.
internal/host/agent.go:runAgent the agent (user carlos): the HA duty-view closure moved out to dutyView (verifyassign.go) with the same body, which is why runAgent loses -registry:Host and -whole:Route x2 and dutyView gains exactly those. runAgent now hands svc.SetDutyView to armDutyView, which sets the same view on the duties as before and, on a group box only (groupReferenced, CARLOS_BOX_REFERENCE=group from host.env), starts verifyAssignLoop over reg.List (the agent's own registry handle) and the data dir dd it already uses. No new read source, no new credential.
internal/host/agent.go:dataDirFrom new, the agent: dataDir's body taking getenv as a parameter (CARLOS_DATA_DIR, else the /data literal) so agentEntry can compute the data dir from the getenv it is given. Same two data literals dataDir held, moved. Reads nothing else.
internal/host/agent.go:dataDir quiet: now dataDirFrom(os.Getenv), its two data literals moved into dataDirFrom. Same answer.
-internal/boxself/boxself.go:Read new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos): reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Not called by root code, and safe if it were.
-internal/boxself/boxself.go:ReadFresh new, the drill only (user carlos): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's.
-internal/boxself/boxself.go:readStrict new, the drill only: boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode (unknown fields and trailing values refused). No file I/O of its own now. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query.
+internal/boxself/boxself.go:Read new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos), which refuses to run as root before calling it: reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Never reached as root: the drill is its only caller and refuses euid 0 first.
+internal/boxself/boxself.go:ReadFresh new, the drill only (user carlos, never root: hibernateRun.run refuses euid 0 before it): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's.
+internal/boxself/boxself.go:readStrict new, the drill only (never root): boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode refusing unknown fields, and exactly one value: a second Decode must return io.EOF, so a trailing }, ], second value or malformed bytes are refused (census round 1 P2, Decoder.More cannot say this). No file I/O of its own. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query.
internal/host/verifyassign.go:computeAssignment new, the agent (user carlos), group boxes only: for each registry route with HA set, takes the serving box refs from the duty view (the same view the HA duties use) and picks boxchoice.HRW(host, refs), the hash the duties already used (moved from activator dutyHRW). Reads rt.HA and rt.Host and passes the whole Route to the view. Its result is only the assignment the drill reads. No file, bucket or command.
internal/host/verifyassign.go:dutyView new, the agent: the HA duty-view closure moved verbatim out of runAgent (a sidecar's projection by its lifetime placement, a sidecar the index does not know denied, DutySnapshot for any other route). Same reads the closure had in runAgent, no new ones.
internal/host/verifyassign.go:runVerifyAssign new, the agent, group boxes only: lists the agent's own registry routes, writes computeAssignment's result with boxself.WriteAssignment, and on a list or write error logs and leaves the last file in place. One whole Route use (the listed routes handed on). Reads nothing else.
-internal/metrics/verify.go:ReadVerify new, the agent's metrics loop, every alert tick: reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy of this box's record, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only, refused over the cap. A missing file is no reading. Parsed as a dbverify.Record (version 2 required) into alert readings only (host names, streaks, reasons, behind). Never opens, runs or queries anything named in it. Safe for a root-run agent too.
-internal/ops/ops.go:hibernateRun.run new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. Its +file:Open is registry.Open(RegPath), the same registry the old body opened (<data>/registry.db or -registry), now closed right after HibernatingHosts. New before it: boxself.ReadFresh of self.json (refuses to run without a fresh record from the agent) and dbreads.ValidRegion(CARLOS_REGION from host.env). After it: dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (reads verify-assign.json on a group box), MkdirTemp under TMPDIR (the unit's on-disk CacheDirectory), the drill, and publishes via dbverify.Publish to control/verify/<ref>.json only. The deployment store is openDeployStore as before.
+internal/metrics/verify.go:ReadVerify new, the agent's metrics loop, every alert tick, and only for an agent that is not root: host.newVerifyWatch(euid, path) gives a root-run agent no path, so it never calls ReadVerify or works out the path (ls284, drillRecordsArmed, as newRestartWatchFile). Reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only. json.Unmarshal takes exactly one value. A missing file is no reading. Parsed into alert readings only. Never opens, runs or queries anything named in it.
+internal/ops/ops.go:hibernateRun.run new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. First of all it refuses root (Root, from os.Geteuid() == 0 in runHibernateVerify): one log line, exit 1, before any monitor file is read, the deployment store opened or the registry opened (census round 1 P1, ls284: self.json, which the carlos user writes, names the record a run replaces). Then, as before: boxself.ReadFresh of self.json (refuses to run without a fresh record), dbreads.ValidRegion(CARLOS_REGION), openDeployStore, registry.Open(RegPath) (its +file:Open, the same registry the old body opened, closed after HibernatingHosts), dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (verify-assign.json on a group box), MkdirTemp under the unit's on-disk TMPDIR, the drill, and dbverify.Publish to control/verify/<ref>.json only.
internal/ops/ops.go:parseHibernateVerifyFlagsTo new, the drill: flag parsing moved out of runHibernateVerify (-registry, -data, -budget, -max, hidden -publish-every). Its data literal is defaultDataDir in the -data usage text, the same literal the old flag set held. Reads nothing.
internal/ops/ops.go:runHibernateVerify quiet: now only parses flags, reads the activator config, sets up the stop signal and hands the run to hibernateRun.run. Its registry.Open moved to hibernateRun.run.
internal/ops/hibernate_verify.go:HibernatingHosts the drill: the same reg.List filter (not BackingUnit, not stateless, ActivatorLeased, DBPath set), now also copying each route's Account (through registry.EffectiveAccount) and App into HibernatingRoute, which the drill uses to bind a verdict to the instance (dbreads.CaptureIdentity / ConfirmIdentity over the instance's record in the deployment bucket). Reads the same listed routes, no new source.
internal/boxself/boxself.go:ReadFile new, the one read of the three monitor files (self.json and verify-assign.json by the drill, verify.json by the agent through metrics.ReadVerify): readFile on Linux, ErrUnsupported elsewhere. A missing file wraps os.ErrNotExist, anything unsafe or over max is ErrUnsafe.
internal/boxself/io_linux.go:readFile new, Linux only: safefile.OpenFile(path, O_RDONLY), which walks every directory from / with O_NOFOLLOW|O_DIRECTORY and opens the last component only after an O_PATH|O_NOFOLLOW handle fstats as a regular file with one link (so a symlink, FIFO, socket, device, directory or hard link is never opened for reading), then io.ReadAll over io.LimitReader(max+1) and a refusal over max. Safe for root and for carlos: nothing the carlos user plants redirects it.
-internal/boxself/io_linux.go:writeFile new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes, verify-assign.json by the agent on group boxes every 5 minutes, verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC.
+internal/boxself/io_linux.go:writeFile new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes and verify-assign.json by the agent on group boxes every 5 minutes, neither by a root-run agent (agentEntry and verifyAssignLoop return first when euid is 0), verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC.
internal/safefile/reap_linux.go:ReapStages new, called by boxself (agent and drill, user carlos) on <data>/monitor before each write and once at agent start: Reap's checks applied to dir's own entries only, descending into nothing. openDir no-follow from /, ReadDir of that directory, and for an entry whose name is exactly .carlos-write-<32 lowercase hex> openat2 with RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS|RESOLVE_NO_XDEV and O_NOFOLLOW, then the existing reapStage: owned by this euid, mode 0700, older than olderThan, holding at most one regular single-link data file of this euid, the entry re-checked by dev/ino before each unlinkat. Removes nothing else and follows nothing. Missing dir is nil.
internal/hostbox/empty_census.go:censusStageCheck new, root's claim census and migration census: for an entry directly in a CensusStages directory whose name is exactly safefile's stage name, accepts only a real directory (WalkDir type not symlink) that safefile.OpenDir opens without following any component, and whose first three entries are none, or one regular file named data. ReadDir of names and types only, no file opened or read, nothing below walked (SkipDir). Anything else is ErrTypedInventory. Narrow by design: it lets a crashed boxself write's leftover pass the census instead of wedging it.
internal/hostbox/empty_census.go:EmptyInstallationCensus.checkLocal body: one more branch in the shared-path walk after the exact-rule lookup: an entry censusIsStage names (a stage-named entry directly in a CensusStages directory) goes to censusStageCheck. No other rule, refusal or read changes. The same nine sites.
diff --git a/docs/superpowers/notes/census-proposal-member-backups-2a.md b/docs/superpowers/notes/census-proposal-member-backups-2a.md
index a55d55d7d..ba694ffc3 100644
--- a/docs/superpowers/notes/census-proposal-member-backups-2a.md
+++ b/docs/superpowers/notes/census-proposal-member-backups-2a.md
@@ -45,6 +45,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- quiet `internal/ops/ops.go:runHibernateVerify`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
- reads `internal/ops/hibernate_verify.go:HibernatingHosts`: +registry:Account, +registry:App; keeps legacy, task accepted-legacy
-Seal: `40c8459580c3e62a53637e9989f1616e5735ce78796ec6ea1b22655a5eb4ad63` → `a51642d7a2dea0506dfd4b9116aec5261629d2a525d13250712f21cd42f6af10`.
+Seal: `40c8459580c3e62a53637e9989f1616e5735ce78796ec6ea1b22655a5eb4ad63` → `3c417644d5e0f91936a79d2a62259f6de38a3324743cd88c2e246a68b0bf9224`.
Overlay: `internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 38dcb7593..2ba02ce43 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -169,4 +169,4 @@ plan14-root-reads-group-capacity-damping.tsv 0c649af234a7b89a75479e59e705307e329
plan14-root-reads-group-verb-followups.tsv 9c74b9876a13a3a3802860fe44406898c8bcbfd3bd22e8172a59a02674c3b4af
plan14-root-reads-group-read-transport-retry.tsv 9c74b9876a13a3a3802860fe44406898c8bcbfd3bd22e8172a59a02674c3b4af
plan14-root-reads-linked-deployments-slice1.tsv 40c8459580c3e62a53637e9989f1616e5735ce78796ec6ea1b22655a5eb4ad63
-plan14-root-reads-member-backups-2a.tsv a51642d7a2dea0506dfd4b9116aec5261629d2a525d13250712f21cd42f6af10
+plan14-root-reads-member-backups-2a.tsv 3c417644d5e0f91936a79d2a62259f6de38a3324743cd88c2e246a68b0bf9224
diff --git a/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv b/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv
index 7da58ee54..72685d1b8 100644
--- a/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv
+++ b/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv
@@ -2,19 +2,19 @@
# 5 body, 1 sites, 16 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 18 new dispositions: 1 reads re-frozen at their disposition with the claim, 15 new units frozen accepted-legacy, 2 quiet units retired while they read nothing, 0 other.
@legacy da6959baf82f9b6423665b204b41cb853d8d8af62dabcc137a00716a8462bcf1 internal/host/units/carlos-hibernate-verify.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-member-backups-2a;basis=comment lines only: the header now describes the per-box record control/verify/<ref>.json, the on-disk scratch dir, the drill reading <data>/monitor/self.json and (group box) <data>/monitor/verify-assign.json, and that bootstrap arms the timer on every box. Every directive is byte-for-byte unchanged (User=carlos, EnvironmentFile=-/etc/carlos/host.env, ExecStart=/opt/carlos/carlos ops hibernate-verify, CacheDirectory/TMPDIR, ReadWritePaths=/data, the sandboxing and MemoryMax). The arming itself is bootstrap.go (enabledUnits gains carlos-hibernate-verify.timer, inertUnits drops it), in the internal/host envelope. file:external@0 da1688e959f8c33a57cdcf0baec1796fdb1d403dfe9679df25b7d3424a4e241f
-@legacy 8d2e9b0b0fbbd33fe43e15ac375d9a6c79e483f805957aac04d579e73149cfe3 internal/boxself/boxself.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos): reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Not called by root code, and safe if it were. file:Read@5 ef840852070607d6c2cca1c999adeac1f723716e23c89c030d3a3a5541ff67dd
+@legacy b3ab4bfa9ff24e740bed7bae02bcd3dea68f2c784c684fe068054034b0ab6ad5 internal/boxself/boxself.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos), which refuses to run as root before calling it: reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Never reached as root: the drill is its only caller and refuses euid 0 first. file:Read@5 ef840852070607d6c2cca1c999adeac1f723716e23c89c030d3a3a5541ff67dd
@legacy f1d32703aac97cdbcf62b807256f32fc38c054cb52dd1323c9da70e5338ca3c7 internal/boxself/boxself.go ReadFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the one read of the three monitor files (self.json and verify-assign.json by the drill, verify.json by the agent through metrics.ReadVerify): readFile on Linux, ErrUnsupported elsewhere. A missing file wraps os.ErrNotExist, anything unsafe or over max is ErrUnsafe. file:ReadFile@5 8d494eeacc5af3802121ca0780357093905911fe2e6d4368d92a6541ffcc5031
-@legacy cef1c8dded47138d0f994e33ac071de2beb081e560623a2aac9732be3be7fcbe internal/boxself/boxself.go ReadFresh legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's. file:Read@95 2a84bea3f8f3ac6bd5632cad358e6b5e4acd2821a492cfe9c787356143005d9e
-@legacy 8b5c2bb82f569765e191438d77a0d32e048c73797b1e18a5998b2b20fba8cea1 internal/boxself/boxself.go readStrict legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only: boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode (unknown fields and trailing values refused). No file I/O of its own now. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query. file:ReadFile@67 372020ecc73fde7a1b17c925ddff10ca95b85e52855c91c2d1e0fd61c03460b7
+@legacy 54e699073bbf617ebf7e0b8bfa79ac5fd72485a01c460213e5bcafd1d5158c42 internal/boxself/boxself.go ReadFresh legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos, never root: hibernateRun.run refuses euid 0 before it): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's. file:Read@95 2a84bea3f8f3ac6bd5632cad358e6b5e4acd2821a492cfe9c787356143005d9e
+@legacy f6475093a6985a2746b5b4429e120edd1f1bdf39dff2c1fba736b0bd66dbe34f internal/boxself/boxself.go readStrict legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (never root): boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode refusing unknown fields, and exactly one value: a second Decode must return io.EOF, so a trailing }, ], second value or malformed bytes are refused (census round 1 P2, Decoder.More cannot say this). No file I/O of its own. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query. file:ReadFile@67 5195372714e17b9b4aee4bb51a556832b13eef4cec672eebf4bb1aa13f026edc
@legacy 98dd837231c210d35b5ca6aaa95c21472b56f58b59404ff117034c2525ceb13e internal/boxself/io_linux.go readFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only: safefile.OpenFile(path, O_RDONLY), which walks every directory from / with O_NOFOLLOW|O_DIRECTORY and opens the last component only after an O_PATH|O_NOFOLLOW handle fstats as a regular file with one link (so a symlink, FIFO, socket, device, directory or hard link is never opened for reading), then io.ReadAll over io.LimitReader(max+1) and a refusal over max. Safe for root and for carlos: nothing the carlos user plants redirects it. file:OpenFile@65,file:ReadAll@278 bd278a499e88fedfd0706554b758fd1d062bee0116b9d58360865cdbf1561de1
-@legacy 15e92745cb45106f4d0785c1fcd3ed79d5bb4dc521339761949339788c2f8a41 internal/boxself/io_linux.go writeFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes, verify-assign.json by the agent on group boxes every 5 minutes, verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC. file:Fstatat@495 542009670d5e82131bbbab7653c4bcf056932eed2cebce3356a550fe6c9bf997
+@legacy 10de65dba6f3d1a1d7f34efa2f86072d07408eb4452ed7ab8ace9c7bffb988e3 internal/boxself/io_linux.go writeFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes and verify-assign.json by the agent on group boxes every 5 minutes, neither by a root-run agent (agentEntry and verifyAssignLoop return first when euid is 0), verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC. file:Fstatat@495 542009670d5e82131bbbab7653c4bcf056932eed2cebce3356a550fe6c9bf997
@legacy 40152be15d7b2c8918eef4c637811fddb6dee91ed1290f595acc98ec3681f1e5 internal/host/agent.go dataDirFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent: dataDir's body taking getenv as a parameter (CARLOS_DATA_DIR, else the /data literal) so agentEntry can compute the data dir from the getenv it is given. Same two data literals dataDir held, moved. Reads nothing else. data-literal@122,data-literal@70 db4cb2d4a068006be7fb509beca9ab0b2aa04d912b4674e914875fe27b4a9d57
@legacy 8967a17ebb888c5d306204f28ea457773444c6735b3cb7c5d87f59487b42148b internal/host/verifyassign.go computeAssignment legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent (user carlos), group boxes only: for each registry route with HA set, takes the serving box refs from the duty view (the same view the HA duties use) and picks boxchoice.HRW(host, refs), the hash the duties already used (moved from activator dutyHRW). Reads rt.HA and rt.Host and passes the whole Route to the view. Its result is only the assignment the drill reads. No file, bucket or command. registry:HA@206,registry:Host@388,registry:Host@460,registry:Host@495,whole:Route@191,whole:Route@242 8837552094468b1add2d14e304753b9db34d2d23c26f12cbd75e646c5a5a6160
@legacy cea6dd19c63338c8980c88318884d505aa06b395ccf20a1747f9e2205afe35eb internal/host/verifyassign.go dutyView legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent: the HA duty-view closure moved verbatim out of runAgent (a sidecar's projection by its lifetime placement, a sidecar the index does not know denied, DutySnapshot for any other route). Same reads the closure had in runAgent, no new ones. registry:Host@191,whole:Route@302,whole:Route@358 23d23f2ea5eb0385614d8264cc07be61d0199764f74ef21b730133d54fec80ad
@legacy 658a406e2ad0139dea9f748c5c63a0b52ab58c7870ef054be791a46b0a166b71 internal/host/verifyassign.go runVerifyAssign legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent, group boxes only: lists the agent's own registry routes, writes computeAssignment's result with boxself.WriteAssignment, and on a list or write error logs and leaves the last file in place. One whole Route use (the listed routes handed on). Reads nothing else. whole:Route@365 29dbc06dfaa3846891cbf4a1bce8082c9bc3759a4ce47e67e29ac3717adb9a57
@legacy e0f969e4415730cae78db1c72d30f47d9b131f20bf1feef6dca613482ac71df3 internal/hostbox/empty_census.go censusStageCheck legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, root's claim census and migration census: for an entry directly in a CensusStages directory whose name is exactly safefile's stage name, accepts only a real directory (WalkDir type not symlink) that safefile.OpenDir opens without following any component, and whose first three entries are none, or one regular file named data. ReadDir of names and types only, no file opened or read, nothing below walked (SkipDir). Anything else is ErrTypedInventory. Narrow by design: it lets a crashed boxself write's leftover pass the census instead of wedging it. file:ReadDir@250 2176126eaed2df6249d4a1c6577956dba79be08656d21f5d8307b6115b47a241
-@legacy 0c34c62e5ed733a5c659f355caecf60f93c8b8e4feece78bfb1875b13ae6244f internal/metrics/verify.go ReadVerify legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent's metrics loop, every alert tick: reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy of this box's record, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only, refused over the cap. A missing file is no reading. Parsed as a dbverify.Record (version 2 required) into alert readings only (host names, streaks, reasons, behind). Never opens, runs or queries anything named in it. Safe for a root-run agent too. file:ReadFile@226 53321f5997500d7831775aad96f6a3d8c7ed45529efe55a08466b8922e7262eb
-@legacy 825bc146e1d948b4c2fd62f3a853d5bbc07892be197ef03c6119bd26a3ab3c43 internal/ops/ops.go hibernateRun.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. Its +file:Open is registry.Open(RegPath), the same registry the old body opened (<data>/registry.db or -registry), now closed right after HibernatingHosts. New before it: boxself.ReadFresh of self.json (refuses to run without a fresh record from the agent) and dbreads.ValidRegion(CARLOS_REGION from host.env). After it: dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (reads verify-assign.json on a group box), MkdirTemp under TMPDIR (the unit's on-disk CacheDirectory), the drill, and publishes via dbverify.Publish to control/verify/<ref>.json only. The deployment store is openDeployStore as before. file:Open@847 8304062bfa85e5fbe40209554a9529ab1bee31ffc4aa94564dbc44ebc6c77c3a
+@legacy e217983a45ff9bc79d0b496fbd713d3ac92873efec41fde0b2ef5b15d7e06078 internal/metrics/verify.go ReadVerify legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent's metrics loop, every alert tick, and only for an agent that is not root: host.newVerifyWatch(euid, path) gives a root-run agent no path, so it never calls ReadVerify or works out the path (ls284, drillRecordsArmed, as newRestartWatchFile). Reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only. json.Unmarshal takes exactly one value. A missing file is no reading. Parsed into alert readings only. Never opens, runs or queries anything named in it. file:ReadFile@226 53321f5997500d7831775aad96f6a3d8c7ed45529efe55a08466b8922e7262eb
+@legacy 0de8f5d55268130831a16d0d31c83fd0b306865f732bfa99c3ca1a4370e67791 internal/ops/ops.go hibernateRun.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. First of all it refuses root (Root, from os.Geteuid() == 0 in runHibernateVerify): one log line, exit 1, before any monitor file is read, the deployment store opened or the registry opened (census round 1 P1, ls284: self.json, which the carlos user writes, names the record a run replaces). Then, as before: boxself.ReadFresh of self.json (refuses to run without a fresh record), dbreads.ValidRegion(CARLOS_REGION), openDeployStore, registry.Open(RegPath) (its +file:Open, the same registry the old body opened, closed after HibernatingHosts), dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (verify-assign.json on a group box), MkdirTemp under the unit's on-disk TMPDIR, the drill, and dbverify.Publish to control/verify/<ref>.json only. file:Open@1381 4fae57813664c632d1a8f0cc8fb0aec720fbe0d9a9106e9c9fab7f7b14a04679
@legacy 3621456d5f69fbe0b9d3776cef4aba9715ffbca70c494fe032a0697c31f902b3 internal/ops/ops.go parseHibernateVerifyFlagsTo legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill: flag parsing moved out of runHibernateVerify (-registry, -data, -budget, -max, hidden -publish-every). Its data literal is defaultDataDir in the -data usage text, the same literal the old flag set held. Reads nothing. data-literal@332 c3bab95458f6316836cffe04127a4280dba975ae456c64d5bbe1942a133ec61e
@legacy 4188beb78e1cd204b7fcdb9cf24318a391da4bc2939cdd80cad57a89079eecff internal/safefile/reap_linux.go ReapStages legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, called by boxself (agent and drill, user carlos) on <data>/monitor before each write and once at agent start: Reap's checks applied to dir's own entries only, descending into nothing. openDir no-follow from /, ReadDir of that directory, and for an entry whose name is exactly .carlos-write-<32 lowercase hex> openat2 with RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS|RESOLVE_NO_XDEV and O_NOFOLLOW, then the existing reapStage: owned by this euid, mode 0700, older than olderThan, holding at most one regular single-link data file of this euid, the entry re-checked by dev/ino before each unlinkat. Removes nothing else and follows nothing. Missing dir is nil. file:ReadDir@327 1a0fb8b22c43d7352bacc0d39b394a991ace5505afb34546eb119d5f70368a1e
@legacy ee1f24d6b48c5d4207a6481fdc5d9ceb2bb738c44570108520abae679f34eefd internal/ops/hibernate_verify.go HibernatingHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the same expression as FleetDBsWithSkipped's exclusion, Route.ActivatorLeased instead of Hibernate, so a resident rootfs row is drilled here;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Exclude projected stateless routes from per-host database freshness verification. Box-wide Litestream exclusion remains 3b-owned.;rev3=census-ruling-member-backups-2a;basis=the drill: the same reg.List filter (not BackingUnit, not stateless, ActivatorLeased, DBPath set), now also copying each route's Account (through registry.EffectiveAccount) and App into HibernatingRoute, which the drill uses to bind a verdict to the instance (dbreads.CaptureIdentity / ConfirmIdentity over the instance's record in the deployment bucket). Reads the same listed routes, no new source. registry:Account@756,registry:App@773,registry:Backing@397,registry:DBPath@626,registry:DBPath@707,registry:Host@691,registry:Stateless@588,whole:Route@190 6ef18400668a71a4ee424ed9093e0ccd02e5e6f48a59bc5639893630c826853d
@@ -23,19 +23,19 @@ internal/host/units/carlos-hibernate-verify.service external legacy accepted-leg
internal/hostbox/empty_census.go EmptyInstallationCensus.checkLocal authority C,G rev3=PROPOSED-p3;run=25;identity=root instance-control uid 0; agent fallback uid carlos remains strict;basis=new-host empty census classifies sibling state only by exact root installation and payload revision with persistent identity, and sibling live links only by matching root generation reservation; unknown and selected-host artifacts refuse;rev3=census-ruling-member-backups-2a;basis=body: one more branch in the shared-path walk after the exact-rule lookup: an entry censusIsStage names (a stage-named entry directly in a CensusStages directory) goes to censusStageCheck. No other rule, refusal or read changes. The same nine sites. file:Exec@1153,file:Lstat@2914,file:WalkDir@3161,registry:ClaimOwnership@2173,registry:Host@2120,whole:ClaimOwnership@2177,whole:ClaimOwnership@2195,whole:Route@2108,whole:Timer@2337 43a8de527e6e1e326141b45b05c6e06e5b1827247be5650a2be420d3f32972cb
internal/hostbox/empty_census.go censusRule.check authority C,J2,J4 root-input;rev3=census-ruling-member-backups-2a;basis=body: the new stage: rule kind checks its own directory the way tree: does (a real directory, not a symlink), and classifies nothing below it. No read added. file:Readlink@530 c83bb13c054e4fc9205378bda804c1985c584a9625253238987b325643d62ca1
internal/hostbox/migration_census_linux.go CheckMigrationRoots authority G,J4 rev3=census-ruling-claim-step8-readiness;run=18;identity=offline root migration uid 0;basis=accounts for trusted vendor systemd links separately from retained installation artifacts without exempting unknown files or CARLOS unit aliases; a refusal now names the root and path it could not classify;rev3=census-ruling-member-backups-2a;basis=body: the same censusIsStage branch as checkLocal, after the exact-rule lookup and before the vendor-unit and tree checks, reporting a refusal through migrationRefusal. No other change. The same two sites. file:Lstat@932,file:WalkDir@1202 84ef8e13be8649dcaf1c0b535ac44fde11b53c855478535103005bcc45f121c5
-internal/boxself/boxself.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos): reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Not called by root code, and safe if it were. file:Read@5 ef840852070607d6c2cca1c999adeac1f723716e23c89c030d3a3a5541ff67dd
+internal/boxself/boxself.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new package boxself, called only by the drill (ops hibernateRun.run through ReadFresh, user carlos), which refuses to run as root before calling it: reads <data>/monitor/self.json through readStrict with a 64 KiB cap (boxself.ReadFile: no symlink followed in any component, a regular file with one link only, a FIFO or directory refused before it is opened). It checks version 1 and a ref ValidRef accepts (one key segment) and returns the ref and group flag. Never reached as root: the drill is its only caller and refuses euid 0 first. file:Read@5 ef840852070607d6c2cca1c999adeac1f723716e23c89c030d3a3a5541ff67dd
internal/boxself/boxself.go ReadFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the one read of the three monitor files (self.json and verify-assign.json by the drill, verify.json by the agent through metrics.ReadVerify): readFile on Linux, ErrUnsupported elsewhere. A missing file wraps os.ErrNotExist, anything unsafe or over max is ErrUnsafe. file:ReadFile@5 8d494eeacc5af3802121ca0780357093905911fe2e6d4368d92a6541ffcc5031
-internal/boxself/boxself.go ReadFresh legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's. file:Read@95 2a84bea3f8f3ac6bd5632cad358e6b5e4acd2821a492cfe9c787356143005d9e
-internal/boxself/boxself.go readStrict legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only: boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode (unknown fields and trailing values refused). No file I/O of its own now. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query. file:ReadFile@67 372020ecc73fde7a1b17c925ddff10ca95b85e52855c91c2d1e0fd61c03460b7
+internal/boxself/boxself.go ReadFresh legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos, never root: hibernateRun.run refuses euid 0 before it): Read plus a refusal (ErrStale) of a record older than maxAge (the drill passes 15 minutes), more than a minute in the future, or with no time, so a stopped agent's record names no box and the drill does not run. Adds no file read beyond Read's. file:Read@95 2a84bea3f8f3ac6bd5632cad358e6b5e4acd2821a492cfe9c787356143005d9e
+internal/boxself/boxself.go readStrict legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (never root): boxself.ReadFile(path, max) (self.json 64 KiB, verify-assign.json 1 MiB) then a strict JSON decode refusing unknown fields, and exactly one value: a second Decode must return io.EOF, so a trailing }, ], second value or malformed bytes are refused (census round 1 P2, Decoder.More cannot say this). No file I/O of its own. The paths are fixed under the data dir. Its contents only name the box ref the drill publishes under and narrow which HA hosts it drills, never a path, a command or a query. file:ReadFile@67 5195372714e17b9b4aee4bb51a556832b13eef4cec672eebf4bb1aa13f026edc
internal/boxself/io_linux.go readFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only: safefile.OpenFile(path, O_RDONLY), which walks every directory from / with O_NOFOLLOW|O_DIRECTORY and opens the last component only after an O_PATH|O_NOFOLLOW handle fstats as a regular file with one link (so a symlink, FIFO, socket, device, directory or hard link is never opened for reading), then io.ReadAll over io.LimitReader(max+1) and a refusal over max. Safe for root and for carlos: nothing the carlos user plants redirects it. file:OpenFile@65,file:ReadAll@278 bd278a499e88fedfd0706554b758fd1d062bee0116b9d58360865cdbf1561de1
-internal/boxself/io_linux.go writeFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes, verify-assign.json by the agent on group boxes every 5 minutes, verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC. file:Fstatat@495 542009670d5e82131bbbab7653c4bcf056932eed2cebce3356a550fe6c9bf997
+internal/boxself/io_linux.go writeFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, Linux only, the one write of the three monitor files (self.json by the agent every 5 minutes and verify-assign.json by the agent on group boxes every 5 minutes, neither by a root-run agent (agentEntry and verifyAssignLoop return first when euid is 0), verify.json by the drill through ops writeLocalVerify, which now does no file I/O of its own): safefile.MkdirAll and safefile.OpenDir of the directory (no symlink followed in any component), fstatat(name, AT_SYMLINK_NOFOLLOW) refusing an existing target that is not a regular file, then safefile.WriteAt on that open directory: a fresh 0700 staging directory under a random name, the file created in it with O_CREAT|O_EXCL|O_NOFOLLOW, written, chmod 0644 (explicit, so the other process reads it), fsynced, renameat onto the target relative to the open directory, directory fsynced. No fixed scratch name, nothing opened by a name the carlos user can pre-plant, a rename that replaces a name and never follows it. Before staging it calls safefile.ReapStages on that directory with a 10-minute age (best effort, errors ignored), removing this euid's crashed writes' stages there only. Replaces the earlier writeAtomic, which used a fixed <path>.tmp and O_TRUNC. file:Fstatat@495 542009670d5e82131bbbab7653c4bcf056932eed2cebce3356a550fe6c9bf997
internal/host/agent.go dataDirFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent: dataDir's body taking getenv as a parameter (CARLOS_DATA_DIR, else the /data literal) so agentEntry can compute the data dir from the getenv it is given. Same two data literals dataDir held, moved. Reads nothing else. data-literal@122,data-literal@70 db4cb2d4a068006be7fb509beca9ab0b2aa04d912b4674e914875fe27b4a9d57
internal/host/verifyassign.go computeAssignment legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent (user carlos), group boxes only: for each registry route with HA set, takes the serving box refs from the duty view (the same view the HA duties use) and picks boxchoice.HRW(host, refs), the hash the duties already used (moved from activator dutyHRW). Reads rt.HA and rt.Host and passes the whole Route to the view. Its result is only the assignment the drill reads. No file, bucket or command. registry:HA@206,registry:Host@388,registry:Host@460,registry:Host@495,whole:Route@191,whole:Route@242 8837552094468b1add2d14e304753b9db34d2d23c26f12cbd75e646c5a5a6160
internal/host/verifyassign.go dutyView legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent: the HA duty-view closure moved verbatim out of runAgent (a sidecar's projection by its lifetime placement, a sidecar the index does not know denied, DutySnapshot for any other route). Same reads the closure had in runAgent, no new ones. registry:Host@191,whole:Route@302,whole:Route@358 23d23f2ea5eb0385614d8264cc07be61d0199764f74ef21b730133d54fec80ad
internal/host/verifyassign.go runVerifyAssign legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent, group boxes only: lists the agent's own registry routes, writes computeAssignment's result with boxself.WriteAssignment, and on a list or write error logs and leaves the last file in place. One whole Route use (the listed routes handed on). Reads nothing else. whole:Route@365 29dbc06dfaa3846891cbf4a1bce8082c9bc3759a4ce47e67e29ac3717adb9a57
internal/hostbox/empty_census.go censusStageCheck legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, root's claim census and migration census: for an entry directly in a CensusStages directory whose name is exactly safefile's stage name, accepts only a real directory (WalkDir type not symlink) that safefile.OpenDir opens without following any component, and whose first three entries are none, or one regular file named data. ReadDir of names and types only, no file opened or read, nothing below walked (SkipDir). Anything else is ErrTypedInventory. Narrow by design: it lets a crashed boxself write's leftover pass the census instead of wedging it. file:ReadDir@250 2176126eaed2df6249d4a1c6577956dba79be08656d21f5d8307b6115b47a241
-internal/metrics/verify.go ReadVerify legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent's metrics loop, every alert tick: reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy of this box's record, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only, refused over the cap. A missing file is no reading. Parsed as a dbverify.Record (version 2 required) into alert readings only (host names, streaks, reasons, behind). Never opens, runs or queries anything named in it. Safe for a root-run agent too. file:ReadFile@226 53321f5997500d7831775aad96f6a3d8c7ed45529efe55a08466b8922e7262eb
-internal/ops/ops.go hibernateRun.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. Its +file:Open is registry.Open(RegPath), the same registry the old body opened (<data>/registry.db or -registry), now closed right after HibernatingHosts. New before it: boxself.ReadFresh of self.json (refuses to run without a fresh record from the agent) and dbreads.ValidRegion(CARLOS_REGION from host.env). After it: dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (reads verify-assign.json on a group box), MkdirTemp under TMPDIR (the unit's on-disk CacheDirectory), the drill, and publishes via dbverify.Publish to control/verify/<ref>.json only. The deployment store is openDeployStore as before. file:Open@847 8304062bfa85e5fbe40209554a9529ab1bee31ffc4aa94564dbc44ebc6c77c3a
+internal/metrics/verify.go ReadVerify legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the agent's metrics loop, every alert tick, and only for an agent that is not root: host.newVerifyWatch(euid, path) gives a root-run agent no path, so it never calls ReadVerify or works out the path (ls284, drillRecordsArmed, as newRestartWatchFile). Reads <data>/monitor/verify.json (dbverify.LocalPath), the drill's local copy, through boxself.ReadFile with a 1 MiB cap (dbverify.LocalMax): no symlink followed, a regular single-link file only. json.Unmarshal takes exactly one value. A missing file is no reading. Parsed into alert readings only. Never opens, runs or queries anything named in it. file:ReadFile@226 53321f5997500d7831775aad96f6a3d8c7ed45529efe55a08466b8922e7262eb
+internal/ops/ops.go hibernateRun.run legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill (carlos ops hibernate-verify, user carlos): the verb's body, moved out of runHibernateVerify so a test can run it whole. First of all it refuses root (Root, from os.Geteuid() == 0 in runHibernateVerify): one log line, exit 1, before any monitor file is read, the deployment store opened or the registry opened (census round 1 P1, ls284: self.json, which the carlos user writes, names the record a run replaces). Then, as before: boxself.ReadFresh of self.json (refuses to run without a fresh record), dbreads.ValidRegion(CARLOS_REGION), openDeployStore, registry.Open(RegPath) (its +file:Open, the same registry the old body opened, closed after HibernatingHosts), dbverify.Load of this box's own control/verify/<ref>.json, selectHosts (verify-assign.json on a group box), MkdirTemp under the unit's on-disk TMPDIR, the drill, and dbverify.Publish to control/verify/<ref>.json only. file:Open@1381 4fae57813664c632d1a8f0cc8fb0aec720fbe0d9a9106e9c9fab7f7b14a04679
internal/ops/ops.go parseHibernateVerifyFlagsTo legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill: flag parsing moved out of runHibernateVerify (-registry, -data, -budget, -max, hidden -publish-every). Its data literal is defaultDataDir in the -data usage text, the same literal the old flag set held. Reads nothing. data-literal@332 c3bab95458f6316836cffe04127a4280dba975ae456c64d5bbe1942a133ec61e
internal/safefile/reap_linux.go ReapStages legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, called by boxself (agent and drill, user carlos) on <data>/monitor before each write and once at agent start: Reap's checks applied to dir's own entries only, descending into nothing. openDir no-follow from /, ReadDir of that directory, and for an entry whose name is exactly .carlos-write-<32 lowercase hex> openat2 with RESOLVE_BENEATH|RESOLVE_NO_SYMLINKS|RESOLVE_NO_XDEV and O_NOFOLLOW, then the existing reapStage: owned by this euid, mode 0700, older than olderThan, holding at most one regular single-link data file of this euid, the entry re-checked by dev/ino before each unlinkat. Removes nothing else and follows nothing. Missing dir is nil. file:ReadDir@327 1a0fb8b22c43d7352bacc0d39b394a991ace5505afb34546eb119d5f70368a1e
internal/ops/hibernate_verify.go HibernatingHosts legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the same expression as FleetDBsWithSkipped's exclusion, Route.ActivatorLeased instead of Hibernate, so a resident rootfs row is drilled here;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Exclude projected stateless routes from per-host database freshness verification. Box-wide Litestream exclusion remains 3b-owned.;rev3=census-ruling-member-backups-2a;basis=the drill: the same reg.List filter (not BackingUnit, not stateless, ActivatorLeased, DBPath set), now also copying each route's Account (through registry.EffectiveAccount) and App into HibernatingRoute, which the drill uses to bind a verdict to the instance (dbreads.CaptureIdentity / ConfirmIdentity over the instance's record in the deployment bucket). Reads the same listed routes, no new source. registry:Account@756,registry:App@773,registry:Backing@397,registry:DBPath@626,registry:DBPath@707,registry:Host@691,registry:Stateless@588,whole:Route@190 6ef18400668a71a4ee424ed9093e0ccd02e5e6f48a59bc5639893630c826853d
@@ -47,16 +47,16 @@ internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-
@coverage internal/activator 6b77746e88cea431a2431ceed309b2dd1f93d30ae106466b7ad206d20c158b19
@coverage internal/alerting f6e549908a84dd337258672702c99911929bd8ef5f587dee752672ca034fb7e2
@coverage internal/boxchoice ece558d52bbfea1fddb62a1cf72923277d15ae703a9252af70e0aa65be71f5e1
-@coverage internal/boxself 3ee63283d5b2ff250248b9e8207848178f873384100d85cc3def7fa28a097e6e
+@coverage internal/boxself 33707c17853b7a44e9ebba7d9ab927ce74d8d12cba55631f6b77c77fafd3e25b
@coverage internal/dbreads f72b24e2fee6abbd121dec290f64e3db084986d3f52b9246b083b95dd23dbb1e
@coverage internal/dbverify 86c7a3e2d489d8b2f1492ce540094dabd0fcd543a6a50ebf33e14dbcc82fc435
-@coverage internal/host 5043a7b9cba9ba6bd8ceae0ed11d028197b6974ba282cc385042e5ccdb62fa9a
+@coverage internal/host f17fbae2cb1fda8eda5a5889e219ac4fede37a9e86db751e5ceb95f2a7b52384
@coverage internal/host/units 8a4e5748de16e76d530d2a82f4a8554cd728e523b82b7dadf233ad95e16f8555
@coverage internal/hostbox 7b06ed9912b0a8bb9ddb0590dfe5d28f3a758947e39383fd45114dc73ae3af25
@coverage internal/hostops 19db0dd625c5fce18062fed5af958c1714f10c9be489869530f86581ad036436
@coverage internal/lease 08fa56059b42517b1a875a4ae15a4b62ed7e7ead4548caaa0e854d1ca0cc686b
@coverage internal/metrics 77a33a529198f08a8463bbd2457d1115eddd8e0aa3578856110f675f2d6cd491
@coverage internal/moves 3895687f7e68200bad063865c140aaf2d54450a50f4685e59753cae98ae6f17a
-@coverage internal/ops f21da8dabc10782a903406dfed2c908452b7b85c044086ff09361e61c9eb4b33
+@coverage internal/ops f3f61bf6938628ca919efb2099542d38f8a4bedcf18798ef718e724b9302b2f8
@coverage internal/release e0a8fb001daa384d3ef4d4ccac8c59b9af52a5cca91218ecb64110a48768fe6a
@coverage internal/safefile b91f35e83de69d9227930559950fdb086a020d72ca6ec55d50d596fb7a0b3556