Skip to content

Reference

Commands

Generated from native help.

usage: __main__.py [-h] --thresholds THRESHOLDS --out OUT
                   [--specs-root SPECS_ROOT] [--worlds-root WORLDS_ROOT]
                   [--started-at STARTED_AT] [--completed-at COMPLETED_AT]
                   manifest

Write one result file per trial of an evidence manifest.

positional arguments:
  manifest              livingproof-hallway-evidence/2.0.0 manifest

options:
  -h, --help            show this help message and exit
  --thresholds THRESHOLDS
                        JSON object of time_limit, lateral_limit, half_width,
                        and fall_height. Example: {"time_limit": 27.0,
                        "lateral_limit": 0.49, "half_width": 0.75,
                        "fall_height": 0.5}. The limits actually graded are
                        written to thresholds.json in --out
  --out OUT             Directory for one JSON file per trial and for
                        thresholds.json, the limits those results cite.
                        Example: evaluator-results/livingproof-scenario
  --specs-root SPECS_ROOT
                        A robot-capability-specs checkout (the directory that
                        holds specs/). A scenario graded on its world, such as
                        walk-corner, reads its parameters.json from it. The
                        frozen straight-route scenario ignores it
  --worlds-root WORLDS_ROOT
                        A livingproof-worlds checkout (the directory that
                        holds worlds/). A scenario graded on its world reads
                        its world.json from it, and the file's sha256 must
                        match the manifest's lock. The frozen straight-route
                        scenario ignores it
  --started-at STARTED_AT
                        UTC timestamp, default the current minute
  --completed-at COMPLETED_AT
                        UTC timestamp, default the current minute

API

Generated from installed public functions.

livingproof_evaluator_scenario.checks

accepted_limits(parameters: 'dict', raw: 'dict') -> 'dict'

Limits this evaluator would grade with for raw inputs.

The numbers are livingproof_scenario_parameters.resolve. A reference problem or a bad input is that package's ERROR, and this module has no copy of a limit formula.

assess(observation, thresholds, trial_id, seed=None, *, world=None, parameters=None)

One assessment per check in the parameter file, in that file's order.

thresholds are the limits the verifier already resolved. world supplies the route and the exit; omitted, the frozen straight route is used.

assessment(evaluator, status, rationale, evidence_id, details=None, assessor='deterministic')

No function docstring supplied.

fail_absent_or_greater(check, observation, limits, eid, seed, route, exit_place, document, world, frozen_record)

Fail when the exit crossing is absent or its time is strictly over the limit.

fail_greater(check, observation, limits, eid, seed, route, exit_place, document, world, frozen_record)

Fail when the greatest distance to the route is strictly over the limit.

fail_less(check, observation, limits, eid, seed, route, exit_place, document, world, frozen_record)

Fail when the lowest base height is strictly under the limit.

fail_not_empty(check, observation, limits, eid, seed, route, exit_place, document, world, frozen_record)

Fail when any wall contact is recorded.

fail_not_in_order(check, observation, limits, eid, seed, route, exit_place, document, world, frozen_record)

Fail when a through-place is missed or entered out of order before the exit.

failure(check, observed, limit, unit, t, seed, **extra)

Structured failed check, so a PR comment can group failures.

first_crossing(samples, route, exit_place)

The first sample at which a step crosses the exit, or None.

p0 is strictly before the exit line and p1 is on or past it. Later samples are not considered.

first_distance_excess(samples, route, limit)

Time of the first sample whose distance to route is strictly over limit.

limits_from_thresholds(parameters: 'dict', thresholds: 'dict') -> 'dict'

Parameter-file limits taken from the threshold object the verifier passes.

exit_segment is still accepted under the verifier's half_width key.

trace_crosses(p0, p1, route, exit_place)

Whether the step p0 to p1 crosses exit_place, from the parameters package.

The package stops being true once a step has crossed: callers keep the first true.

trace_distance(route, point)

Floor-plane distance from point to route, from the parameters package.

livingproof_evaluator_scenario.result

canonical_json(value) -> 'bytes'

