Quickstart
Install
Your First .plumb File
Save the following as demo.plumb. It declares a speed, records its Gaussian uncertainty in one line, and checks two predictions against the same budget.
assumption stat.gaussian_demo: StatisticalModel "Independent Gaussian measurement error."
role demo.speed: km/s "Speed of the demo carrier."
measurement obs_speed: demo.speed = 300 +- 10 km/s assuming stat.gaussian_demo
theory constant_speed {
v: km/s
predict demo.speed = v
}
compare check_consistent: obs_speed ~ constant_speed
at v = 305 km/s
accept chi2 <= 4
expect compared
by gaussian_ldlt
compare check_conflict: obs_speed ~ constant_speed
at v = 350 km/s
accept chi2 <= 4
expect conflict declared_budget_exceeded
by gaussian_ldlt
Run plumb check to see both verdicts.
plumb check demo.plumb
check_consistentevaluates ->compared.check_conflictevaluates ->conflict (declared_budget_exceeded).- The command exits with code
0. Both verdicts are completed checks. - The prediction applies to any measurement of
demo.speed.
Everyday CLI Workflow
Format canonically
plumb fmt demo.plumb # rewrite in canonical Plumb style
plumb fmt --check demo.plumb # fail (exit 2) if not formatted
Lock a workspace (plumb.lock)
Whenever your workspace has .plumb files and/or external JSON data files (artifact ... from "..."), generate or verify plumb.lock:
plumb lock my_project # creates or updates my_project/plumb.lock
plumb lock --check my_project # verifies exact-byte SHA-256 of every module & artifact
If you edit a .plumb module or a data file, plumb lock --check fails with exit code 2 until you deliberately re-run plumb lock (which bumps the module’s revision and records supersedes).
Check and emit an immutable receipt
plumb check my_project/analysis.plumb --out runs/attempt-1
This writes two files atomically inside runs/attempt-1/:
receipt.json(plumb.receipt/v1) — full machine-readable audit record with digests, verdicts, witnesses, and assumption ledgers.report.md— human-readable Markdown summary.
Plumb refuses to overwrite an existing attempt directory (exit code 2), preserving append-only audit history.
Inspect transitive assumptions (plumb trace)
plumb trace runs/attempt-1/receipt.json
plumb trace runs/attempt-1/receipt.json my_compare_name
plumb trace prints every assumption and active bias stage that contributed to a finding — transitively across all imported modules and derived from chains.
Compare two receipts safely (plumb compare)
To compare two candidate models against the exact same dataset, put your shared data and observables in data_module.plumb, then create two model modules (model_a.plumb, model_b.plumb) that import data_module and define the same compare check name(s) targeting the same observable(s). Importing data_module brings in its declarations without re-running its own checks.
plumb check my_project/model_a.plumb --out runs/model-a
plumb check my_project/model_b.plumb --out runs/model-b
plumb compare runs/model-a/receipt.json runs/model-b/receipt.json
plumb compare allows the candidate predictions (prediction_sha256) to differ while refusing if the two receipts differ in axis order, observation digest, covariance digest, conditioning, metric, units, active bias stack, or check set.
Validate an entire locked project (plumb validate)
plumb validate . # validate the locked project in the current directory
plumb validate my_project # verifies plumb.lock, strict JSON schemas, every module, and every `expect`
Explore docs, std modules, checkers, and error codes
plumb doc # built-in user guide topics
plumb doc language # syntax reference
plumb doc std.astronomy.ladder.cepheids # inspect any built-in std module source verbatim
plumb doc --search "bias" # search built-in docs
plumb list checkers # list all built-in `by <method>` verification checkers
plumb explain P0312 # explain a specific diagnostic code