own-VPS spec gate: ADR 0030's 4 GiB floor rejects the exact droplet the app's own remedy recommends renting #439

Closed
opened 2026-08-11 18:11:29 +00:00 by ben · 2 comments
Owner

Failure: rehearsal drive 20260811T180057Z progressed cleanly through own-VPS enrollment and pairing (state/founding-state.json: every own-vps stage through supply/pair succeeded) and then red at the spec gate:

probe.mem_bytes: 4106100736   (~3.824 GiB)
floor.min_mem_bytes: 4294967296  (4 GiB, ADR 0030)
failed: ["mem"]
headline: "This machine has 4 GB memory — the gateway needs 4 GB."

Comparison: internal/enroll/ledger.go:806 (specShortfalls), floor defined at internal/founding/standup.go:71-74 (GatewayFloor.MinMemBytes = 4 << 30, citing ADR 0030). Rendered correctly by app/src/components/founding/FoundingSpecGateFail.vue (S9x card) — this is not a UI bug.

Why this matters: the target droplet (170.64.179.132) is the same DigitalOcean 2vCPU/4GB tier the app's own remedy card recommends (FoundingSpecGateFail.vue: "Rent a server instead — Sized right, about $12/month"). Real cloud '4 GB' droplets report slightly under 4 GiB MemTotal to the kernel (firmware/hypervisor-reserved region) — this is universal, not specific to this box. As coded, GatewayFloor.MinMemBytes is an exact binary-GiB comparison with zero headroom, so the app's own suggested remedy cannot pass its own gate. Anyone renting the recommended tier hits this every time.

Side effect: because the JourneyFailure fires mid-row (app/tests/e2e/fixtures/journey.ts:106-137, waitForLeg), the test throws before driveLegs runs, so artifacts/legs.json stays [] and .sandcastle/rehearsal-report.sh falls back to the generic wizard label/signature — worth knowing since that signature bucket is shared with unrelated pre-legs reds and won't discriminate this cause from others.

Suspected layer: policy/ADR, not code defect. docs/adr/0030-hardware-minima.md:8-14 frames 4 GiB as deliberately chosen — "the honest floor, not a comfortable target" — grounded in measured swap pressure on a reference VPS at ~1.9 GB used, and explicitly marked provisional pending S13 Q9 (Nix build placement). Loosening MinMemBytes to admit real-world '4 GB' droplets has genuine OOM-risk consequences the ADR was written to guard against.

What plugging it needs (human ruling): pick one — (a) give GatewayFloor.MinMemBytes explicit headroom for realistic reported RAM (e.g. decimal-GB or a small percentage margin) and amend ADR 0030 with the new number and rationale, or (b) leave the floor as-is and change the remedy copy / rehearsal droplet provisioning to recommend/use a tier that actually clears it (e.g. the next size up), or (c) some combination. Either changes an ADR-encoded constant or user-facing remedy guidance — out of scope for an unattended mechanical heal.

drive 20260811T180057Z red at wizard: drive red at wizard — the wizard died before any leg ran
evidence: test-results/…/20260811T180057Z/ on matou-workstation (legs.json, droplet-journal.txt, trace)

**Failure:** rehearsal drive `20260811T180057Z` progressed cleanly through own-VPS enrollment and pairing (`state/founding-state.json`: every `own-vps` stage through `supply`/`pair` succeeded) and then red at the spec gate: ``` probe.mem_bytes: 4106100736 (~3.824 GiB) floor.min_mem_bytes: 4294967296 (4 GiB, ADR 0030) failed: ["mem"] headline: "This machine has 4 GB memory — the gateway needs 4 GB." ``` Comparison: `internal/enroll/ledger.go:806` (`specShortfalls`), floor defined at `internal/founding/standup.go:71-74` (`GatewayFloor.MinMemBytes = 4 << 30`, citing ADR 0030). Rendered correctly by `app/src/components/founding/FoundingSpecGateFail.vue` (S9x card) — this is not a UI bug. **Why this matters:** the target droplet (170.64.179.132) is the same DigitalOcean 2vCPU/4GB tier the app's own remedy card recommends (`FoundingSpecGateFail.vue`: "Rent a server instead — Sized right, about $12/month"). Real cloud '4 GB' droplets report slightly under 4 GiB `MemTotal` to the kernel (firmware/hypervisor-reserved region) — this is universal, not specific to this box. As coded, `GatewayFloor.MinMemBytes` is an exact binary-GiB comparison with zero headroom, so the app's own suggested remedy cannot pass its own gate. Anyone renting the recommended tier hits this every time. **Side effect:** because the JourneyFailure fires mid-row (`app/tests/e2e/fixtures/journey.ts:106-137`, `waitForLeg`), the test throws before `driveLegs` runs, so `artifacts/legs.json` stays `[]` and `.sandcastle/rehearsal-report.sh` falls back to the generic `wizard` label/signature — worth knowing since that signature bucket is shared with unrelated pre-legs reds and won't discriminate this cause from others. **Suspected layer:** policy/ADR, not code defect. `docs/adr/0030-hardware-minima.md:8-14` frames 4 GiB as deliberately chosen — "the honest floor, not a comfortable target" — grounded in measured swap pressure on a reference VPS at ~1.9 GB used, and explicitly marked provisional pending S13 Q9 (Nix build placement). Loosening `MinMemBytes` to admit real-world '4 GB' droplets has genuine OOM-risk consequences the ADR was written to guard against. **What plugging it needs (human ruling):** pick one — (a) give `GatewayFloor.MinMemBytes` explicit headroom for realistic reported RAM (e.g. decimal-GB or a small percentage margin) and amend ADR 0030 with the new number and rationale, or (b) leave the floor as-is and change the remedy copy / rehearsal droplet provisioning to recommend/use a tier that actually clears it (e.g. the next size up), or (c) some combination. Either changes an ADR-encoded constant or user-facing remedy guidance — out of scope for an unattended mechanical heal. drive `20260811T180057Z` red at `wizard`: `drive red at wizard — the wizard died before any leg ran` evidence: `test-results/…/20260811T180057Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) <!-- rehearsal-sig: dcf630511b50 -->
Author
Owner

