Skip to main content

reqthread

The golden thread from requirement to evidence.

Traceability and certification evidence for safety-critical embedded software. It reads what your repo already has — requirements as files, @satisfies / @verifies annotations in code and tests, and the JUnit, coverage, and SARIF output your CI already produces — and builds a hashed evidence bundle, checks it against gate rules, and writes a standalone HTML report.

It fails your pipeline when a requirement loses its test, a test verifying a safety requirement fails or never runs, code traces to nothing, or a static-analysis finding is open. With a baseline, it fails only on new gaps, so a team with existing gaps can adopt it today.

Standard-agnostic by design: integrity levels, test levels, tool classes, and package sections come from a standard-data file you load from your own licensed copy. The tool ships no standard text. A structure-only IEC 61508-3 skeleton is in standards/.

Install

pip install git+https://github.com/eggheadengineer/reqthread

Python 3.10 or later. Two dependencies: PyYAML and jsonschema. A PyPI release (pip install reqthread) is coming.

Quick start

git clone https://github.com/eggheadengineer/reqthread && cd reqthread
pip install .
reqthread check -c examples/wb55-ref/reqthread.yaml --html report.html

examples/wb55-ref/ is a real reference project — a black-channel heartbeat receiver in C, tested from pytest, with real gcov coverage and real flawfinder SARIF. It has three genuine gaps; the report shows them.

Annotate code and tests

/* @satisfies SSR-001
 * @implements DD-TIMEOUT */
bool hb_supervise(hb_state_t *s, uint32_t now_ms) { … }
def test_trip_after_300ms(lib):
    """@verifies SSR-001"""

A tag applies to the function it is inside, or the function directly below it. A block containing @file applies to the whole file. Anything ambiguous is an error, never a guess. Zephyr ZTEST, GoogleTest TEST, Unity test_*, and pytest tests are recognised.

Commands

Command Does Exit
reqthread check build, evaluate gates, optionally ratchet with --baseline; write -o bundle, --html, --json 0 pass · 1 error · 2 gaps
reqthread build build and write a bundle (--previous chains hashes) 0 · 1
reqthread report render HTML from a bundle 0 · 1
reqthread hazards hazard analysis on its own: validate hazard and cause files, print the hazard matrix 0 · 1 · 2 gaps
reqthread validate validate standard data, requirement files, or a hand-written bundle 0 · 1

Gate rules

  1. Every software safety requirement has a verifying test at each declared test level.
  2. Every software safety requirement derives from a system-level requirement.
  3. Every code unit traces to a requirement or design element, or is marked @infrastructure with a reason.
  4. Every test verifying a safety requirement passed at baseline and failed nowhere — skipped or never-run doesn't count.
  5. Every static-analysis finding is fixed or covered by an unexpired, approved deviation.
  6. Every hazard is mitigated by at least one requirement, directly or through one of its causes.
  7. Every cause (STPA unsafe control action or FMEA failure mode) is mitigated by a requirement, or its residual risk is formally accepted.
  8. Every requirement that mitigates a hazard is a safety requirement with an integrity level.

Hazard analysis

Hazards and causes live in the repo as files too, so the trace runs from hazard to cause to requirement to test to CI result. In the reference project, HAZ-001 (machine keeps moving after a stop command) traces through three unsafe control actions to SSR-001..003, and a fourth cause, a stuck-high output driver, has no mitigating requirement. The hazard analysis found a gap the requirements never knew about.

reqthread hazards --hazards hazards/ --causes causes/ --requirements requirements/

That command needs no project config, standard data, or CI output, so a safety engineer can start with hazard analysis alone and add the rest later.

CI

  • GitHub: ci/github/action.yml (composite action)

    permissions: { contents: read, actions: read }   # actions: read lets PR runs fetch the baseline
    jobs:
      traceability:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v7
          - uses: eggheadengineer/reqthread/ci/github@main   # pin a release tag once v0.1.0 is out
            with:
              config: reqthread.yaml
    
  • GitLab: templates/reqthread.yml (CI/CD component)

Both record the default branch's bundle as the baseline and fail merge requests only on new gaps. The GitHub Action has been exercised end to end on GitHub-hosted runners; the GitLab component has not run yet.

Docs

  • docs/FORMATS.md — file formats, annotations, bundle model
  • docs/EVIDENCE_PACKAGE_SPEC.md — what an IEC 61508-3 assessor expects, and what this automates

Tests

PYTHONPATH=src python3 -m unittest discover -s tests

License

Apache-2.0. See LICENSE.

Metadata

Release files for reqthread 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reqthread 0.2.0
File Size Uploaded Provenance Actions
reqthread-0.2.0.tar.gz 81.5 kB With provenance Details for reqthread-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reqthread 0.2.0
File Interpreter ABI Platform Actions
reqthread-0.2.0-py3-none-any.whl Python 3 none any Details for reqthread-0.2.0-py3-none-any.whl

Total release size: 128.8 kB

Release files / reqthread-0.2.0.tar.gz

Download URL reqthread-0.2.0.tar.gz
Size 81.5 kB
Tags Source
SHA-256 checksum
How to use checksums
04df784a220f47e2ef2cc555d0a00c906dffae5be53397861d08c7dee760ad57
BLAKE2b-256 checksum
How to use checksums
be091c6c755849773664994fcc3618e012773156e461d2546c896d96aaed8376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / reqthread-0.2.0-py3-none-any.whl

Download URL reqthread-0.2.0-py3-none-any.whl
Size 47.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a6bfa0cb8737faad1b6bd17e99b6bd6582ade77055b5424ef2f582f1f3b0d25
BLAKE2b-256 checksum
How to use checksums
ff3a411288c23ac99a9b9ce2a5e147b88cd5f623a6637183e565c62cb3a7d20d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for reqthread 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reqthread-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page