carlos / platform Public

docs: PPv2 runbook and spec rev 5.1 for the final review fixes

Runbook: the tool now watches both target groups from before the apply
(manual watch dropped); new flags; per-port B evidence; a restart fails
the window; the guard-binary prerequisite; sync-tfvars in the S3
incident; ec2:DescribeNetworkInterfaces on every root's re-pin card;
the idle-preconnect timeout watch item for dev witness row 2.

Spec rev 5.1: the barrier blocks only B steps (A steps and reverify
allowed, 8a3d302's build-time ruling); barrier file written after the
sweep; section 6.1 item 6, the installed guard binary; per-listener
counters and edge_instance in trust-status and convergence; the S3
incident's step order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 74bfaf4ee93b78fad22ee1fe276a3e938db8a5e5 parent d7a0697
2 files changed, +54 −28
  • docs/region-ha-runbook.md +35 −18
  • docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md +19 −10
diff --git a/docs/region-ha-runbook.md b/docs/region-ha-runbook.md
index f0d463684..739ad3973 100644
--- a/docs/region-ha-runbook.md
+++ b/docs/region-ha-runbook.md
@@ -366,8 +366,9 @@ In this order:
3. `CARLOS_INGRESS_PROXY_SOURCES` equals the module's output, in the region's host-env parameters (then a group roll, because members write host.env only at launch) and in each fixed box's host.env (drained restart). Every target's journal shows `edge: proxy protocol: armed on :80 and :443, trusting ...` with exactly the module's addresses.
4. The group module is at vN.
5. `CARLOS_HOST_METRICS=cloudwatch` on every target, the module's `proxy_trust_alarm` set, both alarms applied and in OK, and a notification seen arriving.
+6. On a box with the guard armed, the installed guard binary `/opt/carlos/system/guard/carlos` is vN or later. guard-arm copies it once, and application updates do not refresh it. An older one runs `guard-exec recover` with no PPv2 check, so with a journal open it could restore a predecessor below vN. A box without the guard has no such file.
-`prereq` checks only the automated part: both target groups in S0, every target armed with the NLB's node addresses, the barrier down, the trust alarm OK. It writes `prereq.json`, including the NLB's public addresses, which the probes must target. Items 1, 2 and 4 and a delivered notification stay manual.
+`prereq` checks only the automated part: both target groups in S0, every target armed with the NLB's node addresses, the barrier down, the trust alarm OK, and item 6 on every target. For item 6 it runs the installed guard binary's `version --json` over SSM and refuses, naming the boxes, unless the binary is absent or reports `ingress-proxy-v2`. It writes `prereq.json`, including the NLB's public addresses, which the probes must target. Items 1, 2 and 4 and a delivered notification stay manual.
```
python3 scripts/ppv2-step.py prereq --nlb-arn <nlb> --tg-arn-80 <tg80> --tg-arn-443 <tg443> \
@@ -379,17 +380,20 @@ Before A80 you can unwind in reverse: remove the key from the parameters and fix
Needs: the AWS profile must allow `ec2:DescribeNetworkInterfaces`, `ssm:SendCommand` and `ssm:ListCommandInvocations`, plus the target group and alarm reads and the tofu apply. The operator host and the probe host must both be NTP-synced. The tool tolerates 5 s of difference between them.
+Every root's plan role needs `ec2:DescribeNetworkInterfaces` from this release on, even with PPv2 off: the ingress module reads the NLB's node interfaces at plan time. Without it the root's re-pin plan fails, though it would change no target group. Put the permission on each root's re-pin card before its first plan at vN.
+
### The steps
Four steps per NLB, in this order: A80, A443 (PPv2 on), B80, B443 (preservation off). `:80` goes first in each pair. Each step starts only when the previous step's record exists and passed.
-`apply` changes one attribute on one target group, then goes straight into convergence. Once `tofu apply` returns, it polls the health of the step's own target group every 10 s and trust counters every 30 s, until the record is written. It does not watch the other target group, and it does not watch the apply itself. So start your own watch first: run `aws elbv2 describe-target-health` for both the `:80` and the `:443` target group every 10 s, from before the apply until the step ends, and keep it through the window. Treat any unhealthy observation as a failed step and run `reverify`. Then run the step like this:
+`apply` changes one attribute on one target group, then goes straight into convergence. It watches the health of both target groups, `:80` and `:443`, every 10 s: from just after it writes `<step>-intent.json`, before `tofu apply` starts, through the apply and the convergence, until the record is written. Any unhealthy or unregistered target in either group, at any poll, fails the step, and so does more than 15 s without an answer from either group. It polls trust counters every 30 s. You need no watch of your own. Run the step like this:
-1. Start `apply`. It also needs `--probe-records`, two paths, one per NLB public address, that do not exist yet:
+1. Start `apply`. It names both target groups, and `--port` and `--tg-address` say which one the step changes. It also needs `--probe-records`, two paths, one per NLB public address, that do not exist yet:
```
- python3 scripts/ppv2-step.py apply --root <tofu root> --nlb-arn <nlb> --tg-arn <tg> \
- --tg-address <tofu address of the tg> --port <80|443> --step <A80|A443|B80|B443> \
+ python3 scripts/ppv2-step.py apply --root <tofu root> --nlb-arn <nlb> \
+ --tg-arn-80 <tg80> --tg-arn-443 <tg443> \
+ --tg-address <tofu address of the stepped tg> --port <80|443> --step <A80|A443|B80|B443> \
--record-dir <dir> --probe-records <new-a.json>,<new-b.json> \
--profile <profile> --region <region> --targets <i-...,i-...>
```
@@ -404,20 +408,27 @@ Four steps per NLB, in this order: A80, A443 (PPv2 on), B80, B443 (preservation
Use `--expect s1` for A steps and `--expect s2` for B steps. The tool rejects a record with any other expectation. A probe that started before the apply is refused, and so is a stale record file.
3. Leave the probes and `apply` running until `apply` exits. Exit 0 means the step passed and wrote `<step>.json`. Run no restart, drain or group roll until then. Do maintenance between steps.
-Exit codes: 0 done or passed, 1 refused or failed, 2 invalid arguments, 130 interrupted. Records are in the record directory. `<step>-polls.jsonl` has every poll.
+Exit codes: 0 done or passed, 1 refused or failed, 2 invalid arguments, 130 interrupted. Records are in the record directory. `<step>-polls.jsonl` has every poll, including the health polls made during `tofu apply`.
+
+A B step converges only on its own port's traffic: every node's `proxied` count must rise on that listener (`by_listener` in trust-status). After B80, `:80` traffic does not count for B443.
+
+A restart of any target's edge during the window fails the step. The tool sees it as a new `edge_instance` in trust-status, or as any counter lower than at the poll before. Counters start from zero after a restart, so the window cannot prove what happened in between. Run `reverify` once the box is back.
If the run is interrupted, or a convergence fails, or one `aws` call is slow enough to leave more than 15 s between health observations, the window fails. Use `reverify`, not `converge`. It opens a fresh window for a step already made (A steps cannot be undone) with new probes and new record paths:
```
-python3 scripts/ppv2-step.py reverify --root <tofu root> --nlb-arn <nlb> --tg-arn <tg> \
- --tg-address <tofu address of the tg> --port <80|443> --step <step> \
+python3 scripts/ppv2-step.py reverify --root <tofu root> --nlb-arn <nlb> \
+ --tg-arn-80 <tg80> --tg-arn-443 <tg443> \
+ --tg-address <tofu address of the stepped tg> --port <80|443> --step <step> \
--record-dir <dir> --probe-records <new-a.json>,<new-b.json> \
--profile <profile> --region <region> --targets <i-...,i-...> [--incident-cleared]
```
-`reverify` also adopts the change if a `tofu apply` failed after it began and the target group is now in the step's target state. A reverify's result replaces the step's evidence, pass or fail. `converge` (flags `--step --record-dir --probe-records --tg-arn --profile --region --targets`) exists only to resume a window that was not broken.
+`reverify` also adopts the change if a `tofu apply` failed after it began and the target group is now in the step's target state. A reverify's result replaces the step's evidence, pass or fail. `converge` (flags `--step --record-dir --probe-records --tg-arn-80 --tg-arn-443 --profile --region --targets`) exists only to resume a window that was not broken.
+
+B steps refuse while any barrier is up. A steps, R steps and `reverify` of an A step do not.
-B steps refuse while any barrier is up. A and R steps do not.
+Watch item for the dev window: if the NLB sends its PROXY header only with the client's first bytes, an idle connection (a browser preconnect that never sends a request) reaches the 10 s header deadline and moves `timeout`. `timeout` must not move during a step, so B steps would never converge. Row 2 of the dev witness shows which way the NLB behaves. If `timeout` moves on idle preconnects, stop and report before B80.
### Rollback
@@ -428,18 +439,24 @@ Rollback ends at S1. Run `R443` then `R80` with `apply` (preservation on). `--pr
Run this if the trust-violation alarm fires, or the probe or a target's counters show `marker_trusted` or `no_client_refused` above zero. Some target group has PPv2 off with preservation off.
1. On every target in that target group, over SSM, all at once: `carlos system edge trust-barrier`. No connection from an NLB node carries a client address after this, and forged ones are closed. Health checks still pass. It prints one JSON line with `barrier` and `closed`.
-2. Turn preservation on for the affected target group with `aws elbv2 modify-target-group-attributes`. This is the only direct command allowed, and only in an incident. The group is now in S0 (or S1 if PPv2 was still on). Reconcile tofu afterwards with a plan that shows no change.
-3. Find who turned PPv2 off. If the attribute is off, run the A step again with `apply`, while the barrier stays up (A steps allow it). If it is already on, run `reverify` for the A step with `--incident-cleared`. `reverify` refuses after any S3 signal recorded for the step unless you pass the flag, so pass it only once you understand the incident.
-4. Check S1 with the probe, `--expect s1`, on both public addresses.
-5. On every target: `carlos system edge trust-resume`.
-6. Continue with the B steps, in a window.
-7. Report to 8a3d302 with the alarm, the counters and the barrier's close counts.
+2. Turn preservation on for the affected target group with `aws elbv2 modify-target-group-attributes`. This is the only direct command allowed, and only in an incident. The group is now in S0 (or S1 if PPv2 was still on).
+3. Bring `ppv2.auto.tfvars.json` back in line with live. Until you do, every step refuses with "disagrees with the live target group". `sync-tfvars` rewrites the file to both groups' live attributes under the step lock, keeps the old bytes in a `sync-tfvars-<time>.json` record, and refuses while either group is in S3. Then reconcile tofu with a plan that shows no change.
+
+ ```
+ python3 scripts/ppv2-step.py sync-tfvars --root <tofu root> --nlb-arn <nlb> \
+ --tg-arn-80 <tg80> --tg-arn-443 <tg443> --record-dir <dir> --profile <profile> --region <region>
+ ```
+4. Find who turned PPv2 off. If the attribute is off, run the A step again with `apply`, while the barrier stays up (A steps allow it). If it is already on, run `reverify` for the A step with `--incident-cleared`. `reverify` refuses after any S3 signal recorded for the step unless you pass the flag, so pass it only once you understand the incident.
+5. Check S1 with the probe, `--expect s1`, on both public addresses.
+6. On every target: `carlos system edge trust-resume`.
+7. Continue with the B steps, in a window.
+8. Report to 8a3d302 with the alarm, the counters and the barrier's close counts.
-To read a target at any time, `carlos system edge trust-status` prints one JSON line with `armed`, `barrier`, the counters and `proxied_by_node`. The three verbs exit 0 on success, 1 when refused or failed, 2 for bad arguments or a box not armed.
+To read a target at any time, `carlos system edge trust-status` prints one JSON line with `armed`, `barrier`, `edge_instance` (a random id the edge sets when it starts), the counters and `proxied_by_node` for both listeners together, and `by_listener` with each listener's own, under `"80"` and `"443"`. The three verbs exit 0 on success, 1 when refused or failed, 2 for bad arguments or a box not armed.
Notes from the reviews:
-- `trust-barrier` exits non-zero with `"persisted":false` when it could not write the barrier to disk. The barrier is up in memory but will not survive a restart. Fix the disk and raise it again.
+- `trust-barrier` raises the barrier and closes the connections first, then writes it to disk, so a slow or stalled disk delays only the file. It exits non-zero with `"persisted":false` when it could not write the barrier to disk. The barrier is up in memory but will not survive a restart. Fix the disk and raise it again.
- Trust violations in the last partial minute before an agent stop are never published as a metric. After an unexpected stop, read the journal: `journalctl -u carlos-edge -g "proxy protocol:"`.
- A refused boot recovery on a box with the guard armed keeps the edge down until an operator acts, because its edge unit has `Requires=carlos-system-recover.service`. On a fixed box that includes its EIP traffic.
diff --git a/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md
index afa7bb1d5..47eef47ba 100644
--- a/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md
+++ b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md
@@ -1,6 +1,8 @@
# PROXY protocol v2 on the region HA load balancers
-Design, 2026-11-12, **rev 5** (Astra rounds 1 to 3 applied, §12, §13 and §15. Round 3, the last, was NOT READY with one P1 in F1; its fix, the trust barrier, was **accepted without a fourth round by 8a3d302 on 2026-11-12** (§15). **APPROVED 2026-11-12** for build: Paul approved "PPv2 ... before G6"; no infra or live change without 8a3d302's GO and a #421 window. Earlier: round 2 repeated fault family F1, so under stopping rule 2 the choice went to Paul: **option A, one-way PROXY protocol, decided 2026-11-12** by agent manager 8a3d302 on Paul's standing acceptance of recommendations, Paul informed and free to override; §14). Rev 4 wrote A in; rev 5 applies round 3's P2s and proposes the barrier for its P1 (§4.7, §15). Agent manager 8a3d302 asked for it on 2026-11-12 with Paul's approval: client IP preservation off and PROXY protocol v2 on, on both target groups of each region NLB, before G6 opens the NLBs to customers. Design only; the build is a separate GO. Review budget: at most three Astra rounds (AGENTS.md stopping rules); all three rounds are spent.
+Design, 2026-11-12, **rev 5.1** (Astra rounds 1 to 3 applied, §12, §13 and §15. Round 3, the last, was NOT READY with one P1 in F1; its fix, the trust barrier, was **accepted without a fourth round by 8a3d302 on 2026-11-12** (§15). **APPROVED 2026-11-12** for build: Paul approved "PPv2 ... before G6"; no infra or live change without 8a3d302's GO and a #421 window. Earlier: round 2 repeated fault family F1, so under stopping rule 2 the choice went to Paul: **option A, one-way PROXY protocol, decided 2026-11-12** by agent manager 8a3d302 on Paul's standing acceptance of recommendations, Paul informed and free to override; §14). Rev 4 wrote A in; rev 5 applies round 3's P2s and proposes the barrier for its P1 (§4.7, §15). Agent manager 8a3d302 asked for it on 2026-11-12 with Paul's approval: client IP preservation off and PROXY protocol v2 on, on both target groups of each region NLB, before G6 opens the NLBs to customers. Design only; the build is a separate GO. Review budget: at most three Astra rounds (AGENTS.md stopping rules); all three rounds are spent.
+
+**Rev 5.1 (2026-11-13), build-time amendments from the whole-branch review:** §4.7 and §6.5, the barrier blocks only B steps (S1 to S2), A steps and reverify are allowed under it; §6.1 item 6, the installed guard binary; §4.5 and §6.4, per-listener counters and the edge's identity, which convergence uses; §6.5, the incident's step order.
Line citations are to `origin/main` at ae1b8cca. AWS facts quote "Edit target group attributes for your Network Load Balancer" (docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html, read 2026-11-12) unless another page is named.
@@ -94,6 +96,8 @@ The header's destination address and port are not used.
Per listener and, for trusted connections, per node address, since start: `proxied`, `no_client`, `no_client_refused` (§4.6), `ignored` (untrusted header consumed), `ignored_private` (untrusted header from a private address: almost certainly an NLB node missing from the key), `marker_trusted` (§6.4), `malformed`, `timeout`. One journal line at start (`edge: proxy protocol: armed on :80 and :443, trusting 172.31.29.110,172.31.11.189`), and one throttled line every minute while armed, naming every counter. `no_client_refused` and `ignored_private` above zero also log once a minute at warning level with the peer address. The cutover reads these lines over SSM (§6.4).
+**Rev 5.1: what `trust-status` carries.** The counters and `proxied_by_node` summed over both listeners (the metric's view, below), and `by_listener` with each listener's own counters and per-node `proxied`, keyed `"80"` and `"443"`, all from one snapshot. And `edge_instance`, a random id the edge sets once when it arms at start: the counters live exactly as long as it, so a reader that sees it change knows they started again. Convergence (§6.4) uses both: a B step's evidence is its own port's listener, and a changed `edge_instance` or any count lower than at the previous poll is a restart that fails the window.
+
**The trust-violation metric, for the whole armed lifetime.** `no_client_refused` plus `marker_trusted` is the S3 signal: in S3 every client that sends no header of its own lands in `no_client_refused` (§4.6), which on a serving target group is nearly every client, and the forgery probe's marker lands in `marker_trusted`. The agent publishes the per-minute increase of that sum as `IngressProxyTrustViolations` in the `Carlos/Host` namespace, with the `Deployment` and `Region` dimensions the clock and admission metrics already use (`internal/host/memwatch.go:53-90`, `ingress/alarms.tf:49-90`), on every armed box with `CARLOS_HOST_METRICS=cloudwatch`. The agent runs the edge in-process (`internal/host/ingressdrain.go:87-88` holds it) and reads the counters directly. One alarm in the ingress module (§8.1) fires on Maximum > 0 for one minute, missing data not breaching (unarmed boxes publish nothing). The armed prerequisite (§6.1) includes `CARLOS_HOST_METRICS=cloudwatch` on every target.
### 4.6 A trusted connection without a client address answers the health check only
@@ -106,9 +110,9 @@ In S3, ordinary clients (no header of their own) are refused loudly by this rule
### 4.7 The trust barrier (rev 5, accepted 2026-11-12; replaces rev 4's one-shot `close-trusted`, see §15)
-A root command on the box, `carlos system edge trust-barrier`, raises a barrier in the edge. While it is up, a trusted connection's header grants no identity: **every** connection from a node address, whether open, still parsing its header, or accepted later, is treated as `no-client` (§4.6) once its state resolves, so it can answer the health check and nothing else. Raising the barrier sets it before it closes anything: first the flag, then it closes every open connection from a node address, pending ones included. The wrapper tracks trusted connections from accept, not from parse, for this. A connection that finishes a forged header after the flag is up is still `no-client`; a node still in S3 that sends new connections meets the same rule. Health checks keep passing, so targets stay in service, and in S0 or S1 every client connection is untrusted and served as normal.
+A root command on the box, `carlos system edge trust-barrier`, raises a barrier in the edge. While it is up, a trusted connection's header grants no identity: **every** connection from a node address, whether open, still parsing its header, or accepted later, is treated as `no-client` (§4.6) once its state resolves, so it can answer the health check and nothing else. Raising the barrier sets it before it closes anything: first the flag, then it closes every open connection from a node address, pending ones included, then (rev 5.1) it writes the barrier file. Containment never waits on the disk: a stalled or slow data disk delays only the file, and a write that fails leaves the barrier up in the running edge and says it is not persisted. The wrapper tracks trusted connections from accept, not from parse, for this. A connection that finishes a forged header after the flag is up is still `no-client`; a node still in S3 that sends new connections meets the same rule. Health checks keep passing, so targets stay in service, and in S0 or S1 every client connection is untrusted and served as normal.
-The barrier is written to a file in the agent's state directory and read at edge start, so a restart does not lower it. Only `carlos system edge trust-resume` lowers it, run after the target group is verified back in S1 or S2 by the marker probe (§6.4). The step script refuses a forward step while any target's barrier is up. The commands are root CLI verbs that reach the agent the way W6's and §25's verbs do: a child that drops to the agent's user and calls the drain socket (`internal/host/hadrain_call.go`, `hadrain_socket_linux.go:23`, which admits only the agent's UID). The agent holds the edge in-process (`internal/host/ingressdrain.go:87-88`). Each reports how many connections it closed and the barrier state; the state also goes in the §4.5 journal line.
+The barrier is written to a file in the agent's state directory and read at edge start, so a restart does not lower it. Only `carlos system edge trust-resume` lowers it, run after the target group is verified back in S1 or S2 by the marker probe (§6.4). The step script refuses a B step (S1 to S2) while any target's barrier is up. **Rev 5.1:** A steps (S0 to S1) and `reverify` are allowed under a barrier: in S0 and S1 no client connection is trusted, so the barrier matters only once preservation goes off, and an A step under the barrier is the only way forward from an S3 incident without lowering it first (8a3d302's build-time ruling via the controller, 2026-11-12). The commands are root CLI verbs that reach the agent the way W6's and §25's verbs do: a child that drops to the agent's user and calls the drain socket (`internal/host/hadrain_call.go`, `hadrain_socket_linux.go:23`, which admits only the agent's UID). The agent holds the edge in-process (`internal/host/ingressdrain.go:87-88`). Each reports how many connections it closed and the barrier state; the state also goes in the §4.5 journal line.
## 5. Client IP everywhere it is used
@@ -142,6 +146,7 @@ In this order:
3. **The key.** `CARLOS_INGRESS_PROXY_SOURCES` equal to the module output (§8.1): in the region's host-env parameters, then a group roll so every member is launched with it (members write host.env only at launch, `hostenv.go:144-150`), and in each fixed box's host.env with a drained restart, as W6 delivered `CARLOS_INGRESS_TARGET_GROUPS`. Each target's journal shows the §4.5 armed line with exactly the module's addresses.
4. **The group module at vN**, whose precondition accepts the new states (§8.2). A group plan with the old module would refuse once the TGs change.
5. **Metrics and alarm.** `CARLOS_HOST_METRICS=cloudwatch` on every target; the module's `proxy_trust_alarm` input set, both alarms applied, in OK, and notification delivery seen (§4.5, §8.1, §8.3).
+6. **Rev 5.1: the installed guard binary at vN or later.** On a box with the guard armed, `/opt/carlos/system/guard/carlos` is a separate copy guard-arm installed (`internal/host/guardarm.go:149`) and application updates do not refresh it. An older one runs `guard-exec recover` with no activation check (§7.3), so with a journal open and a carlos.prev below vN it could restore that predecessor. The step script's `prereq` checks, over SSM on every target, that the file is absent or reports `ingress-proxy-v2` in `version --json`, and refuses naming the boxes otherwise.
Arming changes nothing on the wire: until step A80 no connection carries a header, and trusted peers are only health checks, which §4.6 serves.
@@ -197,10 +202,11 @@ The edge catches the forged marker itself: a trusted `proxied` header whose sour
Convergence of a step, per TG port, needs all of:
- after A: the marker fails on **both** NLB addresses for 30 consecutive attempts (60 s); plain stays at its port's answer on both addresses (`:443`: 200 with the probe's address; `:80`: 302, not followed);
-- after B: the same, plus every target's counters show `proxied` rising from **both** node addresses and `no_client_refused` at 0;
-- all the time: `malformed`, `timeout`, `ignored_private` and `marker_trusted` at 0.
+- after B: the same, plus every target's counters show `proxied` rising from **both** node addresses on **the changed port's listener** (`by_listener`, §4.5; rev 5.1: after B80, `:80` traffic is no evidence for B443) and `no_client_refused` at 0;
+- all the time: `malformed`, `timeout`, `ignored_private` and `marker_trusted` at 0, summed and on the changed port's listener;
+- all the time (rev 5.1): every target's `edge_instance` as at the step's baseline, and no count lower than at the previous poll. A restart fails the window; a fresh window (`reverify`) follows once the box is back.
-**Transition gates and maintenance rows are separate.** From the start of an attribute step until its convergence record is written, every target is healthy in both TGs (`describe-target-health` every 10 s) and no drain, restart or group roll runs. Maintenance rows (§10 rows 5 and 6) run only between steps: during one, the named target may be `unhealthy.draining` or deregistered, every other target stays healthy, and the plain probe stays at 0 errors. The all-healthy gate is back before the next attribute step starts.
+**Transition gates and maintenance rows are separate.** From the start of an attribute step until its convergence record is written, every target is healthy in both TGs (`describe-target-health` every 10 s) and no drain, restart or group roll runs. Rev 5.1: the step script itself watches both TGs, from just after it writes the step's intent record (before `tofu apply` starts, the continuity check's anchor) through the apply and the convergence to the record, interrupted runs included; any unhealthy target in either TG, or more than 15 s without an observation of either, fails the step. Maintenance rows (§10 rows 5 and 6) run only between steps: during one, the named target may be `unhealthy.draining` or deregistered, every other target stays healthy, and the plain probe stays at 0 errors. The all-healthy gate is back before the next attribute step starts.
The script writes the record (times, counts, per-address results) that the next step requires.
@@ -210,11 +216,14 @@ The script writes the record (times, counts, per-address results) that the next
**Rollback ends at S1.** B443 then B80 back, each preservation **on**, by the step script or, in an abort, the direct command. S1 is today's client addresses through the NLB and today's collision behaviour, which is everything a rollback needs to restore; the edge stays armed and keeps ignoring the NLB's header as in S1. A80 and A443 are never reversed (§6.2, §7.3). No convergence proof is needed for S2 to S1, because every node is in S1 or S2 throughout and neither trusts a client header.
-**S3 incident** (the alarm, any `marker_trusted`, or any `no_client_refused`):
+**S3 incident** (the alarm, any `marker_trusted`, or any `no_client_refused`). Rev 5.1 order: barrier, preservation on, the A step again or `reverify --incident-cleared`, verify S1, resume, B steps.
1. `carlos system edge trust-barrier` (§4.7) on every target in that TG, over SSM on all of them at once. From that moment no connection from a node address carries an identity, open, pending or new, and the forged ones are closed. Health checks keep passing.
-2. Preservation **on** for the affected TG with the direct command (§6.3). New client connections become untrusted (S0 or S1) and are served normally behind the barrier.
-3. Find who turned PPv2 off. Verify the TG is in S1 with the marker probe on both addresses, then `trust-resume` on every target, then go forward with the step script (S1 to S2) in a window.
-4. Report to 8a3d302 with the alarm, the counters and the barrier's close counts.
+2. Preservation **on** for the affected TG with the direct command (§6.3). New client connections become untrusted (S0 or S1) and are served normally behind the barrier. Then the step script's `sync-tfvars` brings its tfvars file back in line with live (every step refuses until it does; it never writes S3).
+3. Find who turned PPv2 off. With PPv2 off (the TG is in S0), run the A step again with the step script, under the barrier (§4.7). With PPv2 already on (S1), `reverify` the A step with `--incident-cleared`.
+4. Verify the TG is in S1 with the marker probe on both addresses.
+5. `trust-resume` on every target.
+6. Go forward with the step script (S1 to S2, the B steps) in a window.
+7. Report to 8a3d302 with the alarm, the counters and the barrier's close counts.
### 6.6 Order across NLBs