Skip to content

build(deps): bump the Electron client majors, holding @electron/fuses - #57

Merged
stuffbucket merged 1 commit into
mainfrom
chore/npm-major-electron
Sep 7, 2026
Merged

stuffbucket merged 1 commit into
mainfrom
chore/npm-major-electron

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Group 3 of 4 replacing #37. This one changes the artifact users install, so
read the verification section before merging — a green CI run is not the verdict
here.

Package From To
electron 43.4.0 44.0.0 (both declarations)
@electron/packager 18.4.0 20.3.0
@electron/asar 3.4.1 4.3.0
@vitejs/plugin-react 5.2 / 6.0 6.1 (both declarations)

@electron/fuses 2 is held back

It breaks the peer contract of @electron-forge/[email protected], which
requires ^1.0.0:

✕ unmet peer @electron/fuses
  Installed: 2.1.3
  Wanted:  ^1.0.0:  @electron-forge/[email protected]

Only Electron Forge 8.0.0-alpha.5 and later accept ^2.0.0, and Forge's
latest is still 7.11.2. Pulling a Forge alpha into the signed, notarized
client to satisfy a fuses bump is not a trade worth making — fuses control
runtime hardening on the shipped app. Held at ^1.8.0; unblocks when Forge 8
ships.

The split ratchet emptied itself

Aligning @vitejs/plugin-react on 6.1 removed the last entry, and
verify-workspace.mjs failed as designed:

@vitejs/plugin-react is aligned now — drop it from BACKLOG
FAIL  the known-split list has no stale entries

That file's own note says "When BACKLOG reaches zero, delete it and this
ratchet with it"
, so both are gone. What remains is the check that still does
work — no two workspace packages on different versions of the same
directly-declared dependency — plus DELIBERATE, where a split that is meant
gets named with its reason. This is the ratchet reaching the state it existed to
reach, not a check being switched off.