RULED (Ben, 2026-08-11): fix the floor to measured-MemTotal in decimal GB with kernel-reserve headroom — a real 4 GB cloud box must pass. This is the last gate before a green rehearsal.

The change

  • internal/founding/standup.go GatewayFloor.MinMemBytes: replace 4 << 30 (4 GiB = 4,294,967,296) with a decimal-GB floor carrying headroom for the firmware/hypervisor-reserved region cloud "4 GB" boxes never expose to the kernel. 3_800_000_000 (3.8 GB) is the value: this run's droplet reports MemTotal 4,106,100,736 (~3.82 GiB / 4.1 GB decimal), so 3.8e9 passes it with ~0.3 GB margin while still rejecting a genuine 2 GB box (2.1e9) unambiguously. (2 GiB=2.15e9 also fails cleanly; the gap 3.8–2.15 is wide.)
  • Keep the headline honest: gib() (standupfmt.go) rounds to whole GB, so "needs 4 GB" stays the operator-facing number even though the byte floor is 3.8e9 — that rounding is why the failing card read the nonsensical "has 4 GB — needs 4 GB". After the fix a 4 GB box passes silently; only a truly-under box fails, and its headline reads a real shortfall (e.g. "has 2 GB — needs 4 GB").
  • Amend ADR 0030: the declared floor is measured MemTotal, not nominal RAM — nominal "4 GB" hardware presents ~3.8–4.1 GB to the kernel, so the enforced byte floor sits below the nominal number by design. State the value (3.8 GB) and the reason (kernel/firmware reserve) so the next reader doesn't "tidy" it back to 4<<30. The recommended tier (8 GB) is unaffected. Guard it: a seam/unit test asserting a 4,106,100,736-byte probe PASSES the gate and a 2,147,483,648-byte probe FAILS on mem — that pins the intent against a future GiB regression.

Scope note from the reporter, worth folding into #435's orbit (not here): a spec-gate fail fires mid-row so legs.json stays [] and the report buckets under the generic wizard signature — fine for now (this is the only live wizard-bucket cause), but the eventual per-cause signature wants the fault's own key.

Flip to ready-for-agent on landing this ruling.

