Bootstrap walkthrough

What this layer does

Phase 5 is Joe Blow's first contact with snappy-os. One command at a fresh terminal turns a bare laptop into a fully wired snappy-os node: canonical files on disk, symlinks fanned out to every detected runtime, hooks wired, doctor cron installed. No git. No package manager. No interactive ceremony beyond pasting a key.

Files involved

Robert's machine; Joes start clean).

three-band policy reads.

Step-by-step

  1. Detect platform (mac / linux / windows). No package-manager

dependency — bin/do-spaces.js is bundled.

  1. Detect runtimes on PATH (claude, codex, gemini, openclaw,

cursor, windsurf). Apply the three-band version policy.

  1. Prompt for SNAPPY_MASTER_KEY (or read from env, 1Password CLI,

Doppler, or the <inviteCode> baked into /install/<code>).

  1. Pull both canonicals via Worker:
   snappy-os pull --force --scope all --repo os
   snappy-os pull --force --scope all --repo kernel
  1. Run symlink-runtimes.sh for every detected runtime.
  2. Wire hooks (canonical order, dedup on re-run).
  3. Generate Codex 3-file shims.
  4. Sync runtime instruction files (CLAUDE.md →

AGENTS.md / GEMINI.md / .cursorrules / .windsurfrules / .github/copilot-instructions.md).

  1. Install the doctor self-test cron:

30 */6 * * * snappy-os doctor --silent || snappy-os alert "doctor-failed".

  1. Smoke-test: program.md exists, symlinks resolve, _status 200,

at least one skill visible per runtime in the parity matrix.

  1. Print "next steps" punch list (sample slash commands, where to

read program.md, telemetry opt-out, support channel).

Three-band version policy

BandBehaviour
version < minREFUSE to wire that runtime; print "runtime upgrade required: <name> >= <ver>"; continue with others
min ≤ version < recommendedWarn; proceed with degraded-mode notes
version ≥ recommendedSilent green

Every decision lands in .bootstrap-report.json under runtimes[].decision. The /snappy-ops "System / ops" picker reads this file for the "Bootstrap report" sub-option.

Operational gotchas

and only writes on diff. Smoke step C.1 / step 14 runs bootstrap 3x and asserts hook arrays don't grow.

the same drive. PowerShell and cmd.exe both supported. Cross-drive junctions are rejected with a clear error.

must be migrated before symlinking; symlink-runtimes.sh calls migrate-realdirs.sh first when divergence is safe (SHA match) and surfaces a manual diff prompt when it isn't.

.bootstrap-version is more than one ahead, it prompts the user to re-run npx snappy-os@latest; it does not silently overwrite.

How to verify it's working

decision: "wired" | "warned" | "refused".