Parser compatibility
braid parses output from btrfs-progs, cryptsetup, util-linux, smartmontools, NUT, and ethtool. These parsers can break when tool versions change. Two validation lanes exist:
Stable lane (pinned contract)
just test-parsers— CLI parser canary. Exercises CLI-reachable parsers against live tool output in VMs (includingbraid-status-ups, the NUT canary).just test-rust— validates golden fixtures for the full parser set, includingparse_upsc. Fixture-backed coverage stays current only after runningjust capture-all-fixtureswhen parser-critical tool versions change (e.g. nixpkgs bump).- Fixture refresh is a separate obligation:
just test-parserspassing does not guarantee TUI-only parsers (parse_lsblk_json,parse_cryptsetup_luks_dump) or unused parsers (parse_btrfs_scrub_status_per_device) are compatible with the current toolchain. parse_smartctl(the SMART health parser) is reachable from both the TUI and thebraid statusCLI command, so it is no longer TUI-only. It is still not covered by the live VM canary, though: virtio disks emit no usable SMART, sojust test-parserscannot exercise it. Its drift canary is the stable-only smartctl golden fixture (see the smartctl-fixtures note below).- Fixtures in
cli/tests/fixtures/nixos-26.05/are committed and authoritative. NUT fixtures live incli/tests/fixtures/nixos-26.05/upsc/(and the unstable mirror); they are produced byjust capture-ups-fixtures, which boots a dedicated NUT VM with per-statedummy-upsdrivers (seetests/capture-ups-fixtures.nix). - smartctl fixtures are stable-only by design. VM virtio disks do
not emit useful SMART data, so
just capture-all-fixturesdoes not regeneratesmartctl-sata-with-temperature.jsonorsmartctl-selftest-*.json.smartctl-sata-with-temperature.jsonis a one-time physical-drive capture;smartctl-selftest-*.jsonfixtures are hand-authored (seecli/tests/fixtures/nixos-26.05/README.md). Thetool-versionsVM test checks thatsmartctlresolves to a/nix/store/path on the VM’s PATH and that its self-reported version matchespkgs.smartmontools.version, but it does not detect nixpkgs version bumps because both sides advance together. On any nixpkgs bump that touches smartmontools, manually review and refreshsmartctl-selftest-*.jsonagainst the newata_smart_self_test_log.standardJSON shape andsmartctl-sata-with-temperature.jsonagainst the new health/temperature JSON shape (smart_status,temperature,ata_smart_attributes). - ethtool WoL fixtures are hand-authored / no-live-capture. VM
virtio NICs do not emit useful Wake-on-LAN data, so
just capture-all-fixturesdoes not regenerate ethtool output. The doctorwake_on_lanparser is covered by hand-authored Rust unit fixtures, and wrapper provenance is covered by the override-based VM tests intool-versionsandbraid-auto-suspend.
Parser-critical tool versions are the pinned nixpkgs versions of btrfs-progs, cryptsetup, util-linux, nut, smartmontools, and ethtool. Treat any change to the nixpkgs node in flake.lock, any flake.nix change that alters the nixpkgs input, or any change to braid.packages.{btrfsProgs,cryptsetup,utilLinux,nut,smartmontools,ethtool} as a required fixture-refresh event.
When parser-critical tool versions change, run:
just capture-all-fixturesjust test-rustjust test-parsers
Unstable lane (tracked forecast)
Early-warning lane for upstream parser/output drift. Unstable failures signal upcoming changes, not a contract violation. Fixtures in cli/tests/fixtures/nixos-unstable/ are committed so upstream output changes are visible in git history, but they are non-authoritative.
just test-all-unstable– VM tests against nixos-unstable. Covers CLI-reachable parsers against live tool output but does not cover the full parser surface (TUI-only parsers, unused parsers, smartctl).just capture-all-fixtures-unstable+just test-rust-unstable– covers btrfs/cryptsetup/util-linux/NUT against unstable tool output via golden fixtures. Missing fixtures fail (not skip).- smartctl and ethtool have no unstable fixtures. Unstable capture/test coverage intentionally covers btrfs/cryptsetup/util-linux/NUT only; see the Stable lane for why smartctl fixtures are stable-only and how to refresh them on smartmontools bumps, and why ethtool WoL output is hand-authored instead of live-captured.
Full unstable canary workflow:
just test-all-unstablejust capture-all-fixtures-unstablejust test-rust-unstable