{ "format": 1, "seat": "mesh-conditions", "scope": "mesh", "grain": "whole", "domain": "Health and repair", "decision": "novox/hq ADR 0564, ADR 0634, ADR 0635", "description": "What is wrong with the mesh now (ADR 0564): the open conditions raised from the observers' findings and cleared when a finding goes.", "verbs": [ { "name": "conditions", "description": "What is wrong with the mesh now: every open condition, urgent first, then oldest, raised from the observers' findings (the watchman, the self-check, the healers, the assigner) and cleared when the finding goes, never by hand. Given a key, that one whole with its evidence; with history, every transition lately.", "input": { "properties": { "days": { "description": "with history: how many days back (default 7, at most 90)", "type": "string" }, "history": { "description": "\"true\": every raising, change, silence and clearing lately, oldest first", "enum": [ "true", "false" ], "type": "string" }, "key": { "description": "a condition's key: that one whole; with history, only its transitions", "type": "string" }, "machine": { "description": "only those about this machine", "type": "string" }, "scope": { "description": "only this scope: machine, plan, call, build, merge, provider, seat, bus, core, probe, mesh, delivery or module", "type": "string" }, "severity": { "description": "only urgent, or only warning", "type": "string" } }, "type": "object" }, "answer": { "type": "object", "description": "the open conditions, or one whole, or the history" } }, { "name": "silence", "description": "Stop one condition's messages for a while, a hand act with why: it stays open and in status, and the silence is kept as its transition in history.", "input": { "properties": { "cause": { "description": "the cause in a word (the condition's kind when absent)", "type": "string" }, "for": { "description": "how long: 30m, 4h, 2d; at most 7d", "type": "string" }, "key": { "description": "the condition's key", "type": "string" }, "why": { "description": "why, required and recorded", "type": "string" } }, "required": [ "key", "for", "why" ], "type": "object" }, "answer": { "type": "object", "description": "the condition now silenced" } }, { "name": "resync", "description": "Ask the observers to state their findings again, every one or the one named, and raise and clear what differs from the open conditions: the recovery of a keeper that missed a change. Each call is written in the hand-act log of the seat mesh-hand-acts (design 47 G 390).", "input": { "type": "object", "properties": { "module": { "type": "string", "description": "ask this observer alone; none asks all" } }, "additionalProperties": false }, "answer": { "type": "object", "description": "what was raised and cleared again" }, "class": "act" } ], "events": [ { "name": "condition-raised", "body": { "$ref": "#/defs/ConditionEvent" } }, { "name": "condition-changed", "body": { "$ref": "#/defs/ConditionEvent" } }, { "name": "condition-cleared", "body": { "$ref": "#/defs/ConditionEvent" } }, { "name": "findings-asked", "keep": { "max-age-days": 7, "max-mib": 16 }, "body": { "type": "object", "description": "the keeper asks every observer, or one, to state its findings (design 47 G 384, 390)", "properties": { "ask": { "type": "string", "description": "the ask's id" }, "at": { "type": "string", "format": "date-time" }, "by": { "type": "string", "description": "who asked: the keeper, or the person or session that called resync" }, "module": { "type": "string", "description": "to ask one observer; none asks all" } }, "required": [ "ask", "at", "by" ] } } ], "family": { "name": "mesh-conditions.events", "max-age-days": 7 }, "states": [ { "name": "conditions", "template": "state", "key-forms": [ { "key": "", "value": { "type": "object", "description": "one open condition", "properties": { "key": { "type": "string", "description": "scope.id.token" }, "kind": { "type": "string" }, "subject": { "$ref": "#/defs/Subject" }, "severity": { "type": "string", "enum": [ "urgent", "warning" ] }, "summary": { "type": "string", "description": "one line" }, "headline": { "type": "string" }, "explanation": { "type": "string" }, "resolved": { "type": "string" }, "needs": { "type": "string" }, "actions": { "type": "array", "items": { "$ref": "#/defs/Action" } }, "evidence": { "type": "array", "description": "newest first, at most 10", "items": { "$ref": "#/defs/Evidence" } }, "source": { "type": "string", "description": "the row, probe or event that saw it" }, "resolver": { "type": "string", "description": "self, operator, agent or healer:" }, "owner": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "who the condition is about, taken from the finding or handed to operator-channel by the keeper: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "waiting-on": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "what it waits on, from the finding: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "raised": { "type": "string", "format": "date-time" }, "last-observed": { "type": "string", "format": "date-time" }, "first": { "type": "string", "format": "date-time" }, "gaps": { "type": "array", "items": { "type": "object", "properties": { "cleared": { "type": "string", "format": "date-time" }, "reopened": { "type": "string", "format": "date-time" } } } }, "observations": { "type": "integer" }, "count": { "type": "integer" }, "tried": { "type": "array", "items": { "type": "object", "properties": { "at": { "type": "string", "format": "date-time" }, "what": { "type": "string" }, "outcome": { "type": "string" }, "by": { "type": "string" } } } }, "silenced": { "type": "object", "properties": { "until": { "type": "string", "format": "date-time" }, "by": { "type": "string" }, "why": { "type": "string" }, "since": { "type": "string", "format": "date-time" } } }, "epoch": { "type": "integer" }, "looks-unread": { "type": "string" } }, "required": [ "key", "kind", "subject", "severity", "raised", "last-observed" ] }, "description": "one open condition, without its looks it keeps from its finding" } ], "description": "the open conditions the keeper holds, one key each" }, { "name": "findings", "template": "state", "writer": "caller", "key-forms": [ { "key": "..", "value": { "$ref": "#/bodies/Finding" }, "description": "one finding of the observer that wrote it, its layout the body Finding (design 47 G 439, 461, 660)" } ], "description": "every observer's findings, one key per finding, kept in the observer's own state and read only by its owner's read tool; the keeper hears each change as the observer's events finding-written, finding-cleared and findings-stated (design 47 G 383, 434)" }, { "name": "findings-views", "template": "state", "description": "the keeper's sources: one key per observer and node, its last stated set with its at, its pending keys and the open asks; deleted when the module leaves the catalog or the node (design 47 G 388)", "key-forms": [ { "key": ".", "description": "one observer on one node", "value": { "type": "object", "properties": { "v": { "type": "integer" }, "observer": { "type": "string" }, "node": { "type": "string" }, "stated": { "type": "object", "description": "the last findings-stated set", "properties": { "at": { "type": "string", "format": "date-time" }, "findings": { "type": "array", "items": { "$ref": "#/bodies/Finding" } } } }, "pending": { "type": "array", "items": { "type": "string" }, "description": "the keys it cannot judge yet" }, "asks": { "type": "array", "items": { "type": "string" }, "description": "the open asks" } }, "required": [ "v", "observer", "node" ] } } ] } ], "defs": { "Subject": { "type": "object", "description": "what the condition is about", "properties": { "scope": { "type": "string", "description": "machine, plan, call, build, merge, provider, seat, bus, core, probe, mesh, delivery or module" }, "id": { "type": "string", "description": "its id within the scope" }, "machine": { "type": "string", "description": "the machine it concerns, when there is one" }, "also": { "type": "array", "description": "the other machines it concerns", "items": { "type": "string" } } }, "required": [ "scope", "id" ] }, "Evidence": { "type": "object", "description": "one observation, as it was said", "properties": { "at": { "type": "string", "format": "date-time" }, "said": { "type": "string" } }, "required": [ "at", "said" ] }, "Action": { "type": "object", "description": "one answer the operator may give from a notification", "properties": { "label": { "type": "string" }, "verb": { "type": "string", "description": "the seat verb the operator channel calls" }, "machine": { "type": "string" }, "arguments": { "type": "object", "additionalProperties": { "type": "string" } }, "level": { "type": "string", "enum": [ "acknowledge", "approve" ] } }, "required": [ "label", "verb" ] }, "ConditionEvent": { "type": "object", "description": "a condition and what changed", "properties": { "key": { "type": "string", "description": "scope.id.token" }, "kind": { "type": "string" }, "subject": { "$ref": "#/defs/Subject" }, "severity": { "type": "string", "enum": [ "urgent", "warning" ] }, "summary": { "type": "string", "description": "one line" }, "headline": { "type": "string" }, "explanation": { "type": "string" }, "resolved": { "type": "string" }, "needs": { "type": "string" }, "actions": { "type": "array", "items": { "$ref": "#/defs/Action" } }, "evidence": { "type": "array", "description": "newest first, at most 10", "items": { "$ref": "#/defs/Evidence" } }, "source": { "type": "string", "description": "the row, probe or event that saw it" }, "resolver": { "type": "string", "description": "self, operator, agent or healer:" }, "owner": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "who the condition is about, taken from the finding or handed to operator-channel by the keeper: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "waiting-on": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "what it waits on, from the finding: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "raised": { "type": "string", "format": "date-time" }, "last-observed": { "type": "string", "format": "date-time" }, "first": { "type": "string", "format": "date-time" }, "gaps": { "type": "array", "items": { "type": "object", "properties": { "cleared": { "type": "string", "format": "date-time" }, "reopened": { "type": "string", "format": "date-time" } } } }, "observations": { "type": "integer" }, "count": { "type": "integer" }, "tried": { "type": "array", "items": { "type": "object", "properties": { "at": { "type": "string", "format": "date-time" }, "what": { "type": "string" }, "outcome": { "type": "string" }, "by": { "type": "string" } } } }, "silenced": { "type": "object", "properties": { "until": { "type": "string", "format": "date-time" }, "by": { "type": "string" }, "why": { "type": "string" }, "since": { "type": "string", "format": "date-time" } } }, "epoch": { "type": "integer" }, "looks-unread": { "type": "string" }, "event": { "type": "string" }, "at": { "type": "string", "format": "date-time" }, "change": { "type": "string", "enum": [ "raised", "reopened", "severity", "resolver", "silenced", "silence-ended", "cleared", "words", "owner" ] }, "was": { "type": "string" }, "why": { "type": "string" }, "cleared": { "type": "string", "format": "date-time" }, "show": { "type": "string", "description": "the tool call that shows it" } }, "required": [ "key", "event", "at", "change" ] } }, "bodies": { "Finding": { "type": "object", "description": "one finding as an observer says it: the layout whole, plus scope, id and since (design 47 G 437, 439)", "properties": { "kind": { "type": "string" }, "scope": { "type": "string", "description": "the key's first part: .. (ADR 0564)" }, "id": { "type": "string", "description": "the key's second part" }, "at": { "type": "string", "format": "date-time" }, "since": { "type": "string", "format": "date-time", "description": "since when the finding stands" }, "severity": { "type": "string", "enum": [ "urgent", "warning" ] }, "summary": { "type": "string", "description": "one line" }, "headline": { "type": "string" }, "explanation": { "type": "string" }, "subject": { "$ref": "#/defs/Subject" }, "evidence": { "type": "array", "description": "newest first, at most 10", "items": { "$ref": "#/defs/Evidence" } }, "source": { "type": "string", "description": "the row, probe or event that saw it" }, "observer": { "type": "string", "description": "the module that wrote it" }, "owner": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "who the finding is about, when not the observer: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "waiting-on": { "type": "string", "pattern": "^([a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*|[a-z][a-z0-9-]*|forge:[A-Za-z0-9._-]+)$", "description": "what it waits on: a session who@node (^[a-z0-9][a-z0-9._-]*@[a-z0-9][a-z0-9-]*$), a seat's name (^[a-z][a-z0-9-]*$) or a commit's author forge: (^forge:[A-Za-z0-9._-]+$); another is refused (design 47 G 678)" }, "actions": { "type": "array", "items": { "$ref": "#/defs/Action" } }, "needs": { "type": "string" }, "resolver": { "type": "string", "description": "self, operator, agent or healer:" }, "ref": { "type": "string", "description": "the key's last part when it is not the kind" }, "run": { "type": "string", "description": "what of its own saw it last" } }, "required": [ "kind", "scope", "id", "at", "since", "severity", "summary", "subject", "source", "observer" ] }, "FindingWritten": { "$ref": "#/bodies/Finding" }, "FindingCleared": { "type": "object", "description": "an observer no longer observes a finding", "properties": { "kind": { "type": "string" }, "scope": { "type": "string" }, "id": { "type": "string" }, "at": { "type": "string", "format": "date-time" }, "why": { "type": "string" } }, "required": [ "kind", "scope", "id", "at", "why" ] }, "FindingsStated": { "type": "object", "description": "every finding an observer observes now, at its start and when asked (design 47 G 384, 439)", "properties": { "at": { "type": "string", "format": "date-time" }, "asked": { "type": "string", "description": "the ask it answers; none at a start" }, "kinds": { "type": "array", "items": { "type": "string" }, "description": "the finding kinds the stating bundle owns and states, the only kinds whose keys the statement deletes and whose conditions the keeper clears when it names none of them; none covers every kind, as a part with one bundle states (design 47 G 580)" }, "findings": { "type": "array", "items": { "$ref": "#/bodies/Finding" } }, "pending": { "type": "array", "description": "the keys the observer cannot judge yet since its start, with their since and bound", "items": { "type": "object", "properties": { "key": { "type": "string" }, "since": { "type": "string", "format": "date-time" }, "bound": { "type": "string", "description": "a duration such as 5m" } }, "required": [ "key", "since", "bound" ] } } }, "required": [ "at", "findings", "pending" ] } } }