Assertions Mate
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
From source (recommended for development)
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:
- The CWL document is loaded.
- Assertion hints are discovered from
workflow.hints. - Matching validators are built and executed against the input mapping.
- Validation issues are reported with pointer and detail messages.
Supported Assertion Hints
The tool maps eoap: hint classes to internal validators:
eoap:JSONSchemaHinteoap:RegoPolicyHinteoap: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 CLItests/unit testsschemas/CWL hint schema definitionsdocs/notebooks and documentation sources
License
Metadata
Release files for assertions-mate 0.10.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| assertions_mate-0.10.1.tar.gz | 49.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| assertions_mate-0.10.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.9 kB
Release files / assertions_mate-0.10.1.tar.gz
| Download URL | assertions_mate-0.10.1.tar.gz |
|---|---|
| Size | 49.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e8cae7e25f62b054ab3ac6f075a17537dc424cda00646ad1812398eb179a12b
|
|
BLAKE2b-256 checksum How to use checksums |
fd356d313a6e5234bcf30b65f456aba3637b2185da48e62f9926708f41ac4ec0
|
| 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 27, 2026.
Transparency logRelease files / assertions_mate-0.10.1-py3-none-any.whl
| Download URL | assertions_mate-0.10.1-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e1dafb7b7956e49c186f6be07cf5eb0ac9872e654e3280211e0f4cb9897e463
|
|
BLAKE2b-256 checksum How to use checksums |
2d569029d53a08d6af0df8ca74ed4603378c62b2d076ff9d9e06965358711877
|
| 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 27, 2026.
Transparency log