Repository navigation
Verify the sidecar came from this workspace - #4
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.
Restores what the deleted macOS packaging job proved: that the client bundles THIS workspace's maximal-core rather than the stale git pin it ships with upstream. That was the one check standing between a silent fall-back and a release, and it has had no replacement since f1e1d04. The old check ran maximal-core --version inside the packaged .app, which needs a Mac. Neither assertion here does. The sidecar is compiled --target=bun-darwin-arm64 and cannot execute on ubuntu, but it can be read: 1. packages/maximal/client/node_modules/@stuffbucket/maximal-core resolves to packages/maximal-core, so the dependency is the workspace copy and not a git tarball. 2. The compiled sidecar embeds HEAD, so it was built from that copy during this run rather than restored stale from a cache. Both negative cases were exercised rather than assumed: with HEAD moved one commit on, the sha assertion fails; with the binary removed, the existence assertion fails. A check that cannot fail is not a check.
The verification step added in this branch failed on its first run against main: sidecar does not embed HEAD (aa31080) -- built from something else Not a flake, and not a wrong assertion. maximal-client#build declares outputs: [resources/bin/**], so turbo restored a sidecar compiled at an earlier commit. The git SHA baked into that binary is not part of the task's input hash, so turbo correctly considered the task up to date while the artifact carried a commit that was no longer HEAD. A binary that embeds its commit has to rebuild when the commit changes. Declaring GITHUB_SHA as an env input does exactly that, and only in CI: it is unset locally, so developer builds keep caching. The rebuild is a sub-second compile (754ms in the last CI run), paid once per run. Verified: GITHUB_SHA=aaa and =bbb each produce a cache miss, while unset returns to the same hash and replays. Third instance this session of one pattern -- a per-commit value outside the task hash. The others were MAXIMAL_TEST_TRACE and the restored JUnit report.
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.
Stacked on #3 — base is
build/sidecar-provenance-from-git, notmain. The SHA assertion only means something oncebuild-core.tsbakesgit rev-parse HEAD, which is #3. Merge #3 first and this retargets to main automatically.What this restores
The macOS packaging job removed in
f1e1d04asserted 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.ymlhas 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 --versioninside the.app. The sidecar is compiled--target=bun-darwin-arm64and cannot execute onubuntu-latest— but it can be read:packages/maximal/client/node_modules/@stuffbucket/maximal-coreresolves topackages/maximal-core→ the dependency is the workspace copy, not a git tarball.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:
What is still not covered
This proves the sidecar's provenance, not that
electron-forgeproduces a working.app. That genuinely needs a Mac and belongs withstuffbucket/macos-builderat release time, per AGENTS.md.