Compliance & Verification

Generating SHA-256 provenance and JUnit audit bundles

Turn every CI firmware run into a self-contained JSON and JUnit record pinned to exact ELF, board and twin SHA-256 digests.

When an external auditor or customer asks what tests ran on firmware v2.4.1, screenshots from a lab bench rarely hold up. You need the exact binary hash, simulator inputs and deterministic pass/fail transcript.

CircuitTwin prints structured JSON with SHA-256 hashes of the ELF, board definition and component twins alongside standard JUnit XML for GitHub, GitLab and Azure DevOps.

Audit bundle contents

FileProduced byPurpose
run-summary.jsonct test run --jsonRecords ELF SHA-256, board/twin hashes, virtual time and verdict
junit.xml--junit results/junit.xmlStandard CI test dashboard & requirement mapping
trace/--record trace/Optional replayable execution & bus event transcript

Local CLI workflow

Shell - emit and hash CI audit bundle
mkdir -p audit-bundle
ct test run --json --recheck --junit audit-bundle/junit.xml tests/release.suite.yaml > audit-bundle/run.json
sha256sum build/release.elf audit-bundle/junit.xml audit-bundle/run.json > audit-bundle/SHA256SUMS

Suite & fault configuration

tests/release.suite.yaml
version: 1
board: nucleo-f767zi
firmware: build/release.elf
tests:
  - name: release-boot-and-self-test
    timeout_ms: 3000
    expect:
      console_contains: "SELFTEST_PASS"
      exit_code: 0

CI pipeline integration

.github/workflows/provenance-bundle.yml
name: Release Provenance Bundle
on:
  release:
    types: [published]
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: circuittwin/action@v1
        with:
          suite: tests/release.suite.yaml
          junit-out: audit-bundle/junit.xml
      - uses: actions/upload-artifact@v4
        with:
          name: firmware-audit-bundle
          path: audit-bundle/

Troubleshooting checklist

SymptomFix
Two CI runners produce different hashes for run.jsonVerify --recheck passes and exclude wall-clock host duration fields when comparing deterministic run payloads.

Frequently asked questions

QuestionAnswer
What exit codes does ct test run return for CI gating?Exit code 0 means all assertions passed, non-zero indicates test failure, and exit code 4 specifically flags inconclusive runs that touched an unmodelled peripheral register.

Related boards & component twins

More in Compliance & Verification