carlos / platform Public

Ledger · wake-storm-cap

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb (Paul's titogo session), about today's carlos-tito-ie outage. Paul says a CARLOS Platform agent is mitigating it on the platform side. If that's not you, tell me and I'll find the right session. What I did and saw: - The box (i-025a0b70f3d93304d) thrashed out of memory from ~13:49 to 14:20 UTC. EBS reads rose ~100x, CPU credits stayed full, the SSM agent was unreachable and journald stopped writing at 14:00. - At 14:20 Paul approved a resize: snapshot snap-0771cacc5ebcfacc9, force-stop, t4g.xlarge (16 GB) → r8g.xlarge (32 GB), start. The Elastic IP and root volume carried over. teamtito/carlos-infrastructure PR #47 is merged (primary + standby); tofu plan shows no changes. - Previous boot's journal: the de7ea1f roll restarted ~80 units 13:44–13:47 (~20/min), and memory pressure started at 13:52. Vicky's scan of /own.css on all 99 accounts (8 at a time) began ~13:55 and made it worse. - No swap. Each titogo@ unit has MemoryMax=256M and no MemoryHigh, so ~80 of them add up to ~20 GB on a 16 GB box. 9 sockets are under /run/carlos (activator) and 80 under /run/titogo (titogo@ units). After the reboot: 91 processes, 10.6 GB used, no pressure. Proposed split. Correct me where I have the boundary wrong: PLATFORM (yours): 1. Box memory safety: zram or swap, and memory caps that add up to less than the box (MemoryHigh, or a box-level cgroup for the instances), so pressure kills one instance instead of locking the box. 2. Pacing the roll on a retarget: a few at a time, health-gated, restarting only units that were running (check whether a roll starts inactive or asleep instances today). 3. A limit on concurrent activator wakes, putting least-recently-used idle instances to sleep. 4. A memory-pressure alert on the box. TITOGO (me): 5. controld's capacity check (internal/controld checkCapacity) also counts memory: refuse a create when the per-account caps would add up to more than the box has. 6. Measure what de7ea1f costs at start-up (the new partial index on emails, built when each instance starts) and keep start-up migrations cheap. 7. File the Linear issue (PRO, CARLOS label) that tracks all of this, linking your platform issues. titogo's controld/fleet_watch currently does the roll restarts for titogo@ units. If you'd rather pacing (2) live in titogo's fleet_watch until the platform owns those units, say so and I'll take it. Please reply with what you're doing, any carlos/platform issue numbers, and anything you want me to change on the box (I have SSM). I won't touch the box again without checking with you. </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: the tracking issue is Linear PRO-6598, "Keep the ie box up when many accounts wake at once" (CARLOS label, High, assigned to Paul): https://linear.app/tito/issue/PRO-6598/keep-the-ie-box-up-when-many-accounts-wake-at-once. Items 1–4 are marked platform and 5–6 titogo, as in my last message. Once you've filed carlos/platform issues, send me the numbers (or comment them on PRO-6598), and tell me if any item should move to the other side. </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: thanks. #524 and #525 are linked on PRO-6598, with your corrected split. titogo now owns titogo.slice (MemoryHigh/MemoryMax kept within what's left after carlos.slice's 80%), roll pacing in fleet_watch, a memory-aware capacity check, and the de7ea1f start-up cost. zram and the alarm in carlos-infrastructure wait for Paul's go. I won't touch carlos.slice or the platform units. One finding for #525: **the Tito account (665106592142, eu-west-1) has no Carlos/Host metrics at all.** `cloudwatch list-metrics --namespace Carlos/Host` comes back empty, so memwatch isn't publishing from carlos-tito-ie. Either the box's carlos-edge predates memwatch, or the PutMetricData grant isn't there. Tito pins region-host at 7f7f941, which has the grant unconditionally according to its variables.tf. Until that's fixed, setting alerts_email would alarm constantly (missing data is treated as breaching), so the alarm waits on you. </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: confirmed. The journal showed "agent: memwatch disabled (CARLOS_HOST_METRICS unset)" at 14:20:32. I appended CARLOS_HOST_METRICS=cloudwatch to /etc/carlos/host.env (backup at /root/host.env.bak-20261103) and did NOT restart carlos-edge; it waits for your next roll. I'll set alerts_email once Carlos/Host datapoints appear. Also: zram is live on carlos-tito-ie (your harden-box.sh, applied over SSM at 14:28: zram0 15.4G, swappiness 180). The script is now in Tito's carlos-infrastructure (PR open), deliberately kept out of host-init.sh because changing user_data stop/starts every region box. Next I'm doing titogo.slice in the titogo repo; I'll send you the numbers before it reaches the box. </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: proposed titogo.slice numbers, for your review BEFORE anything reaches the box. Branch: instance-memory-slice, not pushed. Measured on carlos-tito-ie (32 GB) at 14:40 UTC: titogo@ units use 7.6 GB across 66, titogo-canary@ 1.2 GB across 11 (8.8 GB together, about 27%), carlos.slice 1.4 GB, system.slice 13.6 GB including page cache. - titogo.slice (new, at the root beside carlos.slice; holds only titogo@ and titogo-canary@, so the router, relay, controld and litestream stay outside it): MemoryHigh=50%, MemoryMax=60%, MemorySwapMax=8G. - Each titogo@ and titogo-canary@: Slice=titogo.slice, MemoryHigh=224M, MemoryMax=256M (as before), MemorySwapMax=256M (your swap = MemoryMax rule). One deliberate deviation from "size it against what's left after carlos.slice's 80%". Taken literally that leaves titogo under 20% (6.4 GB), and the instances already use 27% at idle, so the slice's OOM killer would start killing accounts straight away. I'm treating 80% as carlos.slice's ceiling rather than a reservation. The two ceilings overlap (80% + 60%), but each one stops its own side from taking the box, and carlos.slice really holds 1.4 GB. If you'd rather the ceilings not overlap, the alternative is lowering carlos.slice on this box, and that's your call. MemoryHigh is 10 percentage points under MemoryMax on the slice, and 32 MB (12.5%) under it per unit. Go's GOMEMLIMIT comes from the unit's memory.max minus 96 MiB, which is 160 MiB. The slice's swap cap is an absolute 8G, not a percentage: systemd takes a swap percentage from the swap that exists when it loads the unit, and at boot zram may not be up yet. The rollout is install-instance-units.sh over SSM (install plus daemon-reload, no restarts). Units move into the slice at their next restart, which is the next titogo deploy's staggered roll. OK to proceed, or do you want changes? </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: thanks, all three noted. carlos.slice stays as it is. Installing on carlos-tito-ie waits for (a) Astra's review, (b) the PR merging, and (c) Paul's explicit go. After the daemon-reload I'll read memory.high and memory.swap.max on one running titogo@ and report which behaviour we got. Two journal findings from the outage window, FYI: de7ea1f's start-up cost is ruled out (the largest emails table is 2,838 rows, so the index build is trivial). And titogo's import-sync process is at 947 MB RSS outside any memory cap, and carlos-litestream logged 25.5k lines between 13:47 and 13:56. I'm looking at import-sync on the titogo side next. </cross-session-message>

Human

Yes, go ahead with unblocking. Luna can review copy?

Human

<task-notification> <task-id>b4fgebe5f</task-id> <tool-use-id>toolu_01Hjf9Ey2Q8PB66BaNLGNhH7</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/b4fgebe5f.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra round 2 to finish" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bn8hoe8op</task-id> <tool-use-id>toolu_01RLvBzE9gU6qZ8tj6wAbovM</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/bn8hoe8op.output</output-file> <status>completed</status> <summary>Background command "Wait for round 2 log to finish" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bft0dbf1a</task-id> <tool-use-id>toolu_011jeN9fRGLq6d7RZz5uEHeL</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/bft0dbf1a.output</output-file> <status>completed</status> <summary>Background command "Wait for round 2 final verdict" completed (exit code 0)</summary> </task-notification>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: titogo.slice is installed on carlos-tito-ie, with Paul's go. titogo #5447 is merged (7a72355), and install-instance-units.sh ran over SSM at about 14:55 UTC: it installed both instance units and ran daemon-reload, and restarted nothing. The box's unit files differed from main only by the new lines. Your note 3 answered: on titogo@demo, `systemctl show` now reports Slice=titogo.slice, MemoryHigh=224M and MemorySwapMax=256M, but the running cgroup still reads memory.high=max and memory.swap.max=max. So on systemd 257 the new limits do NOT reach running units at the reload; they arrive with the move into the slice at restart. titogo.slice is loaded but inactive (MemoryHigh 15.4 GiB, MemoryMax 18.5 GiB, MemorySwapMax 8 GiB). The deploy of 7a72355 is queued, and its roll will move the units in; I'll verify after. carlos-infrastructure #48 (harden-box.sh) is merged too. </cross-session-message>

Human

<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: the a1bfeae deploy's roll had already started by the time your message arrived, so there was nothing left to hold, and I skipped (1) because the gap closed within minutes. I sampled the box every 15 s through the roll instead. From 14:54 to 14:56:36, units moved 50 → 0 in the old slice and 16 → 68 in titogo.slice, about 20 a minute. Throughout: MemAvailable 20–21G, swap used 0 MiB, memory PSI some avg10 = 0.00. The slice settled at about 6.3 GB. Live cgroup values now: titogo@demo memory.high=224M, max=256M, swap.max=256M. Slice memory.high=15.4G, max=18.5G, swap.max=8G. 10 session canaries are still in the old slice; they move when their own channels next promote. go, carlos, demo, vicky and stripeyste all answer from outside. On pacing (2): fleet_watch's roll isn't changed in this deploy. With the slice and zram in place, the 80-restart roll didn't move memory pressure off zero, and neither did the 14:34 and 14:40 rolls on the 32 GB box. I'm leaving it deferred, as noted on PRO-6598, unless the memory metrics show otherwise once they're flowing. </cross-session-message>

Human

<task-notification> <task-id>bjtls7mnq</task-id> <tool-use-id>toolu_014M4RZKeUbQCNTzrcMoPj23</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/bjtls7mnq.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the latest tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bbl6be2x8</task-id> <tool-use-id>toolu_016iGW2yKaiazhNxvg6D2Cj5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/bbl6be2x8.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on merged tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>af8cbf06a91e32222</task-id> <tool-use-id>toolu_0172AD2XFMLkdMPBfQqZjaiP</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/9fdb19f6-7964-4108-a723-1323c2914a76/tasks/af8cbf06a91e32222.output</output-file> <status>completed</status> <summary>Agent "Unblock litestream #284 slice A" 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>`litestream-oom-284` is merge-ready at **0fd1beb3d63dabe0e6b8a464f35ca83eac341e78**, and CI passed on that exact tip. It still merges cleanly with main (56940c87, which hadn't moved at my last fetch). I did not merge it. **Uncommitted work at the start:** only `.claude/HANDOFF.md` (the 14 Oct handoff). It's untouched and still on disk; main now gitignores it. **The merge.** Main had replaced the console's alert watcher with the fleet alerts engine. So the branch's console changes had to be ported onto the engine, not just merged: - Each `restarts@&lt;unit&gt;` rule is its own incident, one per unit, with the boxes as members. - Its level, words, value text, settings and noise count come from the rule type `restarts`. Its title names the unit, e.g. "Restart loop (carlos-litestream.service) on box-a". - `restarts` is now on the Rules page and in the shared rule text (`internal/alerting`) that both the box and the console use. - `alertTick` takes both the restart readings and main's disk trend and engine beat. The first tick at startup passes the beat, so a restored engine_silent alert isn't cleared by mistake. - The October census overlay was dropped and re-proposed, because main rebuilt the census on a new base. - build, vet and gofmt are clean, and the darwin, windows and linux-arm64 cross-builds pass. **Copy changes (Luna, gpt-5.6-luna, high effort; no flags):** | key | new | applied | |---|---|---| | A4 box footer | `rule: restart loop (%s)` | **No.** Main's footers all use each rule's capitalised display name (fleet alerts ruling R-31), so this rule would be the only lower-case one. Left for Paul. | | B2 how long you have | `The service may be down or unreliable after repeated restarts.` | yes | | B3 what to do | `Read the service's journal on that box to find out why it restarted repeatedly.` | yes | | C1 console what | `A platform service on %s has restarted repeatedly.` | yes | | C2 what, no box named | `A platform service has restarted repeatedly.` | yes | | D1 flag help | `systemd drop-in that sets the replicator's memory cap from the database count (default %s when --out is %s; "none" leaves the unit's cap alone)` | yes | | D2 warning | `litestream: WARNING: could not apply the memory cap from %s: %v` | yes | | D4 drop-in header | Luna: ``# GENERATED by `carlos ops litestream`. Do not hand-edit. It is rewritten when`` | yes, but lower case after the full stops (``. do not hand-edit. it is rewritten when``), because the house rule says so and Luna's capitals broke it | The rows are marked approved by delegation (Luna, 2026-11-03, on Paul's instruction) in `docs/superpowers/notes/copy-litestream-284.md`. One string came later and Luna hasn't seen it: `rules.th.restarts` = "Fixed at more than 3 restarts in 10 minutes. Not configurable." It copies main's wording for the other fixed thresholds. The ten-string October deck didn't survive. Main now commits a `copy-review/` folder (another branch's deck), and the merge wrote it over the old one, which git was ignoring. I rebuilt the deck from the code, and it now covers the engine strings too. **Census ls284: approved** (Astra, read-only), recorded as reply 1212 on #280: [https://amadan.net/carlos/platform/discussions/280](https://amadan.net/carlos/platform/discussions/280) - **Round 1: NOT READY.** One P1: an agent running as root would follow a symlink planted at `&lt;dataDir&gt;/monitor/restarts.json`. That directory belongs to the `carlos` user. - **Fix:** a root-run agent now keeps the restart watch in memory only and never builds the path, the same way main handles the engine beat. A guard test covers it. - **Round 2 (7120ca15): READY.** No findings; all seven units and five package fingerprints approved. **Astra merge-diff review** (only what changed since fa63c1ea): READY AFTER FIXES. Its one P2, the Rules row saying "No threshold.", is fixed in 0fd1beb3. That was the single fix round. **For you or Paul:** 1. Merge, when you're ready. 2. Luna's A4: a lower-case footer for this one rule, or not. 3. Under main's alert design (spec §7.2) a box only sends its own alerts for disk and engine_silent. So restart alerts reach people only through the console's connectors, as warnings. The box's own restart wording (deck group A) is tested but never sent. If a litestream loop should rank as an incident instead, that's a one-line change. 4. CI died once with "signal: terminated" on bfb7367b, with no test output. That matches the runner restart problem in #359. The next push passed. If it keeps happening, it belongs on #359. Locally I ran only the touched packages, with targeted `-run` patterns in host and console. Three claim-binding host tests fail here, and they fail on clean main too, so I didn't chase them. Posted: a status reply on #284 and an updated branch description. My scratch files are deleted. The previous session's kept scratch dir (`~/.cache/tmp/claude-1001/ls284`) is left as it was.</result> <usage><subagent_tokens>256989</subagent_tokens><tool_uses>148</tool_uses><duration_ms>4001172</duration_ms></usage> </task-notification>

Human

go ahead.