Files
cgm-remote-monitor/docs/proposals/schemas/policy-composition.schema.json
T
bewestandBen West 12c90cfc63 Add proposal for agentic collaboration control plane and data plane
Create a new RFC document and associated JSON schemas defining an agentic control plane for automated insulin delivery systems, including event envelopes, capabilities models, delivery tracking, and conflict rules.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 06715f81-f852-4156-8ab0-cf9e0aa3564d
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 010cdc4a-2c86-4d2e-9768-bf2769a89953
Replit-Helium-Checkpoint-Created: true
2026-01-19 13:12:53 -08:00

147 lines
4.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nightscout.github.io/schemas/policy-composition.schema.json",
"title": "PolicyComposition",
"description": "Materialized view of effective therapy parameters computed from active profile and overrides",
"type": "object",
"required": ["compositionId", "references", "effectiveParameters", "computedBy", "validFrom"],
"properties": {
"compositionId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for this composition snapshot"
},
"references": {
"type": "object",
"required": ["profileId", "profileHash"],
"description": "References to source objects used in this composition",
"properties": {
"profileId": {
"type": "string",
"description": "Active ProfileDefinition ID"
},
"profileHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$",
"description": "Content hash of active profile for verification"
},
"activeOverrideInstanceIds": {
"type": "array",
"items": { "type": "string" },
"description": "Currently active OverrideInstance IDs"
},
"capabilitySnapshotId": {
"type": ["string", "null"],
"description": "Reference to CapabilitySnapshot if available"
}
}
},
"effectiveParameters": {
"type": "object",
"description": "Computed therapy parameters currently in force",
"properties": {
"targetRange": {
"type": "object",
"required": ["low", "high"],
"properties": {
"low": {
"type": "number",
"description": "Effective lower target bound"
},
"high": {
"type": "number",
"description": "Effective upper target bound"
}
}
},
"effectiveISF": {
"type": "number",
"description": "Effective insulin sensitivity factor for current time"
},
"effectiveCR": {
"type": "number",
"description": "Effective carb ratio for current time"
},
"effectiveBasal": {
"type": "number",
"description": "Effective basal rate for current time (after multipliers)"
},
"scheduledBasal": {
"type": "number",
"description": "Scheduled basal rate from profile (before multipliers)"
},
"basalMultiplier": {
"type": "number",
"description": "Aggregate basal multiplier from overrides"
},
"sensitivityMultiplier": {
"type": "number",
"description": "Aggregate sensitivity multiplier from overrides"
},
"maxBasalAllowed": {
"type": "number",
"description": "Maximum basal rate allowed by constraints"
},
"maxBolusAllowed": {
"type": "number",
"description": "Maximum bolus allowed by constraints"
},
"maxIOB": {
"type": "number",
"description": "Maximum IOB allowed by constraints"
},
"automationEnabled": {
"type": "boolean",
"description": "Whether closed-loop automation is active"
},
"automationMode": {
"type": "string",
"enum": ["closedLoop", "openLoop", "suspended", "manual"],
"description": "Current automation mode"
}
}
},
"computedBy": {
"type": "object",
"required": ["computedAt"],
"properties": {
"controllerKind": {
"type": "string",
"description": "Controller type that computed this (loop, trio, aaps, nightscout)"
},
"controllerVersion": {
"type": "string",
"description": "Controller version"
},
"controllerInstanceId": {
"type": "string",
"description": "Specific controller instance ID"
},
"computedAt": {
"type": "string",
"format": "date-time",
"description": "When this composition was computed"
}
}
},
"validFrom": {
"type": "string",
"format": "date-time",
"description": "When this composition became valid"
},
"validTo": {
"type": ["string", "null"],
"format": "date-time",
"description": "When this composition was superseded; null if current"
},
"cursor": {
"type": "integer",
"description": "Global ordering cursor for event stream"
},
"previousCompositionId": {
"type": ["string", "null"],
"description": "Previous composition for audit chain"
}
}
}