@vibe-agent-toolkit/cli 0.2.0-rc.4 â 0.2.0-rc.5
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.
- package/dist/bin.js +35 -2
- package/dist/bin.js.map +1 -1
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +23 -5
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/claude/plugin/install.js +0 -1
- package/dist/commands/claude/plugin/install.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +1 -19
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/inventory.js +1 -1
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/resources/check-progress.d.ts +145 -0
- package/dist/commands/resources/check-progress.d.ts.map +1 -0
- package/dist/commands/resources/check-progress.js +205 -0
- package/dist/commands/resources/check-progress.js.map +1 -0
- package/dist/commands/resources/check-supervisor.d.ts +465 -0
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
- package/dist/commands/resources/check-supervisor.js +566 -0
- package/dist/commands/resources/check-supervisor.js.map +1 -0
- package/dist/commands/resources/check.d.ts +454 -0
- package/dist/commands/resources/check.d.ts.map +1 -0
- package/dist/commands/resources/check.js +1237 -0
- package/dist/commands/resources/check.js.map +1 -0
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +277 -6
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query.d.ts +89 -0
- package/dist/commands/resources/query.d.ts.map +1 -0
- package/dist/commands/resources/query.js +146 -0
- package/dist/commands/resources/query.js.map +1 -0
- package/dist/commands/resources/scan.js +1 -1
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/skills/install.js +0 -1
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +4 -2
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/utils/agent-runner.d.ts.map +1 -1
- package/dist/utils/agent-runner.js +7 -3
- package/dist/utils/agent-runner.js.map +1 -1
- package/dist/utils/command-error.d.ts +56 -1
- package/dist/utils/command-error.d.ts.map +1 -1
- package/dist/utils/command-error.js +66 -3
- package/dist/utils/command-error.js.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +10 -3
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/issue-severity.d.ts +12 -5
- package/dist/utils/issue-severity.d.ts.map +1 -1
- package/dist/utils/issue-severity.js +1 -1
- package/dist/utils/issue-severity.js.map +1 -1
- package/dist/utils/projection-query.d.ts +263 -0
- package/dist/utils/projection-query.d.ts.map +1 -0
- package/dist/utils/projection-query.js +262 -0
- package/dist/utils/projection-query.js.map +1 -0
- package/dist/utils/projection-store.d.ts +104 -2
- package/dist/utils/projection-store.d.ts.map +1 -1
- package/dist/utils/projection-store.js +126 -4
- package/dist/utils/projection-store.js.map +1 -1
- package/dist/utils/vat-bin-path.d.ts +36 -0
- package/dist/utils/vat-bin-path.d.ts.map +1 -0
- package/dist/utils/vat-bin-path.js +49 -0
- package/dist/utils/vat-bin-path.js.map +1 -0
- package/package.json +25 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../../src/commands/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../../src/commands/corpus/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,E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AK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,EAAE;QAC7B,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,WAAW,CAAC,CAAC;QAC/D,OAAO,wBAAwB,CAAC;YAC/B,IAAI,EAAE,WAAW;YACjB,YAAY;YACZ,uEAAuE;YACvE,2DAA2D;YAC3D,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC;SAC3D,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAS,uBAAuB,CAC/B,UAAkB;IAElB,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAChD,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,GAAG,EAAE,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The progress log a supervised `vat resources check` writes, and the reader
|
|
3
|
+
* that turns whatever survived into a report.
|
|
4
|
+
*
|
|
5
|
+
* ## ðĻ Why progress goes to a FILE, and never to stdout or IPC
|
|
6
|
+
*
|
|
7
|
+
* The run this log exists for is one that gets `SIGKILL`ed. That is not a design
|
|
8
|
+
* preference: a statement blocked inside synchronous `node:sqlite` never returns
|
|
9
|
+
* to the event loop, so nothing in-process can interrupt it â measured on Node
|
|
10
|
+
* 24.13.1, `worker.terminate()` never resolves against such a thread and the
|
|
11
|
+
* parent's own `process.exit()` does not exit either. An external `SIGKILL` is
|
|
12
|
+
* the only lever, and `SIGKILL` cannot be handled, deferred or flushed.
|
|
13
|
+
*
|
|
14
|
+
* So the child's report of what it has finished has to be DURABLE at every
|
|
15
|
+
* instant, not merely sent. stdout is buffered by the pipe and lost with the
|
|
16
|
+
* process; an IPC message needs a live event loop to be delivered, which is the
|
|
17
|
+
* exact resource the hung child does not have. An `appendFileSync` per unit is
|
|
18
|
+
* on disk before the next unit starts, which is the only property that matters.
|
|
19
|
+
*
|
|
20
|
+
* Keeping it off stdout has a second benefit worth stating: stdout stays the one
|
|
21
|
+
* parseable document this verb has always published, so `vat resources check |
|
|
22
|
+
* jq` is unaffected by a mechanism it should never have to know about.
|
|
23
|
+
*
|
|
24
|
+
* ## ðŠĪ The reader must expect DAMAGE, not merely tolerate it
|
|
25
|
+
*
|
|
26
|
+
* The signal lands wherever it lands, including part-way through a write, so the
|
|
27
|
+
* last line of a killed run's log is routinely half a JSON object. A reader that
|
|
28
|
+
* threw there would replace the bounded failure report with a stack trace at
|
|
29
|
+
* exactly the moment the report is the only thing the operator gets. A reader
|
|
30
|
+
* that GUESSED at a damaged line would be worse still: it would publish a cost
|
|
31
|
+
* record for a measurement nobody took, beside ones somebody did.
|
|
32
|
+
*
|
|
33
|
+
* Every line is therefore validated against a `.strict()` schema and silently
|
|
34
|
+
* dropped when it does not parse. That schema is also the whole of the format
|
|
35
|
+
* contract â there is no version integer here and there must never be one. This
|
|
36
|
+
* file is written and read by ONE process pair within ONE run of ONE build; the
|
|
37
|
+
* question a version integer pretends to answer ("can I read this?") is answered
|
|
38
|
+
* exactly and automatically by the schema the reader compiles with.
|
|
39
|
+
*/
|
|
40
|
+
import { z } from 'zod';
|
|
41
|
+
declare const ProgressEntrySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"population">;
|
|
43
|
+
population: z.ZodUnion<[z.ZodLiteral<"derived">, z.ZodLiteral<"store">]>;
|
|
44
|
+
populationMs: z.ZodNumber;
|
|
45
|
+
membersEnumerated: z.ZodNumber;
|
|
46
|
+
}, "strict", z.ZodTypeAny, {
|
|
47
|
+
kind: "population";
|
|
48
|
+
population: "derived" | "store";
|
|
49
|
+
populationMs: number;
|
|
50
|
+
membersEnumerated: number;
|
|
51
|
+
}, {
|
|
52
|
+
kind: "population";
|
|
53
|
+
population: "derived" | "store";
|
|
54
|
+
populationMs: number;
|
|
55
|
+
membersEnumerated: number;
|
|
56
|
+
}>, z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"start">;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
name: string;
|
|
61
|
+
kind: "start";
|
|
62
|
+
}, {
|
|
63
|
+
name: string;
|
|
64
|
+
kind: "start";
|
|
65
|
+
}>, z.ZodObject<{
|
|
66
|
+
kind: z.ZodLiteral<"check">;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
durationMs: z.ZodNumber;
|
|
69
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
broken: z.ZodOptional<z.ZodLiteral<true>>;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
name: string;
|
|
73
|
+
kind: "check";
|
|
74
|
+
durationMs: number;
|
|
75
|
+
rows?: number | undefined;
|
|
76
|
+
broken?: true | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
name: string;
|
|
79
|
+
kind: "check";
|
|
80
|
+
durationMs: number;
|
|
81
|
+
rows?: number | undefined;
|
|
82
|
+
broken?: true | undefined;
|
|
83
|
+
}>, z.ZodObject<{
|
|
84
|
+
kind: z.ZodLiteral<"checks-complete">;
|
|
85
|
+
}, "strict", z.ZodTypeAny, {
|
|
86
|
+
kind: "checks-complete";
|
|
87
|
+
}, {
|
|
88
|
+
kind: "checks-complete";
|
|
89
|
+
}>]>;
|
|
90
|
+
/** One line of the progress log. */
|
|
91
|
+
export type ProgressEntry = z.infer<typeof ProgressEntrySchema>;
|
|
92
|
+
/**
|
|
93
|
+
* What the run was doing when it was killed.
|
|
94
|
+
*
|
|
95
|
+
* `idle` and `reporting` are both real answers and neither is a fallback.
|
|
96
|
+
* `idle` is the gap between the population and the first statement â nothing had
|
|
97
|
+
* started. `reporting` is the opposite end: every check finished and the child
|
|
98
|
+
* was assembling and serialising its document. Naming a rule in either would
|
|
99
|
+
* blame one that did not hang, and collapsing the two would tell an operator
|
|
100
|
+
* "between the population and the first statement" about a run that completed
|
|
101
|
+
* forty rules.
|
|
102
|
+
*/
|
|
103
|
+
export type UnitInFlight = {
|
|
104
|
+
readonly kind: 'population';
|
|
105
|
+
} | {
|
|
106
|
+
readonly kind: 'check';
|
|
107
|
+
readonly name: string;
|
|
108
|
+
} | {
|
|
109
|
+
readonly kind: 'reporting';
|
|
110
|
+
} | {
|
|
111
|
+
readonly kind: 'idle';
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Read whatever of the log survived.
|
|
115
|
+
*
|
|
116
|
+
* @param text - The log's raw contents, tail damage and all
|
|
117
|
+
* @returns The lines that validate, in the order they were written
|
|
118
|
+
*/
|
|
119
|
+
export declare function parseProgressLog(text: string): ProgressEntry[];
|
|
120
|
+
/**
|
|
121
|
+
* Which unit was running when the log stopped growing.
|
|
122
|
+
*
|
|
123
|
+
* ð The population sentinel is keyed on the population line's ABSENCE rather
|
|
124
|
+
* than on there being no `start` lines. Those are different states: a run killed
|
|
125
|
+
* during population has no projection and no honest document, while a run killed
|
|
126
|
+
* between the population and the first statement has both.
|
|
127
|
+
*
|
|
128
|
+
* @param entries - What {@link parseProgressLog} recovered
|
|
129
|
+
* @returns The unit in flight
|
|
130
|
+
*/
|
|
131
|
+
export declare function unitInFlight(entries: readonly ProgressEntry[]): UnitInFlight;
|
|
132
|
+
/**
|
|
133
|
+
* Open the log for append, and hand back the one-line-per-unit writer.
|
|
134
|
+
*
|
|
135
|
+
* â ïļ `appendFileSync`, and it must stay synchronous. The child that writes these
|
|
136
|
+
* lines is about to enter a blocking native call; an asynchronous write would be
|
|
137
|
+
* queued behind work the event loop never gets back to, so the line naming the
|
|
138
|
+
* rule that hangs would exist only in memory â where `SIGKILL` destroys it.
|
|
139
|
+
*
|
|
140
|
+
* @param path - Where the supervisor is watching
|
|
141
|
+
* @returns A writer that appends one entry and returns once it is on disk
|
|
142
|
+
*/
|
|
143
|
+
export declare function createProgressWriter(path: string): (entry: ProgressEntry) => void;
|
|
144
|
+
export {};
|
|
145
|
+
//# sourceMappingURL=check-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-progress.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/check-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0ExB,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKvB,CAAC;AAEH,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9B;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAQ9D;AAyBD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,YAAY,CAuB5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAKjF"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The progress log a supervised `vat resources check` writes, and the reader
|
|
3
|
+
* that turns whatever survived into a report.
|
|
4
|
+
*
|
|
5
|
+
* ## ðĻ Why progress goes to a FILE, and never to stdout or IPC
|
|
6
|
+
*
|
|
7
|
+
* The run this log exists for is one that gets `SIGKILL`ed. That is not a design
|
|
8
|
+
* preference: a statement blocked inside synchronous `node:sqlite` never returns
|
|
9
|
+
* to the event loop, so nothing in-process can interrupt it â measured on Node
|
|
10
|
+
* 24.13.1, `worker.terminate()` never resolves against such a thread and the
|
|
11
|
+
* parent's own `process.exit()` does not exit either. An external `SIGKILL` is
|
|
12
|
+
* the only lever, and `SIGKILL` cannot be handled, deferred or flushed.
|
|
13
|
+
*
|
|
14
|
+
* So the child's report of what it has finished has to be DURABLE at every
|
|
15
|
+
* instant, not merely sent. stdout is buffered by the pipe and lost with the
|
|
16
|
+
* process; an IPC message needs a live event loop to be delivered, which is the
|
|
17
|
+
* exact resource the hung child does not have. An `appendFileSync` per unit is
|
|
18
|
+
* on disk before the next unit starts, which is the only property that matters.
|
|
19
|
+
*
|
|
20
|
+
* Keeping it off stdout has a second benefit worth stating: stdout stays the one
|
|
21
|
+
* parseable document this verb has always published, so `vat resources check |
|
|
22
|
+
* jq` is unaffected by a mechanism it should never have to know about.
|
|
23
|
+
*
|
|
24
|
+
* ## ðŠĪ The reader must expect DAMAGE, not merely tolerate it
|
|
25
|
+
*
|
|
26
|
+
* The signal lands wherever it lands, including part-way through a write, so the
|
|
27
|
+
* last line of a killed run's log is routinely half a JSON object. A reader that
|
|
28
|
+
* threw there would replace the bounded failure report with a stack trace at
|
|
29
|
+
* exactly the moment the report is the only thing the operator gets. A reader
|
|
30
|
+
* that GUESSED at a damaged line would be worse still: it would publish a cost
|
|
31
|
+
* record for a measurement nobody took, beside ones somebody did.
|
|
32
|
+
*
|
|
33
|
+
* Every line is therefore validated against a `.strict()` schema and silently
|
|
34
|
+
* dropped when it does not parse. That schema is also the whole of the format
|
|
35
|
+
* contract â there is no version integer here and there must never be one. This
|
|
36
|
+
* file is written and read by ONE process pair within ONE run of ONE build; the
|
|
37
|
+
* question a version integer pretends to answer ("can I read this?") is answered
|
|
38
|
+
* exactly and automatically by the schema the reader compiles with.
|
|
39
|
+
*/
|
|
40
|
+
import { appendFileSync } from 'node:fs';
|
|
41
|
+
import { z } from 'zod';
|
|
42
|
+
/**
|
|
43
|
+
* The population finished â how it was obtained, what it cost, and how much of
|
|
44
|
+
* the tree it covered.
|
|
45
|
+
*
|
|
46
|
+
* Written the instant the projection is ready, because a kill BEFORE this line
|
|
47
|
+
* means there is no projection at all and therefore no honest document to
|
|
48
|
+
* publish. The parent distinguishes those two endings by this line's presence
|
|
49
|
+
* and nothing else, so it must never be written early or optimistically.
|
|
50
|
+
*/
|
|
51
|
+
const PopulationEntrySchema = z.object({
|
|
52
|
+
kind: z.literal('population'),
|
|
53
|
+
population: z.union([z.literal('derived'), z.literal('store')]),
|
|
54
|
+
populationMs: z.number(),
|
|
55
|
+
membersEnumerated: z.number(),
|
|
56
|
+
}).strict();
|
|
57
|
+
/**
|
|
58
|
+
* A check's statement is ABOUT to run.
|
|
59
|
+
*
|
|
60
|
+
* The only record that can name the rule that hung: a check which never returns
|
|
61
|
+
* never files a cost, so without this line a killed run could say a check was in
|
|
62
|
+
* flight but not which one â and "one of your forty rules hangs" is not an
|
|
63
|
+
* actionable report.
|
|
64
|
+
*/
|
|
65
|
+
const StartEntrySchema = z.object({
|
|
66
|
+
kind: z.literal('start'),
|
|
67
|
+
name: z.string(),
|
|
68
|
+
}).strict();
|
|
69
|
+
/**
|
|
70
|
+
* A check completed â the same fields `CheckCost` publishes.
|
|
71
|
+
*
|
|
72
|
+
* ðŠĪ `rows` is optional and `broken` is `true`-or-absent, mirroring `CheckCost`
|
|
73
|
+
* exactly: a statement that threw has no row count, and `rows: 0` on it would
|
|
74
|
+
* read as "selected nothing and passed". Keeping the two shapes identical is
|
|
75
|
+
* what lets the parent hand recovered records to the same `buildCheckOutputData`
|
|
76
|
+
* a completed run uses, rather than growing a second payload builder that could
|
|
77
|
+
* drift from it.
|
|
78
|
+
*/
|
|
79
|
+
const CheckEntrySchema = z.object({
|
|
80
|
+
kind: z.literal('check'),
|
|
81
|
+
name: z.string(),
|
|
82
|
+
durationMs: z.number(),
|
|
83
|
+
rows: z.number().optional(),
|
|
84
|
+
broken: z.literal(true).optional(),
|
|
85
|
+
}).strict();
|
|
86
|
+
/**
|
|
87
|
+
* Every check has filed its cost; the document is about to be built.
|
|
88
|
+
*
|
|
89
|
+
* ðĻ **The defect this closes is a run killed AFTER it had its answer.** When
|
|
90
|
+
* the last check files its cost the child is not finished: it still resolves
|
|
91
|
+
* severities and serialises the document, and a document with 5,000 issues is
|
|
92
|
+
* 639 KB of YAML. That phase emitted nothing, so the watchdog's clock kept
|
|
93
|
+
* running from the final cost line and a budget that expired there SIGKILLed a
|
|
94
|
+
* run whose work was complete â a false failure that discards a correct result.
|
|
95
|
+
*
|
|
96
|
+
* One `appendFileSync` buys severity resolution and serialisation a fresh budget
|
|
97
|
+
* window. It carries no fields: the fact that it was written is the whole
|
|
98
|
+
* message.
|
|
99
|
+
*
|
|
100
|
+
* ðŠĪ **Emitted by `runDeclaredChecks`, before it resolves severities.** It first
|
|
101
|
+
* shipped a level up, from `runOutcome` after that function had already
|
|
102
|
+
* returned, which left `resolveIssueSeverity` charged to the last check's window
|
|
103
|
+
* while this comment claimed otherwise. What it still does NOT cover is the last
|
|
104
|
+
* check's row-to-issue conversion â `runChecks` files that check's cost before
|
|
105
|
+
* converting its rows â which is why the report's `idle` sentence hedges.
|
|
106
|
+
*/
|
|
107
|
+
const ChecksCompleteEntrySchema = z.object({
|
|
108
|
+
kind: z.literal('checks-complete'),
|
|
109
|
+
}).strict();
|
|
110
|
+
const ProgressEntrySchema = z.discriminatedUnion('kind', [
|
|
111
|
+
PopulationEntrySchema,
|
|
112
|
+
StartEntrySchema,
|
|
113
|
+
CheckEntrySchema,
|
|
114
|
+
ChecksCompleteEntrySchema,
|
|
115
|
+
]);
|
|
116
|
+
/**
|
|
117
|
+
* Read whatever of the log survived.
|
|
118
|
+
*
|
|
119
|
+
* @param text - The log's raw contents, tail damage and all
|
|
120
|
+
* @returns The lines that validate, in the order they were written
|
|
121
|
+
*/
|
|
122
|
+
export function parseProgressLog(text) {
|
|
123
|
+
const entries = [];
|
|
124
|
+
for (const line of text.split('\n')) {
|
|
125
|
+
if (line.trim() === '')
|
|
126
|
+
continue;
|
|
127
|
+
const entry = readLine(line);
|
|
128
|
+
if (entry !== undefined)
|
|
129
|
+
entries.push(entry);
|
|
130
|
+
}
|
|
131
|
+
return entries;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* One line, or nothing.
|
|
135
|
+
*
|
|
136
|
+
* ðŠĪ Two separate refusals, deliberately: `JSON.parse` throws on the truncated
|
|
137
|
+
* tail, and the schema refuses a well-formed object that is not an entry this
|
|
138
|
+
* build knows. Collapsing them into one `try` around a parse-and-validate would
|
|
139
|
+
* still work, but the two failures mean different things â damage versus drift â
|
|
140
|
+
* and only the second is worth a future reader's attention.
|
|
141
|
+
*
|
|
142
|
+
* @param line - One line of the log
|
|
143
|
+
* @returns The entry, or undefined when the line is damaged or unknown
|
|
144
|
+
*/
|
|
145
|
+
function readLine(line) {
|
|
146
|
+
let value;
|
|
147
|
+
try {
|
|
148
|
+
value = JSON.parse(line);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
const parsed = ProgressEntrySchema.safeParse(value);
|
|
154
|
+
return parsed.success ? parsed.data : undefined;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Which unit was running when the log stopped growing.
|
|
158
|
+
*
|
|
159
|
+
* ð The population sentinel is keyed on the population line's ABSENCE rather
|
|
160
|
+
* than on there being no `start` lines. Those are different states: a run killed
|
|
161
|
+
* during population has no projection and no honest document, while a run killed
|
|
162
|
+
* between the population and the first statement has both.
|
|
163
|
+
*
|
|
164
|
+
* @param entries - What {@link parseProgressLog} recovered
|
|
165
|
+
* @returns The unit in flight
|
|
166
|
+
*/
|
|
167
|
+
export function unitInFlight(entries) {
|
|
168
|
+
if (!entries.some((entry) => entry.kind === 'population'))
|
|
169
|
+
return { kind: 'population' };
|
|
170
|
+
const completed = new Set(entries.filter((entry) => entry.kind === 'check').map((entry) => entry.name));
|
|
171
|
+
// ðŠĪ The `completed` set is what makes this unique, NOT the scan direction.
|
|
172
|
+
// The runner is serial â one statement at a time, its cost filed before the
|
|
173
|
+
// next `start` â so at most one `start` can lack a cost, and a scan from
|
|
174
|
+
// either end reaches the same entry. An earlier version scanned backwards and
|
|
175
|
+
// justified it as "the LAST unfinished start"; reversing it left all 10 unit
|
|
176
|
+
// tests green, which is the honest tell that the direction was never the
|
|
177
|
+
// guard. Dropping the `completed` filter, by contrast, reds immediately.
|
|
178
|
+
const started = entries.find((entry) => entry.kind === 'start' && !completed.has(entry.name));
|
|
179
|
+
if (started !== undefined)
|
|
180
|
+
return { kind: 'check', name: started.name };
|
|
181
|
+
// ð Checked AFTER the in-flight statement, never before. The line means "no
|
|
182
|
+
// check is running any more"; a `start` without a cost means one still is, and
|
|
183
|
+
// a log holding both is damaged in a way that must still name the rule.
|
|
184
|
+
if (entries.some((entry) => entry.kind === 'checks-complete'))
|
|
185
|
+
return { kind: 'reporting' };
|
|
186
|
+
return { kind: 'idle' };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Open the log for append, and hand back the one-line-per-unit writer.
|
|
190
|
+
*
|
|
191
|
+
* â ïļ `appendFileSync`, and it must stay synchronous. The child that writes these
|
|
192
|
+
* lines is about to enter a blocking native call; an asynchronous write would be
|
|
193
|
+
* queued behind work the event loop never gets back to, so the line naming the
|
|
194
|
+
* rule that hangs would exist only in memory â where `SIGKILL` destroys it.
|
|
195
|
+
*
|
|
196
|
+
* @param path - Where the supervisor is watching
|
|
197
|
+
* @returns A writer that appends one entry and returns once it is on disk
|
|
198
|
+
*/
|
|
199
|
+
export function createProgressWriter(path) {
|
|
200
|
+
return (entry) => {
|
|
201
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- a path this process minted for this run
|
|
202
|
+
appendFileSync(path, `${JSON.stringify(entry)}\n`, 'utf-8');
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=check-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-progress.js","sourceRoot":"","sources":["../../../src/commands/resources/check-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,U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