FailSlice

v0.1.1
io.github.sdmhdn/failslice Checked 2 days ago Published 3 days ago

Shrink multi-table CSV/Parquet data to a small, FK-consistent, verified reproducer of a data bug.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

inspect_dataset

Inspect CSV / Parquet / DuckDB tables inside the root: exact row and NULL counts, schemas, declared-FK orphan counts, bounded previews, and a config template. Give `directory` (all files in it) or `tables` (name -> path).

ParameterTypeDescription
base_dir
directory
foreign_keys
preview_rowsinteger
tables

suggest_relationships

Suggest primary and foreign keys for the files in `directory`, with evidence and a confidence label. These are suggestions to review, never facts. Returns the report and a failslice.yaml text with the suggestions commented out.

ParameterTypeDescription
directory *string
full_scanboolean
sample_rowsinteger

check_predicate

Validate a project (config_path to a failslice.yaml inside the root, or an inline `config`) and run the determinism check: the predicate must be TRUE on the full data four times with the same result. Runs in a supervised child process.

ParameterTypeDescription
base_dir
config
config_path

reduce_failure

Reduce the data to a small configuration that keeps the predicate TRUE, export it under <root>/.failslice/runs/<run_id>, replay it in a fresh process and write the report, manifest, CSV and pytest bundle. Long-running: progress is reported; cancelling the request kills the run. Budgets may not exceed the server's ceilings.

ParameterTypeDescription
base_dir
config
config_path
eval_timeout_s
max_evals
minimality
seed
wall_clock_s

verify_reproducer

Replay a run (by run_id, or 'latest') in a fresh process from its exported files only: predicate TRUE and referential integrity.

ParameterTypeDescription
run_id *string
timeout_s

explain_reproducer

Observations on the rows that survived reduction (row and NULL counts, duplicated declared keys, per-FK join pairs per key). Observations, not a diagnosis.

ParameterTypeDescription
run_id *string
limitinteger

export_pytest

Re-verify a run and write a self-contained pytest bundle (needs only pytest and duckdb) under <root>/.failslice/exports/<run_id>/<name>. expect='fails': the test passes while the bug reproduces; expect='passes': it passes once the bug is gone.

ParameterTypeDescription
run_id *string
expectstring
name
timeout_s