Repository navigation
--ports: the only ports a run may touch - #2
Merged
Merged
Conversation
Every Valar board is 303A, so bench mode's default of 'every ESP port' would flash a configured unit or another project's board attached to the same machine. The allowlist is applied inside list_ports, the one function every flash and bench path gets its ports from. Tests: only the named port is seen; a bench run touches only it (asserted on the fake esptool's log); control: without --ports all three are seen. Sabotage (filter removed): 2 red. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A local protected-MAC list (~/.config/valar-flasher/protected-macs.json, never in the repo). A protected board is refused on any port and in every write path (bench, variant flash, both chip-flash paths): first by USB serial, so it is not even reset, then by the MAC esptool reads, before any write. Unreadable list = bench refused. - Bench mode without --ports lists every board (port, MAC, EXCLUDED/PROTECTED) and waits for 'yes'; it then flashes only those MACs, and a board attached later is refused. GUI does the same with a confirm dialog. - Bench refuses a configured provisioner path that does not exist. - Golden-plan test LF-normalises, so it passes on a Windows checkout too. Tests 38. Sabotage: checks removed from bench_board -> 7 red; confirmation that accepts anything -> 1 red. Live read-only run of the list on the bench machine: COM6 and COM15 EXCLUDED: PROTECTED, COM18 WILL BE FLASHED. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
origin/mainat638a1fba596ee8944254a7ec62c9512e0d5295de, fetched and branched immediately before the commit.Found while preparing Step 4. This machine has COM6 (Daniel's configured unit), COM15 and COM18 attached, all Espressif
303A. Bench mode as merged takes every ESP port, so a run meant for COM18 would have flashed and provisioned all three.--ports COM18restricts every path. It's applied insidelist_ports(), the one function the GUI, console and bench mode all get their ports from, so no path can skip it.Tests (22):
--ports, all three are listed.Sabotage: with the filter removed, exactly those 2 tests go red. After restore, 22/22 pass.
Added before merge (
c36de61): the real guards~/.config/valar-flasher/protected-macs.json. It is never in the repo, because it names this bench's hardware. It is seeded with COM6 (Blipscope bench unit) and COM15 (Missileer test board); COM5 is added when it next appears.--portslists every board (port, MAC, EXCLUDED: PROTECTED) and waits foryes. It then flashes only those MACs; a board attached later is refused. The GUI does the same with a confirm dialog.Tests: 38. Sabotage runs:
bench_boardAfter restore, all green.
Live read-only check on the bench machine (no port opened):
Note that COM15 (TinyUSB) reports its serial as
90706931E9D8, with no colons. The matcher normalises both forms, and a test covers it.🤖 Generated with Claude Code