diff --git a/health-and-repair/go/seats/meshconditions/contract.go b/health-and-repair/go/seats/meshconditions/contract.go index 7406782..73984b6 100644 --- a/health-and-repair/go/seats/meshconditions/contract.go +++ b/health-and-repair/go/seats/meshconditions/contract.go @@ -276,6 +276,78 @@ type Subject struct { Scope string `json:"scope"` } +// Finding is one finding as an observer says it: the layout whole, plus scope, id and since (design 47 G 437, 439). +type Finding struct { + Actions []Action `json:"actions,omitempty"` + At time.Time `json:"at"` + // newest first, at most 10 + Evidence []Evidence `json:"evidence,omitempty"` + Explanation string `json:"explanation,omitempty"` + Headline string `json:"headline,omitempty"` + // the key's second part + ID string `json:"id"` + Kind string `json:"kind"` + Needs string `json:"needs,omitempty"` + // the module that wrote it + Observer string `json:"observer"` + // the module the finding is about, when not the observer + Owner string `json:"owner,omitempty"` + // the key's last part when it is not the kind + Ref string `json:"ref,omitempty"` + // self, operator, agent or healer: + Resolver string `json:"resolver,omitempty"` + // what of its own saw it last + Run string `json:"run,omitempty"` + // the key's first part: .. (ADR 0564) + Scope string `json:"scope"` + Severity string `json:"severity"` + // since when the finding stands + Since time.Time `json:"since"` + // the row, probe or event that saw it + Source string `json:"source"` + Subject Subject `json:"subject"` + // one line + Summary string `json:"summary"` + // what it waits on: a person, a part or a call + WaitingOn string `json:"waiting-on,omitempty"` +} + +// The values of Finding's severity. +const ( + FindingSeverityUrgent = "urgent" + FindingSeverityWarning = "warning" +) + +// FindingCleared is an observer no longer observes a finding. +type FindingCleared struct { + At time.Time `json:"at"` + ID string `json:"id"` + Kind string `json:"kind"` + Scope string `json:"scope"` + Why string `json:"why"` +} + +// FindingWritten is a type of the contract. +type FindingWritten = Finding + +// FindingsStatedPendingItem is a type of the contract. +type FindingsStatedPendingItem struct { + // a duration such as 5m + Bound string `json:"bound"` + Key string `json:"key"` + Since time.Time `json:"since"` +} + +// FindingsStated is every finding an observer observes now, at its start and when asked (design 47 G 384, 439). +type FindingsStated struct { + // the ask it answers; none at a start + Asked string `json:"asked,omitempty"` + At time.Time `json:"at"` + Findings []Finding `json:"findings"` + // the keys the observer cannot judge yet since its start, with their since and bound + Pending []FindingsStatedPendingItem `json:"pending"` +} + // ConditionsInput is what conditions takes. type ConditionsInput struct { // with history: how many days back (default 7, at most 90) @@ -448,8 +520,8 @@ const ( // FindingsViewsByObserverNodeValueStated is the last findings-stated set. type FindingsViewsByObserverNodeValueStated struct { - At *time.Time `json:"at,omitempty"` - Findings []map[string]any `json:"findings,omitempty"` + At *time.Time `json:"at,omitempty"` + Findings []Finding `json:"findings,omitempty"` } // FindingsViewsByObserverNodeValue is one value of the state findings-views under the key .. diff --git a/health-and-repair/module.json b/health-and-repair/module.json index db73ae1..9dc4693 100644 --- a/health-and-repair/module.json +++ b/health-and-repair/module.json @@ -56,6 +56,14 @@ "go/clients/meshhandactsclient" ] }, + { + "name": "go-meshwatchdogsclient", + "kind": "package", + "language": "go", + "paths": [ + "go/clients/meshwatchdogsclient" + ] + }, { "name": "go-meshconditionsclient", "kind": "package", diff --git a/health-and-repair/ts/seats/meshconditions/index.d.ts b/health-and-repair/ts/seats/meshconditions/index.d.ts index 1366690..3cebb90 100644 --- a/health-and-repair/ts/seats/meshconditions/index.d.ts +++ b/health-and-repair/ts/seats/meshconditions/index.d.ts @@ -140,6 +140,70 @@ export interface Subject { "scope": string; } +/** one finding as an observer says it: the layout whole, plus scope, id and since (design 47 G 437, 439) */ +export interface Finding { + "actions"?: Action[]; + "at": string; + /** newest first, at most 10 */ + "evidence"?: Evidence[]; + "explanation"?: string; + "headline"?: string; + /** the key's second part */ + "id": string; + "kind": string; + "needs"?: string; + /** the module that wrote it */ + "observer": string; + /** the module the finding is about, when not the observer */ + "owner"?: string; + /** the key's last part when it is not the kind */ + "ref"?: string; + /** self, operator, agent or healer: */ + "resolver"?: string; + /** what of its own saw it last */ + "run"?: string; + /** the key's first part: .. (ADR 0564) */ + "scope": string; + "severity": "urgent" | "warning"; + /** since when the finding stands */ + "since": string; + /** the row, probe or event that saw it */ + "source": string; + "subject": Subject; + /** one line */ + "summary": string; + /** what it waits on: a person, a part or a call */ + "waiting-on"?: string; +} + +/** an observer no longer observes a finding */ +export interface FindingCleared { + "at": string; + "id": string; + "kind": string; + "scope": string; + "why": string; +} + +export type FindingWritten = Finding; + +export interface FindingsStatedPendingItem { + /** a duration such as 5m */ + "bound": string; + "key": string; + "since": string; +} + +/** every finding an observer observes now, at its start and when asked (design 47 G 384, 439) */ +export interface FindingsStated { + /** the ask it answers; none at a start */ + "asked"?: string; + "at": string; + "findings": Finding[]; + /** the keys the observer cannot judge yet since its start, with their since and bound */ + "pending": FindingsStatedPendingItem[]; +} + /** is what conditions takes. */ export interface ConditionsInput { /** with history: how many days back (default 7, at most 90) */ @@ -292,7 +356,7 @@ export interface FindingsByKeyValue { /** the last findings-stated set */ export interface FindingsViewsByObserverNodeValueStated { "at"?: string; - "findings"?: Record[]; + "findings"?: Finding[]; } /** is one value of the state findings-views under the key .. */ diff --git a/health-and-repair/ts/seats/meshconditions/tsconfig.json b/health-and-repair/ts/seats/meshconditions/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/health-and-repair/ts/seats/meshconditions/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/health-and-repair/ts/seats/meshhandacts/tsconfig.json b/health-and-repair/ts/seats/meshhandacts/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/health-and-repair/ts/seats/meshhandacts/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/health-and-repair/ts/seats/meshhealers/tsconfig.json b/health-and-repair/ts/seats/meshhealers/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/health-and-repair/ts/seats/meshhealers/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/health-and-repair/ts/seats/meshselfcheck/tsconfig.json b/health-and-repair/ts/seats/meshselfcheck/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/health-and-repair/ts/seats/meshselfcheck/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/health-and-repair/ts/seats/meshwatchdogs/tsconfig.json b/health-and-repair/ts/seats/meshwatchdogs/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/health-and-repair/ts/seats/meshwatchdogs/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/identity-and-access/ts/seats/meshnodeenroller/tsconfig.json b/identity-and-access/ts/seats/meshnodeenroller/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/identity-and-access/ts/seats/meshnodeenroller/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/identity-and-access/ts/seats/meshvault/tsconfig.json b/identity-and-access/ts/seats/meshvault/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/identity-and-access/ts/seats/meshvault/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/operator-and-conversation/ts/seats/operatorchannel/tsconfig.json b/operator-and-conversation/ts/seats/operatorchannel/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/operator-and-conversation/ts/seats/operatorchannel/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/provisioning/ts/seats/meshprovisioner/tsconfig.json b/provisioning/ts/seats/meshprovisioner/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/provisioning/ts/seats/meshprovisioner/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/ts/seats/meshbroker/tsconfig.json b/ts/seats/meshbroker/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/ts/seats/meshbroker/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/ts/seats/meshconfig/tsconfig.json b/ts/seats/meshconfig/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/ts/seats/meshconfig/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/ts/seats/meshmoduleassigner/tsconfig.json b/ts/seats/meshmoduleassigner/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/ts/seats/meshmoduleassigner/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -} diff --git a/ts/seats/nodeengine/tsconfig.json b/ts/seats/nodeengine/tsconfig.json deleted file mode 100644 index 60274c6..0000000 --- a/ts/seats/nodeengine/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "noEmit": true, - "strict": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": ["src/**/*.ts"] -}