vpf-cli 0.1.0

The `vpf` command: check plans in the Verifiable Plan Format and show them in words.
vpf-cli-0.1.0 is not a library.

VPF Rust SDK

Read, check and show plans in the Verifiable Plan Format (VPF).

A plan says what is wanted, who does each step and what proves each step is done. This SDK reads a plan from its JSON text, tells every problem the specification defines, and says the plan in words a person can read before it runs. It passes every conformance case of VPF 1.

Crate What it is
vpf The library: read, check and show a plan.
vpf-cli The vpf command.

The library

let text = std::fs::read_to_string("monthly-sales-report.vpf.json")?;
let report = vpf::check(&text);
if report.may_run() {
    let plan = report.plan.unwrap();
    print!("{}", vpf::words_text(&plan));
} else {
    for problem in &report.problems {
        println!("{problem}");
    }
}

check returns every problem with a reason that does not change, such as proof.missing, the step it is about and a sentence. Reason::as_str gives the id, so a program can say it in its reader's language.

The command

cargo install --path crates/vpf-cli
vpf check plans/*.vpf.json          # ends with 1 when a plan may not run
vpf check --json report.vpf.json    # the problems as JSON
vpf show report.vpf.json            # the plan in words
$ vpf check conformance/plans/several-problems.vpf.json
conformance/plans/several-problems.vpf.json: 6 problems
  step.id: Count: An id is not 1 to 24 small letters, digits or -, or is asked.
  proof.missing: Count: A step an agent does has no proof.
  ...

Development

cargo test
cargo clippy --all-targets -- -D warnings
cargo fmt --all --check

conformance/ and examples/ are copied from the vpf repository; conformance/SOURCE.md names the commit. Run scripts/sync-conformance.sh path/to/vpf to copy them again.

Commits follow Conventional Commits and are signed off under the Developer Certificate of Origin (git commit -s).

License

Apache License 2.0.