{
  "version": 1,
  "generatedAt": "2026-10-08T22:51:20.867Z",
  "scope": "Five deterministic tool-output fixtures. Includes repetitive, unique, compact and unsupported inputs. No paid model calls.",
  "measure": "Character counts are measured. Token counts use ceil(UTF-16 code units / 4); not a provider tokenizer.",
  "quality": "Round-trip reconstruction of data is verified. LLM task quality and invoice savings are not tested.",
  "claim": "No universal customer cost or 30x savings claim is supported by this benchmark.",
  "reproduce": "pnpm --filter @leash/core build && node scripts/optimization-benchmark.mjs",
  "results": [
    {
      "id": "records",
      "name": "Structured tool response",
      "inputSha256": "fcbc6183c08d2bdc49fdb83cc9bcc0e789f1952f5842f3e879b99cded9b234d5",
      "changed": true,
      "strategy": "json-table",
      "reason": "optimized",
      "beforeChars": 13854,
      "afterChars": 3967,
      "savedChars": 9887,
      "savedPercent": 71.36567056445791,
      "estimatedTokensBefore": 3464,
      "estimatedTokensAfter": 992,
      "estimatedTokenSavings": 2472,
      "estimateMethod": "ceil(UTF-16 code units / 4); heuristic, not provider token counts or invoice savings",
      "outputSizeRatio": 3.49,
      "roundTrip": "passed"
    },
    {
      "id": "repeated-log",
      "name": "Highly repetitive build log",
      "inputSha256": "1af9a1ec3e96117cf9f0eff964729159d5ae33f241e60abb488c92920f8f0b5a",
      "changed": true,
      "strategy": "line-runs",
      "reason": "optimized",
      "beforeChars": 25274,
      "afterChars": 336,
      "savedChars": 24938,
      "savedPercent": 98.67057054680699,
      "estimatedTokensBefore": 6319,
      "estimatedTokensAfter": 84,
      "estimatedTokenSavings": 6235,
      "estimateMethod": "ceil(UTF-16 code units / 4); heuristic, not provider token counts or invoice savings",
      "outputSizeRatio": 75.22,
      "roundTrip": "passed"
    },
    {
      "id": "unique-log",
      "name": "Log with distinct events",
      "inputSha256": "d3a0da27506d2a292f0cb2b6e74c0af5dc95f6cc581984e996662707e3711cbf",
      "changed": false,
      "strategy": "none",
      "reason": "unsupported",
      "beforeChars": 4435,
      "afterChars": 4435,
      "savedChars": 0,
      "savedPercent": 0,
      "estimatedTokensBefore": 1109,
      "estimatedTokensAfter": 1109,
      "estimatedTokenSavings": 0,
      "estimateMethod": "ceil(UTF-16 code units / 4); heuristic, not provider token counts or invoice savings",
      "outputSizeRatio": 1,
      "roundTrip": "passed"
    },
    {
      "id": "small-json",
      "name": "Already compact JSON",
      "inputSha256": "723c39a9c415af7d8d03c521245bd91fedc9c8a5398c737494fc29a70334f138",
      "changed": false,
      "strategy": "none",
      "reason": "not-smaller",
      "beforeChars": 21,
      "afterChars": 21,
      "savedChars": 0,
      "savedPercent": 0,
      "estimatedTokensBefore": 6,
      "estimatedTokensAfter": 6,
      "estimatedTokenSavings": 0,
      "estimateMethod": "ceil(UTF-16 code units / 4); heuristic, not provider token counts or invoice savings",
      "outputSizeRatio": 1,
      "roundTrip": "passed"
    },
    {
      "id": "source",
      "name": "Source code (unchanged)",
      "inputSha256": "a7549caabac621bccf78d36d73b5d8bb30f93eba3e0845c2e2412b17cdc4c1b1",
      "changed": false,
      "strategy": "none",
      "reason": "unsupported",
      "beforeChars": 85,
      "afterChars": 85,
      "savedChars": 0,
      "savedPercent": 0,
      "estimatedTokensBefore": 22,
      "estimatedTokensAfter": 22,
      "estimatedTokenSavings": 0,
      "estimateMethod": "ceil(UTF-16 code units / 4); heuristic, not provider token counts or invoice savings",
      "outputSizeRatio": 1,
      "roundTrip": "passed"
    }
  ]
}