UTF-8 JSON with sorted keys, no insignificant whitespace, and one trailing newline.

The sha256 on a thresholds input is the digest of these bytes. The same value always produces the same bytes. NaN and Infinity are rejected.

grade_trial(steps: 'list[dict]') -> 'str'

Trial outcome from its step verdicts. Every step must pass.

package_version() -> 'str'

Installed distribution version as SemVer. hatch-vcs fills it from the git tag.

parameters_source(parameters: 'dict | None' = None) -> 'dict'

Specification identity for the parameter document that selected the limits.

The vendored parameters.json records its repository, tag, commit, path, and file sha256. Any other document records only the sha256 of its canonical JSON, because no tag or commit is known for it.

thresholds_bytes(thresholds: 'dict', parameters: 'dict | None' = None) -> 'bytes'

Canonical bytes of :func:thresholds_document. This is the digest input.

thresholds_document(thresholds: 'dict', parameters: 'dict | None' = None) -> 'dict'

The exact limits graded, plus the parameter-file source when it is known.

Limit names are the parameter file's names. half_width is recorded as exit_segment. Keys that grading ignores are omitted, so two objects that grade as the same limits have one document.

thresholds_input(thresholds: 'dict', parameters: 'dict | None' = None, *, uri: 'str' = 'thresholds.json') -> 'dict'

Contract input reference for the limits that will be graded.

role, uri, and sha256 are the only fields. uri is the file name :func:write_run writes beside the results.

trial_id(configuration: 'str', index: 'int') -> 'str'

Result id verify already assigns: {configuration}-seed-{index:02d}.

trial_result(observation: 'dict', thresholds: 'dict', trial_id: 'str', *, seed=None, inputs: 'list[dict]', started_at: 'str', completed_at: 'str', world: 'dict | None' = None, parameters: 'dict | None' = None) -> 'dict'

The result document for one trial. Findings are empty.

inputs gains the thresholds reference for the limits this call grades. A caller-supplied entry with that role is replaced, so the digest is the canonical limits rather than a digest the caller asserted.

write_run(manifest_path: 'Path', thresholds: 'dict', out_dir: 'Path', *, started_at: 'str', completed_at: 'str', world: 'dict | None' = None, parameters: 'dict | None' = None) -> 'list[Path]'

Write one result file per trial, and thresholds.json beside them.

The file name of each result is the result id. thresholds.json is the canonical limits every result in this call cites. Its bytes are what the thresholds input's sha256 names, so keeping the output directory keeps the referenced input.

Every trial is read and graded before anything is written. A trial that cannot be graded (for example an unknown observation format) raises before the output directory is created or changed, so a failed run leaves no partial results.

Tasks

Run from the prepared repository checkout, not a Docker wrapper.

check

task: check

Check Python with locked Ruff

commands:
 - uv run --locked --no-sync --no-python-downloads ruff check .
 - uv run --locked --no-sync --no-python-downloads ruff format --check .


setup

task: setup

Sync locked dependencies into the project environment

commands:
 - uv sync --locked --no-python-downloads


test

task: test

Run locked pytest

commands:
 - uv run --locked --no-sync --no-python-downloads python -c "import os; os.makedirs('artifacts', exist_ok=True)"
 - uv run --locked --no-sync --no-python-downloads pytest --junitxml=artifacts/tests.xml


verify

task: verify

Run checks and tests

commands:
 - Task: check
 - Task: test


docs:build

task: docs:build

Generate references and build the branded manual

commands:
 - uv run --locked --no-sync python tools/docs/build.py
 - .docs-venv/bin/zensical build --clean


docs:setup

task: docs:setup

Install locked documentation tools separately from runtime dependencies

commands:
 - uv venv --python 3.12 .docs-venv
 - uv pip sync --python .docs-venv/bin/python --require-hashes tools/docs/requirements.lock


docs:verify

task: docs:verify

Check rendered local links, fragments and shared branding

commands:
 - python3 tools/docs/verify.py
 - .docs-venv/bin/python tools/docs/test_deploy_guard.py