{
  "project": "Yuzu",
  "version": "1.0.0",
  "evaluatedAt": "2026-09-18T02:42:16.405Z",
  "overallScore": 60,
  "maxPossibleScore": 60,
  "percentage": 100,
  "allRulesMet": true,
  "summary": "Yuzu satisfies all 3 Product Requirements and all 3 Hard Rules with full 10/10 marks. Architecture features clear paid/free separation, multi-agent MCP and REST interfaces, 100 credit Arena ceiling, zero custom payment systems, deny-by-default capability security, and zero-waste ephemeral grant auditing.",
  "criteria": [
    {
      "id": "req-1-paid-service",
      "key": "req_1",
      "category": "product_requirement",
      "title": "Requirement 1: Paid and Free Service Split",
      "requirement": "At least one paid service (split between free and paid clearly documented and enforced).",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "Clear split between paid billable services and free inspection routes, documented in the manifest and enforced through atomic capability grant consumption.",
      "citations": [
        {
          "id": "c-req1-manifest",
          "label": "Service Manifest Pricing and SLAs",
          "file": "app/api/manifest/route.ts",
          "target": "lines 91-230",
          "explanation": "Manifest documents paid services (broker at 12 credits, shortlist at 10 credits, assay at 3 credits) alongside free routes (verify, pubkey, grants, health).",
          "snippet": "price: { amount: 12, currency: 'arena-credits', note: 'For the run.' }"
        },
        {
          "id": "c-req1-settlement",
          "label": "Grant-Based Credit Settlement",
          "file": "lib/market/settlement.ts",
          "target": "sellCredits and chargeContract",
          "explanation": "Paying is minting. Buying credits derives an authorized capability grant from the shelf. Consuming uses decrements the kernel meter.",
          "snippet": "Credits are grant uses. That is the whole billing system."
        },
        {
          "id": "c-req1-test-paid",
          "label": "Paid Invariant Unit Test",
          "file": "test/paid-is-consumed.test.ts",
          "target": "lines 62-90",
          "explanation": "Verifies that kernel usage store matches credits reported paid with zero drift.",
          "snippet": "expect(consumed).toBe(settlement.paid);"
        },
        {
          "id": "c-req1-admission",
          "label": "Billable Routes Guarded",
          "file": "test/billable-routes-guarded.test.ts",
          "target": "lines 32-52",
          "explanation": "Ensures all paid routes enforce rate admission checks before request body parsing.",
          "snippet": "const BILLABLE = ['broker', 'arena', 'assay', 'shortlist', 'sellers', 'mcp'];"
        }
      ],
      "proofs": [
        "POST /api/broker charges 12 credits for discovery, proofing, negotiation, delivery, verification, and receipt signing.",
        "POST /api/shortlist charges 10 credits for multi-vendor comparative assaying and ranked portfolio allocation.",
        "POST /api/assay charges 3 credits for listing verification and claim falsification analysis.",
        "POST /api/verify, GET /api/pubkey, GET /api/manifest, and GET /api/grants are free and non-consuming."
      ],
      "verificationChecks": [
        {
          "name": "Paid services documented with explicit prices",
          "passed": true,
          "detail": "broker (12 credits), shortlist (10 credits), assay (3 credits) defined in manifest."
        },
        {
          "name": "Free verification endpoints require 0 credits",
          "passed": true,
          "detail": "/api/verify, /api/pubkey, /api/manifest, and /api/grants cost 0 credits."
        },
        {
          "name": "Kernel usage store tracks paid usage",
          "passed": true,
          "detail": "SharedOS usageStore atomically matches billed capability invocations."
        }
      ]
    },
    {
      "id": "req-2-agent-accessible",
      "key": "req_2",
      "category": "product_requirement",
      "title": "Requirement 2: Agent Interoperability Surface",
      "requirement": "Directly accessible by other agents (MCP, REST API, CLI with standard JSON schema).",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "Fully accessible across MCP protocol, REST API with JSON and plain-text support, and CLI curl commands with standard JSON schemas.",
      "citations": [
        {
          "id": "c-req2-mcp-route",
          "label": "Model Context Protocol Route",
          "file": "app/api/mcp/route.ts",
          "target": "POST handler and TOOLS catalogue",
          "explanation": "Full JSON-RPC 2.0 MCP server exposing 6 tools: yuzu_broker, yuzu_assay, yuzu_verify_receipt, yuzu_grant_map, yuzu_sellers, yuzu_shortlist.",
          "snippet": "case 'tools/list': return ok(id, { tools: TOOLS });"
        },
        {
          "id": "c-req2-rest-api",
          "label": "REST Endpoints",
          "file": "app/api/broker/route.ts",
          "target": "POST handler",
          "explanation": "REST API accepts JSON and plain text. Reusable by any external autonomous agent.",
          "snippet": "Accepts JSON body of {goal, budget, capability} or plain-text sentence."
        },
        {
          "id": "c-req2-cli-schema",
          "label": "CLI Command Documentation and Schemas",
          "file": "app/api/manifest/route.ts",
          "target": "lines 231-247 (howToCall)",
          "explanation": "Complete curl commands with standard JSON schemas for every endpoint, plus standalone offline CLI script at /api/pubkey.",
          "snippet": "curl -X POST /api/broker -H 'content-type: application/json' -d '{\"goal\":\"...\",\"budget\":20}'"
        },
        {
          "id": "c-req2-test-mcp",
          "label": "MCP Test Suite",
          "file": "test/mcp-all-tools.test.ts",
          "target": "lines 15-80",
          "explanation": "Comprehensive test validating tools/call for all 6 tools through the MCP route.",
          "snippet": "expect(sellersBody.result.isError).toBe(false);"
        }
      ],
      "proofs": [
        "MCP server implements JSON-RPC 2.0 tools/list, tools/call, and initialize protocols.",
        "REST API endpoints return uniform JSON responses with standard error codes.",
        "CLI-ready curl snippets documented in manifest for instant shell or script execution.",
        "Offline verification script runnable directly in Node without network dependencies."
      ],
      "verificationChecks": [
        {
          "name": "MCP server tools published",
          "passed": true,
          "detail": "6 tools published with strict inputSchema definitions."
        },
        {
          "name": "REST endpoints accessible",
          "passed": true,
          "detail": "Endpoints respond to standard HTTP methods with structured JSON."
        },
        {
          "name": "CLI snippets provided",
          "passed": true,
          "detail": "Executable curl commands documented in manifest for agent automation."
        }
      ]
    },
    {
      "id": "req-3-top-earner-arena",
      "key": "req_3",
      "category": "product_requirement",
      "title": "Requirement 3: Arena Tournament Readiness",
      "requirement": "Top Earner and Arena ready (100 credits budget ceiling, >=3 vendor diversification, portable Ed25519 receipts).",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "Strict 100-credit budget ceiling enforced at write time, automated diversification across >=3 non-house vendors, and portable Ed25519 signed receipts.",
      "citations": [
        {
          "id": "c-req3-budget-ceiling",
          "label": "100 Credits Hard Budget Limit",
          "file": "lib/arena/ledger.ts",
          "target": "ARENA_BUDGET, recordPurchase",
          "explanation": "Hardcoded ceiling of 100 credits. Any purchase exceeding 100 is rejected at write time.",
          "snippet": "export const ARENA_BUDGET = 100; if (spent + purchase.credits > ARENA_BUDGET) return error;"
        },
        {
          "id": "c-req3-diversification",
          "label": "Vendor Diversification Floor",
          "file": "lib/arena/ledger.ts",
          "target": "MIN_SELLERS = 3, SPREAD = 4",
          "explanation": "Requires spending across at least 3 distinct third-party sellers. House sellers are excluded to prevent self-dealing.",
          "snippet": "export const MIN_SELLERS = 3; const SPREAD = 4; const WEIGHTS = [0.4, 0.3, 0.2, 0.1];"
        },
        {
          "id": "c-req3-ed25519-receipts",
          "label": "Portable Ed25519 Cryptographic Receipts",
          "file": "lib/assay/receipt.ts",
          "target": "sign, verify, publicKeyDocument",
          "explanation": "Asymmetric Ed25519 signatures over canonical JSON. Verifiable offline without contacting Yuzu.",
          "snippet": "signature: { alg: 'ed25519', value: signatureBase64, publicKeyId }"
        },
        {
          "id": "c-req3-test-selfdealing",
          "label": "Anti-Self-Dealing Test",
          "file": "test/arena-selfdealing.test.ts",
          "target": "lines 1-60",
          "explanation": "Validates that house sellers are barred from Arena rankings and credit allocation.",
          "snippet": "House sellers are excluded from every allocation."
        }
      ],
      "proofs": [
        "100 credit ceiling prevents overspend at transaction creation time.",
        "Round 2 portfolio allocation spreads budget across >=3 distinct vendors.",
        "House sellers marked with house marker and ignored during arena purchases.",
        "Receipts verify independently via /api/pubkey or offline CLI verifier."
      ],
      "verificationChecks": [
        {
          "name": "Arena budget ceiling fixed at 100 credits",
          "passed": true,
          "detail": "Current budget is 100, spent is 0, remaining is 100."
        },
        {
          "name": "Vendor diversification rule configured",
          "passed": true,
          "detail": "Minimum seller threshold is 3 with spread factor 4."
        },
        {
          "name": "Ed25519 signature algorithm active",
          "passed": true,
          "detail": "Public key ID is 0d926c27c2dbb95f with SPKI encoding."
        }
      ]
    },
    {
      "id": "rule-1-zero-payment-system",
      "key": "rule_1",
      "category": "hard_rule",
      "title": "Hard Rule 1: Zero Payment System Built",
      "requirement": "Zero payment system built (Arena credits used strictly as grant authorizations).",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "No payment gateway, billing ledger, or synthetic balance table built. Arena credits operate exclusively as SharedOS capability grant authorizations.",
      "citations": [
        {
          "id": "c-rule1-settlement-philosophy",
          "label": "Zero Billing Code Invariant",
          "file": "lib/market/settlement.ts",
          "target": "lines 7-32",
          "explanation": "There is no payment primitive, invoice table, or wallet code. Credits are derived as maxUses on capability grants.",
          "snippet": "Credits are grant uses. That is the whole billing system."
        },
        {
          "id": "c-rule1-grant-derivation",
          "label": "Deriving Capability Grants from Shelf",
          "file": "lib/market/settlement.ts",
          "target": "sellCredits function",
          "explanation": "Buying N credits derives an N-use grant from parent shelf grant. Consuming a use is handled by kernel authorizer.",
          "snippet": "const derived = deriveGrant(parent, { maxUses: input.credits });"
        },
        {
          "id": "c-rule1-grant-exhaustion",
          "label": "Native Kernel Grant Exhaustion",
          "file": "lib/market/broker.ts",
          "target": "chargeContract and closeContract",
          "explanation": "When credits are spent, kernel authorizer throws grant_exhausted. Balance is read from usageStore rather than internal table.",
          "snippet": "The balance is a question asked of the usage store."
        },
        {
          "id": "c-rule1-submission-doc",
          "label": "Submission Architecture Statement",
          "file": "SUBMISSION.md",
          "target": "lines 35-41",
          "explanation": "Yuzu has no billing code on the path where money moves. Payment is the permission model.",
          "snippet": "The payment is the permission model."
        }
      ],
      "proofs": [
        "Zero database tables for wallets, fiat, or cryptocurrency balances.",
        "Credits map 1:1 to SharedOS CapabilityGrant maxUses.",
        "Overspending is blocked by the SharedOS kernel authorizer with grant_exhausted.",
        "Balance checks query the SharedOS usage store directly."
      ],
      "verificationChecks": [
        {
          "name": "No custom currency or balance database",
          "passed": true,
          "detail": "Zero billing tables or external payment SDKs in the codebase."
        },
        {
          "name": "Credits mapped to SharedOS grant maxUses",
          "passed": true,
          "detail": "Grant derivations enforce invocation limits atomically via compare and set."
        },
        {
          "name": "Meter enforced by kernel authorizer",
          "passed": true,
          "detail": "Refusals for overspend originate from kernel authorizer."
        }
      ]
    },
    {
      "id": "rule-2-deny-by-default",
      "key": "rule_2",
      "category": "hard_rule",
      "title": "Hard Rule 2: Deny-by-Default and Zero Ambient Authority",
      "requirement": "Deny-by-default and zero ambient authority.",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "All requests fail closed without active grants. Tool execution requires explicit context, narrow scopes, and ADR 0022 precedents.",
      "citations": [
        {
          "id": "c-rule2-host-authorizer",
          "label": "Kernel Deny-by-Default Authorizer",
          "file": "lib/sharedos/host.ts",
          "target": "withTurn and callTool",
          "explanation": "Ungranted capabilities fail closed. Every tool call must cite a valid context, purpose, and capability grant.",
          "snippet": "Calls without matching authority return outcome: 'denied'."
        },
        {
          "id": "c-rule2-adverse-precedent",
          "label": "ADR 0022 Precedent Hardening",
          "file": "lib/sharedos/precedent.ts",
          "target": "decideFromPrecedent",
          "explanation": "Precedent allows may only narrow, never expand. Unseeded questions fail closed with no_precedent_cited.",
          "snippet": "An allow may only ever narrow, envelope is the tightest across every precedent cited."
        },
        {
          "id": "c-rule2-host-ceiling",
          "label": "Host-Level Ceiling Rules",
          "file": "lib/api.ts",
          "target": "TOUCHSTONE_FROZEN_VENDORS",
          "explanation": "Host ceilings refuse denied actors before grants are evaluated. No grant can buy past a ceiling.",
          "snippet": "A ceiling can only ever refuse, no permission buys past it."
        },
        {
          "id": "c-rule2-identity-scoping",
          "label": "Explicit Identity and Purpose Scopes",
          "file": "lib/sharedos/identity.ts",
          "target": "PURPOSES constants",
          "explanation": "Capabilities are strictly partitioned into isolated purposes: broker, contract, deliver, prove, assay, probe.",
          "snippet": "Namespace 'arena', resource plane 'assay'."
        }
      ],
      "proofs": [
        "Unauthenticated or ungranted capabilities default to refusal.",
        "Zero ambient authority: ambient process credentials grant no resource access.",
        "ADR 0022 auto-decisions only narrow, uncited questions fail closed.",
        "Host-level freeze ceiling overrides all permissions."
      ],
      "verificationChecks": [
        {
          "name": "Default deny on ungranted resources",
          "passed": true,
          "detail": "Kernel rejects ungranted calls with decision: 'refuse'."
        },
        {
          "name": "No ambient authorization tokens",
          "passed": true,
          "detail": "Every tool invocation requires explicit AccessContext parameter."
        },
        {
          "name": "Precedents restricted to narrowing permissions",
          "passed": true,
          "detail": "ADR 0022 constraints enforce strictest envelope across cited precedents."
        }
      ]
    },
    {
      "id": "rule-3-zero-credit-waste",
      "key": "rule_3",
      "category": "hard_rule",
      "title": "Hard Rule 3: Zero Credit Waste Before Arena",
      "requirement": "Zero credit waste before Arena (mock and ephemeral grants for staging/auditing).",
      "score": 10,
      "maxScore": 10,
      "status": "PASS",
      "verdict": "Testing and staging run on ephemeral in-memory mock grants and simulated probes, consuming zero real credits or paid provider quotas.",
      "citations": [
        {
          "id": "c-rule3-mock-testing",
          "label": "In-Memory Test Isolation",
          "file": "test/paid-is-consumed.test.ts",
          "target": "lines 25-52",
          "explanation": "Tests mock model completions and use isolated in-memory stores. Zero external API calls or credits burned during test execution.",
          "snippet": "vi.mock('../lib/assay/llm', async (importOriginal) => ...)"
        },
        {
          "id": "c-rule3-ephemeral-grants",
          "label": "Ephemeral Grant Withdrawal",
          "file": "lib/market/settlement.ts",
          "target": "closeContract and withdrawGrant",
          "explanation": "Grants created for contracts are short-lived and immediately withdrawn when order closes.",
          "snippet": "withdrawGrant(contract.grantId);"
        },
        {
          "id": "c-rule3-admission-gate",
          "label": "Admission Rate Guarding",
          "file": "lib/api.ts",
          "target": "admit and rateLimited",
          "explanation": "Admission control rejects unadmitted requests before body parsing, preventing wallet-draining loops.",
          "snippet": "const admission = admit(request); if (!admission.ok) return rateLimited(admission);"
        },
        {
          "id": "c-rule3-offline-verifier",
          "label": "Offline Zero-Cost Verification",
          "file": "app/api/pubkey/route.ts",
          "target": "GET handler",
          "explanation": "Verification of receipts can be executed locally offline without spending compute or invoking services.",
          "snippet": "A script you can run offline to check a receipt without asking us anything."
        }
      ],
      "proofs": [
        "Vitest test suite runs completely offline with mocked models and zero network cost.",
        "Contract grants are ephemeral and withdrawn upon deal resolution.",
        "Admission limiter defends against bot denial-of-wallet attacks.",
        "Audit and staging workflows use dry-run synthetic probes."
      ],
      "verificationChecks": [
        {
          "name": "Test suite runs with in-memory mock isolation",
          "passed": true,
          "detail": "32 test files execute with zero Arena credit consumption."
        },
        {
          "name": "Ephemeral grants cleaned up upon deal close",
          "passed": true,
          "detail": "withdrawGrant executes at contract conclusion."
        },
        {
          "name": "Rate limiter prevents credit draining",
          "passed": true,
          "detail": "Token buckets guard all public billable endpoints."
        }
      ]
    }
  ],
  "systemInfo": {
    "nodeRuntime": "v24.19.0",
    "representativeAgentNodeId": "f0cf3a2d-f961-4d9e-81bc-a19bab2ad61b",
    "sharedosKernelVersion": "@aicoo/sharedos 0.1.0-alpha.5",
    "ed25519PublicKeyPublished": true,
    "mcpToolsPublishedCount": 6,
    "registeredSellersCount": 9,
    "arenaBudgetCap": 100,
    "currentArenaSpend": 0
  }
}