{
  "format": "bayeto-decision-record",
  "formatVersion": 3,
  "formatNote": "v3 adds decisionHash. Additive: v2 records remain valid and re-derivable — no v2 field changed meaning, moved, or was removed.",
  "record": {
    "action": "Prune the 12002 un-cached tokens Meeting Summaries re-sends on every call — retrieved context, conversation history, repeated blocks",
    "applicationId": "meeting-summaries",
    "beforeAfter": {
      "addedEdges": [],
      "addedNodes": [],
      "after": "Meeting Summaries: Prune the 12002 un-cached tokens Meeting Summaries re-sends on every call — retrieved context, conversation history, repeated blocks",
      "before": "Meeting Summaries: full-length system prompts on every request",
      "changedEdges": [
        "app:meeting-summaries"
      ]
    },
    "benchmark": {
      "context": "Average input tokens per request (lower is leaner prompts). (illustrative)",
      "median": 2200,
      "metric": "avg_input_tokens",
      "topQuartile": 1400,
      "unit": "tokens",
      "yourValue": 12002
    },
    "businessValueEur": 9573.02,
    "complexity": "Low",
    "confidence": 0.7139,
    "contextCompleteness": {
      "absent": [
        "Codebase",
        "Quality evaluation"
      ],
      "present": [
        "Telemetry",
        "Provider bill",
        "Per-app criticality",
        "Prior experiments"
      ],
      "presentCount": 4,
      "totalDims": 6
    },
    "costModelBasis": {
      "agentRunAllowanceEur": 20,
      "byHand": {
        "effortCostEur": 2400,
        "effortDays": 3,
        "engineeringDayRateEur": 800
      },
      "effortCostEur": 320,
      "rateBasis": "prior",
      "reviewHourRateEur": 100,
      "reviewHours": 3,
      "reviewHoursBasis": "prior",
      "version": "agent-assisted-v1-2026-08"
    },
    "criticalReview": {
      "alternativeExplanations": [
        "The large prompt may be load-bearing context the model actually uses; trimming it would degrade quality, not just cost."
      ],
      "assumptions": [
        "Assumes ~15% of the prompt is redundant boilerplate that can be pruned without changing answers."
      ],
      "failureConditions": [
        "Wrong if the trimmed context was genuinely used by the model for correctness.",
        "This figure counts ONLY the un-cached surface. Shortening the cached prefix instead reclaims far less — those tokens already bill at the cache-read rate — and forces a re-warm at the write premium, which can cost more than the trim saves.",
        "Wrong if this workload's real quality bar is higher than assumed and the change degrades answers."
      ],
      "missingEvidence": [
        "No before/after quality evaluation — the compressible fraction is a heuristic, not a measured safe-to-cut amount.",
        "No independent quality evaluation — the quality impact is unmeasured."
      ]
    },
    "demoted": null,
    "effort": "Low",
    "evidenceIds": [
      "ev:meeting-summaries:prompt_compression"
    ],
    "expectedImpact": {
      "annualSavingsEur": 6952.22,
      "costDeltaPct": -0.1333,
      "latencyDeltaPct": -0.05,
      "qualityDeltaPct": null,
      "qualityRisk": "medium"
    },
    "id": "rec:meeting-summaries:prompt_compression",
    "inferenceId": "inf:meeting-summaries:prompt_compression",
    "latencyValueEur": 2620.8,
    "memoryNote": "Learned caution: only 1/3 prior implementations succeeded (N=51,000); confidence penalized.",
    "objectiveKey": "lowest_cost",
    "observationIds": [
      "obs:meeting-summaries:avg_input_tokens"
    ],
    "pareto": true,
    "paybackDays": 17,
    "priceBasis": "scenario",
    "priorityScore": 5293.99,
    "qualityOfEvidence": "High",
    "roi": {
      "affectedRequestsMonthly": 30000,
      "annualSavingsEur": 6952.22,
      "effortDays": 3,
      "monthlySavingsEur": 579.35,
      "paybackDays": 17,
      "verified": false
    },
    "ruleId": "prompt_compression",
    "sampleSize": 24000,
    "targetNodeId": "app:meeting-summaries",
    "title": "Compress the un-cached context Meeting Summaries re-sends every call",
    "whyNot": [
      {
        "costDeltaPct": -0.28,
        "latencyDeltaPct": -0.1,
        "option": "Aggressively truncate context",
        "paretoOptimal": false,
        "qualityDeltaPct": null,
        "qualityRisk": "high",
        "reason": "Bigger cost cut, but an aggressive prune carries a materially higher unmeasured quality risk on this workload — the quality effect of removing context has never been measured here."
      },
      {
        "costDeltaPct": 0.05,
        "latencyDeltaPct": 0.2,
        "option": "LLM summarization pre-pass",
        "paretoOptimal": false,
        "qualityDeltaPct": 0,
        "qualityRisk": "none",
        "reason": "Adds an extra model call — raises cost and latency, defeating the purpose."
      }
    ]
  },
  "decisionHash": "sha256:d06cf5bfe8e73257454b0322e3b10273cd4b2a632690567d06a068598537ae73",
  "narrative": {
    "note": "Phrased by the AI Fabric from deterministic drafts. Not part of the decision; changing it cannot change any number above. `provenance` records which provider source control approved, whether it served, and why not — source:\"draft\" means you are reading the engine's own deterministic wording.",
    "business": "Meeting Summaries re-sends a large un-cached context on every call and pays full input rate for it; pruning ~15% of that surface cuts 13.3% of this application’s spend. Estimated €6,952/yr at the current run-rate, payback 17 days, confidence 71%.",
    "technical": "Dedupe retrieved context, cap conversation history, and remove repeated blocks from the PER-CALL portion of the prompt — measure quality before/after. Affects ~30,000 req/mo; expected cost -13.3%, latency -5%, quality unmeasured (medium risk).",
    "phrasedBy": "mock",
    "provenance": {
      "narrativeProvenanceVersion": 1,
      "attempted": "mock",
      "policyVersion": "fabric-v1-2026-08",
      "source": "provider",
      "degraded": false
    }
  },
  "ledgerState": "overlapping_alternative",
  "ledgerVersion": "22c35e346df765c3",
  "overlapGroup": {
    "applicationId": "meeting-summaries",
    "memberIds": [
      "rec:meeting-summaries:migration_laggard",
      "rec:meeting-summaries:overpowered_model",
      "rec:meeting-summaries:prompt_compression"
    ],
    "leadId": "rec:meeting-summaries:migration_laggard"
  },
  "simulation": {
    "formulaVersion": "sim-v1",
    "formula": "realization = 0.7 + 0.3 × confidence (scenario assumption)",
    "inputs": {
      "baseAnnualSavingsEur": 6952.22,
      "confidence": 0.7139
    },
    "intermediates": {
      "realization": 0.914
    },
    "outputs": {
      "annualSavingsEur": 6355.51,
      "downsideAnnualSavingsEur": 4866.55,
      "upsideAnnualSavingsEur": 6952.22
    }
  },
  "measured": null,
  "run": {
    "engineVersion": "0.1.0",
    "workspaceSourceKind": "demo",
    "stateVersion": "none|none|0|0:none",
    "datasetHash": "c8030438f36955eebab44a8b2fe9a468df7d9592992ba71e8145de0a9965ce23",
    "pricing": {
      "catalogVersion": "thornbury-scenario-v0",
      "unresolved": null,
      "rows": [
        {
          "family": "gpt-4-turbo",
          "rates": {
            "inputPer1M": 10,
            "outputPer1M": 30,
            "cacheReadPer1M": 10,
            "cacheWritePer1M": 0
          },
          "provenance": {
            "source": "bayeto-scenario",
            "capturedAt": "2026-07-21",
            "quality": "scenario"
          }
        }
      ]
    },
    "windowDays": 24,
    "windowStart": "2026-06-06T00:00:00.000Z",
    "windowEnd": "2026-06-29T23:58:51.723Z",
    "coverage": {
      "rows": 124800,
      "activeDays": 24,
      "unattributedRows": 0
    },
    "fxRates": {
      "USD_EUR": 0.92,
      "GBP_EUR": 1.17,
      "effectiveDate": "2026-07-06",
      "basis": "fixed reference rates (determinism; never live FX)"
    },
    "implementationCostModel": {
      "version": "agent-assisted-v1-2026-08",
      "reviewHourRateEur": 100,
      "agentRunAllowanceEur": 20,
      "basis": "agent-assisted priors (review hours × rate + agent-run allowance); byHand comparison at the blended day rate"
    },
    "engineeringDayRateEur": 800,
    "evidenceTaxonomyVersion": "evtax-v1",
    "formulaVersions": {
      "accuracy": "pvm-v1",
      "simulation": "sim-v1"
    },
    "generatedAt": "2026-08-28T18:51:37.397Z"
  }
}
