{
  "slug": "commissions",
  "status": "recorded",
  "recordedAt": "2026-12-04T13:04:51.479Z",
  "synthetic": true,
  "machine": {
    "model": "MacBookPro18,2",
    "cpuCount": 10,
    "cpu": "Apple M1 Max",
    "loadAverage": {
      "one": 26.47,
      "five": 32.79,
      "fifteen": 79.28
    },
    "loadNote": "load average 26.47 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": "5bf4d08bbf04210afa23a00271efd361310e835c",
    "workingTreeNote": "6 uncommitted path(s) in the checkout at capture time (not imported by this script unless listed in imports): M experiments/hopper-dag/bench/temporal/hopper-server.mjs; M experiments/hopper-dag/src/orchestration/durable/activities.mjs; M experiments/hopper-dag/src/orchestration/durable/operations.mjs; M experiments/hopper-dag/src/orchestration/durable/visibility.mjs; M experiments/hopper-dag/test/durable-engine.test.mjs; M experiments/hopper-dag/test/durable-leases.test.mjs",
    "imports": [
      "src/computer.mjs",
      "src/program-surface.mjs",
      "src/program-modules.mjs",
      "src/dependencies.mjs"
    ]
  },
  "via": "engine directly (ProgramSurface from src/program-surface.mjs, author grant to register and diff)",
  "kernels": [
    {
      "path": "scripts/case-evidence/kernels/commissions.mjs",
      "moduleId": "case-commissions",
      "digest": "sha256:bc444d300c1b37ba01980f347f74113d748ae43ee61c1cd375c0a24957004cc9",
      "operations": [
        "module.case-commissions.plan-v1",
        "module.case-commissions.plan-v2",
        "module.case-commissions.pay",
        "module.case-commissions.compare"
      ]
    }
  ],
  "programs": [
    {
      "name": "commission.quarter",
      "version": "1.0.0",
      "componentRef": "component:e620d162755e00462b42c1d378ae3a5b7e6c267bd02306ddbe98997fdfdd8ca2",
      "visibility": "registered in a local engine scope; not published"
    },
    {
      "name": "commission.quarter",
      "version": "2.0.0",
      "componentRef": "component:4a963341ab34306f215abb33c7b7994b5ad860ef547e0a9298b4458c4a65454f",
      "visibility": "registered in a local engine scope; not published"
    },
    {
      "name": "commission.compare",
      "version": "1.0.0",
      "componentRef": "component:fc58edc979283d642f51005709eb9194df953b54254da06d07c489b5c0b6edab",
      "visibility": "registered in a local engine scope; not published"
    }
  ],
  "input": {
    "rows": 20000,
    "reps": 500,
    "period": "2026-Q3",
    "synthetic": true,
    "seed": 20260930,
    "generator": "mulberry32 (scripts/case-evidence/lib.mjs seeded()), Box-Muller for normal draws",
    "description": "20,000 made-up deals spread uniformly over 500 made-up reps; deal size log-normal around $6,000 scaled by a per-rep skill factor; minimum deal $500"
  },
  "plan": {
    "v1": {
      "acceleratorRateBp": 1200,
      "appliesTo": "bookings above quota",
      "baseRateBp": 800,
      "period": "2026-Q3",
      "quotaCents": 25000000
    },
    "v2": {
      "acceleratorRateBp": 1000,
      "appliesTo": "bookings above quota",
      "baseRateBp": 800,
      "period": "2026-Q3",
      "quotaCents": 25000000
    }
  },
  "runs": [
    {
      "label": "Quarter under plan v1",
      "program": "commission.quarter@1.0.0",
      "taskId": "q3-plan-v1",
      "status": "succeeded",
      "ms": 210.4,
      "headDigest": "sha256:61b4d192887fe3f24782593e2ef75b0f5b473e8ead4c9fce391144cc4d9e2afb",
      "headDigestShort": "61b4d192887f",
      "outputDigest": "sha256:2e86702d58638d55245d07e04acc469b0106f58ee7e6929483bc63fecb69604f",
      "outputDigestShort": "2e86702d5863",
      "summary": {
        "bookedCents": 15422759131,
        "commissionCents": 1395828736,
        "deals": 20000,
        "reps": 500,
        "repsAboveQuota": 310
      }
    },
    {
      "label": "Quarter under plan v2",
      "program": "commission.quarter@2.0.0",
      "taskId": "q3-plan-v2",
      "status": "succeeded",
      "ms": 190.9,
      "headDigest": "sha256:638f859193f573f828ac8bf1d1a863437498767cafdcd62b44c3a3b7e5751ffa",
      "headDigestShort": "638f859193f5",
      "outputDigest": "sha256:a7e69fa4dc0201a06ec789707edd2f2feaf93f683fbd0305bca9133a08f25ff9",
      "outputDigestShort": "a7e69fa4dc02",
      "summary": {
        "bookedCents": 15422759131,
        "commissionCents": 1314824753,
        "deals": 20000,
        "reps": 500,
        "repsAboveQuota": 310
      }
    },
    {
      "label": "Engine comparison of the two runs' per-rep outputs",
      "program": "commission.compare@1.0.0",
      "taskId": "q3-v1-to-v2",
      "status": "succeeded",
      "ms": 21.9,
      "headDigest": "sha256:d0fe51020485ee99a9e4eb34430b75c37bcd386057a153d41cc63e0455bb3d9d",
      "headDigestShort": "d0fe51020485",
      "outputDigest": "sha256:74705a73a5a2d52659234cdd5642ee99e08fc6ed9a62ed86d3a3a4f6642345f9",
      "outputDigestShort": "74705a73a5a2",
      "summary": {
        "affected": 310,
        "losers": 310,
        "gainers": 0,
        "of": 500,
        "totalDifferenceCents": -81003983
      }
    }
  ],
  "replay": {
    "reexecuted": true,
    "by": "engine",
    "digestMatched": true,
    "verifiedRetainedHistory": true,
    "originalOutputDigest": "sha256:2e86702d58638d55245d07e04acc469b0106f58ee7e6929483bc63fecb69604f",
    "reexecutedOutputDigest": "sha256:2e86702d58638d55245d07e04acc469b0106f58ee7e6929483bc63fecb69604f",
    "modules": [
      {
        "moduleId": "case-commissions",
        "digest": "sha256:bc444d300c1b37ba01980f347f74113d748ae43ee61c1cd375c0a24957004cc9",
        "verified": true
      }
    ],
    "carriedContent": 0,
    "ms": 277.2,
    "program": "commission.quarter@1.0.0",
    "taskId": "q3-plan-v1"
  },
  "comparison": {
    "from": "commission.quarter@1.0.0",
    "to": "commission.quarter@2.0.0",
    "engineDiff": {
      "fromRef": "component:e620d162755e00462b42c1d378ae3a5b7e6c267bd02306ddbe98997fdfdd8ca2",
      "toRef": "component:4a963341ab34306f215abb33c7b7994b5ad860ef547e0a9298b4458c4a65454f",
      "inputChanges": {
        "added": [],
        "removed": [],
        "modified": []
      },
      "outputChanges": {
        "added": [],
        "removed": [],
        "modified": []
      },
      "stepDiff": {
        "added": [],
        "removed": [],
        "modified": [
          "plan"
        ]
      },
      "contractBreaking": false
    },
    "changed": [
      "step changed (engine diff stepDiff.modified): plan",
      "steps added: none; removed: none",
      "inputs and outputs unchanged (contractBreaking: false)",
      "plan term acceleratorRateBp: 1200 -> 1000 (read from the two runs' plan outputs)"
    ],
    "affected": {
      "count": 310,
      "of": 500,
      "losers": 310,
      "gainers": 0,
      "totalDifferenceCents": -81003983,
      "largest": {
        "label": "rep-459",
        "before": 10189651,
        "after": 8824709,
        "difference": -1364942,
        "unit": "cents"
      }
    }
  },
  "checks": [
    {
      "name": "v1 run succeeded and verified",
      "passed": true,
      "detail": "succeeded"
    },
    {
      "name": "v2 run succeeded and verified",
      "passed": true,
      "detail": "succeeded"
    },
    {
      "name": "every deal counted once (deals in = deals in summary)",
      "passed": true,
      "detail": "20000 and 20000 of 20000"
    },
    {
      "name": "bookings identical under both plans",
      "passed": true,
      "detail": "15422759131 cents"
    },
    {
      "name": "engine replay re-executed the v1 run to the same output digest",
      "passed": true,
      "detail": "2e86702d5863 vs 2e86702d5863"
    },
    {
      "name": "only reps above quota are affected",
      "passed": true,
      "detail": "310 affected, 310 above quota"
    }
  ],
  "notes": [
    "The commission plan is 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.",
    "Which reps were affected, by how much, and the largest loss were worked out by a third engine program from the two runs' results.",
    "The list of changed plan terms was worked out by the capture script, by comparing the terms each run used.",
    "The engine replayed the v1 run from scratch on its own and got the same result fingerprint.",
    "Times are wall-clock on a shared Mac (load average 26.47 on 10 cores at the start)."
  ],
  "detail": [
    "The kernel is scripts/case-evidence/kernels/commissions.mjs, loaded with the engine's loadProgramModule at the SHA-256 recorded in kernels[]; its steps run as pure steps of programs registered through ProgramSurface. The engine schedules the steps, stores inputs and outputs and verifies the run history.",
    "commission.compare@1.0.0 takes the two runs' perRep outputs as inputs. The engine's program.diff names only the changed step (plan); the changed terms come from comparing the plan outputs of the two runs.",
    "replay is the engine's program.replay with reexecute:true: it verifies the retained history, re-reads the kernel module and checks it against the recorded digest, runs the program again in a fresh in-memory engine and compares output digests. replay.ms times that call.",
    "headDigest fingerprints one run's retained history and includes when it ran, so two identical executions have different headDigests. outputDigest is the engine's canonical digest of the outputs; that is what replay compares.",
    "Times are milliseconds measured with performance.now() around each engine call."
  ]
}
