Add engine binary distribution — cross-compile, release, auto-bootstrap - #47
Conversation
The Go engine was never distributed with the plugin, so all YAML workflows fell through to markdown fallbacks and Claude ran without determinism. - Add build-for/build-all targets to Makefile (linux, darwin, windows x amd64, arm64) - Rewrite release workflow: draft release → parallel matrix build → upload binaries → publish - Add scripts/install-engine.sh: auto-detect platform, download from GitHub releases - Wire bootstrap check into all 4 commands and 3 skills that invoke the engine - Remove all "Fallback (no engine)" markdown — engine is required, no honor system - Add engine health check to /devkit:status
Release workflow:
- Fix tag-before-release race: inline cleanup if gh release create fails
- Fix shallow checkout: fetch-depth 0, ref main, tag version-bumped commit
- Fix PR title injection: pass notes via env var, not ${{ }} interpolation
- Fix cleanup conditions: handle cancelled state, use ::warning:: annotations
- Add checksums.txt generation in publish step
Install script:
- Add checksum verification (sha256sum/shasum) against checksums.txt
- Use curl -fSL (capital S) to keep error messages visible
- Validate downloaded file is non-empty before installing
- Export PATH after ~/.local/bin fallback so binary is immediately usable
- Remove 2>/dev/null from mkdir to surface failure reasons
- Add explicit error messages on mv failures
- Add --upgrade flag for re-downloading
Makefile:
- Replace $(eval) footgun with shell conditional for .exe extension
- Add sync-version prerequisite to build-for target
Bootstrap (DRY fix):
- Extract shared ensure-engine.sh wrapper script
- All 7 commands/skills now call ensure-engine.sh instead of inline find
- ensure-engine.sh finds install-engine.sh relative to itself first
- Guard against empty find result with explicit error
- Fix relative paths in fallback messages to absolute GitHub URLs
Review fixes: - Checksum grep: use awk exact column match instead of substring grep - Guard empty find in all command/skill markdown (prevents bash "" hang) - Source install-engine.sh instead of subprocess (PATH exports propagate) - Remove 2>/dev/null from checksum download (surface failure reasons) - Post-install PATH verification in ensure-engine.sh Windows support: - Search APPDATA and LOCALAPPDATA plugin paths in ensure-engine.sh - Search Windows plugin paths in all command/skill find patterns - Check LOCALAPPDATA/devkit in post-install PATH scan
|
Windows PATH issue with That directory isn't on PATH by default, so after install the binary won't be found by The Linux Recommendation: After installing to if [[ "$OS" == "windows" ]]; then
install_dir="$LOCALAPPDATA/devkit"
mkdir -p "$install_dir"
mv "$tmp/devkit.exe" "$install_dir/devkit.exe"
export PATH="$install_dir:$PATH" # current session
# Persist to user PATH for future sessions
powershell.exe -Command "[Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ';$install_dir', 'User')"
fiUsing Alternatively, could install to |
- export PATH for current bash session after Windows install - Use PowerShell SetEnvironmentVariable to persist to user PATH (safer than setx which truncates PATH > 1024 chars) - Graceful fallback if powershell.exe not available
Summary
The Go engine was never distributed with the plugin. Every YAML workflow invocation fell through to markdown fallback instructions — Claude ran without any deterministic enforcement. This PR fixes that.
build-for(cross-compile for any GOOS/GOARCH) andbuild-all(6 targets: linux, darwin, windows x amd64, arm64)scripts/install-engine.sh): Auto-detects platform, downloads the correct binary from GitHub releases, installs to/usr/local/bin,~/.local/bin, or%LOCALAPPDATA%/devkit(Windows)devkit workflow run. Hard stop if engine unavailable — no fallback.Why this matters
Without this, the entire deterministic workflow conversion (PRs #38-#44, ~3,600 lines of work) was theater. YAML workflows existed but the engine never ran them. Claude just read the fallback docs and did whatever it wanted.
Test plan
cd src && make build-for GOOS=darwin GOARCH=arm64producesbin/devkit-darwin-arm64cd src && make build-for GOOS=windows GOARCH=amd64producesbin/devkit-windows-amd64.exebash scripts/install-engine.sh --checkexits 1 (binary not on PATH) or 0 (installed)/devkit:statusshows engine health section