OpstriQ · Methodology · v2.1

How the numbers are computed

Plain-language methodology for every metric on the Ledger and Executive Briefing.

Cost data sources

OpstriQ pulls cost data from three sources, in this priority order:

  1. AWS Cost Explorer API (ce:GetCostAndUsage) — used for daily spend, MTD totals, and service breakdowns. Returned in amortized cost basis by default. Cached 1 hour to control API spend ($0.01 per call).
  2. RI / Savings Plan utilization — pulled from ce:GetReservationUtilization and ce:GetSavingsPlansUtilization. Used for the Commitments KPI.
  3. Scanner-derived estimates — used as a fallback when CUR is unavailable, and for waste categorization (idle / unused / orphaned). These are heuristic, not authoritative.

Cost basis options

BasisWhat it meansWhen to use
AmortizedSpread upfront RI/SP fees across their termDefault · CFO-grade · matches GL
UnblendedWhat you actually paid that dayCash-flow analysis
BlendedOrg-level discounted rates applied uniformlyMulti-account chargeback

Forecast model

End-of-month and 30-day-ahead forecasts use Holt's damped-trend exponential smoothing implemented in NumPy:

level_t = α · y_t + (1 − α) · (level_{t−1} + φ · trend_{t−1})
trend_t = β · (level_t − level_{t−1}) + (1 − β) · φ · trend_{t−1}
forecast_{t+h} = level_t + Σ(φ^i, i=1..h) · trend_t

Defaults: α = 0.4 (level smoothing) · β = 0.15 (trend smoothing) · φ = 0.95 (damping). The 80% prediction interval uses the standard deviation of fitting residuals scaled by √h. Confidence reports as high with ≥30 days of history, medium with ≥7, low otherwise.

Anomaly detection

σ-based detector against a 7-day rolling baseline. A day is flagged if:

|actual − baseline_mean| > 2 · baseline_std

Severity by % above baseline: critical > 60% · high > 40% · medium > 20% · else low.

Waste & remediation

Findings are scanner-derived and tagged GREEN / YELLOW / RED:

The "Identified waste" KPI is the sum of GREEN+YELLOW monthly cost. The waste % of spend is that sum divided by total monthly amortized cost.

Unit economics

Cost per unit = amortized_spend / unit_count_for_period. The denominator is configured in Settings → Cost Allocation. Options: per_customer · per_transaction · per_MAU · per_employee · per_service. Confidence is low if unit count < 100 in the period, high otherwise. The 90-day trend chart includes p25 and p75 percentile bands computed from rolling 30-day windows.

Governance score

A weighted composite (0–100) intended to land in 70–89 for typical enterprises:

0.30 · tagging_coverage_pct
  + 0.25 · commitment_efficiency_pct
  + 0.20 · budget_adherence_pct
  + 0.15 · anomaly_resolution_score
  + 0.10 · forecast_accuracy_pct

Grade: ≥90 A · ≥80 B · ≥70 C · ≥60 D · else F.

Provenance & AI brief

The morning brief is generated by Leana (an AI agent at version reported in the briefing footer). Every brief carries:

AI text is reviewed-by-default by the tenant admin email on file. Always verify AI-generated narrative before making financial decisions.

Coverage & freshness

Coverage = (accounts in scope) / (accounts total). Confidence is high when coverage ≥ 90% and tagged spend ≥ 70%, medium when coverage ≥ 70%, otherwise low. The Ledger surfaces this in §0 before any conclusions, by design.

SOC 2 evidence

Attestation hashes on the Executive Briefing and Ledger colophon support SOC 2 CC3.4 (monitoring objectives) and CC4.1 (control evidence). Each rendered briefing is captured with content hash + inputs hash so a point-in-time review is reconstructible.

Cost Explorer pricing

Each ce:GetCostAndUsage call costs $0.01. OpstriQ caches results for 1 hour to keep the per-tenant API spend predictable (~$7/month at hourly polling). Heavier queries (90-day daily granularity by service) are computed at most once per hour.