@smoothbricks/nx-plugin 0.4.29 → 0.4.31

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.
Files changed (110) hide show
  1. package/README.md +104 -25
  2. package/dist/bin/smoo-nx-test-clocks.d.ts +3 -0
  3. package/dist/bin/smoo-nx-test-clocks.d.ts.map +1 -0
  4. package/dist/bin/smoo-nx-test-clocks.js +28 -0
  5. package/dist/bounded-test-policy.d.ts +1 -8
  6. package/dist/bounded-test-policy.d.ts.map +1 -1
  7. package/dist/bounded-test-policy.js +2 -8
  8. package/dist/cargo-closure-input.d.ts +11 -0
  9. package/dist/cargo-closure-input.d.ts.map +1 -1
  10. package/dist/cargo-closure-input.js +16 -6
  11. package/dist/ensure-built-receipt.d.ts +8 -2
  12. package/dist/ensure-built-receipt.d.ts.map +1 -1
  13. package/dist/ensure-built-receipt.js +45 -13
  14. package/dist/ensure-built-witness.d.ts +40 -4
  15. package/dist/ensure-built-witness.d.ts.map +1 -1
  16. package/dist/ensure-built-witness.js +68 -15
  17. package/dist/ensure-built.d.ts.map +1 -1
  18. package/dist/ensure-built.js +11 -3
  19. package/dist/executors/bounded-exec/cpu-pool.d.ts +7 -3
  20. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  21. package/dist/executors/bounded-exec/cpu-pool.js +9 -4
  22. package/dist/executors/bounded-exec/cpu-tokens.d.ts +22 -5
  23. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +1 -1
  24. package/dist/executors/bounded-exec/cpu-tokens.js +189 -18
  25. package/dist/executors/bounded-exec/executor.d.ts +1 -1
  26. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  27. package/dist/executors/bounded-exec/executor.js +38 -14
  28. package/dist/executors/bounded-exec/no-space.d.ts +8 -0
  29. package/dist/executors/bounded-exec/no-space.d.ts.map +1 -0
  30. package/dist/executors/bounded-exec/no-space.js +31 -0
  31. package/dist/executors/bounded-exec/ram-temp.d.ts +3 -0
  32. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  33. package/dist/executors/bounded-exec/ram-temp.js +15 -4
  34. package/dist/executors/bounded-exec/run-cpu-pool.d.ts +10 -0
  35. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -0
  36. package/dist/executors/bounded-exec/run-cpu-pool.js +63 -0
  37. package/dist/executors/bounded-exec/verdict.d.ts +34 -4
  38. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  39. package/dist/executors/bounded-exec/verdict.js +54 -3
  40. package/dist/graph-input-contract.d.ts +4 -0
  41. package/dist/graph-input-contract.d.ts.map +1 -1
  42. package/dist/graph-input-contract.js +17 -4
  43. package/dist/index.d.ts +3 -1
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +13 -3
  46. package/dist/owned-installation.d.ts +14 -0
  47. package/dist/owned-installation.d.ts.map +1 -0
  48. package/dist/owned-installation.js +324 -0
  49. package/dist/producer-receipts.d.ts.map +1 -1
  50. package/dist/producer-receipts.js +15 -10
  51. package/dist/test-backstop.d.ts +9 -0
  52. package/dist/test-backstop.d.ts.map +1 -0
  53. package/dist/test-backstop.js +10 -0
  54. package/dist/test-clock-policy.d.ts +30 -0
  55. package/dist/test-clock-policy.d.ts.map +1 -0
  56. package/dist/test-clock-policy.js +686 -0
  57. package/dist/testing.d.ts.map +1 -1
  58. package/dist/testing.js +8 -1
  59. package/managed/raw/tooling/direnv/developer-links.ts +1 -8
  60. package/managed/raw/tooling/direnv/setup-environment.ts +13 -1
  61. package/package.json +15 -4
  62. package/src/__tests__/cargo-closure-fixture.ts +113 -0
  63. package/src/__tests__/counted-cargo.ts +8 -25
  64. package/src/__tests__/directory-change.ts +27 -0
  65. package/src/__tests__/owned-installation.ts +4 -164
  66. package/src/__tests__/past-tick.ts +12 -0
  67. package/src/bin/smoo-nx-test-clocks.ts +29 -0
  68. package/src/bounded-test-policy.ts +2 -8
  69. package/src/cargo-closure-input.property.test.ts +50 -0
  70. package/src/cargo-closure-input.test.ts +15 -112
  71. package/src/cargo-closure-input.ts +23 -6
  72. package/src/cargo-closure-key.test.ts +240 -0
  73. package/src/cargo-resolve-cache.test.ts +29 -7
  74. package/src/ensure-built-receipt.ts +56 -13
  75. package/src/ensure-built-witness.test.ts +113 -4
  76. package/src/ensure-built-witness.ts +75 -16
  77. package/src/ensure-built.test.ts +74 -2
  78. package/src/ensure-built.ts +13 -2
  79. package/src/executors/bounded-exec/cpu-pool.test.ts +18 -0
  80. package/src/executors/bounded-exec/cpu-pool.ts +10 -4
  81. package/src/executors/bounded-exec/cpu-tokens.test.ts +205 -0
  82. package/src/executors/bounded-exec/cpu-tokens.ts +229 -22
  83. package/src/executors/bounded-exec/disk-lease.test.ts +47 -13
  84. package/src/executors/bounded-exec/executor-host.test.ts +23 -11
  85. package/src/executors/bounded-exec/executor.test.ts +189 -63
  86. package/src/executors/bounded-exec/executor.ts +39 -13
  87. package/src/executors/bounded-exec/hang-diagnostics.test.ts +14 -8
  88. package/src/executors/bounded-exec/no-space.ts +40 -0
  89. package/src/executors/bounded-exec/ram-temp-host.test.ts +9 -8
  90. package/src/executors/bounded-exec/ram-temp.test.ts +32 -18
  91. package/src/executors/bounded-exec/ram-temp.ts +17 -4
  92. package/src/executors/bounded-exec/run-cpu-pool.test.ts +76 -0
  93. package/src/executors/bounded-exec/run-cpu-pool.ts +75 -0
  94. package/src/executors/bounded-exec/verdict.test.ts +125 -25
  95. package/src/executors/bounded-exec/verdict.ts +78 -3
  96. package/src/graph-input-contract.test.ts +8 -0
  97. package/src/graph-input-contract.ts +26 -4
  98. package/src/index.test.ts +12 -2
  99. package/src/index.ts +13 -3
  100. package/src/nextest-extraction.test.ts +114 -4
  101. package/src/nx-daemon-claim.test.ts +5 -3
  102. package/src/nx-daemon-idle-policy.test.ts +22 -18
  103. package/src/nx-daemon-validity.test.ts +5 -13
  104. package/src/owned-installation.ts +174 -0
  105. package/src/producer-receipts.ts +15 -10
  106. package/src/test-backstop.ts +11 -0
  107. package/src/test-clock-policy.test.ts +338 -0
  108. package/src/test-clock-policy.ts +708 -0
  109. package/src/testing.ts +8 -1
  110. package/test-timings.json +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EAKL,yBAAyB,EAiB1B,MAAM,sBAAsB,CAAC;AAqB9B,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,gEAAgE;AAChE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AA2VlD,KAAK,gBAAgB,GAAG,OAAO,GAAG,KAAK,CAAC;AACxC,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,UAAU,YAAY;IACpB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,YAAY,EAAE,gBAAgB,CAAC;CAChC;AA4ID,UAAU,oBAAqB,SAAQ,YAAY;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AA0CD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAEhF;AAoRD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,UAAsB,GAC9B,MAAM,EAAE,CAKV;AAkID,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAEvG;AAED,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC;AAeF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,uBAAuB,CAGxE,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,uBAAuB,CAG1E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EAKL,yBAAyB,EAiB1B,MAAM,sBAAsB,CAAC;AAsB9B,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC,gEAAgE;AAChE,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AA2VlD,KAAK,gBAAgB,GAAG,OAAO,GAAG,KAAK,CAAC;AACxC,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,UAAU,YAAY;IACpB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,YAAY,EAAE,gBAAgB,CAAC;CAChC;AA8ID,UAAU,oBAAqB,SAAQ,YAAY;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AA0CD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,oBAAoB,GAAG,MAAM,CAEhF;AAoRD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,UAAsB,GAC9B,MAAM,EAAE,CAKV;AAkID,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,aAAa,CAEvG;AAED,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC;AAeF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,uBAAuB,CAIxE,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,uBAAuB,CAI1E,CAAC"}
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { CARGO_CLOSURE_INPUT, cargoClosureInputs, indexedCargoManifests, resolve
12
12
  import { CARGO_TOOLCHAIN_NAMED_INPUT, CARGO_TOOLCHAIN_PIN_INPUTS, cargoRuntimeInput, } from './cargo-toolchain-policy.js';
13
13
  import { attributeCargoWorkspacePackages, CARGO_TEST_ARCHIVE_FILE, CARGO_TEST_ARCHIVE_TARGET, CARGO_TEST_COMPILE_TARGET, CARGO_TEST_EXCEPTIONS_SUFFIX, CARGO_TEST_TARGET, cargoPackageTestInputs, cargoTestGroupTargetName, cargoTestPackageTargetName, createCargoInputsCache, exceptionalTestFilter, listCargoCrossTestTargets, listCargoWorkspacePackages, NEXTEST_REPO_CONFIG_PATH, nextestToolConfigArg, PLUGIN_NEXTEST_CONFIG_PATH, serialTestGroups, } from './cargo-workspace.js';
14
14
  import { CARGO_CROSS_LINT_COMMAND, CARGO_CROSS_LINT_TARGET, CARGO_FETCH_COMMAND, CARGO_FETCH_TARGET, CARGO_FROZEN_PREFIX, CARGO_LINT_CLIPPY_COMMAND, cargoCrossTestArchiveFile, cargoCrossTestArchiveTargetName, cargoCrossTestTargetName, cargoFrozen, } from './cross-check-policy.js';
15
+ import { closeRunCpuPool, serveRunCpuPool } from './executors/bounded-exec/run-cpu-pool.js';
15
16
  import { hashVersionlessCrateManifests } from './manifest-hash.js';
16
17
  import { EXTRACTED_BINARIES_METADATA, EXTRACTED_CARGO_METADATA, EXTRACTED_TARGET_DIR, NEXTEST_EXTRACT_BIN, } from './nextest-extraction.js';
17
18
  import { postTasksExecution as postProducerReceipts, preTasksExecution as preProducerReceipts, } from './producer-receipts.js';
@@ -400,6 +401,8 @@ const CARGO_INPUTS = [
400
401
  // build really reads is the package's `napi` block (binary name, targets) and
401
402
  // the `@napi-rs/cli` it runs; those are hashed as such by napiInputs().
402
403
  const CARGO_OUTPUT_INPUTS = CARGO_INPUTS;
404
+ /** A full cargo-mutants sweep's wall-clock backstop: a sweep takes hours, and a hung one must still end. */
405
+ const MUTATION_TIMEOUT_MS = 6 * 60 * 60 * 1000;
403
406
  // The toolchain half of a cargo task's identity lives in its own module
404
407
  // because `smoo monorepo validate` reads the same two constants to refuse a
405
408
  // declaration that drops it. See cargo-toolchain-policy.ts for why it is the
@@ -849,15 +852,19 @@ function isBuildOutputPackageJson(packageJsonPath) {
849
852
  /**
850
853
  * Nx accepts one pre/post task-hook pair per plugin. Two independent observers share it: the controller's task-results
851
854
  * hint and the opt-in producer completion receipts. Each sees the same options and run context; neither reads the
852
- * other's output. The hint is recorded first so a producer-receipt bug cannot cost the controller its evidence.
855
+ * other's output. The hint is recorded first so a producer-receipt bug cannot cost the controller its evidence. The
856
+ * pair also serves a run on a host without a gateway its own CPU pool, which every task inherits
857
+ * (`run-cpu-pool.ts`), and closes it when the run ends.
853
858
  */
854
859
  export const preTasksExecution = async (options, context) => {
855
860
  preTaskResults(options, context);
856
861
  await preProducerReceipts(options, context);
862
+ await serveRunCpuPool(context);
857
863
  };
858
864
  export const postTasksExecution = async (options, context) => {
859
865
  await postTaskResults(options, context);
860
866
  await postProducerReceipts(options, context);
867
+ await closeRunCpuPool(context);
861
868
  };
862
869
  export default { createNodesV2, postTasksExecution, preTasksExecution };
863
870
  function packageBinOutputs(packageJson, packageJsonPath) {
@@ -1223,10 +1230,13 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
1223
1230
  };
1224
1231
  // Mutation runs are minutes-to-hours: never cached, never part of build/lint.
1225
1232
  // CI runs these per-PR via `cargo mutants --in-diff` (see mutants.toml docs).
1233
+ // bounded-exec sizes cargo-mutants' own jobserver to its CPU grant (its `cargo-mutants` runner kind), which
1234
+ // otherwise starts one task per core whatever else runs on the host. It reports no test bounded-exec can read as
1235
+ // progress, so its bound is a wall-clock backstop, not a performance budget.
1226
1236
  targets.mutation = {
1227
- executor: 'nx:run-commands',
1237
+ executor: '@smoothbricks/nx-plugin:bounded-exec',
1228
1238
  cache: false,
1229
- options: { command: cargoFrozen('mutants --workspace'), cwd: cargoWorkspaceRoot },
1239
+ options: { command: cargoFrozen('mutants --workspace'), cwd: cargoWorkspaceRoot, timeoutMs: MUTATION_TIMEOUT_MS },
1230
1240
  };
1231
1241
  targets.bench = {
1232
1242
  executor: 'nx:run-commands',
@@ -0,0 +1,14 @@
1
+ /** One test file's installation: made on first use and shared by its fixtures, retired by the file's `afterAll`. */
2
+ export interface TestFileInstallation {
3
+ /** The `node_modules` a fixture workspace links. */
4
+ readonly nodeModules: () => Promise<string>;
5
+ /** Fails if a fixture wrote into the copy; a file that never used it has nothing to retire. */
6
+ readonly retire: () => Promise<void>;
7
+ }
8
+ /**
9
+ * The installation one test file owns: a copy of the closure `censusRoot` (the workspace whose Nx, plugin and
10
+ * TypeScript the fixtures stand for) resolves, made in the empty directory `makeRoot` creates on first use. Call once
11
+ * per file, at module scope: Bun runs many test files in one process, and each must own its copy.
12
+ */
13
+ export declare function ownedInstallation(censusRoot: string, makeRoot: () => Promise<string>): TestFileInstallation;
14
+ //# sourceMappingURL=owned-installation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AAqJA,oHAAoH;AACpH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAW3G"}
@@ -0,0 +1,324 @@
1
+ import * as _assertGuard_1 from "typia/lib/internal/_assertGuard";
2
+ import * as _accessExpressionAsString_1 from "typia/lib/internal/_accessExpressionAsString";
3
+ const __typia_transform__accessExpressionAsString = _accessExpressionAsString_1._accessExpressionAsString;
4
+ /**
5
+ * A fixture's own copy of a workspace's Nx installation, and the check that nothing wrote into it.
6
+ *
7
+ * The graph witness binds node stamps (ctime included) of every file in the closure of Nx, this plugin and
8
+ * TypeScript (README "Ancestor directories bind..."). Linked from a workspace, that closure is the host's: on CI
9
+ * its files are hardlinks in the shared Bun store, and any other task that installs, restores or cleans changes their
10
+ * link count, so their ctime, so a fixture's installation identity, between two calls of one test. Where this plugin
11
+ * is a developer link, the closure is also a live checkout that its own author edits and rebuilds while a consumer's
12
+ * test reads it. A fixture must not take an input it does not own.
13
+ *
14
+ * So the closure is copied, exactly as the witness's own census resolves it from the workspace that names it: each
15
+ * package once, with the census's own exclusions (`node_modules`, `.git`, `.nx`), each dependency edge relinked beside
16
+ * its copy as Bun's isolated layout does, the top-level packages' bins in `.bin`. Every copy is a new inode, cloned
17
+ * where the volume allows and written otherwise, so no link count is shared with anything outside its owner.
18
+ *
19
+ * A test file makes one copy, on first use, shared by its fixtures; retiring it fails, naming the changed nodes, if
20
+ * any fixture wrote into it.
21
+ */
22
+ import { constants } from 'node:fs';
23
+ import { cp, mkdir, readFile, rm, symlink } from 'node:fs/promises';
24
+ import { basename, dirname, join, relative } from 'node:path';
25
+ import { expandOutputs } from 'nx/src/native';
26
+ import { readModulePackageJson } from 'nx/src/utils/package-json';
27
+ import typia from 'typia';
28
+ import { graphInstallationCensus, graphInstallationIdentity, } from './ensure-built-witness.js';
29
+ /** The configuration the census resolves: Nx, this plugin and TypeScript. */
30
+ const CENSUS_NX_JSON = { plugins: ['@smoothbricks/nx-plugin'] };
31
+ /** The graph witness's installation identity resolved from `root`; an unproved installation fails loudly. */
32
+ function installationIdentity(root) {
33
+ let unproved = 'no detail';
34
+ const identity = graphInstallationIdentity(root, CENSUS_NX_JSON, readModulePackageJson, expandOutputs, null, (detail) => {
35
+ unproved = detail;
36
+ });
37
+ if (identity === null)
38
+ throw new Error(`the Nx installation resolved from ${root} is unproved: ${unproved}`);
39
+ return identity;
40
+ }
41
+ /** Copy the installation closure `censusRoot` resolves into `root/node_modules`; `root` is an empty directory the
42
+ * caller owns.
43
+ *
44
+ * Only the closure is read from `censusRoot`, never its proof: that installation is the host's, whose shared store
45
+ * other tasks relink while the census reads it, which changes node stamps and would make every test that copies it
46
+ * fail for the host's work rather than its own. The copy, which the fixture owns, is what gets proved.
47
+ */
48
+ async function makeOwnedInstallation(censusRoot, root) {
49
+ let unread = 'no detail';
50
+ const census = graphInstallationCensus(censusRoot, CENSUS_NX_JSON, readModulePackageJson, expandOutputs, null, (detail) => {
51
+ unread = detail;
52
+ });
53
+ if (census === null)
54
+ throw new Error(`the Nx installation closure of ${censusRoot} cannot be read: ${unread}`);
55
+ const { resolutions } = census;
56
+ const modules = join(root, 'node_modules');
57
+ // Each source package root's copy, inside a store directory whose node_modules also holds its dependency links.
58
+ const copies = new Map();
59
+ for (const [, , manifest] of resolutions) {
60
+ if (manifest === null || copies.has(dirname(manifest)))
61
+ continue;
62
+ const { name, bin } = (() => {
63
+ const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || _assertGuard_1._assertGuard(_exceptionable, {
64
+ method: "typia.json.assertParse",
65
+ path: _path + ".name",
66
+ expected: "string",
67
+ value: input.name
68
+ }, _errorFactory)) && ((null !== input.bin || _assertGuard_1._assertGuard(_exceptionable, {
69
+ method: "typia.json.assertParse",
70
+ path: _path + ".bin",
71
+ expected: "(Record<string, string> | string | undefined)",
72
+ value: input.bin
73
+ }, _errorFactory)) && (undefined === input.bin || "string" === typeof input.bin || ("object" === typeof input.bin && null !== input.bin && false === Array.isArray(input.bin) || _assertGuard_1._assertGuard(_exceptionable, {
74
+ method: "typia.json.assertParse",
75
+ path: _path + ".bin",
76
+ expected: "(Record<string, string> | string | undefined)",
77
+ value: input.bin
78
+ }, _errorFactory)) && _ao1(input.bin, _path + ".bin", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
79
+ method: "typia.json.assertParse",
80
+ path: _path + ".bin",
81
+ expected: "(Record<string, string> | string | undefined)",
82
+ value: input.bin
83
+ }, _errorFactory)));
84
+ const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
85
+ const value = input[key];
86
+ if (undefined === value)
87
+ return true;
88
+ return "string" === typeof value || _assertGuard_1._assertGuard(_exceptionable, {
89
+ method: "typia.json.assertParse",
90
+ path: _path + __typia_transform__accessExpressionAsString(key),
91
+ expected: "string",
92
+ value: value
93
+ }, _errorFactory);
94
+ });
95
+ const _io0 = input => "string" === typeof input.name && (null !== input.bin && (undefined === input.bin || "string" === typeof input.bin || "object" === typeof input.bin && null !== input.bin && false === Array.isArray(input.bin) && _io1(input.bin)));
96
+ const _io1 = input => Object.keys(input).every(key => {
97
+ const value = input[key];
98
+ if (undefined === value)
99
+ return true;
100
+ return "string" === typeof value;
101
+ });
102
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
103
+ let _errorFactory;
104
+ const __assert = (input, errorFactory) => {
105
+ if (false === __is(input)) {
106
+ _errorFactory = errorFactory;
107
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
108
+ method: "typia.json.assertParse",
109
+ path: _path + "",
110
+ expected: "{ name: string; bin?: string | Record<string, string> | undefined; }",
111
+ value: input
112
+ }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
113
+ method: "typia.json.assertParse",
114
+ path: _path + "",
115
+ expected: "{ name: string; bin?: string | Record<string, string> | undefined; }",
116
+ value: input
117
+ }, _errorFactory))(input, "$input", true);
118
+ }
119
+ return input;
120
+ };
121
+ return (input, errorFactory) => __assert(JSON.parse(input), errorFactory);
122
+ })()(await readFile(manifest, 'utf8'));
123
+ const store = join(modules, '.store', String(copies.size), 'node_modules');
124
+ copies.set(dirname(manifest), { store, copy: join(store, name), bin });
125
+ }
126
+ const copyOf = (source) => {
127
+ const copied = copies.get(source);
128
+ if (copied === undefined)
129
+ throw new Error(`${source} resolves dependencies but is not in the census`);
130
+ return copied;
131
+ };
132
+ await Promise.all([...copies].map(([source, { copy }]) => cp(source, copy, {
133
+ recursive: true,
134
+ verbatimSymlinks: true,
135
+ mode: constants.COPYFILE_FICLONE,
136
+ filter: (path) => path === source || !['node_modules', '.git', '.nx'].includes(basename(path)),
137
+ })));
138
+ for (const [from, name, manifest] of resolutions) {
139
+ if (manifest === null)
140
+ continue;
141
+ const link = join(from === censusRoot ? modules : copyOf(from).store, name);
142
+ await mkdir(dirname(link), { recursive: true });
143
+ await symlink(relative(dirname(link), copyOf(dirname(manifest)).copy), link, 'dir');
144
+ if (from !== censusRoot)
145
+ continue;
146
+ const { bin } = copyOf(dirname(manifest));
147
+ const commands = typeof bin === 'string' ? { [basename(name)]: bin } : (bin ?? {});
148
+ for (const [command, path] of Object.entries(commands)) {
149
+ await mkdir(join(modules, '.bin'), { recursive: true });
150
+ await symlink(relative(join(modules, '.bin'), join(link, path)), join(modules, '.bin', command));
151
+ }
152
+ }
153
+ return { root, identity: installationIdentity(root) };
154
+ }
155
+ /**
156
+ * Remove an installation, failing, with the changed nodes named, if its identity is no longer the one it was made
157
+ * with: the proof that its sharers only read it.
158
+ */
159
+ async function retireOwnedInstallation({ root, identity }) {
160
+ try {
161
+ const retired = installationIdentity(root);
162
+ if (retired === identity)
163
+ return;
164
+ const entries = (census) => {
165
+ const { nodes, files } = (() => {
166
+ const _ip0 = input => "string" === typeof input["path"];
167
+ const _ap0 = (input, _path, _exceptionable = true) => "string" === typeof input["path"] || _assertGuard_1._assertGuard(_exceptionable, {
168
+ method: "typia.json.assertParse",
169
+ path: _path + ".path",
170
+ expected: "string",
171
+ value: input["path"]
172
+ }, _errorFactory);
173
+ const _ao0 = (input, _path, _exceptionable = true) => ((Array.isArray(input.resolutions) || _assertGuard_1._assertGuard(_exceptionable, {
174
+ method: "typia.json.assertParse",
175
+ path: _path + ".resolutions",
176
+ expected: "ReadonlyArray<readonly [string, string, string | null]>",
177
+ value: input.resolutions
178
+ }, _errorFactory)) && input.resolutions.every((elem, _index4) => (Array.isArray(elem) || _assertGuard_1._assertGuard(_exceptionable, {
179
+ method: "typia.json.assertParse",
180
+ path: _path + ".resolutions[" + _index4 + "]",
181
+ expected: "readonly [string, string, string | null]",
182
+ value: elem
183
+ }, _errorFactory)) && ((elem.length === 3 || _assertGuard_1._assertGuard(_exceptionable, {
184
+ method: "typia.json.assertParse",
185
+ path: _path + ".resolutions[" + _index4 + "]",
186
+ expected: "[string, string, (null | string)]",
187
+ value: elem
188
+ }, _errorFactory)) && ("string" === typeof elem[0] || _assertGuard_1._assertGuard(_exceptionable, {
189
+ method: "typia.json.assertParse",
190
+ path: _path + ".resolutions[" + _index4 + "][0]",
191
+ expected: "string",
192
+ value: elem[0]
193
+ }, _errorFactory)) && ("string" === typeof elem[1] || _assertGuard_1._assertGuard(_exceptionable, {
194
+ method: "typia.json.assertParse",
195
+ path: _path + ".resolutions[" + _index4 + "][1]",
196
+ expected: "string",
197
+ value: elem[1]
198
+ }, _errorFactory)) && (null === elem[2] || "string" === typeof elem[2] || _assertGuard_1._assertGuard(_exceptionable, {
199
+ method: "typia.json.assertParse",
200
+ path: _path + ".resolutions[" + _index4 + "][2]",
201
+ expected: "(null | string)",
202
+ value: elem[2]
203
+ }, _errorFactory))) || _assertGuard_1._assertGuard(_exceptionable, {
204
+ method: "typia.json.assertParse",
205
+ path: _path + ".resolutions[" + _index4 + "]",
206
+ expected: "readonly [string, string, string | null]",
207
+ value: elem
208
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
209
+ method: "typia.json.assertParse",
210
+ path: _path + ".resolutions",
211
+ expected: "ReadonlyArray<readonly [string, string, string | null]>",
212
+ value: input.resolutions
213
+ }, _errorFactory)) && ((Array.isArray(input.nodes) || _assertGuard_1._assertGuard(_exceptionable, {
214
+ method: "typia.json.assertParse",
215
+ path: _path + ".nodes",
216
+ expected: "ReadonlyArray<NodeWitness>",
217
+ value: input.nodes
218
+ }, _errorFactory)) && input.nodes.every((elem, _index5) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
219
+ method: "typia.json.assertParse",
220
+ path: _path + ".nodes[" + _index5 + "]",
221
+ expected: "NodeWitness",
222
+ value: elem
223
+ }, _errorFactory)) && _ao1(elem, _path + ".nodes[" + _index5 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
224
+ method: "typia.json.assertParse",
225
+ path: _path + ".nodes[" + _index5 + "]",
226
+ expected: "NodeWitness",
227
+ value: elem
228
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
229
+ method: "typia.json.assertParse",
230
+ path: _path + ".nodes",
231
+ expected: "ReadonlyArray<NodeWitness>",
232
+ value: input.nodes
233
+ }, _errorFactory)) && ((Array.isArray(input.files) || _assertGuard_1._assertGuard(_exceptionable, {
234
+ method: "typia.json.assertParse",
235
+ path: _path + ".files",
236
+ expected: "readonly { readonly path: string; readonly sha256: string; }[]",
237
+ value: input.files
238
+ }, _errorFactory)) && input.files.every((elem, _index6) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
239
+ method: "typia.json.assertParse",
240
+ path: _path + ".files[" + _index6 + "]",
241
+ expected: "{ readonly path: string; readonly sha256: string; }",
242
+ value: elem
243
+ }, _errorFactory)) && _ao2(elem, _path + ".files[" + _index6 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
244
+ method: "typia.json.assertParse",
245
+ path: _path + ".files[" + _index6 + "]",
246
+ expected: "{ readonly path: string; readonly sha256: string; }",
247
+ value: elem
248
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
249
+ method: "typia.json.assertParse",
250
+ path: _path + ".files",
251
+ expected: "readonly { readonly path: string; readonly sha256: string; }[]",
252
+ value: input.files
253
+ }, _errorFactory));
254
+ const _ao1 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && ("string" === typeof input.stamp || _assertGuard_1._assertGuard(_exceptionable, {
255
+ method: "typia.json.assertParse",
256
+ path: _path + ".stamp",
257
+ expected: "string",
258
+ value: input.stamp
259
+ }, _errorFactory));
260
+ const _ao2 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && ("string" === typeof input.sha256 || _assertGuard_1._assertGuard(_exceptionable, {
261
+ method: "typia.json.assertParse",
262
+ path: _path + ".sha256",
263
+ expected: "string",
264
+ value: input.sha256
265
+ }, _errorFactory));
266
+ const _io0 = input => Array.isArray(input.resolutions) && input.resolutions.every(elem => Array.isArray(elem) && (elem.length === 3 && "string" === typeof elem[0] && "string" === typeof elem[1] && (null === elem[2] || "string" === typeof elem[2]))) && (Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _io1(elem))) && (Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io2(elem)));
267
+ const _io1 = input => _ip0(input) && "string" === typeof input.stamp;
268
+ const _io2 = input => _ip0(input) && "string" === typeof input.sha256;
269
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
270
+ let _errorFactory;
271
+ const __assert = (input, errorFactory) => {
272
+ if (false === __is(input)) {
273
+ _errorFactory = errorFactory;
274
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
275
+ method: "typia.json.assertParse",
276
+ path: _path + "",
277
+ expected: "GraphInstallationCensus",
278
+ value: input
279
+ }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
280
+ method: "typia.json.assertParse",
281
+ path: _path + "",
282
+ expected: "GraphInstallationCensus",
283
+ value: input
284
+ }, _errorFactory))(input, "$input", true);
285
+ }
286
+ return input;
287
+ };
288
+ return (input, errorFactory) => __assert(JSON.parse(input), errorFactory);
289
+ })()(census);
290
+ return new Set([
291
+ ...nodes.map(({ path, stamp }) => `${path} ${stamp}`),
292
+ ...files.map(({ path, sha256 }) => `${path} ${sha256}`),
293
+ ]);
294
+ };
295
+ const made = entries(identity);
296
+ const now = entries(retired);
297
+ const changed = [
298
+ ...[...made].filter((entry) => !now.has(entry)).map((entry) => `- ${entry}`),
299
+ ...[...now].filter((entry) => !made.has(entry)).map((entry) => `+ ${entry}`),
300
+ ];
301
+ throw new Error(`a fixture changed the installation it shares, in ${root}:\n${changed.slice(0, 20).join('\n')}`);
302
+ }
303
+ finally {
304
+ await rm(root, { recursive: true, force: true });
305
+ }
306
+ }
307
+ /**
308
+ * The installation one test file owns: a copy of the closure `censusRoot` (the workspace whose Nx, plugin and
309
+ * TypeScript the fixtures stand for) resolves, made in the empty directory `makeRoot` creates on first use. Call once
310
+ * per file, at module scope: Bun runs many test files in one process, and each must own its copy.
311
+ */
312
+ export function ownedInstallation(censusRoot, makeRoot) {
313
+ let made;
314
+ return {
315
+ nodeModules: async () => {
316
+ made ??= makeRoot().then((root) => makeOwnedInstallation(censusRoot, root));
317
+ return join((await made).root, 'node_modules');
318
+ },
319
+ retire: async () => {
320
+ if (made !== undefined)
321
+ await retireOwnedInstallation(await made);
322
+ },
323
+ };
324
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"producer-receipts.d.ts","sourceRoot":"","sources":["../src/producer-receipts.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnH,OAAO,EAEL,KAAK,0BAA0B,EAE/B,KAAK,kBAAkB,EAIxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,2BAA2B,CAAC;AAUnC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CACrE;AAqQD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,yBAAyB,CAAC,aAAa,CAAC,GAChD,eAAe,CAAC,SAAS,IAAI,EAAE,CAAC,CAqBlC;AACD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,GAAG,MAAM,CAShG;AACD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAyCf;AACD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAoIf;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAOrG"}
1
+ {"version":3,"file":"producer-receipts.d.ts","sourceRoot":"","sources":["../src/producer-receipts.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnH,OAAO,EAEL,KAAK,0BAA0B,EAE/B,KAAK,kBAAkB,EAIxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,2BAA2B,CAAC;AAUnC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CACrE;AAyQD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,yBAAyB,CAAC,aAAa,CAAC,GAChD,eAAe,CAAC,SAAS,IAAI,EAAE,CAAC,CAqBlC;AACD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,GAAG,MAAM,CAShG;AACD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAyCf;AACD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAoIf;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAAC,kBAAkB,CAAC,CAOrG"}
@@ -5,7 +5,7 @@ import { delimiter, dirname, join, resolve } from 'node:path';
5
5
  import typia from 'typia';
6
6
  import { createWorkspaceNxRequire, parseTargetSelector, providerInputProof, selectorTaskId, } from './ensure-built.js';
7
7
  import { captureProducerSource, producerOutputPaths, providerReceipt, receiptNode, } from './ensure-built-receipt.js';
8
- import { graphInstallationIdentity, movedNodes, nodesUnchanged, workspaceSnapshot, } from './ensure-built-witness.js';
8
+ import { censusStart, graphInstallationIdentity, movedNodes, workspaceSnapshot, } from './ensure-built-witness.js';
9
9
  import { graphInputContractIdentity } from './graph-input-contract.js';
10
10
  const runs = new Map();
11
11
  function sha(value) {
@@ -49,7 +49,8 @@ function same(left, right) {
49
49
  return JSON.stringify(left) === JSON.stringify(right);
50
50
  }
51
51
  /**
52
- * Whether a tool node whose ctime alone moved still reads as `tools` recorded it: the same bytes, link text,
52
+ * Whether a tool node whose stamp does not prove it (its ctime alone moved, or it was read in the tick it changed in,
53
+ * recordedStamp) still reads as `tools` recorded it: the same bytes, link text,
53
54
  * membership and mode. Bun's global store is shared by every checkout, and linking a package's bin on any of their
54
55
  * installs re-chmods the store file to the mode it already has; that moves the ctime of a node these tools witness
55
56
  * without changing it, and is no reason to refuse the run.
@@ -58,7 +59,7 @@ function recordedTool(tools) {
58
59
  const recorded = new Map(tools.flatMap((tool) => tool.nodes.map((node) => [node.path, node])));
59
60
  return (path) => {
60
61
  const node = recorded.get(path);
61
- return node !== undefined && same(receiptNode(path, path, []), node);
62
+ return node !== undefined && same(receiptNode(path, path), node);
62
63
  };
63
64
  }
64
65
  function missing(paths) {
@@ -117,6 +118,7 @@ function toolsFor(root, nxJson, projectGraph, bases) {
117
118
  if (installation === null)
118
119
  return { ok: false, detail: 'Invalid installed module closure evidence' };
119
120
  const observed = [];
121
+ const census = { start: censusStart(), observed };
120
122
  const paths = new Set(installation.nodes.map(({ path }) => path));
121
123
  const absent = new Set();
122
124
  function namespace(path) {
@@ -150,7 +152,7 @@ function toolsFor(root, nxJson, projectGraph, bases) {
150
152
  absent.add(candidate);
151
153
  }
152
154
  }
153
- const nodes = [...paths].sort().map((path) => receiptNode(path, path, observed));
155
+ const nodes = [...paths].sort().map((path) => receiptNode(path, path, census));
154
156
  const module = {
155
157
  kind: 'module',
156
158
  name: 'installed-nx-plugin-closure',
@@ -180,7 +182,7 @@ function toolsFor(root, nxJson, projectGraph, bases) {
180
182
  if (path === undefined)
181
183
  return { ok: false, detail: `Unbound producer executable ${name}` };
182
184
  const physicalPath = realpathSync(path);
183
- const entries = [...new Set([path, physicalPath])].map((entry) => receiptNode(entry, entry, observed));
185
+ const entries = [...new Set([path, physicalPath])].map((entry) => receiptNode(entry, entry, census));
184
186
  tools.push({
185
187
  kind: 'executable',
186
188
  name,
@@ -209,16 +211,18 @@ function toolsFor(root, nxJson, projectGraph, bases) {
209
211
  function verifyTools(tools) {
210
212
  try {
211
213
  const observed = [];
214
+ const census = { start: censusStart(), observed };
212
215
  for (const tool of tools) {
213
216
  if (realpathSync(tool.path) !== tool.physicalPath || !missing(tool.missing))
214
217
  return { ok: false, detail: `Producer tool alias/namespace changed: ${tool.name}` };
215
- const nodes = tool.nodes.map((node) => receiptNode(node.path, node.path, observed));
218
+ const nodes = tool.nodes.map((node) => receiptNode(node.path, node.path, census));
216
219
  if (!same(nodes, tool.nodes) || sha(nodes) !== tool.sha256)
217
220
  return { ok: false, detail: `Producer tool/module bytes changed: ${tool.name}` };
218
221
  }
219
- return nodesUnchanged(observed)
222
+ const moved = movedNodes(observed, recordedTool(tools));
223
+ return moved === null
220
224
  ? { ok: true, value: observed }
221
- : { ok: false, detail: 'Producer tool nodes changed during readonly validation' };
225
+ : { ok: false, detail: `Producer tool nodes changed during readonly validation: ${moved}` };
222
226
  }
223
227
  catch (error) {
224
228
  if (error instanceof Error)
@@ -909,8 +913,9 @@ function validatedReceipt(root, target) {
909
913
  ? 'Public product bytes differ from actual producer receipt'
910
914
  : census.reason.detail,
911
915
  };
912
- if (!nodesUnchanged(tools.value))
913
- return { ok: false, detail: 'Producer tool namespace changed during independent product validation' };
916
+ const moved = movedNodes(tools.value, recordedTool(receipt.producer.tools));
917
+ if (moved !== null)
918
+ return { ok: false, detail: `Producer tool namespace changed during independent product validation: ${moved}` };
914
919
  return { ok: true, value: receipt };
915
920
  }
916
921
  catch (error) {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A test target's one bound: the `idleTimeoutMs` with which no test may go unfinished, the hang backstop of
3
+ * specs/cowshed/08_testing.md. It is no wall-clock ceiling: a suite that keeps finishing tests runs as long as it
4
+ * needs. It is the longest any single test may run, so it stays above every slow-timeout class in the plugin's
5
+ * nextest.toml; a bun leg has no per-test deadline of its own (`BUN_TEST_TIMEOUT_FLAG`).
6
+ */
7
+ export declare const BOUNDED_TEST_IDLE_TIMEOUT_MS = 180000;
8
+ export declare const BOUNDED_TEST_KILL_AFTER_MS = 10000;
9
+ //# sourceMappingURL=test-backstop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-backstop.d.ts","sourceRoot":"","sources":["../src/test-backstop.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,0BAA0B,QAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ // A leaf module with no imports: tests' child processes on plain bun load testing.ts, which reads this bound, so
2
+ // nothing here may pull in a module that needs the typia transform (bounded-test-policy.ts does).
3
+ /**
4
+ * A test target's one bound: the `idleTimeoutMs` with which no test may go unfinished, the hang backstop of
5
+ * specs/cowshed/08_testing.md. It is no wall-clock ceiling: a suite that keeps finishing tests runs as long as it
6
+ * needs. It is the longest any single test may run, so it stays above every slow-timeout class in the plugin's
7
+ * nextest.toml; a bun leg has no per-test deadline of its own (`BUN_TEST_TIMEOUT_FLAG`).
8
+ */
9
+ export const BOUNDED_TEST_IDLE_TIMEOUT_MS = 180_000;
10
+ export const BOUNDED_TEST_KILL_AFTER_MS = 10_000;
@@ -0,0 +1,30 @@
1
+ import { type ChangeRange } from './test-walk-policy.js';
2
+ export type ClockOracleKind = 'runner-deadline' | 'test-deadline' | 'clock-delta' | 'clocked-bound';
3
+ export declare const TEST_CLOCK_ORACLE: {
4
+ id: string;
5
+ /** The leg's no-progress backstop: a bound at or above it, or 0 (disabled), cannot decide a case. */
6
+ backstopMs: number;
7
+ message: {
8
+ 'runner-deadline': string;
9
+ 'test-deadline': string;
10
+ 'clock-delta': string;
11
+ 'clocked-bound': string;
12
+ };
13
+ help: {
14
+ 'runner-deadline': string;
15
+ 'test-deadline': string;
16
+ 'clock-delta': string;
17
+ 'clocked-bound': string;
18
+ };
19
+ };
20
+ export interface ClockOracle {
21
+ readonly kind: ClockOracleKind;
22
+ readonly file: string;
23
+ readonly line: number;
24
+ /** The 1-based column of the site's first character. */
25
+ readonly column: number;
26
+ readonly text: string;
27
+ }
28
+ export declare function findClockOracles(root: string, files: readonly string[], changes?: ReadonlyMap<string, readonly ChangeRange[]>): ClockOracle[];
29
+ export declare function formatClockOracle(oracle: ClockOracle): string;
30
+ //# sourceMappingURL=test-clock-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-clock-policy.d.ts","sourceRoot":"","sources":["../src/test-clock-policy.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,uBAAuB,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,eAAe,GAAG,aAAa,GAAG,eAAe,CAAC;AAEpG,eAAO,MAAM,iBAAiB;;IAE5B,qGAAqG;;;;;;;;;;;;;;CAwBtG,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAslBD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC,GACpD,WAAW,EAAE,CAsBf;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAM7D"}