oficina / equipo Public

plans: Task 34 dev drill rev 3.3, a block deadline stops the run

Per the coordinator ruling and kit d77b505d: past --max a teardown
block refuses (99); teardown.sh reports the stop, runs no retry or
further step, and holds its unit while the stalled step runs (units are
KillMode=control-group). 8.0 counts D plus guard: 1090.75 min under the
23 h cap. Hosts gone within 505 min of a trigger or stopped by 540.75;
a stopped run bills about $0.80 a day until Paul answers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0318a0ee42d7e48a45034910b05965ebf54af5f1 parent d77b505
2 files changed, +173 −111
  • docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md +146 −111
  • docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md +27 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md b/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
index e489b396..6d7a2a2b 100644
--- a/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
+++ b/docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md
@@ -1,7 +1,8 @@
# Hosted runners slice 2, Task 34: the dev drill in `kass` (for Paul's GO)
-**Revision:** 3.2 (2026-12-02), after the scoped after-cap review (`p34-r4.md`, finding 19, with the
-kit's `d17fc5c4` and `4af781ec`); 3.1 came after Astra's round 3 (`p34-r3.md`, its after-cap fixes, with the
+**Revision:** 3.3 (2026-12-02), after the coordinator's ruling that a block deadline only refuses
+(kit `d77b505d`, after Astra's `p34-r5.md`); 3.2 came after the scoped after-cap review (`p34-r4.md`,
+finding 19); 3.1 came after Astra's round 3 (`p34-r3.md`, its after-cap fixes, with the
kit's `5b65ec54`); revision 3 came after Astra's round 2 (`.superpowers/sdd/2026-11-30-hosted-runners-slice-2/p34-r2.md`),
with the coordinator's revision 3 rulings (`task-34-rev3-brief.md`), the run kit's round 2
(`dc868b1c`, `0acdeea7`; `kit-p34-report.md`, "Round 2") and the headless round 2 (`4efc4956`).
@@ -14,24 +15,37 @@ everything else, a ledger, systemd user units, teardown verified by direct reads
through `equipo-hosted-ops` (slice 2 Task 33), so this drill is that tool's first real run, ahead of
the production bring-up (`2026-11-30-hosted-prod-account-plan.md`, "the account plan").
+## Revision 3.3 (the coordinator's ruling: a block deadline only refuses)
+
+After Astra's `p34-r5.md`, the coordinator cut the deadline path to a refusal (kit `d77b505d`;
+`kit-p34-report.md`, "Cut"). Past a block's `--max`, the block journals `DEADLINE` and exits 99. It
+stops, unlocks and reconciles nothing and asks for no recovery; the command runs on in its unit.
+Section 8 now follows it:
+- **A deadline anywhere stops the run and asks Paul.** In `teardown.sh` the 99 ends the steps: no
+ retry follows it, and the stop is reported (a FINDING and `report-stopped.md`). The continuation
+ runs once and never runs again. Retries stay only for an ordinary exit 1 of an `--optional` block,
+ and only where the plan had them: 8.3a, 8.3b and 8.6. The three retries revision 3.2 cut stay cut.
+- **Only `--optional` blocks return 1** on an ordinary failure; a required block's non-zero exit is
+ still a hard stop. Every teardown block is `--optional`.
+- **The stalled command keeps running.** The continuation (and section 8 by hand, unit `8`) is a
+ systemd unit with `KillMode=control-group`: when its main process ends, systemd stops whatever is
+ left in it. So after a deadline `teardown.sh` reports the stop, then waits, running nothing, until
+ the stalled step's process ends. The unit's runtime cap, the continuation's 23 hours, is the
+ backstop.
+- **The table** counts each attempt at its deadline plus the block's guard (2 minutes). The sum is
+ **1090.75 minutes (18 h 11)**, 289.25 minutes inside the 23 hours, which stay.
+- **The bounds.** From a trigger, the hosts are gone within **505 minutes (8 h 25)**, at most 9
+ host-hours, about **$0.49**. Otherwise the run has stopped and is asking Paul by **540.75 minutes
+ (9 h 01)**. A stopped run is not bounded: its stalled command may still be running under the
+ 23-hour cap, and the hosts keep billing until Paul answers, **about $0.80 a day**.
+- **Worst-case estimate** $32.82 (35 host-hours); self-stop margin $7.18.
+
## Revision 3.2 (the scoped after-cap review, finding 19)
-The scoped review (`p34-r4.md`) found the 8.0 table left out work done outside its allowances. Kit
-`d17fc5c4` and `4af781ec` (`kit-p34-report.md`, K14 to K17) changed what a deadline does and measured
-its worst case. Section 8 now reflects them:
-- **The deadline path.** The group is stopped synchronously (TERM, 90 s, KILL, 30 s; not proved gone
- is a stop). Only the roots the block touched are reconciled. Only a state lock this block's killed
- OpenTofu provably left is released; any other lock stops.
-- **The table** counts every attempt at D + 18.5 minutes plus its guard. The 35.75 minutes a stop's
- recovery adds is counted once (a stop ends the script). `ops unit stop --all` has its own row.
-- **The sum** at revision 3.1's attempts was 1524.25 minutes, over even the kit's 24-hour maximum.
- Three retries were cut (8.1's, the image deletes', and 8.7's second read), and the cap stays 23
- hours. The new sum is **1312.75 minutes (21 h 53)**, leaving 67 minutes.
-- **The hosts** are gone within **616 minutes (10 h 16)** of a trigger, or the script has stopped and
- asked Paul by **651.75 (10 h 52)**: 11 host-hours, about **$0.60**.
-- **Worst-case estimate** $32.93.
-- **Known limit:** a descendant that leaves the process group (`setsid`) is not stopped with it.
- OpenTofu and its providers do not do that.
+The scoped review (`p34-r4.md`) found the 8.0 table left out work done outside its allowances.
+Revision 3.2 gave `ops unit stop --all` its own row and cut three retries to fit the 23 hours: 8.1's,
+the image deletes' and 8.7's second read. Its deadline arithmetic (kit `d17fc5c4`, `4af781ec`) is
+superseded by revision 3.3: the deadline path it measured was removed from the kit.
## Revision 3.1 (after Astra's last round)
@@ -39,14 +53,13 @@ Astra's round 3 (`p34-r3.md`) found findings 1, 2 and 10 still open and two new
With the kit's after-cap commit `5b65ec54` (`kit-p34-report.md`, "After cap"):
1. **Teardown steps had no deadline** (finding 1). Every step in `teardown.sh` is now
- `ops block <id> --teardown --optional --max <D> -- bash "$P/teardown.sh" step <id>` (kit K12): past its deadline the block kills the
- step's process group, journals `DEADLINE`, reconciles any root it cut short and exits 1, which
- takes the step's one retry where it has one, and otherwise stops the script (`escalate`). 8.3 is
+ `ops block <id> --teardown --optional --max <D> -- bash "$P/teardown.sh" step <id>` (kit K12), so each step has a deadline (what
+ happens past it is revision 3.3's refusal). 8.3 is
split: 8.3a (terminate and unfence) and 8.3b (the services destroy), one retry each. Every
hand-run unit has `ops unit start <id> --max <bound> -- bash "$P/blocks/<id>.sh"`, so systemd ends it at its bound. 8.0's sum
with every retry was 21 h 18 min and the hosts were gone within 554.5 minutes of a trigger (both
- superseded by revision 3.2's measured arithmetic: 21 h 53 and 616 minutes), or the script
- has stopped and asked Paul.
+ superseded by revision 3.3: 18 h 11 and 505 minutes), or the script has stopped and asked
+ Paul.
2. **`vms adopt` classified late** (finding 2). The strike classifies `vms adopt` before it starts
`vms scan`.
10. **The reboot's timing** (finding 10). The strike passes `--not-after <strike_before>` (kit K13),
@@ -209,10 +222,10 @@ back to Paul.
**Spend** (section 9): the bill is expected at about **$1.80**, at most about $5. The run's own
estimate, which charges every admitted VM at four times the Large rate for 90 minutes, ends near
-**$26.68** to plan, with a proven worst case of **$32.93**. Self-stop **$40**; ceiling **$50**.
+**$26.68** to plan, with a proven worst case of **$32.82**. Self-stop **$40**; ceiling **$50**.
After a safe stop the armed teardown runs unattended: from its steps' deadlines the hosts are gone
-within 10 h 16 min of the trigger, at most about **$0.60** more, or it stops and asks Paul by
-10 h 52 min.
+within 8 h 25 min of the trigger, at most about **$0.49** more, or it stops and asks Paul by
+9 h 01 min. A stopped run leaves the hosts billing, about $0.80 a day, until he answers.
**Paul's own steps:** confirm the dev alert subscription (2.4, any time before 7.4); sign the
certificate (5.4, bounded 12 hours); confirm the test alert arrived (7.4, bounded 2 hours). Past the
@@ -1439,90 +1452,88 @@ Section 8 is one script, `$P/teardown.sh` (8.0), written and armed at 2.2b. It r
`upoll 8 1380`.
Inside, every step is `ops block <id> --teardown --optional --max <D> -- bash "$P/teardown.sh" step <id>`
-(revision 3.1, kit K12; revision 3.2, kit K14 to K17): the guard and the ledger's ownership run, the
-spend gate does not, any create refuses with 99, and **the step has a deadline**. Past it, the block:
-1. stops the step's whole process group: TERM, then up to 90 seconds for it to go (above OpenTofu's
- own 60), then KILL and up to 30 seconds more; a group not proved gone is a stop (99) and nothing is
- reconciled;
-2. reads the state lock of every root this block touched (a `TF-START` since the block's start) and
- releases only a lock this block's killed OpenTofu provably left (this user@host, created inside
- the block's window), journalled `FORCE-UNLOCK`; any other lock is a stop (99);
-3. reconciles only the roots this block was applying (`tf reconcile`, all within one 15-minute
- context, its last OpenTofu call killed 60 seconds after that), a safety error there being a stop
- (99);
-4. journals `DEADLINE` and exits 1.
-
-A killed step is not a resource gone: the reconcile records what state says, and `verify-gone`
-judges at the end. Exit 1 (an ordinary failure or the deadline) takes the step's one retry where it
-has one (`<id>.retry1`, same deadline). 8.1's 1 is a FINDING and the script goes on. Any other step's
-second 1, or a 1 from a step with no retry, stops the script (`escalate`: a FINDING,
-`ops report --stopped`, exit 99). 99 always stops: the block asks for recovery, which spares the
-continuation and does not start it again. Either way the run reports what still exists and its daily
-cost and asks Paul; that spend is not bounded until he answers. **Known limit:** a descendant that
-leaves the process group (for example through `setsid`) is not stopped with it; OpenTofu and its
-providers do not do that, and no step of this script does.
+(revision 3.1, kit K12; revision 3.3, kit `d77b505d`): the guard and the ledger's ownership run, the
+spend gate does not, any create refuses with 99, and **the step has a deadline**.
+- **Before the deadline** the step's own exit decides. 0 goes on. An ordinary failure, 1 (only an
+ `--optional` block returns it, and every block here is one), takes the step's one retry where it
+ has one (`<id>.retry1`, same deadline); 8.1's 1 is a FINDING and the script goes on; any other
+ step's second 1, or a 1 from a step with no retry, stops the script (`escalate`: a FINDING,
+ `ops report --stopped`, exit 99). The step's own 99 stops: the block asks for recovery, which
+ spares the continuation and does not start it again.
+- **Past the deadline the block only refuses:** it journals `DEADLINE`, exits 99, and stops,
+ unlocks, reconciles and recovers nothing. The script stops too: no retry, no further step. It
+ writes a FINDING and `report-stopped.md`, then waits, running nothing, until the stalled step's
+ process ends. That wait is what lets the stalled command run on: the unit is `KillMode=control-group`,
+ so systemd would stop everything left in it the moment the script ended. The unit's runtime cap,
+ 23 hours, ends the command if it has not finished by then.
+
+Either way a stop reports what still exists and its daily cost and asks Paul; that spend is not
+bounded until he answers (about $0.80 a day while the hosts stand, 8.0). A `DEADLINE` line or
+`report-stopped.md` means the run has stopped, even while its unit still shows `running`: the agent
+asks Paul and does not start section 8 again.
### 8.0 The script, and its bound
-The kit's measured worst case past a deadline (`kit-p34-report.md`, K14 to K17): an attempt that ends
-with exit 1 takes at most **D + 18.5 minutes** (2.5 to stop the group, 15 for the lock release and
-the reconcile, 1 for the last OpenTofu call); one that ends in a stop (99) at most **D + 54.25**, the
-recovery its hard path requests adding 35.75. Each attempt also opens with the block's guard (2). A
-stop ends the script, so at most one attempt in the whole run takes the extra 35.75: the table counts
-every attempt at D + 20.5 and adds that 35.75 once, as "the script's end" (it covers `escalate`'s 5
-too, which happens instead).
+Each attempt takes at most its deadline plus the block's guard (2 minutes): past the deadline the
+block refuses at once. A step's own 99 before its deadline adds the recovery the block asks for and
+waits on (35.75 minutes). A stop ends the script, so that is counted once, as "the script's end"; it
+covers the stop report (5), which happens instead after an `escalate` or a deadline.
| Step | What it runs (from the kit's bounds) | `--max` | Wall per attempt | Attempts | Budget |
| --- | --- | --- | --- | --- | --- |
| `ops unit stop --all` | outside any block's `--max`: up to four units (the watchdogs, a block) stopped at 90 s each | | 6 m | 1 | 6 m |
-| 8.1 | staging off: five `carlos` calls | 20m | 40.5 m | 1 (its 1 is a FINDING) | 40.5 m |
-| 8.2 | `ops fence` (guard 2, attach and read 2, host stop 10), `vms reconcile` (5), each image's settle with its repeat (41; two images 82), `ledger reconcile` (5): 108 | 110m | 130.5 m | 1 | 130.5 m |
-| 8.3a | `controller terminate` (12), `unfence` (5), its one repeat (fence 14, settles 82, unfence 5): 118 | 120m | 140.5 m | 2 | 281 m |
-| 8.3b | the services destroy (30), `tf reconcile` on its failure (10): 40 | 40m | 60.5 m | 2 | 121 m |
-| 8.4.1, 8.4.2 | one image delete each (`-timeout 15m`, plus guard, STS and reads: 20) | 20m | 40.5 m | 1 each | 81 m |
-| 8.5 | `connector delete` (its 120-minute budget, then reads) | 130m | 150.5 m | 1 | 150.5 m |
-| 8.6 | three bucket empties (7 each), the config destroy (30) and its reconcile on failure (10), the network the same (40): 101 | 105m | 125.5 m | 2 | 251 m |
-| 8.7 | `verify-gone` (about 90 direct reads at up to 60 s: 90), the state bucket's empty and delete (10), `verify-gone --all` (90), `estimate` (5): 195 | 195m | 215.5 m | 1 | 215.5 m |
-| the script's end | one stop's recovery (35.75), or `escalate` (5) | | | 1 | 35.75 m |
-| **Sum** | | | | | **1312.75 m = 21 h 53 min** |
-
-**What revision 3.2 cut to fit.** At revision 3.1's attempts, the same arithmetic gives 1524.25
-minutes, over the continuation's 23 hours and over the kit's 24-hour maximum too, so raising the cap
-could not fit them. Three retries were cut instead:
-- **8.1's retry.** Its deadline is now a FINDING and the script goes on: turning hosted work off on
- staging destroys nothing in AWS, and section S's S.1 has already tried it.
+| 8.1 | staging off: five `carlos` calls | 20m | 22 m | 1 (its 1 is a FINDING) | 22 m |
+| 8.2 | `ops fence` (guard 2, attach and read 2, host stop 10), `vms reconcile` (5), each image's settle with its repeat (41; two images 82), `ledger reconcile` (5): 108 | 110m | 112 m | 1 | 112 m |
+| 8.3a | `controller terminate` (12), `unfence` (5), its one repeat (fence 14, settles 82, unfence 5): 118 | 120m | 122 m | 2 | 244 m |
+| 8.3b | the services destroy (30), `tf reconcile` on its failure (10): 40 | 40m | 42 m | 2 | 84 m |
+| 8.4.1, 8.4.2 | one image delete each (`-timeout 15m`, plus guard, STS and reads: 20) | 20m | 22 m | 1 each | 44 m |
+| 8.5 | `connector delete` (its 120-minute budget, then reads) | 130m | 132 m | 1 | 132 m |
+| 8.6 | three bucket empties (7 each), the config destroy (30) and its reconcile on failure (10), the network the same (40): 101 | 105m | 107 m | 2 | 214 m |
+| 8.7 | `verify-gone` (about 90 direct reads at up to 60 s: 90), the state bucket's empty and delete (10), `verify-gone --all` (90), `estimate` (5): 195 | 195m | 197 m | 1 | 197 m |
+| the script's end | a step's own 99: the recovery it asks for (35.75); or the stop report (5) | | | 1 | 35.75 m |
+| **Sum** | | | | | **1090.75 m = 18 h 11 min** |
+
+**What revision 3.2 cut, and why it stays cut.** Revision 3.2 cut three retries to fit arithmetic
+that revision 3.3 replaced; the ruling keeps retries only where the plan has them, so they stay cut:
+- **8.1's retry.** Its ordinary failure is a FINDING and the script goes on: turning hosted work off
+ on staging destroys nothing in AWS, and section S's S.1 has already tried it.
- **The image deletes' retries.** A failure escalates after the hosts are gone; what is left (an
image) has no hourly charge, only storage.
- **8.7's second read of `verify-gone`.** A tag index that does not read escalates after everything
is torn down.
-The cap stays at `--max 23h` (1380 minutes): **67 minutes** for cleanup and slack, under the kit's
-24-hour cap. Every step's deadline is enforced, so the script cannot run into `RuntimeMaxSec` with a
-step inside a stalled call. From a trigger (a watchdog's deadline or a failed block), the
-continuation starts within about 31 minutes plus 90 seconds per running unit (at most four here:
-about 37), and ends within 23 hours plus a 5-minute stop: **about 23 h 42 min end to end**.
+The cap stays at `--max 23h` (1380 minutes): **289.25 minutes** to spare while the script is running
+steps. Past 18 h 11 the unit can be running only because a stop is holding it for a stalled step,
+and the cap ends that. From a trigger (a watchdog's deadline or a failed block), the continuation
+starts within about 31 minutes plus 90 seconds per running unit (at most four here: about 37), and
+ends within 23 hours plus a 5-minute stop: **about 23 h 42 min end to end**.
**When the hosts are gone, from the deadlines.** The controller is terminated in 8.3a and the proxies
-in 8.3b's destroy. So the hosts are gone, at the latest, 37 + 6 (`unit stop --all`) + 40.5 (8.1) +
-130.5 (8.2) + 281 (8.3a, two attempts) + 121 (8.3b, two attempts) = **616 minutes, 10 h 16 min after
-the trigger**. Otherwise the script has stopped and asked Paul by **651.75 minutes (10 h 52 min)**,
-the same plus one stop's recovery: 8.2 past its deadline, 8.3a or 8.3b failing twice, or a stop on
-the way. Bounded, that is at most **11 host-hours in the estimate, about $0.60**. Image storage is
-already charged at its one-week minimum; the buckets, the connector and the topic cost pennies. After
-an escalation before 8.3b finishes, the proxies, the addresses and the volumes stay (about $0.80 a
-day, the controller already stopped by the fence) until Paul answers.
-
-**Where the retries go (the coordinator's ruling).** 8.3a has one because a stall there leaves the
-billable hosts up. 8.5, the connector delete, has none: by then 8.3b has destroyed the hosts and
+in 8.3b's destroy. So the hosts are gone, at the latest, 37 + 6 (`unit stop --all`) + 22 (8.1) + 112
+(8.2) + 244 (8.3a, two attempts) + 84 (8.3b, two attempts) = **505 minutes, 8 h 25 min after the
+trigger**: at most **9 host-hours in the estimate, about $0.49**. Otherwise the run has stopped and is
+asking Paul by **540.75 minutes (9 h 01 min)**, the same plus one stop's recovery: a deadline
+anywhere, 8.2 failing, 8.3a or 8.3b failing twice, or a stop on the way.
+
+**A stopped run is not bounded.** If a deadline stopped it, the stalled command may still be running,
+under the unit's 23-hour cap. Until Paul answers, whatever stands keeps billing. Stopped before 8.3b
+finishes, the hosts stay: **about $0.80 a day** (the two proxies, the controller's address and volume;
+the controller itself stopped by S.2's or 8.2's fence), $1.31 a day if a run by hand stops in 8.1 or
+in 8.2 before its fence, about $1.15 a day for the whole run with the image's storage. Image storage
+is already charged at its one-week minimum; the buckets, the connector and the topic cost pennies.
+
+**Where the retries go (the coordinator's ruling).** 8.3a has one because a failure there leaves
+the billable hosts up (a retry follows only an ordinary failure, never a deadline). 8.5, the connector delete, has none: by then 8.3b has destroyed the hosts and
released their addresses, so a stuck connector leaves only network pieces with no hourly charge (the
connector, which has no listed charge (Task 17b), its interfaces, the VPCs, subnets, peering, route
tables, gateway, security groups and roles), plus the buckets at a few cents a month. The script then
-stops and asks Paul, and nothing bills by the hour meanwhile. Revision 3.2 cut three more retries to
-fit the measured deadline arithmetic (8.0): 8.1's, the image deletes' and 8.7's second read.
+stops and asks Paul, and nothing bills by the hour meanwhile. Revision 3.2 cut three more (8.1's,
+the image deletes' and 8.7's second read); they stay cut.
```sh
set -euo pipefail; P='<P printed by 0.1>'; . "$P/run.env"
if [ "${1:-}" = step ]; then
+ printf '%s\n' "$$" > "$P/teardown-step.pid"
case "$2" in
8.1)
S=(--app equipo-staging --account bds --console https://console.carloku.com)
@@ -1622,42 +1633,59 @@ if [ "${1:-}" = step ]; then
exit 0
fi
escalate() { ops finding "teardown stopped: $1"; ops report --stopped --out "$P/report-stopped.md"; exit 99; }
+held() { local pid; pid=$(cat "$P/teardown-step.pid" 2>/dev/null || true); while [ -n "$pid" ] && grep -qs teardown.sh "/proc/$pid/cmdline"; do sleep 60; done; }
+past_deadline() { awk -F'\t' -v s="BLOCK $1 start" -v d="DEADLINE block=$1 " 'index($2, s) == 1 {f = 0} index($2, d) == 1 {f = 1} END {exit !f}' "$P/journal.tsv"; }
+refused() {
+ if [ "$2" != 99 ]; then return 0; fi
+ if past_deadline "$1"; then
+ ops finding "teardown stopped: $1 passed its deadline; its command runs on, nothing was stopped"
+ ops report --stopped --out "$P/report-stopped.md"
+ held
+ fi
+ exit 99
+}
ops unit stop --all
set +e
ops block 8.1 --teardown --optional --max 20m -- bash "$P/teardown.sh" step 8.1
rc=$?
set -e
+refused 8.1 "$rc"
ordinary "$rc"
-if [ "$rc" = 1 ]; then ops finding "8.1 did not finish within its deadline, staging may still have hosted work on, which destroys nothing"; fi
+if [ "$rc" = 1 ]; then ops finding "8.1 failed (exit 1): staging may still have hosted work on, which destroys nothing"; fi
set +e
ops block 8.2 --teardown --optional --max 110m -- bash "$P/teardown.sh" step 8.2
rc=$?
set -e
+refused 8.2 "$rc"
ordinary "$rc"
-if [ "$rc" = 1 ]; then escalate "8.2 did not finish within its deadline"; fi
+if [ "$rc" = 1 ]; then escalate "8.2 failed (exit 1)"; fi
set +e
ops block 8.3a --teardown --optional --max 120m -- bash "$P/teardown.sh" step 8.3a
rc=$?
set -e
+refused 8.3a "$rc"
ordinary "$rc"
if [ "$rc" = 1 ]; then
set +e
ops block 8.3a.retry1 --teardown --optional --max 120m -- bash "$P/teardown.sh" step 8.3a
rc=$?
set -e
+ refused 8.3a.retry1 "$rc"
ordinary "$rc"
- if [ "$rc" = 1 ]; then escalate "terminate and unfence did not finish twice"; fi
+ if [ "$rc" = 1 ]; then escalate "terminate and unfence failed twice"; fi
fi
set +e
ops block 8.3b --teardown --optional --max 40m -- bash "$P/teardown.sh" step 8.3b
rc=$?
set -e
+refused 8.3b "$rc"
ordinary "$rc"
if [ "$rc" = 1 ]; then
set +e
ops block 8.3b.retry1 --teardown --optional --max 40m -- bash "$P/teardown.sh" step 8.3b
rc=$?
set -e
+ refused 8.3b.retry1 "$rc"
ordinary "$rc"
if [ "$rc" = 1 ]; then escalate "the services destroy failed twice"; fi
fi
@@ -1667,33 +1695,38 @@ if [ -n "$I1" ]; then
ops block 8.4.1 --teardown --optional --max 20m -- bash "$P/teardown.sh" step 8.4 "$I1"
rc=$?
set -e
+ refused 8.4.1 "$rc"
ordinary "$rc"
- if [ "$rc" = 1 ]; then escalate "the first image's delete did not finish (the hosts are already gone)"; fi
+ if [ "$rc" = 1 ]; then escalate "the first image's delete failed (the hosts are already gone)"; fi
fi
if [ -n "$I2" ]; then
set +e
ops block 8.4.2 --teardown --optional --max 20m -- bash "$P/teardown.sh" step 8.4 "$I2"
rc=$?
set -e
+ refused 8.4.2 "$rc"
ordinary "$rc"
- if [ "$rc" = 1 ]; then escalate "the second image's delete did not finish (the hosts are already gone)"; fi
+ if [ "$rc" = 1 ]; then escalate "the second image's delete failed (the hosts are already gone)"; fi
fi
set +e
ops block 8.5 --teardown --optional --max 130m -- bash "$P/teardown.sh" step 8.5
rc=$?
set -e
+refused 8.5 "$rc"
ordinary "$rc"
-if [ "$rc" = 1 ]; then escalate "the connector delete did not finish (no retry: what it leaves has no hourly charge)"; fi
+if [ "$rc" = 1 ]; then escalate "the connector delete failed (no retry: what it leaves has no hourly charge)"; fi
set +e
ops block 8.6 --teardown --optional --max 105m -- bash "$P/teardown.sh" step 8.6
rc=$?
set -e
+refused 8.6 "$rc"
ordinary "$rc"
if [ "$rc" = 1 ]; then
set +e
ops block 8.6.retry1 --teardown --optional --max 105m -- bash "$P/teardown.sh" step 8.6
rc=$?
set -e
+ refused 8.6.retry1 "$rc"
ordinary "$rc"
if [ "$rc" = 1 ]; then escalate "the buckets or a destroy failed twice"; fi
fi
@@ -1701,13 +1734,14 @@ set +e
ops block 8.7 --teardown --optional --max 195m -- bash "$P/teardown.sh" step 8.7
rc=$?
set -e
+refused 8.7 "$rc"
ordinary "$rc"
-if [ "$rc" = 1 ]; then escalate "8.7 did not finish within its deadline"; fi
+if [ "$rc" = 1 ]; then escalate "8.7 failed (exit 1)"; fi
echo "section 8 done; 8.8 is the agent's"
```
**What each step does.** 8.1 turns hosted work off on staging (an unset of a variable never set is a
-FINDING; 1.2 showed what it does; its deadline is a FINDING too, and the script goes on). 8.2's fence attaches `deny_launches` and stops the controller
+FINDING; 1.2 showed what it does; its ordinary failure is a FINDING too, and the script goes on). 8.2's fence attaches `deny_launches` and stops the controller
host; each settle terminates every known VM, proves the image clear by three scans and a direct read
of each known ID, and repeats after 10 minutes; a VM live past a bound stops (99). 8.3a:
`controller terminate` reads every controller host back `terminated`; `unfence` detaches
@@ -1721,8 +1755,8 @@ deletes only a recorded image and takes one already gone as done, so a later re-
ordinary failure escalates (no retry since revision 3.2: the hosts are gone by then); 4 stops.
8.5 is the connector's first real interface cleanup: on `DELETE_FAILED`, one retry with the
managed-operator condition dropped; interfaces left after the delete are waited for within the same
-120-minute budget and never deleted by hand; 1 (while the connector is still recorded, or the
-deadline) stops the script and asks Paul (no retry: what it leaves has no hourly charge), 99
+120-minute budget and never deleted by hand; 1 (while the connector is still recorded) stops the
+script and asks Paul (no retry: what it leaves has no hourly charge), 99
(interfaces not proved gone after the delete) stops. 8.6
empties the buckets by their fixed names: a recorded bucket a direct read shows gone is done
(`DELETED ... read-gone`, kit K11), so `8.6.retry1` after a partial config destroy goes on to the
@@ -1790,31 +1824,32 @@ Builds: one, plus one only if the step-down runs.
| | Expected (to plan) | Worst case |
| --- | --- | --- |
-| Hosts | 9 h × $0.054692 = $0.49 | 37 h × $0.054692 = $2.02 |
+| Hosts | 9 h × $0.054692 = $0.49 | 35 h × $0.054692 = $1.91 |
| VMs and VM reservations | 12 × $1.86 = $22.32 | 13 × $1.86 = $24.18 (a late VM found by a settle repeat) |
| Image builds | 1 × $1 = $1.00 | 2 × $1 = $2.00 (the step-down) |
| Image storage | 1 × $1.87 | 2 × $1.87 = $3.73 (the step-down image) |
| S3, SNS, alarms | $1.00 | $1.00 |
-| **Estimate** | **$26.68** | **$32.93** |
+| **Estimate** | **$26.68** | **$32.82** |
Host hours, from the services apply to the hosts' termination. Expected: up and status 0.75,
certification 1, signing 2, wiring 0.25, three scenarios 1.5, two drills 1.5, the alert 0.5,
teardown to termination 1.25: 8.75, rounded up to 9. Worst, every step at its bound: up and status
0.85 (4.2 25 minutes, 4.3 25), certification 1.1 (5.1 25, 5.2 40), the signing bound 12, wiring
0.25, three watchers 5.25 (105 minutes each), 7.0 and two drills 4.4 (10, 135, 110), the alert bound
-2, then the alert watchdog's trigger and the continuation to 8.3b's end, 10.27 (8.0): 36.12,
-rounded up to 37.
+2, then the alert watchdog's trigger and the continuation to 8.3b's end, 8.42 (8.0): 34.27,
+rounded up to 35.
**After a trigger** (a watchdog's expiry or a failed block, from 2.2b on): the continuation ends
-the hosts within 616 minutes (from the steps' measured deadlines), at most **11 host-hours, about
-$0.60**, added to the estimate at the
+the hosts within 505 minutes (from the steps' deadlines), at most **9 host-hours, about
+$0.49**, added to the estimate at the
trigger; nothing else grows (no VM runs after S.4, and image storage is already charged at its
minimum). The worst case above already contains the latest trigger. The continuation itself ends
within about 23 h 42 min. The exceptions are a guard failure, a failed credential check at the
-trigger (2.2b's known limit) and a teardown step that stops: then about $1.15 a day on the bill until
-Paul answers.
+trigger (2.2b's known limit) and a teardown step that stops or passes its deadline (its command
+may run on under the unit's 23-hour cap): then the hosts bill about $0.80 a day, about $1.15 a day
+for the whole run, until Paul answers.
-**Self-stop $40** leaves $7.07 over the worst case: three unplanned VMs. **Ceiling $50**: the stop is
+**Self-stop $40** leaves $7.18 over the worst case: three unplanned VMs. **Ceiling $50**: the stop is
checked only when a block or reservation starts, and the estimate leaves out the connector, the
state bucket and data transfer. Teardown is never refused on spend.
@@ -1850,10 +1885,10 @@ bills its full week.
| `cert bundle` (with and without `-empty`) and `cert reload` | 5.4b, 7.2 | skip, FINDING; a withdrawal not acknowledged in the window is not judged |
| the dev alert subscription and a real alert email | 2.4, 7.4 | FINDING; PASSED needs it |
| `ops fence`, `ops controller terminate`, `ops unfence` | 8.2, 8.3a | unfence: one repeat of fence and settle; then stop |
-| teardown step deadlines (`--max` on each teardown block) | 8.0 | the group stopped (else 99), only our own stale locks released (else 99), the touched roots reconciled, `DEADLINE`, exit 1 (at most D + 18.5 min); its one retry where it has one, 8.1's a FINDING, else `escalate`; a stop at most D + 54.25 |
+| teardown step deadlines (`--max` on each teardown block) | 8.0 | past it: `DEADLINE`, 99; nothing stopped, unlocked or reconciled, no recovery; the script writes a FINDING and `report-stopped.md`, runs no further step and no retry, and holds its unit while the stalled step runs (cap 23 h); Paul decides |
| `tf` destroys | 8.3b, 8.6 | 1: reconciled in the step, then the step's retry; 99: stop |
-| `img delete` with `-ledger`, one block per image | 8.4.1, 8.4.2 | ordinary or the deadline: escalate (the hosts are gone); 4: stop |
-| the connector's interface cleanup | 8.5 | 1: stop and ask Paul (no retry; nothing left bills by the hour); 99: stop |
+| `img delete` with `-ledger`, one block per image | 8.4.1, 8.4.2 | ordinary: escalate (the hosts are gone); 4 or the deadline: stop |
+| the connector's interface cleanup | 8.5 | 1: stop and ask Paul (no retry; nothing left bills by the hour); 99 or the deadline: stop |
| resumable bucket teardown | 8.6, 8.7 | a recorded bucket already gone is done; another owner: stop |
| `verify-gone` with the strict tag cross-check | 8.7 | 1: escalate; 99: report and ask Paul (R9) |
diff --git a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
index 14d1536f..b7613b72 100644
--- a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
@@ -4140,3 +4140,30 @@ Mutation checks (`-run 'TestBlockDeadlineRefuses|TestBlockMaxBeforeTheDeadline'`
- **C3** recovery requested at the deadline: FAILED `:67 [--teardown]: the deadline did more than refuse (RECOVERY)`.
- **C4** the deadline made 1: FAILED `:58 ... = 1, want 99`.
- **C5** no DEADLINE line: FAILED `:60 [--teardown]: no DEADLINE refusal`.
+
+## Task 34 revision 3.3 (coordinator's ruling: a block deadline only refuses, kit d77b505d)
+
+Section 8 follows the cut: past a block's `--max` the block journals `DEADLINE`, exits 99 and stops,
+unlocks, reconciles and recovers nothing. In `teardown.sh` a deadline now stops the run (no retry, no
+further step): `refused ID "$rc"` after each block finds the `DEADLINE` line since that block's latest
+start, writes a FINDING and `report-stopped.md`, then holds the unit (`held`) until the stalled
+step's process (its PID in `teardown-step.pid`) ends. The hold is needed because the kit starts units
+with `KillMode=control-group`: if the script exited, systemd would stop the stalled command with it.
+The unit's 23-hour cap is the backstop. A step's own 99 still exits 99 (the block already asked for
+recovery). Retries stay only on an ordinary 1, where the plan had them (8.3a, 8.3b, 8.6). Every
+mention of group kill, force-unlock and post-deadline reconcile is gone; revision 3.2's notes now
+point to 3.3.
+
+8.0 counts each attempt at D plus the 2-minute guard, plus one stop's recovery (35.75) at the end:
+1090.75 minutes (18 h 11), 289.25 minutes inside the 23 hours. From a trigger the hosts are gone
+within 505 minutes (8 h 25; 9 host-hours, about $0.49), or the run has stopped and is asking Paul by
+540.75 (9 h 01). A stopped run is not bounded: its stalled command may run on under the 23-hour cap,
+and the hosts bill about $0.80 a day until Paul answers. Worst-case estimate $32.82 (35 host-hours),
+self-stop margin $7.18.
+
+Green: the three plan-parse tests, `make budget`, `bash -n` on all 32 `sh` blocks and the quoted
+`run.env`. Stub run: teardown in order; 8.1's ordinary 1 a FINDING, then on; 8.1 past its deadline:
+FINDING, report, the unit held while the stalled step ran (2 s), exit 99, no 8.2; 8.3a's ordinary 1
+retried, then on; 8.3a past its deadline: no retry, exit 99; 8.3a.retry1 past its deadline: exit 99;
+8.4.1's 1 escalates; 8.2's own 99 exits 99 with no report and no hold; an older `DEADLINE` for 8.6
+before its latest start is ignored.