provision: root-read census proposal for fleet alerts plan 1
make census-propose NAME=fleet-alerts-1 over the whole branch: two body units (statusLoop passes the euid and the disk forecast into the probes; CollectBox copies DiskFullETAHours), one new unit (engineBeatLstat, the non-root agent's Lstat of CARLOS_ALERT_ENGINE_BEAT, refused for euid 0 before any lookup), and the envelopes of ., internal/alerting, internal/host, internal/metrics and internal/status re-pinned (internal/alerting/ruletext.go is strings only). Seal 1379d066 -> 31a5199b. TestPlan14RootReadCensus passes. Approval is the reviewer's, on #280, at the whole-branch review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+46
−0
docs/superpowers/notes/census-fleet-alerts-1-claims.md+6 −0docs/superpowers/notes/census-proposal-fleet-alerts-1.md+25 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-fleet-alerts-1.tsv+14 −0
CI passed — run details
Intent
Attributed to this commit: 25.8 g CO₂e (3,230,743 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-fleet-alerts, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/notes/census-fleet-alerts-1-claims.md b/docs/superpowers/notes/census-fleet-alerts-1-claims.md| new file mode 100644 |
| index 000000000..8859a474e |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-fleet-alerts-1-claims.md |
| @@ -0,0 +1,6 @@ |
| +# CLAIMS for the root-read census, branch design-fleet-alerts (fleet alerts plan 1, Tasks 1-10). |
| +# Format (AGENTS.md "The census"): <file>:<unit><TAB><what changed>. Lines starting with # are ignored. |
| +# Envelopes re-pinned without a unit row: internal/alerting (alerting.go: Slack body, IsSlackWebhook, no redirects, URL-free webhook errors; ruletext.go: rule display strings only, no code path), internal/metrics (forecast.go: pure DiskTrend; alert.go: disk_eta and engine_silent rules, CARLOS_ALERT_DISK_ETA_HOURS), internal/host (disktrend.go ring, enginebeat.go, alertsink.go incident-only box sinks, probes.go readDiskBytes statfs, metrics_loop.go), internal/status (snapshot.go fields), . (cli.go engine-beat word). |
| +internal/host/agent.go:statusLoop the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added |
| +internal/status/snapshot.go:CollectBox copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added |
| +internal/host/enginebeat.go:var engineBeatLstat new: Lstat of the CARLOS_ALERT_ENGINE_BEAT path (the console's beat file, alert-engine.beat beside console.db), reached only when euid != 0: engineBeatArmed refuses root before any lookup, newEngineBeatWatch returns nil and the nil watch never calls it (TestEngineBeatRootRefusedBeforeLookup: zero stat calls as euid 0); a relative path is refused too; Lstat, so a symlink is never followed (beatNotRegular); only the mtime and file type are used, nothing is opened or read |
diff --git a/docs/superpowers/notes/census-proposal-fleet-alerts-1.md b/docs/superpowers/notes/census-proposal-fleet-alerts-1.md| new file mode 100644 |
| index 000000000..27147e6fa |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-fleet-alerts-1.md |
| @@ -0,0 +1,25 @@ |
| +# Census approval: fleet-alerts-1 |
| + |
| +Ruling `census-ruling-fleet-alerts-1`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/host/agent.go` `statusLoop` | body | unchanged (6) | the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added | |
| +| `internal/status/snapshot.go` `CollectBox` | body | unchanged (28) | copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added | |
| + |
| +Envelopes re-pinned: `.`, `internal/alerting`, `internal/host`, `internal/metrics`, `internal/status`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/host/agent.go` `statusLoop`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved. |
| +- `internal/status/snapshot.go` `CollectBox`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/host/enginebeat.go:var engineBeatLstat`: reads +file:Lstat; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7` → `31a5199b15666cd6396f83577dc545c88cc1198138bdae4545d81270815829d3`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-fleet-alerts-1.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 1ab671e64..4d27a9154 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -43,3 +43,4 @@ plan14-root-reads-region-ha-dead-holder-backoff.tsv 8f6a1865b0abcea9d4fb68232cc2 |
| plan14-root-reads-managed-fleets-1c-451.tsv af326671321edda76c7e6217a47892605a9e3b886fa880ad6d049c2f28f63873 |
| plan14-root-reads-fleet-public-routes.tsv bca6ef741a96b72767b1747789cd01b3111d61b68548cbe368258c31f3d53a2e |
| plan14-root-reads-fleet-routes-followups.tsv 1379d066c8dd2335d95d5f6e9c7bce65ff57f00b2b287a308d9b3f47911ae5e7 |
| +plan14-root-reads-fleet-alerts-1.tsv 31a5199b15666cd6396f83577dc545c88cc1198138bdae4545d81270815829d3 |
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-alerts-1.tsv b/internal/provision/testdata/plan14-root-reads-fleet-alerts-1.tsv| new file mode 100644 |
| index 000000000..d60d6aa71 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-fleet-alerts-1.tsv |
| @@ -0,0 +1,14 @@ |
| +# Census overlay fleet-alerts-1, written by census-propose (#369). census-ruling-fleet-alerts-1, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fleet-alerts-1.md. |
| +# 2 body, 0 sites, 5 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@legacy 440dbec8d7cbfb155e7f93a5c076d3cadf12bacbcf39ebd02ca119640f4f896b internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added whole:Route@11699,whole:Route@11980,whole:Route@6404,whole:Route@6431,whole:Route@7739,whole:Route@9885 e122599c7ec0566cbc3414609916c8a0b7c9f608f7c8c124b98df2e1ecc14d46 |
| +@legacy 983e5968ca5a7592d8217a69bed312dbe1b07fae660195333b497856f08a0823 internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 491390f8bccdd92999bd99c789d8c5be87c9c71ab3ce67a6946f559d6e6d5ef7 |
| +@legacy d7ab5887450972a048d0ac70a52f0135cc94cb9f20061ed90c2705981fa79713 internal/host/enginebeat.go var engineBeatLstat legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-alerts-1;basis=new: Lstat of the CARLOS_ALERT_ENGINE_BEAT path (the console's beat file, alert-engine.beat beside console.db), reached only when euid != 0: engineBeatArmed refuses root before any lookup, newEngineBeatWatch returns nil and the nil watch never calls it (TestEngineBeatRootRefusedBeforeLookup: zero stat calls as euid 0); a relative path is refused too; Lstat, so a symlink is never followed (beatNotRegular); only the mtime and file type are used, nothing is opened or read file:Lstat@22 216d7385e187661a2f65a10d5765294ec0746268de3824c3d857d71267f3858c |
| +internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added whole:Route@11699,whole:Route@11980,whole:Route@6404,whole:Route@6431,whole:Route@7739,whole:Route@9885 e122599c7ec0566cbc3414609916c8a0b7c9f608f7c8c124b98df2e1ecc14d46 |
| +internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 491390f8bccdd92999bd99c789d8c5be87c9c71ab3ce67a6946f559d6e6d5ef7 |
| +internal/host/enginebeat.go var engineBeatLstat legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-alerts-1;basis=new: Lstat of the CARLOS_ALERT_ENGINE_BEAT path (the console's beat file, alert-engine.beat beside console.db), reached only when euid != 0: engineBeatArmed refuses root before any lookup, newEngineBeatWatch returns nil and the nil watch never calls it (TestEngineBeatRootRefusedBeforeLookup: zero stat calls as euid 0); a relative path is refused too; Lstat, so a symlink is never followed (beatNotRegular); only the mtime and file type are used, nothing is opened or read file:Lstat@22 216d7385e187661a2f65a10d5765294ec0746268de3824c3d857d71267f3858c |
| +@coverage . 742501aa860c35d339a70256eb690afe8f8b93d216335b631d796c6a67f5a081 |
| +@coverage internal/alerting b79d484c1a6fd6ca3303a19c5e6de85b04287db76311ff398ab35cccf2444fb1 |
| +@coverage internal/host 2bf3ebb0a7c0054525603d420b633f5632ba5a28302bea83cada157efd78cfce |
| +@coverage internal/metrics 5d62e95689b0488af1af501bd5bccad8a7f892c3eb25756c3bdae0eac69cc595 |
| +@coverage internal/status 2b55e5e071d65606597751d4edd90bf0da66242d6b47fb5c1d630186ee36b62c |