Found while reviewing
feat/v06-batch at 13891f1.
python/tan/commands/flash_cmd.py:1020-1028. When SETOOLS_DIR resolves, the SETOOLS branch returns a preview and exits before meta.build(...) (:1039) and before validate_flow_d_preflight_args (:1057-1063).
validate_flow_d_preflight_args's own comment at :1048-1056 says it exists precisely so tan flash --dry-run on a half-armed or malformed manifest stops reporting ok with no diagnostic. The new early return reopens exactly that hole, and only on hosts where SETOOLS is installed — so it is invisible to anyone without it.
Reproduction
Both with SETOOLS_DIR resolving:
flash_args:
jlink_flash_device: AE822FA0E5597LS0_M55_HE
slot0_load_address: "0x80010000"
expect_dpidr: "not-hex"
exitCode 0 status "ok" issues []
The same manifest with SETOOLS_DIR unset is a refusal:
flash_args.expect_dpidr is present but flash_args.jlink_device is not -- refusing to
silently skip the pre-write SW-DP IDR check
So the dry run green-lights a manifest whose SW-DP IDR guard is disarmed — the guard that, on a bench where two probes share the cloned serial 603000869, is what distinguishes the AEN E8 (0x4C013477) from the GD32 bridge (0x0BE12477) before a write.
Second case, output_artefact: zephyr.hex with no sibling .bin:
exitCode 0
would sign ...\build\zephyr.hex with SETOOLS at ...
The same function refuses that artefact fourteen lines later (flash_cmd.py:852-861, "SETOOLS needs a raw .bin to sign") on a real run. That is the ELF-vs-.bin question answered two different ways inside one function, selected by --dry-run.
Impact
--dry-run is what a customer runs to find out whether a flash is safe before touching MRAM. Returning ok:true for a manifest that a real run refuses inverts its purpose. It is also the shape of defect this repo keeps filing (#299, #301, #306, #310, #350, #355): a verdict reported without the check that would justify it.
Acceptance criteria
- The raw-
.bin resolution/refusal (flash_cmd.py:852-861) moves ABOVE the if ctx.dry_run: at :838, so both paths answer the artefact question identically.
- The dry-run path falls through to
meta.build and validate_flow_d_preflight_args and reports their outcome, with a preview-only marker rather than an early return.
- A dry run whose real run would refuse reports that refusal, with the same issue code and message.
- Tests cover both reproductions above, with and without
SETOOLS_DIR resolving, and fail against current main.
Related: #353, #312.
Found while reviewing
feat/v06-batchat13891f1.python/tan/commands/flash_cmd.py:1020-1028. WhenSETOOLS_DIRresolves, the SETOOLS branch returns a preview and exits beforemeta.build(...)(:1039) and beforevalidate_flow_d_preflight_args(:1057-1063).validate_flow_d_preflight_args's own comment at:1048-1056says it exists precisely sotan flash --dry-runon a half-armed or malformed manifest stops reportingokwith no diagnostic. The new early return reopens exactly that hole, and only on hosts where SETOOLS is installed — so it is invisible to anyone without it.Reproduction
Both with
SETOOLS_DIRresolving:The same manifest with
SETOOLS_DIRunset is a refusal:So the dry run green-lights a manifest whose SW-DP IDR guard is disarmed — the guard that, on a bench where two probes share the cloned serial
603000869, is what distinguishes the AEN E8 (0x4C013477) from the GD32 bridge (0x0BE12477) before a write.Second case,
output_artefact: zephyr.hexwith no sibling.bin:The same function refuses that artefact fourteen lines later (
flash_cmd.py:852-861, "SETOOLS needs a raw .bin to sign") on a real run. That is the ELF-vs-.binquestion answered two different ways inside one function, selected by--dry-run.Impact
--dry-runis what a customer runs to find out whether a flash is safe before touching MRAM. Returningok:truefor a manifest that a real run refuses inverts its purpose. It is also the shape of defect this repo keeps filing (#299, #301, #306, #310, #350, #355): a verdict reported without the check that would justify it.Acceptance criteria
.binresolution/refusal (flash_cmd.py:852-861) moves ABOVE theif ctx.dry_run:at:838, so both paths answer the artefact question identically.meta.buildandvalidate_flow_d_preflight_argsand reports their outcome, with a preview-only marker rather than an early return.SETOOLS_DIRresolving, and fail against currentmain.Related: #353, #312.