@a11ign/screenreader-fleet 0.2.0 → 0.4.0
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/capture-client.d.mts +0 -1
- package/dist/capture-client.mjs +144 -306
- package/dist/check-worker-code.d.mts +0 -1
- package/dist/check-worker-code.mjs +42 -110
- package/dist/cli-flags.d.mts +0 -1
- package/dist/cli-flags.mjs +33 -179
- package/dist/code-drift.d.mts +4 -4
- package/dist/command-line-census.d.mts +0 -1
- package/dist/compare-workers.d.mts +0 -1
- package/dist/compare-workers.mjs +383 -255
- package/dist/control-plane-isolation.d.mts +0 -1
- package/dist/doctor.d.mts +0 -1
- package/dist/doctor.mjs +361 -809
- package/dist/fleet-consistency.d.mts +0 -1
- package/dist/fleet-consistency.mjs +155 -379
- package/dist/fleet-env.d.mts +1 -2
- package/dist/fleet-env.mjs +148 -438
- package/dist/fleet-scripts.d.mts +0 -1
- package/dist/git-safe-env.d.mts +0 -1
- package/dist/guest-run.d.mts +0 -1
- package/dist/host-address.d.mts +0 -1
- package/dist/host-address.mjs +19 -90
- package/dist/host-capacity.d.mts +0 -1
- package/dist/host-capacity.mjs +22 -136
- package/dist/host-metrics.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +233 -0
- package/dist/local-vm.d.ts +0 -1
- package/dist/measure-guard.d.mts +0 -1
- package/dist/normalise-fleet.d.mts +0 -1
- package/dist/npm-cli-executable.d.mts +0 -1
- package/dist/probe-outcome.d.mts +0 -1
- package/dist/probe-outcome.mjs +50 -96
- package/dist/protocol-guard.d.mts +0 -1
- package/dist/source-walk.d.mts +0 -1
- package/dist/src_fleet-scripts_mjs.mjs +16 -0
- package/dist/src_git-safe-env_mjs.mjs +9 -0
- package/dist/transient-fault.d.mts +0 -1
- package/dist/transient-fault.mjs +21 -81
- package/dist/utm-deprecated.d.mts +0 -1
- package/dist/worker-code-check.d.mts +0 -1
- package/dist/worker-code-check.mjs +127 -83
- package/dist/worker-health.d.mts +0 -1
- package/dist/worker-health.mjs +16 -61
- package/dist/worker-http.d.mts +0 -1
- package/dist/worker-http.mjs +42 -234
- package/dist/worker-stats.d.mts +0 -1
- package/package.json +13 -7
- package/src/local-worker/worker-ctl.sh +1 -1
- package/src/provisioning/bootstrap-windows-worker.ps1 +1 -1
- package/dist/capture-client.d.mts.map +0 -1
- package/dist/capture-client.mjs.map +0 -1
- package/dist/check-worker-code.d.mts.map +0 -1
- package/dist/check-worker-code.mjs.map +0 -1
- package/dist/cli-flags.d.mts.map +0 -1
- package/dist/cli-flags.mjs.map +0 -1
- package/dist/code-drift.d.mts.map +0 -1
- package/dist/code-drift.mjs +0 -284
- package/dist/code-drift.mjs.map +0 -1
- package/dist/command-line-census.d.mts.map +0 -1
- package/dist/command-line-census.mjs +0 -96
- package/dist/command-line-census.mjs.map +0 -1
- package/dist/compare-workers.d.mts.map +0 -1
- package/dist/compare-workers.mjs.map +0 -1
- package/dist/control-plane-isolation.d.mts.map +0 -1
- package/dist/control-plane-isolation.mjs +0 -67
- package/dist/control-plane-isolation.mjs.map +0 -1
- package/dist/deploy-worker.d.mts +0 -3
- package/dist/deploy-worker.d.mts.map +0 -1
- package/dist/deploy-worker.mjs +0 -333
- package/dist/deploy-worker.mjs.map +0 -1
- package/dist/doctor.d.mts.map +0 -1
- package/dist/doctor.mjs.map +0 -1
- package/dist/fleet-consistency.d.mts.map +0 -1
- package/dist/fleet-consistency.mjs.map +0 -1
- package/dist/fleet-env.d.mts.map +0 -1
- package/dist/fleet-env.mjs.map +0 -1
- package/dist/fleet-scripts.d.mts.map +0 -1
- package/dist/fleet-scripts.mjs +0 -41
- package/dist/fleet-scripts.mjs.map +0 -1
- package/dist/git-safe-env.d.mts.map +0 -1
- package/dist/git-safe-env.mjs +0 -44
- package/dist/git-safe-env.mjs.map +0 -1
- package/dist/guest-run.d.mts.map +0 -1
- package/dist/guest-run.mjs +0 -164
- package/dist/guest-run.mjs.map +0 -1
- package/dist/host-address.d.mts.map +0 -1
- package/dist/host-address.mjs.map +0 -1
- package/dist/host-capacity.d.mts.map +0 -1
- package/dist/host-capacity.mjs.map +0 -1
- package/dist/host-metrics.d.mts.map +0 -1
- package/dist/host-metrics.mjs +0 -201
- package/dist/host-metrics.mjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -1
- package/dist/local-vm.d.ts.map +0 -1
- package/dist/local-vm.js +0 -360
- package/dist/local-vm.js.map +0 -1
- package/dist/measure-guard.d.mts.map +0 -1
- package/dist/measure-guard.mjs +0 -73
- package/dist/measure-guard.mjs.map +0 -1
- package/dist/normalise-fleet.d.mts.map +0 -1
- package/dist/normalise-fleet.mjs +0 -76
- package/dist/normalise-fleet.mjs.map +0 -1
- package/dist/npm-cli-executable.d.mts.map +0 -1
- package/dist/npm-cli-executable.mjs +0 -159
- package/dist/npm-cli-executable.mjs.map +0 -1
- package/dist/probe-outcome.d.mts.map +0 -1
- package/dist/probe-outcome.mjs.map +0 -1
- package/dist/protocol-guard.d.mts.map +0 -1
- package/dist/protocol-guard.mjs +0 -121
- package/dist/protocol-guard.mjs.map +0 -1
- package/dist/source-walk.d.mts.map +0 -1
- package/dist/source-walk.mjs +0 -56
- package/dist/source-walk.mjs.map +0 -1
- package/dist/transient-fault.d.mts.map +0 -1
- package/dist/transient-fault.mjs.map +0 -1
- package/dist/utm-deprecated.d.mts.map +0 -1
- package/dist/utm-deprecated.mjs +0 -23
- package/dist/utm-deprecated.mjs.map +0 -1
- package/dist/worker-code-check.d.mts.map +0 -1
- package/dist/worker-code-check.mjs.map +0 -1
- package/dist/worker-health.d.mts.map +0 -1
- package/dist/worker-health.mjs.map +0 -1
- package/dist/worker-http.d.mts.map +0 -1
- package/dist/worker-http.mjs.map +0 -1
- package/dist/worker-stats.d.mts.map +0 -1
- package/dist/worker-stats.mjs +0 -143
- package/dist/worker-stats.mjs.map +0 -1
package/dist/guest-run.mjs
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
// Run a script on a guest, elevated, and get its output back.
|
|
3
|
-
//
|
|
4
|
-
// node packages/worker-fleet/src/guest-run.mjs <vm-name> <local-script.cmd> [--timeout=600]
|
|
5
|
-
//
|
|
6
|
-
// This exists because there was no reliable way to do it, and the workarounds each failed differently:
|
|
7
|
-
//
|
|
8
|
-
// utmctl exec runs as NT AUTHORITY\SYSTEM -- fully elevated -- but returns NO OUTPUT and exit
|
|
9
|
-
// code 0 whether or not the command ran. Fine for firing something, useless for
|
|
10
|
-
// knowing what happened.
|
|
11
|
-
// the worker's HTTP unelevated. The worker task is RunLevel Limited on purpose (NVDA does not need
|
|
12
|
-
// elevation), so DISM, sc.exe and Defender's registry keys are all closed to it.
|
|
13
|
-
// Register-ScheduledTask from the worker "Access is denied" -- registering an elevated task itself
|
|
14
|
-
// needs elevation.
|
|
15
|
-
// ssh / WinRM / RDP not installed; ports 22, 5985, 5986, 3389 and 445 are all closed.
|
|
16
|
-
//
|
|
17
|
-
// The combination that works: `utmctl exec` (SYSTEM) registers a scheduled task at RunLevel HIGHEST,
|
|
18
|
-
// starts it, and the task writes its output to a file we pull back. Elevation from the exec channel,
|
|
19
|
-
// results through the file channel, neither depending on the other.
|
|
20
|
-
//
|
|
21
|
-
// TWO TRAPS, both of which produced wrong answers today and are handled here:
|
|
22
|
-
//
|
|
23
|
-
// 1. `utmctl exec ... -- a b c` passes a, b and c as SEPARATE argv entries. A cmd line containing
|
|
24
|
-
// parentheses, `&` or quotes gets split across them and cmd receives fragments. A `reg query`
|
|
25
|
-
// written that way reported "key not found" for a key that certainly existed, and nearly led to
|
|
26
|
-
// the conclusion that a real configuration drift was a false alarm. The command is passed as ONE
|
|
27
|
-
// argument here, always.
|
|
28
|
-
// 2. A detached child dies with the exec that spawned it. `start /b` looked like it worked -- exit 0,
|
|
29
|
-
// no output -- and the child never ran. A scheduled task survives because the Task Scheduler
|
|
30
|
-
// service owns it.
|
|
31
|
-
import { execFile } from "node:child_process";
|
|
32
|
-
import { createReadStream, readFileSync, existsSync } from "node:fs";
|
|
33
|
-
import { pathToFileURL } from "node:url";
|
|
34
|
-
import { basename, resolve } from "node:path";
|
|
35
|
-
import { promisify } from "node:util";
|
|
36
|
-
import { refuseUnknownFlags } from "./cli-flags.mjs";
|
|
37
|
-
import { warnUtmDeprecated } from "./utm-deprecated.mjs";
|
|
38
|
-
/**
|
|
39
|
-
* takes a VM name and a script POSITIONALLY, which this guard does not touch, plus `--timeout=`;
|
|
40
|
-
* a mistyped timeout silently falls back to 600s on an operation that may legitimately need longer.
|
|
41
|
-
*
|
|
42
|
-
* An unrecognised flag is otherwise IGNORED, so it runs the default and reports success.
|
|
43
|
-
*/
|
|
44
|
-
refuseUnknownFlags(["--timeout="], { entry: import.meta.url, command: "npm run guest:run" });
|
|
45
|
-
const run = promisify(execFile);
|
|
46
|
-
const UTMCTL = "/Applications/UTM.app/Contents/MacOS/utmctl";
|
|
47
|
-
const GUEST_DIR = "C:\\Users\\witness\\a11y-witness";
|
|
48
|
-
const TASK_NAME = "a11yguestrun";
|
|
49
|
-
/** Written by the wrapper as its last act. Absent means still running, or it died. */
|
|
50
|
-
export const DONE_SENTINEL = "---GUEST-RUN-DONE---";
|
|
51
|
-
const POLL_MS = 5_000;
|
|
52
|
-
/**
|
|
53
|
-
* The cmd line that registers and starts the elevated task.
|
|
54
|
-
*
|
|
55
|
-
* Built as a single string on purpose -- see trap 1 above. Exported so the quoting is testable without
|
|
56
|
-
* a guest, because it is the part that silently produces wrong answers rather than errors.
|
|
57
|
-
*/
|
|
58
|
-
/** @param {{ scriptPath: string, taskName?: string }} where */
|
|
59
|
-
export function scheduleCommand({ scriptPath, taskName = TASK_NAME }) {
|
|
60
|
-
return `schtasks /create /tn ${taskName} /tr "${scriptPath}" /sc once /st 00:00 ` +
|
|
61
|
-
`/ru SYSTEM /rl HIGHEST /f >nul 2>&1 & schtasks /run /tn ${taskName} >nul 2>&1`;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Wrap a caller's script so it always terminates with the sentinel.
|
|
65
|
-
*
|
|
66
|
-
* Without this there is no way to distinguish "still running" from "died on line one" -- which is
|
|
67
|
-
* exactly how a trim that crashed immediately looked identical to a trim in progress, for three boots.
|
|
68
|
-
*/
|
|
69
|
-
/** @param {string} body @param {string} outputFile */
|
|
70
|
-
export function wrapScript(body, outputFile) {
|
|
71
|
-
const lines = [
|
|
72
|
-
"@echo off",
|
|
73
|
-
`cd /d ${GUEST_DIR}`,
|
|
74
|
-
`set OUT=${outputFile}`,
|
|
75
|
-
`> ${outputFile} echo === guest-run ===`,
|
|
76
|
-
...body.split(/\r?\n/).filter((/** @type {string} */ l) => !/^@echo off\s*$/i.test(l)).map((/** @type {string} */ l) => l.trimEnd()),
|
|
77
|
-
`>> ${outputFile} echo ${DONE_SENTINEL}`,
|
|
78
|
-
];
|
|
79
|
-
return lines.join("\r\n") + "\r\n";
|
|
80
|
-
}
|
|
81
|
-
/** Did the run finish? Exported because "no sentinel" and "no file" are different failures. */
|
|
82
|
-
/** @param {string} output */
|
|
83
|
-
/** @param {string | null} output */
|
|
84
|
-
export function isComplete(output) {
|
|
85
|
-
return typeof output === "string" && output.includes(DONE_SENTINEL);
|
|
86
|
-
}
|
|
87
|
-
/** @param {string} vmName */
|
|
88
|
-
async function uuidFor(vmName) {
|
|
89
|
-
const { stdout } = await run(UTMCTL, ["list"]);
|
|
90
|
-
const line = stdout.split("\n").find((l) => l.trim().endsWith(` ${vmName}`) || l.trim().endsWith(`\t${vmName}`));
|
|
91
|
-
const uuid = line?.trim().split(/\s+/)[0];
|
|
92
|
-
if (!uuid)
|
|
93
|
-
throw new Error(`no VM named '${vmName}'`);
|
|
94
|
-
return uuid;
|
|
95
|
-
}
|
|
96
|
-
/** @param {string} uuid @param {string} guestPath @param {string} localPath @returns {Promise<void>} */
|
|
97
|
-
function push(uuid, guestPath, localPath) {
|
|
98
|
-
return new Promise((done, fail) => {
|
|
99
|
-
const child = execFile(UTMCTL, ["file", "push", uuid, guestPath], (error) => error ? fail(new Error(`push failed: ${ /** @type {Error} */(error).message}`)) : done());
|
|
100
|
-
if (child.stdin)
|
|
101
|
-
createReadStream(localPath).pipe(child.stdin);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/** @param {string} uuid @param {string} guestPath */
|
|
105
|
-
async function pull(uuid, guestPath) {
|
|
106
|
-
try {
|
|
107
|
-
const { stdout } = await run(UTMCTL, ["file", "pull", uuid, guestPath], { maxBuffer: 1 << 24 });
|
|
108
|
-
return stdout;
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
return null; // not written yet
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async function main() {
|
|
115
|
-
warnUtmDeprecated("node packages/worker-fleet/src/guest-run.mjs");
|
|
116
|
-
const args = process.argv.slice(2);
|
|
117
|
-
const [vmName, scriptFile] = args.filter((a) => !a.startsWith("--"));
|
|
118
|
-
const timeoutS = Number(args.find((a) => a.startsWith("--timeout="))?.split("=")[1] ?? 600);
|
|
119
|
-
if (!vmName || !scriptFile) {
|
|
120
|
-
process.stderr.write("usage: node packages/worker-fleet/src/guest-run.mjs <vm-name> <script.cmd> [--timeout=600]\n");
|
|
121
|
-
process.exit(2);
|
|
122
|
-
}
|
|
123
|
-
const local = resolve(scriptFile);
|
|
124
|
-
if (!existsSync(local))
|
|
125
|
-
throw new Error(`no such script: ${local}`);
|
|
126
|
-
const name = basename(scriptFile).replace(/\.[^.]+$/, "");
|
|
127
|
-
const guestScript = `${GUEST_DIR}\\${name}.cmd`;
|
|
128
|
-
const guestOutput = `${GUEST_DIR}\\.${name}.out`;
|
|
129
|
-
const wrapped = resolve(process.env.TMPDIR ?? "/tmp", `${name}.wrapped.cmd`);
|
|
130
|
-
const { writeFileSync } = await import("node:fs");
|
|
131
|
-
writeFileSync(wrapped, wrapScript(readFileSync(local, "utf8"), guestOutput), "utf8");
|
|
132
|
-
const uuid = await uuidFor(vmName);
|
|
133
|
-
process.stdout.write(`==> ${vmName} (${uuid})\n`);
|
|
134
|
-
await push(uuid, guestScript, wrapped);
|
|
135
|
-
process.stdout.write(` pushed ${name}.cmd\n`);
|
|
136
|
-
// One argument. See trap 1.
|
|
137
|
-
await run(UTMCTL, ["exec", uuid, "--cmd", "cmd.exe", "--", "/c",
|
|
138
|
-
scheduleCommand({ scriptPath: guestScript })]);
|
|
139
|
-
process.stdout.write(" running as SYSTEM at RunLevel HIGHEST\n");
|
|
140
|
-
const deadline = Date.now() + timeoutS * 1000;
|
|
141
|
-
while (Date.now() < deadline) {
|
|
142
|
-
await new Promise((r) => setTimeout(r, POLL_MS));
|
|
143
|
-
const output = await pull(uuid, guestOutput);
|
|
144
|
-
if (isComplete(output)) {
|
|
145
|
-
process.stdout.write((output ?? "").replace(DONE_SENTINEL, "").trimEnd() + "\n");
|
|
146
|
-
process.stdout.write(" done\n");
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
throw new Error(`no ${DONE_SENTINEL} within ${timeoutS}s — the script may still be running; ` +
|
|
151
|
-
`pull ${guestOutput} to see how far it got`);
|
|
152
|
-
}
|
|
153
|
-
// `import.meta.url === pathToFileURL(process.argv[1])`, not `endsWith("guest-run.mjs")`. The old form
|
|
154
|
-
// worked but matched on a SUFFIX, so any entry point whose path happened to end that way -- a
|
|
155
|
-
// `my-guest-run.mjs`, a copy under another directory -- would have run this file's main instead of its own.
|
|
156
|
-
// Every other entry point in this repo now uses the exact comparison; one idiom, so there is one thing to
|
|
157
|
-
// get right.
|
|
158
|
-
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
|
|
159
|
-
main().catch((error) => {
|
|
160
|
-
process.stderr.write(`guest-run failed: ${error.message}\n`);
|
|
161
|
-
process.exit(1);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
//# sourceMappingURL=guest-run.mjs.map
|
package/dist/guest-run.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|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AC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;YACjF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACnC,OAAO;QACT,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,MAAM,aAAa,WAAW,QAAQ,uCAAuC;QAC3F,QAAQ,WAAW,wBAAwB,CAAC,CAAC;AACjD,CAAC;AAED,sGAAsG;AACtG,8FAA8F;AAC9F,4GAA4G;AAC5G,0GAA0G;AAC1G,aAAa;AACb,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-address.d.mts","sourceRoot":"","sources":["../src/host-address.mjs"],"names":[],"mappings":"AAiCA,kGAAkG;AAClG,yBAAyB;AACzB,8BADY,MAAM,iBAKjB;AAED;;;;;;;;GAQG;AACH,wCAHW,MAAM,GACJ,MAAM,GAAG,SAAS,CAiB9B;AAED;;;;;GAKG;AACH,gDAHW,MAAM,GACJ,MAAM,GAAG,SAAS,CAS9B;AAED;;;;;;;;;;GAUG;AACH,yCAJW,MAAM,SACN,MAAM,GAAG,MAAM,GACb,MAAM,CAWlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-address.mjs","source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;;;;;;;;;;gBA7DR,MAAM;uBAAiB,MAAM;4BAAsB,MAAM;qBAAe,MAAM;;;;;;;;;;;;EAwEzG;AA2BD;;;GAGG;AACH,iCAHW,YAAY,SACZ,YAAY;;;;;;;EAmBtB;;;;;;2BApCY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,SAAS,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE"}
|
package/dist/host-metrics.mjs
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
/**
|
|
3
|
-
* What the HOST was doing while a measurement ran: CPU, disk, memory.
|
|
4
|
-
*
|
|
5
|
-
* ## Why this exists
|
|
6
|
-
*
|
|
7
|
-
* Every performance conclusion in this project has been drawn from wall-clock time and phase marks,
|
|
8
|
-
* and the causes were misattributed three times in one day — first to memory, then to the guests
|
|
9
|
-
* themselves, then to contention in the abstract. The actual bottleneck was **disk I/O from Chromium
|
|
10
|
-
* cold-starting on three guests at once**, and it was invisible because nothing ever measured it.
|
|
11
|
-
*
|
|
12
|
-
* A timing number without the foundations underneath it does not identify a cause; it only says
|
|
13
|
-
* something got slower. These are the four things that were being guessed at:
|
|
14
|
-
*
|
|
15
|
-
* CPU load average and the guests' own share. Ruled contention in or out.
|
|
16
|
-
* DISK transfers/s and MB/s. The one that mattered, and the one never sampled.
|
|
17
|
-
* MEMORY RESIDENT bytes, not `phys_footprint`.
|
|
18
|
-
* PAGING pageouts and compressor size — the difference between "tight" and "thrashing".
|
|
19
|
-
*
|
|
20
|
-
* ## phys_footprint is a charge, not occupancy — this is the mistake it caused
|
|
21
|
-
*
|
|
22
|
-
* `MEMORY_PER_WORKER_MB` was set three times (7,600 then 8,100 then 5,600) from `top`'s memory column,
|
|
23
|
-
* which on macOS is `phys_footprint`: it counts compressed and swapped-out pages as though they were
|
|
24
|
-
* resident. Three guests showing 5.8 GB each — 17.4 GB "used" — held **3.8 GB of actual RAM** between
|
|
25
|
-
* them, with 7.8 GB sitting in the compressor. The capacity model reserved roughly four times what a
|
|
26
|
-
* worker occupies and concluded the Mac could only run two. Resident size is reported here for exactly
|
|
27
|
-
* that reason.
|
|
28
|
-
*
|
|
29
|
-
* **FOOTPRINT IS NOT REPORTED, and this header claimed it was.** The sentence used to end "footprint is
|
|
30
|
-
* reported alongside it so the gap between them stays visible", and `parseProcessMemory`'s own docstring
|
|
31
|
-
* promised "Resident size AND footprint per process". Neither is true: the source is
|
|
32
|
-
* `ps -o pid=,rss=,comm=`, which has no footprint column, and the returned records carry only `residentMb`.
|
|
33
|
-
* A documented remedy that was never implemented, vouched for by two comments.
|
|
34
|
-
*
|
|
35
|
-
* That matters because RSS is the reading that lies in the one state worth detecting: a starved guest
|
|
36
|
-
* showed `rss=0.4 GB` while its `phys_footprint` was 8.1 GB, its pages being in swap. So `residentMbTotal`
|
|
37
|
-
* FALLS as a host gets sicker — the same self-defeating shape as reading `vm_stat` for available memory.
|
|
38
|
-
*
|
|
39
|
-
* Do not read it alone. `compressorMb` and the pageout DELTA come from `vm_stat` in the same snapshot and
|
|
40
|
-
* are not distorted that way: low resident WITH a large compressor is a host absorbing pressure, and a
|
|
41
|
-
* non-zero pageout delta is one that is swapping. `compare-workers.mjs` prints all three together and
|
|
42
|
-
* labels the RSS column "<- RSS, not phys_footprint", which is why the missing field never misled anyone.
|
|
43
|
-
*
|
|
44
|
-
* Adding footprint means `top -l 1 -o mem -stats mem`, which costs a second and a fragile parse; the
|
|
45
|
-
* pairing above answers the same question from a snapshot already being taken. Recorded rather than done,
|
|
46
|
-
* so the next reader is not told a field exists that does not.
|
|
47
|
-
*/
|
|
48
|
-
import { execFileSync } from "node:child_process";
|
|
49
|
-
const BYTES_PER_MB = 1024 * 1024;
|
|
50
|
-
/**
|
|
51
|
-
* Parse `vm_stat`. Pure — the arithmetic is where this goes wrong, not the shelling out.
|
|
52
|
-
*
|
|
53
|
-
* The page size is read from the output rather than assumed: it is 16 KB on Apple Silicon and 4 KB on
|
|
54
|
-
* Intel, and hardcoding 4096 would understate every figure on this machine by a factor of four.
|
|
55
|
-
*
|
|
56
|
-
* @param {string} output
|
|
57
|
-
*/
|
|
58
|
-
export function parseVmStat(output) {
|
|
59
|
-
const pageSize = Number(/page size of (\d+) bytes/.exec(output)?.[1]);
|
|
60
|
-
if (!Number.isFinite(pageSize))
|
|
61
|
-
return null;
|
|
62
|
-
const pages = (/** @type {string} */ label) => Number(new RegExp(`${label}:\\s+(\\d+)`).exec(output)?.[1] ?? 0);
|
|
63
|
-
const mb = (/** @type {string} */ label) => Math.round((pages(label) * pageSize) / BYTES_PER_MB);
|
|
64
|
-
return {
|
|
65
|
-
freeMb: mb("Pages free"),
|
|
66
|
-
activeMb: mb("Pages active"),
|
|
67
|
-
inactiveMb: mb("Pages inactive"),
|
|
68
|
-
wiredMb: mb("Pages wired down"),
|
|
69
|
-
// Compressed pages live in RAM. A large compressor with low `free` is a host absorbing pressure,
|
|
70
|
-
// which is a different state from one that is swapping, and they need different responses.
|
|
71
|
-
compressorMb: mb("Pages occupied by compressor"),
|
|
72
|
-
pageins: pages("Pageins"),
|
|
73
|
-
pageouts: pages("Pageouts"),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Parse `iostat -d -c 2` — the disk columns for each device.
|
|
78
|
-
*
|
|
79
|
-
* The FIRST sample from iostat is an average since boot and is meaningless for a measurement window;
|
|
80
|
-
* callers must use the second. Getting that wrong reports a busy disk as idle and vice versa.
|
|
81
|
-
*
|
|
82
|
-
* @param {string} output
|
|
83
|
-
* @returns {Array<{device: string, kbPerTransfer: number, transfersPerSecond: number, mbPerSecond: number}>}
|
|
84
|
-
*/
|
|
85
|
-
export function parseIostat(output) {
|
|
86
|
-
const lines = String(output).trim().split(/\r?\n/);
|
|
87
|
-
const header = lines.findIndex((l) => /^\s*disk/.test(l));
|
|
88
|
-
if (header === -1)
|
|
89
|
-
return [];
|
|
90
|
-
const devices = lines[header].trim().split(/\s+/);
|
|
91
|
-
const samples = lines.slice(header + 2).filter((l) => /\d/.test(l));
|
|
92
|
-
const last = samples.at(-1);
|
|
93
|
-
if (!last)
|
|
94
|
-
return [];
|
|
95
|
-
const numbers = last.trim().split(/\s+/).map(Number);
|
|
96
|
-
return devices.map((device, i) => ({
|
|
97
|
-
device,
|
|
98
|
-
kbPerTransfer: numbers[i * 3] ?? 0,
|
|
99
|
-
transfersPerSecond: numbers[i * 3 + 1] ?? 0,
|
|
100
|
-
mbPerSecond: numbers[i * 3 + 2] ?? 0,
|
|
101
|
-
})).filter((d) => Number.isFinite(d.mbPerSecond));
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Load averages, or null.
|
|
105
|
-
* @param {string} output
|
|
106
|
-
*/
|
|
107
|
-
export function parseLoadAverage(output) {
|
|
108
|
-
const m = /([\d.]+)\s+([\d.]+)\s+([\d.]+)/.exec(String(output));
|
|
109
|
-
return m ? { one: Number(m[1]), five: Number(m[2]), fifteen: Number(m[3]) } : null;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* RESIDENT size per process. Not footprint — `ps` has no such column; see this module's header for why
|
|
113
|
-
* that is a deliberate limit rather than an oversight, and what to read beside it.
|
|
114
|
-
*
|
|
115
|
-
* @param {string} psOutput output of `ps -o pid=,rss=,comm=`
|
|
116
|
-
* @param {string} match substring of the command to keep
|
|
117
|
-
*/
|
|
118
|
-
export function parseProcessMemory(psOutput, match) {
|
|
119
|
-
// `flatMap` rather than map -> filter -> map. The old shape checked `m &&` and was correct at runtime,
|
|
120
|
-
// but a filter cannot narrow a type for the two lines after it, so every field access read as a
|
|
121
|
-
// possible null. Doing the match and the decision in one place needs no narrowing to explain.
|
|
122
|
-
return String(psOutput).trim().split(/\r?\n/).flatMap((line) => {
|
|
123
|
-
const fields = line.trim().match(/^(\d+)\s+(\d+)\s+(.*)$/);
|
|
124
|
-
if (!fields || !fields[3].includes(match))
|
|
125
|
-
return [];
|
|
126
|
-
return [{ pid: Number(fields[1]), residentMb: Math.round(Number(fields[2]) / 1024), command: fields[3] }];
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
const run = (/** @type {string} */ cmd, /** @type {string[]} */ args) => {
|
|
130
|
-
try {
|
|
131
|
-
return execFileSync(cmd, args, { encoding: "utf8", timeout: 15_000 });
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
return ""; // a missing tool must never break a measurement; the field just reads null
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* One snapshot of the foundations.
|
|
139
|
-
*
|
|
140
|
-
* `iostat -c 2 -w 1` deliberately takes two samples a second apart and uses the second, because the
|
|
141
|
-
* first is a since-boot average. That makes this call cost ~1 s, which is why it is a snapshot taken
|
|
142
|
-
* around a measurement rather than something polled continuously.
|
|
143
|
-
*
|
|
144
|
-
* @param {{ processMatch?: string }} options
|
|
145
|
-
*/
|
|
146
|
-
export function sampleHost({ processMatch = "QEMU" } = {}) {
|
|
147
|
-
const memory = parseVmStat(run("vm_stat", []));
|
|
148
|
-
return {
|
|
149
|
-
at: new Date().toISOString(),
|
|
150
|
-
memory,
|
|
151
|
-
disk: parseIostat(run("iostat", ["-d", "-c", "2", "-w", "1"])),
|
|
152
|
-
load: parseLoadAverage(run("sysctl", ["-n", "vm.loadavg"])),
|
|
153
|
-
processes: parseProcessMemory(run("ps", ["-Ao", "pid=,rss=,comm="]), processMatch),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* What changed between two snapshots.
|
|
158
|
-
*
|
|
159
|
-
* Paging is reported as a DELTA because the absolute counters are since-boot and therefore enormous
|
|
160
|
-
* and useless: 6.6 GB of swap left over from an incident hours ago looks identical to a host swapping
|
|
161
|
-
* right now. Only the delta distinguishes them, and that distinction was worth an afternoon.
|
|
162
|
-
*/
|
|
163
|
-
// Every `?.` and `??` is a branch, so six inlined reads of a possibly-absent snapshot pushed diffHost
|
|
164
|
-
// to a complexity of 21 against a limit of 15 -- without being any clearer than naming the read once.
|
|
165
|
-
/**
|
|
166
|
-
* @typedef {{ memory?: Record<string, number>, processes?: { residentMb: number }[] }} HostSnapshot
|
|
167
|
-
*
|
|
168
|
-
* Named because the first attempt at annotating this called it `Record<string, number>` -- flat numbers,
|
|
169
|
-
* which is what the CALL SITES read out of it and not what it is. A shape guessed from its uses is the
|
|
170
|
-
* same defect as a type inferred from its defaults, one file over.
|
|
171
|
-
*/
|
|
172
|
-
/**
|
|
173
|
-
* @param {HostSnapshot} snapshot
|
|
174
|
-
* @param {string} field
|
|
175
|
-
* @param {number | null} fallback
|
|
176
|
-
* @returns {number | null}
|
|
177
|
-
*/
|
|
178
|
-
const reading = (snapshot, field, fallback) => snapshot?.memory?.[field] ?? fallback;
|
|
179
|
-
/**
|
|
180
|
-
* @param {HostSnapshot} before
|
|
181
|
-
* @param {HostSnapshot} after
|
|
182
|
-
*/
|
|
183
|
-
export function diffHost(before, after) {
|
|
184
|
-
// `?? 0` at the call, so these two stay plain numbers: a delta of two absent readings is 0, which is
|
|
185
|
-
// what "the host did not swap" has always meant here. `compressorMb` and `freeMb` below keep null,
|
|
186
|
-
// because an ABSENT reading and a reading of zero are different facts about the host and this file's
|
|
187
|
-
// whole purpose is that a number carries what it was computed from.
|
|
188
|
-
const pageouts = (reading(after, "pageouts", 0) ?? 0) - (reading(before, "pageouts", 0) ?? 0);
|
|
189
|
-
const pageins = (reading(after, "pageins", 0) ?? 0) - (reading(before, "pageins", 0) ?? 0);
|
|
190
|
-
return {
|
|
191
|
-
pageoutsDelta: pageouts,
|
|
192
|
-
pageinsDelta: pageins,
|
|
193
|
-
// The honest headline. Non-zero pageouts during a measurement means the host was swapping and the
|
|
194
|
-
// timing describes a constrained machine, not the software under test.
|
|
195
|
-
swappingDuringRun: pageouts > 0,
|
|
196
|
-
compressorMb: reading(after, "compressorMb", null),
|
|
197
|
-
freeMb: reading(after, "freeMb", null),
|
|
198
|
-
residentMbTotal: (after?.processes ?? []).reduce((sum, p) => sum + p.residentMb, 0),
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
//# sourceMappingURL=host-metrics.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-metrics.mjs","sourceRoot":"","sources":["../src/host-metrics.mjs"],"names":[],"mappings":"AAAA,YAAY;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,MAAM;IAChC,MAAM,QAAQ,GAAG,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,KAAK,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChH,MAAM,EAAE,GAAG,CAAC,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;IACjG,OAAO;QACL,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC;QACxB,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC;QAC5B,UAAU,EAAE,EAAE,CAAC,gBAAgB,CAAC;QAChC,OAAO,EAAE,EAAE,CAAC,kBAAkB,CAAC;QAC/B,iGAAiG;QAC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AAE,iBAAiB,GAClG,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAItE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzD"}
|
package/dist/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host-side worker fleet: lease a Windows capture worker, judge its health, and know how many the host can
|
|
3
|
-
* actually afford to run.
|
|
4
|
-
*
|
|
5
|
-
* None of this touches guidepup or NVDA — it runs on the machine that *drives* the workers, which is why it is
|
|
6
|
-
* a separate package from `@a11ign/screenreader-worker` (ADR 0004). The split is not cosmetic: the worker is
|
|
7
|
-
* Windows-only and the fleet is not.
|
|
8
|
-
*
|
|
9
|
-
* The measurement internals — `host-metrics`, `worker-stats`, `fleet-consistency` — are deliberately NOT
|
|
10
|
-
* exported. Their shapes change every time something new gets measured, and this project's own history is a
|
|
11
|
-
* record of that happening.
|
|
12
|
-
*/
|
|
13
|
-
export { DEFAULT_WORKER, isAfterRun, leaseWorker, leaseWorkerPool, hostAddressForWorker, guestReachableUrl, } from "./local-vm.js";
|
|
14
|
-
import { fleetScriptPaths as scriptPaths } from "./fleet-scripts.mjs";
|
|
15
|
-
/**
|
|
16
|
-
* The provisioning and lifecycle scripts, as absolute paths.
|
|
17
|
-
*
|
|
18
|
-
* They are shell and PowerShell, not JavaScript, so a consumer has to spawn them — and they can only be found
|
|
19
|
-
* relative to the module. Delegated to `fleet-scripts.mjs` so this package has exactly ONE definition of where
|
|
20
|
-
* they live: it had four, and one of them was wrong, which broke `leaseWorker` silently.
|
|
21
|
-
*/
|
|
22
|
-
export function fleetScriptPaths() {
|
|
23
|
-
return scriptPaths();
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,GAClG,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,gBAAgB,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,WAAW,EAAE,CAAC;AACvB,CAAC"}
|
package/dist/local-vm.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-vm.d.ts","sourceRoot":"","sources":["../src/local-vm.ts"],"names":[],"mappings":"AA0BA,oEAAoE;AACpE,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAWtD,oDAAoD;AACpD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAI9D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,QAAQ,CAEnD;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,kEAAkE;IAClE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,qFAAqF;AACrF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,MAAM,EAAE,UAAU,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B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