M0: Profile backup (S2.6) #15

Closed
opened 2026-08-28 18:33:04 +02:00 by AlexKucera · 1 comment
Owner

Destination

The daily profile snapshot is implemented and tested: every decision the build needs is made (mechanism, contents, liveness gate, failure posture, restore docs, policy constants) and the build ticket below has landed — a working, tested backup pass with PRD/DOX docs amended to match.

Notes

  • Destination override (2026-09-20): unlike a decisions-only map, this effort carries execution to the destination — the final ticket is the build itself (the #13 precedent: its map ended with build ticket #47 landing the code).
  • Consult: CONTEXT.md (Museion Profile, Engine), PRD.md G4 + S2.6 + M0 row, ADR-0009 (no sandbox — real ~/Library paths), Museion/AGENTS.md (gate & provisioning seams), docs/agents/issue-tracker.md (Wayfinding operations).
  • Charting decisions (2026-09-20 — settled, do not re-ask):
    • Mechanism: Swift FileManager copy in-app. Probe-verified against the real binary: hermes profile export museion → 2.1 MB tar.gz but excludes auth.json/.env/state.db — fails G4 "credentials included"; hermes backup → whole-home zip (all profiles), wrong scope, restore ≠ Finder copy-back. A byte copy never parses the engine's format — the #13 "engine owns its profile" rule was about scaffolding, not copying.
    • Contents (amends G4's "complete copy" → "complete of what matters"): curated exclusions — dirs logs/, cache/, audio_cache/, image_cache/; files *.pid, *.sock, *.lock, .DS_Store, models_dev_cache.json/.etag, provider_models_cache.json, ollama_cloud_models_cache.json, context_length_cache.yaml. Everything else copies, credentials and SQLite sidecars included (stale locks excluded so a restored profile isn't blocked by them; sidecar consistency comes from the liveness gate, not exclusion). ~9 MB/snapshot vs 54 MB literal, 83% of which is logs.
    • Timing: async after the gate pass, sequenced after the provisioning pass finishes (success or failure — a failed provision doesn't skip the backup; sequencing avoids racing the per-skill seed renames).
    • Liveness gate (pre-copy): compound check — gateway.pid liveness (parse pid, kill(pid, 0); the file can be stale — verified a recorded-but-dead pid) + ps ax -o command= scan for profiles/museion or -p museion (the gateway's argv carries no profile path — its pid file's hermes_home field is the only deterministic signal; CLI/ACP children do carry the flag). Either signal live → skip this launch's snapshot, one os_log line, retry at the next qualifying launch. Skips record no state; the normal age check governs.
    • Failure posture: backup is protection, not function — failure = one os_log line, never an alert (contrast #45's provisioning card); retried at the next qualifying launch.
    • Restore UX: menu item "Open Backup Folder" (reveals ~/Library/Application Support/Museion/Backups/ in Finder) + a section linking to a help document describing manual Finder copy-back. No restore UI beyond that in v1.
    • Policy: fixed constants in code — retention 7, daily cadence, exclusion list; no settings surface in v1.
    • Copy mechanics: copy to temp name + rename into place (seed-phase pattern); timestamped dir name, lexicographically sortable; prune past 7 after a successful rename; age check reads the newest existing snapshot.

Decisions so far

  • Build: implement daily profile backup pass — landed & closed: liveness-gated curated copy (retention 7, RESTORE.md + Help → Open Backup Folder), 8/8 ProfileBackupTests + full suite green. Verified deviations from charting: gateway.pid is a JSON line (pid key), plain recursive contentsOfDirectory copy (enumerator path-resolution + skipDescendants traps), snapshot layout <stamp>/museion/, psScan injectable for tests.

Not yet specified

<empty — the fog is clear; the way to the destination is the build ticket>

Out of scope

  • hermes profile export / hermes backup as the snapshot mechanism — probe-rejected (credential exclusion / wrong scope).
  • Any settings UI for retention/cadence/exclusions.
  • In-app restore beyond opening the folder + the help doc — v1 restore is manual Finder copy-back.
  • Snapshot triggers beyond launch-daily (pre-update, pre-pass, on-quit) — future effort if wanted.

What to build

The mentor's accumulated state survives profile corruption or a bad update. On launch, if the newest snapshot is older than a day, Museion copies the whole museion profile to a timestamped snapshot under ~/Library/Application Support/Museion/Backups/, keeping the last 7. The snapshot is a complete copy, credentials included, so restore is a single Finder copy-back in v1. Snapshots stay user-local — never in the project or git. (PRD S2.6, G4)

Acceptance criteria

[ ] Snapshot taken at most once per day on launch (age check against the newest existing snapshot)
[ ] Complete copy including credentials; timestamped naming
[ ] Only the last 7 snapshots kept; older ones pruned
[ ] Restore documented as manual Finder copy-back; snapshots never written into the project or git

Blocked by

• #13 — M0: Profile provisioning & skill seeding (S2.1)

[Generated by AI]

## Destination The daily profile snapshot is implemented and tested: every decision the build needs is made (mechanism, contents, liveness gate, failure posture, restore docs, policy constants) and the build ticket below has landed — a working, tested backup pass with PRD/DOX docs amended to match. ## Notes - Destination override (2026-09-20): unlike a decisions-only map, this effort carries execution to the destination — the final ticket is the build itself (the #13 precedent: its map ended with build ticket #47 landing the code). - Consult: CONTEXT.md (Museion Profile, Engine), PRD.md G4 + S2.6 + M0 row, ADR-0009 (no sandbox — real `~/Library` paths), Museion/AGENTS.md (gate & provisioning seams), docs/agents/issue-tracker.md (Wayfinding operations). - Charting decisions (2026-09-20 — settled, do not re-ask): - **Mechanism**: Swift FileManager copy in-app. Probe-verified against the real binary: `hermes profile export museion` → 2.1 MB tar.gz but **excludes auth.json/.env/state.db** — fails G4 "credentials included"; `hermes backup` → whole-home zip (all profiles), wrong scope, restore ≠ Finder copy-back. A byte copy never parses the engine's format — the #13 "engine owns its profile" rule was about scaffolding, not copying. - **Contents** (amends G4's "complete copy" → "complete of what matters"): curated exclusions — dirs `logs/`, `cache/`, `audio_cache/`, `image_cache/`; files `*.pid`, `*.sock`, `*.lock`, `.DS_Store`, `models_dev_cache.json`/`.etag`, `provider_models_cache.json`, `ollama_cloud_models_cache.json`, `context_length_cache.yaml`. Everything else copies, credentials and SQLite sidecars included (stale locks excluded so a restored profile isn't blocked by them; sidecar consistency comes from the liveness gate, not exclusion). ~9 MB/snapshot vs 54 MB literal, 83% of which is logs. - **Timing**: async after the gate pass, sequenced after the provisioning pass finishes (success or failure — a failed provision doesn't skip the backup; sequencing avoids racing the per-skill seed renames). - **Liveness gate** (pre-copy): compound check — `gateway.pid` liveness (parse pid, `kill(pid, 0)`; the file can be stale — verified a recorded-but-dead pid) + `ps ax -o command=` scan for `profiles/museion` or `-p museion` (the gateway's argv carries no profile path — its pid file's `hermes_home` field is the only deterministic signal; CLI/ACP children do carry the flag). Either signal live → skip this launch's snapshot, one os_log line, retry at the next qualifying launch. Skips record no state; the normal age check governs. - **Failure posture**: backup is protection, not function — failure = one os_log line, never an alert (contrast #45's provisioning card); retried at the next qualifying launch. - **Restore UX**: menu item "Open Backup Folder" (reveals `~/Library/Application Support/Museion/Backups/` in Finder) + a section linking to a help document describing manual Finder copy-back. No restore UI beyond that in v1. - **Policy**: fixed constants in code — retention 7, daily cadence, exclusion list; no settings surface in v1. - **Copy mechanics**: copy to temp name + rename into place (seed-phase pattern); timestamped dir name, lexicographically sortable; prune past 7 after a successful rename; age check reads the newest existing snapshot. ## Decisions so far - [Build: implement daily profile backup pass](https://git.babylondreams.de/AlexKucera/museion/issues/50) — landed & closed: liveness-gated curated copy (retention 7, RESTORE.md + Help → Open Backup Folder), 8/8 ProfileBackupTests + full suite green. Verified deviations from charting: gateway.pid is a JSON line (pid key), plain recursive contentsOfDirectory copy (enumerator path-resolution + skipDescendants traps), snapshot layout `<stamp>/museion/`, psScan injectable for tests. ## Not yet specified <empty — the fog is clear; the way to the destination is the build ticket> ## Out of scope - `hermes profile export` / `hermes backup` as the snapshot mechanism — probe-rejected (credential exclusion / wrong scope). - Any settings UI for retention/cadence/exclusions. - In-app restore beyond opening the folder + the help doc — v1 restore is manual Finder copy-back. - Snapshot triggers beyond launch-daily (pre-update, pre-pass, on-quit) — future effort if wanted. --- ## What to build The mentor's accumulated state survives profile corruption or a bad update. On launch, if the newest snapshot is older than a day, Museion copies the whole museion profile to a timestamped snapshot under ~/Library/Application Support/Museion/Backups/, keeping the last 7. The snapshot is a complete copy, credentials included, so restore is a single Finder copy-back in v1. Snapshots stay user-local — never in the project or git. (PRD S2.6, G4) ## Acceptance criteria [ ] Snapshot taken at most once per day on launch (age check against the newest existing snapshot) [ ] Complete copy including credentials; timestamped naming [ ] Only the last 7 snapshots kept; older ones pruned [ ] Restore documented as manual Finder copy-back; snapshots never written into the project or git ## Blocked by • #13 — M0: Profile provisioning & skill seeding (S2.1) [Generated by AI]
AlexKucera added the ready-for-agent label 2026-08-28 18:33:04 +02:00
AlexKucera added a new dependency 2026-08-28 19:18:41 +02:00
AlexKucera added the wayfinder:map label 2026-09-24 15:30:33 +02:00
Author
Owner

Closeout

The destination is reached — the map is complete. All four #15 acceptance criteria are met and test-pinned via the build ticket Build: implement daily profile backup pass (#50), landed and closed.

  • Build: feat(backup) @ e5b7203 on main ("add S2.6 daily profile backup (fixes #50)"), pushed 2026-09-30.
  • All four ACs verified in the #50 resolution comment: daily age check, credentials-included curated copy with timestamped naming, last-7 retention with prune, manual-restore docs (RESTORE.md + Help → Open Backup Folder) and snapshots user-local by construction (Backups root under Application Support).
  • All charting decisions shipped as charted, with the verified deviations recorded in Decisions so far (gateway.pid JSON line, plain recursive copy, <stamp>/museion/ layout, injectable psScan).

Nothing on this map remains open. Fog empty, no out-of-scope rescopes.

[Generated by AI]

## Closeout The destination is reached — the map is complete. All four #15 acceptance criteria are met and test-pinned via the build ticket [Build: implement daily profile backup pass (#50)](https://git.babylondreams.de/AlexKucera/museion/issues/50), landed and closed. - Build: `feat(backup)` @ `e5b7203` on `main` ("add S2.6 daily profile backup (fixes #50)"), pushed 2026-09-30. - All four ACs verified in the [#50 resolution comment](https://git.babylondreams.de/AlexKucera/museion/issues/50): daily age check, credentials-included curated copy with timestamped naming, last-7 retention with prune, manual-restore docs (RESTORE.md + Help → Open Backup Folder) and snapshots user-local by construction (Backups root under Application Support). - All charting decisions shipped as charted, with the verified deviations recorded in Decisions so far (gateway.pid JSON line, plain recursive copy, `<stamp>/museion/` layout, injectable psScan). Nothing on this map remains open. Fog empty, no out-of-scope rescopes. [Generated by AI]
Sign in to join this conversation.