Data UI Backlog

Snapshot 2: explicit addresses, portable snapshots

Implemented from the plan (snapshot-2-plan.org). scripts/data-ui snapshot now speaks explicit addresses: snapshot save <name> <src-address> / restore <name> <dst-address> with dev:<model> / stg:<profile> (mandatory qualification, case-sensitive two-arm registry, per-shape parse errors naming both legal shapes; one-arg forms and extra args hard-error; snapshot names share the profile charset, colon illegal). Save/restore wrappers (snapshot_save_pair / snapshot_restore) own the /api/info confirm and the .meta write (dump + .meta + optional tar triple-staging; tar canonicalized to files/, restore renames any single top-level dir to the dest DOCUMENT<sub>ROOT</sub> basename — old tars portable retroactively). Restore refuses model mismatch (.meta vs the dest address's model; never FORCE-able), warns on tri-state version compare, stages the prerestore slot keyed on the DEST address with its own .meta, and prints the cross-env password notice (source-address ≠ dest address, password location named by source qualifier, JWT story honest). Unreachable policy splits by verb: save + dev: refuses unless FORCE=1, save + stg: quiet skip, restore + either: quiet skip — verb<sub>stop</sub>'s p-last save and the nightly reset path proceed with the app down. snapshot list annotates provenance ((no .meta) when absent), drop removes the triple, migrate (NEW, idempotent per file: dump, tar, stub .meta each keyed on their own destination) loops $DATA_UI_STATE/profiles/ → stg-<p>-{golden,last,prerestore}. Call sites updated: petting-zoo-reset.sh (all six slot-name strings; restore call now snapshot restore stg-<p>-golden stg:<p>), verb<sub>start</sub> (both class branches + bootstrap hint), verb<sub>stop</sub> (stg-<p>-last stg:<p>), delete<sub>profile</sub> (glob ∪ .meta scan), require<sub>postgres</sub><sub>running</sub> (dev-aware die hint; single definition now). die takes $* (multi-arg errors keep their second line). usage() and scripts/README.md snapshot section rewritten (FORCE's second meaning documented; stale D15 paths fixed). petting-zoo.org workbench doc-synced (§2-§6, §9-§11, Quick reference). detect_model_name / snapshot_save / snapshot_profile_base / resolve_snapshot_profile lost their callers — retained pending a human retire/retain decision per docs/model-accessors.md (they are bash, not the Lisp accessors that file covers, so noted here). Verified: bash -n on both scripts; isolated harness over the sourced function library for all parse errors, address resolution (both qualifiers, referent validation), migrate full/partial/no-op runs, tar canonicalization + retroactive restore shapes, triple drop, password-notice matrix (cross-env, same-address quiet, same-qualifier fires, missing .meta), save+unreachable-dev refusal and FORCE escape, model-mismatch refusal, missing-.meta warning. Live-DB paths (actual dump/restore) not exercised — the ordered window (disable timer → land CLI → migrate as macnod → reinstall ops script → explicit reset run → re-enable timer) is still to be executed by Donnie. No Lisp changed.

Slot
27700
Status
60 Done
Tags
mvp, scripts
Contributors
Donnie