Skip to content

test(golden): dual-firmware golden fixtures (Momentum + Official) - #106

Merged
millsmillsymills merged 3 commits into
phase1from
feat/dual-firmware-golden-fixtures
Jun 10, 2026
Merged

test(golden): dual-firmware golden fixtures (Momentum + Official)#106
millsmillsymills merged 3 commits into
phase1from
feat/dual-firmware-golden-fixtures

Conversation

@millsmillsymills

Copy link
Copy Markdown
Contributor

Addresses the golden-fixture reorg item on #99.

What

Hardware golden fixtures whose recorded bytes are firmware-specific now live in per-flavor subdirs; the firmware-independent offline fixtures stay flat:

tests/golden/fixtures/
  cli_tx_gate_disabled.json      # offline, firmware-independent
  wifi_cli_rejection.json        # offline, firmware-independent
  momentum/                      # captured on Momentum mntm-012
    cli_exec_device_info.json  fs_push_integrity.json  lock_contention.json  mode_switch.json
  official/                      # captured live on Official 1.4.3
    cli_exec_device_info.json  fs_push_integrity.json  lock_contention.json  mode_switch.json
  • harness.py gains OFFLINE_FIXTURES, HARDWARE_FIXTURES, FIRMWARE_FLAVORS, and hardware_dir(flavor).
  • record.py classifies the connected device's flavor from device_info and writes the hardware fixtures into that flavor's dir (make record-fixtures works on either firmware).
  • test_golden_fixtures.py parametrizes the four hardware replay tests over both flavors; the drift guard checks the offline set is flat and each flavor dir holds the full hardware set.

The Official set was captured live (device is currently on Official 1.4.3 following the #99 flash validation).

Tests

tests/golden/ 18 passed (hardware tests now run for both Momentum and Official). Full non-integration suite: 211 passed. ruff + ty clean.

🤖 Generated with Claude Code

Hardware golden fixtures whose recorded bytes are firmware-specific
(cli_exec device_info, fs_push, mode_switch, lock_contention) now live under
tests/golden/fixtures/<flavor>/; the firmware-independent offline fixtures stay
flat. The recorder writes into the connected device's flavor dir (classified
from device_info), and the replay tests are parametrized over both flavors.

Captured the Official 1.4.3 set live to complement the existing Momentum
mntm-012 set, so the drift guard now covers both firmwares.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
millsmillsymills and others added 2 commits June 9, 2026 21:21
Mask the capture device's hardware_uid, radio_ble_mac, and hardware_name
out of the committed golden fixtures and test mocks. The recorder now
redacts these fields at capture time with equal-length masks so the
length-prefixed protobuf frames stay decodable and no future re-record
reintroduces a real hardware fingerprint into the public test corpus.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant