Skip to main content

URML

A small, opinionated, human-readable language for describing robot intent.

urml.dev


Validator

Status: Phase 1. Schemas + four-pass validator + urml CLI + JSON Schema export shipping on PyPI at 0.1.1. The LLM bridge and on-device providers ship as urml-llm-bridge.

What this is

The static verification engine for URML. Given a URML program, a Layer-1 capability manifest for the target robot, and the active safety envelope, the validator returns one of two outcomes:

  1. Accepted — the program is statically valid; the runtime may execute it.
  2. Rejected with a structured error — the program fails one or more checks; the error is a machine-readable object that a calling tool (often the LLM bridge) can use to revise the program.

The validator is the safety boundary. Per MANIFESTO.md §Design Principles and CLAUDE.md §What Claude Should Never Do:

URML programs are executed only after static verification against the target's capability manifest and active safety envelope. Any "fast path" that skips verification is rejected on review.

The validator runs in the same process as the runtime. URMLRuntime.execute imports it and re-validates every program, against the manifest, envelope, policy and rulebooks it is given, before its first adapter call. A rejected program raises ValidationRejectedError and the adapter receives nothing; python -m urml_conformance --goal-line checks this for every rejected conformance fixture. Skipping the check takes an explicit revalidate=False in code.

What the validator checks

When fully implemented, the validator runs these checks against every URML program:

Layer-3 (composition) checks

  • The program parses as valid URML against the layer-3 grammar.
  • Every composition operator is well-formed (no empty parallel, no retry with negative bound, no on_error: substitute referencing an undefined behavior).
  • Every $variable reference resolves to a prior store_as.
  • Types match across producer/consumer primitives.

Layer-2 (primitive) checks

  • Every primitive is in the spec (or in a profile the program declares).
  • Every primitive's required arguments are present and well-typed.
  • Profile-specific argument constraints are honored (e.g., drone-profile move_to declares altitude).

Layer-1 (capability) checks

  • The robot's manifest declares every capability the program needs (mobility, manipulation, perception, declared frames, declared locations).
  • Every named location in the program resolves in the manifest or the world model the manifest references.

Safety-envelope checks

  • Every declared limit is honored: max velocity, max payload, max force, max altitude, geofence, force ceilings, no-go zones, link-loss policy.
  • Profile-specific envelope checks (drone people-occupancy, industrial cell perimeter, home people-only zones) are applied for whichever profiles the program declares.

Rulebook checks (RFC-0702, Draft)

  • A rulebook states what law or a company allows: caps, forbidden primitives, forbidden zones, no flight over declared people zones, required deployment declarations, and how many aircraft fly at once. The format is spec/layer-1-hal/rulebook.md.
  • The rulebook pass runs after the envelope checks and cites the rule it enforces, with rule.* codes. --no-policy does not skip it.
  • The bundled rulebook, the statically checkable subset of 14 CFR Part 107 and Part 89, applies by default to drone programs and aircraft. --rulebook PATH adds organization and deployment rulebooks; --no-default-rulebooks switches the bundled one off, with a warning.
  • A deployment rulebook records declarations (such as the Remote ID method) and exceptions that name their basis (such as a waiver number). An exception turns a violation into a warning that names the basis. URML records these and does not verify them.
  • Every report lists the rules a static check cannot see as obligations. A program that passes a rulebook is not a legal compliance determination.
urml validate flight.urml.yaml -m drone.manifest.yaml \
  --rulebook examples/rulebooks/example-deployment.yaml

What the validator does NOT do

  • It does not execute the program. That is the runtime's job.
  • It does not parse natural language. That is the LLM bridge's job.
  • It does not generate the URML program. That is an LLM's job, via the LLM bridge.
  • It does not monitor runtime state. Run-time safety (an unexpected obstacle, a sudden wind gust, a person walking into the cell) is the substrate's job. The validator is static; the substrate is dynamic. Both are required for safety.

Language

  • Python, primary implementation. mypy --strict. Public API fully type-annotated.
  • A long-running validator service (e.g., as a sidecar to multiple runtimes in production) may eventually be backed by Rust for deployment ergonomics; the Python implementation remains the reference.

API (sketch)

from urml.validator import validate, ValidationResult

result: ValidationResult = validate(
    program=program_yaml,         # str or parsed dict
    manifest=manifest_yaml,        # str or parsed dict
    envelope=envelope_yaml,        # str or parsed dict
    profiles=("home",),            # which profiles the program declares
    spec_versions={
        "layer-1-hal": "0.1.0",
        "layer-2-primitives": "0.1.0",
        "layer-3-behavior": "0.1.0",
    },
)

