Object-flow programming language v0 validator
Project description
ofplang validate
A validator for Object-flow Programming Language v0 — a YAML-based dataflow workflow IR with linear Object tracking. The language is defined in the ofplang/spec repository.
The validator checks that a document is well-formed portable v0: structure and types, the feature model, linear Object tracking, structured nodes, contracts, and scheduling policies. It reports findings as stable error codes rather than free text, so results are easy to consume in tests and tooling.
Install
pip install -e ".[test]"
Requires Python 3.10+. The only runtime dependency is PyYAML.
Command line
ofp-validate <file>... # or: python -m ofplang.validate <file>...
ofp-validate --mode extension-tolerant doc.yaml
ofp-validate --format json doc.yaml
Options: --mode {strict,extension-tolerant}, --format {text,json},
-q/--quiet, --no-color.
Exit codes: 0 all valid, 1 validation errors found, 2 usage/input error.
$ ofp-validate workflow.yaml
workflow.yaml:7:15: error unknown_type processes.main.inputs.x.type unknown type in 'Foo'
1 error in 1 of 1 file
Diagnostics carry a file:line:col source position (an imported fragment's own
file when the problem is inside an $import); --format json includes
file/line/col fields.
This tool is also intended to be exposed as the validate subcommand of the
umbrella ofp CLI (a separate repository in the ofplang organization).
Library
from ofplang.validate import validate
result = validate("workflow.yaml", mode="strict")
if not result.ok:
for d in result.diagnostics:
print(d.code, d.path, d.message)
validate(source, *, mode="strict") returns a ValidationResult with .ok and
.diagnostics (each a Diagnostic(code, message, path, file, line, col)). The
validator collects all independent findings rather than stopping at the first;
only a YAML parse or $import resolution failure is terminal.
The package lives under the ofplang PEP 420 namespace (ofplang.validate),
shared across the organization's tools.
Scope
Covers graph-time validation of portable v0. Runtime failures, and run/data-phase
preflight checks, are out of scope (spec §6.2, §25). Two modes are supported:
strict (portable v0) and extension-tolerant (accepts x- extension keys).
Tests
The behavior is pinned by a spec-derived conformance suite that matches on error codes (see tests/conformance/README.md).
pytest # run everything
OFPLANG_STRICT_TESTS=1 pytest # full contract, no pending escapes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ofplang_validate-0.1.0rc1.tar.gz.
File metadata
- Download URL: ofplang_validate-0.1.0rc1.tar.gz
- Upload date:
- Size: 96.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9ba6c6404dcd556d0e8677853b312c2855099eaba2da4b355a5ab589411f9f
|
|
| MD5 |
56ed91268a9044af94c1e6cb7731c5cd
|
|
| BLAKE2b-256 |
0e4f21373692676faee498417708f14d5bd85934d2766b1d1a8531b547751dc8
|
Provenance
The following attestation bundles were made for ofplang_validate-0.1.0rc1.tar.gz:
Publisher:
publish.yml on ofplang/validate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ofplang_validate-0.1.0rc1.tar.gz -
Subject digest:
ab9ba6c6404dcd556d0e8677853b312c2855099eaba2da4b355a5ab589411f9f - Sigstore transparency entry: 2255369463
- Sigstore integration time:
-
Permalink:
ofplang/validate@1802c2ab91aebf742a4e6fe507e31bd9ce9bd8d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ofplang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1802c2ab91aebf742a4e6fe507e31bd9ce9bd8d1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ofplang_validate-0.1.0rc1-py3-none-any.whl.
File metadata
- Download URL: ofplang_validate-0.1.0rc1-py3-none-any.whl
- Upload date:
- Size: 73.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58106f7b36c54600f864ec5851a84c5ffc61339ed4d1da95f752d38dd87e293
|
|
| MD5 |
6965c5110c02ce5d5a4caeb28c4f1d09
|
|
| BLAKE2b-256 |
dda2d70999f794c0dec6314c7ea02ba712a1054b5661715d230a99829c441a92
|
Provenance
The following attestation bundles were made for ofplang_validate-0.1.0rc1-py3-none-any.whl:
Publisher:
publish.yml on ofplang/validate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ofplang_validate-0.1.0rc1-py3-none-any.whl -
Subject digest:
a58106f7b36c54600f864ec5851a84c5ffc61339ed4d1da95f752d38dd87e293 - Sigstore transparency entry: 2255369479
- Sigstore integration time:
-
Permalink:
ofplang/validate@1802c2ab91aebf742a4e6fe507e31bd9ce9bd8d1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ofplang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1802c2ab91aebf742a4e6fe507e31bd9ce9bd8d1 -
Trigger Event:
push
-
Statement type: