T06: optimization-case schema, fail-closed evaluator, cadence and decision template. Every option including the baseline must present all ten decision fields; one unknown blocks the comparison. Validated on the storage case (Hetzner computes and loses to Scaleway by EUR 29.14/month on operator labour; Host Europe blocks on four named gaps) and on the non-storage reef-railiance k3s rightsizing case (low utilization is real, but nothing is costable while the railiance01 price is unknown). T07: portfolio report over coverage, lifecycle, utilization, cost, renewals, risks, open cases, and next actions, derived only from committed evidence. Portfolio spend is reported null rather than as a partial sum, unattributed cost is a named list rather than a spread, and unmeasurable resources are reported rather than dropped. RESOURCE-WP-0003 is finished; both cases remain blocked_on_evidence against live delegated records in other repositories. RESOURCE-WP-0002 is untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
85 lines
3.5 KiB
JSON
85 lines
3.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://coulomb.social/resource-control/resource-control-cycle.schema.json",
|
|
"title": "Immutable resource forecast or actual observation",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["schema_version", "record_id", "record_type", "resource_id", "resource_class", "period", "created_at", "usage_proxies", "capacity", "costs", "allocation", "service_constraints", "evidence"],
|
|
"properties": {
|
|
"schema_version": {"const": "0.1"},
|
|
"record_id": {"type": "string", "minLength": 1},
|
|
"record_type": {"enum": ["forecast", "actual"]},
|
|
"resource_id": {"type": "string", "pattern": "^resource:"},
|
|
"resource_class": {"enum": ["storage", "vm", "cluster_compute", "shared_platform_service", "managed_service", "other"]},
|
|
"period": {"type": "string", "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"},
|
|
"created_at": {"type": "string", "format": "date-time"},
|
|
"scenario": {"enum": ["low", "base", "high", "observed"]},
|
|
"forecast_ref": {"type": ["string", "null"]},
|
|
"revision_of": {"type": ["string", "null"]},
|
|
"usage_proxies": {
|
|
"type": "object",
|
|
"minProperties": 1,
|
|
"additionalProperties": {"$ref": "#/$defs/measurement"}
|
|
},
|
|
"capacity": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["model", "provisioned", "used"],
|
|
"properties": {
|
|
"model": {"enum": ["fixed", "elastic", "hybrid"]},
|
|
"provisioned": {"type": "object", "additionalProperties": {"$ref": "#/$defs/measurement"}},
|
|
"used": {"type": "object", "additionalProperties": {"$ref": "#/$defs/measurement"}}
|
|
}
|
|
},
|
|
"costs": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["currency", "infrastructure", "internal_labor", "external_labor", "total"],
|
|
"properties": {
|
|
"currency": {"const": "EUR"},
|
|
"infrastructure": {"type": "number", "minimum": 0},
|
|
"internal_labor": {"type": "number", "minimum": 0},
|
|
"external_labor": {"type": "number", "minimum": 0},
|
|
"total": {"type": "number", "minimum": 0},
|
|
"booked_cost_refs": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
|
}
|
|
},
|
|
"allocation": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["method", "driver", "method_version", "unattributed_eur"],
|
|
"properties": {
|
|
"method": {"type": "string", "minLength": 1},
|
|
"driver": {"type": "string", "minLength": 1},
|
|
"method_version": {"type": "string", "minLength": 1},
|
|
"unattributed_eur": {"type": "number", "minimum": 0}
|
|
}
|
|
},
|
|
"service_constraints": {"type": "object", "additionalProperties": {"$ref": "#/$defs/measurement"}},
|
|
"uncertainty": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["level", "notes"],
|
|
"properties": {
|
|
"level": {"enum": ["low", "medium", "high"]},
|
|
"notes": {"type": "array", "items": {"type": "string"}}
|
|
}
|
|
},
|
|
"variance_attribution": {
|
|
"type": "object",
|
|
"additionalProperties": {"enum": ["demand", "provider_price", "allocation", "labor", "model", "data_quality"]}
|
|
},
|
|
"evidence": {"type": "array", "minItems": 1, "items": {"type": "string"}}
|
|
},
|
|
"$defs": {
|
|
"measurement": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["value", "unit"],
|
|
"properties": {
|
|
"value": {"type": "number", "minimum": 0},
|
|
"unit": {"type": "string", "minLength": 1}
|
|
}
|
|
}
|
|
}
|
|
}
|