Repository navigation
Take the sidecar's git SHA from git, not a stale lockfile - #3
Merged
Merged
Conversation
build-core.ts parsed packages/maximal/client/package-lock.json for the git URL maximal-core was once installed from, and baked the SHA in that URL into the compiled sidecar as __MAXIMAL_GIT_SHA__. That is wrong twice over in a workspace: pnpm does not install from that lockfile, and the SHA it carried (c44284be) named a commit that is not what gets compiled -- coreRoot is a symlink to packages/maximal-core, so the code comes from this checkout. git rev-parse HEAD is the commit that actually produced the binary, and falls back to an empty string where git is unavailable, as the old parse did. Deleting the lockfile is then safe -- nothing else reads it -- and it removes a SOURCES.md violation plus 11 dependabot alerts raised against an install that never happens (extract-zip, tar, tmp, keyed to that manifest). Verified: the sidecar carries HEAD once and the stale pin zero times, still reports 0.6.3, and build+typecheck pass 8/8 after a --frozen-lockfile install.
stuffbucket
added a commit
that referenced
this pull request
Aug 18, 2026
**Stacked on #3** — base is `build/sidecar-provenance-from-git`, not `main`. The SHA assertion only means something once `build-core.ts` bakes `git rev-parse HEAD`, which is #3. Merge #3 first and this retargets to main automatically. ## What this restores The macOS packaging job removed in `f1e1d04` asserted that the packaged app's sidecar reported the *workspace* maximal-core version — the one check that would catch the client silently falling back to the stale git pin it ships with upstream. `ci.yml` has carried a comment since then saying *"That check has no replacement yet."* This is the replacement. ## Why it does not need a Mac The old check ran `maximal-core --version` inside the `.app`. The sidecar is compiled `--target=bun-darwin-arm64` and cannot execute on `ubuntu-latest` — but it can be **read**: 1. `packages/maximal/client/node_modules/@stuffbucket/maximal-core` resolves to `packages/maximal-core` → the dependency is the workspace copy, not a git tarball. 2. The compiled sidecar embeds `HEAD` → it was built from that copy in this run, not restored stale from a cache. Together those are the property the old job proved, minus the packaging step. ## Both negative cases exercised A check that cannot fail is not a check, so I broke it deliberately: ``` HEAD moved one commit on -> sha assertion FAILS (binary predates HEAD) sidecar removed -> existence assertion FAILS normal build -> both PASS ``` ## What is still not covered This proves the sidecar's provenance, not that `electron-forge` produces a working `.app`. That genuinely needs a Mac and belongs with `stuffbucket/macos-builder` at release time, per AGENTS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of a series splitting up the build/dependency cleanup. Independent of the rest.
What was wrong
packages/maximal/client/scripts/build-core.tsreadpackage-lock.jsonto find the git URLmaximal-corewas once installed from, and baked that URL's SHA into the compiled sidecar as__MAXIMAL_GIT_SHA__.In a workspace that is wrong twice over:
packages/maximal/client/package-lock.jsondescribes an install that never happens.c44284be, named a commit that is not what gets compiled.coreRootresolves tonode_modules/@stuffbucket/maximal-core, a workspace symlink topackages/maximal-core— so the code comes from this checkout, not from that git ref.What changed
git rev-parse HEAD— the commit that actually produced the binary. Falls back to an empty string where git is unavailable, exactly as the old parse did.Deleting the lockfile is then safe; a grep confirms nothing else reads it.
Why it is worth doing now
Three independent reasons converge on the same file:
SOURCES.mdrule: "Do not add per-package lockfiles. The root lockfile is the only one that applies; a second implies a pinning that is not in effect."__MAXIMAL_GIT_SHA__— this is the "silent fall-back to the stale git pin" the deleted macOS job used to catch.extract-zip,tar,tmp). They describe an install that never happens, and go away with the file.Verification
Not in this PR
packages/maximal/site/bun.lock— same class, 3 more phantom alerts.pnpm-lock.yaml. All transitive build tooling;[email protected]has no patch at all. Worth doing after sidecar-version verification is restored, since nothing currently notices if packaging breaks.