@smoothbricks/nx-plugin 0.5.7 → 0.6.1
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 +1097 -360
- package/dist/.build-inputs.json +141 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
- package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
- package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
- package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
- package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
- package/dist/bin/smoo-nx-nextest-timings.js +28 -0
- package/dist/bounded-test-policy.d.ts +1 -1
- package/dist/bounded-test-policy.d.ts.map +1 -1
- package/dist/bounded-test-policy.js +14 -15
- package/dist/build-state-output-policy.d.ts +95 -1
- package/dist/build-state-output-policy.d.ts.map +1 -1
- package/dist/build-state-output-policy.js +368 -30
- package/dist/bun-lock-scope.d.ts +44 -0
- package/dist/bun-lock-scope.d.ts.map +1 -0
- package/dist/bun-lock-scope.js +97 -0
- package/dist/cargo-build-script-env.d.ts +49 -0
- package/dist/cargo-build-script-env.d.ts.map +1 -0
- package/dist/cargo-build-script-env.js +324 -0
- package/dist/cargo-closure-input.d.ts +31 -4
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +66 -6
- package/dist/cargo-retention-hook.d.ts +17 -0
- package/dist/cargo-retention-hook.d.ts.map +1 -0
- package/dist/cargo-retention-hook.js +85 -0
- package/dist/cargo-source-hash.d.ts +25 -7
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +108 -43
- package/dist/cargo-toolchain-paths.d.ts +40 -0
- package/dist/cargo-toolchain-paths.d.ts.map +1 -0
- package/dist/cargo-toolchain-paths.js +84 -0
- package/dist/cargo-toolchain-policy.d.ts +25 -8
- package/dist/cargo-toolchain-policy.d.ts.map +1 -1
- package/dist/cargo-toolchain-policy.js +39 -5
- package/dist/cargo-workspace.d.ts +10 -4
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +65 -95
- package/dist/cross-check-policy.d.ts +9 -9
- package/dist/cross-check-policy.d.ts.map +1 -1
- package/dist/cross-check-policy.js +11 -11
- package/dist/disk-command-policy.d.ts.map +1 -1
- package/dist/disk-command-policy.js +1 -0
- package/dist/ensure-built-receipt.d.ts +22 -5
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +168 -48
- package/dist/ensure-built-witness.d.ts +27 -8
- package/dist/ensure-built-witness.d.ts.map +1 -1
- package/dist/ensure-built-witness.js +45 -15
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +9 -1
- package/dist/eslint-config-closure.d.ts +7 -0
- package/dist/eslint-config-closure.d.ts.map +1 -0
- package/dist/eslint-config-closure.js +346 -0
- package/dist/executors/bounded-exec/bounds.d.ts +56 -0
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
- package/dist/executors/bounded-exec/bounds.js +43 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts +28 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.js +20 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +35 -38
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +56 -120
- package/dist/executors/bounded-exec/executor.d.ts +19 -12
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +389 -239
- package/dist/executors/bounded-exec/gateway-lease.d.ts +23 -19
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +102 -29
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
- package/dist/executors/bounded-exec/lease-wait.d.ts +64 -0
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lease-wait.js +72 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
- package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
- package/dist/executors/bounded-exec/lock-wait.js +108 -0
- package/dist/executors/bounded-exec/mbx-pool.d.ts +31 -0
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -0
- package/dist/executors/bounded-exec/mbx-pool.js +24 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
- package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
- package/dist/executors/bounded-exec/owned-subtree.js +178 -0
- package/dist/executors/bounded-exec/progress.d.ts +4 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/progress.js +5 -2
- package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
- package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-attach.js +207 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
- package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
- package/dist/executors/bounded-exec/ram-detach.js +207 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
- package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
- package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +1213 -399
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts +10 -4
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +122 -35
- package/dist/executors/bounded-exec/runner-hook.js +14 -5
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
- package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
- package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
- package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
- package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
- package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
- package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
- package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
- package/dist/executors/bounded-exec/runtime-pin.js +167 -0
- package/dist/executors/bounded-exec/schema.d.ts +18 -1
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.d.ts +48 -11
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +89 -20
- package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
- package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
- package/dist/executors/cargo-zigbuild/executor.js +67 -12
- package/dist/executors/clean-outputs/executor.js +1 -0
- package/dist/executors/scriptc-native/executor.d.ts +79 -0
- package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
- package/dist/executors/scriptc-native/executor.js +367 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
- package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
- package/dist/executors/scriptc-native/ffi-paths.js +25 -0
- package/dist/executors/scriptc-native/schema.d.ts +34 -0
- package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
- package/dist/executors/scriptc-native/schema.js +1 -0
- package/dist/executors/typescript-emit/emit-overrides.d.ts +14 -0
- package/dist/executors/typescript-emit/emit-overrides.d.ts.map +1 -0
- package/dist/executors/typescript-emit/emit-overrides.js +24 -0
- package/dist/executors/typescript-emit/executor.d.ts +3 -1
- package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
- package/dist/executors/typescript-emit/executor.js +146 -33
- package/dist/forbidden-spelling-policy.d.ts +56 -0
- package/dist/forbidden-spelling-policy.d.ts.map +1 -0
- package/dist/forbidden-spelling-policy.js +176 -0
- package/dist/generators/create-package/generator.d.ts.map +1 -1
- package/dist/generators/create-package/generator.js +3 -4
- package/dist/graph-input-contract.d.ts +14 -0
- package/dist/graph-input-contract.d.ts.map +1 -1
- package/dist/graph-input-contract.js +67 -2
- package/dist/index.d.ts +23 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +672 -214
- package/dist/managed-assets.d.ts +2 -0
- package/dist/managed-assets.d.ts.map +1 -1
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +28 -3
- package/dist/managed-files/managed-format.d.ts.map +1 -1
- package/dist/managed-files/managed-format.js +1 -0
- package/dist/managed-files/publish-workflow.js +14 -11
- package/dist/nextest-code-bound.js +1 -0
- package/dist/nextest-timings.d.ts +35 -0
- package/dist/nextest-timings.d.ts.map +1 -0
- package/dist/nextest-timings.js +168 -0
- package/dist/owned-installation.d.ts +6 -5
- package/dist/owned-installation.d.ts.map +1 -1
- package/dist/owned-installation.js +150 -26
- package/dist/package-target-policy.d.ts.map +1 -1
- package/dist/package-target-policy.js +2 -3
- package/dist/process-children.d.ts +7 -0
- package/dist/process-children.d.ts.map +1 -0
- package/dist/process-children.darwin.d.ts +7 -0
- package/dist/process-children.darwin.d.ts.map +1 -0
- package/dist/process-children.darwin.js +13 -0
- package/dist/process-children.js +14 -0
- package/dist/process-children.linux.d.ts +8 -0
- package/dist/process-children.linux.d.ts.map +1 -0
- package/dist/process-children.linux.js +25 -0
- package/dist/process-group.d.ts +108 -0
- package/dist/process-group.d.ts.map +1 -0
- package/dist/process-group.js +171 -0
- package/dist/process-listing.d.ts +7 -0
- package/dist/process-listing.d.ts.map +1 -0
- package/dist/process-listing.js +51 -0
- package/dist/producer-receipts.d.ts +8 -2
- package/dist/producer-receipts.d.ts.map +1 -1
- package/dist/producer-receipts.js +514 -47
- package/dist/task-graph-policy.d.ts +21 -0
- package/dist/task-graph-policy.d.ts.map +1 -0
- package/dist/task-graph-policy.js +91 -0
- package/dist/test-timings.js +4 -4
- package/dist/test-walk-policy.d.ts +14 -5
- package/dist/test-walk-policy.d.ts.map +1 -1
- package/dist/test-walk-policy.js +8 -2
- package/dist/testing.d.ts +73 -28
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +217 -223
- package/dist/tool-bins.d.ts +33 -0
- package/dist/tool-bins.d.ts.map +1 -0
- package/dist/tool-bins.js +72 -0
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +3 -4
- package/dist/wait-why-policy.d.ts +28 -0
- package/dist/wait-why-policy.d.ts.map +1 -0
- package/dist/wait-why-policy.js +223 -0
- package/dist/workspace-config-policy.d.ts +14 -8
- package/dist/workspace-config-policy.d.ts.map +1 -1
- package/dist/workspace-config-policy.js +60 -16
- package/dist/workspace-manifest.d.ts +41 -6
- package/dist/workspace-manifest.d.ts.map +1 -1
- package/dist/workspace-manifest.js +57 -0
- package/executors.json +16 -1
- package/loader.js +2 -0
- package/managed/raw/envrc +11 -0
- package/managed/raw/patches/nx@23.2.1.patch +2840 -199
- package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
- package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
- package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
- package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
- package/managed/raw/tooling/direnv/developer-links.ts +464 -25
- package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
- package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
- package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
- package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
- package/managed/raw/tooling/direnv/repo-path +68 -6
- package/managed/raw/tooling/direnv/secret-references.ts +13 -4
- package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
- package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
- package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
- package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
- package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
- package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
- package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +95 -14
- package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
- package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
- package/src/bin/smoo-nx-nextest-timings.ts +31 -0
- package/src/bounded-test-policy.ts +12 -14
- package/src/build-state-output-policy.ts +458 -34
- package/src/bun-lock-scope.ts +108 -0
- package/src/cargo-build-script-env.ts +265 -0
- package/src/cargo-closure-input.ts +74 -7
- package/src/cargo-retention-hook.ts +94 -0
- package/src/cargo-source-hash.ts +138 -41
- package/src/cargo-toolchain-paths.ts +95 -0
- package/src/cargo-toolchain-policy.ts +49 -5
- package/src/cargo-workspace.ts +72 -123
- package/src/cross-check-policy.ts +12 -10
- package/src/disk-command-policy.ts +1 -0
- package/src/ensure-built-receipt.ts +173 -39
- package/src/ensure-built-witness.ts +62 -10
- package/src/ensure-built.ts +11 -1
- package/src/eslint-config-closure.ts +357 -0
- package/src/executors/bounded-exec/bounds.ts +76 -0
- package/src/executors/bounded-exec/cpu-pool-thread.ts +43 -0
- package/src/executors/bounded-exec/cpu-pool.ts +55 -120
- package/src/executors/bounded-exec/executor.ts +442 -260
- package/src/executors/bounded-exec/gateway-lease.ts +94 -35
- package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
- package/src/executors/bounded-exec/lease-wait.ts +116 -0
- package/src/executors/bounded-exec/lock-wait.ts +141 -0
- package/src/executors/bounded-exec/mbx-pool.ts +48 -0
- package/src/executors/bounded-exec/owned-subtree.ts +235 -0
- package/src/executors/bounded-exec/progress.ts +9 -3
- package/src/executors/bounded-exec/ram-attach.ts +238 -0
- package/src/executors/bounded-exec/ram-detach.ts +226 -0
- package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
- package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
- package/src/executors/bounded-exec/ram-temp.ts +1497 -460
- package/src/executors/bounded-exec/run-cpu-pool.ts +129 -35
- package/src/executors/bounded-exec/runner-hook.ts +14 -6
- package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
- package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
- package/src/executors/bounded-exec/runtime-pin.ts +232 -0
- package/src/executors/bounded-exec/schema.json +11 -2
- package/src/executors/bounded-exec/schema.ts +19 -1
- package/src/executors/bounded-exec/verdict.ts +145 -35
- package/src/executors/cargo-zigbuild/executor.ts +82 -8
- package/src/executors/clean-outputs/executor.ts +1 -0
- package/src/executors/scriptc-native/executor.ts +394 -0
- package/src/executors/scriptc-native/ffi-paths.ts +29 -0
- package/src/executors/scriptc-native/schema.json +60 -0
- package/src/executors/scriptc-native/schema.ts +34 -0
- package/src/executors/typescript-emit/emit-overrides.ts +24 -0
- package/src/executors/typescript-emit/executor.ts +186 -38
- package/src/forbidden-spelling-policy.ts +226 -0
- package/src/generators/create-package/generator.ts +7 -7
- package/src/graph-input-contract.ts +61 -2
- package/src/index.ts +788 -224
- package/src/managed-assets.ts +3 -0
- package/src/managed-files/files.ts +28 -3
- package/src/managed-files/managed-format.ts +1 -0
- package/src/managed-files/publish-workflow.ts +20 -15
- package/src/nextest-code-bound.ts +1 -0
- package/src/nextest-timings.ts +106 -0
- package/src/owned-installation.ts +150 -23
- package/src/package-target-policy.ts +2 -3
- package/src/process-children.darwin.ts +14 -0
- package/src/process-children.linux.ts +33 -0
- package/src/process-children.ts +22 -0
- package/src/process-group.ts +209 -0
- package/src/process-listing.ts +54 -0
- package/src/producer-receipts.ts +92 -41
- package/src/task-graph-policy.ts +98 -0
- package/src/test-walk-policy.ts +23 -8
- package/src/testing.ts +240 -232
- package/src/tool-bins.ts +108 -0
- package/src/typecheck-test-policy.ts +2 -3
- package/src/wait-why-policy.ts +226 -0
- package/src/workspace-config-policy.ts +63 -15
- package/src/workspace-manifest.ts +89 -6
- package/test-timings.json +124 -99
- package/dist/bin/smoo-nx-failures.d.ts +0 -3
- package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
- package/dist/bin/smoo-nx-failures.js +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
- package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
- package/dist/bin/smoo-nx-nextest-extract.js +0 -42
- package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
- package/dist/failure-summary.d.ts +0 -5
- package/dist/failure-summary.d.ts.map +0 -1
- package/dist/failure-summary.js +0 -118
- package/dist/nextest-extraction.d.ts +0 -117
- package/dist/nextest-extraction.d.ts.map +0 -1
- package/dist/nextest-extraction.js +0 -303
- package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
- package/src/__tests__/cargo-closure-filesets.ts +0 -94
- package/src/__tests__/cargo-closure-fixture.ts +0 -113
- package/src/__tests__/counted-cargo-process.ts +0 -286
- package/src/__tests__/counted-cargo.ts +0 -713
- package/src/__tests__/directory-change.ts +0 -27
- package/src/__tests__/fixture-cargo-home.ts +0 -36
- package/src/__tests__/fixture-nx-env.ts +0 -193
- package/src/__tests__/owned-installation.ts +0 -13
- package/src/__tests__/past-tick.ts +0 -12
- package/src/__tests__/progress-clock.ts +0 -43
- package/src/__tests__/runtime-input.ts +0 -23
- package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
- package/src/bin/smoo-nx-failures.ts +0 -4
- package/src/bin/smoo-nx-nextest-extract.ts +0 -44
- package/src/bounded-test-policy.test.ts +0 -1029
- package/src/build-state-output-policy.test.ts +0 -115
- package/src/bun-bootstrap.test.ts +0 -102
- package/src/bun-file-packages.test.ts +0 -47
- package/src/cargo-closure-filesets.test.ts +0 -63
- package/src/cargo-closure-input.property.test.ts +0 -50
- package/src/cargo-closure-input.test.ts +0 -506
- package/src/cargo-closure-key.test.ts +0 -240
- package/src/cargo-resolve-cache.test.ts +0 -1181
- package/src/cargo-source-hash.test.ts +0 -707
- package/src/cargo-workspace.test.ts +0 -615
- package/src/cross-check-policy.test.ts +0 -316
- package/src/disk-command-policy.test.ts +0 -61
- package/src/ensure-built-receipt.test.ts +0 -279
- package/src/ensure-built-witness.test.ts +0 -688
- package/src/ensure-built.test.ts +0 -1462
- package/src/executors/all-verdicts/executor.test.ts +0 -135
- package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
- package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
- package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
- package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
- package/src/executors/bounded-exec/executor-host.test.ts +0 -800
- package/src/executors/bounded-exec/executor.test.ts +0 -1819
- package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
- package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
- package/src/executors/bounded-exec/progress.test.ts +0 -139
- package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
- package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
- package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
- package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
- package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
- package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
- package/src/executors/bounded-exec/verdict.test.ts +0 -545
- package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
- package/src/executors/clean-outputs/executor.test.ts +0 -20
- package/src/executors/typescript-emit/executor.test.ts +0 -83
- package/src/failure-summary.ts +0 -119
- package/src/generators/bounded-test-targets/generator.test.ts +0 -138
- package/src/generators/bun-test-tracing/generator.test.ts +0 -250
- package/src/generators/create-package/generator.test.ts +0 -190
- package/src/generators/make-public/generator.test.ts +0 -137
- package/src/graph-input-contract.test.ts +0 -379
- package/src/host-controller-wiring.test.ts +0 -31
- package/src/index.test.ts +0 -3321
- package/src/linked-snapshots.nx.test.ts +0 -254
- package/src/managed-files/forgejo-artifact.test.ts +0 -395
- package/src/managed-files/generator.test.ts +0 -243
- package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
- package/src/managed-files/json-edit.test.ts +0 -216
- package/src/managed-files/managed-content.test.ts +0 -166
- package/src/managed-files/managed-format-json.test.ts +0 -308
- package/src/managed-files/repo-path.test.ts +0 -172
- package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
- package/src/managed-files/trace-db-artifact.test.ts +0 -7
- package/src/managed-files/tree-permissions.test.ts +0 -109
- package/src/managed-files/tree.test.ts +0 -123
- package/src/manifest-hash.test.ts +0 -219
- package/src/nextest-code-bound.test.ts +0 -161
- package/src/nextest-extraction.test.ts +0 -216
- package/src/nextest-extraction.ts +0 -371
- package/src/nextest-partitions.test.ts +0 -501
- package/src/nx-cache-bound.test.ts +0 -109
- package/src/nx-cache-restore-mtime.test.ts +0 -170
- package/src/nx-daemon-claim.test.ts +0 -279
- package/src/nx-daemon-idle-cpu.test.ts +0 -80
- package/src/nx-daemon-idle-policy.test.ts +0 -111
- package/src/nx-daemon-ignore-files.test.ts +0 -210
- package/src/nx-daemon-root-normalization.test.ts +0 -105
- package/src/nx-daemon-start-never.test.ts +0 -292
- package/src/nx-daemon-validity.test.ts +0 -1055
- package/src/nx-dot-input-policy.test.ts +0 -353
- package/src/nx-failure-life-cycles.test.ts +0 -207
- package/src/nx-files-archive-racy.test.ts +0 -97
- package/src/nx-foreign-workspace-env.test.ts +0 -329
- package/src/nx-incomplete-run-summary.test.ts +0 -70
- package/src/nx-plugin-load-errors.test.ts +0 -120
- package/src/nx-project-graph-errors.test.ts +0 -70
- package/src/nx-project-resolution-cache.test.ts +0 -176
- package/src/nx-raw-inputs.test.ts +0 -166
- package/src/nx-resident-graph-workers.test.ts +0 -112
- package/src/nx-run-information.test.ts +0 -118
- package/src/nx-skipped-task-exit.test.ts +0 -180
- package/src/nx-state-location.test.ts +0 -63
- package/src/nx-store-resolution.test.ts +0 -81
- package/src/nx-task-graph-cycles.test.ts +0 -148
- package/src/nx-task-output-lease.test.ts +0 -550
- package/src/nx-use-local.test.ts +0 -105
- package/src/owned-installation.test.ts +0 -105
- package/src/package-target-policy.test.ts +0 -1014
- package/src/producer-receipts.test.ts +0 -285
- package/src/release-config-policy.test.ts +0 -311
- package/src/runtime-input.test.ts +0 -393
- package/src/serial-group-wiring.test.ts +0 -326
- package/src/task-history-namespace.test.ts +0 -181
- package/src/task-results.test.ts +0 -228
- package/src/test-clock-policy.test.ts +0 -338
- package/src/test-program.test.ts +0 -303
- package/src/test-timings.test.ts +0 -240
- package/src/test-walk-policy.test.ts +0 -620
- package/src/testing.test.ts +0 -509
- package/src/typecheck-test-policy.test.ts +0 -1468
- package/src/typescript-resolution.test.ts +0 -76
- package/src/version-actions.test.ts +0 -80
- package/src/workspace-config-policy.test.ts +0 -737
|
@@ -1,117 +1,223 @@
|
|
|
1
|
-
import { type ProcessEntry } from '../../testing.js';
|
|
2
1
|
import { type PhaseShare } from './disk-lease.js';
|
|
2
|
+
import { type CoverageGap, type SignalledProcess, type SubtreeHandle, type SubtreeOwner } from './owned-subtree.js';
|
|
3
3
|
import type { TempVolumeSpace } from './verdict.js';
|
|
4
4
|
/**
|
|
5
5
|
* The volume's ceiling, plus the revision's sectors. Pages are allocated as they are written and
|
|
6
6
|
* returned when the volume detaches, so this bounds what a runaway suite can take, not what a gate
|
|
7
7
|
* costs. Measured 2026-10-04: a full parallel smoothbricks `lint test build host-controller-test`
|
|
8
8
|
* gate peaked at 1.61 GiB used with 18 concurrent leases; 8 GiB is five times that. That
|
|
9
|
-
* gate also staged cowshed's real-APFS fixture images on the volume, which now stay
|
|
10
|
-
*
|
|
9
|
+
* gate also staged cowshed's real-APFS fixture images on the volume, which now stay outside it,
|
|
10
|
+
* so the peak is an upper bound.
|
|
11
11
|
*/
|
|
12
12
|
export declare const RAM_TEMP_CAPACITY_BYTES: number;
|
|
13
|
+
/**
|
|
14
|
+
* The one length rule of the RAM temp layout (specs/cowshed/01_storage.md, "RAM temp path budget"): a lease directory,
|
|
15
|
+
* the TMPDIR its task gets, is at most this many bytes. It is the layout's worst case, a test namespace's at the largest
|
|
16
|
+
* uid and pid: `/private/var/folders/cowshed/` (29), a u32 uid (10), `/<ns>` (8), `/ram3` (5), `/<pid ≤ 99999>-` (7)
|
|
17
|
+
* and the suffix (6). Production's worst case is 57.
|
|
18
|
+
*/
|
|
19
|
+
export declare const RAM_TMPDIR_MAX_BYTES = 65;
|
|
20
|
+
/** What the rule leaves below a lease for a socket's `/<names>`: 38 bytes. */
|
|
21
|
+
export declare const RAM_TMPDIR_SOCKET_BUDGET_BYTES: number;
|
|
22
|
+
/** The length in bytes of the lease directory process `pid` makes below `mountpoint`. */
|
|
23
|
+
export declare function leaseDirectoryBytes(mountpoint: string, pid: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* How many archives the volume keeps: the failing run under triage and the one before it, the pair a triage compares to
|
|
26
|
+
* tell a flake from a regression. A stated reason, not a measurement.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ARCHIVES_KEPT = 2;
|
|
13
29
|
export interface CommandOutput {
|
|
14
30
|
status: number;
|
|
15
31
|
stdout: string;
|
|
16
32
|
stderr: string;
|
|
33
|
+
/** A bounded wait or a signalled facade is not a terminal disk-child receipt. */
|
|
34
|
+
readonly pending?: {
|
|
35
|
+
/** Diagnostic only: neither this pid's death nor reuse releases detach authority. */
|
|
36
|
+
readonly pid: number | null;
|
|
37
|
+
/** This exact child object's normal exit; null means native completion could not be proved. */
|
|
38
|
+
readonly completion: Promise<CommandOutput | null>;
|
|
39
|
+
};
|
|
17
40
|
}
|
|
18
41
|
/** The host programs the volume lifecycle runs. A seam so the state machine is testable without DiskArbitration. */
|
|
19
|
-
export interface HostCommands {
|
|
20
|
-
run(file: string, args: readonly string[], deadlineMs?: number): Promise<CommandOutput>;
|
|
21
|
-
}
|
|
22
42
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
43
|
+
* Binds an `hdiutil detach <device>` to the I/O Registry entry the caller inventoried the device as: cowshed reads the
|
|
44
|
+
* entry again inside the disk admission and detaches only while it still has the device as its whole disk.
|
|
25
45
|
*/
|
|
26
|
-
export interface
|
|
46
|
+
export interface DetachBinding {
|
|
47
|
+
readonly registryEntry: string;
|
|
48
|
+
}
|
|
49
|
+
/** A RAM disk the gateway attached and holds until this caller keeps or releases it; the gateway detaches it if the caller goes away first. */
|
|
50
|
+
export interface RamDiskLease {
|
|
51
|
+
/** Its whole disk, `/dev/diskN`. */
|
|
52
|
+
readonly device: string;
|
|
53
|
+
/** Its I/O Registry entry, `0x…`, as the gateway read it right after its attach. */
|
|
54
|
+
readonly registryEntry: string;
|
|
27
55
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Every one has exited when this settles; one that would not rejects with its name.
|
|
56
|
+
* The caller owns the disk from here. Err: the gateway refused, or no answer came, and then nothing is known: the
|
|
57
|
+
* gateway may have handed the disk over or left it to its next startup scan, so the caller detaches it by its entry.
|
|
31
58
|
*/
|
|
32
|
-
|
|
59
|
+
keep(): Promise<Result<void, string>>;
|
|
60
|
+
/** The gateway detaches the disk now. Ok: its detach answer; Err: the lease was lost (no answer), so nothing is known of a detach. */
|
|
61
|
+
release(): Promise<Result<CommandOutput, string>>;
|
|
33
62
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
63
|
+
export interface HostCommands {
|
|
64
|
+
run(file: string, args: readonly string[], deadlineMs?: number, binding?: DetachBinding): Promise<CommandOutput>;
|
|
65
|
+
/**
|
|
66
|
+
* Attach a RAM disk of `sectors` 512-byte sectors through its owner, answering its lease. The owner is the cowshed
|
|
67
|
+
* gateway (`ram-lease`), never this task: a helper the task's own job forked would end with it. The gateway holds the
|
|
68
|
+
* disk until the lease is kept or released, and detaches it if this caller goes away first.
|
|
69
|
+
*/
|
|
70
|
+
attachRam(sectors: number): Promise<Result<RamDiskLease, string | RamUnavailable>>;
|
|
71
|
+
/**
|
|
72
|
+
* Exact attach receipts owned by this caller; names and capacity never establish this authority. A disk it owns
|
|
73
|
+
* counts as the volume's even with nothing mounted, which covers an attach whose format never finished; one it holds
|
|
74
|
+
* no receipt for counts only as the volume of its exact name.
|
|
75
|
+
*/
|
|
76
|
+
ownsRamDisk?(disk: AttachedRamDisk): boolean;
|
|
77
|
+
detachRam(device: string, registryEntry: string): Promise<CommandOutput>;
|
|
41
78
|
}
|
|
42
79
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export
|
|
68
|
-
|
|
80
|
+
* How long a process a task left in its subtree gets to exit on SIGTERM before it gets SIGKILL:
|
|
81
|
+
* the time a daemon takes to stop its watcher and its plugin workers, and well under the grace a
|
|
82
|
+
* bounded leg gives its own command.
|
|
83
|
+
*/
|
|
84
|
+
export declare const LEFTOVER_GRACE_MS = 5000;
|
|
85
|
+
/** One coverage gap the supervisor reported for a subtree it retired, as text. */
|
|
86
|
+
export declare function describeCoverageGap(gap: CoverageGap): string;
|
|
87
|
+
/** One process a retirement signalled, as `<pid> (<image>)`. */
|
|
88
|
+
export declare function describeSignalled(entry: SignalledProcess): string;
|
|
89
|
+
/**
|
|
90
|
+
* A test run's host namespace: seven lowercase base-36 characters, the pid of the process that minted it in the first
|
|
91
|
+
* five (zero-padded, so the first is a digit, which begins no production name) and that process's ordinal in the last
|
|
92
|
+
* two. The pid tells a later run whether the namespace's owner is gone. Mirrors `cowshed_os::namespace::TestNamespace`.
|
|
93
|
+
*/
|
|
94
|
+
export type TestNamespace = {
|
|
95
|
+
readonly kind: 'test';
|
|
96
|
+
readonly name: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Whose names a host's RAM temp volume carries: production's, or one test run's own (specs/cowshed/01_storage.md,
|
|
100
|
+
* "Host namespace"). Every path and name the volume takes derives from it (`ramTempPaths`), so no name a test makes can
|
|
101
|
+
* be one production reads, sweeps or reclaims, and no guard compares them. Mirrors
|
|
102
|
+
* `cowshed_os::namespace::HostNamespace`.
|
|
103
|
+
*/
|
|
104
|
+
export type HostNamespace = {
|
|
105
|
+
readonly kind: 'production';
|
|
106
|
+
} | TestNamespace;
|
|
107
|
+
/** The namespace of the user's own volume, which no test leases, creates or detaches. */
|
|
108
|
+
export declare const PRODUCTION: HostNamespace;
|
|
109
|
+
/**
|
|
110
|
+
* The namespace process `pid` mints as its `ordinal`th, encoded as `TestNamespace::of` encodes it:
|
|
111
|
+
* `testNamespace(94769, 3)` is `0214h03`. A pid or an ordinal that does not fit its digits throws.
|
|
112
|
+
*/
|
|
113
|
+
export declare function testNamespace(pid: number, ordinal: number): TestNamespace;
|
|
69
114
|
export interface RamTempPaths {
|
|
70
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* The root the volume mounts below: a directory of `uid`'s with mode 0700, holding the mountpoint and the staging
|
|
117
|
+
* directory. Production's is the per-user root `cowshed setup` makes, `/private/var/folders/cowshed/<uid>`; a test
|
|
118
|
+
* namespace's is the directory of its name below that root, which its fixture makes. mds admits no volume mounted
|
|
119
|
+
* below `/var/folders/`.
|
|
120
|
+
*/
|
|
121
|
+
root: string;
|
|
122
|
+
/** The user that must own `root`. */
|
|
123
|
+
uid: number;
|
|
124
|
+
/**
|
|
125
|
+
* Where the kernel mounts the volume: `<root>/ram<revision>`, so no two revisions stack on one directory. Its length
|
|
126
|
+
* bounds every lease's, which {@link RAM_TMPDIR_MAX_BYTES} caps.
|
|
127
|
+
*/
|
|
71
128
|
mountpoint: string;
|
|
129
|
+
/**
|
|
130
|
+
* The kernel lock, and the ledger beside it: `/private/tmp/<volumeName>.lock` for production,
|
|
131
|
+
* `<root>/ram<revision>.lock` for a test namespace, which keeps its ordinary scratch beside the lock in its own root.
|
|
132
|
+
*/
|
|
72
133
|
lockFile: string;
|
|
73
|
-
/** APFS volume name;
|
|
134
|
+
/** APFS volume name; its marker holds it. `smoo-ram<revision>-<uid>`, with `-<ns>` after it for a test namespace. */
|
|
74
135
|
volumeName: string;
|
|
75
|
-
/** Where the volume is mounted to be marked before
|
|
136
|
+
/** Where the volume is mounted to be marked before it is mounted at `mountpoint`. */
|
|
76
137
|
staging: string;
|
|
77
|
-
/**
|
|
78
|
-
|
|
138
|
+
/**
|
|
139
|
+
* The longest lease directory, a task's TMPDIR, this layout admits: {@link RAM_TMPDIR_MAX_BYTES} for every layout
|
|
140
|
+
* `ramTempPaths` makes. A unit fixture that moves the volume into its own scratch makes no TMPDIR and states
|
|
141
|
+
* `Number.MAX_SAFE_INTEGER`, which survives JSON as Infinity does not.
|
|
142
|
+
*/
|
|
143
|
+
leaseBytesMax: number;
|
|
79
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Where the volume of `user` in `namespace` lives and what it is called. Production's are the user's own: the per-user
|
|
147
|
+
* root `/private/var/folders/cowshed/<uid>`, the mountpoint `<root>/ram3` and staging directory `<root>/ram3-new` below
|
|
148
|
+
* it, the volume `smoo-ram3-<uid>` and its lock in `/private/tmp`. A test namespace's lie in the directory of its name
|
|
149
|
+
* below that root, `<root>/<ns>`: its mountpoint, staging directory and lock (`ram3.lock`) in it, and its name after
|
|
150
|
+
* the volume's (`smoo-ram3-<uid>-<ns>`), so none of its paths or names is production's.
|
|
151
|
+
*/
|
|
80
152
|
export declare function ramTempPaths(user: {
|
|
81
153
|
uid: number;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
154
|
+
}, namespace: HostNamespace): RamTempPaths;
|
|
155
|
+
/** An APFS volume of a RAM disk, as the I/O Registry names it and the mount table places it. */
|
|
156
|
+
export interface RamVolume {
|
|
157
|
+
/** Its `FullName`. A volume is made under its final name and never renamed, so the name says whose it is. */
|
|
158
|
+
name: string;
|
|
159
|
+
/** Where it is mounted, if anywhere. */
|
|
160
|
+
mountpoints: string[];
|
|
161
|
+
}
|
|
162
|
+
/** An attached RAM disk, as the I/O Registry and the mount table show it. */
|
|
85
163
|
export interface RamDisk {
|
|
86
|
-
/**
|
|
87
|
-
|
|
164
|
+
/** Its `IOHDIXHDDriveOutKernel` node's registry entry ID: no later disk has it, where a BSD name passes to the next. */
|
|
165
|
+
entry: string;
|
|
166
|
+
/**
|
|
167
|
+
* The whole disk (`/dev/diskN`): detaching it removes its container and volumes. Null while the disk has published
|
|
168
|
+
* no media yet, part way through its attach.
|
|
169
|
+
*/
|
|
170
|
+
physical: string | null;
|
|
88
171
|
sectors: number;
|
|
89
|
-
/**
|
|
90
|
-
|
|
172
|
+
/** The uid that attached it. */
|
|
173
|
+
uid: number;
|
|
91
174
|
/** Where its volumes are mounted, if anywhere. */
|
|
92
175
|
mountpoints: string[];
|
|
176
|
+
/** Its APFS volumes, by the exact names the I/O Registry gives them: none before it is formatted. */
|
|
177
|
+
volumes: RamVolume[];
|
|
178
|
+
}
|
|
179
|
+
/** A RAM disk with its whole disk published, which a detach can name. */
|
|
180
|
+
export interface AttachedRamDisk extends RamDisk {
|
|
181
|
+
physical: string;
|
|
93
182
|
}
|
|
94
183
|
export interface RamTempLease {
|
|
95
184
|
/** The task's TMPDIR: a directory on the volume that only this task uses. */
|
|
96
185
|
directory: string;
|
|
97
186
|
mountpoint: string;
|
|
98
|
-
|
|
187
|
+
/**
|
|
188
|
+
* The attach of the volume the lease was taken on ({@link MountedVolume.attach}). A read of the mountpoint that finds
|
|
189
|
+
* another attach, or none, is not this lease's volume: its free space is some other filesystem's.
|
|
190
|
+
*/
|
|
191
|
+
attach: string;
|
|
192
|
+
}
|
|
193
|
+
export interface RamUnavailable {
|
|
194
|
+
readonly kind: 'ram-unavailable';
|
|
195
|
+
readonly reason: 'gateway-unsupported' | 'gateway-absent' | 'unproven-owner';
|
|
196
|
+
readonly detail: string;
|
|
99
197
|
}
|
|
100
198
|
export type RamTempAcquisition =
|
|
101
199
|
/**
|
|
102
200
|
* `held`: dead leases that could not be reclaimed, each with what still holds it. `reaped`: the
|
|
103
|
-
* processes
|
|
201
|
+
* processes the supervisor retired from dead leases' recorded subtrees before those leases went,
|
|
202
|
+
* as `<pid> (<image>)`. `gaps`: where the supervisor's view of those subtrees may have missed one.
|
|
104
203
|
*/
|
|
105
204
|
{
|
|
106
205
|
kind: 'leased';
|
|
107
206
|
lease: RamTempLease;
|
|
108
207
|
held: string[];
|
|
109
208
|
reaped: string[];
|
|
209
|
+
gaps: string[];
|
|
210
|
+
/** What became of each dead lease's scratch this acquire reclaimed: archived and kept, or deleted and why. */
|
|
211
|
+
retained: string[];
|
|
110
212
|
}
|
|
111
213
|
/** Inside a cowshed sandbox: /private/tmp is not writable and no image can attach. */
|
|
112
214
|
| {
|
|
113
215
|
kind: 'sandboxed';
|
|
114
216
|
detail: string;
|
|
217
|
+
} | {
|
|
218
|
+
kind: 'unavailable';
|
|
219
|
+
reason: RamUnavailable['reason'];
|
|
220
|
+
detail: string;
|
|
115
221
|
};
|
|
116
222
|
/** A host command or filesystem step failed while the volume was being created, mounted or detached. */
|
|
117
223
|
type ProvisionFailed = {
|
|
@@ -119,13 +225,37 @@ type ProvisionFailed = {
|
|
|
119
225
|
step: string;
|
|
120
226
|
detail: string;
|
|
121
227
|
};
|
|
122
|
-
export type RamTempError = ProvisionFailed
|
|
228
|
+
export type RamTempError = RamUnavailable | ProvisionFailed
|
|
123
229
|
/** A failed task left the volume (nearly) full: the likely cause of its failure. */
|
|
124
230
|
| {
|
|
125
231
|
kind: 'volume-full';
|
|
126
232
|
mountpoint: string;
|
|
127
233
|
capacityBytes: number;
|
|
128
234
|
freeBytes: number;
|
|
235
|
+
}
|
|
236
|
+
/** The lease went while its task held it: its volume was detached or replaced, or its directory removed. */
|
|
237
|
+
| {
|
|
238
|
+
kind: 'lease-lost';
|
|
239
|
+
lease: string;
|
|
240
|
+
mountpoint: string;
|
|
241
|
+
detail: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The root the volume mounts below, the per-user root or a test namespace's directory, is missing or is not the
|
|
245
|
+
* user's 0700 directory.
|
|
246
|
+
*/
|
|
247
|
+
| {
|
|
248
|
+
kind: 'root-unready';
|
|
249
|
+
root: string;
|
|
250
|
+
detail: string;
|
|
251
|
+
}
|
|
252
|
+
/** The lease this caller would make is longer than its layout admits: refused before anything is made. */
|
|
253
|
+
| {
|
|
254
|
+
kind: 'lease-path-budget';
|
|
255
|
+
mountpoint: string;
|
|
256
|
+
pid: number;
|
|
257
|
+
bytes: number;
|
|
258
|
+
most: number;
|
|
129
259
|
};
|
|
130
260
|
export type Result<T, E> = {
|
|
131
261
|
ok: true;
|
|
@@ -135,54 +265,203 @@ export type Result<T, E> = {
|
|
|
135
265
|
error: E;
|
|
136
266
|
};
|
|
137
267
|
export declare function describeRamTempError(error: RamTempError): string;
|
|
268
|
+
/** Settles once every archive deletion this process has queued so far has finished; a test seam, and the detach's wait. */
|
|
269
|
+
export declare function archiveDeletions(): Promise<void>;
|
|
138
270
|
export declare class RamTempVolume {
|
|
139
271
|
private readonly paths;
|
|
140
|
-
private readonly capacityBytes;
|
|
141
272
|
private readonly commands;
|
|
142
273
|
private readonly pid;
|
|
143
274
|
private readonly isAlive;
|
|
144
|
-
private readonly
|
|
275
|
+
private readonly policy;
|
|
145
276
|
/** The RAM disk's size, which with the attaching user identifies this module's disks on the host. */
|
|
146
277
|
private readonly sectors;
|
|
147
278
|
/** The claims and held verdicts the lock admits changes to, beside the lock file. */
|
|
148
279
|
private readonly ledgerPath;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Where optional RAM's ordinary fallback makes its owned scratch: the lock's own directory, which an unavailable answer
|
|
282
|
+
* has just written. For the user's volume that is `/private/tmp`, outside every checkout, so no Git or Cargo walk from
|
|
283
|
+
* the command's temp files finds the workspace it builds; the workspace's runtime alias resolves into
|
|
284
|
+
* `<mount>/.cowshed/run`, inside the checkout, and the inherited TMPDIR may be RAM. A test namespace's lock lies in
|
|
285
|
+
* its own root, so its ordinary scratch does too.
|
|
286
|
+
*/
|
|
287
|
+
readonly ordinaryParent: string;
|
|
288
|
+
constructor(paths: RamTempPaths, capacityBytes: number, commands: HostCommands, pid?: number, isAlive?: (pid: number) => boolean, policy?: 'required' | 'optional');
|
|
289
|
+
/**
|
|
290
|
+
* Take a lease: create the volume if no task holds one, and a private directory on it. A dead
|
|
291
|
+
* lease found on the way is settled through `subtrees`, the supervisor that owns the caller.
|
|
292
|
+
*/
|
|
293
|
+
acquire(subtrees: SubtreeOwner): Promise<Result<RamTempAcquisition, RamTempError>>;
|
|
294
|
+
/** Make a lease directory for `op`'s caller, recorded so a failed acquire takes it back. */
|
|
152
295
|
private make;
|
|
296
|
+
/**
|
|
297
|
+
* Undo a failed acquire: take back the lease made for it, which may have been the volume's last
|
|
298
|
+
* with every release already past it, so then detach the volume as the last release would have.
|
|
299
|
+
* Answers what failed on the way.
|
|
300
|
+
*/
|
|
153
301
|
private undo;
|
|
302
|
+
/**
|
|
303
|
+
* Take back the lease made for a caller that never got it. No task has used it, so it is empty:
|
|
304
|
+
* `rmdir` removes only that, follows no link, and refuses a directory with a mount on it. A
|
|
305
|
+
* directory that is no longer the one made, by identity, is left where it is and named.
|
|
306
|
+
*/
|
|
154
307
|
private unmake;
|
|
155
308
|
private lease;
|
|
309
|
+
/** With this caller's creation claim published: provision the volume, then take the first lease on it. */
|
|
156
310
|
private create;
|
|
157
311
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* behind, and costs a scan of every process only when the lease still holds anything.
|
|
312
|
+
* Record the supervisor's handle on the subtree whose command uses `lease`, beside the lease, so
|
|
313
|
+
* that if this task dies before it retires that subtree, whoever settles the dead lease can hand
|
|
314
|
+
* the handle back to the supervisor instead of guessing from a census who worked there.
|
|
162
315
|
*/
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
|
|
316
|
+
record(lease: RamTempLease, handle: SubtreeHandle): Promise<Result<void, RamTempError>>;
|
|
317
|
+
/**
|
|
318
|
+
* End a lease; the last lease detaches the volume, returning its RAM. `keep` archives the lease's scratch instead of
|
|
319
|
+
* deleting it: its run did not pass. A dead lease found on the way is settled through `subtrees`. Answers what became
|
|
320
|
+
* of every scratch this release reclaimed, its own included.
|
|
321
|
+
*/
|
|
322
|
+
release(lease: RamTempLease, keep: boolean, subtrees: SubtreeOwner): Promise<Result<string[], RamTempError>>;
|
|
166
323
|
private releaseLease;
|
|
324
|
+
/**
|
|
325
|
+
* Wait out another caller's creation or detach. Liveness of its owner is its pid's, so a crashed
|
|
326
|
+
* owner whose pid was reused holds every caller here; past each `CLAIM_WAIT_NOTICE_MS` on the same
|
|
327
|
+
* claim, stderr names it with the wait so far.
|
|
328
|
+
*/
|
|
167
329
|
private waitOut;
|
|
168
|
-
/**
|
|
330
|
+
/**
|
|
331
|
+
* After a failed task: whether the volume ran out of space, which is then the error to report. A lease no longer on
|
|
332
|
+
* its volume is said by its release, and a volume that cannot be read has no space to report.
|
|
333
|
+
*/
|
|
169
334
|
fullness(lease: RamTempLease): Promise<RamTempError | null>;
|
|
170
|
-
/**
|
|
171
|
-
|
|
335
|
+
/**
|
|
336
|
+
* The lease's volume and the space left on it now, measured only while the mountpoint holds the attach the lease was
|
|
337
|
+
* taken on and the lease is still on it: a bare mountpoint's statfs reads the host's Data volume, whose free space is
|
|
338
|
+
* not the lease's. A lease that went with its volume, or from it, is `lost`; a read that failed is `unread`.
|
|
339
|
+
*/
|
|
340
|
+
space(lease: RamTempLease): Promise<TempVolumeSpace>;
|
|
172
341
|
private lock;
|
|
342
|
+
/**
|
|
343
|
+
* Yield to another caller's lifecycle claim. Every claim is queued behind, a detach whose live caller still waits on
|
|
344
|
+
* its facade included. Reported custody, or waiting custody whose caller died, admits nothing until its exact
|
|
345
|
+
* registry entry is gone: the caller's liveness only chooses between queueing and reporting, never clears custody.
|
|
346
|
+
*/
|
|
347
|
+
private yieldTo;
|
|
348
|
+
/** A detach nobody waits on any more can be reconciled only against its exact registry identity, outside the lock. */
|
|
349
|
+
private reconcileDetach;
|
|
350
|
+
/** Publish authority before spawn: a crash anywhere after this point must not admit a lease past the detach. */
|
|
351
|
+
private runDetach;
|
|
352
|
+
/** Only this operation's exact terminal receipt can clear its pending authority; a late receipt cannot clear a successor. */
|
|
353
|
+
private finishDetach;
|
|
354
|
+
/** Its caller stops waiting on the detach: the exact custody becomes reported, its facade pid kept for diagnosis. */
|
|
355
|
+
private reportDetach;
|
|
356
|
+
/** Drop finished claims, never the authority of a detach whose caller merely stopped waiting. */
|
|
173
357
|
private end;
|
|
358
|
+
/**
|
|
359
|
+
* One step under the lock: read the ledger, void the claims of dead owners and the verdicts of
|
|
360
|
+
* another volume or a lease that is gone, observe the volume, and publish what `change` returns.
|
|
361
|
+
* `change` reads metadata and takes or names directories; it runs no host command.
|
|
362
|
+
*/
|
|
174
363
|
private locked;
|
|
364
|
+
/** The ledger as published, and its text; none yet is an empty one. Only this module writes it, whole. */
|
|
175
365
|
private readLedger;
|
|
366
|
+
/**
|
|
367
|
+
* The volume when it is mounted at the mountpoint, identified by its marker; else null. Its key
|
|
368
|
+
* names this attach: the root's and the marker's identity and birth, and the marker's change
|
|
369
|
+
* time, which nothing changes once it is written. The root's own times change with every lease.
|
|
370
|
+
*/
|
|
176
371
|
private observe;
|
|
372
|
+
/** Prove this immutable marker belongs to the exact live attachment, outside the lock. */
|
|
373
|
+
private validateProvenance;
|
|
374
|
+
/** Capture only the exact whole disk this attach answered, before any filesystem mutation. */
|
|
375
|
+
private attachedIdentity;
|
|
376
|
+
/**
|
|
377
|
+
* Under the lock: claim `own`, the caller's ending lease if any, and every dead lease no other
|
|
378
|
+
* caller is settling. A dead lease whose cached verdict still validates is named held and left
|
|
379
|
+
* unclaimed: that proof costs `lstat` calls, not a host-wide probe, so no caller waits on it.
|
|
380
|
+
*/
|
|
177
381
|
private claim;
|
|
382
|
+
/**
|
|
383
|
+
* Outside the lock: settle the leases this caller claimed. Every dead one's recorded subtree is
|
|
384
|
+
* handed back to the supervisor first, and only then is the pass's one inventory read, so no
|
|
385
|
+
* inventory older than a lease's retirement approves its removal. Anything attached from below a
|
|
386
|
+
* lease keeps it: an image backed by a file there would be left pinned to a deleted file, and
|
|
387
|
+
* detaching it here would race the owner that releases it under its own lease; a mount there is
|
|
388
|
+
* backed elsewhere — a cowshed workspace adopted from a fixture checkout, say — and `rm -r` would
|
|
389
|
+
* delete its contents through the mount. A kept lease gets a verdict to publish, when its
|
|
390
|
+
* holders have cheap lifetime keys. A lease nothing holds is reclaimed once the lock confirms it
|
|
391
|
+
* is as claimed: a kept one's scratch is renamed into the archive (`retain`), any other deleted.
|
|
392
|
+
*/
|
|
178
393
|
private settle;
|
|
394
|
+
/**
|
|
395
|
+
* Keep the newest {@link ARCHIVES_KEPT} archives while at least {@link ARCHIVE_FLOOR_SHARE} of the volume is free, and
|
|
396
|
+
* none below that; rename every other one out of the archive and delete it in the background. Answers, for each lease
|
|
397
|
+
* just archived, where its scratch is kept or why it was not. The floor is read once, here, as an archive arrives.
|
|
398
|
+
*/
|
|
399
|
+
private retain;
|
|
400
|
+
/**
|
|
401
|
+
* Queue the deletion of the archives this process renamed out, and of any a dead deleter left, behind this process's
|
|
402
|
+
* earlier ones. Nothing waits for it. A failure is said on stderr and leaves its entry for the next deleter.
|
|
403
|
+
*/
|
|
404
|
+
private deleteArchives;
|
|
405
|
+
private emptyDeleting;
|
|
406
|
+
/**
|
|
407
|
+
* Under the lock: the claimed leases still as claimed — this caller's claim on the same
|
|
408
|
+
* directory, and a task still gone. Any other is left for a fresh look, never removed.
|
|
409
|
+
*/
|
|
179
410
|
private unchanged;
|
|
411
|
+
/** Check the root the volume mounts below, detach what earlier creators left, then attach and provision the volume. */
|
|
180
412
|
private provisionVolume;
|
|
413
|
+
/**
|
|
414
|
+
* Provision the leased disk, record it in the ledger as the kept volume's disk, and keep it once its volume is mounted
|
|
415
|
+
* and marked at its mountpoint. A record whose keep then fails names a disk the rollback detaches.
|
|
416
|
+
*/
|
|
417
|
+
private provisionAndKeep;
|
|
418
|
+
/**
|
|
419
|
+
* End the lease of a volume that failed. The gateway detaches the disk on release, by its registry entry and without
|
|
420
|
+
* force, so a busy owned staging volume is retained. A lease lost to a gateway restart answers no release: this caller
|
|
421
|
+
* then detaches the exact disk itself, under its ledger's custody, so no later lease is admitted on a disk the next
|
|
422
|
+
* gateway's startup scan removes.
|
|
423
|
+
*/
|
|
424
|
+
private rollBack;
|
|
425
|
+
/**
|
|
426
|
+
* Create the volume under its final name, mount it with `mount_apfs` at the private staging
|
|
427
|
+
* directory, and mark it there. Then `umount` that private mount and mount the volume with
|
|
428
|
+
* `mount_apfs` again at the mountpoint, after the marker, so the volume never reaches the
|
|
429
|
+
* mountpoint unmarked. Nothing is renamed (see the module comment). The staging mount is the
|
|
430
|
+
* kernel's, so the kernel releases it: a Disk Arbitration unmount waits in its one queue behind
|
|
431
|
+
* its own probe of the fresh RAM disk (5.1 s for the `zfs` probe alone in `log stream`;
|
|
432
|
+
* 6.5–6.7 s per unmount against 64–69 ms for `umount`, measured 2026-10-15). A crash before
|
|
433
|
+
* the final mount leaves the volume attached at the staging directory or unmounted; the next
|
|
434
|
+
* creator's reclaim detaches either.
|
|
435
|
+
*/
|
|
181
436
|
private provision;
|
|
182
437
|
private expectMounted;
|
|
438
|
+
/**
|
|
439
|
+
* This volume's RAM disks attached on the host, read from the I/O Registry, which omits no attached disk: the ones
|
|
440
|
+
* `volumeDisks` names. A RAM disk of this user and size that is not this volume's, another volume's, a test's, or an
|
|
441
|
+
* unformatted one nothing recorded, is not its to inventory or detach, and is ignored. One of its own still
|
|
442
|
+
* publishing its media is named, never passed over.
|
|
443
|
+
*/
|
|
183
444
|
private attached;
|
|
445
|
+
/**
|
|
446
|
+
* The registry entries the ledger records: the one it keeps pending detach custody of, exact and published before the
|
|
447
|
+
* spawn, and the disk whose volume a creator last kept.
|
|
448
|
+
*/
|
|
449
|
+
private custody;
|
|
450
|
+
/**
|
|
451
|
+
* Detach what earlier creators left attached: no marked volume is mounted, so every RAM disk of this volume
|
|
452
|
+
* (`attached`: by its exact name or its exact record) is debris — unformatted and recorded, staged, mounted
|
|
453
|
+
* without its marker, or the kept volume's disk an operator's unmount left mounted nowhere. One carrying a lease, or
|
|
454
|
+
* with anything attached below it, is still in use and stops the creation instead, and so does one its owner holds no
|
|
455
|
+
* receipt for and its ledger does not record as kept: it is named, never detached.
|
|
456
|
+
*/
|
|
184
457
|
private reclaimStrays;
|
|
458
|
+
/**
|
|
459
|
+
* With this caller's detach claim published, which no caller takes a lease past. Every lease is
|
|
460
|
+
* gone, so nothing below the volume should be attached; whatever is would lose its backing file
|
|
461
|
+
* to the detach. The lock confirms the volume, still empty, and the claim before it goes.
|
|
462
|
+
*/
|
|
185
463
|
private detach;
|
|
464
|
+
/** The host's attachments as one pass reads them: one `ioreg` run and one `mount` run. */
|
|
186
465
|
private readInventory;
|
|
187
466
|
/**
|
|
188
467
|
* The holder check of one creation pass. The first check reads the attachments and every later
|
|
@@ -203,22 +482,38 @@ export declare function mountsBelow(table: string, prefix: string): string[];
|
|
|
203
482
|
/** The disk `diskutil apfs` reports it created: "Disk from APFS operation: disk271". */
|
|
204
483
|
export declare function operationDisk(stdout: string): string | null;
|
|
205
484
|
/**
|
|
206
|
-
* The RAM disks in `
|
|
207
|
-
*
|
|
208
|
-
* the
|
|
485
|
+
* The RAM disks in `ioreg -r -c IOHDIXHDDriveOutKernel -l -w0` output, with the mounts `mount` output gives them. A RAM
|
|
486
|
+
* disk is a legacy DiskImages device served by a diskimages-helper: each starts a `+-o IOHDIXHDDriveOutKernel` entry
|
|
487
|
+
* whose own properties carry `image-path` <"ram://<sectors>"> and `owner-uid`, and the `BSD Name`s below it are its
|
|
488
|
+
* whole disk first, then its APFS container and volumes; each volume node carries its `FullName` beside its `BSD Name`,
|
|
489
|
+
* which is how a volume's name reaches its mounts. The registry is the kernel's record, and unlike `hdiutil info`,
|
|
490
|
+
* which drops images while another attaches or detaches, it leaves out no attached disk. So an entry this cannot read
|
|
491
|
+
* is an error, never a disk left out: a partial read must not stand for an absent disk.
|
|
209
492
|
*/
|
|
210
|
-
export declare function ramDisksIn(
|
|
493
|
+
export declare function ramDisksIn(registry: string, table: string): Result<RamDisk[], string>;
|
|
494
|
+
/**
|
|
495
|
+
* The RAM disks of `disks` that are this volume's, and no others. A disk is the volume's only when it has its user and
|
|
496
|
+
* its exact size, mounts nowhere but at its mountpoint or staging directory, and either carries a volume called exactly
|
|
497
|
+
* its name that is mounted, or is recorded: `recorded` says the disk's exact registry entry is one this volume's owner
|
|
498
|
+
* holds a receipt or its ledger holds custody for, which covers an attach whose format never finished, or records as
|
|
499
|
+
* the disk a creator kept, which covers a volume unmounted from under it. A disk's size and owner establish nothing, so
|
|
500
|
+
* an unmounted disk of the same size that nothing recorded is not the volume's.
|
|
501
|
+
*/
|
|
502
|
+
export declare function volumeDisks(disks: readonly RamDisk[], paths: Pick<RamTempPaths, 'uid' | 'mountpoint' | 'staging' | 'volumeName'>, sectors: number, recorded: (disk: RamDisk) => boolean): RamDisk[];
|
|
503
|
+
/**
|
|
504
|
+
* Detach a RAM disk an inventory found, by its whole-disk name, bound to the registry entry the inventory read it as.
|
|
505
|
+
* A BSD name passes to the next disk once its disk goes, and a detach can queue for the disk admission meanwhile, so
|
|
506
|
+
* the gateway reads the entry again inside its own admission, immediately before it spawns `hdiutil`, and
|
|
507
|
+
* refuses, detaching nothing, unless the entry still names this whole disk (specs/cowshed/06_cli.md, `--registry-entry`).
|
|
508
|
+
* That refusal is this detach's failure, named, and never retried with `-force`: this process did not just attach the
|
|
509
|
+
* disk. The window that remains is cowshed's, from its read to hdiutil's own open of the name.
|
|
510
|
+
*/
|
|
511
|
+
export declare function detachRamDisk(commands: Pick<HostCommands, 'detachRam'>, disk: AttachedRamDisk, step: string): Promise<Result<void, ProvisionFailed>>;
|
|
211
512
|
/** Disk tools delegate their lease and process lifetime to cowshed, with one image policy. */
|
|
212
|
-
export declare function diskCommand(file: string, args: readonly string[], deadlineMs: number): {
|
|
513
|
+
export declare function diskCommand(file: string, args: readonly string[], deadlineMs: number, binding?: DetachBinding, gatewaySocket?: string): {
|
|
213
514
|
args: string[];
|
|
214
515
|
lifetime: 'stop-wait' | 'facade-owned';
|
|
215
516
|
} | null;
|
|
216
|
-
/**
|
|
217
|
-
* The variable naming the cowshed executable that runs `cowshed disk-command`. Unset, it is the installed `cowshed`
|
|
218
|
-
* on PATH. A repository that tests its own cowshed sets it, on the targets that test it, to that checkout's build:
|
|
219
|
-
* an installed cowshed that predates a command its own checkout added would fail the very code under test.
|
|
220
|
-
*/
|
|
221
|
-
export declare const COWSHED_EXECUTABLE_ENV = "COWSHED_EXECUTABLE";
|
|
222
517
|
/**
|
|
223
518
|
* hdiutil and diskutil delegate process lifetime and disk leasing to cowshed: safe commands
|
|
224
519
|
* pass their total budget and wait for the facade's actual exit after child reap. Only image
|
|
@@ -226,7 +521,12 @@ export declare const COWSHED_EXECUTABLE_ENV = "COWSHED_EXECUTABLE";
|
|
|
226
521
|
* device until reboot. Never acquire a second lease around the facade. Other leased helpers
|
|
227
522
|
* take their lease here. Recorded lease waits ask for `alone`; an older gateway is asked
|
|
228
523
|
* shared at once, and for a minute after.
|
|
524
|
+
*
|
|
525
|
+
* `gatewaySocket` is the gateway every disk lease, facade admission and RAM attach and detach goes through. It has no
|
|
526
|
+
* default: the caller names it. The Nx executor names the host's own, `GATEWAY_SOCKET`, which `disk-command` defaults
|
|
527
|
+
* to, so the facade is not told of it and a cowshed that predates `--gateway-socket` still serves it. A host proof
|
|
528
|
+
* names its fixture's, which the facade is told of.
|
|
229
529
|
*/
|
|
230
|
-
export declare function createHostCommands(
|
|
530
|
+
export declare function createHostCommands(gatewaySocket: string, defaultDeadlineMs?: number, wantedShare?: PhaseShare, cowshed?: string): HostCommands;
|
|
231
531
|
export {};
|
|
232
532
|
//# sourceMappingURL=ram-temp.d.ts.map
|