oficina / equipo Public

plans: Task 34 rev 1.1, re-run a failed apply, cert bundle -empty

The coordinator's rulings on revision 1's open questions 2 and 3: 2.3,
2.4 and 4.1 re-run a failed apply once (plan-check now accepts no-ops
for what state holds) before the reconcile and the skip to teardown; the
discovery step after 2.3 stays the refresh-only reconcile, which a no-op
re-apply does not beat on cost; 7.2 withdraws with cert bundle -empty.
The progress file records the plan-check and bundle mutations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev abd527b43c86aadc61337e0c7cb4737ceeea4534 parent 9fa794e
2 files changed, +96 −24
  • docs/superpowers/plans/2026-12-01-hosted-2-dev-live-plan.md +52 −24
  • docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md +44 −0

CI failed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/hosted-runners-2: Type  Size Avail | ext4   96G   84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: image pulled in 9.7s
ci-box: claude: fetched and verified in 9.8s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
ci-box: tofu: fetched and verified in 1.5s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: pi: installed and verified in 7.1s
ci-box: opencode: installed and verified in 2.2s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.6s
ci-box: clone deepened in 5.2s
ci-box: file times set from content: 4056 files, 303 directories
ci-box: ready in 24.8s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
--- FAIL: TestReleaseCopyReviewed (0.09s)
    task_pages_test.go:236: COPY REVIEW REQUIRED: copy-status.py verify found copy pending review or stale bookkeeping
FAIL
rastrillo-budget/v1 ran 88ms
FAIL	amadan.net/oficina/equipo/internal/equipotest	0.239s
FAIL
make: *** [Makefile:324: copy-release-check] Error 1

amadan: step copy failed: exit status 2

