Skip to content

feat(workspaces): native cross-platform bootstrap — bundle git (dugite) + port bash to Node#363

Open
luokerenx4 wants to merge 1 commit into
masterfrom
feat/native-bootstrap
Open

feat(workspaces): native cross-platform bootstrap — bundle git (dugite) + port bash to Node#363
luokerenx4 wants to merge 1 commit into
masterfrom
feat/native-bootstrap

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

Workspace creation (the Harness: every workspace is a fresh git repo) had two external deps that break on a bare machinebash (the bootstrap scripts) and system git. bash is absent on Windows; git is latent on Mac too (a fresh Mac's /usr/bin/git is an Xcode-CLT stub — our dev Macs only have it because CLT was installed long ago, a dogfooding blind spot). So workspace creation failed on a bare Windows box and would on a bare Mac.

Now it needs neither:

  • Bundle git via dugite (GitHub Desktop's package; postinstall fetches a per-platform standalone git — same per-platform model as longbridge, picked up by electron-builder's node_modules inclusion under asar:false). Pinned exact (3.2.2, embedded git 2.53.0).
  • Port the bash bootstraps to Node: templates/_common.mjs (the sole dugite importer, exposes git()), chat/bootstrap.mjs, auto-quant/bootstrap.mjs. The launcher spawns them on the Electron-bundled Node (process.execPath + ELECTRON_RUN_AS_NODE) — no bash, no shebang reliance, plain ESM.
  • Route all git through the bundled git: runGit (initial commit) and git-service (panel log/branch/status) → dugite's exec().
  • template-registry prefers bootstrap.mjs, falls back to bootstrap.sh for third-party templates (which still need bash where they run).

⚠️ dugite must stay in pnpm.onlyBuiltDependencies — its postinstall fetches the git binary; drop it and node_modules/dugite/git/ is silently empty (no install error, runtime failure). Release CI now asserts the binary is present per-platform.

Test plan

  • npx tsc --noEmit clean
  • pnpm test — 2003 passing
  • pnpm test:e2e — chat/auto-quant create flow via real dugite, incl a PATH-stripped case (no system git/bash on PATH) proving the bare-machine path
  • packaged mac .app carries node_modules/dugite/git/bin/git (2.53.0, runs) + the .mjs templates; old .sh gone
  • bare Windows acceptance (cloud Windows box, no Git-for-Windows): create chat + auto-quant workspaces — the definitive proof, runs on dogfood

Boundary touch

Workspace launcher + packaging only. No trading/auth/broker/migration logic. Adds one runtime dep (dugite) + its onlyBuiltDependencies entry.

🤖 Generated with Claude Code

…e) + port bash to Node

Workspace creation (the Harness: every workspace is a fresh git repo) had two
external deps that break on a bare machine: bash (the bootstrap scripts) and
system git. bash is absent on Windows; git is latent on Mac too (a fresh Mac's
/usr/bin/git is an Xcode-CLT stub — our dev Macs only have it because CLT was
installed long ago). So workspace creation failed on a bare Windows box, and
would on a bare Mac.

Now it needs neither:
- Bundle git via dugite (GitHub Desktop's package; postinstall fetches a
  per-platform standalone git — same per-platform model as longbridge, picked
  up by electron-builder's node_modules inclusion under asar:false).
- Port the bash bootstraps to Node: templates/_common.mjs (the sole dugite
  importer, exposes git()), chat/bootstrap.mjs, auto-quant/bootstrap.mjs. The
  launcher spawns them on the Electron-bundled Node (process.execPath +
  ELECTRON_RUN_AS_NODE) — no bash, no shebang reliance, plain ESM.
- Route ALL git through the bundled git: runGit (initial commit) and
  git-service (panel log/branch/status) → dugite's exec().
- template-registry prefers bootstrap.mjs, falls back to bootstrap.sh for
  third-party templates (which still need bash where they run).

dugite MUST stay in pnpm.onlyBuiltDependencies — its postinstall fetches the
git binary; drop it and node_modules/dugite/git/ is silently empty. Release CI
asserts the binary is present per-platform.

Verified: tsc clean, 2003 unit tests + e2e (incl a PATH-stripped case proving
no system git/bash) green; packaged .app carries dugite's git 2.53.0 + the
.mjs templates. Closes the bare-Windows / bare-Mac workspace-creation gap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 19, 2026 9:22am

Request Review

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