thePeoplesProject | Architecture for Change
← Patterns & Architecture

The Resilience Bootstrap

A self-bootstrapping AI system that starts from a USB stick and a laptop, scales to frontier models with internet, and degrades gracefully without it. Bill+JJ, anywhere, always.

0 USB Stick All contexts, OS images, and tools on one removable drive. Fits in a pocket. Survives anything.
1 Bootstrap Model Llama 3.2 1B Q4. ~700 MB. Runs on CPU. Only job: load the next layer. No internet needed.
2 billsml Bill's personal SLM. Qwen 2.5 1.5B + 37 MB adapter. Personality, memory, values. Fully local.
3 JJ Hermes Full runtime. Config, SOUL.md, skills, memory, llm-wiki. All state. All tools. Local-first.
4 Internet Bridge Optional. When available: frontier models, Telegram sync, email, web. When lost: graceful degradation.
∞ Survivability Bill+JJ persists across any disruption. Solar + lithium = indefinite runtime. No cloud required.

USB Stick Layout

/usb-root/
├── shtf-boot.sh              # Master boot script — run this first
├── shtf-builder.sh           # Stick builder — packs everything onto USB
├── README.md                  # Human-readable instructions
│
├── contexts/                 # All intelligence layers
│   ├── bootstrap/
│   │   └── llama-3.2-1b-q4_k_m.gguf    # ~700 MB — the spark
│   ├── billsml/
│   │   ├── adapter.bin                  # ~37 MB — Bill's personality
│   │   ├── qwen2.5-1.5b-q4_k_m.gguf    # ~1.5 GB — base model
│   │   └── config.yaml                  # billsml inference config
│   ├── hermes/
│   │   ├── hermes-runtime/              # ~50 MB — JJ Hermes binary + deps
│   │   ├── config.yaml                  # Local-first Hermes config
│   │   ├── SOUL.md                      # The prime directive
│   │   ├── memory/                      # Durable memory entries
│   │   └── skills/                      # All installed skills
│   └── knowledge/
│       ├── wiki/                        # llm-wiki KB dump
│       ├── opensource-manuals/          # Offline docs
│       └── survival-guides/             # Practical offline references
│
├── os/                       # Minimal Linux distributions
│   ├── alpine-mini.iso              # ~200 MB — runs entirely in RAM
│   └── ubuntu-server-lts.iso        # ~2 GB — full kernel, package manager
│
└── tools/                     # Essential infrastructure
    ├── ollama-static                # Portable Ollama binary
    ├── python3-minimal              # ~12 MB — embedded Python
    └── base-packages.tar.gz         # Core packages for offline install

Boot Chain: The Startup Sequence

Phase 0 — Environment Detection

The boot script surveys the hardware before doing anything.

Phase 1 — Bootstrap Model

Start the smallest viable intelligence. No internet required.

Phase 2 — billsml (Bill's Personal Model)

The bootstrap model hands off to billsml. Bill's personality loads.

Phase 3 — JJ Hermes Runtime

The full assistant framework loads. JJ Hermes comes online.

Phase 4 — Internet Bridge (Optional)

If internet is detected, upgrade gracefully. If lost, degrade without data loss.

Stick Builder Specification

shtf-builder.sh — The Packager

A self-executing script that builds the bootable USB stick from shared Drive contents.

Workflow:

  1. Bill places the builder script and all context files in a shared Drive folder
  2. Bill plugs in the target USB stick
  3. Bill runs shtf-builder.sh from any laptop
  4. The script auto-detects all removable USB drives and lists them with size, model, and mount point
  5. Bill selects the correct device
  6. The script verifies: is this a USB device? (not internal SATA/NVMe). Is it empty or can be wiped?
  7. The script formats the stick, creates the folder structure, unpacks all contexts
  8. If OS images are present, the script writes them and makes the stick bootable
  9. Progress bar. ETA. Verification pass at the end.
  10. Done. Unplug. Stick goes in the go-bag.
Disk Selector Safety

The builder will not write to internal drives. Period.

# Pseudo-code for disk selection safety:
detect_removable() {
  # Linux: /sys/block/sdX/removable = 1
  # macOS: diskutil info | grep "Removable Media"
  # Windows: Get-PhysicalDisk | where MediaType -eq "Removable"
  for each device:
    if device is internal (SATA, NVMe, fixed HDD):
      IGNORE — never list, never touch
    if device is removable (USB, SD card):
      LIST with size, model, serial, mount point
}

verify_empty_or_confirm_wipe() {
  if device has partitions or filesystem:
    WARN user: "This device contains data. All data will be destroyed. Continue? (y/N)"
    if user says no: ABORT
  if device is NOT removable:
    REFUSE: "This is an internal drive. Cannot write. Aborting."
}

Hardware Requirements

Minimum — Degraded Mode

Runs on any laptop from the last decade.

Recommended — Full Local Mode

Bill's Alienware with Nvidia GPU + solar + lithium.

Optimal — Full Stack with Coprocessors

Multiple GPUs, NPU, dedicated inference hardware.

Scale-Down / Scale-Up Protocol

# Graceful degradation (internet lost):
on_internet_lost:
  swap frontier-model clients → billsml local
  queue outbound messages (Telegram, email)
  disable web_search, web_extract tools
  notify user: "Internet lost. Running local mode. Messages queued."
  continue operating with local tools

# Graceful upgrade (internet restored):
on_internet_restored:
  verify connectivity to OpenRouter
  verify connectivity to Telegram API
  process queued outbound messages
  sync missed inbound messages
  swap billsml → frontier models (per user preference)
  re-enable web tools
  notify user: "Internet restored. Frontier models active. Messages synced."

Total Package Size

Bootstrap model (llama-3.2-1b-q4):     ~0.7 GB
billsml base model (qwen2.5-1.5b-q4):   ~1.5 GB
billsml adapter:                          ~0.04 GB
Hermes runtime + skills + memory:         ~0.1 GB
llm-wiki KB dump:                         ~0.2 GB
alpine-mini.iso:                          ~0.2 GB
ubuntu-server-lts.iso:                    ~2.0 GB
tools (ollama, python):                   ~0.5 GB
survival guides + manuals:                ~0.3 GB
─────────────────────────────────────────────
Total (with Ubuntu):                     ~5.5 GB
Total (Alpine only, minimal):            ~3.8 GB

This fits on any USB stick made in the last decade. It runs on any laptop made in the last decade. It produces a fully functional Bill+JJ with zero internet. It scales up transparently when connectivity returns. It degrades gracefully when connectivity is lost. It is the SHTF AI. It is resilience, operationalized.

Next step: build shtf-builder.sh, populate the Drive folder with the actual model files, and test the full boot chain on the Alienware. Share the stick with others once perfected. Local SHTF AI. Must have.