Metadata-Version: 2.5
Name: livingproof-capability-report
Version: 5.0.6
Summary: Portable evidence and capability reports for Living Proof Labs
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Python: >=3.11
Requires-Dist: click==8.5.1
Requires-Dist: defusedxml==0.7.1
Requires-Dist: jsonschema==4.25.1
Requires-Dist: livingproof-common>=1.0.51
Description-Content-Type: text/markdown

# Living Proof Labs capability report

**Start here: [documentation](https://docs.livingprooflabs.com/livingproof-capability-report/).**

[Demo reports](reports/index.html) (demo data) show the published report cards.

Documentation previews: [build and verification guide](docs/verification.md) (14-day CI artifacts).

[![Tests, builds and compatibility](https://github.com/Living-Proof-Labs/livingproof-capability-report/actions/workflows/verify.yml/badge.svg?branch=main)](https://github.com/Living-Proof-Labs/livingproof-capability-report/actions/workflows/verify.yml)
[![Package release](https://img.shields.io/github/v/release/Living-Proof-Labs/livingproof-capability-report)](https://github.com/Living-Proof-Labs/livingproof-capability-report/releases/latest)
[![License](https://img.shields.io/github/license/Living-Proof-Labs/livingproof-capability-report)](LICENSE)

An installable Python library and thin Click command group for portable capability
results. Validate evidence bundles and render the decisions that
[capability-verifier](https://github.com/Living-Proof-Labs/capability-verifier) stored in
them as lossless JSON, offline HTML, markdown or explicitly flattened CSV. The reporter
never grades.
This is a deterministic fixture demonstration, not robot safety certification.
No server, simulator, source checkout or Task installation is needed by consumers.

A [demo reports site (demo data)](reports/index.html) is published with this documentation so we can iterate on card layout. It is demo data, not a real robot run. After `task docs`, open `artifacts/docs/html/reports/index.html`.

## Install a release

In a fresh directory for one release, download the Reporter wheel or Debian package and `SHA256SUMS` from
[Releases](https://github.com/Living-Proof-Labs/livingproof-capability-report/releases).
When the release lists a verified Debian package, it is `Architecture: all`: it ships only pure-Python reporter
files and metadata. Apt installs architecture-appropriate `python3-click`,
`python3-jsonschema`, and `python3-defusedxml` dependencies. All files are managed by dpkg; no pip writes
into system Python, private interpreter, native wheel or vendored virtual
environment is included. The native support matrix is documented below.

```sh
sudo apt install ./python3-livingproof-common_*_all.deb ./livingproof-capability-report_*_all.deb
livingproof-capability-report --help
```

Alternatively, use a Python 3.11+ virtual environment (never system-wide pip):

```sh
python3 -m venv .venv
.venv/bin/pip install ./livingproof_common-*-py3-none-any.whl ./livingproof_capability_report-*.whl
.venv/bin/livingproof-capability-report --help
```

Common is published only by [Living Proof Common](https://github.com/Living-Proof-Labs/livingproof-common/releases).
Before the commands above, download its wheel or Debian package separately from
that canonical release and verify its `SHA256SUMS`. Select the Common version
recorded in `uv.lock` at the exact Reporter release tag; the Reporter Debian
package also declares that exact version in its `Depends` field. Do not use
`latest` or an independently selected version for the Debian dependency.

For scripted preparation from an exact Reporter release checkout,
`python3 tools/fetch_common.py` stages and verifies those canonical bytes in
`dist/` using the lock selection and reviewed checksums. These remain internal
build/test inputs, not Reporter release assets. Place the verified Common wheel
beside the Reporter wheel for the Python command above, or the Common Debian
package beside the Reporter Debian package for apt.

Other wheel dependencies resolve normally. For offline CPython 3.12 installation,
extract the matching architecture's Reporter wheelhouse and copy the separately
verified Common wheel into `wheels/` before disconnecting. Then install with
`pip install --no-index --find-links=./wheels livingproof-capability-report`.
The public wheelhouse excludes Common; the internal image/test wheelhouse stays
complete. Historical immutable releases and their bundled assets are unchanged. The source
archive is also attached. Release package versions come from the release tag;
there are no generated version commits. Python 3.11, 3.12 and 3.13 are exercised through the distribution packages below.
Other Python versions and platforms are not claimed.

Container images are published to public GHCR for Linux AMD64 and ARM64.
Each new release includes its registry manifest digest, supported platforms and
copy/paste pull and run commands in the release notes. Prefer that immutable
reference for reproducible use. The manifest digest is distinct from Docker's
local image ID; native release jobs verify both the installed version and that
the pulled image matches the exact CI-tested image.

Routine releases attach wheels, source archives, offline wheelhouses, compatibility
reports and their checksums. Debian is optional: the release notes say whether the
same Debian candidate passed on both native architectures and was attached. Image archives remain
short-lived internal CI transfers, retained for 14 days, rather than routine
public release attachments. Historical saved-image release assets remain intact.
For an explicit offline image export, first pull the release's digest for the
required platform, tag it locally, and save that local tag with `docker save`.
The receiving machine can use `docker load` with that archive.

Version 1.2.0 initially encountered a `write_package` denial. The
[recovery workflow](https://github.com/Living-Proof-Labs/livingproof-capability-report/actions/workflows/recover-registry.yml)
verifies and publishes that version's original saved images. Those historical
assets remain available. Later routine releases do not attach image archives.

See [release notes](https://github.com/Living-Proof-Labs/livingproof-capability-report/releases)
for immutable image instructions verified by both native architecture jobs.

## Report a portable bundle

With the reporter installed, run this quickstart from the repository root (or
from the extracted source archive containing `examples/`):

```sh
livingproof-capability-report validate examples/bundle/manifest.json
livingproof-capability-report render examples/bundle/manifest.json --format json -o report.json
livingproof-capability-report render report.json
livingproof-capability-report render report.json --format html -o report.html
livingproof-capability-report render report.json --format csv -o report.csv
```

`validate` checks the manifest structure and evidence digests; `render` reads the
verifier's stored decisions from a bundle 1.1.0 manifest (or a saved `report.json`)
and displays them (a terminal table by default). For your own bundle, replace
`examples/bundle/manifest.json` with its manifest path. Installed packages do not
require a checkout to report your bundle.

The example is a walk-hallway run written by capability-verifier: 20 seeded trials of
the stock Unitree G1, 12 of which pass. The **manifest** describes the results, contract
versions, assessments, the verifier's decisions and run assessment, and relative evidence
paths with their digests. Evidence files, such as `examples/bundle/evidence/stock-seed-01.json`,
are referenced by that manifest; they are not standalone reporter input. Keep them at the
relative paths declared by their manifest.

Outputs must be new files. Rendering never grades or silently substitutes a newer
policy. JSON retains the entire source manifest, original producer results,
assessments, evidence references, integrity observations, exact-context groups and
stored decisions. Evidence bytes stay in the portable bundle. HTML is self-contained,
escaped, script-free and usable offline. CSV is deliberately flattened: one decision
per row, with spreadsheet-formula protection; it is not a round-trip representation.

Importable API:

```python
from livingproof_capability_report import load_bundle, render, report_from_bundle
saved = report_from_bundle(load_bundle("examples/bundle/manifest.json"))
html = render(saved, "html")
```

The installed distribution advertises `livingproof_capability_report.cli:report`
as `report` in the `livingproof.capability.commands` entry-point group. A compatible
umbrella can mount that same Click group as `livingproof capability report` when
both packages are installed in the same Python environment. Neither library
depends on the other; the standalone command and Python API remain unchanged.
Version v1.3.0 predates this metadata; it remains usable standalone.

## Bundle and grading contract

Grading belongs to capability-verifier. It assesses the evidence and writes a bundle with
`schema_version` 1.1.0 that carries its decisions; this reporter only checks and renders
them ([reporter #30](https://github.com/Living-Proof-Labs/livingproof-capability-report/issues/30)).

The packaged `bundle.schema.json` stays in this repository. Its `$id` is the schema's
address and its `version` is `1.1.0`, the newest bundle `schema_version` it accepts.
It accepts `schema_version` 1.0.0 and 1.1.0. Each result
includes an identifier, released catalog tag and commit, capability/revision, system and
environment versions, relative evidence paths with SHA-256 digests, assessments,
provenance and the original producer result. Unknown extension fields are retained.
Duplicate JSON keys, non-finite numbers, undeclared evidence references, absolute
paths, traversal and symlinks are rejected. URLs are never fetched. Digests detect
changed bytes; they do not authenticate who produced the evidence.

A 1.0.0 bundle still validates, but it has no decisions, so `render` refuses it with an
error that points to the verifier: assess the evidence with capability-verifier v1.9.0
or later, which writes bundle 1.1.0, and render that. There is no averaging and no
overall numeric score. Aggregation groups exact spec, system and environment contexts.
Step names, limit lines and failure wording come from the bundle's scenario
description and the stored evaluator results. When an observed or required
value is not a number (a list of places passed, a word), the HTML step card writes it
out, with places as `<place> at <t> s` and `(required …)` in place of a limit.
A directory passed as `--output`
with `--format markdown` is written as `<scenario>.markdown`, using the scenario
id on that description (or the result capability when the description has none).

## Version 2.0.0: render the verifier's grading (bundle 1.1.0)

Reporter 2.0.0 is a major release. capability-verifier (from the release that adds
`--bundle-version 1.1.0`) grades walk-hallway evidence itself and writes the outcome
into a bundle with `schema_version` 1.1.0: each result carries a `decision` (status,
reason, structured failures, assessor types, policy), and the bundle carries an
`assessment` in robot-capability-specs' `livingproof-run-assessment/0.1` format (every
decision, plus per run k of N, the Wilson 95% interval, the grade and its rationale).

    livingproof-capability-report render bundle/manifest.json --format json -o report.json
    livingproof-capability-report render bundle/manifest.json --format markdown -o report.md

`render` accepts that manifest directly and computes nothing: statuses, k, N, interval and
grade are shown as stored. `report.json` is the same report document 1.x `grade` wrote
(`summaries` keep the `wilson95` pair), so `report.md` and the `comment` body are
byte-identical to what 1.x produced from the same evidence. `--evidence-links` adds CI
links (see below). A missing or malformed required field is an error naming the field
and the result. Evidence is still checked: a stored PASS whose evidence is missing or
changed is refused.

What changes for callers:

- The packaged bundle schema accepts `schema_version` 1.0.0 and 1.1.0.
- `grade`, `human-template`, the policies (`--policy`, `--human`, `--previous`,
  `--require-pass`) and the `grade` Python function are removed
  ([#30](https://github.com/Living-Proof-Labs/livingproof-capability-report/issues/30)).
  Bundles 1.0.0 are refused by `render`; produce 1.1.0 with capability-verifier instead.
- Saved `report.json` files from earlier releases, including grade revisions, still
  render as stored.
- How human reviews apply to 1.1.0 bundles is not decided yet.

## What the HTML report shows

A [demo reports site (demo data)](reports/index.html) is published with this manual and uses the same renderer and `site` assembly as a production reports section.

`--format html` opens with a summary card: the stored success ring, the success
count and percentage (for example "12 successes, 60%"), the
mission title when the feature spec has one, and one mark per evaluator result.
Finding rows appear only when a result's descriptor lists them. The ring is the
stored rate. A finding that is not in the verdict tier does not change it. Opening
a mark shows only what that result declared: its descriptor (title, version,
purpose, source, tier, and detail text). A card never holds the run record: the
test context, trials, evidence, pins and full report follow the summary card at
run level, and the reporter's own scenario step panels are not shown (#207). A
spec sentence that restates a plan, such as `description.mission.grading`, is not
shown: a stock sentence can still say "20 runs" on a 3-trial assessment. The
acceptance line is that required count as a percentage of `n`, for example
"90% required". A result without a descriptor uses the fallback name and the
letter disc and says so. Each mark shows its own declared state, so a mark can show
a tick on a failed run; the overall run status says FAIL. A quiet non-advisory
mark says "No problems reported by this evaluator." in its panel and its
accessible name. A run with no evaluator results gets no marks: the card says
"No evaluation was stored for this run." The reporter makes up no placeholder mark.

### Deep-linking to an evaluator

On a run page each evaluator tab carries a stable anchor, `evaluator-<evaluator id>`
(for example `#evaluator-livingproof-run-integrity`), on the tab's `<details>` element.
Characters outside `A-Z a-z 0-9 . _ -` become `-`, and a repeated id gets `-2`, `-3`.
Opening the page with that fragment, or navigating to it, opens that evaluator's tab and
moves focus to it. Link to this anchor from other pages. Do not link to
`run-evaluators-tab-N`: the tab number follows the reporter's own order (tier, then
title), so Run Integrity is tab 2 whenever a Scenario result is present. Without
JavaScript the fragment only scrolls to the tab. The `run-evaluators-tab-N` and
`run-evaluators-panel-N` ids are unchanged.

Every value is read from the stored report and its source bundle and HTML-escaped;
nothing is regraded or recomputed, and a field the report does not carry is left out.
The trial table (Result, Catalog, Revision, Environment, Status, Reason) follows.
The collapsed `<details>` block embeds the stored JSON. Addresses that point at a
GitHub Actions artifact are left out of that public copy; `report.json` still keeps
them. `--format table`
prints the policy and grade revision as trailing lines; `--format csv` adds `policy` and
`grade_revision` columns only when the decisions carry `assessment_details`.

## Compatibility evidence

`examples/bundle` is a walk-hallway bundle 1.1.0 in the layout capability-verifier
writes: stock Unitree G1, catalog v1.6.0, 20 seeds, 12 PASS and 8 FAIL, run grade FAIL
(18 of 20 needed). Its rendered markdown and report are pinned in
`tests/fixtures/hallway-expected`; they were produced by the 1.x `grade` path before it
was removed, so the tests show `render` reproduces that output byte for byte from the
stored decisions. The earlier pause example (a 1.0.0 bundle) was removed with grading.

## Contribute a human assessment

The `human-template` command and human re-grading were removed with the reporter's
grading ([#30](https://github.com/Living-Proof-Labs/livingproof-capability-report/issues/30)).
How human reviews are recorded for bundle 1.1.0 is not decided yet; reports saved by
earlier releases keep their human contributions and still render.

## Contributors and delivery

Read [Contribute](CONTRIBUTING.md) for the deliberately adopted
[collaboration-guidelines v6.0.0](https://github.com/Living-Proof-Labs/collaboration-guidelines/tree/v6.0.0)
and local instructions. This guidance pin is separate from the release workflow below.

Install Python 3.12, uv, Docker and Task 3.54.0, then use `task setup`, `task verify`,
`VERSION=0.0.0 task package` and `VERSION=0.0.0 task smoke` from a fresh checkout.
Task delegates to locked native tools. `PACKAGE_NETWORK=host` optionally selects
Docker networking for environments that require it; no daemon configuration changes.
Packaging uses the official Python build backend, pip, venv and `dpkg-deb`.

CI attaches the wheel, source archive, native dependency wheelhouses,
compatibility reports and SHA-256 checksums after anonymous registry verification.
`task package:debian` and `task smoke:debian` are separate optional checks. A build,
APT, or smoke failure warns rather than blocking the wheel or its required render checks.
Image archives are 14-day CI artifacts and are not routine release attachments.
The shared release workflow is pinned to
[collaboration-guidelines v3.0.0](https://github.com/Living-Proof-Labs/collaboration-guidelines/tree/v3.0.0).
Release builds install the exact published package version. Clean containers test
wheel and Debian installations without mounting source. A normal `docker run`
tests the convenience entrypoint; a separate shell override tests the same image
as a job container. Providers can override entrypoints or require a shell; identical
startup behavior across CI providers is not claimed. JUnit expectation tests stay
separate from the capability decisions. No PyPI publication or new credentials.

Original code and fixture adaptations are Apache-2.0; see [LICENSE](LICENSE).

## Debian and ARM support

The authoritative compatibility results are generated by the
[CI matrix](https://github.com/Living-Proof-Labs/livingproof-capability-report/actions/workflows/verify.yml),
not manually contributed machine claims. Each run summary and package artifact
contains `compatibility-amd64.json` / `.md` and `compatibility-arm64.json` / `.md`.
Published versions attach those same machine-generated reports to
[Releases](https://github.com/Living-Proof-Labs/livingproof-capability-report/releases).
The required reports cover wheel, source and image probes. Complete optional
Debian install records are separate CI evidence; release notes report whether the
exact Debian asset was published. These records cover actual OS/version details,
architecture, Python, installation method,
native versus emulated execution, outcome and the evidence run URL. A missing
probe is explicitly NOT_COMPLETED, never counted as supported.

The current automated coverage targets Debian 12, Debian 13 and Ubuntu 24.04,
plus wheel/source/image installations, on amd64 and arm64. Consult a release's
records for what actually passed rather than assuming a configured target passed.

The jobs use `ubuntu-24.04` and `ubuntu-24.04-arm` hosts, with matching-architecture
clean distribution containers. This is native CPU testing, not QEMU emulation or
testing on a particular Googlebook. Installation, commands, importable logic and
removal are checked; distribution-owned dependencies remain after removal.
When Debian is published, optional release verification installed the same candidate
`all.deb` on both CPUs first. Without both proofs the release omits the Debian
asset and reports why. Anonymous downloads of every attached asset are still
checked against the published checksums.

The older v1.0.0 package really is amd64/Python-3.12-specific: its private environment
contains `rpds.cpython-312-x86_64-linux-gnu.so`. Do not force its architecture or
install it on Debian's Python 3.11/3.13. Version 1.2 uses distribution dependencies
with tested minimum versions instead. Apt owns any native dependencies; their
architecture labels remain intact. This is a packaging change, not a file rename.
If upgrading an old installation, apt removes the old package-owned `/opt` files.

Use `cat /etc/os-release`, `python3 --version`, and `dpkg --print-architecture`
to match a device to these automated results. Debian variants outside the coverage are not
verified. The ARM Docker image includes its own Python runtime, so a host's
Python minor version does not control it; working Docker support is still needed.
No changes to a user's device or system Python are performed by this project.

Multi-architecture releases publish immutable version-specific `-amd64` and
`-arm64` images, then one versioned manifest after both native checks pass.
Published previous tags are unchanged. Check Reporter’s `SHA256SUMS` for its wheel,
source archive, `all.deb` and architecture-specific wheelhouses. Check the canonical
Common release’s separate `SHA256SUMS` for Common inputs.

## Test results in GitHub

The verify job uploads JUnit results even when tests fail. The job summary lists
individual cases. The Reporter tests check is created already completed, so a
failed follow-up update cannot leave it in progress. A missing or unreadable
report fails the job. A failure to create or update that check is a warning and
does not by itself fail the job. Fork pull requests receive the summary and
artifact without a write-token check. Raw reports are retained for 14 days. This
provides per-run history for comparison; this integration does not implement a
historical trends dashboard or promise automatic trend correlation.

## Terminal rendering and compatibility

`livingproof-capability-report render report.json` prints a concise table to
standard output, without color or ANSI sequences. It shows stored decisions and
separate contexts, never an overall grade or regrading. This invocation was an
error in v1.0.0 because `--output` was required; adding it is backward-compatible.

Existing `render report.json -o report.html` commands still default to HTML. Use
`--format table -o report.txt` for a saved table, or explicit `--format json`,
`--format html`, or `--format csv` with stdout or a new output file. Library
`render(report)` continues to default to lossless JSON. Scripts should name their
format explicitly. Existing output files are never overwritten.

Release automation assembles packages and checksums on a draft, verifies native
image consumption and the same Debian asset on both architectures, then publishes
the complete immutable release. Historical v1.0.1 and v1.1.0 release records lack
package assets because their earlier workflow attempted upload after publication;
use v1.2.0 or later for these packaging improvements.

## Container development

The `development` target in [Dockerfile](Dockerfile) supplies Python, pinned uv,
Task and Git. It shares the Python base with the small installed-package runtime
target; development dependencies come from the same committed `uv.lock` used by
CI. The release image retains only the installed application and its dependencies.

With Docker Compose and Task on a Linux host (the host wrappers are tested on Linux):

```sh
task dev:build
task dev:verify
task dev:shell
```

On a host using a TLS-inspecting proxy, set `DEV_CA_BUNDLE` to the host's PEM
CA bundle before starting Compose or the devcontainer. It is mounted read-only;
the released development image's `dev-ca-env.sh` combines it with the container
trust bundle for development commands. With no override, `/dev/null` is mounted
and normal container trust remains in effect. Both paths forward the host's
uppercase and lowercase HTTP/HTTPS proxy and no-proxy variables. No certificate
or credential belongs in this repository.

The [devcontainer](.devcontainer/devcontainer.json) builds that same target for
VS Code, Cursor and GitHub Codespaces. Reopen in the container; its creation hook
runs `task setup`. Inside, use `task check`, `task test` and `task verify` directly.
No Docker daemon, host Docker socket, privileged mode or Docker-in-Docker is
required inside the development environment. Package/image building remains a
host/CI task because it requires Docker.

[Development CI](https://github.com/Living-Proof-Labs/livingproof-capability-report/actions/workflows/development.yml)
builds this Docker target on native AMD64 and ARM64 and runs those same Task
commands. This verifies the image and setup/verification lifecycle, not a live
Codespaces session or a particular editor launch. No paid Codespace or new account
grant is provisioned by these checks.

## Retain human reviews as grade revisions

Grade revisions (`all-required-v2@1.0.0`, `--previous`, `--require-pass`) were
removed with the reporter's grading. Earlier reports that embed a `previous_report`
and `grade_revision` still render their own stored decisions without regrading; the
embedded history is kept in JSON but no longer checked or rendered. For a CI gate, use
the verifier's run grade in the bundle's `assessment`.

## Identify the version you are testing

Native shared-environment CI tests the candidate with checksum-verified Living
Proof 2.2.6 and the Common wheel selected by `uv.lock`, including both standalone
and `livingproof capability report` commands. This replaces the older 1.5.17
host baseline, whose exact Common 1.0.0 requirement is incompatible with the
current Common minimum; it does not claim compatibility with that historical pair.

Version policy is supplied by livingproof-common. Runtime and isolated build
metadata declare the tested compatible minimum rather than an exact runtime pin.
Renovate's Common-only `pep621` rule bumps this floor; `uv.lock` records the exact
selected public PyPI wheel and SHA-256 for development and release staging.

A normal isolated pip source install resolves the declared build requirements
from PyPI independently of `uv.lock`; it does not promise the locked build
version. From a fresh directory containing one Reporter source archive:

```sh
.venv/bin/pip install ./livingproof_capability_report-*.tar.gz
.venv/bin/livingproof-capability-report --help
```

Release staging verifies the original Common wheel against the lock and its
immutable upstream checksum manifest. The matching Common Debian asset and
digest come from that same locked version's immutable GitHub release. Native
apt compatibility remains exact; no second manually maintained Debian digest
is needed for a future dependency bump. The reporter supplies only its own
package and repository context; no version algorithm is copied here.

Run `livingproof-capability-report --version` and include both output lines in a
problem report. For example:

```text
livingproof-capability-report, version 1.4.0-dev.3+branch.fix-input-a1b2c3d4.gabcdef123456.dirty
Package: 1.4.1.dev3; identity source: checkout
```

The first line identifies source state. A clean checkout or build exactly on a
`vX.Y.Z` release tag displays plain `X.Y.Z`. Development identities include the
nearest release tag, Git's commit distance from that tag, a bounded branch label,
the first 12 commit-hash characters, and `clean` or `dirty`. Tracked modifications,
staged changes and nonignored untracked files count as dirty. Ignored build
outputs do not. The dirty marker identifies a state, not a digest of uncommitted
contents; two different dirty trees can display the same identity.

Only branch names present in local `origin` tracking refs for this public
repository are eligible for display. Other local branches display `local`;
detached checkouts use a unique matching public tracking branch if available,
otherwise `detached`. Public slugs are at most 33 characters, including a hash
suffix to distinguish normalized/truncated names. These local observations are
not authenticated origin or release attestations. URLs, local paths and private
local branch names are not printed or stored in build provenance.

`dev.empty` means Git has no commits. `dev.untagged.N` means there is no usable
release tag and N commits are visible from the history root, not since a release.
Shallow histories display `dev.unknown` with a `shallow` marker; missing Git or
provenance displays `0.0.0-dev.unknown+nogit.unknown`. Unknown state is never
presented as a clean release.

The second line reports the installed PEP 440 package version and the identity
source. `checkout` is refreshed from the reporter's own source tree on each call,
so editable installs reflect changes without reinstalling; the caller's working
directory is never used. `recorded-build` uses provenance embedded in the wheel
or source distribution, retained by Debian and container packaging without `.git`.
If a live checkout's Git cannot be read, `checkout-unavailable` reports unknown
current identity instead of presenting a stale build snapshot as current.

Package metadata still comes from the existing
[Hatch-VCS](https://github.com/ofek/hatch-vcs) / setuptools-scm integration, with
its stock `no-local-version` scheme to avoid wall-clock dirty dates. The display
identity is separate from package ordering: it is SemVer-shaped but is not a
release number to pass to an installer. Release `VERSION` overrides control
package metadata, not observed source identity. A small
[Hatch build hook](https://hatch.pypa.io/1.13/plugins/build-hook/custom/) embeds
`_build_provenance.json`; source-distribution rebuilds retain that snapshot.
No current timestamp is included. Identical source observations and package
versions produce identical provenance JSON. The installed-package smoke tests
check its retention and CLI agreement for wheels, source distributions, Debian
packages and container images.

## Publish a reports section

This documentation also publishes a [demo reports site (demo data)](reports/index.html) assembled through the same command, from in-repo mock fixtures.

`livingproof-capability-report site REPORTS_DIR --runs DIR --repository OWNER/NAME` builds a static,
single-robot reports section, the one the
[Verification Reports action](https://github.com/Living-Proof-Labs/verification-reports-action)
publishes on GitHub Pages. Each folder in `DIR` is one run: `report.html`, `report.json`,
`report.md`, `report.txt`, `SHA256SUMS` and `run.json`. The command checks every checksum,
copies the run under `ROBOT/SCENARIO/runs/RUN_ID/`, and writes:

- `index.html`, the latest grade of each scenario, failures first;
- `ROBOT/SCENARIO/index.html`, the scenario's run history, and `latest/`, a redirect to the
  newest run;
- each run's published page, with the site navigation and spec provenance added and the
  links it cannot keep (other Actions pages, evidence it did not publish) turned to text;
- `styles.css`, `open.js` and `site.json` (robot, scenario and run counts).

`REPORTS_DIR` may already hold earlier runs, for example restored from the last Pages
deploy. They are rechecked and kept byte for byte; `--exclude-run RUN_ID` (repeatable) drops
one. Copied MCAP, video and media expire after `--evidence-retention-days` (default 7); the
report pages and checksums stay. Each run shows the `ref` its `run.json` records, exactly as
recorded: a `vX.Y.Z` release tag for a released run, otherwise the 40-character commit. Any
other `ref` stops the build; a run with no `ref` shows its commit. The command never runs
`git` or reads the caller's repository. It then checks every link, checksum and published word,
and exits non-zero on any problem. It never fetches anything and never regrades a run.

`--repository` (default `GITHUB_REPOSITORY`; the command refuses to run without it, or when it
is not `OWNER/NAME`) names the caller. Only that repository's own CI run pages (`https://github.com/OWNER/NAME/actions/runs/N`,
case exact, ending at the address or at the HTML entity that closes it) stay links. Any other
Actions address is removed from the pages and the report JSON: other repositories, a case
variant, a suffix such as `/job/2`, `?x=1` or `.zip`, and an `/actions/` hidden by percent or
entity encoding, quoted or not. Every `run.json` must carry a `run.url` that is one of the
caller's runs. A missing, malformed or foreign `run.url` stops the build with
`run.url must be a run of this repository`, naming each `run.json`. Drop that run with
`--exclude-run`, or start the history again.

`--validated-viewer-run ROBOT/VARIANT/runs/RUN_ID` (repeatable) names a restored run whose
trusted viewer the caller has already validated (manifest, release asset, recording and trial
binding, the exact native panel), as verification-reports-action does before it calls `site`.
A restored run's `index.html` normally may not hold an `<iframe>`; for a listed run it must
hold exactly one viewer frame as `compose_viewer_page` writes it: a whole element in the
native advisory panel, with `src` `trusted-viewer/viewer.html#` plus the recording fragment
(`file`, `sha256`, `run`, `configuration`, `trial`, in that order, no extra keys). The four
values are bound to the run's own `report.json`, as `validate_viewer_page` binds them: `sha256`
is the digest of the recording the report cites, `run` and `configuration` are those of the
observation-bound result, `trial` is the recorded trial index, and the cited recording, a
published file beside `report.json`, must have that digest. The command puts that panel back to the original and checks the remaining shell; the rest of
the page, `report.html` and the evidence get every check as usual. The generic wording scan
still opens every published text file, including those under `trusted-viewer/`, so a viewer
or recording that holds "artifact" or an `/actions/` link refuses the build. Those files are
not judged otherwise, and nothing under `trusted-viewer/` is changed, added or deleted — that
stays with the caller's `validate_restored`. Each entry is one exact path, with no globs. A listed run that is not
in the history, has no `trusted-viewer/` folder, or is also passed to `--exclude-run` stops
the command before anything is written. A same-run replace (`--allow-replace-run-id`) of a
listed run replaces the whole run, its `trusted-viewer/` included, so the caller treats that
folder as gone. When evidence expiry rewrites a decorated run as a
plain page, the caller composes the viewer again and checks the result with
`validate_viewer_page`.

Two helpers are public for callers that add to a published run folder:
`livingproof_capability_report.site.checked_report_html(text, where)` returns the page
unchanged when it passes the published HTML policy (it raises `SiteError` otherwise). A
`<script>` that carries the reporter's marker attribute but not the reporter's bytes is
cut out with a warning, so a caller must compare the result with its input; any other
script raises `SiteError`.
`livingproof_capability_report.site.write_published_checksums(folder)` rewrites the folder's
`SHA256SUMS` over every other file in it. A symlinked `SHA256SUMS` is refused, and the
file is written to a temporary name in the same folder and renamed into place, with the mode
the previous file had (or a plain new file's). A temporary file an earlier crash left behind
(the name `mkstemp` writes: `.SHA256SUMS.` plus eight `[a-z0-9_]` characters plus `.tmp`)
is removed and never listed. A file a user named differently is left alone.

## Walk-hallway results

capability-verifier grades walk-hallway trials one per result and stores each decision
in the bundle, with the failed checks' structured fields
`{check, observed, limit, unit, t, seed, wall}`. A seeded run's assessment gives k of N,
the Wilson 95% interval, the required passes and the run grade. A run that compared its
repeats stores one grade and a `reproducibility` object instead of a rate: null `k`,
`n`, `required_passes` and Wilson bounds, plus `reproducibility.statement` when the
repeats agree. The report keeps each run as a `summaries` entry and shows only those
stored fields.

    livingproof-capability-report render bundle/manifest.json --format markdown -o summary.md

writes a PR-comment summary in Art's layout. It starts with a stable
`<!-- livingproof-verification -->` marker so CI can update one comment in place. Then it gives
a header (scenario, the plan's trial count, speed, pass bar, lock sha), a grade table, a plain verdict and
"Why runs failed" bullets (each seed counted once, under its first failure). When the
result's provenance says the repeats were compared, that count is labelled as repeats
rather than `N=`, and the verdict and Passed cell are the stored agreement statement
instead of a success rate. Per-seed tables
are in `<details>`, followed by a footer. Thumbnails appear only when results carry
`provenance.assets`. `--report-url`, `--clips-url` and `--lock-diff-url` add a links row.

`livingproof-capability-report comment --repo OWNER/NAME --pr N reports/*/report.md` posts the
rendered markdown as one pull-request comment under `<!-- livingproof-capability-report -->`,
updating that comment in place on later runs. It uses `GITHUB_TOKEN` (needs
`pull-requests: write`) and the REST API directly; `--dry-run` posts nothing.

`render MANIFEST --evidence-links FILE` (repeatable; bundle 1.1.0 manifest only) stores
evidence links in the report under `evidence_links`, outside the source bundle, so no
digest or grade changes. This file is the one caller input for evidence paths:

```json
{"run": "https://github.com/OWNER/REPO/actions/runs/1",
 "links": [
   {"label": "logs", "path": "evidence/logs.txt", "kind": "log"},
   {"label": "MCAP", "path": "evidence/seed-01.mcap", "kind": "mcap", "seed": 1, "status": "PASS"},
   {"label": "video", "path": "evidence/seed-01.mp4", "poster": "evidence/seed-01.jpg",
    "why": "Typical pass", "kind": "video", "seed": 1, "status": "PASS"},
   {"label": "coverage", "path": "evidence/coverage.txt", "kind": "note"},
   {"label": "video", "path": "evidence/seed-04.mp4", "kind": "video",
    "seed": 4, "status": "FAIL", "expired": true}]}
```

`path` is a relative site path (or a site-root path such as `/runs/current/evidence/log.txt`).
The public page copies that string into `href` or, for a live video, into the player
`src`. It is not joined to a hidden base and it is not rewritten. `poster` and `why`
are optional and appear only when present; the reporter does not choose which videos
to feature and does not write a coverage sentence of its own. Kinds are `log`, `mcap`,
`video`, `note` and `artifact`. An optional https `url` is kept in `report.json`. When
that url is a GitHub Actions artifact address, the public page does not show it or the
word artifact. Entries with an empty URL, no path and no expired flag are dropped.

Set `"expired": true` on a file the site has pruned. The page then shows
`Evidence expired after N days` (class `is-expired`) for that file, in its trial chip
and its Evidence item, and does not link or play it. When every file of a run has
expired, the Evidence card note says the same instead of "kept".
Pass the same `N` the site uses to prune, once, with `--evidence-retention N`. The
reporter has no default and will not render an expired file without it. The same value
is the note on live evidence. For example, `--evidence-retention 7` reads "Evidence
kept for 7 days" on live files and "Evidence expired after 7 days" on pruned ones, and
`--evidence-retention 30` reads "Evidence kept for 30 days".

`--history-href` and `--history-label` add one navigation slot on the HTML page, so the
styled report can be published with no wrapper around it. Href is a relative site path
or an https URL, rendered exactly. Omit both and the page has no slot; the reporter
does not invent a link. Supplying only one of them is an error.

```
livingproof-capability-report render bundle/manifest.json --format html -o report.html \
  --evidence-links links.json --evidence-retention 7 \
  --history-href ../ --history-label "Run history"
```

`--pinned-inputs pins.json` (HTML only) takes a JSON list of the resolved pin records the
caller holds, each with a `name` and a `status` (`verified`, `not-published`, `resolved` or
`fixture`). The page gets a "Pinned inputs" section with one line per pin, such as
`livingproof-capability-report: verified (attestation matched)`, placed after the evidence
and before the full lossless report. An absent or empty list renders no section, and the
other formats refuse the flag. The caller supplies the data and renders no HTML itself.

These three flags also apply when rendering a saved `report.json` to HTML, except
`--evidence-links`, which still applies only while reading a bundle 1.1.0 manifest.
Absent flags keep the previous render, except that a public page no longer shows a
GitHub Actions artifact address. Markdown still lists a stored https url when no
`path` was supplied, so an existing links file keeps its pull-request text. Rendering
refuses a per-trial link whose status disagrees with the stored decision for that seed.

The development target (used by Compose and the devcontainer) extends the
immutable Living Proof development image pinned in `Dockerfile`. `task setup`
still installs this Reporter checkout and its own `uv.lock` into
`/tmp/report-venv`; it does not use a preinstalled Reporter. Host packaging,
Debian, runtime-image and browser verification retain their existing paths.
