census: re-propose member-backups-2a after the residual P2s (#898)
Same NAME and claims, plus one claim for the re-digested lease.CheckDBContext (body only: marks proven damage, same reads) and the hibernateRun.run claim noting the cleanup's earlier place. The chain line stays last on main's chain: 44b11f63... -> b130b2d6.... The census is still to be re-confirmed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+13
−8
docs/superpowers/notes/census-claims-member-backups-2a.tsv+2 −1docs/superpowers/notes/census-proposal-member-backups-2a.md+3 −1internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv+7 −5
diff --git a/docs/superpowers/notes/census-claims-member-backups-2a.tsv b/docs/superpowers/notes/census-claims-member-backups-2a.tsv| index c361194a9..1164f00f5 100644 |
| --- a/docs/superpowers/notes/census-claims-member-backups-2a.tsv |
| +++ b/docs/superpowers/notes/census-claims-member-backups-2a.tsv |
| @@ -22,7 +22,7 @@ internal/host/verifyassign.go:computeAssignment new, the agent (user carlos), gr |
| 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, 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. Final fix wave: the same single boxself.ReadFile read; the parsed reading no longer counts a host whose latest verdict is unverified/no_record as behind (coverage). No new read. |
| -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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir before MkdirTemp, and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. |
| +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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir right after the root refusal and the hibernate-config check, before the self record and both empty-fleet returns (re-review item 9), and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. |
| 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. Final fix wave: also copies rt.HA and rt.IsSidecar() (Kind) into HibernatingRoute, so a group box drills non-HA rows itself and the bracket reads a sidecar's record from sidecars/<name>.json (provision.GetSidecarRecord, user carlos) instead of instances/. Same listed routes, no new source. |
| @@ -36,3 +36,4 @@ internal/hostbox/empty_census.go:censusRule.check body: the new stage: rule kind |
| internal/hostbox/migration_census_linux.go:CheckMigrationRoots 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. |
| internal/lease/check.go:recordedRead.Read new, the drill only (carlos ops hibernate-verify, user carlos, never root: hibernateRun.run refuses euid 0 first): wraps the io.ReadCloser of an LTX object the pinned verify restore opens from the hibernate bucket (VerifyReplicaAt with a non-zero txid, which only the drill passes) and passes Read straight through, noting a non-EOF error so a failed restore carries the storage's own error (ltx v0.5.1 drops it). Reads replica bytes litestream was already reading; no new source, path or credential. |
| internal/ops/ops.go:hibernateRun.clearCrashedScratch new, the drill only (user carlos, after the root refusal): os.ReadDir of its own TmpDir (the unit's %C/carlos-verify, from TMPDIR), and os.RemoveAll of each entry that is a real directory (DirEntry type, a symlink is skipped) named carlos-hibernate-verify* and older than two hours: a killed run's restored databases. No pattern expanded, nothing outside TmpDir, and nothing it reads becomes a path, command or query beyond that removal. |
| +internal/lease/check.go:CheckDBContext body only, callers unchanged (the drill, wake/seed paths, hostbox restore, moves; root and carlos): the same open, busy_timeout, integrity_check and schema-count reads of the one path it is given. A result that proves damage (integrity_check not ok, no tables, or a query error whose SQLite code is SQLITE_CORRUPT or SQLITE_NOTADB) is now returned as checkError, which keeps the message and adds errors.Is(err, ErrCheckFailed); open and I/O errors are returned unmarked. Every caller still only tests err != nil except the drill, which reads the mark. No new read, path or source. |
diff --git a/docs/superpowers/notes/census-proposal-member-backups-2a.md b/docs/superpowers/notes/census-proposal-member-backups-2a.md| index ed29c8bb2..658d9d3f5 100644 |
| --- a/docs/superpowers/notes/census-proposal-member-backups-2a.md |
| +++ b/docs/superpowers/notes/census-proposal-member-backups-2a.md |
| @@ -9,6 +9,7 @@ Ruling `census-ruling-member-backups-2a`. The independent reviewer approves or r |
| | `internal/hostbox/empty_census.go` `EmptyInstallationCensus.checkLocal` | body | unchanged (9) | 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. | |
| | `internal/hostbox/empty_census.go` `censusRule.check` | body | unchanged (1) | 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. | |
| | `internal/hostbox/migration_census_linux.go` `CheckMigrationRoots` | body | unchanged (2) | 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. | |
| +| `internal/lease/check.go` `CheckDBContext` | body | unchanged (3) | body only, callers unchanged (the drill, wake/seed paths, hostbox restore, moves; root and carlos): the same open, busy_timeout, integrity_check and schema-count reads of the one path it is given. A result that proves damage (integrity_check not ok, no tables, or a query error whose SQLite code is SQLITE_CORRUPT or SQLITE_NOTADB) is now returned as checkError, which keeps the message and adds errors.Is(err, ErrCheckFailed); open and I/O errors are returned unmarked. Every caller still only tests err != nil except the drill, which reads the mark. No new read, path or source. | |
| | `internal/host/agent.go` `runAgent` | sites | -registry:Host, -whole:Route ×2 | 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. | |
| Envelopes re-pinned: `internal/activator`, `internal/alerting`, `internal/boxchoice`, `internal/boxself`, `internal/dbreads`, `internal/dbverify`, `internal/host`, `internal/host/units`, `internal/hostbox`, `internal/hostops`, `internal/lease`, `internal/metrics`, `internal/moves`, `internal/ops`, `internal/release`, `internal/safefile`. |
| @@ -22,6 +23,7 @@ Recorded dispositions, which each change must still satisfy: |
| - `internal/hostbox/empty_census.go` `EmptyInstallationCensus.checkLocal`: authority, task C,G. Basis: 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 |
| - `internal/hostbox/empty_census.go` `censusRule.check`: authority, task C,J2,J4. Basis: root-input |
| - `internal/hostbox/migration_census_linux.go` `CheckMigrationRoots`: authority, task G,J4. Basis: 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 |
| +- `internal/lease/check.go` `CheckDBContext`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input |
| - `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained.;rev3=census-ruling-w6-ingress-drain;basis=agent (user carlos), not root. Builds the ingress drain (newIngressDrain) with arming read at ask time from os.Getenv (CARLOS_REGION_HA, CARLOS_INGRESS_TARGET_GROUPS, both from the root-owned host.env), the fixed admission and lease.CurrentSelf (existing IMDS identity); its reader is awstg.Load, the box role's credentials calling ELB DescribeTargetHealth/DescribeTargetGroupAttributes (new AWS reads, by the agent). Wires admission.closeStartsForIngressDrain, the lbhealth drain condition, ingress.setEdge, and ingress.shutdownStarted in WithShutdownStarted. The drain socket (/run/carlos/.ha-drain/drain.sock, agent-user only, existing) is now also served on a fixed box with the drain configured (was group members only), routing /v1/ingress/* to the ingress drain and the group drain verbs to 404 there. armHADepartures now takes fixtureDepartureGetenv() and MakeQueue fixtureDepartureQueue(), which in a production (non-rootrunner) build are os.Getenv and nil, as before. Read sites unchanged (9).;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 8: starts linkLoop(e, reg, linkBoxLabel(...)) beside tunnelLoop: the home link loop over the agent's own registry handle (HomeLink, HomeLinkApps, HomeLinkAppByName, ClaimHomeLink, SetHomeLinkState), dialing the link's hub with tunnelclient.Loop; read sites unchanged |
| New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| @@ -47,6 +49,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, +registry:HA; keeps legacy, task accepted-legacy |
| -Seal: `44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f` → `ecd4ad1ec5b8027552456c99abd06862637a26d4c5e021615481794c4a7752f0`. |
| +Seal: `44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f` → `b130b2d616e6476f056f4bd3dd5a5f64dd77aca49e95718ad6419ed0fd37f2d5`. |
| 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 dfd60f07b..816ed32ad 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -175,4 +175,4 @@ plan14-root-reads-activator-settle-wait.tsv b3d35a0bd7c0500c74efbe5e8f566adb6236 |
| plan14-root-reads-lease-checkpoint-no-compaction.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369 |
| plan14-root-reads-member-backups-1.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369 |
| plan14-root-reads-gvisor-empty-execstart.tsv 44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f |
| -plan14-root-reads-member-backups-2a.tsv ecd4ad1ec5b8027552456c99abd06862637a26d4c5e021615481794c4a7752f0 |
| +plan14-root-reads-member-backups-2a.tsv b130b2d616e6476f056f4bd3dd5a5f64dd77aca49e95718ad6419ed0fd37f2d5 |
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 3b08693a9..c57878e73 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-member-backups-2a.tsv |
| @@ -1,7 +1,8 @@ |
| # Census overlay member-backups-2a, written by census-propose (#369). census-ruling-member-backups-2a, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-member-backups-2a.md. |
| -# 5 body, 1 sites, 16 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 6 body, 1 sites, 16 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 20 new dispositions: 1 reads re-frozen at their disposition with the claim, 17 new units frozen accepted-legacy, 2 quiet units retired while they read nothing, 0 other. |
| @legacy 879fc901db72aa4c11c015673482eb22a150171ab849a83b0cffd07aae464fea 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. Final fix wave: comment lines only again: the header says a group box drills its non-HA hosts itself, and a comment above After= explains that carlos-edge.service is the agent and why the drill also waits for self.json. After=, and every other directive, unchanged. file:external@0 05004534292f82998022255db1dd438d7638da8845c315db67041318e0408556 |
| +@legacy 747c1d261671d71f3c1a5561f4a0914507d38d0b9df03bdf9a2c04ebc6a013fb internal/lease/check.go CheckDBContext legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-member-backups-2a;basis=body only, callers unchanged (the drill, wake/seed paths, hostbox restore, moves; root and carlos): the same open, busy_timeout, integrity_check and schema-count reads of the one path it is given. A result that proves damage (integrity_check not ok, no tables, or a query error whose SQLite code is SQLITE_CORRUPT or SQLITE_NOTADB) is now returned as checkError, which keeps the message and adds errors.Is(err, ErrCheckFailed); open and I/O errors are returned unmarked. Every caller still only tests err != nil except the drill, which reads the mark. No new read, path or source. file:Open@74,file:QueryRowContext@485,file:QueryRowContext@754 322eace1599686bf82e225b3db84da11ba893389e20533b2485dc6e803f54d9a |
| @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 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 |
| @@ -16,7 +17,7 @@ |
| @legacy 691e5a20b5fafe71d81d0aa2d6ee809955eaae462ebbd607caecb949affdbf18 internal/lease/check.go recordedRead.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (carlos ops hibernate-verify, user carlos, never root: hibernateRun.run refuses euid 0 first): wraps the io.ReadCloser of an LTX object the pinned verify restore opens from the hibernate bucket (VerifyReplicaAt with a non-zero txid, which only the drill passes) and passes Read straight through, noting a non-EOF error so a failed restore carries the storage's own error (ltx v0.5.1 drops it). Reads replica bytes litestream was already reading; no new source, path or credential. file:Read@24,file:Read@65 1dd2403779fe5112ab9649591ed4242f58b7cf5ed5b560b309215621183d1f52 |
| @legacy 43ff4f62d39b616ba42c1ca4b5bf0e4ea0118701139177723c609ac4c7f2372d 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. Final fix wave: the same single boxself.ReadFile read; the parsed reading no longer counts a host whose latest verdict is unverified/no_record as behind (coverage). No new read. file:ReadFile@226 9a6222ff11e17f7685efe9eb8243d6237855d70214148b205d539ca49e52927b |
| @legacy 422fac78226291f58fe3811d195a144a55b9e785f5a4ac52cdd4e66276516f90 internal/ops/ops.go hibernateRun.clearCrashedScratch legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos, after the root refusal): os.ReadDir of its own TmpDir (the unit's %C/carlos-verify, from TMPDIR), and os.RemoveAll of each entry that is a real directory (DirEntry type, a symlink is skipped) named carlos-hibernate-verify* and older than two hours: a killed run's restored databases. No pattern expanded, nothing outside TmpDir, and nothing it reads becomes a path, command or query beyond that removal. file:ReadDir@60 5db2acd93b97eba20824ebfce9991321047abc74554f289cfc2a888647005c35 |
| -@legacy 5fecc2b791f3b364f2d109151558d7cdbd06fb2ecca4cec158e7b3ba04c8a9e6 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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir before MkdirTemp, and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. file:Open@1903 5c03e0f4e9f4bc38e5044873038bf02094015187d23381d787ac94cbd1b22c28 |
| +@legacy 40e16e4afbfa088b6069933a5482860a1bc917d60d3c64a1f07b512f6e967efa 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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir right after the root refusal and the hibernate-config check, before the self record and both empty-fleet returns (re-review item 9), and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. file:Open@2161 5045aaad2befa1652a7f95f8066316927de43bafb5d8317fb8208f648eda4dec |
| @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 801ff0f59fc42fcd037278505b9ccbc54162323378475cf6b9dcfe1f74d5892e 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. Final fix wave: also copies rt.HA and rt.IsSidecar() (Kind) into HibernatingRoute, so a group box drills non-HA rows itself and the bracket reads a sidecar's record from sidecars/<name>.json (provision.GetSidecarRecord, user carlos) instead of instances/. Same listed routes, no new source. registry:Account@756,registry:App@773,registry:Backing@397,registry:DBPath@626,registry:DBPath@707,registry:HA@808,registry:Host@691,registry:Stateless@588,whole:Route@190 2946973b286a84f81f801630eb536d7908c1f4ad02502fa9372b977fd5e9de27 |
| @@ -25,6 +26,7 @@ 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/lease/check.go CheckDBContext legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-member-backups-2a;basis=body only, callers unchanged (the drill, wake/seed paths, hostbox restore, moves; root and carlos): the same open, busy_timeout, integrity_check and schema-count reads of the one path it is given. A result that proves damage (integrity_check not ok, no tables, or a query error whose SQLite code is SQLITE_CORRUPT or SQLITE_NOTADB) is now returned as checkError, which keeps the message and adds errors.Is(err, ErrCheckFailed); open and I/O errors are returned unmarked. Every caller still only tests err != nil except the drill, which reads the mark. No new read, path or source. file:Open@74,file:QueryRowContext@485,file:QueryRowContext@754 322eace1599686bf82e225b3db84da11ba893389e20533b2485dc6e803f54d9a |
| 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, 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 |
| @@ -39,7 +41,7 @@ internal/hostbox/empty_census.go censusStageCheck legacy accepted-legacy accepte |
| internal/lease/check.go recordedRead.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (carlos ops hibernate-verify, user carlos, never root: hibernateRun.run refuses euid 0 first): wraps the io.ReadCloser of an LTX object the pinned verify restore opens from the hibernate bucket (VerifyReplicaAt with a non-zero txid, which only the drill passes) and passes Read straight through, noting a non-EOF error so a failed restore carries the storage's own error (ltx v0.5.1 drops it). Reads replica bytes litestream was already reading; no new source, path or credential. file:Read@24,file:Read@65 1dd2403779fe5112ab9649591ed4242f58b7cf5ed5b560b309215621183d1f52 |
| 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. Final fix wave: the same single boxself.ReadFile read; the parsed reading no longer counts a host whose latest verdict is unverified/no_record as behind (coverage). No new read. file:ReadFile@226 9a6222ff11e17f7685efe9eb8243d6237855d70214148b205d539ca49e52927b |
| internal/ops/ops.go hibernateRun.clearCrashedScratch legacy accepted-legacy accepted-legacy;rev3=census-ruling-member-backups-2a;basis=new, the drill only (user carlos, after the root refusal): os.ReadDir of its own TmpDir (the unit's %C/carlos-verify, from TMPDIR), and os.RemoveAll of each entry that is a real directory (DirEntry type, a symlink is skipped) named carlos-hibernate-verify* and older than two hours: a killed run's restored databases. No pattern expanded, nothing outside TmpDir, and nothing it reads becomes a path, command or query beyond that removal. file:ReadDir@60 5db2acd93b97eba20824ebfce9991321047abc74554f289cfc2a888647005c35 |
| -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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir before MkdirTemp, and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. file:Open@1903 5c03e0f4e9f4bc38e5044873038bf02094015187d23381d787ac94cbd1b22c28 |
| +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. Final fix wave (still refusing root first): the self.json read is retried every 15 s for up to 5 minutes (SelfWait, the same boxself.ReadFresh), a fleet box's CARLOS_REGION fleet/<name> is accepted beside dbreads.ValidRegion, it calls clearCrashedScratch on its own TmpDir right after the root refusal and the hibernate-config check, before the self record and both empty-fleet returns (re-review item 9), and its publisher now writes through dbverify.PublishOver (the same Get-then-CAS Put of control/verify/<ref>.json, also parsing the record it reads to drop hosts a landing removed). No new read source. file:Open@2161 5045aaad2befa1652a7f95f8066316927de43bafb5d8317fb8208f648eda4dec |
| 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. Final fix wave: also copies rt.HA and rt.IsSidecar() (Kind) into HibernatingRoute, so a group box drills non-HA rows itself and the bracket reads a sidecar's record from sidecars/<name>.json (provision.GetSidecarRecord, user carlos) instead of instances/. Same listed routes, no new source. registry:Account@756,registry:App@773,registry:Backing@397,registry:DBPath@626,registry:DBPath@707,registry:HA@808,registry:Host@691,registry:Stateless@588,whole:Route@190 2946973b286a84f81f801630eb536d7908c1f4ad02502fa9372b977fd5e9de27 |
| @@ -58,9 +60,9 @@ internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve- |
| @coverage internal/host/units ab54aada854d7f1b799c390fd14438961fc3271c611adaf620929faa72e99505 |
| @coverage internal/hostbox 7b06ed9912b0a8bb9ddb0590dfe5d28f3a758947e39383fd45114dc73ae3af25 |
| @coverage internal/hostops 19db0dd625c5fce18062fed5af958c1714f10c9be489869530f86581ad036436 |
| -@coverage internal/lease 48e3aee6597b7d3c34f845e9384ab1e8fc1b1c793a4778a1da0bc77790187d8e |
| +@coverage internal/lease 31b1ffb2314a5293d30666000be97cd1cc214d4d9bb80bbee4d891be200e31cc |
| @coverage internal/metrics 56236d8756fbfd8263f66628d91b30a2a89a4163662334e4012af2101f5af11b |
| @coverage internal/moves 3895687f7e68200bad063865c140aaf2d54450a50f4685e59753cae98ae6f17a |
| -@coverage internal/ops 19bfa81d71ffbc0a344329e427289f7ae3490b0601cedce5782ca998fa3bb4f3 |
| +@coverage internal/ops c056e3fbb110ef6fcd4ae038eddc9e80d073e73fa3eac102bf8e261b7ad11e1c |
| @coverage internal/release 2d4d91685208d75b4d971c6d9855d7c918d6ad5e85eb9380e300ac57c8049a1a |
| @coverage internal/safefile b91f35e83de69d9227930559950fdb086a020d72ca6ec55d50d596fb7a0b3556 |