Skip to main content

Assertions Mate

PyPI - Version PyPI - Python Version GitHub Actions Workflow Status Code coverage

assertions-mate validates CWL workflow inputs against assertion hints embedded in the workflow definition.

It adds policy and rule checks on top of CWL typing by supporting:

  • JSON Schema validation
  • Rego policy validation (OPA)
  • CQL2 expression validation

Documentation site: https://terradue.github.io/assertions-mate/

Documentation follows the Diataxis framework:

  • Tutorials: learning-oriented walkthroughs
  • How-to guides: task-focused recipes
  • Reference: technical contracts and interfaces
  • Explanation: design rationale and concepts

Why Use It

When a CWL workflow needs stricter runtime checks (business rules, policy constraints, geospatial conditions), assertions-mate lets you define them as workflow hints and evaluate them against an input payload before execution.

Installation

git clone https://github.com/Terradue/assertions-mate.git
cd assertions-mate
pip install -e .

Runtime requirements

  • Python >= 3.10
  • Dependencies are managed in pyproject.toml

Command Line Usage

pip install transpiler-mate-runtime "assertions-mate>=0.10.0"

After installation, run:

transpiler-mate assertions-mate --inputs path/to/inputs.yaml path/to/workflow.cwl

What happens:

  1. The CWL document is loaded.
  2. Assertion hints are discovered from workflow.hints.
  3. Matching validators are built and executed against the input mapping.
  4. Validation issues are reported with pointer and detail messages.

Supported Assertion Hints

The tool maps eoap: hint classes to internal validators:

  • eoap:JSONSchemaHint
  • eoap:RegoPolicyHint
  • eoap:Cql2FilterHint

Example hints snippet

hints:
  - class: eoap:JSONSchemaHint
    json_schema:
      type: object
      required: [count]
      properties:
        count:
          type: integer
          minimum: 1

  - class: eoap:RegoPolicyHint
    module: |
      package workflow
      deny contains "count must be <= 10" if {
        input.count > 10
      }
    queries:
      - data.workflow.deny[_]

  - class: eoap:Cql2FilterHint
    queries:
      - id: cql-rule-1
        cql2: "count > 0"
        message: "count must be greater than zero"

Development

This project uses Hatch environments and pytest.

# Run tests
hatch run test:test-q

# Run formatting check
hatch run dev:lint

# Run lint checks with fixes
hatch run dev:check

If you use Taskfile:

task test
task lint
task check

Project Layout

  • src/assertions_mate/ core package and CLI
  • tests/ unit tests
  • schemas/ CWL hint schema definitions
  • docs/ notebooks and documentation sources

License

Apache License, Version 2.0

Metadata

Release files for assertions-mate 0.11.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 assertions-mate 0.11.0
File Size Uploaded Provenance Actions
assertions_mate-0.11.0.tar.gz 49.5 kB With provenance Details for assertions_mate-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for assertions-mate 0.11.0
File Interpreter ABI Platform Actions
assertions_mate-0.11.0-py3-none-any.whl Python 3 none any Details for assertions_mate-0.11.0-py3-none-any.whl

Total release size: 69.2 kB

Release files / assertions_mate-0.11.0.tar.gz

Download URL assertions_mate-0.11.0.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4612d990c02b06a91d962a8a65a9ab950130d014cc9121155a5afaabcef77259
BLAKE2b-256 checksum
How to use checksums
09b93764a0492a990339dfeaf76e21256a1859613b3cbed9f4f33a93f3dd7342
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Release files / assertions_mate-0.11.0-py3-none-any.whl

Download URL assertions_mate-0.11.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b84f9e4660dec61ef425775a995500d0b0abdc68ec9b8689b49e01c2f253d16c
BLAKE2b-256 checksum
How to use checksums
644190a66b8ba72a101e45e8a67a7ab20a794c87cb8d7cc9827906f159e6ea60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Security for assertions-mate 0.11.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 assertions_mate-0.11.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 Nov 16, 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.

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