Yichus / Reference / API MCP tools
api_snapshot
Keep an example you trust and re-check it after every edit. Record: pass sources and binding (plus inputs and rows as api_why takes them, and mocks and clock) and save the returned candidate as the snapshot. Check: pass sources and the saved snapshot; the run repeats with its own inputs, seeded rows, clock and mock answers in a fresh in-memory database. When an edit changes a mocked request, pass new mocks with the snapshot. status is matches, changed or new. comparison lines up the ordered IO receipts (same, changed, removed and inserted steps) and both results. A changed run returns candidate; pass review: true and show the person reviewHtml, and save the candidate only after they accept it. Database effects stay in memory; the clock answer is fixed; each registered integration call and random_int must match the next mock's operation and request exactly, and that mock supplies the result; other host operations are refused. It describes this example only, not every input or schedule.
Kind: Snapshot. Family proofs: MCP servers list it once api_tools opens that family. Origin: Yichus/Mcp::catalog.
CLI: yichus snapshot — one implementation: SnapshotCheck records a run or re-runs a saved one; the CLI keeps the snapshot, its pending proposal and the review page in files and promotes with snapshot accept, the tool takes and returns the records.
Parameters
sources(required, array) — JSON array of {fileName, source} Bosatsu files for the module.snapshot(optional, object) — The saved yichus-run-snapshot-1 record to re-check; omit to record a new run.binding(optional, string) — To record: the binding to run, as Pkg/Name::binding.inputs(optional, object) — To record: JSON object {param: value}, as api_why takes it.rows(optional, object) — To record: JSON object {table: [row, ...]} seeding the in-memory database.mocks(optional, array) — To record: JSON array of exact {operation, request, result} answers for host calls, in call order.clock(optional, integer) — To record: the fixed clock answer in epoch milliseconds (default 0).seed(optional, integer) — To record: seed for omitted inputs (default 41).review(optional, boolean) — Optional; true adds reviewHtml, a standalone page comparing the two runs, to show the person.
Read the result according to this tool’s scope: static checks, bounded execution checks, and descriptive diagrams answer different questions. A successful call is not a general approval of the program. The safety and permissions guide compares the checks and provides editable ownership, guard, and role examples.