Verified here

  • Container suite 15/15 tasks; verify:workspace passes (13 assertions).
  • pnpm run package builds the darwin-arm64 app on Electron 44.0.0, and CI's
    packaged-app assertions hold against it — app.asar 1,072,733 bytes, sidecar
    74,311,010 bytes.
  • Peer resolution clean apart from a pre-existing dsh-brand rc.6 vs rc.8
    mismatch that is already on main (from build(deps-dev): bump @deepseek-ai/dsh-attachment from 0.1.0-rc.6 to 0.1.0-rc.8 #40) and unrelated to this PR.

NOT verified here — and it cannot be from a dev machine

Signing, notarization, stapling, and the Gatekeeper acceptance test.

Per AGENTS.md and RELEASING.md this needs:

  1. a prerelease tag dispatched to stuffbucket/macos-builder (the only holder
    of the Developer ID), then
  2. scripts/verify-dmg.sh <tag> <prev-tag> — step 12 is what checks the
    bundle identifier and Team ID did not move, and
  3. a Gatekeeper open on a Mac that has never held the signing identity.

That last one is a precondition for publishing, not a nice-to-have: a bundle-id
or Team-ID change strands every installed copy, since macOS keys TCC grants,
keychain ACLs and LaunchServices registration on the pair. An Electron major is
exactly the kind of change that can move them.

So: green checks on this PR mean the app builds and its contents are intact.
They say nothing about whether a user's Mac will open it.

Replaces part of #37.

@stuffbucket
stuffbucket force-pushed the chore/npm-major-electron branch from 017f960 to bb41919 Compare September 6, 2026 10:09
@stuffbucket

Copy link
Copy Markdown
Owner Author

Rebased onto main (now at #56). The conflict was pnpm-lock.yaml alone — it came from #55 landing about ten seconds after this branch was cut, not from anything in the bumps here.

Resolved by taking main's lockfile and re-resolving against this branch's package.json files, then node scripts/strip-lockfile-hosts.mjs per SOURCES.md — 1,679 shard hosts stripped, 0 remain.

node scripts/verify-workspace.mjs: 13 assertions over 2,727 things, 0 failed. That includes no new dependency is split across the workspace passing with the BACKLOG ratchet deleted, which is the assertion this branch's verify-workspace.mjs change depends on — it fails against the pre-rebase tree because `@vitejs/plugin-react" is only aligned once both declarations move to 6.1.

@electron/fuses is still held at ^1.8.0; the install reports no unmet peer.

@stuffbucket

Copy link
Copy Markdown
Owner Author

The electron package job fails on linux, and I have not found the cause

✖ Finalizing package [FAILED: ENOENT: no such file or directory,
  open '/tmp/electron-packager/tmp-.../resources/app/node_modules/minipass/LICENSE.md']

[email protected] ships LICENSE; [email protected] ships LICENSE.md. Both are in the tree, so a step enumerates the name from one copy and opens it against the other.

What I ruled out, so the next person does not repeat it:

Suspect Verdict
my @electron/packager 18 → 20 bump Not involved. @electron-forge/[email protected] pins @electron/[email protected]; our 20.3.0 is a separate copy used only by maximal/client. The failing task is @stuffbucket/maximal-electron#package, which goes through forge.
my @electron/asar 3 → 4 bump Not involved. packager 18.4.4 resolves @electron/asar: 3.4.1 on this branch and on main — identical.
lockfile drift moving minipass No. Both versions are byte-identical to main's lockfile.

That leaves 43 → 44 as the only change reaching this package, which does not obviously explain a license-file read.

It is platform-specific. pnpm --filter @stuffbucket/maximal-electron run package passes on darwin-arm64 locally; only linux-x64 in CI fails. I cannot reproduce it from this machine, so I am not going to keep guessing at it through 10-minute CI rounds.

Worth a look: forge.config.ts sets derefSymlinks: true and prune: false, and prunePlatformPackages (added in #48) does a recursive readdirSync then rmSync in packageAfterCopy. An enumerate-then-delete ordering against two minipass copies is the shape that would produce exactly this error, and the linux dependency closure is the one that carries both.

Also note my verification gap: locally I ran the root pnpm run package, which is turbo run package --filter maximal-client — it never packages maximal-electron. That is why this reached CI. pnpm --filter @stuffbucket/maximal-electron run package is the command to run next time.

Dependabot has since opened #61 for this same group (it also includes @electron/fuses 2, which is blocked on Electron Forge 8 — see the PR body).

@stuffbucket

Copy link
Copy Markdown
Owner Author

Correction to the line above — a shell quoting slip ate the package name. It should read:

That leaves electron 43 → 44 as the only change reaching this package, which does not obviously explain a license-file read.

stuffbucket added a commit that referenced this pull request Sep 7, 2026
`main` is red at `6d8f346`, and #57 is red with the same error naming a
different file. Neither is a dependency break — which is exactly what
the failing pull requests made it look like.

## The bug

`@electron/packager` derives its staging base from a constant:

```js
// common.js
baseTempDir(opts) {
  return path.join(opts.tmpdir || os.tmpdir(), 'electron-packager')
}

// packager.js
async ensureTempDir() {
  if (this.useTempDir) {
    await fs.remove(this.tempBase)   // the whole shared directory, every run
  }
}
```

The directory *inside* that base is already unique — `stagingPath` calls
`mkdtemp`, which is where `tmp-TRr4aR` comes from — so uniqueness is not
what is missing. The unconditional wipe of the shared **parent** is what
throws it away.

Since #45, CI packages two applications rather than one (`ci.yml`: "Two
Forge builds, not one"). So the second build deletes the first's staged
tree while asar is midway through reading it. asar crawls, `lstat`s
every path, then opens each in turn, so the loss surfaces as ENOENT on a
file it had **already stat'ed** — whichever file it reached at that
instant.

That accounts for the whole symptom set:

| Observed | Because |
|---|---|
| `resources/app/package.json` on `main`,
`node_modules/minipass/LICENSE.md` on #57 | whatever asar was reading
when the wipe landed |
| Failing package moves between `maximal-electron` and `maximal-client`
| whichever build started first loses |
| `lstat` succeeds, `open` ENOENTs, same process | the tree is deleted
between crawl and read |
| Green locally, red in CI | one build locally; two concurrently in CI |
| Red on `main` with no Electron bump | nothing to do with any
dependency |

## The fix

`mkdtemp` one level up, in both applications. Packager still wipes the
base, but it is one this build created and owns, and `move()` relocates
the finished build into `out/`, so nothing accumulates there.

Both applications must set it. One alone still leaves the other wiping a
directory it does not own.

## Verification

Planting another build's staging tree at the shared path — the exact
path from the CI error — and running a package:

```
without this change   sentinel GONE
with this change      sentinel PRESENT
```

No timing dependence: the wipe is unconditional, so this is
deterministic rather than a race that has to be caught. Separately, a
packaged run with this change creates no `electron-packager` base at
all, staging under `forge-maximal-electron-AAbIdm` instead.

`tsc --noEmit` and `eslint` pass in both packages. The real check is
this branch's own `electron package` job, which exercises the two
concurrent builds that were colliding.

## Worth reporting upstream

A fixed, shared temp base that is `rm -rf`'d once per run makes
concurrent `@electron/packager` invocations unsafe for anyone, not just
this repository.
stuffbucket added a commit that referenced this pull request Sep 7, 2026
Held out of #55 because it fails in two packages and both needed
decisions
rather than a bump. Both turned out to be **knip 6 behaviour changes**,
not debt
this repo had accumulated.

## maximal-core

**Five system binaries newly reported unlisted** —
`qemu-system-aarch64`,
`pgrep`, `swtpm`, `schtasks`. OS-provided, not npm binaries, so they
join
`trufflehog` in `ignoreBinaries`.

**Five `TokenUsage*` types newly reported unused — and they are.** This
was the
one that looked risky, since `maximal-core` publishes to GitHub Package
Registry. It isn't:

- the package's surface is the **six entries** in its `exports` map
(`client`, `contract`, `control-contract`, `provider-host`,
`settings-types`,
  `supervisor`) — the token-usage barrel is not one of them;
- a declaration build confirms it: **zero** `TokenUsage*` names anywhere
in
  `dist/lib/*.d.ts`;
- nor is the shape inlined structurally — no `byModel`, `byProvider`,
`buckets`,
  `inputTokens` or `cacheRead` either;
- the one file referencing the summary type (`lib/live/resources.ts`,
via
`Awaited<ReturnType<...>>`) is not reachable from `contract.ts`,
`client.ts`
  or `supervisor.ts`.

Nothing outside could have imported them, because nothing outside could
reach
them. **The types themselves stay in `store.ts`**, where they are
genuinely used
— `TokenUsageTotals` is extended by three of the others. Only the dead
re-export goes.

**Stale ignores removed** — `src/lib/auth/token.ts`,
`@stuffbucket/eslint-config`, `@stuffbucket/maximal-provider-contract`.
knip 6
detects all three as used, so the ignores were hiding nothing.

## maximal

**knip 6 descends into the nested `client/` workspace; knip 5 did not.**
`client/` has its own manifest declaring `vitest`, `react` and
`@playwright/test`, so resolving its imports against `maximal`'s
manifest
produced 14 phantom "unlisted dependencies". `client/` is ignored here
and
analysed on its own terms.

Three workspace dependencies plus `prettier-plugin-packagejson` are
detected as
used now, so those `ignoreDependencies` entries go. `lint-staged`
replaces them
— it is configured through a `package.json` block rather than imported,
which
knip does not count as usage. Same entry `maximal-core` already carries.

## Verification

- knip 6 passes in **both** packages.
- `maximal-core` `check:deep:host` passes end to end.
- Container suite **15/15 tasks**; `verify:workspace` clean; lockfile
  re-resolved and stripped of rotating shard hosts.

Replaces the last held item from #37 that was actually actionable.
`@electron/fuses` 2 stays blocked upstream on Electron Forge 8 (see
#57).
@stuffbucket

Copy link
Copy Markdown
Owner Author

Correction: the electron package failure here was not caused by anything in this PR, and my earlier hypothesis on this thread was wrong.

#69 (landed as ff4fcf3) has the real cause — @electron/packager wipes the shared /tmp/electron-packager base on every run, and since #45 CI packages two applications, the second build deletes the first's staged tree mid-read. I had pointed at prunePlatformPackages in forge.config.ts; those hooks are not involved.

Consistent with that, this job passed on a plain re-run here with no code change. Rebasing onto main to pick up the fix.

@stuffbucket
stuffbucket force-pushed the chore/npm-major-electron branch from bb41919 to 3540c9c Compare September 7, 2026 04:55
@stuffbucket

Copy link
Copy Markdown
Owner Author

Rebased onto main at #68 (ab7eb09), which now carries TypeScript 7 (#67), knip 6 (#68) and the packaging fix (#69).

The rebase itself applied cleanly, but git auto-merged pnpm-lock.yaml, which is not something to trust — an auto-merged lockfile can be internally consistent as text and wrong as a resolution. Reset to main's lockfile, re-resolved against this branch's package.json files, then scripts/strip-lockfile-hosts.mjs per SOURCES.md: 1,722 shard hosts stripped, 0 remain.

node scripts/verify-workspace.mjs: 13 assertions over 2,772 things, 0 failed — including the whole workspace is on one typescript major against TS 7, and no new dependency is split across the workspace with the BACKLOG ratchet deleted.

Resolved versions: electron 44.0.0, @vitejs/plugin-react 6.1.1, @electron/packager 20.3.0, @electron/asar 4.3.0, and @electron/fuses still held at 1.8.0.

The earlier red X was not this PR

For the record, since it sat red for a while: the electron package failure here was #69's bug, not these bumps. @electron/packager wipes a shared staging base at the start of every run, so with two Forge builds in CI the second deleted the first's staged tree mid-pack and asar failed opening a file it had already stat'ed. main was red with the identical error at 6d8f346, naming a different file, with none of these bumps in it.

Still worth deciding

#61 is Dependabot's version of this same group, and it additionally bumps @electron/fuses to 2.1.3 — which breaks @electron-forge/[email protected]'s ^1.0.0 peer, the reason it is held here. The two should not both land.

From the npm-major group of 17, the part that changes the artifact users
install:

  electron              43.4.0 -> 44.0.0   (both declarations)
  @electron/packager    18 -> 20
  @electron/asar        3 -> 4
  @vitejs/plugin-react  5.2 and 6.0 -> 6.1 (both declarations)

@electron/fuses 1 -> 2 is held at ^1.8.0. It breaks the peer contract of
@electron-forge/[email protected], which requires ^1.0.0; only Electron
Forge 8.0.0-alpha.5 and later accept ^2.0.0, and Forge's latest is still
7.11.2. Pulling a Forge alpha into the signed and notarized client to
satisfy a fuses bump is not a trade worth making. It unblocks when Forge
8 ships.

Aligning @vitejs/plugin-react on 6.1 emptied the split ratchet in
verify-workspace.mjs, which failed as designed: "@vitejs/plugin-react is
aligned now -- drop it from BACKLOG". Its own note says to delete the
backlog and the ratchet with it once it reaches zero, so both are gone.
What remains is the check that still does work -- no two workspace
packages on different versions of the same directly-declared dependency
-- and DELIBERATE, where a split that is meant gets named with a reason.

Verified here: the container suite is 15/15, verify:workspace passes,
`pnpm run package` builds the darwin-arm64 app on Electron 44, and CI's
packaged-app assertions hold against it (app.asar 1,072,733 bytes,
sidecar 74,311,010 bytes). Peer resolution is clean apart from a
pre-existing dsh-brand rc.6 vs rc.8 mismatch that is already on main.

NOT verified here, and it cannot be: signing, notarization, stapling,
and the Gatekeeper acceptance test. Those need a prerelease tag through
stuffbucket/macos-builder followed by scripts/verify-dmg.sh, whose step
12 is what checks the bundle identifier and Team ID did not move. Per
AGENTS.md nothing publishes until that passes on a Mac that has never
held the signing identity.
@stuffbucket
stuffbucket force-pushed the chore/npm-major-electron branch from 3540c9c to 3651181 Compare September 7, 2026 08:35
@stuffbucket

Copy link
Copy Markdown
Owner Author

Rebased onto be5f3d0 and re-resolved. Notes on the rebase and the local artifact verification, since this PR's own body says a green CI run is not the verdict.

The lockfile re-resolve was uneventful

Worth recording because it used to be the hard part. .pnpmfile.cjs (#77) landed since this PR was opened, so the re-resolve was a plain pnpm install: it reported dropped 1743 rotating shard-host tarball URL(s) and produced a lockfile with 0 hosts, no strip-lockfile-hosts.mjs sequencing and no manual repair. pnpm run package also left the lockfile untouched at 0 hosts — that is the command that used to poison it worst.

Resolution is what was intended

Package Resolved
electron 44.0.0
@electron/packager 20.3.0 (+ 18.4.4)
@electron/asar 4.3.0 (+ 3.4.1)
@electron/fuses 1.8.0 only
@vitejs/plugin-react 6.1.1, single version

The second packager/asar versions are Electron Forge 7.11.2 pinning ^18.3.5 internally; the packaging path still goes through those, and the 20.x/4.x copies serve the repo scripts off the hoisted root. Expected, not drift.

@electron/fuses resolves to 1.8.0 and nothing else, so the hold this PR describes is intact — no 2.x leaked in transitively.

@vitejs/plugin-react resolves to exactly one version, which is what makes the BACKLOG removal in verify-workspace.mjs correct rather than merely convenient. verify:workspace passes 13/13 locally.

Artifact verification on macOS arm64

Both apps package (12/12 tasks successful), and the built framework really is the new major:

Chrome/152.0.7977.54 Electron/44.0.0

I A/B'd the signing surface against Electron 43.4.0 built from main at 51ca078, same machine, same command. codesign -dv and codesign --verify --deep --strict output for both apps is byte-identical between 43 and 44:

Maximal.app      flags=0x20002(adhoc,linker-signed)  Signature=adhoc
Stuffbucket.app  flags=0x2(adhoc)                    Signature=adhoc

Both emit the same adhoc-verify complaints on 43 as on 44, so they are the pre-existing shape of a dev package build, not something this bump introduces. That is consistent with both forge.config.ts files deliberately setting no osxSign/osxNotarize — stuffbucket/macos-builder owns signing and notarization in the release workflow.

What this does not establish

Gatekeeper, notarization and the designated requirement. Those need the macos-builder and Apple's notary queue and are gated at release, not at PR time — no PR-level run can settle them. What the above does establish is that Electron 44 changes nothing about the packaging or signing surface relative to 43.

@stuffbucket
stuffbucket merged commit 5c3092e into main Sep 7, 2026
6 checks passed
@stuffbucket
stuffbucket deleted the chore/npm-major-electron branch September 8, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant