# Checklist: Automate versioned SMI release artifacts

Status: complete
Type: checklist
Updated: 2026-07-12
Next Action: none
Canonical Truth: E:/dev/high_point/7520553_SMI_FW/README.md

## Goal

Adapt reference commit `8cfb5c5` from `7520708_DispTest_FW` so SMI builds
stable artifacts and automatically copies validated, versioned release artifacts
without importing HPT7-specific names, paths, macros, or programmer settings.

## Inspected Current State

- e2 project name: `SMI`; repository/stable artifact basename: `7520553_SMI_FW`.
- Current e2 basename: `${ProjName}`, producing `SMI.elf`, `SMI.map`, and `SMI.srec`.
- Version source: `src/AppGlobalDefs.h`, selected by `BUILD_IS_PRODUCTION`.
- Production runtime file/version: `7520553_SMI_00_04_11.imx` / `Version 00-04-11`.
- Development runtime file/version: `7520553_SMI_DEV_00_04_11_v001.imx` / `Dev 00-04-11r001`.
- Existing working-tree edits predate this task and must remain untouched except where
  this checklist explicitly names an overlapping configuration file.

## Checklist

- [x] Record the pre-implementation Git status and preserve unrelated edits with
      path-scoped patches and reviews; never reset or restore the whole tree.
- [x] Change Debug and Release `artifactName` values in `.cproject` to
      `7520553_SMI_FW` and add a post-build packaging command to both builders.
- [x] Add `script/package-release-artifacts.ps1`. It must parse
      `BUILD_IS_PRODUCTION`, select the matching preprocessor branch, extract the
      active `SOFTWARE_VERSION_FILE_NAME` and `SOFTWARE_VERSION_STRING`, validate
      the SMI-specific production or development naming relationship, and copy
      stable `.elf`, `.srec`, and `.map` files to versioned names.
- [x] Add `script/vscode-e2-build.ps1`, adapted to the installed Synergy e2 24.1.1
      toolchain and stable `7520553_SMI_FW` artifacts, without regenerating project content.
- [x] Update `.vscode/tasks.json` with managed Debug/Release build tasks and the
      existing `smi.jflash` programmer flow; update `.vscode/launch.json` to use
      `Debug/7520553_SMI_FW.elf` consistently.
- [x] Update `SMI Debug.launch` image, symbols, and program fields to the stable ELF
      at this checkout; update all three `.jflash` projects to the stable S-record
      while preserving their existing connection modes and probe serial numbers.
- [x] Clarify the single manual version-edit location and SMI production/development
      naming rules in `src/AppGlobalDefs.h`, and document build/package usage in `README.md`.
- [x] Regenerate managed Debug makefiles through e2 metadata/build behavior as needed,
      then run packaging-script negative/positive validation, incremental and clean
      Debug builds, artifact existence/timestamp checks, PowerShell syntax checks,
      JSON parsing, XML parsing, `git diff --check`, and a scoped Git diff review.
- [x] Confirm no `synergy/ssp` churn or unrelated working-tree edits were removed.
- [x] Refresh `work/index.md` and `work/index.json`, run the Tool Shed stale-path
      checker, and mark this checklist complete with verification evidence.

## Runtime Closeout

Not applicable; this task changes local build and packaging configuration only.

## Verification

- Stable and versioned Debug ELF/MAP/S-record artifacts exist with matching build times.
- Packaging rejects a mismatched active filename/version and accepts the committed macros.
- VS Code JSON and e2 XML parse successfully.
- Managed rebuild succeeds with the known-good GCC 10.3.1/20210824 toolchain.
- Final Git review contains only pre-existing edits plus the explicitly planned files.

## Verification Evidence

- PowerShell AST parsing passed for both new scripts.
- VS Code JSON and e2 `.cproject`/launch XML parsing passed.
- Clean managed Debug build completed successfully with GCC 10.3.1/20210824.
- Stable `7520553_SMI_FW.{elf,map,srec}` artifacts were produced at the same build time.
- Production packaging produced `7520553_SMI_FW_00_04_11.{elf,map,srec}`.
- Development-branch validation produced
  `7520553_SMI_FW_DEV_00_04_11_v001.{elf,map,srec}` from a temporary fixture.
- A temporary mismatched production display version was rejected with a nonzero exit.
- `git diff --check` passed; no tracked `synergy/ssp`, `src/synergy_gen`, or
  generated `synergy_cfg` churn remains.
- Reusing the GUI workspace for headless e2 compiled successfully but hung in its
  scanner/support-file phase. The fix is a dedicated headless workspace at
  `E:/dev/high_point/e2_workspaces/7520553_SMI_FW_headless`. A clean import/build
  there completed naturally in 62.5 seconds with exit code 0 and produced stable
  artifacts at 18:29:06. Headless Synergy import still regenerates tracked content
  and omits the custom post-build recipe from its generated Makefile, so generated
  churn was restored and packaging was run explicitly; the managed-Make wrapper
  remains the routine automation path.
- Final headless automation uses `script/headless-e2-build.ps1`: it stages the
  current working tree outside the repository, imports/builds in a fresh e2
  workspace, runs version validation/packaging, hash-checks stable versus
  versioned outputs, copies only artifacts back, and removes the staging tree.
  The acceptance run completed in 65.6 seconds with exit code 0, produced all six
  Debug artifacts at 18:34:54, and left no generated source churn.
