carlos / platform Public

docs: region HA host.env settings, single-quoted identity map

Adds docs/region-ha-runbook.md with the fixed-box host.env lines for
region HA: CARLOS_REGION_HA, CARLOS_TERMINATION_QUEUE_URL and
CARLOS_HA_FIXED_BOX_IDENTITIES. The identity map must be single-quoted
(hostenv.renderValue writes it that way) so systemd and a sourcing shell
both keep its JSON double quotes; unquoted, systemd strips them and the
box refuses the setting at identity_bindings.

Invariant documented: the operator writes root-owned host.env and restarts
carlos-edge one box at a time; rollback is the previous host.env.
Copy: one Luna pass, applied verbatim, approved by delegation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 78f4e793637eb4882e75583e2bc6f97ec2ee7893 parent 1acce96
1 file changed, +22 −0
  • docs/region-ha-runbook.md +22 −0

Intent

Human

<task-notification> <task-id>btslpq8ld</task-id> <tool-use-id>toolu_01MQmX6XXWdyftkgfH9gMuXw</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/acef84d4-5254-488e-9bf2-166a4d113752/tasks/btslpq8ld.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra code run to finish" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/region-ha-runbook.md b/docs/region-ha-runbook.md
new file mode 100644
index 000000000..5611d44d0
--- /dev/null
+++ b/docs/region-ha-runbook.md
@@ -0,0 +1,22 @@
+# Region HA operator runbook
+
+This page is for operators of a deployment that runs region HA (`CARLOS_REGION_HA=1`). It covers the settings a box needs and the three jobs the platform leaves to an operator. The design is in `docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md`.
+
+## Settings in host.env
+
+A fixed box is one you created by hand, not through Auto Scaling. It reads its region HA settings from root-owned `/etc/carlos/host.env`, mode 0600. The region-host module does not write that file. Write the lines, then restart `carlos-edge.service` on one box at a time. A restart costs about 1 to 11 seconds of held or refused requests on that box.
+
+```
+CARLOS_REGION_HA=1
+CARLOS_TERMINATION_QUEUE_URL=https://sqs.eu-west-1.amazonaws.com/123456789012/example-host-terminations
+CARLOS_HA_FIXED_BOX_IDENTITIES='{"box-a":"i-0123456789abcdef0","box-b":"i-0fedcba9876543210"}'
+```
+
+- `CARLOS_TERMINATION_QUEUE_URL` is this box's own termination queue, from the region-host module's `termination_queue_url` output. Each box polls its own queue. Without it, termination recovery does not start, and the journal says so.
+- `CARLOS_HA_FIXED_BOX_IDENTITIES` maps each fixed box's reference to its EC2 instance ID, as a JSON object.
+ - **Wrap the value in single quotes**, as above. The JSON needs its double quotes, and single quotes preserve them for both systemd and a shell that sources the file. Without the single quotes, systemd strips the double quotes and the box refuses the setting.
+ - Only lower-case letters, digits, `{`, `}`, `"`, `:`, `,`, space and `-` are allowed. A reference is one DNS label. An instance ID is `i-` followed by 8 or 17 hexadecimal characters.
+ - The box's own entry must match its own instance ID, or termination recovery refuses to start (`identity_bindings`).
+ - Without the setting, a box binds only itself. A peer then has no binding, and taking over its hosts after it is terminated falls back to asking EC2 directly.
+
+To roll back, restore the previous host.env and restart `carlos-edge.service`.