CLI reference¶
whatif --help
Commands¶
Command |
Purpose |
|---|---|
|
Fork production traces, replay with a proposed change, score, emit verdict. |
|
Re-render an existing JSON report as Markdown (without re-running). |
|
Deep-dive a single trace from the last run-full diff, judge rationale, replay span tree. |
|
Print version and exit. |
|
Print top-level help. |
whatif fork¶
The main verb. Ingests traces, replays, scores, emits report.
Required flags¶
Flag |
Description |
Example |
|---|---|---|
- -source` |
Tracer to ingest from. |
|
- -target` |
Path to the user-supplied runner. |
|
- -change` |
The proposed change to apply. |
|
- -score` |
Scorer specification. |
|
Selection flags¶
Flag |
Description |
Default |
|---|---|---|
- -failures` |
Failure-cohort selector. |
required (or - -config`) |
- -baseline` |
Baseline-cohort selector. |
recommended; warning if omitted |
- -mode` |
|
|
Selector grammar:
"score-below:0.6,since:24h,limit:20"
"score-above:0.8,since:24h,limit:20,sample:random,seed:42"
"tag:incident-triage,limit:50"
Replay flags¶
Flag |
Description |
Default |
|---|---|---|
- -tool-cache` |
|
|
- -tool-allowlist` |
When - -tool-cache live`, comma-separated list of tools allowed to call live. |
empty |
Output flags¶
Flag |
Description |
Default |
|---|---|---|
- -report` |
Path for the Markdown report. |
|
- -json` |
Path for the machine-readable JSON report. |
|
- -quiet` |
Suppress progress output (the report is still written). |
|
Decision flags¶
Flag |
Description |
Default |
|---|---|---|
- -fail-on-regression` |
Exit |
|
- -regression-threshold` |
Median score drop above which to fail. |
|
Configuration mode (v0.2+)¶
whatif fork --config whatif.config.yaml --change system_prompt=prompts/v3.txt
When - -config is provided, all selection / replay / scoring / decision settings come from the YAML file. Only - -change is supplied per-invocation. See the config reference.
Exit codes¶
Code |
Meaning |
|---|---|
|
Passed configured policy. Ship-grade. |
|
Failed configured policy. Do not ship. |
|
Inconclusive-setup, replay, or scoring failure. |
whatif enforces your declared policy. Exit code 0 is not a safety certification; it means the run satisfied the policy you declared.
whatif report¶
Re-render a JSON report as Markdown. Useful for CI pipelines that want both formats but emit JSON first.
whatif report --json ./reports/run-1234.json --report ./reports/run-1234.md
whatif explain¶
Deep-dive a single trace from the most recent run.
whatif explain trace-id-abc123
Output: full diff, judge rationale, replay span tree, links back to the source tracer. Useful when the verdict report’s Evidence section flags a case as a regression and you want the underlying detail.