{
  "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": "Route Portfolio Analytics requests to an in-region deployment (EU callers → EU serving)",
    "applicationId": "portfolio-analytics",
    "beforeAfter": {
      "addedEdges": [],
      "addedNodes": [],
      "after": "Portfolio Analytics: Route Portfolio Analytics requests to an in-region deployment (EU callers → EU serving)",
      "before": "Portfolio Analytics: cross-region serving on the hot path",
      "changedEdges": [
        "app:portfolio-analytics"
      ]
    },
    "benchmark": {
      "context": "Share of traffic served outside the caller region (lower is better). (illustrative)",
      "median": 0.12,
      "metric": "cross_region_share",
      "topQuartile": 0.03,
      "unit": "ratio",
      "yourValue": 0.4274
    },
    "businessValueEur": 1052.6,
    "complexity": "Medium",
    "confidence": 0.8998,
    "contextCompleteness": {
      "absent": [
        "Codebase",
        "Quality evaluation"
      ],
      "present": [
        "Telemetry",
        "Provider bill",
        "Per-app criticality",
        "Prior experiments"
      ],
      "presentCount": 4,
      "totalDims": 6
    },
    "costModelBasis": {
      "agentRunAllowanceEur": 20,
      "byHand": {
        "effortCostEur": 4800,
        "effortDays": 6,
        "engineeringDayRateEur": 800
      },
      "effortCostEur": 820,
      "rateBasis": "prior",
      "reviewHourRateEur": 100,
      "reviewHours": 8,
      "reviewHoursBasis": "prior",
      "version": "agent-assisted-v1-2026-08"
    },
    "criticalReview": {
      "alternativeExplanations": [
        "The cross-region hop may be REQUIRED by data-residency / compliance policy; pinning to the caller's region could violate it."
      ],
      "assumptions": [
        "Assumes cross-region serving is an accident of routing, not a deliberate choice."
      ],
      "failureConditions": [
        "Wrong if regulation mandates where this workload's data is processed."
      ],
      "missingEvidence": [
        "No compliance/data-residency constraints on record for this app.",
        "No independent quality evaluation — the quality impact is unmeasured."
      ]
    },
    "demoted": null,
    "effort": "Medium",
    "evidenceIds": [
      "ev:portfolio-analytics:region_optimization"
    ],
    "expectedImpact": {
      "annualSavingsEur": 21.48,
      "costDeltaPct": -0.03,
      "latencyDeltaPct": -0.1068,
      "qualityDeltaPct": 0,
      "qualityRisk": "none"
    },
    "id": "rec:portfolio-analytics:region_optimization",
    "inferenceId": "inf:portfolio-analytics:region_optimization",
    "latencyValueEur": 1031.12,
    "memoryNote": "Learned from 3 prior implementations, 3 succeeded (N=62,000).",
    "objectiveKey": "lowest_cost",
    "observationIds": [
      "obs:portfolio-analytics:cross_region_share",
      "obs:portfolio-analytics:p95_latency_ms"
    ],
    "pareto": true,
    "paybackDays": 13934,
    "priceBasis": "scenario",
    "priorityScore": 19.62,
    "qualityOfEvidence": "High",
    "roi": {
      "affectedRequestsMonthly": 9232,
      "annualSavingsEur": 21.48,
      "effortDays": 6,
      "monthlySavingsEur": 1.79,
      "paybackDays": 13934,
      "verified": false
    },
    "ruleId": "region_optimization",
    "sampleSize": 17280,
    "targetNodeId": "app:portfolio-analytics",
    "title": "Pin Portfolio Analytics serving to the caller’s region",
    "whyNot": [
      {
        "costDeltaPct": 0.04,
        "latencyDeltaPct": -0.1,
        "option": "Add an in-region read replica cache",
        "paretoOptimal": true,
        "qualityDeltaPct": 0,
        "qualityRisk": "none",
        "reason": "Helps, but only for cacheable reads; in-region serving fixes the whole path and is cheaper to run."
      },
      {
        "costDeltaPct": -0.15,
        "latencyDeltaPct": 0.05,
        "option": "Route to a US-only cheaper provider",
        "paretoOptimal": false,
        "qualityDeltaPct": 0,
        "qualityRisk": "none",
        "reason": "Cheaper but keeps EU traffic on US infra — worsens latency and breaches EU data-residency (privacy)."
      }
    ]
  },
  "decisionHash": "sha256:dfe1b3a21a4712c3188a2e062d213c2f6788b1c8b4994905425886c3cc1571b8",
  "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": "Portfolio Analytics is latency-sensitive, yet 42.7% of its traffic takes a cross-region round trip; in-region serving removes that hop. Estimated €21/yr at the current run-rate, payback not economic, confidence 90%.",
    "technical": "Deploy the Portfolio Analytics inference path in the caller's region and route by user geography; keep US as failover. Affects ~9,232 req/mo; expected cost -3%, latency -10.7%, quality unchanged by construction.",
    "phrasedBy": "mock",
    "provenance": {
      "narrativeProvenanceVersion": 1,
      "attempted": "mock",
      "policyVersion": "fabric-v1-2026-08",
      "source": "provider",
      "degraded": false
    }
  },
  "ledgerState": "lead",
  "ledgerVersion": "22c35e346df765c3",
  "overlapGroup": null,
  "simulation": {
    "formulaVersion": "sim-v1",
    "formula": "realization = 0.7 + 0.3 × confidence (scenario assumption)",
    "inputs": {
      "baseAnnualSavingsEur": 21.48,
      "confidence": 0.8998
    },
    "intermediates": {
      "realization": 0.97
    },
    "outputs": {
      "annualSavingsEur": 20.83,
      "downsideAnnualSavingsEur": 15.04,
      "upsideAnnualSavingsEur": 21.48
    }
  },
  "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": "claude-sonnet",
          "rates": {
            "inputPer1M": 2,
            "outputPer1M": 10,
            "cacheReadPer1M": 0.2,
            "cacheWritePer1M": 2.5
          },
          "provenance": {
            "source": "bayeto-scenario",
            "capturedAt": "2026-07-21",
            "quality": "scenario"
          }
        },
        {
          "family": "gpt-4o-mini",
          "rates": {
            "inputPer1M": 0.15,
            "outputPer1M": 0.6,
            "cacheReadPer1M": 0.075,
            "cacheWritePer1M": 0.15
          },
          "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:29:08.280Z"
  }
}
