-
Notifications
You must be signed in to change notification settings - Fork 2
Seamless armonia migration — bootstrap + migration + retirement scripts (#386) #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c828d10
edc43a6
9d4364b
1abf0b4
06c8033
2416205
2fa568b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Armonia subsumes ~/.amico — symlink farm now, ArmoniaService retirement later | ||
|
|
||
| Status: accepted (2026-08-14) | ||
|
|
||
| All amicode product state migrates from `~/.amico/` into `~/armonia/data/`. The | ||
| `~/.amico/` directory becomes a backward-compatible symlink farm (phase B) that is | ||
| retired by a user-run cleanup script once ArmoniaService resolves paths directly | ||
| (phase C). Opencode's XDG paths (`~/.config/opencode/`, `~/.local/share/opencode/`) | ||
| are untouched — they belong to the engine, not the product. | ||
|
|
||
| **Why:** `~/.amico/` accumulated ~15 distinct paths organically. Issue #326 (Armonia | ||
| as default workspace) needs a single tree it can browse, watch, and resolve against. | ||
| Leaving state scattered across two roots (`~/armonia/` for repos+artifacts, | ||
| `~/.amico/` for everything else) means the sidebar can never show the full picture | ||
| and the session cwd story has a permanent asterisk. Subsuming everything under | ||
| armonia gives one tree, one backup target, one mental model. | ||
|
|
||
| **Why a symlink farm (not a code refactor first):** the codebase has ~30 call sites | ||
| that resolve `homedir() + ".amico" + X`. Rewriting them all requires ArmoniaService | ||
| (#326) which is a substantial PR. The symlink farm makes the filesystem migration | ||
| zero-breakage today — every existing path resolves transparently — while the code | ||
| catches up at its own pace. | ||
|
|
||
| **Why config files stay as real files at `~/.amico/` (not symlinked):** file-level | ||
| symlinks break if the target is deleted and recreated (the symlink becomes dangling | ||
| and a new real file appears at the original path). Credential files like `cloud.json` | ||
| are written atomically (delete + rename) by multiple code paths. Directory symlinks | ||
| do not have this problem — `readdir` follows them transparently. | ||
|
Comment on lines
+24
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Resolve the phase-B configuration exception. These lines keep State whether configuration files remain canonical under 🤖 Prompt for AI Agents |
||
|
|
||
| **Considered:** | ||
|
|
||
| - **(A) `~/.amico/` stays canonical, armonia is browse-only** — rejected: perpetuates | ||
| two roots, the sidebar is a projection of reality rather than reality itself, and | ||
| "where does X live?" remains a question with two answers. | ||
| - **(B) Single symlink `~/.amico → ~/armonia/data`** — rejected: forces a flat layout | ||
| inside `data/` that matches `~/.amico/`'s structure exactly, blocking any | ||
| reorganization (e.g. `data/config/`, `data/env/julia/`). | ||
| - **(C) Immediate code refactor (no symlink phase)** — rejected: blocks the migration | ||
| on #326 and a ~30-site refactor; users cannot benefit until both land. | ||
|
|
||
| **Chosen: (D) symlink farm now, retirement script gated on ArmoniaService.** The | ||
| retirement script (`tools/retire-amico-symlinks.sh`) ships in the same PR and checks | ||
| for a marker file (`~/armonia/.armonia-active`) written by ArmoniaService on boot | ||
| before it will run. This ensures the user cannot accidentally retire the symlinks | ||
| while the code still reads through them. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| **Layout after migration:** | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add a language identifier to the layout fence.
🧰 Tools🪛 markdownlint-cli2 (0.23.2)[warning] 49-49: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| ~/armonia/data/ | ||
| config/ profile.json, cloud.json, pasqal.json, connections.json, lab.toml, mounts.toml | ||
| env/julia/ the provisioned Julia project | ||
| problems/ problem workspaces | ||
| runs/ run output | ||
| vaults/ mounted vaults | ||
| library/ uploaded papers | ||
| fleet/ fleet registry + tunnel state | ||
| ledger/ runs.jsonl, claims.jsonl, approvals/ | ||
| devices/ calibration state | ||
| authoring/ authoring.json | ||
| amicode/ entitlements, solver mode | ||
| ``` | ||
|
|
||
| **Exit condition (phase C):** all `homedir() + ".amico" + X` callers migrated to | ||
| `ArmoniaService.resolve()`, ArmoniaService writes `~/armonia/.armonia-active` on | ||
| boot, the retirement script passes its gate check, and the user runs it. Phase C is | ||
| a separate issue gated on #326 with the `hitl` label. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: harmoniqs/amicode
Length of output: 8547
🏁 Script executed:
Repository: harmoniqs/amicode
Length of output: 15259
🏁 Script executed:
Repository: harmoniqs/amicode
Length of output: 18425
🏁 Script executed:
Repository: harmoniqs/amicode
Length of output: 18205
Align the Armonia layout contract across documentation and setup scripts.
The setup scripts provision
repos/{packages,demos}, flatrepos/<name>projects, anddata/{env,problems,runs,vaults}. They map~/.amico/juliatodata/env, notdata/env/julia. UpdateCONTEXT.mdand ADR 0008 to match, or update the scripts and migration logic to implement the documented paths. Also resolve the config contract: ADR 0008 keeps config files in~/.amico/, while the other documentation places them underdata/config.📍 Affects 2 files
CONTEXT.md#L46-L47(this comment)docs/adr/0008-armonia-subsumes-amico-state.md#L50-L52🤖 Prompt for AI Agents