net-kingdom/canon/schemas/tenancy-posture_v0.1.schema.json
tegwick cced59d3aa
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Publish tenancy posture draft-8 contract
2026-08-18 12:15:41 +02:00

190 lines
5.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://policy.coulomb.social/schemas/tenancy-posture/v0.1",
"title": "NetKingdom tenancy posture declaration v0.1",
"type": "object",
"required": ["schema_version", "framework"],
"properties": {
"schema_version": {"const": "0.1"},
"framework": {"const": "netkingdom-tenancy-posture"},
"service": {"$ref": "#/$defs/serviceName"},
"role": {"type": "string", "minLength": 1},
"tenancy": {"$ref": "#/$defs/tenancy"},
"provider": {"$ref": "#/$defs/provider"},
"evidence": {"$ref": "#/$defs/evidence"},
"notes": {"$ref": "#/$defs/stringList"},
"services": {
"type": "array",
"minItems": 1,
"items": {"$ref": "#/$defs/service"}
}
},
"oneOf": [
{
"required": ["service", "role", "tenancy"],
"not": {"required": ["services"]}
},
{
"required": ["services"],
"not": {"anyOf": [
{"required": ["service"]},
{"required": ["role"]},
{"required": ["tenancy"]},
{"required": ["provider"]},
{"required": ["evidence"]}
]}
}
],
"additionalProperties": false,
"$defs": {
"serviceName": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9._-]*$"
},
"axisName": {
"enum": ["I", "A", "E", "P", "R", "V"]
},
"level": {
"oneOf": [
{"type": "integer", "minimum": 0, "maximum": 4},
{"const": "n/a"}
]
},
"axisVector": {
"type": "object",
"required": ["I", "A", "E", "P", "R", "V"],
"properties": {
"I": {"oneOf": [{"type": "integer", "minimum": 0, "maximum": 3}, {"const": "n/a"}]},
"A": {"$ref": "#/$defs/level"},
"E": {"$ref": "#/$defs/level"},
"P": {"$ref": "#/$defs/level"},
"R": {"$ref": "#/$defs/level"},
"V": {"$ref": "#/$defs/level"}
},
"additionalProperties": false
},
"partialAxisVector": {
"type": "object",
"minProperties": 1,
"properties": {
"I": {"oneOf": [{"type": "integer", "minimum": 0, "maximum": 3}, {"const": "n/a"}]},
"A": {"$ref": "#/$defs/level"},
"E": {"$ref": "#/$defs/level"},
"P": {"$ref": "#/$defs/level"},
"R": {"$ref": "#/$defs/level"},
"V": {"$ref": "#/$defs/level"}
},
"additionalProperties": false
},
"stringMap": {
"type": "object",
"additionalProperties": {"type": "string", "minLength": 1}
},
"stringList": {
"type": "array",
"items": {"type": "string", "minLength": 1}
},
"paths": {
"type": "object",
"propertyNames": {"$ref": "#/$defs/axisName"},
"additionalProperties": {
"type": "object",
"minProperties": 1,
"additionalProperties": {"$ref": "#/$defs/level"}
}
},
"placementException": {
"type": "object",
"required": ["tenants", "P", "reason"],
"properties": {
"tenants": {"$ref": "#/$defs/stringList"},
"P": {"type": "integer", "minimum": 0, "maximum": 4},
"reason": {"type": "string", "minLength": 1},
"tier_ref": {"type": "string", "minLength": 1}
},
"additionalProperties": false
},
"tenancy": {
"type": "object",
"required": ["current", "target", "reviewed", "review_due", "service_class"],
"properties": {
"current": {"$ref": "#/$defs/axisVector"},
"implemented": {"$ref": "#/$defs/partialAxisVector"},
"target": {"$ref": "#/$defs/axisVector"},
"reviewed": {"type": "string", "format": "date"},
"review_due": {"type": "string", "format": "date"},
"service_class": {"enum": ["latency-critical", "interactive", "batch"]},
"permanent": {
"type": "array",
"uniqueItems": true,
"items": {"$ref": "#/$defs/axisName"}
},
"reason": {"$ref": "#/$defs/stringMap"},
"gap": {"$ref": "#/$defs/stringMap"},
"paths": {"$ref": "#/$defs/paths"},
"placement_exceptions": {
"type": "array",
"items": {"$ref": "#/$defs/placementException"}
},
"secondary_stores": {"$ref": "#/$defs/stringList"}
},
"additionalProperties": false
},
"providerAxis": {
"type": "object",
"required": ["available", "maximum"],
"properties": {
"available": {"$ref": "#/$defs/level"},
"maximum": {"$ref": "#/$defs/level"},
"conditions": {"$ref": "#/$defs/stringList"},
"evidence": {"$ref": "#/$defs/stringList"},
"reason": {"type": "string", "minLength": 1}
},
"additionalProperties": false
},
"provider": {
"type": "object",
"required": ["axes"],
"properties": {
"capability": {"type": "string", "minLength": 1},
"profile": {"type": "string", "minLength": 1},
"axes": {
"type": "object",
"minProperties": 1,
"properties": {
"I": {"$ref": "#/$defs/providerAxis"},
"A": {"$ref": "#/$defs/providerAxis"},
"E": {"$ref": "#/$defs/providerAxis"},
"P": {"$ref": "#/$defs/providerAxis"},
"R": {"$ref": "#/$defs/providerAxis"},
"V": {"$ref": "#/$defs/providerAxis"}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"evidence": {
"type": "object",
"additionalProperties": {
"oneOf": [
{"type": "string", "minLength": 1},
{"$ref": "#/$defs/stringList"}
]
}
},
"service": {
"type": "object",
"required": ["service", "role", "tenancy"],
"properties": {
"service": {"$ref": "#/$defs/serviceName"},
"role": {"type": "string", "minLength": 1},
"tenancy": {"$ref": "#/$defs/tenancy"},
"provider": {"$ref": "#/$defs/provider"},
"evidence": {"$ref": "#/$defs/evidence"},
"notes": {"$ref": "#/$defs/stringList"}
},
"additionalProperties": false
}
}
}