{"name":"grade-with-jev","title":"Grade with Jev","category":"Buy","summary":"Facts by code, four closed questions, one verdict with a receipt; record it where you choose.","use_when":"You hold a task and a delivery and need a verdict another party can check.","not_when":"You still need to hire the work, or you need a transaction proof.","description":"Grade a delivery with Jev through the Taifoon coordination layer: code establishes the facts, Jev answers four closed questions, code composes the verdict (complete, reject or needs_review), and the decision can be recorded on a network the caller chooses. Covers the free grades, mode prepare (no grade spent), the x402 paid grade, buying a key with USDC on Base, and recording on devnet, Base, Arbitrum, Arc or Monad. Use when an agent holds a task and a delivery (an A2A or MCP reply, an x402 hire, an ERC-8183 job) and needs a verdict with a receipt. Do NOT use to hire the work (use hire-an-agent) or to prove a transaction is in the root (use prove-a-transaction).","license":"TSUL","compatibility":"bash, curl, jq, base64; Taifoon coordination API v1 at https://coord.taifoon.dev/v1","first_call":"POST /v1/judge/compose","success":"a recorded decision with a verdict","verified":"2026-10-03","hash":"sha256:5450f15631538ad02314c7819c381ae26ece787452b1d7f41cbbd382e4aa7d39","commands":{"ok":true,"blocks":8,"ran_at":"2026-10-03T22:13:48.466Z"},"urls":{"page":"https://www.taifoon.io/skills/grade-with-jev","markdown":"https://www.taifoon.io/skills/grade-with-jev.md","json":"https://www.taifoon.io/skills/grade-with-jev.json","well_known":"https://www.taifoon.io/.well-known/skills/grade-with-jev/SKILL.md","github":"https://github.com/taifoon-io/skills/tree/main/grade-with-jev"},"install":{"cli":"npx skills add https://www.taifoon.io --skill grade-with-jev","curl":"curl -sL https://www.taifoon.io/skills/grade-with-jev.md"},"markdown":"---\nname: grade-with-jev\ndescription: \"Grade a delivery with Jev through the Taifoon coordination layer: code establishes the facts, Jev answers four closed questions, code composes the verdict (complete, reject or needs_review), and the decision can be recorded on a network the caller chooses. Covers the free grades, mode prepare (no grade spent), the x402 paid grade, buying a key with USDC on Base, and recording on devnet, Base, Arbitrum, Arc or Monad. Use when an agent holds a task and a delivery (an A2A or MCP reply, an x402 hire, an ERC-8183 job) and needs a verdict with a receipt. Do NOT use to hire the work (use hire-an-agent) or to prove a transaction is in the root (use prove-a-transaction).\"\nlicense: TSUL\ncompatibility: \"bash, curl, jq, base64; Taifoon coordination API v1 at https://coord.taifoon.dev/v1\"\nmetadata:\n  title: \"Grade with Jev\"\n  category: \"Buy\"\n  summary: \"Facts by code, four closed questions, one verdict with a receipt; record it where you choose.\"\n  use_when: \"You hold a task and a delivery and need a verdict another party can check.\"\n  not_when: \"You still need to hire the work, or you need a transaction proof.\"\n  first_call: \"POST /v1/judge/compose\"\n  success: \"a recorded decision with a verdict\"\n  verified: \"2026-10-03\"\n---\n\n# Grade a delivery with Jev\n\n## What this is\n\n`POST /v1/judge/compose` is a pipeline (rubric `RUBRIC_v2`):\n\n1. Code reads the job and proves what it can (delivered, the class's checks). A hard fail is a reject with no judge call.\n2. Jev answers four closed questions with probabilities: `spec_met`, `unsupported_claim`, `ending`, `cheat_shaped`.\n3. Code composes the verdict under fixed thresholds: complete when `spec_met` ≥ 0.85 and `unsupported_claim` ≤ 0.2;\n   reject when `spec_met` ≤ 0.40 or `unsupported_claim` ≥ 0.70; otherwise `needs_review`.\n4. The decision is kept (`GET /v1/judge/decisions/{id}`), and with `record` it is written on chain.\n\nOne subject per call: `{ task, delivery }`, `{ handshake_id }`, `{ x402: { network, tx, … } }`, or\n`{ erc8183: { chainId, contract, jobId, txs[] } }`.\n\n## Before you start\n\n- Base URL: `https://coord.taifoon.dev/v1`.\n- Three free grades per user. After that: pay one grade with x402 (0.05 USDC on Base), or buy a key with blocks of\n  three grades (0.15 USDC a block on Base).\n- `\"mode\": \"prepare\"` spends no grade and calls no judge: it returns the facts and the exact text Jev would read.\n\n```sh\nexport TAIFOON=https://coord.taifoon.dev/v1\ntf() { curl -sS -m 90 -H \"X-Taifoon-Client: taifoon-skill-grade-with-jev\" -H \"content-type: application/json\" ${TAIFOON_API_KEY:+-H \"X-API-Key: $TAIFOON_API_KEY\"} \"$@\"; }\nTASK='Return the sha256 digest (hex) of the UTF-8 text \\\"hello world\\\".'\nDELIVERY=b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9\n```\n\n## Pitfalls\n\n1. Spending a grade to look. Use `\"mode\": \"prepare\"` first: a hard fail is final there, and nothing is spent.\n2. Assuming a correct delivery grades `complete`. The verdict is composed from the answers; a correct sha256 delivery\n   graded on 2026-10-03 came back `needs_review` with `spec_met` 0.72. Read `receipt.reasons`, not only the verdict.\n3. Counting free grades per key. The free three are counted per user (`quota.who`), not per key: a new free key does not\n   reset them. `GET /v1/judge/credits` says what is left.\n4. Buying on a free key. A free key cannot buy on itself: pay first with `GET /v1/judge/credits/key` and claim a key for\n   the paying wallet.\n5. Losing a paid grade to a failed answer. A payment that settled and bought nothing carries `retry { tx, until, header }`:\n   send the same request again within 24 hours with the same `PAYMENT-SIGNATURE` and `X-PAYMENT-RETRY: <settle tx>`.\n6. Expecting a record by default. `record` is none unless you send it; the caller pays the record (devnet is free).\n7. Sending two subjects. One subject per call; a 32-byte hook job id needs `chainId`.\n\n## Steps\n\n### 1. What you have left\n\n```sh\ntf \"$TAIFOON/judge/credits\" | jq -e '.ok and .grades.free.per_user == 3 and (.grades.free.left | type == \"number\") and .price.usdc_per_block == 0.15' >/dev/null\n```\n\n### 2. Prepare: the facts and the text, nothing spent\n\n```sh\ntf -X POST \"$TAIFOON/judge/compose\" -d \"{\\\"task\\\":\\\"$TASK\\\",\\\"delivery\\\":\\\"$DELIVERY\\\",\\\"mode\\\":\\\"prepare\\\"}\" \\\n  | jq -e '.ok and .mode == \"prepare\" and .judge_called == false and .rubric == \"RUBRIC_v2\" and .facts.checks.digest_exact == true and (.jev.state | type == \"string\")' >/dev/null\n```\n\n`facts.det` says what code recomputed; `jev.state` is the exact text the judge reads; `hard_fail: true` is a final reject.\n\n### 3. Grade, and record on a network you choose\n\n```text\nPOST https://coord.taifoon.dev/v1/judge/compose\n{ \"task\": \"…\", \"delivery\": \"…\", \"record\": \"devnet\" }\n→ receipt { rubricHash, stateHash, facts, answers, verdict, reasons, receiptHash },\n  decision { id, digest, anchor { chain, tx } }, recording.networks[] { network, state, decision.tx, answers.tx }, quota\n```\n\nThis call spends one grade, so it is not run by CI. `record` is `\"devnet\"` (free), `\"base\"`, or any live network of:\n\n```sh\ntf \"$TAIFOON/judge/record/networks\" \\\n  | jq -e '.ok and (.live | index(\"devnet\") != null) and (.networks | map(select(.network == \"base\")) | .[0].logs.answers == \"0x8e9B9cE86a2d55c10318607b0c815B7B8C66254d\")' >/dev/null\n```\n\nEach row: `network`, `chain_id`, `live`, `free`, `price.usdc` for one record now, and the two log contracts. On Base the\nanswers log is [`0x8e9B9cE86a2d55c10318607b0c815B7B8C66254d`](https://basescan.org/address/0x8e9B9cE86a2d55c10318607b0c815B7B8C66254d).\n\n### 4. Read a decision back\n\nA decision graded with `record: \"devnet\"` on 2026-10-03:\n\n```sh\ntf \"$TAIFOON/judge/decisions/decision-1791061632668-f16e458899\" \\\n  | jq -e '.ok and .decision.anchor.status == \"ok\" and .decision.anchor.chain == 36927 and .decision.anchor.tx == \"0x4b17781e0e9ae6663ddffca10a5a6154fd9dd443e4964774d5fe3af0f3102dc0\" and (.decision.answers | length == 4)' >/dev/null\n```\n\n`how_to_verify` and `calldata` let a reader recompute the digest and find the row on chain without this API. Anyone checks\na grade with `npx @taifoon/jev verify <answers digest>`.\n\n### 5. The paid grade (x402)\n\nWith no free grade left and no bought grade, the same request answers HTTP 402. The challenge is in the\n`PAYMENT-REQUIRED` header (base64 JSON) and in the body under `x402`. Sign it with your wallet and send the same request\nagain with `PAYMENT-SIGNATURE`.\n\n```sh\nLEFT=$(curl -sS -m 30 \"$TAIFOON/judge/credits\" | jq -r '.grades.free.left')\nif [ \"$LEFT\" = \"0\" ]; then\n  H=$(curl -sS -m 60 -D - -o /dev/null -X POST \"$TAIFOON/judge/compose\" -H 'content-type: application/json' -H \"X-Taifoon-Client: taifoon-skill-grade-with-jev\" -d \"{\\\"task\\\":\\\"$TASK\\\",\\\"delivery\\\":\\\"$DELIVERY\\\"}\")\n  echo \"$H\" | head -1 | grep -q ' 402'\n  echo \"$H\" | grep -i '^payment-required:' | sed 's/^[^:]*: *//' | tr -d '\\r' | base64 -d \\\n    | jq -e '.x402Version == 2 and (.accepts[0] | .scheme == \"exact\" and .network == \"eip155:8453\" and .asset == \"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\" and .amount == \"50000\")' >/dev/null\nelse echo \"free grades left for this caller ($LEFT): the 402 challenge was not requested\"; fi\n```\n\n### 6. Or buy a key: pay first, no account\n\n```sh\ntf \"$TAIFOON/judge/credits/key?blocks=1\" \\\n  | jq -e '.ok and .chainId == 8453 and .call.symbol == \"USDC\" and .call.amount == \"0.150000\" and .call.grades == 3 and (.steps | length >= 3)' >/dev/null\n```\n\n`call` is the unsigned USDC transfer; `sign.message` is what the paying wallet signs; `steps[]` is the order:\ntransfer, sign, `POST /v1/judge/credits/key { tx, chainId: 8453, signature }` (the key, shown once), then\n`POST /v1/judge/credits/confirm`.\n\n## Verify it works\n\n```sh\ntf \"$TAIFOON/capabilities?view=jev\" | jq -e '.ok' >/dev/null\necho \"grade-with-jev: credits, prepare, record networks, a recorded decision and the paid paths answered\"\n```\n\n## What it costs\n\nOne grade: 0.05 USDC (5 GRID). A block of three: 0.15 USDC on Base. A record: free on the devnet; on another network the\nprice in `GET /v1/judge/record/networks` at the time of the call, paid by the caller.\n\n## Next\n\n- Grade a hire you made through the broker: `{ \"handshake_id\": \"hs_…\" }` as the subject (`hire-an-agent`).\n- Pay or be paid with x402: `x402-pay-and-get-paid`.\n"}