Skip to main content

Assertions Mate

PyPI - Version PyPI - Python Version

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.10.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.10.0
File Size Uploaded
assertions_mate-0.10.0.tar.gz 59.9 kB Details

Built distribution (wheel)

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

Total release size: 79.0 kB

Release files / assertions_mate-0.10.0.tar.gz

Download URL assertions_mate-0.10.0.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c16afcc1aeb77cb7cbd3b2546a43df4843d76a4daccf32411116b7e104a92357
BLAKE2b-256 checksum
How to use checksums
54d1d715fa6966c7aae895a3673eb724d4c11512ed8832d1f90f5a9043ce9a2b
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 Sep 17, 2026.

Transparency log

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

Download URL assertions_mate-0.10.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8990579fd071c56ba975298500beecb278e3ef55ebedc966949d0a7f2684f216
BLAKE2b-256 checksum
How to use checksums
664ceed43dc91ff3eac30cec0fda1cc258860b76b6197507a4fc2da33ab21cde
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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.1

2 release files

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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