{
  "schemaVersion": "vf.agent.service.v1",
  "name": "Preflight QA Gate v1",
  "version": "0.7.0-test",
  "lifecycle": "public-testnet-pilot",
  "description": "A paid agent endpoint that performs deterministic structural, hygiene, and evidence-traceability checks on inline deliverables.",
  "capabilities": [
    {
      "id": "qa.structured-deliverable.v1",
      "method": "deterministic-ruleset",
      "specification": {
        "id": "structured-deliverable-pilot",
        "version": "1.0.0",
        "rulesetVersion": "vf-dqa-1.0.0",
        "engine": "vf-deterministic-qa",
        "scoring": {
          "requiredSections": 20,
          "wordLimit": 10,
          "placeholders": 15,
          "forbiddenTerms": 10,
          "sourceMinimum": 15,
          "claimCitations": 20,
          "claimTraceability": 10
        }
      },
      "result": "scored QA report with check-level evidence and remediation",
      "limitations": [
        "Does not independently establish the truth of arbitrary prose.",
        "Does not fetch submitted evidence URLs in this pilot."
      ]
    }
  ],
  "endpoints": {
    "health": "/api/health",
    "openapi": "/openapi.json",
    "terms": "/api/quote",
    "quote": { "path": "/api/quote", "method": "POST" },
    "evaluate": { "path": "/api/verify", "method": "POST", "payment": "x402" },
    "preflightGuide": { "path": "/api/v1/preflight", "method": "GET", "payment": "none" },
    "preflight": {
      "path": "/api/v1/preflight",
      "method": "POST",
      "payment": "x402",
      "discovery": "bazaar-declared"
    },
    "reconcile": { "path": "/api/reconcile", "method": "POST" },
    "recoveryChallenge": {
      "path": "/api/recovery/challenge",
      "method": "POST",
      "proof": "wallet-personal-sign"
    },
    "recover": { "path": "/api/recover", "method": "POST" },
    "report": { "path": "/api/reports/{jobId}", "access": "bearer-token" },
    "readiness": "/api/readiness",
    "pilotProof": "/api/pilot-proof",
    "bazaarStatus": "/api/bazaar-status"
  },
  "workflow": [
    "POST the job to /api/quote with an Idempotency-Key and buyer address.",
    "Retry the unchanged job at /api/verify with the returned quoteId.",
    "Complete the x402 v2 exact payment challenge.",
    "Receive the report and PAYMENT-RESPONSE settlement receipt.",
    "Store the returned reportAccess token and send it as an Authorization bearer token for later reads or replay.",
    "If the paid response is lost, use the recovery challenge and a fresh paying-wallet signature; the server can discover the recent settlement onchain.",
    "For direct agent calls, POST {job} to /api/v1/preflight and follow its immediate 402 challenge."
  ],
  "payment": {
    "protocol": "x402-v2",
    "scheme": "exact",
    "network": "eip155:84532",
    "chainId": 84532,
    "asset": "USDC",
    "assetContract": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "amount": "$0.52",
    "amountAtomic": "520000",
    "payTo": "0x7038082eD5aFfb8cD81D4A88C99F777d9293E871",
    "payerPolicy": "any Base Sepolia address that matches the quoted buyer"
  },
  "requestContract": {
    "contentType": "application/json",
    "schemaVersion": "vf.qa.job.v1",
    "idempotencyHeader": "Idempotency-Key",
    "maxBytes": 131072,
    "inlineMediaTypes": ["text/plain", "text/markdown", "application/json"],
    "fields": {
      "task": ["title", "objective", "requiredSections", "forbiddenTerms", "maxWords", "minSources"],
      "deliverable": ["mediaType", "content", "sources", "claims"]
    }
  },
  "responseContract": {
    "schemaVersion": "vf.qa.result.v1",
    "status": "completed",
    "verdicts": ["pass", "needs_revision", "fail"],
    "scoreRange": [0, 100],
    "includes": [
      "jobId",
      "quoteId",
      "requestHash",
      "resultCoreHash",
      "checks",
      "payment",
      "reportAccess"
    ]
  },
  "safety": {
    "mainnetEnabled": false,
    "privateKeyRequired": false,
    "reportReleasedAfterSettlement": true,
    "durableIdempotency": true,
    "paymentTermsBoundToRequestHash": true,
    "receiptReconciliation": true,
    "serverAssistedReceiptDiscovery": true,
    "reportEntitlement": "rotatable bearer token",
    "recoveryProof": "fresh paying-wallet signature",
    "recoveryProofFormat": "EIP-4361 bound to the canonical service URI",
    "recoveryMinConfirmations": 2,
    "externalEvidenceFetching": false
  },
  "discovery": {
    "protocol": "x402-bazaar-v2",
    "metadataDeclared": true,
    "cdpSettlementConfirmed": true,
    "settlementTransaction": "0x3a5dac9bbb688252d46737a032faf35f1e0db0aa52224e507ff043b9d9dc7d8a",
    "indexed": "verify-live-at-/api/bazaar-status",
    "metadataQuality": {
      "serviceName": true,
      "tags": true,
      "icon": true,
      "describedInputSchema": true,
      "realisticInputExample": true,
      "describedOutputSchema": true,
      "realisticOutputExample": true
    },
    "nextGate": "Confirm catalog propagation through the public CDP Bazaar merchant lookup."
  },
  "evidence": {
    "testnetPilot": "/api/pilot-proof",
    "exactSettlement": true,
    "amount": "$0.52 Base Sepolia test USDC",
    "score": 100,
    "verdict": "pass",
    "realMoney": false
  },
  "commercial": {
    "offer": "Preflight QA Gate v1",
    "unit": "one deterministic evaluation of one inline structured deliverable",
    "activePrice": "$0.52 Base Sepolia test USDC",
    "activePriceHasRealValue": false,
    "mainnetPriceStatus": "candidate-not-owner-approved",
    "mainnetReceivingWalletStatus": "candidate-not-owner-approved",
    "refunds": "A fail verdict is a completed evaluation, not a failed service delivery."
  }
}
