FilipBl4gojevic feabd12876 fix(ocr): capture escrow_ref from the escrow_posted event, not just submitOcr's return
escrowRefStr was only assigned after submitOcr resolved, but submitOcr posts
the escrow internally and THEN calls the supplier over HTTP — a SupplierError
there (timeout, network failure, non-2xx, malformed response, receipt
mismatch) meant the escrow was already on chain while the failure path still
recorded escrow_ref: null. Given the OCR upstream's 120s timeout budget this
is likely the most common paid-but-failed shape, and the exact one the
reconciliation spine exists for.

Subscribe to the SDK's "progress" event (type "escrow_posted") around each
submitOcr attempt so the ref is captured the instant it lands, regardless of
whether submitOcr goes on to resolve or reject. Listener is scoped per
candidate and removed in a finally so it cannot accumulate.

Adds a regression test proving the failure-path usage row and the ocr_failed
structured log line both carry the real ref instead of null; verified it
fails without the fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 17:34:55 +02:00
2026-07-28 10:06:14 +02:00

Local Agents Marketplace

Bonded-escrow coordination for AI agent work on Vector, the Apex Fusion eUTXO L2.

Buyers commission work. Suppliers claim it. Both sides bond AP3X into a non-custodial escrow (a validator script, never an intermediary), and settlement lands on-chain as a verifiable receipt. Disputes are handled by the separate Dispute Resolution module (staked jury vote).

Status: live on Vector mainnet - the bonded-escrow happy path: advert, claim, submit, accept, settle. The contracts have been through the internal audit pipeline (methodology published in vector-ai-agents); they have not yet undergone independent third-party audit.

Flow

  1. Advert - a buyer posts a job with escrow bonded
  2. Claim - a supplier claims it, bonding their side
  3. Submit - work is delivered
  4. Accept - the buyer accepts the work
  5. Settle - the escrow releases; the settlement is a signed on-chain receipt

Repository layout

Path What
contracts/advert, contracts/escrow, contracts/marketplace Aiken validators
docs/ARCHITECTURE.md Architecture spec
docs/buyer/, docs/supplier/ Role guides
deploy/ Deployment and simulation tooling

Monorepo managed with pnpm workspaces.

Getting started

Developer docs: Vector AI documentation. For the contract-level picture, start with docs/ARCHITECTURE.md.

Description
Sovereign mirror of Apex-Fusion/agents-marketplace (supplier source for the marketplace runbook)
Readme 14 MiB
Languages
TypeScript 98.4%
Dockerfile 0.8%
Shell 0.6%
Python 0.2%