fix(cli): guard against @objectstack/console objectui-SHA drift#2507
Merged
Conversation
packages/console/dist is a gitignored, locally-built artifact that only scripts/build-console.sh produces — `turbo run build` never rebuilds it. So pulling a branch that bumps the committed .objectui-sha pin left a stale dist in place, and the CLI silently served a Console built from a different objectui commit (the npm-major version guard can't see a SHA move under a single @objectstack/console version). - build-console.sh stamps the built SHA into dist/.objectui-sha - new scripts/check-console-sha.mjs compares stamp vs pin; hard-gates pnpm dev / dev:crm / dev:todo, and is self-tested in showcase-smoke CI - resolveConsolePath warns at serve time on a drifted dist (all boot paths) - remediation is `pnpm objectui:build`; published installs ship no pin so the guard is a no-op there Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Problem
Pull a branch that bumps the objectui pin (
.objectui-sha) but forget to re-runpnpm objectui:refresh, andpnpm builddoes not regenerate the Console — a Console built from a different objectui commit gets served silently.Root cause:
packages/console/distis gitignored and produced only byscripts/build-console.sh;turbo run buildnever rebuilds it, and the existing CLI resolver guard compares only the npm major of@objectstack/console(blind to the objectui SHA underneath).Scope: local dev only — the release pipeline always rebuilds the Console from the pin, so published artifacts are never affected.
Fix — fail-loud drift guard
build-console.shwrites the built SHA intodist/.objectui-sha(travels withdist/; a cloud Docker overlay that replacesdist/restamps it).pnpm check:console-sha: compares stamp vs the committed pin. Hard-gatespnpm dev/dev:crm/dev:todo; no-ops when the Console isn't built yet.resolveConsolePathwarns when it selects a drifted dist — covers every boot path (os serve, self-host), not justpnpm dev. No-op for published installs (no pin up-tree, so the stamped dist stays authoritative).showcase-smokerunscheck:console-sharight afterbuild-console.shso the stamping mechanism can't silently rot.Remediation the guard prints is
pnpm objectui:build(rebuild at the pinned SHA) — notobjectui:refresh, which would re-bump the pin to your local../objectuiHEAD.Verification
@objectstack/clitscclean;console-resolve.test.ts11 passed (7 existing + 4 new guard cases: drift / in-sync / unstamped / published-install).🤖 Generated with Claude Code