@memnexus-ai/mx-agent-cli 0.1.230 → 0.1.232
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/__tests__/doctor.test.d.ts +20 -0
- package/dist/__tests__/doctor.test.d.ts.map +1 -0
- package/dist/__tests__/doctor.test.js +849 -0
- package/dist/__tests__/doctor.test.js.map +1 -0
- package/dist/__tests__/fleet-data.test.d.ts +2 -0
- package/dist/__tests__/fleet-data.test.d.ts.map +1 -0
- package/dist/__tests__/fleet-data.test.js +340 -0
- package/dist/__tests__/fleet-data.test.js.map +1 -0
- package/dist/__tests__/fleet-tmux.test.d.ts +2 -0
- package/dist/__tests__/fleet-tmux.test.d.ts.map +1 -0
- package/dist/__tests__/fleet-tmux.test.js +242 -0
- package/dist/__tests__/fleet-tmux.test.js.map +1 -0
- package/dist/__tests__/worker-cap.test.d.ts +14 -0
- package/dist/__tests__/worker-cap.test.d.ts.map +1 -0
- package/dist/__tests__/worker-cap.test.js +97 -0
- package/dist/__tests__/worker-cap.test.js.map +1 -0
- package/dist/agent-config/agents/implementation-engineer.md +8 -0
- package/dist/agent-config/agents/qa-tester.md +13 -5
- package/dist/agent-config/shared/eval-tiered-rigor.md +4 -2
- package/dist/agent-config/skills/mx-pre-pr-check/SKILL.md +4 -0
- package/dist/commands/doctor.d.ts +203 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +688 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/fleet-tmux.d.ts +68 -0
- package/dist/commands/fleet-tmux.d.ts.map +1 -0
- package/dist/commands/fleet-tmux.js +288 -0
- package/dist/commands/fleet-tmux.js.map +1 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +36 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/fleet-data.d.ts +181 -0
- package/dist/lib/fleet-data.d.ts.map +1 -0
- package/dist/lib/fleet-data.js +375 -0
- package/dist/lib/fleet-data.js.map +1 -0
- package/dist/lib/fleet-render.d.ts +66 -0
- package/dist/lib/fleet-render.d.ts.map +1 -0
- package/dist/lib/fleet-render.js +184 -0
- package/dist/lib/fleet-render.js.map +1 -0
- package/dist/lib/tmux.d.ts +69 -0
- package/dist/lib/tmux.d.ts.map +1 -0
- package/dist/lib/tmux.js +115 -0
- package/dist/lib/tmux.js.map +1 -0
- package/dist/lib/vm-health.d.ts +562 -0
- package/dist/lib/vm-health.d.ts.map +1 -0
- package/dist/lib/vm-health.js +960 -0
- package/dist/lib/vm-health.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vm-health.ts — measured VM performance state for `mx-agent doctor` (#4498).
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS
|
|
5
|
+
* Per the 2026-07-24 post-mortem (MemNexus memory
|
|
6
|
+
* 70123fe2-44f1-4a76-b18f-cf527d71b59f, KI-WSL2-SWAP-EVICTS-VSCODE — these
|
|
7
|
+
* figures are quoted from it, not re-measured), the WSL2 VM took nine OOM kills
|
|
8
|
+
* between 22:59 and 23:56 UTC (node processes at ~1.3 GB anon-rss each),
|
|
9
|
+
* exhausted its 8 GiB swap (SwapFree reached 0 kB), and evicted the VS Code
|
|
10
|
+
* server family — fileWatcher 387 MB, extensionHost 210 MB, server-main 79 MB —
|
|
11
|
+
* into swap, leaving 3.4 GB swapped out. Linux does not page an idle process
|
|
12
|
+
* back proactively, so the editor stayed swapped out and keystrokes lagged for
|
|
13
|
+
* ~2 days. Diagnosing it took a manual post-mortem because nothing measured the
|
|
14
|
+
* VM's state.
|
|
15
|
+
*
|
|
16
|
+
* The root cause is host-side: WSL2 page reporting and auto memory reclaim hand
|
|
17
|
+
* idle guest pages back to Windows. The container cannot fix it — `/proc/sys` is
|
|
18
|
+
* read-only here, `swapoff` needs CAP_SYS_ADMIN, and `/mnt/c` is not mounted so
|
|
19
|
+
* `%UserProfile%\.wslconfig` is unreachable. What the container CAN do is detect
|
|
20
|
+
* the condition and name the remedy. That is this module's whole job.
|
|
21
|
+
*
|
|
22
|
+
* DESIGN CONTRACT
|
|
23
|
+
* 1. PURE PARSERS over text fixtures are exported and unit-tested against fixture
|
|
24
|
+
* strings — never against live system state.
|
|
25
|
+
* 2. COLLECTORS are thin wrappers that read one path and hand the text to a
|
|
26
|
+
* parser. Every collector returns `Collected<T>`; a failure yields
|
|
27
|
+
* `{ value: null, error }` so the check can print "unavailable" with the
|
|
28
|
+
* reason instead of crashing or inventing a number.
|
|
29
|
+
* 3. NO ESTIMATES. Every number rendered comes from a file we read this run.
|
|
30
|
+
* 4. CHEAP BY DEFAULT. The default path uses single reads of /proc/meminfo and
|
|
31
|
+
* /proc/vmstat plus statfs. It never walks /proc/<pid>/* across hundreds of
|
|
32
|
+
* PIDs — that allocates and syscalls under exactly the memory pressure being
|
|
33
|
+
* measured. Per-process work is either deferred to --verbose (see
|
|
34
|
+
* collectProcesses) or ENFORCED to at most MAX_BOUNDED_PIDS entries. The
|
|
35
|
+
* enforcement matters: a pgrep match count is an environmental assumption,
|
|
36
|
+
* not a bound, and this path runs at every session start on every team.
|
|
37
|
+
* 5. THE DELTA STORE IS UNTRUSTED CROSS-TEAM INPUT.
|
|
38
|
+
* `~/.mx-agent/doctor-last-reading/*.json` sits in the shared $HOME, OUTSIDE
|
|
39
|
+
* every worktree, and every agent team on this machine runs as the same uid.
|
|
40
|
+
* Any process on the box can write it. Its values are turned into text that
|
|
41
|
+
* is printed into agent context at session start, fleet-wide, so a malicious
|
|
42
|
+
* reading is a prompt-injection and terminal-escape channel. Treat anything
|
|
43
|
+
* read from that file exactly as this project treats any other cross-team
|
|
44
|
+
* content: as DATA, validated before use, never as trusted state. See
|
|
45
|
+
* loadLastReading — do not relax its validation, and do not add a field to
|
|
46
|
+
* DoctorReading without extending it.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* The exact `%UserProfile%\.wslconfig` settings block, printed VERBATIM when the
|
|
50
|
+
* swap or OOM condition is present. Single source of truth: the annotated
|
|
51
|
+
* shipped file `dev-tools/wsl/wslconfig-recommended.ini` must contain every one
|
|
52
|
+
* of these lines (enforced by doctor.test.ts), so the two cannot drift.
|
|
53
|
+
*
|
|
54
|
+
* WHY swap=4GB AND NOT swap=0 — this is the part a future reader will want to
|
|
55
|
+
* "helpfully" change, so it is written down here as well as in the README. The
|
|
56
|
+
* nine OOM kills the post-mortem recorded on 2026-07-24 happened WITH 8 GiB of
|
|
57
|
+
* swap present, and that swap was driven to SwapFree=0. (The 8 GiB is one figure
|
|
58
|
+
* we did re-confirm: /proc/meminfo still reported SwapTotal 8.0 GiB on
|
|
59
|
+
* 2026-07-25.) Swap existing was not the fault; swap being
|
|
60
|
+
* both too small to absorb the spike and large enough to host a long thrash was.
|
|
61
|
+
* Setting swap=0 deletes the kernel's pressure-relief buffer and makes OOM kills
|
|
62
|
+
* arrive SOONER — it trades the product owner's editor freezing for agent
|
|
63
|
+
* sessions being killed mid-write with unsaved work lost. That is the worse
|
|
64
|
+
* trade. 4 GiB is a deliberately smaller buffer: enough to absorb a transient
|
|
65
|
+
* spike, not enough to sustain a long thrash.
|
|
66
|
+
*
|
|
67
|
+
* The settings that actually address the documented root cause are
|
|
68
|
+
* pageReporting=false and autoMemoryReclaim=disabled — those are what stop WSL2
|
|
69
|
+
* returning idle pages to Windows, which is what evicted VS Code.
|
|
70
|
+
*
|
|
71
|
+
* `memory=22GB` is a tradeoff, not a settled number. The host has 32.0 GB
|
|
72
|
+
* installed / 31.8 GB usable, confirmed by the product owner on 2026-07-25 — it
|
|
73
|
+
* cannot be read from inside the container. Giving the VM more raises agent
|
|
74
|
+
* capacity but starves Windows, where the VS Code CLIENT runs; giving it less
|
|
75
|
+
* starves the Linux side, where the VS Code SERVER runs. Both ends produce the
|
|
76
|
+
* same typing lag for opposite reasons, and this command can only see the Linux
|
|
77
|
+
* end. dev-tools/wsl/README.md explains how to settle it by measurement.
|
|
78
|
+
*/
|
|
79
|
+
export declare const WSLCONFIG_REMEDY = "[wsl2]\nmemory=22GB\nswap=4GB\npageReporting=false\n\n[experimental]\nautoMemoryReclaim=disabled";
|
|
80
|
+
/**
|
|
81
|
+
* The swap size WSLCONFIG_REMEDY recommends, in kB (4 GiB). This is a POLICY
|
|
82
|
+
* CONSTANT — the recommendation from dev-tools/wsl/, not something measured — and
|
|
83
|
+
* the swap check compares the measured SwapTotal against it. Kept next to the
|
|
84
|
+
* remedy so the two can only ever be changed together.
|
|
85
|
+
*/
|
|
86
|
+
export declare const RECOMMENDED_SWAP_KB: number;
|
|
87
|
+
/**
|
|
88
|
+
* Kernel tunable that belongs with the remedy but is NOT a .wslconfig setting.
|
|
89
|
+
* The default (60) lets the kernel page out active anonymous memory about as
|
|
90
|
+
* readily as it drops clean page cache; 10 makes it strongly prefer dropping
|
|
91
|
+
* cache, which is what keeps the editor resident. It cannot be set from inside
|
|
92
|
+
* this container (/proc/sys is read-only, and swapoff needs CAP_SYS_ADMIN) — it
|
|
93
|
+
* needs `/etc/wsl.conf` on the distro or an equivalent host-side step. See
|
|
94
|
+
* dev-tools/wsl/README.md.
|
|
95
|
+
*/
|
|
96
|
+
export declare const SWAPPINESS_REMEDY = "vm.swappiness=10";
|
|
97
|
+
/** Drains swap immediately without a VM restart. Windows host, elevated shell. */
|
|
98
|
+
export declare const SWAP_DRAIN_COMMAND = "wsl -d <distro> -u root sh -c \"swapoff -a && swapon -a\"";
|
|
99
|
+
/**
|
|
100
|
+
* The caveat that MUST travel with SWAP_DRAIN_COMMAND wherever it is printed.
|
|
101
|
+
*
|
|
102
|
+
* `swapoff -a` faults every swapped-out page back into RAM at once. Run under the
|
|
103
|
+
* memory pressure that filled swap in the first place, it triggers the very OOM
|
|
104
|
+
* kills our own documentation says lose unsaved agent work — so the command is
|
|
105
|
+
* most dangerous exactly when someone is most tempted to reach for it. The README
|
|
106
|
+
* carries this warning, but the copy people will actually paste is the one
|
|
107
|
+
* `doctor` prints, so the warning has to be printed there too.
|
|
108
|
+
*/
|
|
109
|
+
export declare const SWAP_DRAIN_CAVEAT: string;
|
|
110
|
+
/** Where the annotated remedy and its verification steps live in this repo. */
|
|
111
|
+
export declare const REMEDY_DOC_PATH = "dev-tools/wsl/README.md";
|
|
112
|
+
/**
|
|
113
|
+
* Timeout for a `pgrep` exec, in ms. Two pgrep calls happen per default run, so
|
|
114
|
+
* the worst case this contributes to session start is ~4 s rather than the ~10 s
|
|
115
|
+
* a 5 s timeout would allow. pgrep on a healthy box returns in single-digit ms;
|
|
116
|
+
* anything near this bound means the machine is already in trouble, which is
|
|
117
|
+
* precisely when we must not add to the delay.
|
|
118
|
+
*/
|
|
119
|
+
export declare const PGREP_TIMEOUT_MS = 2000;
|
|
120
|
+
/**
|
|
121
|
+
* Timeout for the `dmesg` exec, in ms. Verbose path only. Without it, a `dmesg`
|
|
122
|
+
* that blocks would hang the command indefinitely — `maxBuffer` bounds the
|
|
123
|
+
* output, not the wait.
|
|
124
|
+
*/
|
|
125
|
+
export declare const DMESG_TIMEOUT_MS = 5000;
|
|
126
|
+
/**
|
|
127
|
+
* Hard cap on how many PIDs the default path will read from /proc.
|
|
128
|
+
*
|
|
129
|
+
* `pgrep -f vscode-server` normally matches about 16 processes, but "normally"
|
|
130
|
+
* is an environmental assumption, not a bound. Any local process can spawn
|
|
131
|
+
* thousands of processes whose cmdline matches, and checkSwapOccupancy is NOT
|
|
132
|
+
* verbose-gated — so without this cap, every session start on every team would
|
|
133
|
+
* perform tens of thousands of /proc reads. 32 is comfortably above the observed
|
|
134
|
+
* count and low enough that the cost stays negligible. Truncation is reported
|
|
135
|
+
* rather than hidden, so a suspicious count is visible instead of silent.
|
|
136
|
+
*/
|
|
137
|
+
export declare const MAX_BOUNDED_PIDS = 32;
|
|
138
|
+
/**
|
|
139
|
+
* A check's measured assessment. This is ADVISORY ONLY — `doctor` always exits
|
|
140
|
+
* 0. A FAIL here means "the condition that caused the 2026-07-24 freeze is
|
|
141
|
+
* present", not "stop the build". See runDoctor for why the exit code is fixed.
|
|
142
|
+
*/
|
|
143
|
+
export type Verdict = 'OK' | 'WARN' | 'FAIL' | 'UNAVAILABLE';
|
|
144
|
+
export interface DoctorCheck {
|
|
145
|
+
/** Stable machine-readable id; the --json key. */
|
|
146
|
+
id: string;
|
|
147
|
+
/** One-line human title. */
|
|
148
|
+
title: string;
|
|
149
|
+
verdict: Verdict;
|
|
150
|
+
/** Human-readable measured result — always contains the number. */
|
|
151
|
+
detail: string;
|
|
152
|
+
/** Extra human lines (process lists, timestamps). Printed under --verbose. */
|
|
153
|
+
extra?: string[];
|
|
154
|
+
/** Raw measured values for --json consumers. */
|
|
155
|
+
metrics?: Record<string, number | string | boolean | null>;
|
|
156
|
+
/** Populated when the source could not be read: why. */
|
|
157
|
+
unavailableReason?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Parse /proc/meminfo into a map of field → kB. Fields without a `kB` unit
|
|
161
|
+
* (e.g. HugePages_Total) are parsed as bare numbers. Unrecognised lines are
|
|
162
|
+
* skipped rather than throwing — meminfo gains fields across kernel versions.
|
|
163
|
+
*/
|
|
164
|
+
export declare function parseMeminfo(text: string): Record<string, number>;
|
|
165
|
+
/**
|
|
166
|
+
* Parse /proc/vmstat into a map of counter → value. This is the cheap source for
|
|
167
|
+
* two numbers we would otherwise pay for: `oom_kill` is an exact count of OOM
|
|
168
|
+
* kills since boot (no dmesg, no permissions), and `pswpin`/`pswpout` are the
|
|
169
|
+
* cumulative page-swap counters that distinguish "swap is allocated but idle"
|
|
170
|
+
* from "swap is actively thrashing".
|
|
171
|
+
*/
|
|
172
|
+
export declare function parseVmstat(text: string): Record<string, number>;
|
|
173
|
+
export interface ProcStatus {
|
|
174
|
+
/** `Name:` from status — the kernel comm, truncated to 15 chars. */
|
|
175
|
+
name: string;
|
|
176
|
+
/** Resident set size in kB, or null when the process has no memory map. */
|
|
177
|
+
vmRssKb: number | null;
|
|
178
|
+
/** Swapped-out anonymous memory in kB, or null when not reported. */
|
|
179
|
+
vmSwapKb: number | null;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Make a process-supplied label safe to print.
|
|
183
|
+
*
|
|
184
|
+
* A process controls its own name via prctl(PR_SET_NAME), and the kernel escapes
|
|
185
|
+
* only newline and backslash when rendering it — a raw ESC byte passes straight
|
|
186
|
+
* through /proc. We print the top 15 processes by RSS under --verbose, so an
|
|
187
|
+
* unsanitised name is a terminal-escape channel. Strip C0 controls and DEL, then
|
|
188
|
+
* bound the length.
|
|
189
|
+
*
|
|
190
|
+
* WHAT THIS DOES NOT STRIP, so the bound is not mistaken for complete: C1
|
|
191
|
+
* controls (U+0080–U+009F) and Unicode bidirectional/format characters such as
|
|
192
|
+
* U+202E RIGHT-TO-LEFT OVERRIDE and U+200B ZERO WIDTH SPACE all survive. Those
|
|
193
|
+
* can still reorder or hide text in a terminal that honours them. Kernel `comm`
|
|
194
|
+
* is 15 bytes and would rarely carry them, and the consequence is confusing
|
|
195
|
+
* output rather than an executed escape sequence, so this is documented rather
|
|
196
|
+
* than widened — but do not read "sanitized" as "safe to render anywhere."
|
|
197
|
+
*/
|
|
198
|
+
export declare function sanitizeProcessLabel(raw: string): string;
|
|
199
|
+
/** Parse the three fields we need out of a /proc/<pid>/status text. */
|
|
200
|
+
export declare function parseProcStatus(text: string): ProcStatus;
|
|
201
|
+
/**
|
|
202
|
+
* The VS Code server processes whose eviction to swap is what the product owner
|
|
203
|
+
* actually feels as keystroke lag. Matched on the cmdline because the kernel
|
|
204
|
+
* `comm` for all of them is just `MainThread` (verified in-container
|
|
205
|
+
* 2026-07-25) — `comm` cannot tell them apart.
|
|
206
|
+
*/
|
|
207
|
+
export declare const VSCODE_ROLE_PATTERNS: ReadonlyArray<{
|
|
208
|
+
role: string;
|
|
209
|
+
needle: string;
|
|
210
|
+
}>;
|
|
211
|
+
/**
|
|
212
|
+
* Identify the VS Code server role for a cmdline, or null. Only the roles above
|
|
213
|
+
* are named; any other vscode-server process is reported as 'vscode-server'.
|
|
214
|
+
*
|
|
215
|
+
* HEURISTIC, NOT AUTHORITATIVE. This is substring matching on a cmdline. An
|
|
216
|
+
* unrelated process whose command line happens to contain `--type=fileWatcher`
|
|
217
|
+
* or `vscode-server` will be labelled as one, and any process can choose its own
|
|
218
|
+
* command line. The labels are advisory context for a human reading the output —
|
|
219
|
+
* "which of these is the editor" — and nothing branches on them beyond wording.
|
|
220
|
+
* There is no security consequence: the PID list is bounded (MAX_BOUNDED_PIDS)
|
|
221
|
+
* and every label is sanitized before printing. Treat a surprising label as a
|
|
222
|
+
* prompt to look, not as a fact.
|
|
223
|
+
*/
|
|
224
|
+
export declare function vscodeRole(cmdline: string): string | null;
|
|
225
|
+
/**
|
|
226
|
+
* True when the cmdline is an agent session root: argv[0] is the `claude`
|
|
227
|
+
* binary. Deliberately narrow — matching the substring "claude" anywhere would
|
|
228
|
+
* also catch every hook script under `.claude/hooks/`, which are shells, not
|
|
229
|
+
* sessions (verified: 3 such false positives in-container).
|
|
230
|
+
*
|
|
231
|
+
* HEURISTIC, NOT AUTHORITATIVE. Exact-argv0 matching is much tighter than the
|
|
232
|
+
* substring test in vscodeRole, but a process still controls its own argv, so
|
|
233
|
+
* anything invoked as `claude` counts and a session launched by another name
|
|
234
|
+
* does not. The session COUNT feeds the delta store, so treat it as an
|
|
235
|
+
* indicator, not an inventory. Same reasoning as vscodeRole: bounded and
|
|
236
|
+
* sanitized, so no security consequence.
|
|
237
|
+
*/
|
|
238
|
+
export declare function isAgentSession(cmdline: string): boolean;
|
|
239
|
+
export interface OomEvent {
|
|
240
|
+
/** Seconds since boot from the `[ 1234.567890]` prefix, or null if untimestamped. */
|
|
241
|
+
monotonicSeconds: number | null;
|
|
242
|
+
/** 'kill' = a process was reaped; 'invoked' = the killer ran (may precede the kill). */
|
|
243
|
+
kind: 'kill' | 'invoked';
|
|
244
|
+
/** Victim process name when the line reports one. */
|
|
245
|
+
process: string | null;
|
|
246
|
+
/** Victim pid when the line reports one. */
|
|
247
|
+
pid: number | null;
|
|
248
|
+
/** anon-rss of the victim in kB when the line reports it — the size of the leak. */
|
|
249
|
+
anonRssKb: number | null;
|
|
250
|
+
/** The matched line, trimmed. */
|
|
251
|
+
raw: string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Extract OOM events from a dmesg dump. Recognises the three shapes the kernel
|
|
255
|
+
* emits, in decreasing order of specificity:
|
|
256
|
+
* "Out of memory: Killed process 1234 (node) total-vm:..., anon-rss:1330000kB, ..."
|
|
257
|
+
* "oom-kill:constraint=CONSTRAINT_NONE,...,task=node,pid=1234,uid=1000"
|
|
258
|
+
* "node invoked oom-killer: gfp_mask=0x..., order=0, oom_score_adj=0"
|
|
259
|
+
* The first two are the same kill reported twice by newer kernels, so a kill is
|
|
260
|
+
* de-duplicated by (pid, name) when both appear within a second of each other.
|
|
261
|
+
*
|
|
262
|
+
* This is the VERBOSE path. The default path uses /proc/vmstat `oom_kill`, which
|
|
263
|
+
* is an exact since-boot count and costs one read; dmesg exists here only to
|
|
264
|
+
* attach timestamps and victim names to that count.
|
|
265
|
+
*/
|
|
266
|
+
export declare function parseOomEvents(dmesgText: string): OomEvent[];
|
|
267
|
+
/**
|
|
268
|
+
* Convert a dmesg monotonic timestamp to wall-clock ISO, given the current time
|
|
269
|
+
* and /proc/uptime seconds. Returns null rather than a date whenever we cannot
|
|
270
|
+
* compute an honest one:
|
|
271
|
+
*
|
|
272
|
+
* - the log line carried no timestamp; or
|
|
273
|
+
* - the timestamp is LATER THAN UPTIME, which is impossible. dmesg is a ring
|
|
274
|
+
* buffer and the monotonic clock resets at boot, so the two normally move
|
|
275
|
+
* together — but some WSL2 restart paths can leave stale lines behind a
|
|
276
|
+
* reset clock. Computing anyway produces a confident, fabricated future date
|
|
277
|
+
* (a line at [999999.0] with uptime 100 renders as 11 days from now). A
|
|
278
|
+
* number we know is impossible must never be rendered; the caller says the
|
|
279
|
+
* timestamp is inconsistent instead. See describeOomEventTime.
|
|
280
|
+
*/
|
|
281
|
+
export declare function monotonicToWallClock(monotonicSeconds: number | null, uptimeSeconds: number, nowMs: number): string | null;
|
|
282
|
+
/**
|
|
283
|
+
* The wall-clock phrase for one OOM event, or an explicit statement of why there
|
|
284
|
+
* is none. Pure, so every branch is testable without a live dmesg. Each failure
|
|
285
|
+
* mode gets its own wording — "unavailable" with a reason, never a blank or a
|
|
286
|
+
* plausible-looking guess.
|
|
287
|
+
*/
|
|
288
|
+
export declare function describeOomEventTime(event: Pick<OomEvent, 'monotonicSeconds'>, uptimeSeconds: number | null, nowMs: number): string;
|
|
289
|
+
/** Parse the first field of /proc/uptime (seconds since boot). */
|
|
290
|
+
export declare function parseUptimeSeconds(text: string): number | null;
|
|
291
|
+
/** Count `inotify wd:...` lines in a /proc/<pid>/fdinfo/<fd> dump — one per watch. */
|
|
292
|
+
export declare function parseInotifyWatchCount(fdinfoText: string): number;
|
|
293
|
+
/**
|
|
294
|
+
* Interpret a cgroup memory limit value. cgroup v2 writes the literal string
|
|
295
|
+
* `max`; v1 writes a sentinel near 2^63. Returns null for "unlimited".
|
|
296
|
+
*/
|
|
297
|
+
export declare function parseCgroupMemoryLimit(text: string): number | null;
|
|
298
|
+
/** kB → human string, e.g. 8388608 → "8.0 GiB". */
|
|
299
|
+
export declare function formatKb(kb: number): string;
|
|
300
|
+
/** bytes → human string. */
|
|
301
|
+
export declare function formatBytes(bytes: number): string;
|
|
302
|
+
/**
|
|
303
|
+
* The subset of measurements we persist between runs. `doctor` is loud only when
|
|
304
|
+
* one of these has WORSENED since the previous run — a static "swap exists →
|
|
305
|
+
* FAIL" would be permanently red on every machine that has not applied the host
|
|
306
|
+
* fix, and everyone would learn to ignore it. Alarm fatigue is the exact failure
|
|
307
|
+
* mode we are fixing: nobody checked anything on 2026-07-24 until the editor had
|
|
308
|
+
* been frozen for two days.
|
|
309
|
+
*/
|
|
310
|
+
export interface DoctorReading {
|
|
311
|
+
/** ISO time the reading was taken. */
|
|
312
|
+
timestamp: string;
|
|
313
|
+
/** /proc/vmstat oom_kill — exact count since boot. */
|
|
314
|
+
oomKills: number;
|
|
315
|
+
/** SwapTotal - SwapFree, in kB. */
|
|
316
|
+
swapUsedKb: number;
|
|
317
|
+
/** SwapTotal in kB — a change here means the host config changed. */
|
|
318
|
+
swapTotalKb: number;
|
|
319
|
+
/** Count of `claude` agent-session processes. */
|
|
320
|
+
agentSessions: number;
|
|
321
|
+
/** Seconds since boot at reading time; a decrease means the VM restarted. */
|
|
322
|
+
uptimeSeconds: number;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Where the last reading lives. Follows the existing convention set by
|
|
326
|
+
* `monitor` (~/.mx-agent/monitor-last-check/<key>.txt): a per-feature directory
|
|
327
|
+
* under ~/.mx-agent with one file per key. No new store is introduced.
|
|
328
|
+
*/
|
|
329
|
+
export declare function doctorReadingPath(key?: string): string;
|
|
330
|
+
/**
|
|
331
|
+
* Hard cap on the delta store file, in bytes. A reading serializes to about 200
|
|
332
|
+
* bytes; 4 KiB is roughly 20x that and still trivially cheap to read.
|
|
333
|
+
*
|
|
334
|
+
* WHY A SIZE BOUND AND NOT JUST A CONTENT CHECK. Validating shape and content
|
|
335
|
+
* still means `readFileSync` + `JSON.parse` run on whatever is at that path
|
|
336
|
+
* first. QA planted a 300 MB junk file and measured collectDoctorResult taking
|
|
337
|
+
* 532 ms longer on that call — and nothing bounds it at 300 MB; it could be
|
|
338
|
+
* gigabytes. Same shared $HOME, same uid, same trust boundary as the injection
|
|
339
|
+
* vector: any process on the box can impose that cost on every session start on
|
|
340
|
+
* the machine, which is the opposite of this module's cheap-by-default
|
|
341
|
+
* principle on a box we are trying to keep responsive.
|
|
342
|
+
*
|
|
343
|
+
* This is the boundPids pattern applied to the other unbounded input: cap it,
|
|
344
|
+
* do not assume it. Over the cap the file is treated as corrupt, which returns
|
|
345
|
+
* null, which triggers a fresh measurement and rewrites a clean baseline — the
|
|
346
|
+
* store self-heals on the same call.
|
|
347
|
+
*/
|
|
348
|
+
export declare const MAX_READING_FILE_BYTES = 4096;
|
|
349
|
+
/**
|
|
350
|
+
* Load the previous reading, or null when it is absent, unparseable, or fails
|
|
351
|
+
* validation.
|
|
352
|
+
*
|
|
353
|
+
* SECURITY — THIS FILE IS UNTRUSTED INPUT. See the module header. It lives in
|
|
354
|
+
* the shared $HOME outside every worktree, every team runs as the same uid, and
|
|
355
|
+
* the values flow into text printed at session start in every agent session on
|
|
356
|
+
* every team. So the shape is checked exhaustively rather than trusted:
|
|
357
|
+
*
|
|
358
|
+
* - `timestamp` must match ISO_INSTANT *and* survive a Date round-trip. That
|
|
359
|
+
* bounds it to 24 characters from a fixed alphabet, which removes the
|
|
360
|
+
* unbounded-string channel entirely (no newlines, no terminal escapes, no
|
|
361
|
+
* injected instructions).
|
|
362
|
+
* - Every numeric field must be a finite number in [0, MAX_SAFE_INTEGER].
|
|
363
|
+
* Negative values are rejected specifically: a stored `oomKills: -1` makes
|
|
364
|
+
* the `current > previous` comparison in detectRegressions true no matter
|
|
365
|
+
* what the machine reports, which is a guaranteed trigger.
|
|
366
|
+
* - The file must be a REGULAR FILE of at most MAX_READING_FILE_BYTES. Size is
|
|
367
|
+
* checked BEFORE reading, because shape validation cannot protect against a
|
|
368
|
+
* cost paid during the read itself. The regular-file requirement matters
|
|
369
|
+
* independently: a FIFO at this path makes a blocking open() wait forever,
|
|
370
|
+
* hanging session start for every team — the same class of hazard that took
|
|
371
|
+
* the disk check off the startup path.
|
|
372
|
+
*
|
|
373
|
+
* VALIDATE THE FILE DESCRIPTOR, NEVER THE PATH — this is the part to preserve.
|
|
374
|
+
* The first version of this bound called statSync(path) and then
|
|
375
|
+
* readFileSync(path). That resolves the path TWICE, and a co-tenant process
|
|
376
|
+
* (same uid, shared $HOME, the trust boundary this module's header declares) can
|
|
377
|
+
* rename the path between the two calls: stat sees the valid file, open gets the
|
|
378
|
+
* FIFO. Security review demonstrated it wedging a victim at iteration 4 of a
|
|
379
|
+
* swap loop. Worse, the damage outlived the attack — the racer restored a valid
|
|
380
|
+
* regular file and exited, and the victim stayed blocked, because a blocked
|
|
381
|
+
* open() pins the FIFO inode no matter what the path resolves to afterwards.
|
|
382
|
+
* Forensics would find a perfectly valid store file and no explanation.
|
|
383
|
+
*
|
|
384
|
+
* So: openSync once with O_NONBLOCK, then fstatSync on the DESCRIPTOR. There is
|
|
385
|
+
* no window to race, because there is no second name resolution. O_NONBLOCK
|
|
386
|
+
* makes open() on a FIFO return immediately instead of waiting for a writer,
|
|
387
|
+
* which closes that case whether or not anyone attempts the race. O_NOFOLLOW is
|
|
388
|
+
* deliberately NOT set: a symlink to a legitimate regular file is fine, and
|
|
389
|
+
* fstat judges the target it actually opened rather than the name used to reach
|
|
390
|
+
* it.
|
|
391
|
+
*
|
|
392
|
+
* None of the three fail-open layers would have helped here. A process blocked
|
|
393
|
+
* in a kernel syscall never throws, and readFileSync cannot be given a timeout.
|
|
394
|
+
*
|
|
395
|
+
* The returned object is REBUILT field by field, so unknown properties in the
|
|
396
|
+
* file are discarded rather than carried into the rest of the program.
|
|
397
|
+
*
|
|
398
|
+
* NOTE ON LAYERING — do not "simplify" this. A far-future but well-formed
|
|
399
|
+
* timestamp like 9999-01-01T00:00:00.000Z is ACCEPTED here on purpose: it is a
|
|
400
|
+
* syntactically valid, bounded ISO instant and not an injection vector, so it is
|
|
401
|
+
* not this function's business. It is rejected TEMPORALLY by the rate limiter in
|
|
402
|
+
* shouldRunStartupDoctorCheck. Two layers, two concerns: this one decides
|
|
403
|
+
* whether the data is well-formed, that one decides whether it is usable now.
|
|
404
|
+
* Merging them would make each harder to reason about.
|
|
405
|
+
*/
|
|
406
|
+
export declare function loadLastReading(path?: string): DoctorReading | null;
|
|
407
|
+
/**
|
|
408
|
+
* Persist the current reading. Best-effort: never throws.
|
|
409
|
+
*
|
|
410
|
+
* Written to a process-unique temp file with `flag: 'wx'` (fail if it already
|
|
411
|
+
* exists) and `mode: 0o600`, then renamed into place. Three properties come out
|
|
412
|
+
* of that:
|
|
413
|
+
* - SYMLINK-SAFE. `writeFileSync` follows a symlink and would clobber whatever
|
|
414
|
+
* it points at; `renameSync` replaces the symlink itself. Since `doctor` now
|
|
415
|
+
* runs at every session start, a symlink planted at the store path would
|
|
416
|
+
* otherwise be a write primitive fired by every team.
|
|
417
|
+
* - ATOMIC. A reader never sees a half-written file.
|
|
418
|
+
* - PRIVATE. 0600 rather than the default 0644.
|
|
419
|
+
* The temp name includes the pid so concurrent sessions cannot collide on it and
|
|
420
|
+
* so `wx` can never be defeated by a pre-planted temp file; it is removed on any
|
|
421
|
+
* failure.
|
|
422
|
+
*/
|
|
423
|
+
export declare function saveReading(reading: DoctorReading, path?: string): void;
|
|
424
|
+
/**
|
|
425
|
+
* Noise floor for the swap-in-use delta, in kB (64 MiB). A POLICY CONSTANT, not
|
|
426
|
+
* a measurement. Swap in use drifts by a few hundred kB between consecutive runs
|
|
427
|
+
* on an otherwise idle box (observed while testing this command), and reporting
|
|
428
|
+
* that as "worse" is exactly the alarm fatigue the delta design exists to
|
|
429
|
+
* prevent. Two things still get reported regardless of size: swap going from
|
|
430
|
+
* completely unused to used at all — that is a state change, not drift — and any
|
|
431
|
+
* growth of 64 MiB or more.
|
|
432
|
+
*
|
|
433
|
+
* KNOWN LIMITATION — STRUCTURALLY BLIND TO A SLOW LEAK. Each run compares only
|
|
434
|
+
* against the IMMEDIATELY PRECEDING reading, and the baseline advances every
|
|
435
|
+
* time. So a leak that grows by less than 64 MiB between checks never fires, no
|
|
436
|
+
* matter how large it becomes in total: 60 MiB per hourly check is 1.4 GiB a day
|
|
437
|
+
* and reports nothing, because no single step clears the floor. Lowering the
|
|
438
|
+
* floor is not the fix — that reintroduces the drift noise it exists to
|
|
439
|
+
* suppress.
|
|
440
|
+
*
|
|
441
|
+
* The fix, if we decide it is worth building, is a second comparison against a
|
|
442
|
+
* LONGER-WINDOW baseline (for example a day-old reading kept alongside the most
|
|
443
|
+
* recent one), so cumulative growth is visible even when each step is small.
|
|
444
|
+
* Deliberately NOT built now: it is a real design change to the delta store, and
|
|
445
|
+
* no slow leak has been observed. Candidate for a later iteration.
|
|
446
|
+
*/
|
|
447
|
+
export declare const SWAP_GROWTH_NOISE_FLOOR_KB: number;
|
|
448
|
+
export interface Regression {
|
|
449
|
+
/** Which reading field worsened. */
|
|
450
|
+
metric: 'oomKills' | 'swapUsedKb' | 'swapTotalKb' | 'agentSessions';
|
|
451
|
+
previous: number;
|
|
452
|
+
current: number;
|
|
453
|
+
/** Ready-to-print sentence, with both numbers. */
|
|
454
|
+
message: string;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Compare two readings and return only the metrics that got WORSE. Returns []
|
|
458
|
+
* when there is no previous reading (first run is quiet by design) or when the
|
|
459
|
+
* VM restarted, since since-boot counters reset and a "decrease" would be
|
|
460
|
+
* meaningless. `swapTotalKb` is reported in BOTH directions: a drop means
|
|
461
|
+
* somebody applied a host-side change, which is news worth printing.
|
|
462
|
+
*/
|
|
463
|
+
export declare function detectRegressions(prev: DoctorReading | null, cur: DoctorReading): Regression[];
|
|
464
|
+
export interface Collected<T> {
|
|
465
|
+
value: T | null;
|
|
466
|
+
/** Present only when value is null: why the source could not be read. */
|
|
467
|
+
error?: string;
|
|
468
|
+
}
|
|
469
|
+
/** Single read. Default path. */
|
|
470
|
+
export declare function collectMeminfo(procRoot?: string): Collected<Record<string, number>>;
|
|
471
|
+
/** Single read. Default path. Source of the exact oom_kill count. */
|
|
472
|
+
export declare function collectVmstat(procRoot?: string): Collected<Record<string, number>>;
|
|
473
|
+
/** Single read. Default path. */
|
|
474
|
+
export declare function collectUptimeSeconds(procRoot?: string): Collected<number>;
|
|
475
|
+
export interface ProcessSample extends ProcStatus {
|
|
476
|
+
pid: number;
|
|
477
|
+
cmdline: string;
|
|
478
|
+
vscode: string | null;
|
|
479
|
+
agentSession: boolean;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Read status + cmdline for an EXPLICIT, BOUNDED list of PIDs. This is the only
|
|
483
|
+
* per-process read on the default path, and the PID list comes from a single
|
|
484
|
+
* `pgrep` exec (kernel-side scan) rather than a Node-side walk of /proc.
|
|
485
|
+
* Processes that exit mid-read are skipped.
|
|
486
|
+
*/
|
|
487
|
+
export declare function collectProcessesByPid(pids: number[], procRoot?: string): ProcessSample[];
|
|
488
|
+
/**
|
|
489
|
+
* Resolve PIDs with a single `pgrep` exec. Returns `{ value: null, error }` when
|
|
490
|
+
* pgrep is absent or matches nothing distinguishable, so the caller can print
|
|
491
|
+
* "unavailable" rather than a zero it cannot justify.
|
|
492
|
+
*
|
|
493
|
+
* A pgrep exec is deliberately preferred over a Node-side /proc walk: the scan
|
|
494
|
+
* happens in the kernel/C, allocating nothing in this process, which matters
|
|
495
|
+
* because we run under the memory pressure we are measuring.
|
|
496
|
+
*
|
|
497
|
+
* The RESULT IS NOT BOUNDED — pgrep returns as many PIDs as match. Callers on
|
|
498
|
+
* the default path must apply boundPids() before reading /proc for each one.
|
|
499
|
+
*/
|
|
500
|
+
export declare function pgrepPids(args: string[]): Collected<number[]>;
|
|
501
|
+
export interface BoundedPids {
|
|
502
|
+
/** At most MAX_BOUNDED_PIDS entries, in the order pgrep returned them. */
|
|
503
|
+
pids: number[];
|
|
504
|
+
/** How many matches were dropped. Non-zero is itself worth reporting. */
|
|
505
|
+
dropped: number;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Enforce the default path's per-process bound. Callers report `dropped` rather
|
|
509
|
+
* than silently truncating, so an abnormal match count surfaces as information
|
|
510
|
+
* instead of disappearing.
|
|
511
|
+
*/
|
|
512
|
+
export declare function boundPids(pids: number[], limit?: number): BoundedPids;
|
|
513
|
+
/**
|
|
514
|
+
* FULL /proc walk — VERBOSE PATH ONLY, and capped. Returns the `limit` processes
|
|
515
|
+
* with the largest RSS. Never call this on the default path: iterating
|
|
516
|
+
* /proc/<pid>/status across hundreds of PIDs allocates and syscalls under
|
|
517
|
+
* exactly the memory pressure being measured.
|
|
518
|
+
*/
|
|
519
|
+
export declare function collectProcesses(limit?: number, procRoot?: string): Collected<ProcessSample[]>;
|
|
520
|
+
/** Read the kernel ring buffer. Fails with EPERM when dmesg_restrict is set. */
|
|
521
|
+
export declare function collectDmesg(): Collected<string>;
|
|
522
|
+
export interface InotifyUsage {
|
|
523
|
+
instances: number;
|
|
524
|
+
watches: number;
|
|
525
|
+
/** Processes whose /proc/<pid>/fd was unreadable — the counts are a lower bound. */
|
|
526
|
+
unreadableProcesses: number;
|
|
527
|
+
}
|
|
528
|
+
export interface InotifyCaps {
|
|
529
|
+
maxInstances: number | null;
|
|
530
|
+
maxWatches: number | null;
|
|
531
|
+
}
|
|
532
|
+
/** Two single reads. Default path — caps only, no walk. */
|
|
533
|
+
export declare function collectInotifyCaps(procRoot?: string): InotifyCaps;
|
|
534
|
+
/**
|
|
535
|
+
* Count live inotify instances and watches by walking /proc/<pid>/fd for
|
|
536
|
+
* `anon_inode:inotify` symlinks and counting watch lines in the matching fdinfo.
|
|
537
|
+
* Regression guard for PR #4475 (the `.worktrees` watcher storm).
|
|
538
|
+
*
|
|
539
|
+
* VERBOSE PATH ONLY — this is a readdir per PID plus a read per matching fd, the
|
|
540
|
+
* most expensive thing in this module. There is no aggregate current-usage
|
|
541
|
+
* counter in /proc, so there is no cheap substitute; the default path reports
|
|
542
|
+
* the caps and says the live count needs --verbose.
|
|
543
|
+
*
|
|
544
|
+
* The counts cover only processes this UID can read, so they are a LOWER BOUND;
|
|
545
|
+
* `unreadableProcesses` reports how many were skipped, so the number is never
|
|
546
|
+
* presented as complete when it is not.
|
|
547
|
+
*/
|
|
548
|
+
export declare function collectInotifyUsage(procRoot?: string): Collected<InotifyUsage>;
|
|
549
|
+
export interface DiskUsage {
|
|
550
|
+
path: string;
|
|
551
|
+
totalBytes: number;
|
|
552
|
+
availableBytes: number;
|
|
553
|
+
freePercent: number;
|
|
554
|
+
}
|
|
555
|
+
/** One statfs syscall. Default path. */
|
|
556
|
+
export declare function collectDisk(path: string): Collected<DiskUsage>;
|
|
557
|
+
/**
|
|
558
|
+
* Read the container's memory cgroup cap, trying cgroup v2 then v1. A null value
|
|
559
|
+
* inside a successful Collected means the cap is unlimited.
|
|
560
|
+
*/
|
|
561
|
+
export declare function collectCgroupMemoryLimit(): Collected<number | null>;
|
|
562
|
+
//# sourceMappingURL=vm-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vm-health.d.ts","sourceRoot":"","sources":["../../src/lib/vm-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAuBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,qGAMF,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,QAAkB,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,8DAA4D,CAAC;AAE5F;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,QAEmE,CAAC;AAElG,+EAA+E;AAC/E,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAQzD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAInC;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAA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