caelum0x edaf16b08b feat(product): domain presets/recipes, provenance workspace, product README
Wave 5 — approachability & front door:
CLI — discover --preset (physics/ecology/epidemiology/finance/general) + presets
catalog; explicit flags override presets. library becomes a provenance-aware
workspace: world/data content hashes, columns, config, tags captured on add;
library search + compare over the workspace (backward-compatible index).

SDK — lawsynth.recipes (parity with CLI presets) + Study.discover(recipe=...,
**overrides); three runnable domain demos. Van der Pol shows the payoff: general
recipe misses the cubic term, mechanics recipe recovers -x+v-x^2*v (R2 0.99995).

Docs — a real product README (hero + Lorenz GIF, CLI+Python quickstart, feature
matrix by product loop, surfaces + HTTP endpoints, honest tone); refreshed
getting-started pages and a CHANGELOG Unreleased section. All flags verified
against the shipped CLI usage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 21:53:47 +03:00

84 lines
3.1 KiB
Markdown

# CLI
Install the `lawsynth` binary, or run it in place during development:
```sh
cargo install --path crates/lawsynth-cli
# or
cargo run -p lawsynth-cli -- --help
```
Every command prints its own usage. The full command set, grouped by the product
loop:
## Discover
```text
lawsynth discover OBS.{csv,tsv,parquet} --time COLUMN --state NAME[,NAME...] --output WORLD.lsworld
[--degree N] [--threshold VALUE] [--solver stlsq|sr3] [--trigonometric] [--rational]
[--savgol-window ODD_N | --spline | --spectral | --tvreg-lambda VALUE [--tvreg-iterations N]]
[--smooth-radius N] [--bootstrap REPLICATES] [--symbolic-depth N]
[--regimes] [--pareto] [--refine] [--causal]
```
Only one derivative estimator may be selected at a time. `--regimes`, `--pareto`,
`--refine`, and `--causal` turn on the corresponding optional discovery stages and
add their findings to the printed summary.
## Understand
```text
lawsynth explain WORLD.lsworld
lawsynth inspect WORLD.lsworld
```
## Use
```text
lawsynth simulate WORLD.lsworld --initial NAME=VALUE [--initial ...] --start T --end T --step DT
[--parameter NAME=VALUE] [--input NAME=VALUE]
[--parameter-at TIME:NAME=VALUE] [--input-at TIME:NAME=VALUE]
lawsynth simulate-discrete WORLD.lsworld --initial NAME=VALUE [--initial ...] --steps N [--start T] ...
lawsynth forecast WORLD.lsworld [--horizon T] [--start T] [--step DT]
[--initial NAME=VALUE]... [--parameter NAME=VALUE]... [--intervene NAME=VALUE@TIME]... [--output FORECAST.csv]
```
## Compare
```text
lawsynth compare WORLD-A.lsworld WORLD-B.lsworld [--json] [--html FILE]
lawsynth scenarios WORLD.lsworld [--horizon T] [--start T] [--step DT]
[--initial NAME=VALUE]... --scenario NAME[:k=v@t,...] [--scenario ...] [--html FILE]
```
## Share
```text
lawsynth report WORLD.lsworld [--output REPORT.html] [--title TEXT]
[--start T] [--end T] [--step DT] [--initial NAME=VALUE]... [--data OBS.{csv,tsv,parquet}] [--time COLUMN]
lawsynth export WORLD.lsworld --format <python|latex|json> [--output FILE]
```
## Organize, scaffold, and validate
```text
lawsynth library <add|list|show|remove> [--dir DIR] ...
lawsynth templates
lawsynth new TEMPLATE [--output WORLD.lsworld] [--data OBS.csv] [--samples N]
lawsynth validate WORLD.lsworld --data OBS.{csv,tsv,parquet} [--time COLUMN] [--holdout FRACTION]
lawsynth pipeline PIPELINE.toml | lawsynth pipeline --example
lawsynth doctor
```
`library` maintains a local index (default `~/.lawsynth/library.tsv`, override with
`--dir`) of tagged, described `.lsworld` bundles. `templates`/`new` scaffold from the
built-in worlds `lorenz`, `lotka-volterra`, `pendulum`, `van-der-pol`, and `sir`.
`validate` scores a world on a held-out fraction of a dataset. `pipeline` runs a
whole ingest → discover → validate → report → export flow from one TOML file
(`--example` prints a documented sample). `doctor` reports whether the install is
healthy.
CSV parsing is intentionally strict: quoted fields, missing values, and non-numeric
values are rejected. On invalid input or an unknown command the process exits with a
non-zero status and an explicit diagnostic.