@bluewombat/runtime 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +84 -7
  2. package/SPECS.md +55 -9
  3. package/dist/cli.js +63 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config/load-config.d.ts.map +1 -1
  6. package/dist/config/load-config.js +2 -1
  7. package/dist/config/load-config.js.map +1 -1
  8. package/dist/config/types.d.ts +7 -0
  9. package/dist/config/types.d.ts.map +1 -1
  10. package/dist/loop/authority.d.ts +2 -0
  11. package/dist/loop/authority.d.ts.map +1 -1
  12. package/dist/loop/authority.js +11 -1
  13. package/dist/loop/authority.js.map +1 -1
  14. package/dist/loop/deliveries.d.ts.map +1 -1
  15. package/dist/loop/deliveries.js +19 -0
  16. package/dist/loop/deliveries.js.map +1 -1
  17. package/dist/loop/features.d.ts +14 -0
  18. package/dist/loop/features.d.ts.map +1 -1
  19. package/dist/loop/features.js +78 -35
  20. package/dist/loop/features.js.map +1 -1
  21. package/dist/loop/journal.d.ts +7 -0
  22. package/dist/loop/journal.d.ts.map +1 -1
  23. package/dist/loop/journal.js +23 -1
  24. package/dist/loop/journal.js.map +1 -1
  25. package/dist/loop/lock.d.ts +2 -0
  26. package/dist/loop/lock.d.ts.map +1 -1
  27. package/dist/loop/lock.js +10 -0
  28. package/dist/loop/lock.js.map +1 -1
  29. package/dist/loop/run-slot.d.ts +14 -0
  30. package/dist/loop/run-slot.d.ts.map +1 -1
  31. package/dist/loop/run-slot.js +53 -5
  32. package/dist/loop/run-slot.js.map +1 -1
  33. package/dist/loop/streams.js +2 -2
  34. package/dist/loop/streams.js.map +1 -1
  35. package/dist/loop/tick.d.ts.map +1 -1
  36. package/dist/loop/tick.js +2 -1
  37. package/dist/loop/tick.js.map +1 -1
  38. package/dist/loop/transformers.d.ts.map +1 -1
  39. package/dist/loop/transformers.js +5 -3
  40. package/dist/loop/transformers.js.map +1 -1
  41. package/dist/operator/dash-model.d.ts +65 -0
  42. package/dist/operator/dash-model.d.ts.map +1 -0
  43. package/dist/operator/dash-model.js +209 -0
  44. package/dist/operator/dash-model.js.map +1 -0
  45. package/dist/operator/dash-view.d.ts +16 -0
  46. package/dist/operator/dash-view.d.ts.map +1 -0
  47. package/dist/operator/dash-view.js +226 -0
  48. package/dist/operator/dash-view.js.map +1 -0
  49. package/dist/operator/dash.d.ts +34 -0
  50. package/dist/operator/dash.d.ts.map +1 -0
  51. package/dist/operator/dash.js +141 -0
  52. package/dist/operator/dash.js.map +1 -0
  53. package/dist/operator/doctor.d.ts.map +1 -1
  54. package/dist/operator/doctor.js +44 -1
  55. package/dist/operator/doctor.js.map +1 -1
  56. package/dist/operator/incident-dossier.d.ts +4 -4
  57. package/dist/operator/incident-dossier.d.ts.map +1 -1
  58. package/dist/operator/incident-dossier.js +14 -18
  59. package/dist/operator/incident-dossier.js.map +1 -1
  60. package/dist/operator/incident-system.d.ts +13 -4
  61. package/dist/operator/incident-system.d.ts.map +1 -1
  62. package/dist/operator/incident-system.js +68 -6
  63. package/dist/operator/incident-system.js.map +1 -1
  64. package/dist/operator/install.d.ts +9 -0
  65. package/dist/operator/install.d.ts.map +1 -0
  66. package/dist/operator/install.js +14 -0
  67. package/dist/operator/install.js.map +1 -0
  68. package/dist/operator/supervise/act.d.ts +37 -0
  69. package/dist/operator/supervise/act.d.ts.map +1 -0
  70. package/dist/operator/supervise/act.js +354 -0
  71. package/dist/operator/supervise/act.js.map +1 -0
  72. package/dist/operator/supervise/config.d.ts +74 -0
  73. package/dist/operator/supervise/config.d.ts.map +1 -0
  74. package/dist/operator/supervise/config.js +175 -0
  75. package/dist/operator/supervise/config.js.map +1 -0
  76. package/dist/operator/supervise/council.d.ts +45 -0
  77. package/dist/operator/supervise/council.d.ts.map +1 -0
  78. package/dist/operator/supervise/council.js +97 -0
  79. package/dist/operator/supervise/council.js.map +1 -0
  80. package/dist/operator/supervise/decision.d.ts +46 -0
  81. package/dist/operator/supervise/decision.d.ts.map +1 -0
  82. package/dist/operator/supervise/decision.js +137 -0
  83. package/dist/operator/supervise/decision.js.map +1 -0
  84. package/dist/operator/supervise/exec.d.ts +28 -0
  85. package/dist/operator/supervise/exec.d.ts.map +1 -0
  86. package/dist/operator/supervise/exec.js +47 -0
  87. package/dist/operator/supervise/exec.js.map +1 -0
  88. package/dist/operator/supervise/memory.d.ts +33 -0
  89. package/dist/operator/supervise/memory.d.ts.map +1 -0
  90. package/dist/operator/supervise/memory.js +73 -0
  91. package/dist/operator/supervise/memory.js.map +1 -0
  92. package/dist/operator/supervise/observe.d.ts +47 -0
  93. package/dist/operator/supervise/observe.d.ts.map +1 -0
  94. package/dist/operator/supervise/observe.js +73 -0
  95. package/dist/operator/supervise/observe.js.map +1 -0
  96. package/dist/operator/supervise/prompts.d.ts +60 -0
  97. package/dist/operator/supervise/prompts.d.ts.map +1 -0
  98. package/dist/operator/supervise/prompts.js +338 -0
  99. package/dist/operator/supervise/prompts.js.map +1 -0
  100. package/dist/operator/supervise/review.d.ts +24 -0
  101. package/dist/operator/supervise/review.d.ts.map +1 -0
  102. package/dist/operator/supervise/review.js +51 -0
  103. package/dist/operator/supervise/review.js.map +1 -0
  104. package/dist/operator/supervise/supervise.d.ts +26 -0
  105. package/dist/operator/supervise/supervise.d.ts.map +1 -0
  106. package/dist/operator/supervise/supervise.js +484 -0
  107. package/dist/operator/supervise/supervise.js.map +1 -0
  108. package/package.json +14 -14
