{
  "slug": "pricing-models",
  "status": "recorded",
  "recordedAt": "2026-12-04T13:06:33.579Z",
  "synthetic": true,
  "machine": {
    "model": "MacBookPro18,2",
    "cpuCount": 10,
    "cpu": "Apple M1 Max",
    "loadAverage": {
      "one": 20.73,
      "five": 28.67,
      "fifteen": 72.5
    },
    "loadNote": "load average 20.73 on 10 cores when the capture started: more work was waiting than there were cores, so times are slower than on an idle machine"
  },
  "engine": {
    "repository": "hopperlabs-ai-engines/hopper-engines-graph-computer",
    "commit": "bc269bb88e0298b3d7085f05a205013f34ba8a23",
    "workingTreeNote": "working tree clean at capture time",
    "imports": [
      "src/computer.mjs",
      "src/program-surface.mjs",
      "src/program-modules.mjs",
      "src/dependencies.mjs"
    ]
  },
  "via": "member app: the runtime of hopper-domain-apps apps/hopper-graph-computer (createRuntime from src/runtime.ts), with its graph connection set to a port over the engine checkout that also admits the case kernel; author and run-only grants passed as invoke context. The signed HTTP host in front of that runtime was not exercised.",
  "memberApp": {
    "repository": "hopperlabs-ai-domain-apps/hopper-domain-apps",
    "commit": "57b0c64a07526b0a0e0a6348376cb8a88608a58e",
    "path": "apps/hopper-graph-computer/src/runtime.ts",
    "workingTreeNote": "3 uncommitted path(s) in that checkout at capture time",
    "graphPortRelease": "sha256:029ade8451ec289d156ad4a0de44f0cc2c40ebf23f0e742983d78131274e0574",
    "graphPortReleaseNote": "a label made by the capture script: sha256 of \"<engine coordinate>@<engine commit>\"; not a released artifact digest"
  },
  "kernels": [
    {
      "path": "scripts/case-evidence/kernels/pricing.mjs",
      "moduleId": "case-pricing",
      "digest": "sha256:60be3747ee030b6c9b6bde80e96ba040ef2ad6cbf65365327370a918e900e62a",
      "operations": [
        "module.case-pricing.factors-v1",
        "module.case-pricing.factors-v2",
        "module.case-pricing.rate",
        "module.case-pricing.compare"
      ]
    }
  ],
  "programs": [
    {
      "name": "pricing.auto-rating",
      "version": "1.0.0",
      "componentRef": "component:015549478e1dd2a99056292b0d45c2375ee5ad931c4f809a30b0b08ecee46102",
      "visibility": "private",
      "stepCount": 2,
      "estimatedUnits": 3
    },
    {
      "name": "pricing.auto-rating",
      "version": "2.0.0",
      "componentRef": "component:c84d5374f0c4aedc57fe53b4f746e7ea476b9670479e7d01147a6ed1c91f22b4",
      "visibility": "private",
      "stepCount": 2,
      "estimatedUnits": 3
    },
    {
      "name": "pricing.compare",
      "version": "1.0.0",
      "componentRef": "component:b5a7f8b60809682b2e82d55208f094f5d78839389d3e91c993ae233c5024b67c",
      "visibility": "private",
      "stepCount": 1,
      "estimatedUnits": 2
    }
  ],
  "model": {
    "v1": {
      "ageBand": {
        "A1": 1850,
        "A2": 1100,
        "A3": 1000,
        "A4": 950,
        "A5": 1200
      },
      "baseRateCents": 50000,
      "coverage": {
        "C1": 800,
        "C2": 1000,
        "C3": 1350
      },
      "discount": {
        "D0": 1000,
        "D1": 900,
        "D2": 850,
        "D3": 780
      },
      "effective": "2026-01-01",
      "scale": 1000,
      "territory": {
        "T1": 1000,
        "T2": 1150,
        "T3": 1320,
        "T4": 920,
        "T5": 1080
      }
    },
    "v2": {
      "ageBand": {
        "A1": 1850,
        "A2": 1100,
        "A3": 1000,
        "A4": 950,
        "A5": 1200
      },
      "baseRateCents": 50000,
      "coverage": {
        "C1": 800,
        "C2": 1000,
        "C3": 1350
      },
      "discount": {
        "D0": 1000,
        "D1": 900,
        "D2": 850,
        "D3": 780
      },
      "effective": "2026-01-01",
      "scale": 1000,
      "territory": {
        "T1": 1000,
        "T2": 1150,
        "T3": 1410,
        "T4": 920,
        "T5": 1080
      }
    },
    "formula": "premium = base rate x territory x age band x coverage x discount, rounded half up to the cent"
  },
  "input": {
    "rows": 100000,
    "synthetic": true,
    "seed": 77001,
    "generator": "mulberry32 (scripts/case-evidence/lib.mjs seeded()), Box-Muller for normal draws",
    "description": "100,000 made-up quotes, each a rating cell drawn with fixed weights: territory T1-T5, age band A1-A5, coverage C1-C3, discount D0-D3. One further single quote (T3/A2/C2/D1) for the member run."
  },
  "member": {
    "listed": {
      "name": "pricing.auto-rating",
      "version": "1.0.0",
      "sourceVisibility": "redacted",
      "published": true,
      "sourceIncluded": false,
      "estimatedUnits": 3
    },
    "describe": {
      "sourceRedacted": true,
      "stepCount": 2,
      "inputs": {
        "effective": {
          "nodeId": "input",
          "targetPointer": "/effective",
          "type": "string"
        },
        "quotes": {
          "nodeId": "input",
          "targetPointer": "/quotes",
          "type": "object"
        }
      },
      "outputs": {
        "factors": {
          "nodeId": "factors::compute",
          "sourcePointer": "/factors",
          "type": "object"
        },
        "premiumCents": {
          "nodeId": "rate::compute",
          "sourcePointer": "/premiumCents",
          "type": "array"
        },
        "summary": {
          "nodeId": "rate::compute",
          "sourcePointer": "/summary",
          "type": "object"
        }
      },
      "sourceIncluded": false
    },
    "estimate": {
      "componentRef": "component:015549478e1dd2a99056292b0d45c2375ee5ad931c4f809a30b0b08ecee46102",
      "stepCount": 2,
      "waveCount": 2,
      "maxDepth": 1,
      "cachedPureSteps": 0,
      "uncachedSteps": 2,
      "estimatedComputeUnits": 3,
      "maxActionsAllowed": 16,
      "withinBudget": true
    },
    "quote": {
      "label": "One quote by a run-only member",
      "program": "pricing.auto-rating@1.0.0",
      "taskId": "quote-1",
      "status": "succeeded",
      "ms": 35.5,
      "headDigest": "sha256:c89112d04fcb0ea6966ab6bb5248dd572a74cd90117fa0f5299f86cae7cf068f",
      "headDigestShort": "c89112d04fcb",
      "outputDigest": "sha256:c8d117591087d9bbb1c7e10c736089288807dafdc42c43bff883c07397233d33",
      "outputDigestShort": "c8d117591087",
      "grant": "run-only",
      "summary": {
        "premiumCents": 65340,
        "cell": "T3/A2/C2/D1"
      }
    },
    "replay": {
      "reexecuted": true,
      "by": "engine",
      "digestMatched": true,
      "verifiedRetainedHistory": true,
      "originalOutputDigest": "sha256:c8d117591087d9bbb1c7e10c736089288807dafdc42c43bff883c07397233d33",
      "reexecutedOutputDigest": "sha256:c8d117591087d9bbb1c7e10c736089288807dafdc42c43bff883c07397233d33",
      "modules": [
        {
          "moduleId": "case-pricing",
          "digest": "sha256:60be3747ee030b6c9b6bde80e96ba040ef2ad6cbf65365327370a918e900e62a",
          "verified": true
        }
      ],
      "carriedContent": 0,
      "ms": 56.6,
      "askedBy": "run-only member through the member app runtime"
    }
  },
  "runOnly": {
    "refused": [
      {
        "operation": "read (programs.get)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "export",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "diff (programs.diff)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "validate (programs.validate)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "register (programs.register)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "publish (programs.publish)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "save draft (drafts.save)",
        "layer": "member app runtime",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "read (program.get)",
        "layer": "engine program surface, called directly",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "validate (program.propose)",
        "layer": "engine program surface, called directly",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "register (program.register)",
        "layer": "engine program surface, called directly",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      },
      {
        "operation": "diff (program.diff)",
        "layer": "engine program surface, called directly",
        "refused": true,
        "code": "SOURCE_INSPECT_DENIED"
      }
    ]
  },
  "runs": [
    {
      "label": "100,000 quotes under v1",
      "program": "pricing.auto-rating@1.0.0",
      "taskId": "book-v1",
      "status": "succeeded",
      "ms": 2000.1,
      "headDigest": "sha256:948ed63c31c61feb47c2ac039f1b3534bfb150a2ba0e43f4675de41735f9f06e",
      "headDigestShort": "948ed63c31c6",
      "outputDigest": "sha256:bedcec1a667af5e96db53b6df91487765b2b685cc9f8432a40f413219c970f76",
      "outputDigestShort": "bedcec1a667a",
      "grant": "run-only",
      "summary": {
        "quotes": 100000,
        "totalPremiumCents": 5714676280
      }
    },
    {
      "label": "100,000 quotes under v2",
      "program": "pricing.auto-rating@2.0.0",
      "taskId": "book-v2",
      "status": "succeeded",
      "ms": 2156.5,
      "headDigest": "sha256:7fbed2c174d8d64926f8a14a6c31651100f5efe2e98b189ae2de3c2896e1029c",
      "headDigestShort": "7fbed2c174d8",
      "outputDigest": "sha256:40a29ebb09b2c020fdbe3d4d67efac06e552956ee9f58e1222029ce5e0168915",
      "outputDigestShort": "40a29ebb09b2",
      "grant": "run-only",
      "summary": {
        "quotes": 100000,
        "totalPremiumCents": 5786104976
      }
    },
    {
      "label": "Engine comparison of the two premium lists",
      "program": "pricing.compare@1.0.0",
      "taskId": "book-v1-to-v2",
      "status": "succeeded",
      "ms": 1019.6,
      "headDigest": "sha256:0d735f3de4b21b1b3859c9c38e56412749de18f34e84402a7affdbe6386448b0",
      "headDigestShort": "0d735f3de4b2",
      "outputDigest": "sha256:70bc3671c453e6f26796c2647bc84b7cf678b7d62e3defa3bbe7219301747b16",
      "outputDigestShort": "70bc3671c453",
      "grant": "run-only",
      "summary": {
        "moved": 14999,
        "of": 100000,
        "up": 14999,
        "down": 0,
        "totalDifferenceCents": 71428696
      }
    }
  ],
  "replay": {
    "reexecuted": true,
    "by": "engine",
    "digestMatched": true,
    "askedBy": "run-only member through the member app runtime",
    "quote": {
      "program": "pricing.auto-rating@1.0.0",
      "taskId": "quote-1",
      "reexecuted": true,
      "by": "engine",
      "digestMatched": true,
      "verifiedRetainedHistory": true,
      "originalOutputDigest": "sha256:c8d117591087d9bbb1c7e10c736089288807dafdc42c43bff883c07397233d33",
      "reexecutedOutputDigest": "sha256:c8d117591087d9bbb1c7e10c736089288807dafdc42c43bff883c07397233d33",
      "modules": [
        {
          "moduleId": "case-pricing",
          "digest": "sha256:60be3747ee030b6c9b6bde80e96ba040ef2ad6cbf65365327370a918e900e62a",
          "verified": true
        }
      ],
      "carriedContent": 0,
      "ms": 56.6
    },
    "bookV1": {
      "program": "pricing.auto-rating@1.0.0",
      "taskId": "book-v1",
      "reexecuted": true,
      "by": "engine",
      "digestMatched": true,
      "verifiedRetainedHistory": true,
      "originalOutputDigest": "sha256:bedcec1a667af5e96db53b6df91487765b2b685cc9f8432a40f413219c970f76",
      "reexecutedOutputDigest": "sha256:bedcec1a667af5e96db53b6df91487765b2b685cc9f8432a40f413219c970f76",
      "modules": [
        {
          "moduleId": "case-pricing",
          "digest": "sha256:60be3747ee030b6c9b6bde80e96ba040ef2ad6cbf65365327370a918e900e62a",
          "verified": true
        }
      ],
      "carriedContent": 0,
      "ms": 3099.9
    }
  },
  "comparison": {
    "from": "pricing.auto-rating@1.0.0",
    "to": "pricing.auto-rating@2.0.0",
    "engineDiff": {
      "fromRef": "component:015549478e1dd2a99056292b0d45c2375ee5ad931c4f809a30b0b08ecee46102",
      "toRef": "component:c84d5374f0c4aedc57fe53b4f746e7ea476b9670479e7d01147a6ed1c91f22b4",
      "inputChanges": {
        "added": [],
        "removed": [],
        "modified": []
      },
      "outputChanges": {
        "added": [],
        "removed": [],
        "modified": []
      },
      "stepDiff": {
        "added": [],
        "removed": [],
        "modified": [
          "factors"
        ]
      },
      "contractBreaking": false
    },
    "changed": [
      "step changed (engine diff stepDiff.modified): factors",
      "steps added: none; removed: none",
      "inputs and outputs unchanged (contractBreaking: false)",
      "factor territory T3: 1.32 -> 1.41 (read from the two runs' factor outputs)"
    ],
    "affected": {
      "count": 14999,
      "of": 100000,
      "up": 14999,
      "down": 0,
      "totalDifferenceCents": 71428696,
      "largest": {
        "label": "quote 3693 (T3/A1/C3/D0)",
        "before": 164835,
        "after": 176074,
        "difference": 11239,
        "unit": "cents"
      }
    }
  },
  "checks": [
    {
      "name": "v1 published with private source visibility",
      "passed": true,
      "detail": "private"
    },
    {
      "name": "run-only listing hides the source",
      "passed": true,
      "detail": "redacted"
    },
    {
      "name": "run-only describe hides the source",
      "passed": true,
      "detail": "true"
    },
    {
      "name": "run-only quote ran and verified",
      "passed": true,
      "detail": "succeeded"
    },
    {
      "name": "every read/export/diff/validate/register/publish/save-draft attempt refused",
      "passed": true,
      "detail": "SOURCE_INSPECT_DENIED"
    },
    {
      "name": "only territory T3 quotes moved",
      "passed": true,
      "detail": "14999 moved, 14999 in T3 (T3 count by the capture script)"
    },
    {
      "name": "engine replay re-executed the quote and the v1 book to the same output digests",
      "passed": true,
      "detail": "quote c8d117591087 vs c8d117591087, book bedcec1a667a vs bedcec1a667a"
    }
  ],
  "notes": [
    "The rating tables are a small JavaScript kernel that the engine loads only at the fingerprint of its exact bytes; the engine runs and records it but does not prove it correct.",
    "A member with run-only access could list, describe, price and replay the model, and every attempt to read, export, compare or change its source was refused.",
    "Which quotes moved, by how much, and the largest move were worked out by a third engine program; the list of changed factors was worked out by the capture script.",
    "Asked by the run-only member, the engine replayed the single quote and the 100,000-quote book from scratch on its own and got the same result fingerprints.",
    "Times are wall-clock on a shared Mac (load average 20.73 on 10 cores at the start)."
  ],
  "detail": [
    "The kernel is scripts/case-evidence/kernels/pricing.mjs, loaded with the engine's loadProgramModule at the SHA-256 recorded in kernels[]; its steps run as pure steps of programs published through the member app runtime (apps/hopper-graph-computer/src/runtime.ts).",
    "The member app's own graph port admits only fixed libraries, so the capture script connected it to a port of the same shape over an engine that also admits the case kernel. Grants were passed directly as invoke context (author or run-only); no signed request, session or HTTP host was involved, and the app's HTTP 403 at its host was not exercised.",
    "The member app refuses read, export, diff, validate, register, publish and save-draft by name before reaching the engine; the four the engine surface itself guards (get, propose, register, diff) were also called on the engine directly with a run-only grant and refused there.",
    "pricing.compare@1.0.0 takes the two runs' premium lists as inputs. The engine diff names only the changed step; the changed factor comes from comparing the two runs' factor outputs.",
    "replay is the engine's program.replay with reexecute:true, asked through the app by the run-only member: it verifies the retained history, re-reads the kernel module and checks it against its recorded digest, runs the program again in a fresh in-memory engine and compares output digests. headDigest fingerprints one run's retained history (it includes when it ran); outputDigest fingerprints the outputs. Times are milliseconds around each app call, including the app's own input checks and record keeping."
  ]
}
