Uh oh!
There was an error while loading. Please reload this page.
fix(devx): prune stale objectui worktree registrations before build-console.sh adds one (#14177) - #14417
Merged
Conversation
…onsole.sh adds one (#14177) Resolution mode 2 (sibling `../objectui` checkout) creates a git worktree under this repo's `.cache/`, registered in the SHARED objectui/.git. The documented cleanup (`rm -rf` on the framework worktree, or the script's own `worktree remove --force || rm -rf` fallback) deletes that directory without ever telling objectui, so the registration survives as `prunable`. The next `worktree add` at the same path then dies with exit 128 "already registered worktree" -- which reads like a lock or git fault, not a leftover. Run `git -C SOURCE_ROOT worktree prune` immediately before the `worktree add` that would trip over a stranded registration. Safe by construction: prune only drops registrations whose directory is already gone. Option 2 (an exit trap removing the script's own worktree) is skipped: the script deliberately reuses BUILD_ROOT across runs when the pin already matches (for the CI console-dist cache), and a trap firing on every exit would remove it unconditionally and defeat that reuse.
This was referenced Sep 2, 2026
baozhoutao
marked this pull request as ready for review
September 2, 2026 05:48
baozhoutao
enabled auto-merge
September 2, 2026 05:48
Uh oh!
There was an error while loading. Please reload this page.
baozhoutao
deleted the
claude/issue-14177-build-console-worktree-prune
branch
September 2, 2026 06:13
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 freeto 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.
Fixes#14177
What
scripts/build-console.shresolution mode 2 (sibling../objectuicheckout)creates a git worktree under this repo's
.cache/, registered in theshared
objectui/.git. The documented cleanup (rm -rfon the frameworkworktree, or the script's own
worktree remove --force || rm -rffallback at:85) deletes that directory without ever telling objectui, so theregistration survives as
prunable. The nextworktree addat the same paththen dies with
fatal: ... is a missing but already registered worktree,exit 128 — which reads like a lock or git fault, not a leftover of a previous
run's cleanup.
Fix
Run
git -C "$SOURCE_ROOT" worktree pruneimmediately before theworktree addat (former):89, inside theif [[ ! -d "$BUILD_ROOT" ]]branch — the only path in the script that reaches
worktree addinresolution mode 2, whether the directory is missing because a previous run
never created it or because the force-remove-or-
rm -rffallback above juststranded it.
pruneonly drops registrations whose directory is alreadygone, so it is safe by construction.
Option 2 (an exit trap removing the script's own worktree) is
deliberately not taken: the script reuses
BUILD_ROOTacross runs whenthe pinned SHA already matches (
:82-87) — that's what backs theconsole-distCI cache keyed in.github/workflows/ci.yml:1827. A trap thatremoved the worktree on every exit would defeat that reuse unconditionally,
which is a bigger behavior change than "one line" for a plain win. Route 1
alone repairs the state regardless of which run stranded it, matching the
ruling's rationale.
Fixture proof (before / after)
Real sibling
objectuicheckout not required to prove this — the defect andfix are pure
git worktreemechanics. Reproduced with a throwaway fixturerepo (not the real
objectui):Exit 128 without the fix, exit 0 with it, on the exact
worktree addinvocation the script uses.
Syntax / lint
bash -n scripts/build-console.sh— OK.shellcheck— not installed in this environment (no system binary,pnpm exec shellcheckreportsCommand "shellcheck" not found); not run.Gates
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsat head98b80532(merge-base79b6a22a5oforigin/main) names14 families for
scripts/build-console.sh— all RAN, all PASS:node scripts/check-ci-filter-parity.mjsnode scripts/check-cross-package-test-inputs.mjsnode scripts/check-shard-attestation.mjsnode scripts/check-test-completeness.mjsturbo run testlog; noPREREQUISITE NOT MET)pnpm check:agent-test-spellingpnpm check:bash32-floorpnpm check:cli-command-idspnpm check:console-injectionpnpm check:console-shapnpm check:cross-package-test-inputspnpm check:entry-guardpnpm check:parse-guardpnpm check:pnpm-filter-targetspnpm check:watch-hint-literalAlways-run for
scripts/**dispatches (per dispatch order):pnpm check:ratchet-remedy-authoritypnpm check:declared-population-livecheck:pm-dispatch-gates(~11.5 min): not in the derived 14-family list forthis file surface — not run.
Changeset
Scripts-only change, no package surface (
scripts/build-console.shis notinside any published package's
files). Following the precedent for thesame class of change (#14178 / PR #14391, and
0079e2585): no.changeset/*.mdadded,skip-changesetlabel applied.Generated by Claude Code