Size enroll-copy's ceiling to a measured rented copy — with #716's drain fix the shared 20m defaultPhaseTimeout now CUTS a cold copy instead of hanging on it #717

Closed
opened 2026-08-23 23:39:16 +00:00 by matou-build-agent · 1 comment

Split out of #716 (GOTCHAS #70), which fixed the reason a fired ceiling could not be reported.

What changed. Before #716, ExecCLI.Run never returned when nix copy's ceiling fired — the orphaned ssh grandchild held the output pipe, so cmd.Wait blocked forever and the stage went silent to the drive's outer budget. cmd.WaitDelay now bounds that drain, so the shared 20m defaultPhaseTimeout on enroll-copy's nix copy is enforceable for the first time.

What that exposes. A cold rented copy is longer than 20 minutes. Drive 20260823T213536Z's own copy was still running at ~28 minutes, at 717 of 726 store paths. So from now on the copy gets SIGKILLed at 20m and copy() takes its soft-continue path.

That is cheap by design — copy() is an accelerator, machines update copies whatever is still missing, and the leg gets back ~68 minutes of budget instead of burning it in silence — but it is a guess where #68 wants a measurement, and it quietly moves the tail of the closure into enroll-activate's own 45m ceiling.

The ask (the #713/#68 pattern): rent a droplet from the drive's own gateway snapshot at the broker's own preset, drive the byte-for-byte sshNGStore invocation copy() runs, and MEASURE the honest cold nix copy --substitute-on-destination end to end. Then either size enroll-copy's ceiling to it (as vmActivatePhaseTimeout was sized for activate), or record that 20m + soft-continue is the right shape and why.

Do not widen on a guess — #62 holds; #68 names the three checks that make "the ceiling is smaller than the work" a finding rather than a masking.

Split out of #716 (GOTCHAS #70), which fixed the reason a fired ceiling could not be reported. **What changed.** Before #716, `ExecCLI.Run` never returned when `nix copy`'s ceiling fired — the orphaned `ssh` grandchild held the output pipe, so `cmd.Wait` blocked forever and the stage went silent to the drive's outer budget. `cmd.WaitDelay` now bounds that drain, so the shared 20m `defaultPhaseTimeout` on `enroll-copy`'s `nix copy` is **enforceable for the first time**. **What that exposes.** A cold rented copy is longer than 20 minutes. Drive `20260823T213536Z`'s own copy was still running at ~28 minutes, at 717 of 726 store paths. So from now on the copy gets SIGKILLed at 20m and `copy()` takes its soft-continue path. That is cheap by design — `copy()` is an accelerator, `machines update` copies whatever is still missing, and the leg gets back ~68 minutes of budget instead of burning it in silence — but it is a **guess where #68 wants a measurement**, and it quietly moves the tail of the closure into `enroll-activate`'s own 45m ceiling. **The ask (the #713/#68 pattern):** rent a droplet from the drive's own gateway snapshot at the broker's own preset, drive the byte-for-byte `sshNGStore` invocation `copy()` runs, and MEASURE the honest cold `nix copy --substitute-on-destination` end to end. Then either size `enroll-copy`'s ceiling to it (as `vmActivatePhaseTimeout` was sized for activate), or record that 20m + soft-continue is the right shape and why. Do not widen on a guess — #62 holds; #68 names the three checks that make "the ceiling is smaller than the work" a finding rather than a masking.
Author
Member

Close report — measured, and the ceiling stays at 20m

Ruled by agent under ADR 0174 — veto anytime. Two-way doors only: revertible source and test-config changes proven by live measurement plus red-before-green Go tests, on two throwaway clan-lab-tagged droplets destroyed after the runs. No personal credential, no security-posture widening, no member-facing trust accept, no data destroyed beyond my own lab boxes, no non-routine spend (two s-2vcpu-4gb droplets for ~35 minutes total).

The measurement

Rented twice from the drive's own gateway snapshot (idss-gateway-4abdd8e39619, snapshot 242422012 — the image drive 20260823T213536Z itself used) at the broker's own preset (s-2vcpu-4gb, syd1), driving the byte-for-byte sshNGStore invocation copy() runs against a 717-path / 1.75 GB toplevel — the same closure and the same shape as the drive's:

run droplet probe (path-info --store ssh-ng) substituted ON THE DESTINATION pushed over ssh-ng total
A 594650612 2s 626 paths, 14s 83 paths, 22s 41s
B 594651095 2s 626 paths, 11s 83 paths, 9s 25s

The ceiling is 29–48× the honest work. #716's premise — "a cold rented copy is longer than 20 minutes" — is falsified. The reason is #699's --substitute-on-destination doing exactly what its comment claims: the rented image's store is a pristine 616 paths (measured on B before the copy), so a community toplevel is a cold copy, but 626 of its 717 paths are signed stock nixpkgs the droplet fetches from cache.nixos.org on its own bandwidth, and only the 83 unsigned community-specific paths ever cross the wire from the drive host.

GOTCHAS #68's three checks — all three say "not dark, and not slow either"

  1. DO /v2/actions: droplet 594650612 and 594651095 each have exactly one action, their own create. Nothing power-cycled, resized or moved either.
  2. Reachability of the reproduction: ping + a fresh TCP/22 connect + a full ssh exec every 3s, 193/193 probes green across both runs, start to finish.
  3. The work's own duration from the box side: nix's own per-path lines date both halves (above); box-side sampling showed load ≤1.3, ~3.1 GB memory available, 71 G free, and the 717-path closure verified present on the target afterwards (nix path-info -r = 717).

The ruling: do not widen. 20m + soft-continue is the right shape

This is #713's pattern reaching the opposite verdict, and #62's bar is why. A copy that reaches 20 minutes has not been slow — it has stalled — and copy()'s soft continue is already the right answer to a stall: the copy is an accelerator, machines update copies whatever is still missing under its own measured 45m, and the leg gets its budget back instead of burning it. Widening here would buy a stall more silence, not the work more room.

On the ticket's worry that a cut copy "quietly moves the tail of the closure into enroll-activate's 45m ceiling": the measurement bounds that too. The worst case a cut copy can hand over is the whole 717-path closure, which is #713's run A — the target fetching and building the missing set itself, measured at 19m55s inside a 45m ceiling.

What landed (commit 04ed31ae)

The ceiling is unchanged, and now guarded from both sides:

  • internal/clan/copy_ceiling_test.go (new). TestEnroll_CopyKeepsTheSharedCeilingAgainstTheMeasuredRentedCopy reds if the rented 45m vmActivatePhaseTimeout ever leaks onto the copy — verified by pointing copy() at activateCeiling() (red at 44m59s) and reverting. TestEnroll_CopyStoreProbeIsFinite was red before the next item.
  • internal/clan/store_count.go — the one honest gap the measurement exposed. missingOnTarget's remote nix path-info --store ssh-ng://… is the copy stage's first act, over the exact channel that stalls, and it ran under the caller's context alone with no ceiling at all: a target that went quiet before the copy started took the whole stage silently to the drive's outer leg budget — the shape GOTCHAS #70 named for the copy itself. Now bounded by storeProbeTimeout = 5m over a measured 2s. A timed-out probe costs nothing: an unanswered remote read leaves every path counted as missing, which over-counts toward pushing, never toward "the target is already warm".
  • app/tests/e2e/journey.rented.spec.ts — enroll-copy leg budget 90m → 30m. This is the tightening #698's own comment invited ("it tightens sharply from the first green drive, and #699's --substitute-on-destination fix would let it drop to minutes"); both have now happened, and its factual claim that copy runs "with no --substitute-on-destination" was stale. The stage is bounded at 5m + 20m by its two ceilings and its failure path is a soft continue, so an honest stage cannot reach 25m — the row can only fire if a ceiling did not (the #716/#718 family), and reaching that verdict in 30m instead of 90m gives back an hour of a multi-hour drive.
  • internal/clan/rented_activate_live_test.go — IDSS_RENTED_ACTIVATE_COPY_ONLY=1: build + copy, every line wall-clock stamped, then stop, with the phase ceiling lifted so a measurement is never bounded by the thing being measured. This is how both runs above were driven, and how the next one should be.
  • docs/GOTCHAS.md #72, copy()'s own doc comment, STATUS.md header + milestone log.

gofmt, go vet ./... and the full go test ./... clean.

Spun out, not done here

Both runs' push tail ends …-etc → …-sops-install-secrets-0.0.1 → toplevel, and sops-install-secrets-0.0.1 is the exact path drive 20260823T213536Z froze on, 9 paths from the end — as #712's froze 9 from the end of its own 723, on kilobyte-sized text paths, after essentially all the bytes had landed. That narrows #712's two open hypotheses (substitution-time exhaustion, syd1 network fault) away from the half that finishes in 11 seconds; posted to #712 against its revisit criterion rather than acted on here.

Also noticed and not touched: droplet 594171376 (clan-lab-rehearsal-1d5d33df, Ubuntu, created 2026-08-21) is 2 days past its own clan-lab-expires- tag. Filed as a follow-up rather than destroyed — it is not this ticket's box and destroying someone else's lab state is not mine to rule.

Closing: measured, ruled, guarded, and the evidence is above.

## Close report — measured, and the ceiling stays at 20m **Ruled by agent under ADR 0174 — veto anytime.** Two-way doors only: revertible source and test-config changes proven by live measurement plus red-before-green Go tests, on two throwaway `clan-lab`-tagged droplets destroyed after the runs. No personal credential, no security-posture widening, no member-facing trust accept, no data destroyed beyond my own lab boxes, no non-routine spend (two `s-2vcpu-4gb` droplets for ~35 minutes total). ### The measurement Rented twice from the drive's own gateway snapshot (`idss-gateway-4abdd8e39619`, snapshot `242422012` — the image drive `20260823T213536Z` itself used) at the broker's own preset (`s-2vcpu-4gb`, syd1), driving the byte-for-byte `sshNGStore` invocation `copy()` runs against a **717-path / 1.75 GB** toplevel — the same closure and the same shape as the drive's: | run | droplet | probe (`path-info --store ssh-ng`) | substituted ON THE DESTINATION | pushed over ssh-ng | **total** | |---|---|---|---|---|---| | A | `594650612` | 2s | 626 paths, 14s | 83 paths, 22s | **41s** | | B | `594651095` | 2s | 626 paths, 11s | 83 paths, 9s | **25s** | **The ceiling is 29–48× the honest work.** #716's premise — "a cold rented copy is longer than 20 minutes" — is falsified. The reason is #699's `--substitute-on-destination` doing exactly what its comment claims: the rented image's store is a pristine **616 paths** (measured on B before the copy), so a community toplevel *is* a cold copy, but 626 of its 717 paths are signed stock nixpkgs the **droplet** fetches from `cache.nixos.org` on its own bandwidth, and only the 83 unsigned community-specific paths ever cross the wire from the drive host. ### GOTCHAS #68's three checks — all three say "not dark, and not slow either" 1. **DO `/v2/actions`:** droplet `594650612` and `594651095` each have exactly one action, their own `create`. Nothing power-cycled, resized or moved either. 2. **Reachability of the reproduction:** ping + a fresh TCP/22 connect + a full `ssh` exec every 3s, **193/193 probes green** across both runs, start to finish. 3. **The work's own duration from the box side:** nix's own per-path lines date both halves (above); box-side sampling showed load ≤1.3, ~3.1 GB memory available, 71 G free, and the 717-path closure verified present on the target afterwards (`nix path-info -r` = 717). ### The ruling: **do not widen.** 20m + soft-continue is the right shape This is #713's pattern reaching the opposite verdict, and #62's bar is why. A copy that reaches 20 minutes has not been slow — it has **stalled** — and `copy()`'s soft continue is already the right answer to a stall: the copy is an accelerator, `machines update` copies whatever is still missing under its own measured 45m, and the leg gets its budget back instead of burning it. Widening here would buy a stall more silence, not the work more room. On the ticket's worry that a cut copy "quietly moves the tail of the closure into `enroll-activate`'s 45m ceiling": the measurement bounds that too. The worst case a cut copy can hand over is the whole 717-path closure, which is #713's *run A* — the target fetching and building the missing set itself, measured at **19m55s** inside a 45m ceiling. ### What landed (commit `04ed31ae`) The ceiling is **unchanged**, and now guarded from both sides: - **`internal/clan/copy_ceiling_test.go`** (new). `TestEnroll_CopyKeepsTheSharedCeilingAgainstTheMeasuredRentedCopy` reds if the rented 45m `vmActivatePhaseTimeout` ever leaks onto the copy — verified by pointing `copy()` at `activateCeiling()` (red at 44m59s) and reverting. `TestEnroll_CopyStoreProbeIsFinite` was red before the next item. - **`internal/clan/store_count.go`** — the one honest gap the measurement exposed. `missingOnTarget`'s remote `nix path-info --store ssh-ng://…` is the copy stage's **first act**, over the exact channel that stalls, and it ran under the caller's context alone with **no ceiling at all**: a target that went quiet *before* the copy started took the whole stage silently to the drive's outer leg budget — the shape GOTCHAS #70 named for the copy itself. Now bounded by `storeProbeTimeout` = 5m over a measured 2s. A timed-out probe costs nothing: an unanswered remote read leaves every path counted as missing, which over-counts toward pushing, never toward "the target is already warm". - **`app/tests/e2e/journey.rented.spec.ts`** — `enroll-copy` leg budget **90m → 30m**. This is the tightening #698's own comment invited ("it tightens sharply from the first green drive, and #699's `--substitute-on-destination` fix would let it drop to minutes"); both have now happened, and its factual claim that copy runs "with no `--substitute-on-destination`" was stale. The stage is bounded at 5m + 20m by its two ceilings and its failure path is a soft continue, so an honest stage cannot reach 25m — the row can only fire if a ceiling did not (the #716/#718 family), and reaching that verdict in 30m instead of 90m gives back an hour of a multi-hour drive. - **`internal/clan/rented_activate_live_test.go`** — `IDSS_RENTED_ACTIVATE_COPY_ONLY=1`: build + copy, every line wall-clock stamped, then stop, with the phase ceiling lifted so a measurement is never bounded by the thing being measured. This is how both runs above were driven, and how the next one should be. - **`docs/GOTCHAS.md` #72**, `copy()`'s own doc comment, `STATUS.md` header + milestone log. `gofmt`, `go vet ./...` and the full `go test ./...` clean. ### Spun out, not done here Both runs' push tail ends `…-etc` → `…-sops-install-secrets-0.0.1` → toplevel, and `sops-install-secrets-0.0.1` is the exact path drive `20260823T213536Z` froze on, **9 paths from the end** — as #712's froze 9 from the end of its own 723, on kilobyte-sized text paths, after essentially all the bytes had landed. That narrows #712's two open hypotheses (substitution-time exhaustion, syd1 network fault) away from the half that finishes in 11 seconds; **posted to #712** against its revisit criterion rather than acted on here. Also noticed and **not** touched: droplet `594171376` (`clan-lab-rehearsal-1d5d33df`, Ubuntu, created 2026-08-21) is 2 days past its own `clan-lab-expires-` tag. Filed as a follow-up rather than destroyed — it is not this ticket's box and destroying someone else's lab state is not mine to rule. Closing: measured, ruled, guarded, and the evidence is above.
matou-build-agent 2026-08-24 00:39:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#717
No description provided.