@smoothbricks/nx-plugin 0.5.3 → 0.5.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/README.md +52 -12
- package/dist/executors/bounded-exec/cpu-tokens.d.ts +13 -0
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-tokens.js +9 -9
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +20 -6
- package/dist/executors/bounded-exec/progress.d.ts +8 -3
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +100 -10
- package/dist/executors/bounded-exec/verdict.d.ts +5 -4
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +1 -0
- package/dist/runtime-input-policy.d.ts +60 -0
- package/dist/runtime-input-policy.d.ts.map +1 -0
- package/dist/runtime-input-policy.js +379 -0
- package/dist/testing.js +1 -1
- package/managed/raw/patches/nx@23.2.1.patch +26 -0
- package/package.json +7 -2
- package/src/executors/bounded-exec/cpu-tokens.ts +15 -9
- package/src/executors/bounded-exec/executor.test.ts +26 -23
- package/src/executors/bounded-exec/executor.ts +19 -4
- package/src/executors/bounded-exec/go-progress-host.test.ts +171 -0
- package/src/executors/bounded-exec/progress.test.ts +73 -0
- package/src/executors/bounded-exec/progress.ts +95 -12
- package/src/executors/bounded-exec/verdict.ts +5 -4
- package/src/nx-daemon-start-never.test.ts +30 -1
- package/src/runtime-input-policy.ts +395 -0
- package/src/runtime-input.test.ts +160 -3
- package/src/testing.ts +1 -1
package/README.md
CHANGED
|
@@ -315,6 +315,10 @@ The reliable diagnostic after a daemon or headless gate's decoder error is:
|
|
|
315
315
|
cat .runtime-input-failures/*/report
|
|
316
316
|
```
|
|
317
317
|
|
|
318
|
+
`smoo github-ci nx-smart`, `nx-run-many` and `nx-deploy` print every report retained during a failed Nx run
|
|
319
|
+
(`runtimeInputFailureReports(root, sinceMs)`, `@smoothbricks/nx-plugin/runtime-input-policy`), so a CI log names the
|
|
320
|
+
command and its cause beside Nx's decoder error, which names neither.
|
|
321
|
+
|
|
318
322
|
Each readable `report` names the command, its indexed arguments, working directory, exit status and original stderr.
|
|
319
323
|
`argv` retains the exact NUL-delimited argument vector (including empty arguments), `stderr` retains the original bytes
|
|
320
324
|
(including trailing newlines), and `exit-status` retains the decimal status. The wrapper also attempts a stderr summary
|
|
@@ -329,6 +333,26 @@ evidence path, timestamp or diagnostic enters a successful key. `runtime-input.t
|
|
|
329
333
|
its hash with the previous success path, and plants a failure through real Nx (daemon and daemonless) to prove both
|
|
330
334
|
refusal and retained evidence.
|
|
331
335
|
|
|
336
|
+
A runtime input runs only programs the workspace declares: devenv's Nix profile, the checkout's `node_modules/.bin` and
|
|
337
|
+
its own scripts. Nx hashes on a developer's Mac, on a NixOS CI runner and inside cowshed's sandbox, and only those are
|
|
338
|
+
the same in all three. A program the host's operating system ships is not: `shasum` is a Perl script that macOS ships in
|
|
339
|
+
`/usr/bin`, not coreutils, and no devenv profile provides it, so an input that named it hashed on every Mac and exited
|
|
340
|
+
127 on a NixOS runner. Hash a file with Bun, as the plugin's own file inputs do (`Bun.CryptoHasher`); devenv's coreutils
|
|
341
|
+
provide `sha256sum` where a pipeline needs one. The only host paths admitted are `/bin/sh` and `/usr/bin/env`, which
|
|
342
|
+
NixOS keeps too. `@smoothbricks/nx-plugin/runtime-input-policy` exports `hostPrograms(command, { path, root, home })`:
|
|
343
|
+
each program the command runs (through the wrapper, `env`, `exec`, `command`, `sh -c` and command substitutions; a
|
|
344
|
+
script file it runs is that script's own concern) that PATH finds outside `/nix`, the checkout and the home, that
|
|
345
|
+
nothing on PATH provides, or that only a link in the checkout's `node_modules/.bin` to a build output of one of its own
|
|
346
|
+
packages provides. Bun links a workspace package's bin only when its target exists at install time, and a fresh checkout
|
|
347
|
+
installs before it builds, so such a name is absent on a fresh runner and present in every checkout that built first;
|
|
348
|
+
run the file instead (`node node_modules/@smoothbricks/nx-plugin/dist/bin/smoo-nx-cargo-hash.js`, as the plugin's own
|
|
349
|
+
Cargo input does). A consumer's installed package ships its build, so its bins are not refused. Each refusal is a tagged
|
|
350
|
+
`HostProgram`, and `hostProgramReason` says it. `runtime-input.test.ts` judges this repository's declared inputs on
|
|
351
|
+
`tooling/direnv/repo-path --print`, the PATH entries the devenv shell and CI give Nx (which hands a runtime input its
|
|
352
|
+
own environment): the devenv profile and the checkout's directories, with no `/usr/bin` or `/bin`, so a program only the
|
|
353
|
+
host provides fails on macOS as it does on the NixOS runner. A consumer judges its own declarations with the same
|
|
354
|
+
export.
|
|
355
|
+
|
|
332
356
|
An input that runs inside a cowshed workspace's sandboxed daemon gets the client's environment, a host shell's `HOME`
|
|
333
357
|
included, but not the client's filesystem view (cowshed `04_sandbox.md`). An input that reads the operator's home fails
|
|
334
358
|
there, so a runtime input reads only the checkout and its declared environment. A `git` command in one sets
|
|
@@ -583,11 +607,13 @@ A test pays its setup once and asserts after each step; two cases that test one
|
|
|
583
607
|
repositories enforce this in their root Nx lint with the `smoo-nx-test-walks` bin. The bin judges only pairs with a case
|
|
584
608
|
changed since the upstream merge base. Among those pairs it reports each case's nearest refusing partner and its nearest
|
|
585
609
|
advisory partner separately, so an advisory pair never hides a refusal. Existing pairs therefore need no allowance
|
|
586
|
-
table.
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
`
|
|
590
|
-
|
|
610
|
+
table. The verdict depends on that base and no file hash names it, so the plugin resolves it as a run precondition
|
|
611
|
+
before Nx hashes any task (`assertUpstreamBasePrecondition`, from its pre-tasks hook): a checkout without a main ref
|
|
612
|
+
refuses the run with the check's own reason rather than carrying the base through a runtime input. `upstreamBase` picks
|
|
613
|
+
the upstream in this order: `NX_BASE` (refused when it names no commit), `refs/remotes/main/main`, the local main's
|
|
614
|
+
upstream branch, `refs/remotes/origin/main`, then `main`. `findDuplicateScenarios(root, files, changes)`,
|
|
615
|
+
`formatDuplicateScenario`, `diffScope` and `upstreamBase` are exported from `@smoothbricks/nx-plugin/test-walk-policy`,
|
|
616
|
+
and git failures come back as `GitAnswer` values.
|
|
591
617
|
|
|
592
618
|
The policy reads bun:test `test`/`it` cases in test files and `#[test]`-family fns in any Rust file. A body that is one
|
|
593
619
|
wrapper call, `await withHarness(memoryBackend, async (h) => { … })` or `runtime().block_on(async { … })`, walks the
|
|
@@ -1328,13 +1354,27 @@ result line or dot. Output that finishes no test is not progress: nextest's `SLO
|
|
|
1328
1354
|
period for a test still running, and a hung test's heartbeat both keep printing. A suite that keeps finishing tests
|
|
1329
1355
|
therefore runs as long as it needs, however slow the host, and a test that never returns ends the run 180 s after the
|
|
1330
1356
|
last test that finished. bun prints nothing per passing test when it believes an agent runs it, so the executor asks a
|
|
1331
|
-
lone `bun test` for `--dots`, one dot per finished test.
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
report no tests; a target names
|
|
1357
|
+
lone `bun test` for `--dots`, one dot per finished test. Without a recognised execution lifecycle, the clock starts at
|
|
1358
|
+
command spawn; a command that reports no tests makes progress only by exiting. nextest's slow-timeout and the serial
|
|
1359
|
+
groups' code-time classes only warn; no per-test bound kills a test or fails one that passed. Bun has a per-test
|
|
1360
|
+
deadline of its own, 5000 ms unless the command sets one, and it reads no bunfig for it, so every bun leg deletes it
|
|
1361
|
+
with `bun test --timeout=0` (`BUN_TEST_TIMEOUT_FLAG`; `0` means no deadline, measured on the pinned Bun 1.4.2). A test
|
|
1362
|
+
waits for the event it is waiting for, however long a loaded host makes the work take; one that never returns still ends
|
|
1363
|
+
the run through `idleTimeoutMs`. `timeoutMs`, an absolute ceiling, is for commands that report no tests; a target names
|
|
1364
|
+
at least one of the two.
|
|
1365
|
+
|
|
1366
|
+
Direct `go test` invocations, including sequential `&&`, `||`, and `;` chains, are requested with `-json`. Go emits a
|
|
1367
|
+
package's `Action:start` only after its build dependencies settle; a package terminal (`pass`, `fail`, or `skip`) ends
|
|
1368
|
+
that execution interval. The unchanged idle bound runs while any package is executing, re-arms on test/package
|
|
1369
|
+
completion, and stops when none is executing. Initial linking and inter-package compilation therefore spend no test idle
|
|
1370
|
+
budget, while a stuck test or `TestMain` still expires after 180 s without a completion. `output`, `build-output`,
|
|
1371
|
+
pause/continue events, and arbitrary compiler activity are not progress. Mixed runner commands and unknown wrappers keep
|
|
1372
|
+
the existing spawn-based clock; Bun and Rust fixture compilation inside an active test gets no exemption.
|
|
1373
|
+
|
|
1374
|
+
Process-group timeout fixtures retain cleanup authority only until the command leader exits and every descendant closes
|
|
1375
|
+
its inherited lifetime FIFO. EOF is the terminal ownership event; a later `afterEach` must not signal the retired PGID
|
|
1376
|
+
again. Darwin can answer `EPERM` for an unreaped zombie-only group, and an ambient `ps` scan is not an ownership proof.
|
|
1377
|
+
Failed fixtures retain their cleanup obligation rather than suppressing signal errors.
|
|
1338
1378
|
|
|
1339
1379
|
A job waiting for a CPU token is queued, not idle. A descendant whose own work waits in the host's CPU queue (a test's
|
|
1340
1380
|
scratch cowshed project, say) writes `{"op":"host-wait"}` on the `BOUNDED_EXEC_CPU_POOL` it inherited and holds the
|
|
@@ -62,6 +62,19 @@ type WorkerFlagKind = 'stryker' | 'vitest' | 'go-test';
|
|
|
62
62
|
* configured counts may only lower them.
|
|
63
63
|
*/
|
|
64
64
|
export declare function runnerDemand(command: string, declared: number | undefined, cores: number, inherited: Readonly<NodeJS.ProcessEnv>, configured?: Readonly<NodeJS.ProcessEnv>): Demand;
|
|
65
|
+
/**
|
|
66
|
+
* Where `invocation` ends in `command`, and where its own arguments end: the next `;`, `&`, `|`, `(` or `)` outside
|
|
67
|
+
* quotes and `$(…)`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function invocationSpan(command: string, invocation: RegExp): {
|
|
70
|
+
end: number;
|
|
71
|
+
argsEnd: number;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* `command` with every `flag` in `invocation`'s own arguments replaced by `value`; when it names none, `value` is
|
|
75
|
+
* added right after the invocation if `add` says so.
|
|
76
|
+
*/
|
|
77
|
+
export declare function withInvocationFlag(command: string, invocation: RegExp, flag: RegExp, value: string, add: boolean): string;
|
|
65
78
|
/**
|
|
66
79
|
* Size the runner to the lesser of its bounded demand and grant, keeping the test-thread ceilings. Rewrite named flags
|
|
67
80
|
* so they cannot outrank that size. `CPU_TOKENS_ENV` still reports the actual held grant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpu-tokens.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/cpu-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnF;;;;;;;;;;GAUG;AAEH,kGAAkG;AAClG,MAAM,MAAM,UAAU;AACpB,mFAAmF;AACjF,SAAS;AACX,mDAAmD;GACjD,cAAc;AAChB,2EAA2E;GACzE,cAAc;AAChB,yHAAyH;GACvH,eAAe;AACjB,kGAAkG;GAChG,OAAO;AACT,2FAA2F;GACzF,SAAS,CAAC;AAEd;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,kBAAkB,CAAA;CAAE,GAC5E;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC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EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,SAAS,CAAC,EAAE,IAAI,CAAA;CAAE,GAC/F;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,uFAAuF;AACvF,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,MAAuB,GAAG,SAAS,CAuB3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GATEWAY_SOCKET, holdLease } from './gateway-lease.js';
|
|
2
|
-
import { BUN_TEST, NEXTEST_RUN } from './verdict.js';
|
|
2
|
+
import { BUN_TEST, GO_TEST, NEXTEST_RUN } from './verdict.js';
|
|
3
3
|
/** Every budgeted command learns its grant here, so a script that starts a runner can size it. */
|
|
4
4
|
export const CPU_TOKENS_ENV = 'BOUNDED_EXEC_CPU_TOKENS';
|
|
5
5
|
const CARGO_BUILD = /(?<=^|[\s;&|()])(?:cargo(?:\s+-\S+)*\s+(?:build|test|check|clippy|rustc|doc|run|nextest\s+archive)|napi\s+build)(?=\s|$)/;
|
|
@@ -36,7 +36,7 @@ const WORKER_FLAGS = {
|
|
|
36
36
|
},
|
|
37
37
|
/** `go test -p`: packages built and tested at once, `GOMAXPROCS` by default, normally one per core. */
|
|
38
38
|
'go-test': {
|
|
39
|
-
invocation:
|
|
39
|
+
invocation: GO_TEST,
|
|
40
40
|
flag: new RegExp(String.raw `(?<![\w-])-p(?:=|\s+)${WORD}`, 'g'),
|
|
41
41
|
sized: (count) => `-p=${count}`,
|
|
42
42
|
ownDefault: (cores, env) => parseInheritedTokens(env.GOMAXPROCS) ?? cores,
|
|
@@ -148,7 +148,7 @@ function namedCounts(text, flag) {
|
|
|
148
148
|
* Where `invocation` ends in `command`, and where its own arguments end: the next `;`, `&`, `|`, `(` or `)` outside
|
|
149
149
|
* quotes and `$(…)`.
|
|
150
150
|
*/
|
|
151
|
-
function invocationSpan(command, invocation) {
|
|
151
|
+
export function invocationSpan(command, invocation) {
|
|
152
152
|
const found = invocation.exec(command);
|
|
153
153
|
const end = found === null ? command.length : found.index + found[0].length;
|
|
154
154
|
let quote = null;
|
|
@@ -179,13 +179,13 @@ function invocationArgs(command, invocation) {
|
|
|
179
179
|
return command.slice(end, argsEnd);
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
-
* `command` with every `flag` in `invocation`'s own arguments replaced by `
|
|
182
|
+
* `command` with every `flag` in `invocation`'s own arguments replaced by `value`; when it names none, `value` is
|
|
183
183
|
* added right after the invocation if `add` says so.
|
|
184
184
|
*/
|
|
185
|
-
function
|
|
185
|
+
export function withInvocationFlag(command, invocation, flag, value, add) {
|
|
186
186
|
const { end, argsEnd } = invocationSpan(command, invocation);
|
|
187
187
|
const args = command.slice(end, argsEnd);
|
|
188
|
-
const sizedArgs = args.search(flag) === -1 && add ? ` ${
|
|
188
|
+
const sizedArgs = args.search(flag) === -1 && add ? ` ${value}${args}` : args.replace(flag, value);
|
|
189
189
|
return `${command.slice(0, end)}${sizedArgs}${command.slice(argsEnd)}`;
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
@@ -226,7 +226,7 @@ export function sizeRunner(demand, command, tokens) {
|
|
|
226
226
|
case 'go-test': {
|
|
227
227
|
const runner = WORKER_FLAGS[demand.kind];
|
|
228
228
|
return {
|
|
229
|
-
command:
|
|
229
|
+
command: withInvocationFlag(command, runner.invocation, runner.flag, runner.sized(runnerCount), true),
|
|
230
230
|
env: { [CPU_TOKENS_ENV]: held },
|
|
231
231
|
};
|
|
232
232
|
}
|
|
@@ -235,9 +235,9 @@ export function sizeRunner(demand, command, tokens) {
|
|
|
235
235
|
// `--jobs` is lowered only where it was set: cargo-mutants refuses it beside `--in-place`.
|
|
236
236
|
const jobs = Math.min(demand.jobs, runnerCount);
|
|
237
237
|
const share = String(Math.max(1, Math.floor(runnerCount / jobs)));
|
|
238
|
-
const tasks =
|
|
238
|
+
const tasks = withInvocationFlag(command, CARGO_MUTANTS, JOBSERVER_TASKS, `--jobserver-tasks=${count}`, true);
|
|
239
239
|
return {
|
|
240
|
-
command:
|
|
240
|
+
command: withInvocationFlag(tasks, CARGO_MUTANTS, MUTANTS_JOBS, `--jobs=${jobs}`, false),
|
|
241
241
|
env: {
|
|
242
242
|
[CPU_TOKENS_ENV]: held,
|
|
243
243
|
...(demand.jobs > 1 ? { CARGO_MUTANTS_JOBS: String(jobs) } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/executor.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,KAAK,gBAAgB,EAGtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAmB,MAAM,uBAAuB,CAAC;AAGhF,OAAO,EAML,aAAa,EAEd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EAarB,MAAM,cAAc,CAAC;AAuBtB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,eAAe,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,uFAAuF;IACvF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,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,EAC7B,MAAM,EAAE,SAAS,GAAG,IAAI,EACxB,SAAS,GAAE,gBAAgB,GAAG,IAAW,EACzC,kBAAkB,GAAE,OAAO,sBAA+C,GACzE,OAAO,CAAC,iBAAiB,CAAC,CA6jB5B;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAM3D"}
|
|
@@ -343,7 +343,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
|
|
|
343
343
|
return refuse(`cowshed: could not start the command: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
344
344
|
}
|
|
345
345
|
// Progress is a finished test, not output: a runner's SLOW warnings and a hung test's heartbeat keep printing.
|
|
346
|
-
const progress = createRunProgress();
|
|
346
|
+
const progress = createRunProgress(command);
|
|
347
347
|
// A write that found no space is said once, in the output, by whatever made it; the volume is read when it is said,
|
|
348
348
|
// since the writer usually removes what it half-wrote before it exits and the volume no longer looks full by then.
|
|
349
349
|
const noSpace = createNoSpaceWatch();
|
|
@@ -405,7 +405,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
|
|
|
405
405
|
idleTimer = setTimeout(() => expire({ kind: 'idle', limitMs, tests: progress.inFlight() }, queuedMs), leftMs);
|
|
406
406
|
};
|
|
407
407
|
const armIdleTimer = () => {
|
|
408
|
-
if (idleTimeoutMs === undefined || state.settled || state.expiry !== null) {
|
|
408
|
+
if (idleTimeoutMs === undefined || state.settled || state.expiry !== null || !progress.isTesting()) {
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
idleLeftMs = idleTimeoutMs;
|
|
@@ -438,6 +438,10 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
|
|
|
438
438
|
const waitedMs = Date.now() - queuedSinceMs;
|
|
439
439
|
queuedMs += waitedMs;
|
|
440
440
|
queuedSinceMs = null;
|
|
441
|
+
if (!progress.isTesting()) {
|
|
442
|
+
appendStderr(`bounded-exec: host CPU wait ended after ${waitedMs}ms; no test runner is active\n`);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
441
445
|
appendStderr(`bounded-exec: idle clock restarted: no descendant's work is queued for host CPU tokens after ${waitedMs}ms; ${idleLeftMs}ms of idleTimeoutMs=${idleTimeoutMs} left\n`);
|
|
442
446
|
scheduleIdle(idleTimeoutMs, idleLeftMs);
|
|
443
447
|
},
|
|
@@ -445,10 +449,21 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
|
|
|
445
449
|
// Only the CHILD's own output is read for progress. The diagnostics below go
|
|
446
450
|
// through appendStderr as well, and re-arming on those would let a teardown
|
|
447
451
|
// message extend the very bound that just fired.
|
|
452
|
+
const scanProgress = (stream, text) => {
|
|
453
|
+
const wasTesting = progress.isTesting();
|
|
454
|
+
const finished = progress.scan(stream, text);
|
|
455
|
+
if (!progress.isTesting()) {
|
|
456
|
+
clearTimeout(idleTimer);
|
|
457
|
+
cancelCapture();
|
|
458
|
+
idleCapture = undefined;
|
|
459
|
+
}
|
|
460
|
+
else if (finished || !wasTesting) {
|
|
461
|
+
armIdleTimer();
|
|
462
|
+
}
|
|
463
|
+
};
|
|
448
464
|
child.stdout?.on('data', (chunk) => {
|
|
449
465
|
const text = chunk.toString();
|
|
450
|
-
|
|
451
|
-
armIdleTimer();
|
|
466
|
+
scanProgress('stdout', text);
|
|
452
467
|
const said = noSpace.scan('stdout', text);
|
|
453
468
|
if (said !== null)
|
|
454
469
|
state.noSpace = sight(said);
|
|
@@ -456,8 +471,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, budge
|
|
|
456
471
|
});
|
|
457
472
|
child.stderr?.on('data', (chunk) => {
|
|
458
473
|
const text = chunk.toString();
|
|
459
|
-
|
|
460
|
-
armIdleTimer();
|
|
474
|
+
scanProgress('stderr', text);
|
|
461
475
|
const said = noSpace.scan('stderr', text);
|
|
462
476
|
if (said !== null)
|
|
463
477
|
state.noSpace = sight(said);
|
|
@@ -15,17 +15,22 @@
|
|
|
15
15
|
* - bun: a line of dots, one per test finished (`--dots`, which `withProgressReport` asks for: bun prints nothing
|
|
16
16
|
* per passing test when it believes an agent runs it), or a `(pass)`/`(fail)`/`(skip)`/`(todo)` line. bun names
|
|
17
17
|
* no test before it finishes, so a bun run names nothing in flight.
|
|
18
|
+
* - go: structured `go test -json` package `start` follows the package's build dependencies; package `pass`,
|
|
19
|
+
* `fail`, or `skip` ends that execution interval. Test terminals re-arm the bound, but `output` and
|
|
20
|
+
* `build-output` never do. Initial and inter-package builds are outside an active test interval.
|
|
18
21
|
*
|
|
19
|
-
* A command
|
|
22
|
+
* A command without a recognised execution lifecycle remains bounded from spawn.
|
|
20
23
|
*/
|
|
21
24
|
export interface RunProgress {
|
|
22
|
-
/** One chunk of one of the command's output streams; true when it reports
|
|
25
|
+
/** One chunk of one of the command's output streams; true when it reports a finished test or Go package. */
|
|
23
26
|
scan(stream: OutputStream, chunk: string): boolean;
|
|
24
27
|
/** The tests the runner reported running and has not reported finished, in the order it first named them. */
|
|
25
28
|
inFlight(): string[];
|
|
29
|
+
/** Whether test idle time is currently chargeable; unknown runner lifecycles stay chargeable. */
|
|
30
|
+
isTesting(): boolean;
|
|
26
31
|
}
|
|
27
32
|
export type OutputStream = 'stdout' | 'stderr';
|
|
28
|
-
export declare function createRunProgress(): RunProgress;
|
|
33
|
+
export declare function createRunProgress(command?: string): RunProgress;
|
|
29
34
|
/**
|
|
30
35
|
* `command` with its one `bun test` asked for a line of dots, one per finished test: the only per-test report bun
|
|
31
36
|
* prints whoever runs it. A command that runs no bun, more than one runner, or already chose bun's dots is returned
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/progress.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,WAAW;IAC1B,4GAA4G;IAC5G,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,6GAA6G;IAC7G,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,iGAAiG;IACjG,SAAS,IAAI,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqD/C,wBAAgB,iBAAiB,CAAC,OAAO,SAAK,GAAG,WAAW,CAqF3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1D"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import typia from 'typia';
|
|
2
|
+
import { invocationSpan, withInvocationFlag } from './cpu-tokens.js';
|
|
3
|
+
import { BUN_TEST, GO_TEST, NEXTEST_RUN } from './verdict.js';
|
|
2
4
|
const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[A-Za-z]`, 'g');
|
|
3
5
|
/** Lines naming a test that finished; group 1 is its name. */
|
|
4
6
|
const FINISHED = [
|
|
@@ -12,14 +14,90 @@ const RUNNING = [
|
|
|
12
14
|
/^test (\S+) has been running for over \d+ seconds$/,
|
|
13
15
|
];
|
|
14
16
|
const DOTS = /^\.+$/;
|
|
15
|
-
|
|
17
|
+
const isGoTestEvent = (() => {
|
|
18
|
+
const _ip0 = input => "string" === typeof input["Package"];
|
|
19
|
+
const _ip1 = input => undefined === input["Test"] || "string" === typeof input["Test"];
|
|
20
|
+
const _io0 = input => "start" === input.Action && _ip0(input);
|
|
21
|
+
const _io1 = input => ("cont" === input.Action || "pause" === input.Action || "run" === input.Action) && _ip0(input) && "string" === typeof input.Test;
|
|
22
|
+
const _io2 = input => ("bench" === input.Action || "fail" === input.Action || "pass" === input.Action || "skip" === input.Action) && _ip0(input) && _ip1(input);
|
|
23
|
+
const _io3 = input => "output" === input.Action && _ip0(input) && "string" === typeof input.Output && _ip1(input);
|
|
24
|
+
const _iu0 = input => (() => {
|
|
25
|
+
if ("start" === input.Action)
|
|
26
|
+
return _io0(input);
|
|
27
|
+
else if ("bench" === input.Action || "fail" === input.Action || "pass" === input.Action || "skip" === input.Action)
|
|
28
|
+
return _io2(input);
|
|
29
|
+
else if ("cont" === input.Action || "pause" === input.Action || "run" === input.Action)
|
|
30
|
+
return _io1(input);
|
|
31
|
+
else if ("output" === input.Action)
|
|
32
|
+
return _io3(input);
|
|
33
|
+
else
|
|
34
|
+
return false;
|
|
35
|
+
})();
|
|
36
|
+
return input => "object" === typeof input && null !== input && _iu0(input);
|
|
37
|
+
})();
|
|
38
|
+
function goTestEvent(text) {
|
|
39
|
+
if (!text.startsWith('{'))
|
|
40
|
+
return null;
|
|
41
|
+
try {
|
|
42
|
+
const event = JSON.parse(text);
|
|
43
|
+
return isGoTestEvent(event) ? event : null;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof SyntaxError)
|
|
47
|
+
return null;
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Defer only a direct Go command/chain; an unknown shell wrapper or another runner keeps its existing bound. */
|
|
52
|
+
function onlyGoTests(command) {
|
|
53
|
+
let rest = command.trim();
|
|
54
|
+
while (rest.search(GO_TEST) === 0) {
|
|
55
|
+
rest = rest.slice(invocationSpan(rest, GO_TEST).argsEnd).trimStart();
|
|
56
|
+
if (rest === '')
|
|
57
|
+
return true;
|
|
58
|
+
const separator = /^(?:&&|\|\||;)\s*/.exec(rest);
|
|
59
|
+
if (separator === null)
|
|
60
|
+
return false;
|
|
61
|
+
rest = rest.slice(separator[0].length);
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
export function createRunProgress(command = '') {
|
|
66
|
+
const goLifecycle = onlyGoTests(command);
|
|
16
67
|
const streams = {
|
|
17
68
|
stdout: { partial: '', countedDots: 0 },
|
|
18
69
|
stderr: { partial: '', countedDots: 0 },
|
|
19
70
|
};
|
|
20
71
|
const running = new Set();
|
|
72
|
+
const packages = new Map();
|
|
21
73
|
// One complete line, ANSI stripped, that is not a line of dots: true when it names a finished test.
|
|
22
74
|
const finishedLine = (text) => {
|
|
75
|
+
const event = goTestEvent(text);
|
|
76
|
+
if (event !== null) {
|
|
77
|
+
switch (event.Action) {
|
|
78
|
+
case 'start':
|
|
79
|
+
packages.set(event.Package, new Set());
|
|
80
|
+
return false;
|
|
81
|
+
case 'run':
|
|
82
|
+
packages.get(event.Package)?.add(event.Test);
|
|
83
|
+
return false;
|
|
84
|
+
case 'pass':
|
|
85
|
+
case 'fail':
|
|
86
|
+
case 'skip':
|
|
87
|
+
case 'bench':
|
|
88
|
+
if (event.Test === undefined)
|
|
89
|
+
packages.delete(event.Package);
|
|
90
|
+
else
|
|
91
|
+
packages.get(event.Package)?.delete(event.Test);
|
|
92
|
+
return true;
|
|
93
|
+
case 'pause':
|
|
94
|
+
case 'cont':
|
|
95
|
+
case 'output':
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (goLifecycle)
|
|
100
|
+
return false;
|
|
23
101
|
for (const pattern of FINISHED) {
|
|
24
102
|
const name = pattern.exec(text)?.[1];
|
|
25
103
|
if (name !== undefined) {
|
|
@@ -47,7 +125,9 @@ export function createRunProgress() {
|
|
|
47
125
|
for (const raw of lines) {
|
|
48
126
|
const text = raw.replace(ANSI, '').trimEnd();
|
|
49
127
|
if (DOTS.test(text)) {
|
|
50
|
-
|
|
128
|
+
if (!goLifecycle && DOTS.test(text)) {
|
|
129
|
+
progressed ||= text.length > counted;
|
|
130
|
+
}
|
|
51
131
|
}
|
|
52
132
|
else if (finishedLine(text)) {
|
|
53
133
|
progressed = true;
|
|
@@ -55,13 +135,17 @@ export function createRunProgress() {
|
|
|
55
135
|
counted = 0;
|
|
56
136
|
}
|
|
57
137
|
const tail = rest.replace(ANSI, '');
|
|
58
|
-
const dots = DOTS.test(tail) ? tail.length : 0;
|
|
138
|
+
const dots = !goLifecycle && DOTS.test(tail) ? tail.length : 0;
|
|
59
139
|
progressed ||= dots > counted;
|
|
60
140
|
state.partial = rest;
|
|
61
141
|
state.countedDots = dots;
|
|
62
142
|
return progressed;
|
|
63
143
|
},
|
|
64
|
-
inFlight: () => [
|
|
144
|
+
inFlight: () => [
|
|
145
|
+
...running,
|
|
146
|
+
...[...packages].flatMap(([name, tests]) => tests.size === 0 ? [name] : [...tests].map((test) => `${name} ${test}`)),
|
|
147
|
+
],
|
|
148
|
+
isTesting: () => !goLifecycle || packages.size > 0,
|
|
65
149
|
};
|
|
66
150
|
}
|
|
67
151
|
/**
|
|
@@ -70,10 +154,16 @@ export function createRunProgress() {
|
|
|
70
154
|
* unchanged.
|
|
71
155
|
*/
|
|
72
156
|
export function withProgressReport(command) {
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
157
|
+
let reported = command;
|
|
158
|
+
for (const match of [...command.matchAll(new RegExp(GO_TEST, 'g'))].reverse()) {
|
|
159
|
+
reported =
|
|
160
|
+
reported.slice(0, match.index) +
|
|
161
|
+
withInvocationFlag(reported.slice(match.index), GO_TEST, /(?<![\w-])-json(?:=(?:true|false))?(?=\s|$)/g, '-json', true);
|
|
162
|
+
}
|
|
163
|
+
const bun = reported.match(BUN_TEST)?.length ?? 0;
|
|
164
|
+
const nextest = reported.match(NEXTEST_RUN)?.length ?? 0;
|
|
165
|
+
if (bun !== 1 || nextest !== 0 || /(?:^|\s)(?:--dots|--reporter[=\s]dots)(?=\s|$)/.test(reported)) {
|
|
166
|
+
return reported;
|
|
77
167
|
}
|
|
78
|
-
return
|
|
168
|
+
return reported.replace(BUN_TEST, (_match, runtime) => `${runtime} test --dots`);
|
|
79
169
|
}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* - `bound`: the run hit a wall-clock bound and nothing else failed. Either the command
|
|
6
6
|
* outlived `timeoutMs` (`total`), or every failing test in the runner's report failed on
|
|
7
7
|
* its runner's per-test timeout (`test`). A loaded host produces exactly these.
|
|
8
|
-
* - `wedged`: `idleTimeoutMs` fired: no test finished for that long
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* - `wedged`: `idleTimeoutMs` fired: no test finished for that long during a chargeable test interval. This proves
|
|
9
|
+
* the suite's completion bound was exceeded, not that every process stopped: an expensive active fixture can
|
|
10
|
+
* exceed it too. The verdict names tests reported running but never finished and tests the report says were
|
|
11
|
+
* aborted; diagnostics distinguish a stalled wait from a progressing but oversized lifecycle.
|
|
12
12
|
* - `no-space`: the run failed and its output said a write found no space (ENOSPC). Whatever its tests then reported,
|
|
13
13
|
* they failed on the disk, not on their own: the verdict names the line that said so and, when the task held one,
|
|
14
14
|
* its RAM temp volume as it stood when that line arrived.
|
|
@@ -147,6 +147,7 @@ export declare const JUNIT_FILE = "report.xml";
|
|
|
147
147
|
*/
|
|
148
148
|
export declare const BUN_TEST: RegExp;
|
|
149
149
|
export declare const NEXTEST_RUN: RegExp;
|
|
150
|
+
export declare const GO_TEST: RegExp;
|
|
150
151
|
/**
|
|
151
152
|
* `command` with its test runner asked to write a JUnit report into `directory`, the report
|
|
152
153
|
* `judgeRun` reads. Both runners are recognised by their invocation, so every target that runs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/verdict.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC5G;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,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,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,GACpH;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CA6BrG;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAqBnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAQjE"}
|
|
@@ -157,6 +157,7 @@ const NEXTEST_REPORT_CONFIG_FILE = 'nextest-report.toml';
|
|
|
157
157
|
*/
|
|
158
158
|
export const BUN_TEST = /(?<=^|[\s;&|()])((?:[^\s;&|()<>'"`\\=]*\/)?bun)\s+test(?=\s|$)/g;
|
|
159
159
|
export const NEXTEST_RUN = /(?<=^|[\s;&|()-])nextest\s+run(?=\s|$)/g;
|
|
160
|
+
export const GO_TEST = /(?<=^|[\s;&|()])go\s+test(?=\s|$)/;
|
|
160
161
|
/**
|
|
161
162
|
* `command` with its test runner asked to write a JUnit report into `directory`, the report
|
|
162
163
|
* `judgeRun` reads. Both runners are recognised by their invocation, so every target that runs
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The programs `script` runs by name or path: the program of each simple command, through `env`, `exec`,
|
|
3
|
+
* `command`, `sh -c` and command substitutions, and the command a `runtime-input.sh` input runs. Shell builtins are
|
|
4
|
+
* not programs. A script file a command runs (`sh tooling/x.sh`) is its own source's concern, not read here.
|
|
5
|
+
*/
|
|
6
|
+
export declare function commandPrograms(script: string): string[];
|
|
7
|
+
/** Where a runtime input's programs are looked up, and the locations that count as declared rather than the host's. */
|
|
8
|
+
export interface ProgramSearch {
|
|
9
|
+
/** The PATH the input runs with: Nx passes its own environment through. */
|
|
10
|
+
readonly path: string;
|
|
11
|
+
/** The workspace root: its `node_modules/.bin` and tooling are declared by the checkout. */
|
|
12
|
+
readonly root: string;
|
|
13
|
+
/**
|
|
14
|
+
* The user's home. A developer's devenv shell keeps its PATH entries in the checkout direnv loaded (a main
|
|
15
|
+
* checkout's `node_modules/.bin` while a shed is judged) and the user's own tools there; neither is the OS image.
|
|
16
|
+
*/
|
|
17
|
+
readonly home: string;
|
|
18
|
+
}
|
|
19
|
+
/** A program a runtime input runs that the workspace does not declare, and why it is refused. */
|
|
20
|
+
export type HostProgram =
|
|
21
|
+
/** PATH finds it outside /nix, the checkout, the home and /bin/sh or /usr/bin/env. */
|
|
22
|
+
{
|
|
23
|
+
readonly program: string;
|
|
24
|
+
readonly refusal: 'host';
|
|
25
|
+
readonly found: string;
|
|
26
|
+
}
|
|
27
|
+
/** Nothing on PATH provides it. */
|
|
28
|
+
| {
|
|
29
|
+
readonly program: string;
|
|
30
|
+
readonly refusal: 'absent';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* PATH finds it in the checkout's `node_modules/.bin` as a link to a build output of a package in this checkout. Bun
|
|
34
|
+
* links a workspace package's bin only when its target exists at install time, and a fresh checkout installs before
|
|
35
|
+
* it builds, so the name is absent there while every checkout that built first has it.
|
|
36
|
+
*/
|
|
37
|
+
| {
|
|
38
|
+
readonly program: string;
|
|
39
|
+
readonly refusal: 'workspace-bin';
|
|
40
|
+
readonly found: string;
|
|
41
|
+
readonly target: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Every program `command` runs that the workspace does not declare: one PATH finds outside the Nix store, the
|
|
45
|
+
* checkout, the home and the guaranteed host paths, one nothing on PATH provides, or one only a workspace package's
|
|
46
|
+
* build output provides. A relative path names a file in the checkout.
|
|
47
|
+
*/
|
|
48
|
+
export declare function hostPrograms(command: string, search: ProgramSearch): HostProgram[];
|
|
49
|
+
/** Why `host` is refused, naming where PATH found it and what to run instead. */
|
|
50
|
+
export declare function hostProgramReason(host: HostProgram): string;
|
|
51
|
+
/** The directory under the workspace root where runtime-input.sh retains each failed input. */
|
|
52
|
+
export declare const RUNTIME_INPUT_FAILURES = ".runtime-input-failures";
|
|
53
|
+
/**
|
|
54
|
+
* The report of every failure runtime-input.sh retained under `root` at or after `sinceMs`, oldest first, each headed
|
|
55
|
+
* by its path. Nx 23.2.1 names a failed runtime input only as `invalid utf-8 sequence of 1 bytes from index N` and
|
|
56
|
+
* drops the input's stderr, so a headless run prints these after Nx fails: they name the command, its exit status and
|
|
57
|
+
* its stderr. A record without a report (its evidence could not be written) is named as such.
|
|
58
|
+
*/
|
|
59
|
+
export declare function runtimeInputFailureReports(root: string, sinceMs: number): string[];
|
|
60
|
+
//# sourceMappingURL=runtime-input-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-input-policy.d.ts","sourceRoot":"","sources":["../src/runtime-input-policy.ts"],"names":[],"mappings":"AAsOA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBxD;AAED,uHAAuH;AACvH,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,iGAAiG;AACjG,MAAM,MAAM,WAAW;AACrB,sFAAsF;AACpF;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAChF,mCAAmC;GACjC;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAA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