@a11ign/screenreader-fleet 0.1.0 → 0.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-worker-code.d.mts","sourceRoot":"","sources":["../src/check-worker-code.mjs"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"check-worker-code.d.mts","sourceRoot":"","sources":["../src/check-worker-code.mjs"],"names":[],"mappings":";AA0CA;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;EAQC;kCAnDyE,iBAAiB;AAqD3F,wFAAwF;AACxF,sCAWC;oCAjEyE,iBAAiB"}
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
import { realpathSync } from "node:fs";
|
|
16
16
|
import { pathToFileURL } from "node:url";
|
|
17
17
|
import { execFileSync } from "node:child_process";
|
|
18
|
-
import { sandboxGitEnv } from "./git-safe-env.mjs";
|
|
19
|
-
// The WORKING-TREE value, imported rather than regex-scraped — architecture-audit.md §5, item 3.
|
|
20
|
-
// `protocol-version.mjs` is dependency-free for exactly this: safe to import from a portable tree.
|
|
21
|
-
import { CAPTURE_PROTOCOL_VERSION as PROTOCOL_IN_TREE } from "@a11ign/screenreader-worker/protocol-version";
|
|
22
|
-
import { workerSourceDir } from "@a11ign/screenreader-worker/code-version";
|
|
23
18
|
import { fleetScriptPaths } from "./fleet-scripts.mjs";
|
|
24
19
|
import { configuredWorkers, inventoryWorkerUrls, resolveWorkerPool } from "./fleet-env.mjs";
|
|
25
20
|
// The comparison, the remedy and the expected hash live in ONE place, because the capture entry points ask
|
|
@@ -42,29 +37,6 @@ const CTL = fleetScriptPaths().workerCtl;
|
|
|
42
37
|
// request after a Windows boot may need PowerShell file-version discovery, so four seconds
|
|
43
38
|
// was too tight and made a healthy worker look unreachable.
|
|
44
39
|
const HEALTH_TIMEOUT_MS = 15000;
|
|
45
|
-
// The guest and the host now call the SAME function over the SAME list, so they cannot disagree by
|
|
46
|
-
// construction. This used to be two copies of one loop kept in step by a comment.
|
|
47
|
-
/**
|
|
48
|
-
* A STALE report is usually a real stale guest — but not when the working tree carries an uncommitted
|
|
49
|
-
* CAPTURE_PROTOCOL_VERSION bump. Then every worker reports stale because the LOCAL hash moved, and the
|
|
50
|
-
* obvious remedy (redeploy) would ship the bump and invalidate every cached capture.
|
|
51
|
-
*
|
|
52
|
-
* Saying so here costs one line and saves someone an unexplained full recapture.
|
|
53
|
-
*/
|
|
54
|
-
function protocolBumpNote() {
|
|
55
|
-
try {
|
|
56
|
-
const inTree = String(PROTOCOL_IN_TREE);
|
|
57
|
-
const committed = /CAPTURE_PROTOCOL_VERSION = (\d+)/.exec(execFileSync("git", ["-C", workerSourceDir(), "show", "HEAD:./protocol-version.mjs"], { encoding: "utf8", env: sandboxGitEnv() }))?.[1];
|
|
58
|
-
if (inTree && committed && inTree !== committed) {
|
|
59
|
-
return `\nNOTE: your working tree has CAPTURE_PROTOCOL_VERSION = ${inTree} but HEAD has ${committed}.\n` +
|
|
60
|
-
"That alone changes the local hash, so the guests may not be stale at all. Deploying it would\n" +
|
|
61
|
-
"invalidate every cached capture — `npm run worker:deploy` refuses unless you pass\n" +
|
|
62
|
-
"--allow-protocol-change.\n";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
catch { /* not a git checkout; nothing to add */ }
|
|
66
|
-
return "";
|
|
67
|
-
}
|
|
68
40
|
/**
|
|
69
41
|
* Which workers to ask, AND WHERE THAT LIST CAME FROM — the second half is not decoration.
|
|
70
42
|
*
|
|
@@ -158,9 +130,6 @@ async function main() {
|
|
|
158
130
|
if (staleUrls.length) {
|
|
159
131
|
for (const line of remedyLines(staleUrls, inventoryWorkerUrls()))
|
|
160
132
|
console.log(line);
|
|
161
|
-
const note = protocolBumpNote();
|
|
162
|
-
if (note)
|
|
163
|
-
console.log(note);
|
|
164
133
|
}
|
|
165
134
|
process.exit(staleUrls.length ? 1 : 0);
|
|
166
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-worker-code.mjs","sourceRoot":"","sources":["../src/check-worker-code.mjs"],"names":[],"mappings":";AACA,YAAY;AACZ,qDAAqD;AACrD,EAAE;AACF,wBAAwB;AACxB,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,2FAA2F;AAC3F,gGAAgG;AAChG,2FAA2F;AAC3F,EAAE;AACF,4FAA4F;AAC5F,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"check-worker-code.mjs","sourceRoot":"","sources":["../src/check-worker-code.mjs"],"names":[],"mappings":";AACA,YAAY;AACZ,qDAAqD;AACrD,EAAE;AACF,wBAAwB;AACxB,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,2FAA2F;AAC3F,gGAAgG;AAChG,2FAA2F;AAC3F,EAAE;AACF,4FAA4F;AAC5F,0EAA0E;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,2GAA2G;AAC3G,qGAAqG;AACrG,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,WAAW,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ACzC,CAAC;AAED,wGAAwG;AACxG,yGAAyG;AACzG,yGAAyG;AACzG,4GAA4G;AAC5G,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI;IAAE,MAAM,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-code-check.d.mts","sourceRoot":"","sources":["../src/worker-code-check.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker-code-check.d.mts","sourceRoot":"","sources":["../src/worker-code-check.mjs"],"names":[],"mappings":"AAwEA;;;;;;;;;;;;;GAaG;AACH,qDAHW,MAAM,EAAE,YACR;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAC,IAAI,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,iBAIlH;AAvBM,6CAA8C;0BAjBN,kBAAkB;kCAAlB,kBAAkB;kCAAlB,kBAAkB;+BAAlB,kBAAkB;4BAAlB,kBAAkB;kCAAlB,kBAAkB"}
|
|
@@ -52,8 +52,15 @@ import { codeDrift, describeCodeDrift, describeEmptyPool, readWorkerCode, remedy
|
|
|
52
52
|
// `code-version.mjs` imports nothing but node stdlib and `worker-files.mjs`, which is why it is safe and
|
|
53
53
|
// why it is its own module. Still the ONE hasher: the subpath is the same function.
|
|
54
54
|
import { codeVersion, workerSourceDir } from "@a11ign/screenreader-worker/code-version";
|
|
55
|
-
/**
|
|
56
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The hash every worker is expected to be serving: the one the installed `@a11ign/screenreader-worker` was released with.
|
|
57
|
+
*
|
|
58
|
+
* NO ARGUMENT, and that is the point (a11ign/a11ign#3740). The package is BUILT, so `workerSourceDir()` is its `dist/`, which holds
|
|
59
|
+
* none of the files a guest runs (a guest runs the raw `src/*.mjs`, ADR 0031) and `codeVersion(workerSourceDir())` threw ENOENT.
|
|
60
|
+
* Built, `codeVersion()` returns the hash of the `src` the package was built from, which is what `/health.code` is over. Raw (0.1.0,
|
|
61
|
+
* which ships `src`), the same call hashes the module's own directory, which is the source: the one expression is right for both.
|
|
62
|
+
*/
|
|
63
|
+
export const expectedWorkerCode = () => codeVersion();
|
|
57
64
|
// Re-exported rather than duplicated: existing callers (`capture-real-pages.mjs`,
|
|
58
65
|
// `capture-screenreader-dataset.mjs`, and this module's own test) import these from here, and moving their
|
|
59
66
|
// implementation to `code-drift.mjs` must not become a second place either has to be found.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-code-check.mjs","sourceRoot":"","sources":["../src/worker-code-check.mjs"],"names":[],"mappings":"AAAA,YAAY;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EACnF,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAElE,sGAAsG;AACtG,yGAAyG;AACzG,iGAAiG;AACjG,yGAAyG;AACzG,oFAAoF;AACpF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"worker-code-check.mjs","sourceRoot":"","sources":["../src/worker-code-check.mjs"],"names":[],"mappings":"AAAA,YAAY;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EACnF,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAElE,sGAAsG;AACtG,yGAAyG;AACzG,iGAAiG;AACjG,yGAAyG;AACzG,oFAAoF;AACpF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAExF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAEtD,kFAAkF;AAClF,2GAA2G;AAC3G,4FAA4F;AAC5F,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAE3G;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,EAAE;IACrE,OAAO,kBAAkB,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;AACzG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a11ign/screenreader-fleet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Host-side lifecycle, health and capacity for a fleet of Windows NVDA capture workers: lease one, judge whether it is degrading, and know how many the host can afford.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|