@@ -0,0 +1,28 @@
1
+ export type ExecResult = {
2
+ /** Null when the command never ran or was cut at its ceiling. */
3
+ code: number | null;
4
+ stdout: string;
5
+ stderr: string;
6
+ /** Milliseconds the clock ran while the supervisor did not (machine asleep, paused). */
7
+ suspendedMs?: number;
8
+ /** The ceiling ended it; what it wrote before is in `stdout`. */
9
+ atCeiling?: boolean;
10
+ /** Why it did not run to its end, when it did not. */
11
+ error?: string;
12
+ };
13
+ export type Exec = (cmd: string[], options: {
14
+ cwd?: string;
15
+ timeoutMs: number;
16
+ }) => Promise<ExecResult>;
17
+ /** The supervisor's one way to start anything: a command, a ceiling, a result. Never throws. */
18
+ export declare const exec: Exec;
19
+ /**
20
+ * Replace `{name}` in each word of a command. A name nobody gave stays as
21
+ * written. A word that is only `{name}` and names a list becomes that list's
22
+ * words, so `{addDirArgs}` can stand for any number of `--add-dir X` pairs.
23
+ */
24
+ export declare function fill(cmd: string[], vars: Record<string, string>, lists?: Record<string, string[]>): string[];
25
+ export declare function succeeded(result: ExecResult): boolean;
26
+ /** What a failed command said, cut to what a reader needs. */
27
+ export declare function tail(result: ExecResult, chars?: number): string;
28
+ //# sourceMappingURL=exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/exec.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACvB,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,CACjB,GAAG,EAAE,MAAM,EAAE,EACb,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KACzC,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzB,gGAAgG;AAChG,eAAO,MAAM,IAAI,EAAE,IAmBlB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAM,GACnC,MAAM,EAAE,CAQV;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAErD;AAED,8DAA8D;AAC9D,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,SAAO,GAAG,MAAM,CAK7D"}
@@ -0,0 +1,47 @@
1
+ import { runSlot } from "../../loop/run-slot.js";
2
+ /** The supervisor's one way to start anything: a command, a ceiling, a result. Never throws. */
3
+ export const exec = async (cmd, options) => {
4
+ const [command, ...args] = cmd;
5
+ if (command === undefined) {
6
+ return { code: null, stdout: "", stderr: "", error: "empty command" };
7
+ }
8
+ const run = await runSlot({
9
+ command,
10
+ args,
11
+ ...(options.cwd === undefined ? {} : { cwd: options.cwd }),
12
+ timeoutMs: options.timeoutMs,
13
+ });
14
+ return {
15
+ code: run.status,
16
+ stdout: run.stdout,
17
+ stderr: run.stderr,
18
+ ...(run.atCeiling ? { atCeiling: true } : {}),
19
+ ...(run.suspendedMs > 0 ? { suspendedMs: run.suspendedMs } : {}),
20
+ ...(run.error === undefined ? {} : { error: run.error.message }),
21
+ };
22
+ };
23
+ /**
24
+ * Replace `{name}` in each word of a command. A name nobody gave stays as
25
+ * written. A word that is only `{name}` and names a list becomes that list's
26
+ * words, so `{addDirArgs}` can stand for any number of `--add-dir X` pairs.
27
+ */
28
+ export function fill(cmd, vars, lists = {}) {
29
+ return cmd.flatMap((word) => {
30
+ const whole = /^\{(\w+)\}$/.exec(word)?.[1];
31
+ if (whole !== undefined && lists[whole] !== undefined) {
32
+ return lists[whole];
33
+ }
34
+ return [word.replace(/\{(\w+)\}/g, (all, name) => vars[name] ?? all)];
35
+ });
36
+ }
37
+ export function succeeded(result) {
38
+ return result.code === 0 && result.error === undefined;
39
+ }
40
+ /** What a failed command said, cut to what a reader needs. */
41
+ export function tail(result, chars = 4000) {
42
+ const text = [result.error, result.stderr, result.stdout]
43
+ .filter((part) => part !== undefined && part.length > 0)
44
+ .join("\n");
45
+ return text.length > chars ? `…${text.slice(-chars)}` : text;
46
+ }
47
+ //# sourceMappingURL=exec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/operator/supervise/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAoBjD,gGAAgG;AAChG,MAAM,CAAC,MAAM,IAAI,GAAS,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IAC/C,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC;IAC/B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;IACxE,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC;QACxB,OAAO;QACP,IAAI;QACJ,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1D,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,MAAM;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CA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AC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,33 @@
1
+ /** What the supervisor did about one subject, so that it does not do it forever. */
2
+ export type Entry = {
3
+ attempts: number;
4
+ /** The last thing seen, as `observe` fingerprints it. */
5
+ fingerprint: string;
6
+ lastAt: number;
7
+ /** Handed to a person: nothing more is tried until the subject changes or ends. */
8
+ human: boolean;
9
+ /** One line each: what was decided and how it went. Fed back to the next council. */
10
+ history: string[];
11
+ };
12
+ export type Memory = {
13
+ entries: Record<string, Entry>;
14
+ };
15
+ export declare function loadMemory(dir: string): Memory;
16
+ export declare function saveMemory(dir: string, memory: Memory): void;
17
+ /** Append-only film of what the supervisor saw and did. Not truth: the ledger is. */
18
+ export declare function note(dir: string, line: Record<string, unknown>, now?: () => Date): void;
19
+ /**
20
+ * Whether this finding is the supervisor's to handle now.
21
+ *
22
+ * Not while a person holds it. Not while what it did last time may still be
23
+ * taking effect (the same thing seen again inside the cooldown). A different
24
+ * fingerprint is a different problem and starts again at the cost already paid.
25
+ */
26
+ export declare function due(entry: Entry | undefined, fingerprint: string, now: number, cooldownMs: number): boolean;
27
+ export declare function spent(entry: Entry | undefined, maxAttempts: number): boolean;
28
+ /** Take one attempt at `subject`. */
29
+ export declare function attempt(memory: Memory, subject: string, fingerprint: string, now: number): Entry;
30
+ export declare function remember(entry: Entry, line: string): void;
31
+ /** Forget what was kept of a subject that reached an end. */
32
+ export declare function forgetKeys(memory: Memory, keys: string[]): void;
33
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/memory.ts"],"names":[],"mappings":"AAGA,oFAAoF;AACpF,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,KAAK,EAAE,OAAO,CAAC;IACf,qFAAqF;IACrF,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;CAAE,CAAC;AAIxD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAK5D;AAED,qFAAqF;AACrF,wBAAgB,IAAI,CAClB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,GAAE,MAAM,IAAuB,GACjC,IAAI,CAMN;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAQT;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED,qCAAqC;AACrC,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,CAchG;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAKzD;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAM/D"}
@@ -0,0 +1,73 @@
1
+ import { appendFileSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ const FILE = "memory.json";
4
+ export function loadMemory(dir) {
5
+ try {
6
+ const parsed = JSON.parse(readFileSync(join(dir, FILE), "utf8"));
7
+ return { entries: parsed.entries ?? {} };
8
+ }
9
+ catch {
10
+ return { entries: {} };
11
+ }
12
+ }
13
+ export function saveMemory(dir, memory) {
14
+ mkdirSync(dir, { recursive: true });
15
+ const tmp = join(dir, `${FILE}.tmp`);
16
+ writeFileSync(tmp, `${JSON.stringify(memory, null, 2)}\n`);
17
+ renameSync(tmp, join(dir, FILE));
18
+ }
19
+ /** Append-only film of what the supervisor saw and did. Not truth: the ledger is. */
20
+ export function note(dir, line, now = () => new Date()) {
21
+ mkdirSync(dir, { recursive: true });
22
+ appendFileSync(join(dir, "events.jsonl"), `${JSON.stringify({ ...line, at: now().toISOString() })}\n`);
23
+ }
24
+ /**
25
+ * Whether this finding is the supervisor's to handle now.
26
+ *
27
+ * Not while a person holds it. Not while what it did last time may still be
28
+ * taking effect (the same thing seen again inside the cooldown). A different
29
+ * fingerprint is a different problem and starts again at the cost already paid.
30
+ */
31
+ export function due(entry, fingerprint, now, cooldownMs) {
32
+ if (entry === undefined) {
33
+ return true;
34
+ }
35
+ if (entry.human) {
36
+ return entry.fingerprint !== fingerprint;
37
+ }
38
+ return entry.fingerprint !== fingerprint || now - entry.lastAt >= cooldownMs;
39
+ }
40
+ export function spent(entry, maxAttempts) {
41
+ return entry !== undefined && entry.attempts >= maxAttempts;
42
+ }
43
+ /** Take one attempt at `subject`. */
44
+ export function attempt(memory, subject, fingerprint, now) {
45
+ const entry = memory.entries[subject] ?? {
46
+ attempts: 0,
47
+ fingerprint,
48
+ lastAt: now,
49
+ human: false,
50
+ history: [],
51
+ };
52
+ entry.attempts += 1;
53
+ entry.fingerprint = fingerprint;
54
+ entry.lastAt = now;
55
+ entry.human = false;
56
+ memory.entries[subject] = entry;
57
+ return entry;
58
+ }
59
+ export function remember(entry, line) {
60
+ entry.history.push(line);
61
+ if (entry.history.length > 8) {
62
+ entry.history.splice(0, entry.history.length - 8);
63
+ }
64
+ }
65
+ /** Forget what was kept of a subject that reached an end. */
66
+ export function forgetKeys(memory, keys) {
67
+ for (const subject of Object.keys(memory.entries)) {
68
+ if (keys.some((key) => subject.endsWith(`:${key}`))) {
69
+ delete memory.entries[subject];
70
+ }
71
+ }
72
+ }
73
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/operator/supervise/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBjC,MAAM,IAAI,GAAG,aAAa,CAAC;AAE3B,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAW,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,MAAc;IACpD,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;IACrC,aAAa,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3D,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,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AG,WAAW,CAAC;IAChC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IAChC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAE,IAAY;IACjD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,IAAc;IACvD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAClD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YACpD,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,47 @@
1
+ export type Item = {
2
+ key: string;
3
+ scope: "ticket" | "feature";
4
+ state: string;
5
+ escalation?: {
6
+ report?: string;
7
+ refusedBy?: string;
8
+ at?: number;
9
+ };
10
+ };
11
+ /** What the supervisor can see of a run without asking anyone. */
12
+ export type Snapshot = {
13
+ now: number;
14
+ items: Item[];
15
+ /** The process that holds the ledger, when it is alive. */
16
+ workerPid?: number;
17
+ /** When the journal last grew. */
18
+ journalAt?: number;
19
+ freeBytes?: number;
20
+ /** The supervisor is able to start a worker, so a missing one is its to fix. */
21
+ canStartWorker: boolean;
22
+ };
23
+ export type Thresholds = {
24
+ stallAfterMs: number;
25
+ diskMinBytes: number;
26
+ settleMs: number;
27
+ };
28
+ export type Finding = {
29
+ kind: "escalated" | "stalled" | "worker-down" | "disk-low";
30
+ /** What the memory is keyed by: one per thing that can go wrong in one place. */
31
+ subject: string;
32
+ /** Changes when the thing that went wrong changes. */
33
+ fingerprint: string;
34
+ key?: string;
35
+ scope?: "ticket" | "feature";
36
+ detail: string;
37
+ };
38
+ /**
39
+ * What is wrong, from what can be seen. Pure: no ledger, no clock, no disk.
40
+ *
41
+ * Judging is not done here. A finding says that something needs looking at,
42
+ * and carries enough to tell it from the same thing seen again.
43
+ */
44
+ export declare function observe(snapshot: Snapshot, limits: Thresholds): Finding[];
45
+ /** Keys that reached an end: whatever the supervisor remembered of them is spent. */
46
+ export declare function finished(items: Item[]): string[];
47
+ //# sourceMappingURL=observe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/observe.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,IAAI,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;IAC3D,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAKF;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,EAAE,CAoDzE;AAED,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAEhD"}
@@ -0,0 +1,73 @@
1
+ import { createHash } from "node:crypto";
2
+ const ACTIVE = new Set(["running", "integrating", "submitted", "merging", "open"]);
3
+ const TERMINAL = new Set(["done", "cancelled", "invalid"]);
4
+ /**
5
+ * What is wrong, from what can be seen. Pure: no ledger, no clock, no disk.
6
+ *
7
+ * Judging is not done here. A finding says that something needs looking at,
8
+ * and carries enough to tell it from the same thing seen again.
9
+ */
10
+ export function observe(snapshot, limits) {
11
+ const found = [];
12
+ if (snapshot.workerPid === undefined && snapshot.canStartWorker) {
13
+ found.push({
14
+ kind: "worker-down",
15
+ subject: "worker",
16
+ fingerprint: "worker-down",
17
+ detail: "No process holds the ledger.",
18
+ });
19
+ }
20
+ const active = snapshot.items.filter((item) => ACTIVE.has(item.state));
21
+ if (snapshot.workerPid !== undefined &&
22
+ snapshot.journalAt !== undefined &&
23
+ active.length > 0 &&
24
+ snapshot.now - snapshot.journalAt > limits.stallAfterMs) {
25
+ const minutes = Math.round((snapshot.now - snapshot.journalAt) / 60_000);
26
+ const oldest = active[0];
27
+ found.push({
28
+ kind: "stalled",
29
+ subject: `stalled:${oldest?.key ?? "?"}`,
30
+ fingerprint: `stalled:${active.map((item) => `${item.key}=${item.state}`).join(",")}`,
31
+ ...(oldest === undefined ? {} : { key: oldest.key, scope: oldest.scope }),
32
+ detail: `The journal has been silent for ${minutes} min with ${active.length} active: ${active
33
+ .map((item) => `${item.key} (${item.state})`)
34
+ .join(", ")}.`,
35
+ });
36
+ }
37
+ if (snapshot.freeBytes !== undefined && snapshot.freeBytes < limits.diskMinBytes) {
38
+ found.push({
39
+ kind: "disk-low",
40
+ subject: "disk",
41
+ fingerprint: "disk-low",
42
+ detail: `${(snapshot.freeBytes / 1024 ** 3).toFixed(1)} GiB free, under ${(limits.diskMinBytes / 1024 ** 3).toFixed(1)} GiB.`,
43
+ });
44
+ }
45
+ for (const item of snapshot.items) {
46
+ if (item.state !== "escalated" || youngerThanSettle(item, snapshot.now, limits.settleMs)) {
47
+ continue;
48
+ }
49
+ const report = item.escalation?.report ?? "";
50
+ found.push({
51
+ kind: "escalated",
52
+ subject: `escalated:${item.key}`,
53
+ fingerprint: `escalated:${item.key}:${hash(`${report}|${item.escalation?.at ?? ""}`)}`,
54
+ key: item.key,
55
+ scope: item.scope,
56
+ detail: report.split("\n")[0]?.slice(0, 200) ?? "",
57
+ });
58
+ }
59
+ return found;
60
+ }
61
+ /** Keys that reached an end: whatever the supervisor remembered of them is spent. */
62
+ export function finished(items) {
63
+ return items.filter((item) => TERMINAL.has(item.state)).map((item) => item.key);
64
+ }
65
+ function youngerThanSettle(item, now, settleMs) {
66
+ const at = item.escalation?.at;
67
+ // The ledger's clock is not promised to be epoch milliseconds: only a value that looks like one counts.
68
+ return settleMs > 0 && at !== undefined && at > 1e12 && now - at < settleMs;
69
+ }
70
+ function hash(text) {
71
+ return createHash("sha1").update(text).digest("hex").slice(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AAG,EAAE,GAAG,QAAQ,CAAC;AAC9E,CAAC;AAED,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { Finding } from "./observe.js";
2
+ export type Brief = {
3
+ finding: Finding;
4
+ /** incident.md and incident.json, gathered by `mason incident`. */
5
+ dossierDir?: string;
6
+ configPath?: string;
7
+ ledgerRoot: string;
8
+ /** Where mason's code can be read: the repositories the supervisor may change, and where the Project installed it. */
9
+ codeRoots: string[];
10
+ targets: string[];
11
+ /** The documents where the repositories above write down what they must be (absolute paths). */
12
+ rules: string[];
13
+ /** What was tried on this subject before, and how it went. */
14
+ history: string[];
15
+ };
16
+ export declare function rootcausePrompt(brief: Brief): string;
17
+ export declare function remedyPrompt(brief: Brief): string;
18
+ export declare function skepticPrompt(brief: Brief): string;
19
+ /**
20
+ * The cheap second ask of an arbiter whose answer was refused for its shape:
21
+ * the first answer and the reason, no reports, no code to reread.
22
+ */
23
+ export declare function formPrompt(answer: string, reason: string): string;
24
+ export declare function arbiterPrompt(brief: Brief, reports: Record<string, string>): string;
25
+ export declare function fixerPrompt(input: {
26
+ target: string;
27
+ title: string;
28
+ instruction: string;
29
+ conformity: string;
30
+ /** What the guard could not check before the change existed. */
31
+ deferred?: string[];
32
+ cause: string;
33
+ evidence: string[];
34
+ deny: string[];
35
+ checks: string[];
36
+ failure?: string;
37
+ }): string;
38
+ /**
39
+ * The guard. It is given a change and the repository, never the stop that
40
+ * caused it: it judges the change against the product, not against the problem.
41
+ */
42
+ export declare function reviewerPrompt(input: {
43
+ target: string;
44
+ title: string;
45
+ files: string[];
46
+ diff: string;
47
+ checks: string[];
48
+ }): string;
49
+ /**
50
+ * The guard, before anything is written: it reads the proposal against the rules.
51
+ * The cheapest place to refuse a change that cannot conform is before it is coded.
52
+ */
53
+ export declare function proposalReviewerPrompt(input: {
54
+ target: string;
55
+ title: string;
56
+ instruction: string;
57
+ conformity: string;
58
+ rules: string[];
59
+ }): string;
60
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/operator/supervise/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,sHAAsH;IACtH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gGAAgG;IAChG,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAqDF,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAwBpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA8BjD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAyBlD;AASD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAYjE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAkDnF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;I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