Explain a program before it runs: its effects, each call with the answer of the capability, and the problems
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"program": {
"description": "The program: a call ({ $proc, input }). The procedure reads it as data: nothing in it starts."
},
"capability": {
"type": "object",
"properties": {
"clearance": {
"description": "The clearance of the run"
},
"effects": {
"description": "The effects that the calls can have. Absent: all effects.",
"type": "object",
"properties": {
"reads": {
"description": "The resources that a call can read: names, or \"any\"",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string",
"const": "any"
}
]
},
"writes": {
"description": "The resources that a call can change: names, or \"any\". An empty list: no change.",
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string",
"const": "any"
}
]
},
"destructive": {
"description": "False: a call cannot start a destructive procedure",
"type": "boolean"
}
}
},
"deadline": {
"description": "The deadline (the static check does not use it)",
"type": "number"
}
},
"description": "The capability of the run. Absent: the capability of the caller."
},
"mode": {
"description": "exec (the default): the program runs as client.exec runs it. body: as the body of a defined procedure, with input in scope.",
"type": "string",
"enum": [
"exec",
"body"
]
}
},
"required": [
"program"
]
},
"output": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "True when no diagnostic is an error: then the host can start the program"
},
"effects": {
"type": "object",
"properties": {
"reads": {
"description": "The resources that a run can read. Absent: not known.",
"type": "array",
"items": {
"type": "string"
}
},
"writes": {
"description": "The resources that a run can change. Absent: not known.",
"type": "array",
"items": {
"type": "string"
}
},
"destructive": {
"description": "True: a call can delete or overwrite data",
"type": "boolean"
},
"idempotent": {
"description": "True: each call that changes data is idempotent",
"type": "boolean"
}
},
"additionalProperties": false,
"description": "The effects that a run can have (the upper bound)"
},
"mustEffects": {
"type": "object",
"properties": {
"reads": {
"type": "array",
"items": {
"type": "string"
},
"description": "The resources that each run reads"
},
"writes": {
"type": "array",
"items": {
"type": "string"
},
"description": "The resources that each run changes"
}
},
"required": [
"reads",
"writes"
],
"additionalProperties": false,
"description": "The effects of each run in which no call fails (the lower bound)"
},
"diagnostics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"severity": {
"type": "string",
"enum": [
"error",
"warning",
"info"
],
"description": "An error stops the program"
},
"code": {
"type": "string",
"description": "The code of the problem, for example unknown-name"
},
"message": {
"type": "string",
"description": "The text of the problem"
},
"pointer": {
"type": "string",
"description": "The JSON pointer of the part of the program"
}
},
"required": [
"severity",
"code",
"message",
"pointer"
],
"additionalProperties": false
},
"description": "The problems, in the order of the program"
},
"registryHash": {
"type": "string",
"description": "The hash of the manifest that the check used"
},
"calls": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "The key of the procedure: its path with dots"
},
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "The path of the procedure"
},
"pointer": {
"type": "string",
"description": "The JSON pointer of the call in the program"
},
"kind": {
"type": "string",
"enum": [
"call",
"control",
"dynamic"
],
"description": "call, a control-flow call, or a dynamic call whose input is a program"
},
"effects": {
"type": "object",
"properties": {
"reads": {
"description": "The resources that the procedure can read. Absent: not declared.",
"type": "array",
"items": {
"type": "string"
}
},
"writes": {
"description": "The resources that the procedure can change. Absent: not declared.",
"type": "array",
"items": {
"type": "string"
}
},
"destructive": {
"description": "True: the procedure can delete or overwrite data",
"type": "boolean"
},
"idempotent": {
"description": "True: a second call with the same input changes nothing more",
"type": "boolean"
}
},
"additionalProperties": false,
"description": "The effects that the procedure declares. Absent: the procedure declares none."
},
"known": {
"type": "boolean",
"description": "True when the host has a procedure at the path"
},
"exposed": {
"type": "boolean",
"description": "True when the host has the procedure and lets a program call it"
},
"permitted": {
"type": "boolean",
"description": "True when the capability permits the call"
},
"reason": {
"description": "The reason of a refusal, or not-found for a path without a procedure",
"type": "string",
"enum": [
"effects-undeclared",
"effects-exceeded",
"clearance",
"deadline",
"not-found"
]
},
"message": {
"type": "string",
"description": "The answer of the capability in words"
}
},
"required": [
"key",
"path",
"pointer",
"kind",
"known",
"exposed",
"permitted",
"message"
],
"additionalProperties": false
},
"description": "The calls of the program, in the order of the tree: a call comes before the calls of its input"
},
"summary": {
"type": "string",
"description": "The explanation in short sentences"
}
},
"required": [
"ok",
"effects",
"mustEffects",
"diagnostics",
"registryHash",
"calls",
"summary"
],
"additionalProperties": false
}
}