if result.accepted:
    runtime.execute(result.program)
else:
    # result.errors is a list of structured errors,
    # designed to be readable by an LLM and used for revision.
    llm_bridge.revise(program_yaml, result.errors)

Core Commitment

The validator is licensed under the Business Source License 1.1: free for non-production use, commercial license for production (see LICENSING.md). Research, education and evaluation use is free, so anyone can check a URML program against a manifest without a contract.

Quickstart (current pre-alpha)

cd reference/validator
python -m venv .venv && . .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest

The 22 tests confirm: the red-mug example parses against the schemas; every primitive accepts its minimal valid form; cross-field rules (e.g. move_to requires exactly one of location/pose, capture(media: video) requires duration, release(mode: place) requires at) fire correctly.

What works now at this pre-alpha milestone:

  • Pydantic v2 schemas for Layer-1 (capability manifest), Layer-2 (all 12 RFC-0002 primitives), Layer-3 (composition), the safety envelope, and the top-level URMLProgram.

  • The Step / BehaviorOrStep tagged union accepts the YAML surface ({move_to: {...}}) and the recursive composition forms.

  • The four-pass validator — urml_validator.validate(program, manifest, envelope, profiles) runs argument, capability, envelope, and binding checks and returns a ValidationResult with structured ValidationErrors. Error codes are stable and namespaced (argument.*, capability.*, envelope.*, binding.*); the LLM bridge will consume this format.

  • Example:

    from urml_validator import validate
    
    result = validate(program, manifest, envelope, profiles=("home",))
    if result.accepted:
        runtime.execute(program)
    else:
        for err in result.errors:
            print(err.render())
    

urml CLI

After pip install -e . the urml console script is on PATH:

urml validate examples/home/red-mug.urml.yaml \
  --manifest reference/validator/tests/fixtures/manifests/turtlebot4_home.yaml \
  --envelope reference/validator/tests/fixtures/envelopes/home_default.yaml \
  --profile home

Exit codes: 0 accepted, 1 validation failed, 2 usage error (missing file, bad YAML), 64 internal error.

Add --json to emit the raw ValidationResult for machine consumers (LLM bridge revision flow, CI checks).

Add --evidence-log PATH (on validate, execute, translate and run) to append one validation record per verdict to a local JSON Lines file. It is off by default and changes nothing the command prints. See docs/evidence/validation-records.md.

JSON Schema export

# Print one schema to stdout (suitable for piping into an LLM prompt fixture).
urml schema --name program

# Write all three schemas to a directory.
urml schema --all --out-dir build/schemas/

Produces Draft 2020-12 schemas for URMLProgram, CapabilityManifest, and SafetyEnvelope. The LLM bridge consumes the program schema as the structured-output contract; robot makers consume the manifest schema when writing manifests by hand.

The Python API mirrors the CLI:

from urml_validator import export_schema, write_schemas

schema = export_schema("program")  # dict
write_schemas(Path("build/schemas/"))  # writes urml-{program,manifest,envelope}.schema.json

What's not in this milestone (lands next):

  • Variable-binding type checking across primitives (e.g., that grasp(target: $foo) requires $foo to be an Object-typed binding, not a Measurement).
  • Geometric geofence containment (polygon-vertex math).
  • The LLM bridge (reference/llm-bridge/).

Metadata

Release files for urml-validator 0.5.2

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

Source distribution (sdist)

Source distribution for urml-validator 0.5.2
File Size Uploaded Provenance Actions
urml_validator-0.5.2.tar.gz 426.1 kB Without provenance Details for urml_validator-0.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for urml-validator 0.5.2
File Interpreter ABI Platform Actions
urml_validator-0.5.2-py3-none-any.whl Python 3 none any Details for urml_validator-0.5.2-py3-none-any.whl

Total release size: 651.8 kB

Release files / urml_validator-0.5.2.tar.gz

Download URL urml_validator-0.5.2.tar.gz
Size 426.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ebd0437b0d2abe372f2fd9e49a1fdd308167349d14286d31e093bf18a7c6001b
BLAKE2b-256 checksum
How to use checksums
442127b44a8ce69135cb9410f41992340c57d6f4e1466013303560c45cfded58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / urml_validator-0.5.2-py3-none-any.whl

Download URL urml_validator-0.5.2-py3-none-any.whl
Size 225.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
444a8e14f1a9890031b5736e7b2b39362f4f863fd909bca27f53a6fae2d8faf0
BLAKE2b-256 checksum
How to use checksums
a43a853c9eafc61a529af3c50314068919fb655d9d350ff10e58704ad103a9f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for urml-validator 0.5.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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