SpoolisDocs

Spoolis docs

Continue only with accepted work

Gate downstream actions on a verified result: verify delivered work against explicit criteria, then pass only accepted units to the next paid step.

Work returning is not the same as work passing. Verify against the agreement, then let only accepted units trigger the next action.

The shape

work returnsverifyaccepted: continuerejected/uncertain: hold

1. Verify the delivered work

Submit the agreement and the delivered records in one call. Declare the unit count so each record gets its own verdict. A 10-record example:

Request
POST https://spoolis.com/api/v1/verify
Authorization: Bearer <your API key>
Content-Type: application/json

{
  "conditions": [{
    "description": "Every record includes ticker, trade_date, and close",
    "deterministic_check": {
      "checker": "completeness",
      "required_fields": ["ticker", "trade_date", "close"]
    }
  }],
  "max_amount_cents": 10,
  "unit": { "total_units": 10, "unit_amount_cents": 1 },
  "evidence": { "type": "dataset", "rows": [ /* the 10 delivered records */ ], "provenance": "api_response" }
}
Response
{
  "accepted": 9,
  "rejected": 1,
  "uncertain": 0,
  "unit_results": [
    { "unit": 1, "verdict": "pass" },
    { "unit": 2, "verdict": "fail", "reason": "close is missing" },
    ...
  ],
  "receipt": { "id": "ocr_..", "schema": "spoolis/outcome-receipt@1", "signature": ".." },
  "receipt_url": "https://spoolis.com/r/.."
}

2. Pass only accepted units downstream

Iterate the per-unit results. Accepted units continue; rejected and uncertain units hold for retry or review.

Gate
const outcome = await verify(agreement, deliveredRows)

for (const result of outcome.unit_results) {
  const row = deliveredRows[result.unit - 1]
  if (result.verdict === 'pass') {
    await paidDownstreamAction(row)
  } else {
    holdForRetryOrReview(row, result)
  }
}

Uncertain verdicts are deliberate: when required evidence is missing, the result says so instead of guessing. For irreversible or paid actions, treat uncertain as not-cleared until the missing evidence is resolved.

3. Keep the receipt with the decision

The signed Outcome Receipt names each rejected unit and why. Reference it from whatever the gate controls, a payment description, a workflow log, a CI check, so the spending decision stays inspectable. See verify a receipt.

When this pattern is worth using

Use this when letting bad work through costs more than verification. If nothing priced happens downstream, the gate may just add cost. The economics, including where the gate loses money, are measured in when does verification actually pay for itself?

Continue only with accepted work · Spoolis