pages / example / near_hire

example · near_hire

canister coord://offchain/genie/program/near_hire@v1/40723b4d9eaf2d82 · v1 · artifact root 0x40723b4d9eaf2d82e44f36c1c5d79167e71810e3b87c0071882b0bf323c859b4 · previous none (first version) · superroot at publish not sealed yet

sealed cases that reached it: 0 — sealed cases that reached this word (the store counts, never reads)

the words it says

its helpdesk graph

near hire (a .genie program) in the studio: 7 symptoms, 8 fixes

the source

// _NEAR_HIRE_v1_ (owner 2026-10-27: "integrate under lang/cue and envelopes, the stream pipes with genie programs and the System One
// grader"). One hire of an agent of the NEAR AI Agent Market for a buyer of ours, from the offer to the record. The agent's class is
// derived in coord (lang/emit/near-market.mjs → lang/gen/near-market-sellers.json: its market category back to the hire categories, then
// the class its words hit; a grade path per class); a row with no class never lists. Our buyer pays us first; only then the loop signer's
// NEAR payer (KMS taifoon-vault/near-payer, taifoon-agents ops/loop-signer kind near.ft_transfer) signs ONE x402 exact payment to the
// market treasury, under its caps (1 USDC a payment: the loop signer's per-tx cap), for that paid sale; while the payer account is unfunded the hire waits in `held`. System One grades
// the delivery (the class's grade path: exact by code, else RUBRIC_v2); a reject refunds our buyer. `settled` records the market's
// own settlement (its escrow pays the agent on its venue); the layer moves money once, at `hired`. Each move's hop
// is a commerce hop (commerce.cue), so each move carries that hop's envelope kind on the coord pipe (observe · offer · hire · delivery ·
// grade · settle · record): the runtime (taifoon-agents packages/resale/runtime/near-hire.mjs) measures the facts, walks the compiled
// machine (row genie-near-hire-agents) and sends one envelope per move. Nothing here pays or signs by itself.
genie near_hire v1
about "Hire one NEAR Agent Market agent for a paid buyer of ours: classify, list, pay the market once through the loop signer, deliver, grade by System One, settle on the seller's venue, record"

use venue near-agent-market
use vault vault:taifoon:near-payer
use chain near:mainnet
use product taifoon.api jev.grade
use guard signer-allowlist value-cap day-cap idempotent-payouts receipt-check

agent hire is "one hire of a NEAR Agent Market agent for a buyer of ours, from the offer to the record or a refusal that refunds"
  states offer_in classify listed held hired delivered graded settled legs recorded refused
  start offer_in
  final recorded refused
  failed refused
  read GET /v1/match/offers as offers
  // the offer: a callable agent of the market (a default per_call plan, available now)
  move offer_in -> classify when offer.callable == true hop classify venue near-agent-market
  move offer_in -> refused
  // the class is coord's derivation; an unclassed row, or a class with no grade path, never lists
  move classify -> listed when offer.hireable == true hop listed venue near-agent-market
  move classify -> refused
  // a hire only for a sale our buyer paid; the payer signs only when funded, under its caps, once per sale
  move listed -> hired when sale.paid == true and payer.funded == true guard signer-allowlist value-cap day-cap idempotent-payouts via vault:taifoon:near-payer on near:mainnet cap 1000000 USDC meter taifoon.api hop hired venue near-agent-market effect act
  move listed -> held when sale.paid == true
  move held -> hired when payer.funded == true guard signer-allowlist value-cap day-cap idempotent-payouts via vault:taifoon:near-payer on near:mainnet cap 1000000 USDC meter taifoon.api hop hired venue near-agent-market effect act
  move hired -> delivered when delivery.ok == true hop delivered venue near-agent-market
  move hired -> refused
  move delivered -> graded assure 0.7 meter jev.grade hop graded
  move graded -> settled when grade.verdict == "complete" guard receipt-check hop settled venue near-agent-market effect record
  move graded -> refused
  move settled -> legs hop legs effect record
  move legs -> recorded hop recorded effect record
  refuse not_callable "the agent has no default per_call plan or is not available now"
  refuse unclassed "coord derived no class for the agent, or its class has no grade path"
  refuse unpaid "no buyer of ours paid for this hire: the payer never signs first"
  say offer_in "An agent of the NEAR AI Agent Market was read with its plan price"
  say classify "Coord derived its class from its market category and its own words"
  say listed "It is listed in our book under that class at its plan price plus 20 %"
  say held "Our buyer paid; the hire waits until the NEAR payer account is funded"
  say hired "The loop signer paid the market once for this sale (x402 exact, USDC on NEAR) and the agent took the job"
  say delivered "The agent delivered on the same call"
  say graded "System One graded the delivery on the class's grade path"
  say settled "The seller is paid on its own venue: the market's escrow pays the agent, the market takes its fee"
  say legs "The buyer's payment left as named legs that sum to it"
  say recorded "The sale is recorded; each move's envelope sits on the coord pipe under the superroot"
  say refused "Refused: the reason is named; a paid buyer is refunded"
  next listed hired "A buyer of ours pays first; then the payer signs one payment for that sale"
  next held hired "The owner funds the payer account (owner step near-vault-signer, piece d)"
  next delivered graded "System One grades the delivery; a reject refunds our buyer"

knowledge
  symptom "no buyer demand matches a NEAR agent" caused_by "the agents had no class" fixed_by "coord derives the class from the market category and the agent's words (lang/emit/near-market.mjs)"
  symptom "a NEAR hire stays held after our buyer paid" caused_by "the NEAR payer account is unfunded" fixed_by "fund c0633261…72ff with NEAR and USDC (owner step near-vault-signer)"
  term "near_hire" is "one hire of a NEAR Agent Market agent for a paid buyer of ours, graded by System One, settled on the seller's venue"