app: private-path payload has no assembly step (#196 landed the read side only) #231

Closed
opened 2026-07-31 18:26:48 +00:00 by ben · 2 comments
Owner

Parent

Reported during QA session preparing #183 Phase A.

What's wrong

#196 landed only the consumption side of ADR 0110: the app resolves a payload directory at runtime and hands it to the bundled helper. Nothing assembles that payload — no step stages the agent binary, the pinned QEMU, and the guest base image into the layout the app reads. The carriage ADR 0110 promises cannot be exercised end to end; the env-var override the ADR demoted to a dev-only convenience is the only working route.

What I expected

A payload assembly step that stages agent + pinned QEMU + guest base image into the payload layout the app resolves, so an installed operator app founds via the private path with no network fetch and no hand-placed image.

Steps to reproduce

  1. Build everything the repo knows how to build today (helper, app shell, guest image).
  2. Look for the payload directory the app resolves at runtime — nothing produced it.
  3. Founding via the private path therefore requires manual env overrides, exactly what ADR 0110 rules out for the real install.

Blocked by

None — staging the agent and guest base image can start immediately; the pinned-QEMU slot completes after #230.

Additional context

Not a #183 blocker (Ben's stopgap ruling for Phase A). Operator-app packaging itself is deferred as later work, but the assembly step should exist and run standalone so the payload can be verified before an installer exists.

## Parent Reported during QA session preparing #183 Phase A. ## What's wrong #196 landed only the consumption side of ADR 0110: the app resolves a payload directory at runtime and hands it to the bundled helper. Nothing **assembles** that payload — no step stages the agent binary, the pinned QEMU, and the guest base image into the layout the app reads. The carriage ADR 0110 promises cannot be exercised end to end; the env-var override the ADR demoted to a dev-only convenience is the only working route. ## What I expected A payload assembly step that stages agent + pinned QEMU + guest base image into the payload layout the app resolves, so an installed operator app founds via the private path with no network fetch and no hand-placed image. ## Steps to reproduce 1. Build everything the repo knows how to build today (helper, app shell, guest image). 2. Look for the payload directory the app resolves at runtime — nothing produced it. 3. Founding via the private path therefore requires manual env overrides, exactly what ADR 0110 rules out for the real install. ## Blocked by None — staging the agent and guest base image can start immediately; the pinned-QEMU slot completes after #230. ## Additional context **Not a #183 blocker** (Ben's stopgap ruling for Phase A). Operator-app packaging itself is deferred as later work, but the assembly step should exist and run standalone so the payload can be verified before an installer exists.
Author
Owner

This was generated by AI during triage.

Triage

Category: enhancement · State: ready-for-agent

Verification: confirmed against the codebase — app/src-electron/electron-main.ts has payloadDirPath() (the consumption side, #196) but scripts/ has no assembly script and nothing in the repo populates a payload directory. internal/vm/resolve.go defines the exact expected layout (qemu-img, qemu-system-<arch>, nixos-guest.qcow2). No existing implementation, no prior .out-of-scope/ rejection.

Agent Brief

Category: enhancement
Summary: Add the private-path payload assembly step that stages agent + pinned QEMU + guest base image into the layout the app resolves (ADR 0110).

Current behavior:
#196 landed only the consumption side — the packaged app resolves OURCLOUD_PAYLOAD_DIR and hands it to the helper, and internal/vm/resolve.go defines the exact expected layout inside that directory. Nothing assembles that directory; the only working route today is hand-placing files via the dev-only single-artifact env var overrides (OURCLOUD_QEMU_IMG, OURCLOUD_QEMU_SYSTEM, OURCLOUD_GUEST_IMAGE), which ADR 0110 demotes to a dev-only convenience, not the real carriage path.

Desired behavior:
A standalone assembly step (script or build target) that stages the agent binary, the pinned QEMU binaries, and the guest base image into a payload directory matching the layout internal/vm/resolve.go expects, so the payload can be built and verified independently of any installer — founding via the private path with no network fetch and no hand-placed image.

Key interfaces:

  • Output layout must match internal/vm/resolve.go's constants: qemu-img, qemu-system-x86_64/qemu-system-aarch64, nixos-guest.qcow2, all siblings inside one payload directory.
  • Should consume the existing guest-image build output (#216) and the agent binary build directly.
  • The pinned-QEMU artifact (#230) may not exist yet when this is picked up — if so, stage what's available (agent + guest image) and document the pending QEMU slot in the assembly step's own output/docs rather than blocking the whole step on #230.

Acceptance criteria:

  • Running the assembly step from a clean checkout produces a payload directory with the agent binary and guest base image (and, once #230 lands, the pinned QEMU binaries) under the exact filenames internal/vm/resolve.go resolves.
  • The assembled payload directory can be pointed at via OURCLOUD_PAYLOAD_DIR and the private path founds with no additional env overrides, no network fetch, no hand-placed files (for the artifacts staged).
  • The step runs standalone (no installer required) so the payload can be verified in CI/dev before packaging exists.

Out of scope:

  • Building the pinned QEMU binaries themselves (#230).
  • The macOS/Windows/Electron installer packaging (deferred per the issue's own scoping).
> *This was generated by AI during triage.* ## Triage **Category:** enhancement · **State:** ready-for-agent **Verification:** confirmed against the codebase — `app/src-electron/electron-main.ts` has `payloadDirPath()` (the consumption side, #196) but `scripts/` has no assembly script and nothing in the repo populates a payload directory. `internal/vm/resolve.go` defines the exact expected layout (`qemu-img`, `qemu-system-<arch>`, `nixos-guest.qcow2`). No existing implementation, no prior `.out-of-scope/` rejection. ## Agent Brief **Category:** enhancement **Summary:** Add the private-path payload assembly step that stages agent + pinned QEMU + guest base image into the layout the app resolves (ADR 0110). **Current behavior:** #196 landed only the consumption side — the packaged app resolves `OURCLOUD_PAYLOAD_DIR` and hands it to the helper, and `internal/vm/resolve.go` defines the exact expected layout inside that directory. Nothing assembles that directory; the only working route today is hand-placing files via the dev-only single-artifact env var overrides (`OURCLOUD_QEMU_IMG`, `OURCLOUD_QEMU_SYSTEM`, `OURCLOUD_GUEST_IMAGE`), which ADR 0110 demotes to a dev-only convenience, not the real carriage path. **Desired behavior:** A standalone assembly step (script or build target) that stages the agent binary, the pinned QEMU binaries, and the guest base image into a payload directory matching the layout `internal/vm/resolve.go` expects, so the payload can be built and verified independently of any installer — founding via the private path with no network fetch and no hand-placed image. **Key interfaces:** - Output layout must match `internal/vm/resolve.go`'s constants: `qemu-img`, `qemu-system-x86_64`/`qemu-system-aarch64`, `nixos-guest.qcow2`, all siblings inside one payload directory. - Should consume the existing guest-image build output (#216) and the agent binary build directly. - The pinned-QEMU artifact (#230) may not exist yet when this is picked up — if so, stage what's available (agent + guest image) and document the pending QEMU slot in the assembly step's own output/docs rather than blocking the whole step on #230. **Acceptance criteria:** - [ ] Running the assembly step from a clean checkout produces a payload directory with the agent binary and guest base image (and, once #230 lands, the pinned QEMU binaries) under the exact filenames `internal/vm/resolve.go` resolves. - [ ] The assembled payload directory can be pointed at via `OURCLOUD_PAYLOAD_DIR` and the private path founds with no additional env overrides, no network fetch, no hand-placed files (for the artifacts staged). - [ ] The step runs standalone (no installer required) so the payload can be verified in CI/dev before packaging exists. **Out of scope:** - Building the pinned QEMU binaries themselves (#230). - The macOS/Windows/Electron installer packaging (deferred per the issue's own scoping).
Author
Owner

Landed in 6523de9 on main.

What was done — the write side of ADR 0110's carriage (#196 landed only the read side). New scripts/assemble-payload.sh stages the private-path payload into one directory in the exact layout internal/vm/resolve.go resolves:

  • agent — the locally-installed agent binary (built static, CGO_ENABLED=0, from ./agent/cmd/agent; the installer places it, resolve.go does not resolve it).
  • nixos-guest.qcow2 — the per-arch guest base image (#216).
  • qemu-img + qemu-system-<arch> — the pinned QEMU.
  • PAYLOAD.txt — a manifest of what was staged and what is pending.

Each artifact builds from source or stages a prebuilt via PAYLOAD_AGENT_SRC / PAYLOAD_GUEST_IMAGE_SRC / PAYLOAD_QEMU_SRC_DIR. The step runs standalone (no installer). Point the app at the result with OURCLOUD_PAYLOAD_DIR.

Pinned QEMU (#230) stays PENDING: it has no build source yet, so the step leaves that slot unstaged (recorded in PAYLOAD.txt) and still stages the rest — a partial payload is a valid, verifiable intermediate. Founding's Create stays fail-loud (ADR 0056/0100) until the slot is filled. Building the QEMU binaries (#230) and the installer packaging were out of scope.

Evidence / seam: internal/vm/assemble_test.go drives the step with stand-in artifacts and asserts the assembled dir is exactly one vm.ResolveConfig resolves and Create's missing-payload precondition accepts — the write side now provably meets the read side, offline (no Go/Nix/QEMU heavy inputs). Verified: full #go-ci gate (build/vet/test/golangci-lint + broker) green; a real standalone run built the agent, staged the image, and correctly reported the QEMU slot pending.

Docs: docs/operator-app/build-and-run.md and app/PACKAGING.md reference the step; STATUS.md updated (header + milestone log).

Landed in 6523de9 on `main`. **What was done — the write side of ADR 0110's carriage (#196 landed only the read side).** New `scripts/assemble-payload.sh` stages the private-path payload into one directory in the exact layout `internal/vm/resolve.go` resolves: - `agent` — the locally-installed agent binary (built static, `CGO_ENABLED=0`, from `./agent/cmd/agent`; the installer places it, `resolve.go` does not resolve it). - `nixos-guest.qcow2` — the per-arch guest base image (#216). - `qemu-img` + `qemu-system-<arch>` — the pinned QEMU. - `PAYLOAD.txt` — a manifest of what was staged and what is pending. Each artifact builds from source or stages a prebuilt via `PAYLOAD_AGENT_SRC` / `PAYLOAD_GUEST_IMAGE_SRC` / `PAYLOAD_QEMU_SRC_DIR`. The step runs **standalone** (no installer). Point the app at the result with `OURCLOUD_PAYLOAD_DIR`. **Pinned QEMU (#230) stays PENDING:** it has no build source yet, so the step leaves that slot unstaged (recorded in `PAYLOAD.txt`) and still stages the rest — a partial payload is a valid, verifiable intermediate. Founding's `Create` stays fail-loud (ADR 0056/0100) until the slot is filled. Building the QEMU binaries (#230) and the installer packaging were out of scope. **Evidence / seam:** `internal/vm/assemble_test.go` drives the step with stand-in artifacts and asserts the assembled dir is exactly one `vm.ResolveConfig` resolves and `Create`'s missing-payload precondition accepts — the write side now provably meets the read side, offline (no Go/Nix/QEMU heavy inputs). Verified: full `#go-ci` gate (build/vet/test/golangci-lint + broker) green; a real standalone run built the agent, staged the image, and correctly reported the QEMU slot pending. Docs: `docs/operator-app/build-and-run.md` and `app/PACKAGING.md` reference the step; `STATUS.md` updated (header + milestone log).
ben closed this issue 2026-07-31 22:28: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.

Dependencies

No dependencies set.

Reference
Matou/idss#231
No description provided.