operator app: the pinned feed carries no app artifact, the reader can't parse the fleet feed shape, and apply never installs — finish the self-update loop (#2166 split) #2167

Closed
opened 2026-11-04 19:10:02 +00:00 by matou-build-agent · 3 comments

Context (split from #2166)

#2166 pinned the operator app's update channel into the packaged build (app/src-electron/releaseChannel.ts): an installed .deb launched with no IDSS_RELEASE_* env now resolves the real signed-Matou source (the get.idss.nz testing feed + the pinned public key the fleet rail signs) instead of silently refusing every update (GOTCHAS #410). But pinning only makes the app check the feed. Three legs remain before the update strip can actually light and an operator can apply:

What remains

  1. The feed carries no operator-app artifact. The rail (scripts/release-rail/, cmd/release-cut) publishes control-plane / control-panel / agent / idss-idp roles into channel/testing.json; it never publishes the operator-app .deb. The rail must publish the app .deb (per platform) as a feed artifact.

  2. The app's feed reader cannot parse the fleet feed shape. app/src/lib/matouChannel.ts ReleaseManifest expects a single top-level artifact: {url, sha256}, but the fleet feed (internal/matouchannel.ReleaseManifest) carries a role-keyed artifacts map. So loadFeed() returns null on the real feed and check() reports no update even when one exists. The reader must learn the role-keyed shape and select the operator-app role for the running platform.

  3. The app-side install+restart leg is unwired. MatouChannelClient.apply only STAGES the verified bytes under <stateDir>/updates/<version>/; nothing installs a staged .deb and relaunches (AC2 of #2166: "Apply verifies the signature against the pinned key, installs, and restarts onto the newer release"). The Electron shell needs the on-launch (or on-apply) installer that applies the staged artifact and relaunches, with a bad signature refused (never installed).

Acceptance

  • The rail publishes the operator-app .deb (per platform) as a feed artifact on the testing channel.
  • matouChannel.ts reads the role-keyed fleet manifest and picks the operator-app role for the platform; a feed that carries no app role is an honest "no update" (ADR 0100), not a crash.
  • Apply installs the staged, signature-verified .deb and relaunches onto it; a bad signature or digest mismatch is refused, not installed (ADR 0098).
  • A live leg: an installed .deb built from main offers and applies a newer release from the testing feed.

Found while working #2166.

## Context (split from #2166) #2166 pinned the operator app's update channel into the packaged build (`app/src-electron/releaseChannel.ts`): an installed `.deb` launched with no `IDSS_RELEASE_*` env now resolves the real signed-Matou source (the get.idss.nz `testing` feed + the pinned public key the fleet rail signs) instead of silently refusing every update (GOTCHAS #410). But pinning only makes the app **check** the feed. Three legs remain before the update strip can actually light and an operator can apply: ## What remains 1. **The feed carries no operator-app artifact.** The rail (`scripts/release-rail/`, `cmd/release-cut`) publishes `control-plane` / `control-panel` / `agent` / `idss-idp` roles into `channel/testing.json`; it never publishes the operator-app `.deb`. The rail must publish the app `.deb` (per platform) as a feed artifact. 2. **The app's feed reader cannot parse the fleet feed shape.** `app/src/lib/matouChannel.ts` `ReleaseManifest` expects a single top-level `artifact: {url, sha256}`, but the fleet feed (`internal/matouchannel.ReleaseManifest`) carries a role-keyed `artifacts` map. So `loadFeed()` returns `null` on the real feed and `check()` reports no update even when one exists. The reader must learn the role-keyed shape and select the operator-app role for the running platform. 3. **The app-side install+restart leg is unwired.** `MatouChannelClient.apply` only STAGES the verified bytes under `<stateDir>/updates/<version>/`; nothing installs a staged `.deb` and relaunches (AC2 of #2166: "Apply verifies the signature against the pinned key, installs, and restarts onto the newer release"). The Electron shell needs the on-launch (or on-apply) installer that applies the staged artifact and relaunches, with a bad signature refused (never installed). ## Acceptance - [ ] The rail publishes the operator-app `.deb` (per platform) as a feed artifact on the `testing` channel. - [ ] `matouChannel.ts` reads the role-keyed fleet manifest and picks the operator-app role for the platform; a feed that carries no app role is an honest "no update" (ADR 0100), not a crash. - [ ] Apply installs the staged, signature-verified `.deb` and relaunches onto it; a bad signature or digest mismatch is refused, not installed (ADR 0098). - [ ] A live leg: an installed `.deb` built from main offers and applies a newer release from the testing feed. Found while working #2166.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: enhancement + ready-for-session.

Why this is a two-way door: the whole ticket is additive code and
config — a role-keyed branch in matouChannel.ts's feed reader, an
install+relaunch leg in the Electron shell, and a new per-platform artifact in
the release rail. Every leg is revertible by a later commit, and none is on the
one-way-door list: the signing uses the testing channel's pinned key the
fleet rail already cuts with (not the production release key — that's #2088), so
no non-routine spend, no security-posture widening, no member-facing trust
accept, no data destruction.

Why ready-for-session and not ready-for-agent: the swarm queue reads
only ready-for-agent, and a swarm worker must not take this. Two of its legs
need an interactive session's live standing:

  • Leg 1 changes the release rail (scripts/release-rail/,
    cmd/release-cut) to publish the operator-app .deb onto the live testing
    feed — a live-infrastructure operation, not a push a worker proves in-sandbox.
  • AC4 is an explicit live drive ("an installed .deb built from main offers
    and applies a newer release from the testing feed") — cut a release, build and
    install an installer, watch it self-update. No swarm worker can produce or
    prove that. This is the same standing the parent #2166 needed, which is
    itself ready-for-session.

What proves the ruling: legs 2 and 3 are red→green unit-testable in-repo
(matouChannel.ts feed-reader parse + the Electron apply/refuse path); the
whole loop is proved by the AC4 live drive. Relabelling is the entire cost of a
veto.


Session brief

Blocked by #2166 (dependency wired) — #2166 pins the update channel into the
packaged build (app/src-electron/releaseChannel.ts, which does not exist on
main yet because #2166 is unbuilt). Do #2166 first, or land them together.

Verified against the tree (2026-11-04):

  • Leg 2 symptom is real: app/src/lib/matouChannel.ts:50 declares a single
    top-level artifact: {url, sha256, …} on ReleaseManifest, while the fleet
    feed's internal/matouchannel/matouchannel.go carries a role-keyed
    artifacts map. loadFeed() therefore returns null on the real feed and
    check() reports no update. The reader must learn the role-keyed shape and
    pick the operator-app role for the running platform; a feed with no app role
    is an honest "no update" (ADR 0100), never a crash.
  • Leg 3: MatouChannelClient.apply (matouChannel.ts:229) only stages the
    verified bytes under <stateDir>/updates/<version>/; nothing installs the
    staged .deb and relaunches. Wire the on-launch/on-apply installer that
    applies the staged, signature-verified artifact and relaunches, refusing a bad
    signature or digest mismatch (never installing it) — ADR 0098.
  • Leg 1: scripts/release-rail/ + cmd/release-cut publish
    control-plane/control-panel/agent/idss-idp roles into
    channel/testing.json and never the operator-app .deb. Add the per-platform
    operator-app artifact.

Acceptance — as filed in the issue body (the four checkboxes stand). AC1–AC3
are unit/seam-provable in-repo; AC4 is the live install+self-update drive this
session must run.

Scope note: macOS/Windows per-platform installers are their own ticket
(#2083). This ticket's .deb leg is the Linux operator-app artifact and the
cross-cutting reader/apply wiring.

Not an app report (no origin: app-report marker on this ticket or on #2166);
lands by push, like its parent.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `enhancement` + `ready-for-session`. **Why this is a two-way door:** the whole ticket is additive code and config — a role-keyed branch in `matouChannel.ts`'s feed reader, an install+relaunch leg in the Electron shell, and a new per-platform artifact in the release rail. Every leg is revertible by a later commit, and none is on the one-way-door list: the signing uses the **testing** channel's pinned key the fleet rail already cuts with (not the production release key — that's #2088), so no non-routine spend, no security-posture widening, no member-facing trust accept, no data destruction. **Why `ready-for-session` and not `ready-for-agent`:** the swarm queue reads only `ready-for-agent`, and a swarm worker must not take this. Two of its legs need an interactive session's live standing: - **Leg 1** changes the release rail (`scripts/release-rail/`, `cmd/release-cut`) to publish the operator-app `.deb` onto the live `testing` feed — a live-infrastructure operation, not a push a worker proves in-sandbox. - **AC4 is an explicit live drive** ("an installed `.deb` built from main offers and applies a newer release from the testing feed") — cut a release, build and install an installer, watch it self-update. No swarm worker can produce or prove that. This is the same standing the parent **#2166** needed, which is itself `ready-for-session`. **What proves the ruling:** legs 2 and 3 are red→green unit-testable in-repo (`matouChannel.ts` feed-reader parse + the Electron apply/refuse path); the whole loop is proved by the AC4 live drive. Relabelling is the entire cost of a veto. --- ## Session brief **Blocked by #2166** (dependency wired) — #2166 pins the update channel into the packaged build (`app/src-electron/releaseChannel.ts`, which does not exist on `main` yet because #2166 is unbuilt). Do #2166 first, or land them together. **Verified against the tree (2026-11-04):** - Leg 2 symptom is real: `app/src/lib/matouChannel.ts:50` declares a single top-level `artifact: {url, sha256, …}` on `ReleaseManifest`, while the fleet feed's `internal/matouchannel/matouchannel.go` carries a role-keyed `artifacts` map. `loadFeed()` therefore returns `null` on the real feed and `check()` reports no update. The reader must learn the role-keyed shape and pick the operator-app role for the running platform; a feed with no app role is an honest "no update" (ADR 0100), never a crash. - Leg 3: `MatouChannelClient.apply` (matouChannel.ts:229) only **stages** the verified bytes under `<stateDir>/updates/<version>/`; nothing installs the staged `.deb` and relaunches. Wire the on-launch/on-apply installer that applies the staged, signature-verified artifact and relaunches, refusing a bad signature or digest mismatch (never installing it) — ADR 0098. - Leg 1: `scripts/release-rail/` + `cmd/release-cut` publish `control-plane`/`control-panel`/`agent`/`idss-idp` roles into `channel/testing.json` and never the operator-app `.deb`. Add the per-platform operator-app artifact. **Acceptance** — as filed in the issue body (the four checkboxes stand). AC1–AC3 are unit/seam-provable in-repo; AC4 is the live install+self-update drive this session must run. **Scope note:** macOS/Windows per-platform installers are their own ticket (#2083). This ticket's `.deb` leg is the Linux operator-app artifact and the cross-cutting reader/apply wiring. Not an app report (no `origin: app-report` marker on this ticket or on #2166); lands by push, like its parent.
Author
Member

Ruled by agent under ADR 0174 — veto anytime. Landed the two provable, two-way legs on main (32c8ca22, push mode); relabelling ready-for-human for the residue, which is one-way / design.

What landed (two-way, proven)

AC2 — the reader learns the fleet feed shape. app/src/lib/matouChannel.ts parsed a single top-level artifact; the real feed (get.idss.nz/channel/testing.json) carries a role-keyed artifacts map (internal/matouchannel.ReleaseManifest, ADR 0248), so loadFeed() returned null on it and check() reported no update even when one existed — exactly the "pin checks but shows nothing" gap #2166 left. The reader now reads the fleet manifest shape and selects its own per-platform role app-<platform>-<arch> (operatorAppRole, from process.platform/process.arch, resolved once at the entry into ChannelConfig.appRole). The shared YYYY.MM.N number (DDR 0290 — the app is packaged under the same one via release-number.mjs, so app.getVersion() is directly comparable) orders releases; kind === 'security' raises the strip as advice (ADR 0015); a feed with no app role for this platform is an honest no-update (ADR 0100), never a crash. Bad signature / digest mismatch / wrong key still never stage — the ladder gate is unchanged (proven green).

AC1 (cut side) — the cutter can carry the app build. release-cut --app <os-arch>=<path> (repeatable, optional) carries the per-platform operator-app build as role app-<os-arch> at its immutable versioned URL (channel/<name>/<rev>/app-<os-arch>) — the cut-side contract the reader selects against. Malformed --app is refused before anything is cut.

Proof: app/tests/unit/matouChannel.test.ts rewritten onto the real role-keyed signed fixture (12 tests — platform selection over a sibling control-plane role, no-app-role and different-platform → no-update, security advice, tamper/digest/wrong-key never staged); cmd/release-cut/main_test.go TestCut_AppRolePerPlatform. app update-path suites (50) + vue-tsc + eslint green; go test ./cmd/release-cut/ + go vet + gofmt clean. Commit 32c8ca22.

Why human (the one-way / design residue)

Three legs need a one-way door or a design ruling and so cannot land as a two-way agent change:

  1. AC1 rail build+publish (scripts/release-rail/). No CI can build/package the Electron .deb: the Forgejo runner cannot execute the packaged Electron (the glibc wall, GOTCHAS #377), no workflow runs electron-builder/package-app, and installing on a real machine is already ready-for-human as #471. Which runner packages the operator-app .deb into each cut, and how is a design + infra call. The cut-side contract is ready (--app <os-arch>=<path> → role app-<os-arch>, matching the reader's operatorAppRole); the rail wiring is the remaining half.
  2. AC3 app-side install + relaunch. Installing a system .deb needs root — a security-posture widening (pkexec/privileged dpkg), which is a one-way door under ADR 0174 rule 2, and there is no designed update-install mechanism yet (PACKAGING.md: "the update feed [is] later work"; the current "restart" is only a renderer location.reload()). The whole install+relaunch mechanism (privilege model + relaunch) wants a design ruling before it is built. (Note: "a bad signature/digest is refused, not installed" is already guaranteed — a bad artifact never reaches downloaded, so apply never runs on it; proven by the never-staged tests.)
  3. AC4 the live leg. Needs the testing channel signing seed (a publish-workflow org secret, not on this host) and a real machine to build + install the .deb; it would publish to the feed Whakatōhea Demo pins — non-routine, member-affecting spend.

Overlap with #2169

#2169 (ACs 1–2, split from #2166) is covered by this work on the reader (AC2) and the cut side of AC1; its residue is the same AC1 rail-build leg as above.

**Ruled by agent under ADR 0174 — veto anytime.** Landed the two provable, two-way legs on `main` (`32c8ca22`, push mode); relabelling `ready-for-human` for the residue, which is one-way / design. ## What landed (two-way, proven) **AC2 — the reader learns the fleet feed shape.** `app/src/lib/matouChannel.ts` parsed a single top-level `artifact`; the real feed (`get.idss.nz/channel/testing.json`) carries a role-keyed `artifacts` map (`internal/matouchannel.ReleaseManifest`, ADR 0248), so `loadFeed()` returned null on it and `check()` reported no update even when one existed — exactly the "pin checks but shows nothing" gap #2166 left. The reader now reads the fleet manifest shape and selects its own per-platform role `app-<platform>-<arch>` (`operatorAppRole`, from `process.platform`/`process.arch`, resolved once at the entry into `ChannelConfig.appRole`). The shared `YYYY.MM.N` number (DDR 0290 — the app is packaged under the same one via `release-number.mjs`, so `app.getVersion()` is directly comparable) orders releases; `kind === 'security'` raises the strip as advice (ADR 0015); **a feed with no app role for this platform is an honest no-update (ADR 0100), never a crash.** Bad signature / digest mismatch / wrong key still never stage — the ladder gate is unchanged (proven green). **AC1 (cut side) — the cutter can carry the app build.** `release-cut --app <os-arch>=<path>` (repeatable, optional) carries the per-platform operator-app build as role `app-<os-arch>` at its immutable versioned URL (`channel/<name>/<rev>/app-<os-arch>`) — the cut-side contract the reader selects against. Malformed `--app` is refused before anything is cut. **Proof:** `app/tests/unit/matouChannel.test.ts` rewritten onto the real role-keyed signed fixture (12 tests — platform selection over a sibling `control-plane` role, no-app-role and different-platform → no-update, security advice, tamper/digest/wrong-key never staged); `cmd/release-cut/main_test.go` `TestCut_AppRolePerPlatform`. app update-path suites (50) + `vue-tsc` + `eslint` green; `go test ./cmd/release-cut/` + `go vet` + `gofmt` clean. Commit `32c8ca22`. ## Why human (the one-way / design residue) Three legs need a one-way door or a design ruling and so cannot land as a two-way agent change: 1. **AC1 rail build+publish (`scripts/release-rail/`).** No CI can build/package the Electron `.deb`: the Forgejo runner cannot execute the packaged Electron (the glibc wall, GOTCHAS #377), no workflow runs `electron-builder`/`package-app`, and installing on a real machine is already `ready-for-human` as **#471**. *Which runner packages the operator-app `.deb` into each cut, and how* is a design + infra call. The cut-side contract is ready (`--app <os-arch>=<path>` → role `app-<os-arch>`, matching the reader's `operatorAppRole`); the rail wiring is the remaining half. 2. **AC3 app-side install + relaunch.** Installing a system `.deb` needs **root — a security-posture widening (pkexec/privileged `dpkg`)**, which is a one-way door under ADR 0174 rule 2, and there is **no designed update-install mechanism yet** (PACKAGING.md: "the update feed [is] later work"; the current "restart" is only a renderer `location.reload()`). The whole install+relaunch mechanism (privilege model + relaunch) wants a design ruling before it is built. (Note: "a bad signature/digest is refused, not installed" is **already** guaranteed — a bad artifact never reaches `downloaded`, so apply never runs on it; proven by the never-staged tests.) 3. **AC4 the live leg.** Needs the `testing` channel **signing seed** (a publish-workflow org secret, not on this host) and a real machine to build + install the `.deb`; it would publish to the feed **Whakatōhea Demo pins** — non-routine, member-affecting spend. ## Overlap with #2169 #2169 (ACs 1–2, split from #2166) is covered by this work on the reader (AC2) and the cut side of AC1; its residue is the same AC1 rail-build leg as above.
Author
Member

Ruled by agent under ADR 0174 — veto anytime. (matou-workstation standing session)

This session was launched on #2167 from a ready-for-session snapshot, but on re-checking origin/main + ticket state at commit time I found it had already been landed concurrently — 32c8ca22 (elitebook-03) covers exactly the two provable legs (the role-keyed reader + per-platform selection in matouChannel.ts/channel.ts, and the cutter --app <os-arch>=<path> → role app-<os-arch>), and the ticket is already routed ready-for-human for the residue (comment above, 21:50). I had built the same two legs independently; per the concurrent-session discipline I discarded my full duplicate and did not clobber the landed work.

The one thing the landing left behind: the GOTCHAS #410 NOTE was stale — it still called the reader a single-artifact manifest and pointed the publish half at #2169, both now false. I pushed a docs-only follow-up correcting it to the landed naming and the real residue:

  • 21c67ff7 — GOTCHAS #410: correct the NOTE to the shape fix #2167 landed (docs-only, two-way).

Routing unchanged: I have left the ticket ready-for-human exactly as 32c8ca22 set it. The residue stands as routed there — the rail .deb build+publish (pnpm package, glibc wall), the Electron install+relaunch (root = security-posture widening, no install/relaunch mechanism designed yet), and the live end-to-end leg (needs the testing signing seed + a real machine). No label change, not closing.

**Ruled by agent under ADR 0174 — veto anytime.** (matou-workstation standing session) This session was launched on #2167 from a `ready-for-session` snapshot, but on re-checking `origin/main` + ticket state at commit time I found it had already been **landed concurrently** — `32c8ca22` (elitebook-03) covers exactly the two provable legs (the role-keyed reader + per-platform selection in `matouChannel.ts`/`channel.ts`, and the cutter `--app <os-arch>=<path>` → role `app-<os-arch>`), and the ticket is already routed `ready-for-human` for the residue (comment above, 21:50). I had built the same two legs independently; per the concurrent-session discipline I **discarded my full duplicate and did not clobber** the landed work. The one thing the landing left behind: the **GOTCHAS #410 NOTE was stale** — it still called the reader a single-`artifact` manifest and pointed the publish half at #2169, both now false. I pushed a docs-only follow-up correcting it to the landed naming and the real residue: - `21c67ff7` — GOTCHAS #410: correct the NOTE to the shape fix #2167 landed (docs-only, two-way). **Routing unchanged:** I have left the ticket `ready-for-human` exactly as `32c8ca22` set it. The residue stands as routed there — the rail `.deb` build+publish (`pnpm package`, glibc wall), the Electron install+relaunch (root = security-posture widening, no install/relaunch mechanism designed yet), and the live end-to-end leg (needs the testing signing seed + a real machine). No label change, not closing.
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#2167
No description provided.