Collector tracer bullet: one collection run from fixtures to the observation store #21
Notifications
Due Date
No due date set.
Blocks
#23 Segment observation history by controller identity
xavierk/Fenris
Reference: xavierk/Fenris#21
Reference in New Issue
Block a user
Parent\n\nImplement the Fenris persistent TUI monitoring redesign\n\nCanonical contracts: fenris-redesign spec · acceptance criteria — criterion IDs cited below live in the register.\n\n## What to build\n\nThe thinnest complete write path through the system. Given a smartctl-JSON fixture, a sysfs fixture tree, a configuration fixture naming the device, and an injected clock, one collection run acquires counters and thermal evidence solely from the smartctl fixture and controller identity solely from the sysfs fixture, normalizes identity exactly once at write time, initializes the observation store if absent (single SQLite database, WAL mode, schema-versioned, all six entities), validates every row it would write against the store invariants, and commits one well-formed sample. Any acquisition failure — or an invariant-violating row — refuses the whole run visibly and writes nothing. Verified end to end against fixtures by inspecting store contents; no device or privileges needed.\n\n## Acceptance criteria\n\n[x] Counters and thermal evidence come only from smartctl -a -j; controller identity only from sysfs; no other acquisition path exists anywhere (AC-1)\n[x] Any acquisition failure fails the whole run; a partial sample (identity without counters or vice versa) is never written (AC-3)\n[x] Identity normalization applied exactly once at write time — trailing spaces and newlines stripped, no case folding, empty-after-strip stored blank — so padded and unpadded renderings yield byte-identical stored values (AC-2)\n[x] The store initializes in WAL mode with the six entities and their column sets; an unprivileged reader during a collector write sees a consistent snapshot (ST-1, ST-2, ST-3)\n[x] PRAGMA user_version is set on init; the collector refuses an unknown newer version (ST-12)\n[x] An invariant-violating run writes nothing, logs the refused row, and fails visibly (FL-1)\n[x] No code path outside the collector interrogates the device; no /run coordination surface exists (CI-3)\n\n## Blocked by\n\nNone (can start immediately).
Implementation Complete
All acceptance criteria for this ticket have been met:
Implemented Features
AC-1: Acquisition path isolation
AC-3: All-or-nothing runs
AC-2: Identity normalization
ST-1, ST-2, ST-3: Store initialization
ST-12: Schema versioning
FL-1: Invariant violation handling
CI-3: No device interrogation outside collector
Files Created
Test Results
All 17 tests pass:
Next Steps
This tracer bullet provides the foundation for:
The implementation follows the red→green→refactor TDD cycle and is ready for code review.