carlos / platform Public

docs: fleet alerts fix round 1 (SNS scope, engine-beat in cli.md, roll-note safety)

README: the SNS bullet now names disk and engine_silent; the monitoring
lists use colons, not em dashes; the beat is rewritten after every pass
that commits; disk and engine_silent reach people twice while the
console is up; ragged wraps fixed. cli.md documents the engine-beat
suffix of carlos status --live. Roll notes: host.env appends cannot fuse
lines; per-deployment account, region and profile for the engine-beat
step; other console deployments out of scope; the witness's real
worst-case disk margin and a no-clear-by-T1+2h20m stop rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev dd7ca3f705bd81e82db27ab51378b683e94e058b parent 75ea37d
3 files changed, +104 −51
  • README.md +45 −40
  • docs/site/cli.md +7 −0
  • docs/superpowers/notes/roll-fleet-alerts-1.md +52 −11

Intent

Human

<task-notification> <task-id>a15e82fbd5ac1a4a0</task-id> <tool-use-id>toolu_01345kbcSRL2kfEnckEFrhs5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6112a34e-476e-4b5e-8e07-f93a46fc6d50/tasks/a15e82fbd5ac1a4a0.output</output-file> <status>completed</status> <summary>Agent "Implement Task 11: docs, roll notes, census" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>- **Status:** DONE_WITH_CONCERNS - **Commits:** - `8c32f72e` docs: fleet alerts README and roll notes - `75ea37d2` provision: root-read census proposal for fleet alerts plan 1 - **Tests:** - `TestPlan14RootReadCensus` passes after the proposal (run by name). - Also passing: `TestCensusScopeIsTheRootBinary`, `TestPlan14J4DeclaredMatchesTheCensus`, `TestPlan14RootInputInventoryCoverage`, `TestCensusRebaseCarriesDispositions`. - RED is the pre-proposal `make census-card`: 3 units and 5 envelopes left open. I did not run the failing test itself. - **Census:** two body units (`statusLoop`, `CollectBox`), new unit `engineBeatLstat`, and 5 envelopes re-pinned. The refreshed card matched the committed one byte for byte. The tool refuses envelope claims, so the note that `ruletext.go` is strings only is a comment in the CLAIMS file and the commit body. Approval stays open for the reviewer on #280. - **Concerns:** 1. The README and roll-notes prose has not had a copy review. 2. `docs/site/cli.md` (around line 2455) does not mention the new `engine-beat=` suffix in `carlos status --live`. 3. The engine-beat step needs the `carlos` user to be able to stat `/data/console`. The roll notes check that first and say to set the variable only after the console rolls, because setting it earlier makes flagship page through SNS after 10 minutes. 4. The witness is proposed on dennis-stenciling. Its 4 h 5 min timing holds only because the env change restarts the agent, which empties its disk-reading history. - **Report:** `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-fleet-alerts/.superpowers/sdd/2026-10-30-fleet-alerts-1-engine-connectors/task-11-report.md`</result> <usage><subagent_tokens>202959</subagent_tokens><tool_uses>82</tool_uses><duration_ms>1049077</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>aa6c65bd6d9ea5860</task-id> <tool-use-id>toolu_01YMs9S2vgmsAK1vQu7BxjEX</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6112a34e-476e-4b5e-8e07-f93a46fc6d50/tasks/aa6c65bd6d9ea5860.output</output-file> <status>completed</status> <summary>Agent "Review Task 11 (docs, census)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Spec Compliance - ✅ Spec compliant. Every item in the brief is present: - README items: `/fleet/alerts`, connector kinds and their confirmations, both env vars, incident-only box sinks, Slack in `CARLOS_ALERT_WEBHOOK`, the seal key and replica-only restores, and at-least-once delivery. - Roll notes: dev first, the `host.env` step, the witness written as a proposal, and the quick Slack check. - Census: the claims file and the overlay. - Step 3 (commit) is done. Step 5 (push and CI) is left to the controller, as the report says. - ⚠️ Cannot verify from the diff: - Both box instance IDs, the dev and flagship account and region, and the profile names match what the repo and my memory notes record. I could not check the live boxes. - The claim that dennis's ordinary disk growth gives a forecast above 108 h, so the witness clears on its own. - Whether `/data/console` is searchable by user `carlos` on the live console boxes. The notes gate this correctly with a pre-check. - Whether the census overlay still seals after any later fix-wave edit to files in `.`, `internal/alerting`, `internal/host`, `internal/metrics` or `internal/status`. `census-propose` has to be rerun with the same NAME after such an edit. ### Strengths - Nearly every README fact checks out against the code: - Rule levels match `alertRuleLevels` (`alertsignals.go:425`). - Defaults match `metrics/alert.go`: disk 90, mem 90, cpu 95, lag 900, ETA 72 h with a 2 h hold, clear at 1.5x or on no growth. - Theil–Sen needs 2 h and 30 points, over a 6 h ring (`forecast.go:34-39`, `disktrend.go:11`). - The beat and `engine_silent` description matches `enginebeat.go`: - 10 min stale and 10 min grace. - `Lstat`, with symlinks, directories and future times counting as no beat. - Root and relative paths are refused before any lookup. - `alertDeliveryProbe` only calls `engineBeatArmed`, so the heartbeat makes no file access. - Box sinks carry `disk` and `engine_silent` only (`disktrend.go:103`). - The noise numbers match `alertengine.go:74-84`: 5 min delay, 30 min quiet, 1 h update, 24 h reminder, 3 fires in 1 h for flapping. - Retry runs from 1 min to a 12 h cap, with suspension at 24 h. - Confirm links last 7 days and snooze links 30 days. - The webhook fields and the signature format match `renderWebhook` and `alertsign.go`. - The seal key path comes from `cmd/console/main.go:478`. - The beat is written only after a committed step (`alertengine_pass.go:146`). - Seed once, revoke and re-grant, and the 24 h "no further reports" horizon match R-24, R-25 and R-26. - Roll safety: - Dev comes first, and boxes roll before their console. - Setting `CARLOS_ALERT_ENGINE_BEAT` is explicitly after the console roll and the beat file existing, so flagship cannot page through SNS early. Both the reason and a stat pre-check are given. - The witness states the account, region, box, every change, traffic, cost, duration, abort, cleanup and verification. That fits the AGENTS.md production rule (line 119). - The timing derivation is honest (restart empties the ring, about 92% of pairs positive). - The 5 GiB free and under 80% pre-checks keep the 2 GiB cap below the `disk` rule's 90%. The worst case is a 25 GiB disk at 88%. - Cleanup is `sed` plus `diff`, not a copy-back. - The store request budget is stated. - The census claims match the code: - `agent.go:4350` and `:4370` match the `statusLoop` claim. - `snapshot.go:1156-1178` match the `CollectBox` claim. - `enginebeat.go:22` and `TestEngineBeatRootRefusedBeforeLookup` match the `engineBeatLstat` claim. - The census steps follow AGENTS.md: the CLAIMS format, `census-propose`, a new unit written `legacy accepted-legacy frozen`, and the card plus chain line. - Dash check: the roll notes and census files contain no em or en dashes, and the new README prose has none. ### Issues #### Critical (Must Fix) None. #### Important (Should Fix) 1. **Stale SNS bullet.** `README.md` (diff lines 59-71, `CARLOS_ALERT_SNS_TOPIC_ARN`) still says the agent "publishes each fire and clear to this SNS topic" and that "anyone subscribed to that topic gets the email". - After this plan, only `disk` and `engine_silent` go there. The new paragraph "Which rules a box sends itself" and the rewritten webhook bullet say so. - The SNS bullet is the flagship channel, so it now contradicts the paragraph above it. The roll notes say the SNS warnings stop. - Fix: change it to "each `disk` and `engine_silent` fire and clear", and drop or qualify "anyone subscribed gets the email". #### Minor (Nice to Have) 1. `README.md` (diff line 33): the rewritten `alerts/boxes` bullet keeps the em dash (`` `alerts/boxes/&lt;box&gt;.json` — on-box ``). It is carried-over text on a line this diff edited, so it falls under the no-dash rule. The new `**Config surface**` bullets use colons, which clashes with the neighbouring dash bullets. 2. `README.md` (the `CARLOS_ALERT_ENGINE_BEAT` bullet): it says the console rewrites the beat "after every pass". The code writes it only after a pass whose step committed (`alertengine_pass.go:146`). The roll notes say this correctly, and it is the point of the backstop, so the README should say "every pass that commits". 3. `README.md`, "Which rules a box sends itself": a reader will not learn that `disk` and `engine_silent` reach people twice while the console is up (box sink plus engine). Add one clause. 4. `README.md` (diff lines 209-216): two ragged wraps ("message. An" / "incident that fires...", and "the incident is 30" / "minutes old"). 5. Roll notes, `&gt;&gt; /etc/carlos/host.env` appends (engine-beat step and witness start): the commands run as written and have precedent in the ZDD notes. If `host.env` lacks a trailing newline, though, the new line fuses onto the last variable. On flagship that silently corrupts a real value before the restart. Use `printf '\n%s\n'`, or check `tail -c1` first. 6. Roll notes, witness clear: the notes say the clear comes when the forecast passes 108 h "which a box with ordinary log growth does". If dennis's ETA lands between 0 and 108 h, `disk_eta` stays open. There is no instruction for that case, such as "if no clear by T1+2h20m, report; do not edit state". Also, "well away from 90%" overstates the worst case (88% at 25 GiB). 7. Roll notes, scope: - The engine-beat step has no account, region or profile line for its own go. Flagship's `keymail` profile and region appear only in the order list. - The notes cover only dev and flagship. The Tito and titogo console, which the repo lists as separate with its own console box, will start the engine and seed operator connectors the moment it takes this release. Either say it is out of scope or add it. 8. Census: the envelope justifications live only in a `#` comment line in the claims file, because the tool refuses envelope claims. They do not reach the card the reviewer reads, so the report's note that they are also in the commit body matters. Make sure the #280 brief repeats them. ### Assessment **Task quality:** Approved (with the one Important doc fix) **Reasoning:** The README, roll notes and census are accurate and safe in the areas the named risks cover: Theil–Sen, `engine_silent` refused for root, connectors and their confirmations, seed once, the 24 h horizon, Slack in the webhook, the seal key and restores, at-least-once delivery, the snooze page, dev-first ordering, the beat sequencing, and the witness scope. One bullet was left stale from the original text (the SNS description), and the rest are polish items.</result> <usage><subagent_tokens>148238</subagent_tokens><tool_uses>38</tool_uses><duration_ms>336075</duration_ms></usage> </task-notification>