RULED (Ben, 2026-08-11): fix the floor to measured-MemTotal in decimal GB with kernel-reserve headroom — a real 4 GB cloud box must pass. **This is the last gate before a green rehearsal.** ## The change - `internal/founding/standup.go` `GatewayFloor.MinMemBytes`: replace `4 << 30` (4 GiB = 4,294,967,296) with a decimal-GB floor carrying headroom for the firmware/hypervisor-reserved region cloud "4 GB" boxes never expose to the kernel. **`3_800_000_000`** (3.8 GB) is the value: this run's droplet reports `MemTotal` 4,106,100,736 (~3.82 GiB / 4.1 GB decimal), so 3.8e9 passes it with ~0.3 GB margin while still rejecting a genuine 2 GB box (2.1e9) unambiguously. (2 GiB=2.15e9 also fails cleanly; the gap 3.8–2.15 is wide.) - Keep the headline honest: `gib()` (standupfmt.go) rounds to whole GB, so "needs 4 GB" stays the operator-facing number even though the byte floor is 3.8e9 — that rounding is why the failing card read the nonsensical "has 4 GB — needs 4 GB". After the fix a 4 GB box passes silently; only a truly-under box fails, and its headline reads a real shortfall (e.g. "has 2 GB — needs 4 GB"). - **Amend ADR 0030**: the declared floor is **measured `MemTotal`**, not nominal RAM — nominal "4 GB" hardware presents ~3.8–4.1 GB to the kernel, so the enforced byte floor sits below the nominal number by design. State the value (3.8 GB) and the reason (kernel/firmware reserve) so the next reader doesn't "tidy" it back to 4<<30. The recommended tier (8 GB) is unaffected. Guard it: a seam/unit test asserting a 4,106,100,736-byte probe PASSES the gate and a 2,147,483,648-byte probe FAILS on `mem` — that pins the intent against a future GiB regression. Scope note from the reporter, worth folding into #435's orbit (not here): a spec-gate fail fires mid-row so `legs.json` stays `[]` and the report buckets under the generic `wizard` signature — fine for now (this is the only live wizard-bucket cause), but the eventual per-cause signature wants the fault's own key. Flip to ready-for-agent on landing this ruling.
Author
Owner

Landed as 874060b on origin/main, following Ben's ruling (2026-08-11) recorded above.

Change: internal/founding/standup.go GatewayFloor.MinMemBytes is now 3_800_000_000 (3.8 GB decimal) instead of 4 << 30 (4 GiB) — the memory floor is enforced against measured MemTotal, not nominal RAM. A nominal 4 GB cloud box (the DO 2vCPU/4GB tier the S9x remedy recommends) presents ~3.8–4.1 GB to the kernel because of the firmware/hypervisor reserve, so the old exact-GiB floor rejected the app's own recommended remedy. The new floor passes this drive's droplet (MemTotal 4,106,100,736, ~0.3 GB margin) while still failing a genuine 2 GB box (2,147,483,648) on mem. The gib() headline still rounds to "needs 4 GB", so a true shortfall reads honestly.

ADR 0030 amended: the declared memory floor is now documented as measured MemTotal = 3.8 GB with the kernel-reserve rationale, so it is not tidied back to 4 << 30. Recommended tier (8 GB) unaffected.

Guard test: TestSpecGate_RealFourGBDropletPasses_TwoGBFails (internal/founding/standup_test.go) asserts 4,106,100,736 PASSES and 2,147,483,648 FAILS on mem, pinning the intent against a future GiB regression.

Catalogue's separate RoleGateway floor was left untouched (out of the ruling's scope; that path is not the own-VPS spec gate). Full internal/founding/..., internal/catalogue, internal/enroll/..., internal/join/..., internal/provision/... suites green; go-ci pre-push gate passed. Unblocks the next own-VPS rehearsal drive past the spec gate.

Landed as `874060b` on `origin/main`, following Ben's ruling (2026-08-11) recorded above. **Change:** `internal/founding/standup.go` `GatewayFloor.MinMemBytes` is now `3_800_000_000` (3.8 GB decimal) instead of `4 << 30` (4 GiB) — the memory floor is enforced against measured `MemTotal`, not nominal RAM. A nominal 4 GB cloud box (the DO 2vCPU/4GB tier the S9x remedy recommends) presents ~3.8–4.1 GB to the kernel because of the firmware/hypervisor reserve, so the old exact-GiB floor rejected the app's own recommended remedy. The new floor passes this drive's droplet (`MemTotal` 4,106,100,736, ~0.3 GB margin) while still failing a genuine 2 GB box (2,147,483,648) on `mem`. The `gib()` headline still rounds to "needs 4 GB", so a true shortfall reads honestly. **ADR 0030 amended:** the declared memory floor is now documented as measured `MemTotal` = 3.8 GB with the kernel-reserve rationale, so it is not tidied back to `4 << 30`. Recommended tier (8 GB) unaffected. **Guard test:** `TestSpecGate_RealFourGBDropletPasses_TwoGBFails` (`internal/founding/standup_test.go`) asserts 4,106,100,736 PASSES and 2,147,483,648 FAILS on `mem`, pinning the intent against a future GiB regression. Catalogue's separate `RoleGateway` floor was left untouched (out of the ruling's scope; that path is not the own-VPS spec gate). Full `internal/founding/...`, `internal/catalogue`, `internal/enroll/...`, `internal/join/...`, `internal/provision/...` suites green; go-ci pre-push gate passed. Unblocks the next own-VPS rehearsal drive past the spec gate.
ben closed this issue 2026-08-11 18:26:33 +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.

Reference
Matou/idss#439
No description provided.