Forecast AI code maintenance liability
Forecast the long-run maintenance liability of aggregate AI-assisted code inventory with a Bayesian Gamma-Poisson recurrent-event model, learned AI/complexity/age hazards, lognormal severity and correlated repository shock VaR/CVaR.
What it's for
Translates AI-generated code enthusiasm into a finance-ready view of future maintenance load, downside tails and technical-liability reserves.
What you give it
Inputs split into evidence read from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.
| Field | Type | Role | Required |
|---|---|---|---|
| coefficient_grid_size | integer ≥ 11, ≤ 41 | Your calibration | Optional |
| coefficient_prior_sd | number > 0, ≤ 20 | Your calibration | Optional |
| current_inventory | array of objects (17 fields) | Evidence | Yes |
| horizon_days | number > 0 | Your calibration | Optional |
| maintenance_history | array of objects (11 fields) | Evidence | Yes |
| max_detail_rows | integer ≥ 1, ≤ 500 | Numerical control | Optional |
| maximum_absolute_coefficient | number > 0, ≤ 10 | Your calibration | Optional |
| minimum_history_rows | integer ≥ 1, ≤ 1000000 | Your calibration | Optional |
| minimum_maintenance_events | integer ≥ 1, ≤ 1000000 | Your calibration | Optional |
| random_seed | integer ≥ 0, ≤ 4294967295 | Your calibration | Optional |
| scenarios | array of objects (8 fields) | Evidence | Yes |
| simulation_count | integer ≥ 1000, ≤ 1000000 | Your calibration | Optional |
| tail_probability | number > 0, < 1 | Your calibration | Optional |
Each current_inventory
record
| Field | Type | Required |
|---|---|---|
| active_change_count | integer (≥ 1, ≤ 1000000) | Yes |
| change_class | string (non-empty) | Yes |
| containment_fraction | number (≥ 0, ≤ 1) | Yes |
| current_mean_age_days | number (≥ 0) | Yes |
| event_rate_prior_change_days | number (> 0) | Yes |
| event_rate_prior_shape | number (> 0) | Yes |
| evidence_verified | boolean | Yes |
| fixed_response_cost | number (≥ 0) | Yes |
| forecast_ai_assisted_fraction | number (≥ 0, ≤ 1) | Yes |
| id | string (non-empty) | Yes |
| maintenance_detection_probability | number (≥ 0, ≤ 1) | Yes |
| normalized_complexity | number (≥ 0) | Yes |
| repository_group_id | string (non-empty) | Yes |
| severity_prior_log_mean | number | Yes |
| severity_prior_log_sd | number (> 0, ≤ 5) | Yes |
| severity_prior_strength | number (> 0) | Yes |
| value_disruption_per_event | number (≥ 0) | Yes |
{
"coefficient_grid_size": 11,
"current_inventory": [
{
"active_change_count": 100,
"change_class": "service-change",
"containment_fraction": 0.25,
"current_mean_age_days": 90,
"event_rate_prior_change_days": 100000,
"event_rate_prior_shape": 1,
"evidence_verified": true,
"fixed_response_cost": 2000,
"forecast_ai_assisted_fraction": 0.7,
"id": "service-change-inventory",
"maintenance_detection_probability": 0.5,
"normalized_complexity": 0.5,
"repository_group_id": "core-services",
"severity_prior_log_mean": 6.907755278982137,
"severity_prior_log_sd": 0.5,
"severity_prior_strength": 5,
"value_disruption_per_event": 500
}
],
"maintenance_history": [
{
"ai_assisted_fraction": 0.1,
"change_class": "service-change",
"evidence_verified": true,
"exposure_change_days": 1000,
"id": "service-change-00",
"maintenance_cost_log_squared_sum": 0,
"maintenance_cost_log_sum": 0,
"maintenance_cost_observation_count": 0,
"maintenance_event_count": 0,
"mean_age_days": 90,
"normalized_complexity": 0.5
},
{
"ai_assisted_fraction": 0.9,
"change_class": "service-change",
"evidence_verified": true,
"exposure_change_days": 1000,
"id": "service-change-01",
"maintenance_cost_log_squared_sum": 95.43416598861116, Truncated for display — the full payload is 362 lines.
What you get back
This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.
{
"assumptions": [
"Complete zero-inclusive aggregate change-day intervals identify recurrent maintenance frequency; positive mature maintenance costs identify lognormal severity.",
"AI-assistance fraction, normalized complexity and log age enter a shared multiplicative hazard while change-class baselines remain partially pooled through governed priors.",
"Repository-group common shocks, control effects, value disruption and finance loss are calibrated locally and preserve scenario dependence across inventory classes."
],
"counts": {
"change_classes": 1,
"history_rows": 24,
"repository_groups": 1,
"scenarios": 2,
"simulations": 2000,
"supported_inventory_classes": 1
},
"decision": "review_ai_code_maintenance_liability_tail",
"forecast": {
"conditional_value_at_risk": 1805487.5167,
"expected_maintenance_events": 272.7125,
"expected_maintenance_liability": 355158.1834,
"median_maintenance_liability": 210711.8293,
"tail_probability": 0.05,
"value_at_risk": 1136268.9707
},
"inventory_forecasts": [
{
"change_class": "service-change",
"expected_maintenance_events": 272.7125,
"expected_maintenance_liability": 355158.1834,
"historical_maintenance_events": 24,
"history_rows": 24,
"inventory_id": "service-change-inventory",
"maintenance_events_p95": 753,
"repository_group_id": "core-services",
"support_gate_pass": true
}
],
"limitations": [
"The AI-assistance coefficient is predictive association unless supplied history comes from a valid prospective causal design; omitted architecture, team or task mix can confound it.",
"The model prices aggregate inventory liability and cannot infer line-level AI authorship, individual code quality, intent, productivity or employment suitability."
],
"method": "bayesian_gamma_poisson_recurrent_ai_code_maintenance_liability_v1",
"posterior": {
"coefficient_grid_size": 11,
"mean_ai_assistance_log_hazard_coefficient": 2.738, Truncated for display — the full payload is 58 lines.
How it works
Sequential Bayesian & bandits — Learn while deciding — update beliefs as evidence arrives and choose where the next unit of effort is worth spending.
- 1 Learn shared posterior AI-assistance, complexity and age hazard coefficients from complete zero-inclusive change-day exposure while retaining governed class-specific Gamma-Poisson baselines.
- 2 Pool positive mature maintenance-cost log moments with local severity priors, then simulate current inventory through coherent future scenarios and additive correlated repository shocks.
- 3 Report expected recurrent events, liability, VaR/CVaR and per-class support gates; abstain when history, event, cost or provenance floors fail.
Before you trust it
Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.
Assumptions & guardrails
- The likelihood or reward model, prior support, action logging, delayed outcomes, and any stationarity assumptions match the deployment process.
- Change-day exposure includes zero-event intervals, event and cost maturity are explicit, class priors are transportable and scenarios preserve shared repository dependence.
- Posterior probability and adaptive selection are model-conditional; they are not substitutes for randomized propensities or guaranteed safety.
- The AI coefficient is predictive association unless the history passed a valid causal design; inventory loss is not line-level authorship or an individual performance judgment.
Minimum evidence
- maintenance_history: required and organization-defined
- current_inventory: required and organization-defined
- scenarios: required and organization-defined
How to validate it
Use chronological train/calibration/test windows, compare proper scores and decision value with a simple baseline, and recalibrate only from outcomes resolved after prediction time.
Calibrating it to your org
Same for everyone
The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.
Specific to you
- versioned change-day panel joining canonical aggregate AI runtime exposure known at change time to mature maintenance/rework events and finance-reconciled costs without classifying line-level authorship
- change-class and recurrent-event definitions, censoring/maturity, exposure and complexity measurement, prior transport, coefficient support, support floors, inventory perimeter, repository groups, horizon/scenarios, finance loss, containment, tail appetite and forecast owner
Calibration workflow
- 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
- 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
- 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
- 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
- 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
- 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.
Call it from your AI
You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 18 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.
gitrevio_capabilities_search
{ "q": "forecast the longrun maintenance liability of" }
→ finds "forecast_ai_code_maintenance_liability"
gitrevio_capability_describe
{ "capability_id": "forecast_ai_code_maintenance_liability" }
→ returns the input schema and agent guidance shown on this page
gitrevio_capability_run
{ "capability_id": "forecast_ai_code_maintenance_liability", "arguments": { ... } }
→ returns the result shown above Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.
Related tools
Audit AI code change evidence integrity
Prove that aggregate AI-assisted coding evidence comes from prospectively registered, nonoverlapping treatment/control studies with immutable assignment, configuration, trace and mature-outcome denominators before anyone estimates an effect.
Optimize AI code assurance portfolio
Choose standard, expert, pair, property, formal or canary assurance per aggregate AI-code change stratum using Beta-binomial defect simulation, unique shared-component loss, hard controls/resources and a CVaR Pareto frontier.
Audit AI capability fallback integrity
Prove that every aggregate capability required when AI is unavailable has a current approved runbook and a sufficiently large, timely, successful, independently observed exercise conducted with AI actually disabled.
Audit AI inference cost allocation integrity
Reconcile provider AI invoices bottom-up to workload and route usage, price terms, cached requests, retries, fixed charges and credits without combining currencies or silently allocating unexplained spend.
Audit AI knowledge grounding integrity
Audit the complete AI knowledge supply chain from immutable source versions through indexed chunks and effective access policy to retrieved evidence, claim-level citations and honestly mature grounding outcomes, without treating unresolved answers as failures.
Audit AI model routing evidence integrity
Audit every live AI-model route against current version-matched local evaluation, uncontaminated temporal holdout, pricing freshness, residency, retention, reliability and genuinely independent provider fallback evidence, counting each workload's value at risk once.