Skip to main content

run

Function run 

Source
pub fn run(path: &Path, check_ids: bool) -> Result<(), Box<dyn Error>>
Expand description

pv validate <path> — validate whatever artifact path holds.

Dispatches on what the file IS, not on the assumption that everything under contracts/ is a Contract. Five files in the corpus are not: two pv binding registries and three publish manifests, all of which failed here with missing field `metadata` while the directory walkers that lint them already knew to treat them differently. See provable_contracts::schema::artifact.

PVL-1 (PMAT-1099): a path that does not exist, or a directory without a contract file, is a DECLINE — exit 2, ZeroContracts — never an OS error at exit 1. Measured 2026-09-11 by the third review quorum on #3093, after two PASS quorums: pv validate <empty dir> answered Is a directory (os error 21) and pv validate /nonexistent answered No such file or directory (os error 2), both exit 1 — validate reads one artifact and never went through the walker every other reporting command was routed through. A directory WITH contract files validates every file lint would walk (the one definition of the corpus) and fails if any of them fails: measured, and named.