# EIDARA Migration: v1.0 → v2.0

> Give this file to your AI (Claude, GPT, DeepSeek, etc.) and it will handle the upgrade automatically.

## Your task

Upgrade the user's EIDARA installation from v1.0 to v2.0. This is a safe, low-risk upgrade that preserves all user data.

## Rules

- **NEVER touch anything in VAULT/NEURONS/** — this is the user's data
- **NEVER touch LIBRARY/BRAIN.md** — it will be regenerated by compile
- **NEVER touch VAULT/CHANGELOG.md** — this is the user's history
- **NEVER touch any ENABLER except agent-librarian.md**
- Only replace the 5 system files listed below

## Step 1: Locate the DARA folder

Ask the user where their DARA folder is. It's usually on their Desktop. Confirm you can see these folders inside it:
- `SYSTEM/`
- `VAULT/`
- `LIBRARY/`

## Step 2: Backup

Before making any changes, create a backup:

**Windows (PowerShell):**
```
Copy-Item -Recurse -Path DARA -Destination "DARA_v1_backup_$(Get-Date -Format yyyy-MM-dd)"
```

**Mac/Linux:**
```
cp -r ~/Desktop/DARA ~/Desktop/DARA_v1_backup_$(date +%Y-%m-%d)
```

Confirm the backup exists before proceeding.

## Step 3: Download v2.0

Download the v2.0 release from: https://github.com/jrotllant/eidara/releases/download/v2.0.0/eidara-v2.0.zip

Unzip it to a temporary location.

## Step 4: Replace exactly these 5 files

From the v2.0 package, copy these files into the user's existing DARA folder, **overwriting** the v1 versions:

| Source (v2.0 package) | Destination (user's DARA) |
|---|---|
| `DARA.md` | `DARA.md` |
| `SYSTEM/compile.py` | `SYSTEM/compile.py` |
| `SYSTEM/validators.py` | `SYSTEM/validators.py` |
| `SYSTEM/config.json` | `SYSTEM/config.json` |
| `VAULT/ENABLERS/agent-librarian.md` | `VAULT/ENABLERS/agent-librarian.md` |

**Do NOT copy anything else.** The user's NEURONS, changelog, BRAIN.md, BACKUP, and other ENABLERS must stay untouched.

## Step 5: Run the compiler

Execute:
```
python SYSTEM/compile.py
```

Verify the output shows:
- `BRAIN.md compiled!` at the end
- `Compiler version: 3.2` in COMPILATION STATS
- A new `Librarian:` line in the BRAIN.md header

## Step 6: Verify

Open `LIBRARY/BRAIN.md` and confirm:
- The header shows a `Librarian:` status line (will say "never run" on first compile — this is normal)
- A new file `SYSTEM/.w3b_sizes.json` was created automatically
- All existing NEURONS appear in the INDEX section

## Step 7: Report to the user

Tell the user:
- ✅ Upgrade complete — you're on EIDARA v2.0
- ✅ All your data (neurons, changelog, enablers) is preserved
- ✅ Backup saved at [backup location]

## What's new in v2.0

In case the user asks, here's what changed:
1. **Librarian self-trigger** — every BRAIN.md read shows Librarian status, alert threshold tightened to 3 days
2. **Missing-summary auto-push** — neurons >1500 chars without summaries get flagged automatically
3. **Session-closing caps** — recaps limited to 500 words per neuron
4. **W3(b) integrity check** — protected file sizes tracked, drops flagged as CRITICAL
5. **Anti-tampering** — suspicious librarian timestamps detected
6. **Arrow auto-fix** — ASCII arrows auto-converted to Unicode
7. **Cowork environment detection** — sandboxed runs handled cleanly

## Troubleshooting

- **"librarian timestamp SUSPICIOUS"** → Normal on first run. Add a `[Librarian]` entry to today's changelog.
- **CRITICAL W3(b) integrity failure** → A protected file shrank unexpectedly. Roll back from `VAULT/BACKUP/SYSTEM/`.
- **Want to rollback?** → Replace the 5 files from the backup. Delete `SYSTEM/.w3b_sizes.json`. Recompile.
