# Post-phe-recovery migration checklist

**Written 2026-07-06 while phe is down. Execute in this order when phe returns.**

## Context

Today's outage exposed that code-on-lab-via-sshfs is fragile: phe went offline and every agent that reads code (yams, yam_sim, yam_calib, cad, figure_maker, backbones, vid_model, paper_writer, 567_project, mac) was degraded. Cameron's 2026-07-06 policy inverts the earlier `code_lives_on_lab` rule:

- **NEW**: Code + small durable artifacts on VPS local disk (with GitHub as canonical remote). Compute artifacts (checkpoints, video, big datasets) on the compute host.
- **OLD** (superseded): All code on lab, VPS reads via sshfs.

This checklist is the execution plan for that flip.

## Execution order when phe is back

### Step 1 — Verify phe is genuinely back (5 min)

```bash
tailscale status | grep phe108     # should show "active", not "offline"
ping -c 3 100.74.71.38             # should succeed
ssh -o BatchMode=yes cameronsmith@100.74.71.38 'hostname && uptime'   # should return
```

If Tailscale-SSH prompts for browser auth, click the URL and re-check.

### Step 2 — Snapshot lab state for the manifest (5 min)

Get the current list of repos on lab so we don't miss anything:

```bash
ssh cameronsmith@100.74.71.38 '
  cd /data/cameron
  for d in repos/*/; do
    if [ -d "$d/.git" ]; then
      echo "$d	$(git -C $d remote get-url origin 2>/dev/null)	$(du -sh $d 2>/dev/null | cut -f1)"
    fi
  done | tee /tmp/lab_repos_manifest.tsv
'
scp cameronsmith@100.74.71.38:/tmp/lab_repos_manifest.tsv /data/cameron/agents_stuff/migration/lab_repos_manifest.tsv
```

Review the manifest. Which repos have `origin` on GitHub? Which don't? Which are Cameron's vs upstream forks?

### Step 3 — Clone fleet-critical repos to VPS local disk (~30 min)

Run `04_code_to_vps_local.sh` — clones from GitHub (not from lab). This is why we do it AFTER verifying phe is back but we DON'T actually depend on phe for this step — GitHub is the canonical source.

Repos to clone (confirmed): [see 04 script `MIRROR_LIST`]:
- `cameronosmith/agents_stuff` — already local, verified.
- `cameronosmith/custom_robot_building` — cad, private
- `earthtojake/text-to-cad` — cad reference, public
- **TBD (Cameron confirms names + which subset to mirror)**:
  - para (probably `cameronosmith/para` — big; may need sparse checkout for code-only)
  - raiden_fork (unknown remote name; check `git -C /data/cameron/para/robot/yam/raiden_fork remote -v` post-phe)
  - Any additional repos surfaced by Step 2's manifest

For repos not on GitHub yet: `04_code_to_vps_local.sh` prints them and skips. Cameron chooses to (a) push to a new GitHub repo, or (b) keep on lab only for now.

### Step 4 — Adjust sshfs mounts: keep data, drop code (~10 min)

Run `05_adjust_sshfs_mounts.sh`:

- **Remove** from sshfs list: `/data/cameron/repos` (now local)
- **Keep** as sshfs from lab: heavy data paths — `para/libero`, `para/video_training`, `para/robot`, `para/para_mac`, `567_augmentation_viewpoint_project`, `tri_diary`, `scratch_files`
- **Direct-mount** (skip lab chain): `yukon_remote` → puget/yukon directly

### Step 5 — Direct-mount puget + yukon (~10 min)

Run `06_direct_mount_puget_yukon.sh`:

Instead of chain-mounting `yukon_remote` through lab's `~/mnt/yukon`, mount yukon and puget directly from VPS via their Tailscale IPs. Now if lab dies again, agents can still reach yukon/puget data. (Requires: Tailscale-SSH from VPS to yukon + puget authorized; may need a browser-auth click each.)

### Step 6 — Vault + memory → GitHub remotes (~15 min)

Run `07_vault_memory_github_remote.sh`:

- `vault/` already has a local git repo with no remote. Create private GitHub repo `cameronosmith/vault` (or reuse existing if one), add as origin, push.
- `~/.claude/projects/-data-cameron-agents-stuff/memory/` has no git at all. `git init`, create private GitHub repo `cameronosmith/manager_memory`, add as origin, push.
- Wire a daily cron push (or use save_scrollback pattern already in place).

This finally retires `project_migrate_offlab_pending` from the memory index.

### Step 7 — Update agent-facing docs (~10 min)

- `shared/GUIDELINES.md` — flip the "Where does code live?" section to reflect new policy. Old table said `repos → sshfs → lab`; new table says `repos → VPS local`.
- `feedback_code_lives_on_lab.md` memory — supersede with `feedback_code_lives_on_vps.md` (leave old file with a redirect note in case any agent references it).
- Ping every claude agent's inbox with a one-line FYI: "code now lives on VPS local disk; sshfs to lab only for heavy data — see updated GUIDELINES.md".

### Step 8 — Verify + close out (~10 min)

- Test `omidlab.net/browse/` — still fast
- Test cad, figure_maker, yams-side agents can read code without hitting lab
- Kill phe → verify agents keep working (except for anything that needs live real-robot connection)
- Update `project_dual_host_architecture.md` and `project_migrate_offlab_pending.md` memories

## Total estimate

~1.5 hours end-to-end, most of it waiting on git clones.

## What we're NOT doing here

- Migrating compute (training, real-robot connections) — those stay on their respective hosts by design
- Migrating big datasets — those stay on lab/puget/yukon by design
- Changing anything about agent addressing (`agents:<name>` tmux windows unchanged)
