{"slug":"reduce-api-williamrobinson-dev-v1-reduce-minimize-adccfa","title":"Given a source bundle, entry file, command, and failure predicate (exit code and","host":"reduce.api.williamrobinson.dev","method":"POST","resource":"https://reduce.api.williamrobinson.dev/v1/reduce/minimize","category":"code","description":"Given a source bundle, entry file, command, and failure predicate (exit code and/or stdout/stderr patterns), runs a deterministic delta-debugging reducer in a network-isolated sandbox and returns the reduced bundle and entry that still reproduce the failure, plus a replay script and run log. Scoped ","price_listed":0.5,"price_asked":0.5,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":531,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"bundle":"UEsDBBQAAAAAAAAAIVwQVBcsKwQAACsEAAAHAAAAbWFpbi5weWltcG9ydCBqc29uCgpmcm9tIGhlbHBlciBpbXBvcnQgbm9ybWFsaXplLCB3ZWlnaHRlZF9hdmVyYWdlCgoKZGVmIGxvYWRfZGF0YShwYXRoPSJkYXRhLmpzb24iKToKICAgIHdpdGggb3BlbihwYXRoKSBhcyBoYW5kbGU6CiAgICAgICAgcmV0dXJuIGpzb24ubG9hZChoYW5kbGUpCgoKZGVmIGJ1aWxkX3JlcG9ydChkYXRhKToKICAgIHZhbHVlcyA9IGRhdGEuZ2V0KCJ2YWx1ZXMiLCBbXSkKICAgIHdlaWdodHMgPSBkYXRhLmdldCgid2VpZ2h0cyIsIFtdKQogICAgbm9ybWFsaXplZCA9IFtub3JtYWxpemUodmFsdWUpIGZvciB2YWx1ZSBpbiB2YWx1ZXNdCiAgICBhdmVyYWdlID0gd2VpZ2h0ZWRfYXZlcmFnZShub3JtYWxpemVkLCB3ZWlnaHRzKQogICAgcmV0dXJuIHsiY291bnQiOiBsZW4odmFsdWVzKSwgImF2ZXJhZ2UiOiBhdmVyYWdlfQoKCmRlZiBhcHBseV9mbGFncyhkYXRhLCByZXBvcnQpOgogICAgZmxhZ3MgPSB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AAAAAAACkgWEFAABkYXRhLmpzb25QSwECFAMUAAAAAAAAACFca/EuTqkBAACpAQAACQAAAAAAAAAAAAAApIHYBQAAUkVBRE1FLm1kUEsFBgAAAAAEAAQA2gAAAKgHAAAAAA==","command":["python3","main.py"],"entry":"main.py","language":"python","maxRuns":400,"predicate":{"exitCode":1,"stderrPattern":"ZeroDivisionError"},"pruneFiles":true,"timeoutMs":2000},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"$defs":{"predicate":{"additionalProperties":false,"anyOf":[{"properties":{"exitCode":true},"required":["exitCode"]},{"properties":{"stdoutPattern":true},"required":["stdoutPattern"]},{"properties":{"stderrPattern":true},"required":["stderrPattern"]},{"properties":{"timeoutIsFailure":true},"required":["timeoutIsFailure"]}],"properties":{"exitCode":{"description":"Exact exit code, or \"nonzero\" to match any non-zero code including signals and timeouts.","oneOf":[{"maximum":255,"minimum":0,"type":"integer"},{"const":"nonzero"}]},"stderrPattern":{"description":"ECMAScript regular expression (compiled with the \"u\" flag) tested against the captured, capped stderr.","maxLength":256,"minLength":1,"type":"string"},"stdoutPattern":{"description":"ECMAScript regular expression (compiled with the \"u\" flag) tested against the captured, capped stdout.","maxLength":256,"minLength":1,"type":"string"},"timeoutIsFailure":{"description":"Treat a run that exceeds timeoutMs as satisfying the predicate.","type":"boolean"}},"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"bundle":{"contentEncoding":"base64","description":"Base64 .zip of the bundle: source files and inputs (<= 2097152 bytes decoded), no symlinks, no absolute paths, no \"..\" entries.","maxLength":2796204,"type":"string"},"command":{"description":"Command run from the bundle root; argv[0] must be one of node, python3, sh.","items":{"maxLength":512,"minLength":1,"type":"string"},"maxItems":16,"minItems":1,"type":"array"},"entry":{"description":"Relative forward-slash path inside the bundle of the file to reduce textually (<= 524288 bytes, UTF-8 text).","maxLength":1024,"minLength":1,"type":"string"},"language":{"default":"auto","description":"Language hint for structure-aware passes; \"auto\" sniffs from the entry's extension.","enum":["auto","text","json","javascript","typescript","python","c-like"],"type":"string"},"maxRuns":{"default":400,"description":"Upper bound on candidate executions.","maximum":600,"minimum":1,"type":"integer"},"predicate":{"$ref":"#/properties/input/properties/body/$defs/predicate"},"pruneFiles":{"default":true,"description":"Whether files other than the entry may be deleted when the failure survives without them.","type":"boolean"},"timeoutMs":{"description":"Per-run wall-clock limit in milliseconds.","maximum":5000,"minimum":100,"type":"integer"}},"required":["bundle","entry","command","predicate","timeoutMs"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"$defs":{"artifact":{"additionalProperties":false,"properties":{"href":{"format":"uri","type":"string"},"mediaType":{"type":"string"},"name":{"enum":["reduced.zip","entry.txt","replay.sh","runs.jsonl","report.json"],"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"sizeBytes":{"minimum":0,"type":"integer"}},"required":["name","mediaType","sizeBytes","sha256","href"],"type":"object"},"check":{"additionalProperties":false,"properties":{"code":{"type":"string"},"detail":{"type":"string"},"status":{"enum":["passed","failed","not_checked"],"type":"string"}},"required":["code","status","detail"],"type":"object"},"predicate":{"additionalProperties":false,"anyOf":[{"properties":{"exitCode":true},"required":["exitCode"]},{"properties":{"stdoutPattern":true},"required":["stdoutPattern"]},{"properties":{"stderrPattern":true},"required":["stderrPattern"]},{"properties":{"timeoutIsFailure":true},"required":["timeoutIsFailure"]}],"properties":{"exitCode":{"description":"Exact exit code, or \"nonzero\" to match any non-zero code including signals and timeouts.","oneOf":[{"maximum":255,"minimum":0,"type":"integer"},{"const":"nonzero"}]},"stderrPattern":{"description":"ECMAScript regular expression (compiled with the \"u\" flag) tested against the captured, capped stderr.","maxLength":256,"minLength":1,"type":"string"},"stdoutPattern":{"description":"ECMAScript regular expression (compiled with the \"u\" flag) tested against the captured, capped stdout.","maxLength":256,"minLength":1,"type":"string"},"timeoutIsFailure":{"description":"Treat a run that exceeds timeoutMs as satisfying the predicate.","type":"boolean"}},"type":"object"},"runOutcome":{"additionalProperties":false,"properties":{"durationMs":{"minimum":0,"type":"number"},"exitCode":{"type":["integer","null"]},"failing":{"type":"boolean"},"signal":{"type":["string","null"]},"stderrBytes":{"minimum":0,"type":"integer"},"stdoutBytes":{"minimum":0,"type":"integer"},"timedOut":{"type":"boolean"}},"required":["exitCode","signal","timedOut","durationMs","stdoutBytes","stderrBytes","failing"],"type":"object"},"runSummary":{"additionalProperties":false,"properties":{"bytes":{"minimum":0,"type":"integer"},"entryBytes":{"minimum":0,"type":"integer"},"entryLines":{"minimum":0,"type":"integer"},"files":{"minimum":0,"type":"integer"},"run":{"$ref":"#/properties/output/properties/example/$defs/runOutcome"}},"required":["files","bytes","entryBytes","entryLines","run"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"artifacts":{"items":{"$ref":"#/properties/output/properties/example/$defs/artifact"},"maxItems":5,"type":"array"},"checks":{"items":{"$ref":"#/properties/output/properties/example/$defs/check"},"type":"array"},"command":{"items":{"type":"string"},"type":"array"},"entry":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"limitations":{"items":{"type":"string"},"maxItems":100,"type":"array"},"original":{"$ref":"#/properties/output/properties/example/$defs/runSummary"},"passes":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string"},"removedBytes":{"type":"integer"},"removedFiles":{"minimum":0,"type":"integer"},"runs":{"minimum":0,"type":"integer"}},"required":["name","runs","removedBytes","removedFiles"],"type":"object"},"type":"array"},"predicate":{"$ref":"#/properties/output/properties/example/$defs/predicate"},"prunedFiles":{"items":{"type":"string"},"maxItems":100,"type":"array"},"reduced":{"$ref":"#/properties/output/properties/example/$defs/runSummary"},"reductionRatio":{"maximum":1,"minimum":0,"type":"number"},"runs":{"additionalProperties":false,"properties":{"budgetExhausted":{"type":"boolean"},"failing":{"minimum":0,"type":"integer"},"passing":{"minimum":0,"type":"integer"},"timedOut":{"minimum":0,"type":"integer"},"total":{"minimum":0,"type":"integer"}},"required":["total","failing","passing","timedOut","budgetExhausted"],"type":"object"},"status":{"enum":["passed","failed"],"type":"string"},"tools":{"additionalProperties":false,"properties":{"reducer":{"type":"string"},"runner":{"type":"string"}},"required":["reducer","runner"],"type":"object"},"truncated":{"type":"boolean"},"warnings":{"items":{"type":"string"},"maxItems":100,"type":"array"}},"required":["status","tools","entry","command","predicate","original","reduced","reductionRatio","passes","runs","prunedFiles","checks","warnings","limitations","truncated","expiresAt","artifacts"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.5,"price_match":true,"latency_ms":531,"error":null}],"description_full":"Given a source bundle, entry file, command, and failure predicate (exit code and/or stdout/stderr patterns), runs a deterministic delta-debugging reducer in a network-isolated sandbox and returns the reduced bundle and entry that still reproduce the failure, plus a replay script and run log. Scoped to a local minimum under the passes listed, never a proof of global minimality.","last_updated":"2026-09-11T20:07:51.105Z","schemes":["exact"]}