Documentationtestnet

Concepts

The model proposes; policy decides

Understand the structured model contract, deterministic policy checks, and the signed RiskGuard boundary.

v0.1 · testnet

Model contract

The model receives only a parsed EvidencePacket. It must return one strict FacilityQuote with an enumerated decision, bounded numeric fields, a pinned policy version, a pinned model version, and exactly the registered evidence ID.

json
{
  "decision": "APPROVE",
  "advanceBps": 2000,
  "feeBps": 100,
  "riskTier": "A",
  "evidenceIds": ["0x…"]
}

Deterministic policy checks

  • Advance cap: the quote cannot exceed 40% of the order value.
  • Guarantee ratio: the buyer guarantee must satisfy the configured minimum.
  • Tenor: the exact source delivery deadline must be within the configured 90-day policy window.
  • Buyer concentration: reserved exposure is bounded against total capacity.
  • Expiry, evidence binding, lifecycle state, signer approval, policy version, and liquidity are checked before approval.
  • RiskGuard also rejects a signed quote above its MAX_FEE_BPS bound and emits QuoteDecisionAudited with the decision inputs when the deployed bytecode includes the event.

Signing and submission

bash
corepack pnpm --filter @loomcredit/agent quote /tmp/evidence.json --sign
corepack pnpm submit:quote /tmp/signed-quote.json --dry-run
corepack pnpm submit:quote /tmp/signed-quote.json

Signing requires a separate private key whose address is allowlisted in RiskGuard. The worker/operator key pays the transaction fee; it is not silently reused as the model signer. The submission script validates LIVE_VERIFIED status, contract binding, chain ID, quote shape, and recovered signature before reporting success; --dry-run performs those checks without broadcasting. A deployed bytecode version with QuoteDecisionAudited lets an indexer compare the signed decision inputs with the on-chain audit record; the current recorded deployment predates that event and is not presented as having emitted it.

Failure behavior

FailureResult
Missing model or timeoutREFER / MODEL_UNAVAILABLE; no signing.
Malformed model outputSchema failure; no policy approval.
Unsafe numeric quoteREJECTED by deterministic policy.
Expired or replayed quoteRejected by policy or RiskGuard.
Missing signerSigning fails closed with CONFIG_INVALID.

Documentation is generated from the current repository contract. For the recorded testnet evidence, inspect the live proof console.