diff --git a/README.md b/README.md
index 54149d8b3..44aeabcaa 100644
--- a/README.md
+++ b/README.md
@@ -912,11 +912,11 @@ for the full design.
**Bucket layout:**
-- `metrics/boxes/<box>/raw/<YYYY-MM-DD-HH>.json` — 60-second host + per-unit
+- `metrics/boxes/<box>/raw/<YYYY-MM-DD-HH>.json`: 60-second host + per-unit
samples, one object per UTC hour, retained 48 hours.
-- `metrics/boxes/<box>/days/<YYYY-MM-DD>.json` — hourly min/avg/max rollups,
+- `metrics/boxes/<box>/days/<YYYY-MM-DD>.json`: hourly min/avg/max rollups,
kept forever (the capacity/trend history).
-- `alerts/boxes/<box>.json` — on-box alert state (fire/clear, hysteresis),
+- `alerts/boxes/<box>.json`: on-box alert state (fire/clear, hysteresis),
written only when a rule changes. The console's alert engine reads it
every minute (see [Fleet alerts](#fleet-alerts)).
@@ -928,9 +928,11 @@ CPU, mail relay lag and the location database among them, still goes into
`alerts/boxes/<box>.json` with every fire and clear, and reaches people
through the console's alert engine, grouped and with its noise rules. So the
box's sinks are the backstop for when the console is down, not the main
-channel.
+channel. `disk` and `engine_silent` go into the alert object too, so while
+the console is up they reach people twice: at once from the box's sinks,
+and again through the engine.
-**Config surface** — read by the box agent from `/etc/carlos/host.env`:
+**Config surface**, read by the box agent from `/etc/carlos/host.env`:
- `CARLOS_ALERT_WEBHOOK`: optional. The agent POSTs here when `disk` or
`engine_silent` fires or clears. A Slack incoming-webhook URL (https on
@@ -939,25 +941,27 @@ channel.
pointing a box at a Slack channel is this one line. Any other URL gets the
alert event as JSON. Redirects are not followed. Unset skips the webhook
channel.
-- `CARLOS_ALERT_SNS_TOPIC_ARN` — optional; the agent publishes each fire and
- clear to this SNS topic as a plain-text email-sized message, signed with
- the box's instance role (which needs `sns:Publish` on the topic). The
- region is read from the ARN, not from `AWS_REGION`. Set it to the box's
- own region's alerts topic and anyone subscribed to that topic gets the
- email. Either sink works alone and both may be set. A failed send is
- logged and counted, never fatal. The SDK tries a retryable failure up to
- three times within ten seconds. After that, a later tick does not send
- that alert again, unless the same tick's bucket write also failed, which
- repeats the whole transition on the next tick. A value that is not an SNS
- topic ARN (a subscription ARN, for example) is logged and the sink stays
- off. So does a client that cannot be built, which `carlos status --live`
- shows as `alerts=sns-unavailable`.
+- `CARLOS_ALERT_SNS_TOPIC_ARN`: optional. The agent publishes each `disk`
+ and `engine_silent` fire and clear to this SNS topic as a plain-text
+ email-sized message, signed with the box's instance role (which needs
+ `sns:Publish` on the topic). The region is read from the ARN, not from
+ `AWS_REGION`. Set it to the box's own region's alerts topic and anyone
+ subscribed to that topic gets those two rules by email; every other rule
+ reaches people through the console's alert engine instead. Either sink
+ works alone and both may be set. A failed send is logged and counted,
+ never fatal. The SDK tries a retryable failure up to three times within
+ ten seconds. After that, a later tick does not send that alert again,
+ unless the same tick's bucket write also failed, which repeats the whole
+ transition on the next tick. A value that is not an SNS topic ARN (a
+ subscription ARN, for example) is logged and the sink stays off. So does a
+ client that cannot be built, which `carlos status --live` shows as
+ `alerts=sns-unavailable`.
- With neither sink set, the box says so: the agent logs `NO SINK
CONFIGURED` at start, and the box's private status snapshot carries
`metrics.alerts` with both sinks false, which `carlos status --live` prints
as `alerts=not-delivered`. The console's alert engine raises the
`alert_delivery_broken` warning for such a box.
-- `CARLOS_ALERT_DISK_PCT` / `CARLOS_ALERT_MEM_PCT` / `CARLOS_ALERT_CPU_PCT` —
+- `CARLOS_ALERT_DISK_PCT` / `CARLOS_ALERT_MEM_PCT` / `CARLOS_ALERT_CPU_PCT`:
optional threshold overrides for the built-in disk / memory / host-CPU
rules, as percent integers 0-100 (e.g. `95`). Anything else is ignored
with a log line, and that rule keeps its built-in default.
@@ -974,27 +978,28 @@ channel.
carries the forecast as `disk_full_eta_hours`. The variable is read when
the agent starts.
- `CARLOS_ALERT_ENGINE_BEAT`: set it only on the box that runs the console,
- to the beat file the console's alert engine rewrites after every pass:
- `alert-engine.beat` beside console.db, so `/data/console/alert-engine.beat`
- by default. When that file is more than 10 minutes old, or has not
- appeared within 10 minutes of the agent starting, the agent fires
- `engine_silent` through its own sinks. That is the one alert that still
- reaches someone when the console has stopped. The agent checks the file
- with lstat and never follows a symlink; a symlink, a directory or a time
- in the future counts as no beat. An agent running as root does not check
- it at all, because the file is the console's to write, and `carlos status
- --live` says `engine-beat=off (agent runs as root, so the backstop is
- off)`. A watching agent shows `engine-beat=on`. A relative path is refused
- the same way. Unset (every box but the console's) shows nothing.
+ to the beat file the console's alert engine rewrites after every pass
+ that commits: `alert-engine.beat` beside console.db, so
+ `/data/console/alert-engine.beat` by default. When that file is more than
+ 10 minutes old, or has not appeared within 10 minutes of the agent
+ starting, the agent fires `engine_silent` through its own sinks. That is
+ the one alert that still reaches someone when the console has stopped.
+ The agent checks the file with lstat and never follows a symlink; a
+ symlink, a directory or a time in the future counts as no beat. An agent
+ running as root does not check it at all, because the file is the
+ console's to write, and `carlos status --live` says `engine-beat=off
+ (agent runs as root, so the backstop is off)`. A watching agent shows
+ `engine-beat=on`. A relative path is refused the same way. Unset (every
+ box but the console's) shows nothing.
**Console surfaces:**
-- `GET /fleet/metrics` — operator-only dashboard: per-box needles and
+- `GET /fleet/metrics`: operator-only dashboard, with per-box needles and
48-hour sparklines, a per-box per-unit table (ordered by CPU, busiest
first), and active alerts at the top.
- `GET /fleet/alerts` and `/fleet/alerts/history`: operator-only, where
fleet alerts go and what has fired (see [Fleet alerts](#fleet-alerts)).
-- A "Resources" section on each app's own page — owner-facing, scoped to
+- A "Resources" section on each app's own page: owner-facing, scoped to
that app's own instances only (current CPU and memory plus 48-hour
sparklines); never host-level totals or other tenants' units.
@@ -1090,11 +1095,11 @@ week, for that rule on that box, service or host). The noise rules:
- The first message waits until the incident is 5 minutes old and lists
everything affected so far, so one rule firing on several boxes is one
- message. An
- incident that fires and clears inside those 5 minutes sends nothing.
+ message. An incident that fires and clears inside those 5 minutes sends
+ nothing.
- A box (or service, or host) joining an open incident sends nothing until
- the incident is 30
- minutes old, then at most one "now also" message an hour.
+ the incident is 30 minutes old, then at most one "now also" message an
+ hour.
- Nothing repeats while a condition holds, except one reminder a day for an
incident open over 24 hours. A clear sends one message.
- A rule that fires 3 times in an hour on one box becomes one open incident
@@ -1110,9 +1115,9 @@ nothing. Snooze links last 30 days.
**Webhook body.** JSON with `"v":1`: `delivery_id`, `scope`, `rule`,
`level`, `kind` (fire, clear, update, reminder or verify), `subject`,
`members`, `what`, `how_long`, `what_to_do`, `at`, `incident_url` and
-`snooze_url`. Each request carries `Carlos-Signature: t=<unix
-seconds>,ed25519=<base64>`, an Ed25519 signature over `carlos-alert`, a
-newline, `t`, a newline and the body. The label means a mail event can never
+`snooze_url`. Each request carries the header
+`Carlos-Signature: t=<unix seconds>,ed25519=<base64>`, an Ed25519 signature
+over `carlos-alert`, a newline, `t`, a newline and the body. The label means a mail event can never
pass as an alert. The public key is on `/fleet/alerts` and served as bare
base64 text at `GET /alerts/signing-key`, so receivers outside CARLOS can
check it.
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 7554e1071..4399a7e76 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -2457,6 +2457,13 @@ sink configured. `alerts=sns-unavailable` means a topic is set but the box
could not build its SNS client, so nothing is delivered through it. A dash
means the box runs an older binary and did not say.
+On the box that runs the console, with `CARLOS_ALERT_ENGINE_BEAT` set in its
+`host.env`, the column goes on: ` engine-beat=on` when the agent is watching
+the console's alert engine, and ` engine-beat=off (...)` with the reason when
+it will not, for example
+`engine-beat=off (agent runs as root, so the backstop is off)`. Boxes without
+the setting show nothing more.
+
```sh
carlos status --live
```
diff --git a/docs/superpowers/notes/roll-fleet-alerts-1.md b/docs/superpowers/notes/roll-fleet-alerts-1.md
index 2030aa69f..505dea066 100644
--- a/docs/superpowers/notes/roll-fleet-alerts-1.md
+++ b/docs/superpowers/notes/roll-fleet-alerts-1.md
@@ -93,10 +93,19 @@ console.
## `CARLOS_ALERT_ENGINE_BEAT` on each console box
Set `CARLOS_ALERT_ENGINE_BEAT=/data/console/alert-engine.beat` in
-`/etc/carlos/host.env` on the box that runs the console (dev: sophie-knitting,
-i-05498eada6f0afd23; flagship: i-092c0c1eea75723cb), and restart the agent.
-If the console unit sets `CONSOLE_DB`, use `alert-engine.beat` in that
-directory instead.
+`/etc/carlos/host.env` on the box that runs the console, and restart the
+agent. If the console unit sets `CONSOLE_DB`, use `alert-engine.beat` in that
+directory instead. Each deployment is its own go:
+
+- **Dev.** Account 640012953448, region eu-west-1, profile `kass` (works
+ with the sandbox on). Box sophie-knitting (carlos-dev-ie),
+ i-05498eada6f0afd23, console platform.dev.carlosframework.com.
+- **Flagship.** Account 271376211898, region eu-west-1, profile `keymail`
+ (an assumed role: run it with the sandbox off). Box i-092c0c1eea75723cb,
+ console console.carloku.com.
+
+Both are reached as root over SSM. The change on each is one `host.env` line
+and one restart of `carlos-edge`; there is no AWS resource change.
Do it **after** the console has rolled and the beat file exists. An agent
watching a beat that never appears fires `engine_silent` through the box's
@@ -114,9 +123,15 @@ directory permissions need a decision first.
Then:
cp -p /etc/carlos/host.env /etc/carlos/host.env.bak-$(date +%Y%m%d)-enginebeat
- echo 'CARLOS_ALERT_ENGINE_BEAT=/data/console/alert-engine.beat' >> /etc/carlos/host.env
+ [ -z "$(tail -c1 /etc/carlos/host.env)" ] || printf '\n' >>/etc/carlos/host.env
+ printf '%s\n' 'CARLOS_ALERT_ENGINE_BEAT=/data/console/alert-engine.beat' >>/etc/carlos/host.env
+ tail -n 3 /etc/carlos/host.env
systemctl restart carlos-edge
+The `tail -c1` line adds a newline first if the file does not end in one, so
+the new line cannot fuse onto the last one. `tail -n 3` shows the result
+before the restart.
+
The restart is the same edge restart a platform roll makes. Check: `carlos
status --live` shows `engine-beat=on` for the console box, and no
`engine_silent` fires in the next 15 minutes. `engine-beat=off (agent runs
@@ -127,6 +142,17 @@ Optionally, after this, point a box's `CARLOS_ALERT_WEBHOOK` at a Slack
incoming webhook so `disk` and `engine_silent` reach Slack too. That is one
more `host.env` line and agent restart per box, and its own go.
+## Other console deployments
+
+Only dev and flagship are in scope for this roll. Any other deployment that
+runs a CARLOS console (Tito's, or anyone running their own) is not rolled
+here. When one takes this release, its console starts the alert engine on
+its first run (unless it runs with host claims), seeds an already-confirmed
+email connector for each of its operators, and starts sending them engine
+mail; its boxes' own sinks narrow to `disk` and `engine_silent` at the same
+time. Its operators set `CARLOS_ALERT_ENGINE_BEAT` themselves, by the steps
+above.
+
## Quick check: the Slack test message (dev)
Scope for the go: the dev console (platform.dev.carlosframework.com, dev
@@ -182,19 +208,26 @@ minute group window, and the clear.
**Before starting.** On dennis, as root:
- df -B1 --output=avail,pcent /data # need 5 GiB free or more, and use under 80%
+ df -B1 --output=size,avail,pcent /data # need 10 GiB free or more, and use under 80%
test -e /data/tmp && echo exists || echo absent # write this down
- grep -n '^CARLOS_ALERT_DISK_ETA_HOURS=' /etc/carlos/host.env # expect nothing
+ grep -n '^CARLOS_ALERT_DISK_ETA_HOURS=\|^CARLOS_ALERT_DISK_PCT=' /etc/carlos/host.env # expect nothing
systemctl is-active carlos-edge
-The 80% bound keeps the 2 GiB cap well away from the `disk` rule's 90%. If
-`CARLOS_ALERT_DISK_ETA_HOURS` is already set, stop and ask.
+The worst case the bounds allow: the file stops at just over 2 GiB (the
+cap is checked before each write, so one last 50 MiB write can pass it,
+2.05 GiB at most). 10 GiB free under 80% use means a volume of at least
+50 GiB, so the file adds at most 4.1 points: 84% at worst, 6 points under
+the `disk` rule's 90%. On a smaller margin the `disk` rule would fire and
+page through the box's own sinks, so do not start. If
+`CARLOS_ALERT_DISK_ETA_HOURS` is already set, or `CARLOS_ALERT_DISK_PCT`
+lowers the `disk` threshold, stop and ask.
**Start (T0).** On dennis, as root, in one go so the agent's restart and the
first write are within a minute of each other:
cp -p /etc/carlos/host.env /etc/carlos/host.env.bak-fleet-alerts-witness
- echo 'CARLOS_ALERT_DISK_ETA_HOURS=100000' >> /etc/carlos/host.env
+ [ -z "$(tail -c1 /etc/carlos/host.env)" ] || printf '\n' >>/etc/carlos/host.env
+ printf '%s\n' 'CARLOS_ALERT_DISK_ETA_HOURS=100000' >>/etc/carlos/host.env
mkdir -p /data/tmp
systemctl restart carlos-edge
systemd-run --unit=fleet-alerts-witness --on-active=1s --on-unit-active=10min \
@@ -230,7 +263,9 @@ journal, before changing anything.
Removing the one line, rather than copying the backup back, keeps any other
edit made to `host.env` in the meantime. If `diff` shows a difference, keep
-the backup and report it.
+the backup and report it. The one expected difference is a trailing newline
+the start step added, when the file had none; `diff` reports it as "No
+newline at end of file".
**Then expect a clear about 2 hours later** (T1+2h, Slack within 2 minutes
after). The restart empties the readings again, `disk_eta` stays firing
@@ -241,6 +276,12 @@ reads as a trend instead, the threshold is back at 72 hours and the clear
comes when the forecast passes 108 hours, which a box with ordinary log
growth does on that first verdict.
+If there is no clear by T1+2h20m, report it with what
+`alerts/boxes/dennis-stenciling.json`, `/fleet/alerts/history` and the
+"Alert checks" job show. Do not edit the box's alert state
+(`/data/monitor/alerts.json`), the bucket object or the console's tables to
+force a clear.
+
**Verification after cleanup.** `systemctl status fleet-alerts-witness.timer`
says the unit is not found; `/data/tmp/fleet-alerts-witness` does not exist;
`host.env` matches the "before" state; `carlos status --live` shows dennis