amadan: job failed at step copy — its output is above, not at the tail of this log
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 b644be90..89c94857 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,6 +1,7 @@
# Hosted runners slice 2, Task 34: the dev drill in `kass` (for Paul's GO)
-**Revision:** 1 (2026-12-01), in Fable's shape (`.superpowers/sdd/2026-11-30-hosted-runners-slice-2/fable-34.md`)
+**Revision:** 1.1 (2026-12-01; revision 1 plus the coordinator's rulings on `plan-check.py` and
+`cert bundle`'s `-empty`, below), in Fable's shape (`.superpowers/sdd/2026-11-30-hosted-runners-slice-2/fable-34.md`)
with the coordinator's rulings; next Astra (three rounds at most), then Paul's one GO. **No AWS
command or SDK call of any kind was made while writing it, not even a read.** It keeps Task 17b's
shape (`2026-11-30-hosted-1a-task17b-live-plan.md`): hard stops only for safety, `FINDING:` lines
@@ -45,11 +46,22 @@ ahead of the production bring-up (`2026-11-30-hosted-prod-account-plan.md`, "the
the retries of two of the three checks unadmitted, and a refused reservation mid-drill skips the
rest).
- **Fable 6, cheap discovery:** the rehearsal; `inventory` and `quota`; after 2.3,
- `ops tf reconcile network` (a refresh-only plan, $0). **Not** Fable's no-op re-apply:
- `plan-check.py`'s create phase accepts only the `create` action (`check_creates`), so a re-apply
- of an applied root is refused with exit 99. For the same reason a partially applied root cannot be
- completed, only reconciled and destroyed: a failed apply skips to teardown (draft-notes).
+ `ops tf reconcile network` (a refresh-only plan, $0), kept over Fable's no-op re-apply (see 1.1).
- **5.4b reads the journal for `WAIT-EXPIRED` first** (Fable 4).
+
+**Revision 1.1** (the coordinator's rulings on revision 1's open questions 2 and 3):
+- **A failed apply is re-run once** (2.3, 2.4, 4.1), as Fable suggested, before the fallback of
+ `ops tf reconcile` and skip to teardown. `plan-check.py` now lets a create phase plan `no-op` for
+ what the prior state holds (commit `d0650708`; tested on a genuine partly applied network plan;
+ update, replace and delete stay refused), so the re-run plans creates for what is missing and
+ no-ops for the rest.
+- **The discovery step after 2.3 stays the refresh-only reconcile.** A no-op re-apply now passes
+ `plan-check.py`, but it is not cheaper: it runs the same refresh, then `show`, `plan-check.py`, an
+ apply of an empty plan and the outputs, and a provider-computed value that drifts shows as an
+ `update`, which `plan-check.py` refuses with exit 99. The reconcile reads the same state with
+ neither cost. The no-op rule gets its first real run in the failed-apply branch, if one fails.
+- **7.2 withdraws the certificate with `cert bundle`'s new `-empty`** (commit `9fa794e8`) instead of a
+ hand-written file.
- **Drills the kit cannot run** (coordinator): proxy kill, VM stop mid-step, orphan, launch refused
while fenced are NOT RUN, each a FINDING, listed for slice 3 or the production rehearsal (7.3).
- **Resolver and metadata** (coordinator): a standing FINDING "unconfirmed" (5.3, section 11).
@@ -84,8 +96,8 @@ terminate, unfence and `verify-gone`; anything outside the ledger. **Everything
(section 8), pre-approved: teardown is the safe direction, and waiting costs money.
**Pre-approved fallbacks:** one base image version down, once (3.3); `ops ledger reconcile` before
-any skip in 3.3; after a failed apply, one `ops tf reconcile` (adoption runs there if it is needed)
-and a skip to teardown; per root in section 8, one `ops tf reconcile` and one re-destroy; inside
+any skip in 3.3; after a failed apply, one re-run of the apply (creates plus no-ops for what state
+holds), then one `ops tf reconcile` (adoption runs there if it is needed) and a skip to teardown; per root in section 8, one `ops tf reconcile` and one re-destroy; inside
`ops connector delete`, its retry with the managed-operator condition dropped; one repeat of 8.2
inside 8.4 if unfence refuses; buckets emptied by their fixed names; one re-run of a block that
failed on a read; `ops safe-stop` again after its bound. Guarded, read-only calls on this run's own
@@ -381,11 +393,15 @@ ops estimate --stop 40
set +e
ops tf network dev-network
rc=$?
-set -e
if [ "$rc" != 0 ]; then
ops fact "network apply" "exit $rc" "exit 0"
+ ops tf network dev-network
+ rc=$?
+fi
+set -e
+if [ "$rc" != 0 ]; then
ops tf reconcile network
- skip_to_teardown "the network apply failed"
+ skip_to_teardown "the network apply failed twice"
exit 0
fi
ops assert network
@@ -398,11 +414,15 @@ set -e
The checked plan creates the VM VPC with DNS off, the services VPC, the peering, the routes, the VM
security group (egress only to the proxies on 8443 and 8444, no ingress), the NACLs and the
-connector's operator role. `ops assert network` is fatal. A failed apply is reconciled (a resource
-created outside state is adopted there, through a run-local import block) and skipped to teardown,
-which destroys from state: `plan-check.py` accepts only `create` in a create phase, so a partial
-apply cannot be completed. The last step is the $0 discovery Fable asked for, a refresh-only
-reconcile of the applied root: init, the refresh plan and the ledger lookups on real state.
+connector's operator role. `ops assert network` is fatal. A failed apply is re-run once: its plan
+is creates for what is missing and no-ops for what the state holds, which `plan-check.py` accepts
+(nothing updated, replaced or deleted; a known reference must equal its target in state). A second
+failure is reconciled (a resource created outside state is adopted there, through a run-local
+import block) and skipped to teardown, which destroys from state. The last step is the $0
+discovery Fable asked for, a refresh-only reconcile of the applied root: init, the refresh plan and
+the ledger lookups on real state. A no-op re-apply would now pass `plan-check.py` too, but it is
+not cheaper (the same refresh, then `show`, `plan-check.py`, an empty apply and the outputs) and a
+provider-computed value that drifts would show as an `update`, which is refused with exit 99.
### 2.4 Config, and the alert subscription (unit, bound 15m)
@@ -413,11 +433,15 @@ ops estimate --stop 40
set +e
ops tf config dev-config
rc=$?
-set -e
if [ "$rc" != 0 ]; then
ops fact "config apply" "exit $rc" "exit 0"
+ ops tf config dev-config
+ rc=$?
+fi
+set -e
+if [ "$rc" != 0 ]; then
ops tf reconcile config
- skip_to_teardown "the config apply failed"
+ skip_to_teardown "the config apply failed twice"
exit 0
fi
ops wait-human sns-confirmed --max 24h --background
@@ -542,11 +566,15 @@ ops tfvars --add-image "$P/image.json" --add-connector
set +e
ops tf services dev-services
rc=$?
-set -e
if [ "$rc" != 0 ]; then
ops fact "services apply" "exit $rc" "exit 0"
+ ops tf services dev-services
+ rc=$?
+fi
+set -e
+if [ "$rc" != 0 ]; then
ops tf reconcile services
- skip_to_teardown "the services apply failed"
+ skip_to_teardown "the services apply failed twice"
fi
```
@@ -893,7 +921,7 @@ ends: `ops vms settle --image "$IMAGE_ARN" --max 10m`, then
set -euo pipefail; P='<P printed by 0.1>'; . "$P/run.env"
if skipped; then exit 0; fi
CTL="https://$(tfo services controller_public_ip)"; PIN_HEX=$(cat "$P/controller.pin")
-printf '{"certificates":[]}\n' > "$P/no-certificates.json"
+cert bundle -cert-keys "$P/cert-keys.json" -empty -out "$P/no-certificates.json"
ops object put --bucket equipo-hosted-dev-config-640012953448 --key controller/certificates.json --file "$P/no-certificates.json"
set +e
cert reload -controller "$CTL" -controller-tls-pin "$PIN_HEX" -controller-pub "$P/keys/controller.pub" -operator-id operator -operator-key "$P/keys/operator.key"
@@ -902,8 +930,8 @@ set -e
[ "$rc" = 0 ] || ops fact "withdrawing the certificate" "cert reload exit $rc" "exit 0"
```
-The empty set is written by hand: `cert bundle` needs at least one certificate (section 11).
-Expected (`TestChainCertWithdrawnMidStep`):
+`cert bundle` with `-empty` writes the empty set, `{"certificates":[]}` (without `-empty`, a set with no
+certificate is refused). Expected (`TestChainCertWithdrawnMidStep`):
the running job fails `uncertified`, its VM stopped with proof, and **its result is not kept**: the
step does not pass, has no sandbox and no base checks. Placed again once, the controller launches
nothing for it, and after the launch window it ends `cannot_run` `hosted_unavailable`. When the
@@ -1191,7 +1219,8 @@ every VM bursts at 4x and storage bills its full week.
| `carlos` under `env -i` | 0.1, then 1.2 from a unit | abort; FINDING |
| the recovery unit (lock, membership, safe stop, S.1's carlos) | 1.2, own run | abort if it never runs or ends; problems are FINDINGs |
| refresh-only reconcile on real state | 2.3 | FINDING |
-| OpenTofu import adoption | after a failed apply (2.3, 2.4, 4.1), in its reconcile, then in the destroy | an adoption plan refusal is a hard stop; unexercised if nothing fails (recorded) |
+| a re-apply after a failed apply (creates plus no-ops) | 2.3, 2.4, 4.1, only if an apply fails | a second failure: reconcile, skip; unexercised if nothing fails (recorded) |
+| OpenTofu import adoption | after a second failed apply, in its reconcile, then in the destroy | an adoption plan refusal is a hard stop; unexercised if nothing fails (recorded) |
| the default VPC's gateway as `PRE-RUN` | 1.1, used by any network reconcile | an unaccounted gateway: hard stop |
| AWS's build on base version 4, with the 23 + 5 RPMs | 3.3 | step down once; then skip |
| the hosted bubblewrap and containment suite on a real MicroVM | 5.2, 5.3 | skip |
@@ -1201,7 +1230,7 @@ every VM bursts at 4x and storage bills its full week.
| the estimate's scan retry | every block | an incomplete scan after 3 minutes: hard stop |
| Litestream install and restore check | 3.1, 4.3 | install: skip (digest); check: FINDING |
| `ops controller reboot`, waiting for the host to go away | 5.1, 7.1 | 5.1 skip; 7.1 hard stop |
-| `cert bundle` and `cert reload` | 5.4b, 7.2 | skip, FINDING |
+| `cert bundle` (with and without `-empty`) and `cert reload` | 5.4b, 7.2 | skip, FINDING |
| 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.4 | unfence: one repeat of 8.2; then hard stop |
| `tf` destroys | 8.4, 8.6 | one reconcile and one re-destroy; then hard stop |
@@ -1217,7 +1246,6 @@ every VM bursts at 4x and storage bills its full week.
probe does not exist: it would need a VPC with DNS on, or a role on the VM.
- How long a reboot keeps the controller away (5.1 records it), and whether 7.1's step needs its
retry.
-- `cert bundle` refuses an empty set, so 7.2 writes the empty set with `printf`. Should it allow one?
- Ireland rates for MicroVMs, `t4g` hosts and image storage; the bill confirms them.
- Whether a failed image build leaves an image AWS charges storage for (the estimate assumes yes).
- The suite's hosted scenarios (prerequisite 4) do not exist yet.
diff --git a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
index d29f57af..77020981 100644
--- a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
@@ -3485,3 +3485,47 @@ Found while writing (in draft-notes.md): `plan-check.py`'s create phase accepts
partially applied root cannot be completed by `ops tf`, only reconciled and destroyed. The plan uses
a refresh-only `ops tf reconcile network` as the $0 discovery step and skips to teardown after a
failed apply.
+
+## Task 34 revision 1.1: the coordinator's rulings on questions 2 and 3 (2026-12-01)
+
+**plan-check.py, no-op in a create phase** (commit d0650708). A create phase now accepts `no-op` for
+an address the prior state holds, alongside `create`; update, replace and delete stay refused; a
+no-op not in the prior state, an import, or a prior-state resource the phase does not list is
+refused. On a re-plan, values become known: a `ref` pin may be known only when its target is held in
+state (listed, no-op, in the prior state), proven from the source as before and equal to the
+target's value there; a policy with `unknown_refs` that is known has each ref replaced by its held
+target's value before comparing; an `unset` pin on a held resource is judged by the configuration
+alone (AWS fills a peering's `peer_owner_id` in after create). The genuine fixture
+`plan-prod-network-partial.json` comes from `make_plan_fixtures.py`: a state holding the network
+plan's VPCs, subnets, gateway, peering and role (references linked to the referenced resource's
+placeholder, `link_references`), planned with `-refresh=false`: 24 creates and 8 no-ops. Red first:
+the new `PartialApply` tests failed three (the partial plan refused for its no-ops and known
+references; the two prior-state tests did not see "prior state") before the change; 119 tests pass
+after. Mutations, each restored, run with `plan_check_test.py PartialApply Actions`:
+- **P1** no-op allowed outside the prior state: FAILED `test_no_op_in_a_create_phase_refused`.
+- **P2** a known ref accepted when its target is not held: FAILED
+ `test_known_reference_to_a_target_not_in_state_refused`.
+- **P3** a known ref not compared with the state: FAILED `test_known_reference_must_equal_the_target_in_state`.
+- **P4** a known policy with unknown_refs taken as is: FAILED `test_known_policy_must_name_the_subnet_in_state`.
+- **P5** `update` allowed in a create phase: FAILED `test_update_in_a_create_phase_still_refused` and
+ `test_update_refused`.
+
+**cert bundle -empty** (commit 9fa794e8). `bundle -cert-keys FILE -empty -out FILE` writes
+`{"certificates":[]}`; `-empty` with a `-cert` is a usage error; the plain form still refuses an
+empty set. Red first: `TestBundleEmpty` FAILED `bundle -empty = 2 ... flag provided but not defined:
+-empty`; then a test bug of mine (comparing the indented file as text) was fixed to compare compact
+JSON. Mutations, each restored, `go test ./cmd/equipo-hosted-certify -run TestBundle`:
+- **E1** `-empty` accepted with `-cert`: FAILED `TestBundleEmpty` (`bundle -empty -cert = 0`, and it wrote the file).
+- **E2** the plain form accepts no `-cert`: FAILED `TestBundleRefuses` (`no certificates: bundle = 0`).
+- **E3** `-empty` not honoured: FAILED `TestBundleEmpty` (`bundle -empty = 2 ... -cert, -cert-keys and -out are required`).
+
+**The plan** (revision 1.1): 2.3, 2.4 and 4.1 re-run a failed apply once before the reconcile and the
+skip; the discovery step after 2.3 stays the refresh-only reconcile (a no-op re-apply now passes but
+is not cheaper: the same refresh plus `show`, plan-check, an empty apply and the outputs, and a
+drifting computed value would be refused as an update); 7.2 uses `cert bundle ... -empty`.
+- **M8** the plan's 7.2 `cert bundle ... -empty` line without `-out`: `TestPlanCertInvocationsParse`
+ FAILED `-cert-keys and -out are required`.
+
+Green: `plan_check_test.py` (119), `make hosted-infra-check`, `go test ./cmd/equipo-hosted-certify`,
+`-run '^TestPlanInvocationsParse$' ./internal/hostedops`, `-run TestPlan ./cmd/equipo-hosted-image`,
+`make budget`, and `bash -n` on all 39 `sh` blocks.