Migrate the legacy observation history #24
Notifications
Due Date
No due date set.
Blocks
Depends on
#30 Deliver make install
xavierk/Fenris
#23 Segment observation history by controller identity
xavierk/Fenris
Reference: xavierk/Fenris#24
Reference in New Issue
Block a user
Parent
Implement the Fenris persistent TUI monitoring redesign
Canonical contracts: fenris-redesign spec · acceptance criteria — criterion IDs cited below live in the register.
What to build
The legacy
history.jsonlbecomes observation history in one interruption-safe step. The import is a single transaction — a scripted kill mid-import leaves the store fully pre- or fully post-migration — and idempotent: a second run no-ops on the legacy-import marker.history.jsonlis the sole authority;hourly.jsonlis diffed and logged but never trusted. Malformed lines are quarantined with a logged count, never silently dropped. Legacy files are renamed*.migratedonly after commit and never deleted. One implicit monitoring period opens at the first legacy sample and closesend_cause = migratedat the migration moment; pre-migration hours carry an unknown activity split except directly evidenced facts (a sample means powered on; a DUW delta means writes occurred). Everything imports under a labeled, model-scoped legacy identity (mn-only segments). No synthetic or capacity-derived baseline is ever created for legacy history.Acceptance criteria
*.migratedonly after commit, never deleted (ST-8)hourly.jsonlnever trusted; mismatches diffed and logged (ST-10)migratedat the migration moment; pre-migration hours unknown except directly evidenced facts (ST-11)Blocked by
Implementation Complete\n\nImplemented the legacy history migration per spec §3.5 and ADR 0001 §6.\n\n### Changes\n\nNew files:\n- — Idempotent, interruption-safe legacy history.jsonl import\n- — 11 tests covering all acceptance criteria\n\nModified files:\n- — Added table for legacy import marker\n- — Added legacy import check on first run\n- — Updated to include new table in schema verification\n\n### Acceptance Criteria Met\n\n- [x] ST-6: Import is one transaction — interruption leaves store fully pre- or post-migration\n- [x] ST-7: Import is idempotent — second run no-ops on legacy-import marker\n- [x] ST-8: Legacy files renamed only after commit, never deleted\n- [x] ST-9: Malformed lines quarantined with logged count\n- [x] ST-10: never trusted — mismatches diffed and logged\n- [x] ST-11: Implicit period opened at first legacy sample, closed at migration moment\n- [x] ID-3: Legacy history imports under labeled mn-only legacy identity\n- [x] CI-3: No synthetic baseline created for legacy history\n\n### Design Decisions\n\n1. Legacy identity key: Uses prefix to distinguish from post-redesign identity\n2. Metadata table: Added table for store state markers\n3. Hour derivation: Reuses existing for consistent behavior\n4. File renaming: Non-fatal — migration succeeds even if rename fails