retryfuse contract reference

The input you give retryfuse and the evidence it returns. Contract version 1. The decision core is pure and deterministic: the same input always yields the same report.

Back to overview

Input contract

Input is a single JSON object. operation.endpoint is required; everything else is optional and defaults safely.

Decisions

Every evaluation returns exactly one decision. Correctness gates (conflict, exactly-once replay, in-flight, uncertain-write reconciliation) are checked before the budget and circuit brake, because a blind replay is unsafe regardless of remaining budget.

DecisionMeaning
replay_safeNo committed effect exists (a clean first attempt, or a pre-write failure that provably did not land), and the circuit is within its failure and budget limits. Safe to replay.
replay_storedThe operation already completed under this idempotency key with a confirmed committed effect. Return the stored response verbatim — exactly-once, no second execution.
brakeDo not replay. Either a request is already in flight under this key, or the circuit is open from a failure streak or budget burn. Braking stops the retry storm.
reconcile_requiredThe write state is uncertain — a post-write timeout, a timeout of unknown phase, an unknown outcome, or a completed record whose effect is unconfirmed. Reconcile the real state before any replay; never blind-retry.
reject_conflictThe idempotency key was reused with a different request fingerprint. The second request is client misuse and is refused rather than executed.

Evidence status

Each report carries an evidence status: pass, fail, unknown. unknown is a first-class value, kept distinct from both pass and fail — an uncertain write is not a failing write.

CLI exit codes

The CLI returns an exit code for CI gating:

ExitStatusMeaning
0passreplay_safe / replay_stored — safe to proceed
2failbrake / reject_conflict — an unsafe condition was detected
3unknownreconcile_required — safety cannot be determined without reconciliation
1unverifiedmalformed input — the request could not be evaluated
node src/cli.mjs INPUT.json            # machine-readable report
node src/cli.mjs INPUT.json --human    # human-readable report

Learn by example

The fixture matrix documents the contract by example, covering positive, negative, malformed, missing-data and adversarial cases.