app: package the operator app — an installable Electron build carrying helper + payload (retire the unpackaged stopgap) #463
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why now
The operator app has never been built as an installable Electron app. Every launch today is the unpackaged stopgap (
docs/operator-app/build-and-run.md), which names the one remaining gap explicitly:Everything the package must carry now exists standalone — this ticket is the collapse, and its own proof: build the installer, then open what it packaged.
pnpm build:electron→dist/+dist-electron/*.cjs(ADR 0108).pnpm build:helper, resolved atprocess.resourcesPath/helper/helper(app/src-electron/electron-main.ts).scripts/assemble-payload.sh(#231) stages the exact layoutinternal/vm/resolve.goreads.app/src-electron/icons/(#257).Ruled decisions (pre-ruled so this is agent-runnable; the ADR records them)
origin/mainbefore minting — collision lesson, ADR 0145)..deb, Linux x86_64, Ubuntu 24.04 as the reference target. Not AppImage first: Ubuntu 24.04 restricts unprivileged user namespaces (build-and-run.md step 4), so the sandbox story needs the SUIDchrome-sandbox, which a deb postinst owns and an AppImage cannot. electron-builder's stock deb afterInstall sets root-SUID onchrome-sandbox— verify it in the extracted package rather than re-implementing.userData— thestateDirhanded to the helper asOURCLOUD_STATE_DIR(ADR 0050) — lands under an ourcloud-named dir, not~/.config/Electron. Existing unpackaged dev state does not migrate; say so in the docs.app.getVersion()must report the real package version (the ADR 0098 wire; the update feed itself is out of scope).Substrate constraints (mapped by #377 — read its thread before starting)
@electron/get) — do not flip the repo's electron build-script denial inpnpm-workspace.yaml(it keeps the--frozen-lockfileCI install offline-safe) and do not commit any approve-builds state.libnss3/libgtk-3/libgbm/…) and the glibc wall (container 2.36, needed 2.38). Proven on #377. Bundle it; never run it. Anything that must open runs over the nix-built Electron fromnix develop .#e2eviascripts/stage-e2e-electron.sh(ELECTRON_OVERRIDE_DIST_PATH) underxvfb-run— the exact GREEN recipe from #377 (wizard-menu.smoke.spec.ts, evidence20260810T033614Z).assemble-payload.shlayout — is the sanctioned stand-in: packaging checks presence/layout, and the open smoke never reaches the guest (#377 drove the wizard with no payload at all). Content verity stays with the host drives.What to build
pnpm package(inapp/): electron-builder wiring that produces the.debfromdist/+dist-electron/, bundling the helper atresourcesPath/helper/helper, icons atresourcesPath/icons, and a payload dir (input: env/arg pointing at an assemble-payload output) atresourcesPath/payload. Refuses loud on an incomplete payload (ADR 0100/0110) — except thegateway-cache/slot, which is an optimisation and may ship PENDING.dpkg-deb -xthe artifact and assert: helper present + executable bit, payload layout matchesinternal/vm/resolve.go, icons present, control-file version = package version, postinst carries thechrome-sandboxSUID story..deb, stages itsresources/into the writable nix-Electron copy (the stage-e2e-electron pattern — same mechanism as build-and-run step 9), and drives it under Xvfb to the operator home (reusefixtures/wizard.ts/ thewizard-menu.smokeshape;OC_E2E_SPEC-selectable). GREEN = the bytes the installer ships are what booted. Post the run stamp + screenshot/trace as evidence, as #377 did.app/PACKAGING.md(the installer exists; whatpnpm packagedoes; the container/host boundary), a build-and-run.md note that packaging has landed container-proven and the full stopgap collapse waits on the real-install proof (#471), and theSTATUS.mdheader.Acceptance criteria
pnpm packageproduces a Linux x86_64.debcarrying app, helper, icons, and payload as above; incomplete payload (other thangateway-cache/) refuses loud.userData);app.getVersion()real.app/PACKAGING.md+ build-and-run note +STATUS.mdupdated in the same commit.pnpm-workspace.yaml's electron denial and the frozen-lockfile CI install stay untouched.Out of scope (→ #471 and later)
.debon a real machine and launching the shipped Electron binary with the sandbox on, zero env overrides, real payload — the container cannot execute that binary (glibc wall); that residue is #471 (ready-for-human, blocked by this).If the substrate turns out to lack something this ticket assumes, do not fake it — post exactly which prerequisite is missing and what would grant it (#377's second acceptance path), and stop.
References
#377 (substrate proof + glibc wall) · ADR 0040/0108 (packaging phased; shell shape) · ADR 0110 + #295 (
OURCLOUD_PAYLOAD_DIRis the only production resolution; the install carries the payload) · ADR 0133 (gateway-cache/optional slot) ·docs/operator-app/build-and-run.md·app/PACKAGING.md·scripts/stage-e2e-electron.sh· #230, #231, #257.Heads-up for the implementing agent: ADR 0167 is now taken (
docs/adr/0167-design-a-surface-render-crash-wears-a-fault-frame.md, commit87e9382, 2026-08-12). Per this ticket's own instruction, verify againstorigin/mainand mint the next free number (0168 at time of writing).Outcome: GREEN — the operator app packages as an installable
.deb, both proofs pass in the sandboxCommitted in
e2e0a38(ADR 0168 —0167was taken concurrently by the backlog-walk's render-crash DDR; verified againstorigin/mainbefore minting per the collision lesson, ADR 0145).What landed
pnpm package(inapp/, electron-builder,electron-builder.yml) builds a Linux x86_64.debcarrying the shell+renderer asar plus the threeextraResourcesthe shell resolves fromprocess.resourcesPath: the production helper (helper/helper), icons (icons/, #257), and the private-path payload (payload/, ADR 0110).appId nz.matou.ourcloud/productName OurCloud→userDataunder~/.config/OurCloud;version 0.1.0soapp.getVersion()is real. Incomplete payload refuses loud (scripts/verify-payload.mjs) except the optionalgateway-cache/(ADR 0133). The Electron dist is bundled by@electron/get, never executed here (glibc wall, #377);pnpm-workspace.yaml's electron denial + frozen-lockfile install untouched.Evidence
test-results/package-smoke/20260812T153413Z, reproduced end to end byscripts/smoke-package.shinsidenix develop .#e2eover ONLY committed pieces.ourcloud_0.1.0_amd64.deb(108 MB),Package: ourcloud,Version: 0.1.0,Architecture: amd64.scripts/package-layout-check.sh) — PASS (12/12): helper present+executable · payloadagent/control-plane/nixos-guest.qcow2/qemu-img/qemu-system-x86_64/dashboard/(the exactinternal/vm/resolve.golayout) ·icons/256x256.png·resources/app.asar· controlVersion=0.1.0== package0.1.0· postinst root-SUIDschrome-sandbox(chmod 4755) ·chrome-sandboxshipped.package-open.smoke.spec.ts) —1 passed (3.6s), body 1.7s: the.deb's ownresources/(app.asar + real helper + icons + fake-complete payload) staged into a writable nix Electron (scripts/stage-e2e-electron-package.sh) and driven under Xvfb to the operator home. GREEN = the bytes the installer ships are what booted.operator-home.png— the packaged frameless "OurCloud" window (productName landed) on "Create a community", reached over the packaged helper (eyeballed, real render — not a false green)./dev/kvm; glibc 2.36 (Debian bookworm); kernel 6.8.0-124; 4 vCPU; Electron 33.4.11 (nix-built for the drive; bundled npm dist for the package).Out of scope → #471 (
ready-for-human)Installing the
.debon a real machine and founding from the shipped Electron with the sandbox on, zero env overrides, a real payload — the container cannot execute that binary (glibc wall). The layout proof asserts the postinst SUID story that #471 will exercise live.close-report for #463 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope