From b5ae8923a256ea860d1b8ccb6d1b14b7450bb4ea Mon Sep 17 00:00:00 2001 From: "harmoniqs-amico-agent[bot]" Date: Thu, 5 Nov 2026 10:16:45 +0000 Subject: [PATCH] fix(scripts): armonia-workstation clones renamed, archived and retired repos Clone amicissimo (renamed from amico) instead of amico; drop the archived amico-plugin and the retired opencode fork from CODE, the archived IntonatoQICK.jl from PKGS, and the archived embedded-operators-demo from DEMO_REPOS. --check now reports pre-existing stale checkouts from the old layout as STALE (never removed) and exits nonzero when any are present, instead of passing. Adds tests/test_armonia_workstation.sh (no network, fake roots). Refs harmoniqs/amicode#2135 --- scripts/armonia-workstation | 32 ++++++++++++++++---- tests/test_armonia_workstation.sh | 50 +++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 5 deletions(-) create mode 100755 tests/test_armonia_workstation.sh diff --git a/scripts/armonia-workstation b/scripts/armonia-workstation index f4c15177e..16930f4e4 100755 --- a/scripts/armonia-workstation +++ b/scripts/armonia-workstation @@ -27,18 +27,27 @@ while [ $# -gt 0 ]; do case "$1" in say() { printf ' %s\n' "$*"; } head_() { printf '\n== %s ==\n' "$*"; } -# Code repos: the extension, the design authority, the skill library, the fork. -CODE=(amicode amico amico-plugin opencode) +# Code repos: the extension, the design authority. `amico` was renamed to +# `amicissimo` (cloned into the `amicissimo` directory, which mode_cards.ts and +# WORKSTATION.md expect). `amico-plugin` is archived and `opencode` is a retired +# fork (engine source is packages/app-bundle/overlay/); see harmoniqs/amicode#2135. +CODE=(amicode amicissimo) # DEFAULT_SKILL_ROOTS — package skills resolve as .jl/skills//SKILL.md +# IntonatoQICK.jl is archived (harmoniqs/amicode#2135) and intentionally not cloned. PKGS=(Piccolo.jl Piccolissimo.jl DirectTrajOpt.jl NamedTrajectories.jl Intonato.jl - Intonatissimo.jl IntonatoQICK.jl Altissimo.jl Legato.jl Legatissimo.jl + Intonatissimo.jl Altissimo.jl Legato.jl Legatissimo.jl HarmoniqsBenchmarks.jl PiccoloMultidocs.jl CuQuantum.jl JuliaStaticData.jl jl2py pypiccolo) -# Distiller demo-ingest root. +# Distiller demo-ingest root. embedded-operators-demo is archived (#2135), dropped. DEMO_REPOS=(atoms-demo atom-transport-demo braket-testing cloud-demo cryocmos-spin-demo - embedded-operators-demo fluxonium-demo ions kerr-readout-stanford nv-center-demo + fluxonium-demo ions kerr-readout-stanford nv-center-demo nyu-bosonic-demo nyu-multiqubit-demo spin-qubit-demo stanford-bosonics syndrome-extraction-demo) +# Renamed, archived or retired checkouts a workstation built before #2135 still +# carries. Reported as STALE (never deleted); --check exits nonzero if any exist. +STALE_DIRS=("$HQ/amico" "$HQ/amico-plugin" "$HQ/opencode" + "$HQ/packages/IntonatoQICK.jl" "$HQ/demos/embedded-operators-demo") +STALE=0 clone_into() { # local dest="$1/$2" @@ -60,6 +69,15 @@ if [ "$DEMOS" = 1 ]; then for r in "${DEMO_REPOS[@]}"; do clone_into "$HQ/demos" "$r"; done fi +head_ "Stale checkouts from the pre-#2135 layout (reported, never removed)" +for p in "${STALE_DIRS[@]}"; do + if [ -d "$p" ]; then + STALE=$((STALE + 1)) + say "STALE $p (renamed/archived/retired — remove by hand; not touched)" + fi +done +[ "$STALE" -eq 0 ] && say "ok none" + head_ "Vault mounts -> $VAULTS" # Canonical state lives HERE, not in ~/harmoniqs. ~/harmoniqs/armonia is only a # view symlink onto this root (armonia-init's rule: "never the canonical state"). @@ -123,3 +141,7 @@ if [ -d "$HQ/amicode" ]; then fi printf '\nDone.%s\n' "$([ "$CHECK" = 1 ] && echo ' (--check: nothing was changed)')" + +# --check must not pass a machine that still carries the old layout. +[ "$CHECK" = 1 ] && [ "$STALE" -gt 0 ] && exit 1 +exit 0 diff --git a/tests/test_armonia_workstation.sh b/tests/test_armonia_workstation.sh new file mode 100755 index 000000000..1bd86991b --- /dev/null +++ b/tests/test_armonia_workstation.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# Fixture for scripts/armonia-workstation clone lists (harmoniqs/amicode#2135). +# Renamed / archived / retired repos must not be cloned, and --check on a +# machine carrying the old layout must report the stale directories instead of +# passing. Two fake roots only; no network (--check) and no real $HOME touched. +set -uo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +WS="$HERE/../scripts/armonia-workstation" +[ -x "$WS" ] || { echo "FAIL: $WS not executable"; exit 1; } +fail() { echo "FAIL: $*"; exit 1; } + +SB="$(mktemp -d)"; trap 'rm -rf "$SB"' EXIT +export HOME="$SB/home"; mkdir -p "$HOME" + +# --- 1. static clone lists ------------------------------------------------- +# Extract the three arrays from the script without executing its main body. +# Only the array bodies, with comments stripped: a comment mentioning a retired +# name must not count as the name being cloned. +BODY="$(sed -n '/^CODE=(/,/syndrome-extraction-demo)/p' "$WS" | sed 's/#.*$//')" +[ -n "$BODY" ] || fail "could not locate the CODE/PKGS/DEMO_REPOS arrays" +CODE_BODY="$(grep -E '^CODE=\(' "$WS" | sed 's/#.*$//')" +echo "$CODE_BODY" | grep -qw 'amicissimo' || fail "CODE must clone amicissimo" +echo "$CODE_BODY" | grep -qw 'amico' && fail "CODE must not clone the renamed amico repo" +echo "$CODE_BODY" | grep -qw 'amico-plugin' && fail "CODE must drop archived amico-plugin" +echo "$CODE_BODY" | grep -qw 'opencode' && fail "CODE must drop retired opencode fork" +echo "$BODY" | grep -qw 'IntonatoQICK.jl' && fail "archived IntonatoQICK.jl must be dropped from PKGS" +echo "$BODY" | grep -qw 'embedded-operators-demo' && fail "archived embedded-operators-demo must be dropped from DEMO_REPOS" + +# --- 2. --check on an empty machine: amicissimo is the clone target --------- +OUT="$(HARMONIQS_ROOT="$SB/hq-empty" AMICO_VAULTS_ROOT="$SB/vaults-empty" bash "$WS" --check 2>&1)" +echo "$OUT" | grep -q 'MISSING amicissimo' || fail "--check on an empty machine must report MISSING amicissimo" +echo "$OUT" | grep -qE 'MISSING (amico|amico-plugin|opencode)$' && fail "--check must not expect the retired/renamed repos" + +# --- 3. --check on the OLD layout must not pass ---------------------------- +HQ="$SB/hq-old" +for d in amico amico-plugin opencode; do mkdir -p "$HQ/$d/.git"; done +mkdir -p "$HQ/packages/IntonatoQICK.jl/.git" "$HQ/demos/embedded-operators-demo/.git" +set +e +OUT="$(HARMONIQS_ROOT="$HQ" AMICO_VAULTS_ROOT="$SB/vaults-empty" bash "$WS" --check 2>&1)" +RC=$? +set -e +[ "$RC" -ne 0 ] || fail "--check on the old layout must exit nonzero (stale dirs), got 0" +for d in "$HQ/amico" "$HQ/amico-plugin" "$HQ/opencode" "$HQ/packages/IntonatoQICK.jl" "$HQ/demos/embedded-operators-demo"; do + echo "$OUT" | grep -q "STALE" && echo "$OUT" | grep -q "$d" || fail "--check must report stale directory $d" +done + +# --- 4. --check must never delete anything ---------------------------------- +[ -d "$HQ/amico/.git" ] && [ -d "$HQ/opencode/.git" ] || fail "--check must not remove stale checkouts" + +echo "PASS: armonia-workstation clone lists (amicissimo in, retired/archived out; --check flags stale layout)"