Skip to content

python/tan/planner/zephyr_board.py is a hand-port outside PINNED_HASHES, so it drifts from alp-sdk silently #279

Description

@alpCaner

Found while moving PINNED_SDK_TAG to alp-sdk v0.15.0-rc1 for the v0.5.0-rc1 RC. This one nearly shipped.

What happened

alp-sdk#1068 added CONFIG_USE_DT_CODE_PARTITION=y to the AEN board _defconfig, emitted by scripts/gen_zephyr_board.py::_aen_defconfig(). That is the fix that makes a scaffolded AEN801 app link at its slot0 partition instead of the MRAM base — bench-proved on silicon (byte-matched readback, cold-cycle persistent, u VB in the SES boot header).

tan carries its own python/tan/planner/zephyr_board.py::_aen_defconfig(). It did not get the line, so tan generate for any AEN board emitted a _defconfig without it — i.e. the RC would have shipped the exact defect alp-sdk had just fixed, to the testers whose job is to exercise AEN flashing.

Caught only because the byte-parity gate went red on 100 board-tree parametrizations after the pin moved:

AssertionError: ...rpmsg-aen/board.yaml --core m55_he alp_e1m_aen801_m55_he_..._defconfig differs -- line 10:
    sdk: "# Link the image into the board's `zephyr,code-partition`"
    tan: '# Console: Alif UART5 ...'

The actual defect

zephyr_board.py is a hand-port, not a relocation, and it is not one of the 21 keys in PINNED_HASHES (python/tests/gates/test_planner_relocation_freshness.py). The freshness gate tracks scripts/alp_orchestrate/; this generator lives outside it. So the usual staleness check — git log <pinned>..<new> -- scripts/alp_orchestrate — comes back empty and reassuring while this file silently diverges.

Two independent things had to line up for it to be caught: someone moving the pin, and a byte-parity gate that happens to cover the emitted artefact. Neither is a check on the file itself. A hand-port with no freshness gate is a second, undeclared vendor point.

What to do

  1. Bring zephyr_board.py under PINNED_HASHES (or an equivalent per-file freshness gate), so alp-sdk moving it reds a named gate instead of surfacing as a downstream artefact diff.
  2. Audit for siblings. zephyr_board.py was found by accident; the question this raises is which OTHER generators were hand-ported rather than relocated and sit outside the gate the same way. That audit has not been done.
  3. Consider whether the freshness gate should assert coverage — that every file under python/tan/planner/ is either in PINNED_HASHES or explicitly declared exempt — so a future hand-port cannot be added silently outside it.

The immediate line is ported and the gate is green; this issue is about the class, not the instance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingciCI workflows, gates and test wiringpython-portRust-to-Python port of the tan command surface

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions