Skip to content

feat(bootstrap): Unix self-install + multi-platform release artifacts#130

Merged
Artexis10 merged 4 commits into
mainfrom
feat/unix-distribution
Jun 12, 2026
Merged

feat(bootstrap): Unix self-install + multi-platform release artifacts#130
Artexis10 merged 4 commits into
mainfrom
feat/unix-distribution

Conversation

@Artexis10

Copy link
Copy Markdown
Owner

Summary

Closes the distribution gap surfaced after the platform arc: the engine runs on Linux/macOS, but releases shipped only endstate.exe and endstate bootstrap was Windows-only.

endstate bootstrap on Linux/macOS

  • Platform split: bootstrap_windows.go (existing behavior, byte-identical) / bootstrap_unix.go
  • Unix layout: ${XDG_DATA_HOME:-~/.local/share}/endstate/bin/lib/endstate (chmod 0755) + symlink ~/.local/bin/endstate
  • No PATH/shell-rc mutation everaddedToPath: false, one-line stderr hint when ~/.local/bin isn't on PATH (precedent: capture.go winget-retry warning)
  • Self-copy guard (re-bootstrap of the installed copy never clobbers the running binary); idempotent symlink re-point
  • JSON payload shape unchanged (installPath/shimPath/addedToPath; shimPath = symlink on Unix)

Release artifacts (protected area — maintainer-authorized)

  • New publish-unix-artifacts job (ubuntu-latest matrix): endstate-{linux,darwin}-{amd64,arm64} + .sha256, CGO_ENABLED=0, same ldflags version-embedding and trigger model as the windows job; per-artifact asset verification. Windows job untouched.

OpenSpec + docs

  • Change unix-engine-self-install: delta against bootstrap-full-sync (Unix layout/symlink/no-PATH-mutation requirements; Windows behavior preserved)
  • docs/COMPATIBILITY.md: distribution note

Verification

  • go test ./... green (hermetic, build-tagged per platform), go vet, GOOS=windows + GOOS=darwin builds green
  • openspec validate --all --strict 72/72
  • Real WSL smoke: sandboxed bootstrap → XDG layout + 0755 binary + symlink verified, re-run idempotent, installed binary executes via symlink (capabilities OK)
  • Independent code review: no blockers
  • Note: the release workflow itself is exercised on the next tagged release (workflow_dispatch with a tag can dry-run it earlier)

🤖 Generated with Claude Code

Artexis10 and others added 4 commits June 11, 2026 18:42
Split the Windows-only bootstrap command into platform files. The current
Windows behavior moves byte-identically into bootstrap_windows.go; a new
bootstrap_unix.go implements Linux/macOS:

- install to ${XDG_DATA_HOME:-$HOME/.local/share}/endstate/bin, copy binary to
  lib/endstate and chmod 0755 (the copy is non-executable by default)
- symlink $HOME/.local/bin/endstate -> the installed binary, re-pointed
  idempotently (existing target removed first)
- never edit PATH or shell rc files; addedToPath is always false; a one-line
  PATH hint is printed to stderr when $HOME/.local/bin is off PATH (JSON shape
  unchanged)
- self-copy guard: skip the copy when the running binary already resolves to the
  install target, so re-bootstrapping via the installed symlink never truncates it

The BootstrapData payload (installPath/shimPath/addedToPath) is preserved on every
platform; on Unix shimPath is the symlink path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Build-tagged tests so the suite stays green on all three CI OSes. Unix tests
redirect HOME/XDG_DATA_HOME to t.TempDir and assert the 0755 binary, symlink
target, idempotent re-run, payload fields, and stale-file re-point. Windows
tests redirect LOCALAPPDATA and assert the binary+shim and idempotency without
invoking real setx.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a publish-unix-artifacts job on ubuntu-latest that cross-compiles with
CGO_ENABLED=0 for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64,
producing endstate-<os>-<arch> plus a lowercase-hex .sha256 sibling, uploaded
to the same release with the same version-embedding ldflags as the Windows
job. The Windows publish-artifacts job is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tall

Add the unix-engine-self-install OpenSpec change (proposal, tasks, spec delta)
against the bootstrap-full-sync capability: MODIFIED Windows requirements scoped
explicitly to Windows, ADDED Unix requirements for the install layout, symlink,
no-PATH-mutation rule, idempotent re-pointing, and the self-copy guard. Add a
distribution paragraph to docs/COMPATIBILITY.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Artexis10 Artexis10 merged commit f22cd32 into main Jun 12, 2026
3 checks passed
@Artexis10 Artexis10 deleted the feat/unix-distribution branch June 12, 2026 01:07
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