{ "$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} } } } }