Spoolis docs
How verification works
Spoolis turns an agreed criterion and its evidence into a recorded result, then applies the agreement's economic rule. It does not always establish the underlying real-world truth itself.
Start with the transaction boundary
Spoolis is for transactions where payment depends on whether the agreed outcome actually happened.
For an integration, each check follows the same path:
criterion -> evidence -> verifier -> result -> economic rule- Criterion: define the condition before verification.
- Evidence: supply the artifact or confirmation the criterion requires.
- Verifier: route the evidence to an available execution method.
- Result: record what the verifier returned, then apply the agreed rule to determine earned value.
Good verification starts before the work runs. The agreement has to become something software can actually check without changing what was asked. That means writing the acceptance criteria first, declaring required evidence explicitly, and letting downstream systems continue only with accepted work.
Authority limits what can move. Spoolis determines what was earned. The receipt is signed before settlement. A wallet, marketplace, payment system, or configured integration may verify and consume it, then act under its own authorization and settlement policy.
Use a pinned outcome recipe
Fetch GET /recipes/qualified-companies-v1, and verify content_sha256 or the ETag if your integration pins the recipe. Pass the response's conditions field unchanged as the conditions input to verify_result or POST /api/v1/verify. Every condition in the qualified-companies recipe is fully evaluable in the keyless sandbox.
The hash proves the recipe is unchanged; it says nothing about the authority or quality of the criteria.
Who runs the check?
Outcome Receipt condition results support four execution methods. Deterministic and human-confirmed checks are live, and AI-assisted execution is live for claim_cited. Schema acceptance of any other method or checker does not mean an executor is live.
deterministic · LiveFixed code and inputs produce a fixed evaluation. The result proves what that code found in those inputs. It does not prove that the supplied evidence reflects real-world truth.
human_confirmed · LiveAn authorized person confirms the criterion. Spoolis records the confirmation and applies the agreed economic rule. The receipt proves what was recorded, not that Spoolis independently inspected the underlying event or item.
external_tool · Live when declaredA condition can name one external judge and proof requirement. Only a matching submitted external result can resolve it.
ai_assisted · Live for claim_citedThe claim_cited checker evaluates whether supplied text evidence supports a declared claim. Code verifies every returned quote against that evidence. Unsupported judgment classes and missing grounded citations return an uncertain verdict.
If Spoolis cannot support a criterion with an available verification method, it does not invent a verdict.
Result states and what to do next
Every Spool read and verification response reports terminal, settlement_eligible, can_resubmit_evidence, can_rerun, next_step, and decision_authority. Evidence resubmission appends to the existing evidence set and keeps its submitter, provenance, and timestamp.
| Result | Terminal | Settlement-eligible | Can resubmit | Can re-run | Who confirms |
|---|---|---|---|---|---|
| Pass | Yes | Yes | No | No | The authority declared by the conditions |
| Partial, unitized | Yes | Yes | No | No | The authority declared by the conditions |
| Partial, non-unitized | No | No | Yes | Yes, when required evidence is complete | The buyer for buyer confirmation, both parties for both-confirm, otherwise deterministic checks |
| Uncertain | No | No | Yes | Yes, when required evidence is complete | The buyer for buyer confirmation, both parties for both-confirm, otherwise deterministic checks |
| Fail while active | No | No | Yes | Yes, when required evidence is complete | The buyer for buyer confirmation, both parties for both-confirm, otherwise deterministic checks |
| Any terminal outcome | Yes | As recorded by the final verification result | No | No | No further confirmation |
A failed required condition is a definitive fail even when other checks remain uncertain; a unitized run then earns zero. A unitized partial result is final for that Spool. Accepted units remain settlement-eligible; rejected units need a new delivery. A non-unitized partial, uncertain, or failed active result can accept more evidence and run verification again over the full append-only evidence set.
Method and provenance are separate facts
The method says who or what resolved a condition. Evidence provenance records where an evidence item came from, how it was captured, its artifact reference, when it was observed, and which verifier used it. Provenance is origin and capture metadata, not a trust score. When provenance is missing, the origin is unknown.
Required fields are present
result: pass
method: deterministic
evidence provenance: uploaded JSONSpoolis does not assign universal assurance labels. A deterministic check over manually entered input and a human confirmation after physical inspection make different claims. The receipt exposes the raw facts so your integration can apply its own policy.
Verifier registry
The live deterministic registry includes checks for structured data, URLs, text, files, hashes, and timestamps. Fixed code and inputs produce a fixed evaluation. Durable evidence can support later reproduction, while a network response is a time-bound observation even when the checking code is fixed. Examples include:
row_countcompares the delivered dataset row count withexpected.completenessrequires every row to carry each ofrequired_fields, non-empty.duplicate_ratemeasures duplicates overkeyagainst amaximumrate from 0 to 1.url_formatrequiresfieldto hold a well-formed http or https URL in every row.json_pathcompares a dot or bracketpathin a structured evidence payload withexpectedusingoperator(eq, gte, lte, contains).http_statuschecks one public HTTP or HTTPSurlagainstexpected_statuswith SSRF protection and a bounded timeout.text_containschecks whether delivered text contains an agreed non-emptyneedle.hash_matchescomputes SHA-256 over delivered file bytes and compares the agreedexpecteddigest.deadline_metcompares the evidence record timestamp with the agreed ISOdue_at, never the evaluation clock.claim_citeduses AI-assisted execution to compare a boundedclaimwith supplied text evidence. It returns verbatim citations that code checks against the supplied evidence.
These are the checker names the API accepts in deterministic_check. Use verification_method: ai_assisted only with claim_cited. Check records and rejection reasons reference the underlying verifier ids in dotted form, for example url.format.
Missing or unreadable input does not pass. Each verifier returns an explicit reason when a check fails.
Verify the receipt, then apply your policy
In the canonical example, Spoolis verifies 100 enrichment records at $1.00 per accepted record, accepts 98, rejects 2 with reasons, and signs a receipt for $98.00 earned. Install the public npm verifier and verify that Outcome Receipt with a pinned trust set.
import { verifyOutcomeReceipt } from '@spoolis/receipt-verifier'
const verification = await verifyOutcomeReceipt(receipt, { trustSet })
if (!verification.valid) throw new Error(verification.reasons.join(', '))
console.log(receipt.amounts.earned)Offline signature verification proves authenticity without Spoolis uptime. You may optionally call GET /api/v1/receipts/{receipt_id}/status to add correction, revocation, or advisory state before the payment stack acts on the $98.00 earned amount under its own authorization policy.
A valid Ed25519 signature proves the receipt is genuine and unaltered. It does not prove that every underlying check can be reproduced forever, that supplied evidence reflects real-world truth, or that payment was authorized or settled. Deterministic checks over durable evidence can be reproducible. A live URL, external API result, or human confirmation may not be.
Read verify a receipt for package and trust-set details. Read when Spoolis decides and when you decide for the responsibility boundary.
Planner modes are a different vocabulary
The compiler does not propose third-party verification. It becomes runnable only when the agreement explicitly declares an external_judge; the receipt then records external_tool.
Lower-level attestation verification
The signed attestation is the lower-level verdict underneath the Outcome Receipt. Integrations should normally start with the portable receipt. If you need to verify an attestation directly, select the trust set matching its environment, validate its key ID, digests, expiry, amounts, parties, and authority, then verify the canonical payload with Ed25519. A demo attestation has no production settlement authority.
const { signature, signingKeyId, ...payload } = attestation
const bytes = Buffer.from(canonicalSerialize(payload))
const valid = crypto.verify(
null, bytes, publicKey, Buffer.from(signature, "base64")
)