@waffle-os/runtime 0.0.0-stage → 0.0.145
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/Cargo.lock +250 -0
- package/Cargo.toml +16 -0
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +191 -0
- package/browser/diagnostic.ts +58 -0
- package/browser/display/generated/graphics-layout.ts +18 -0
- package/browser/display/guest.ts +87 -0
- package/browser/display/launch-retention.ts +59 -0
- package/browser/display/open.ts +45 -0
- package/browser/display/owner.ts +563 -0
- package/browser/display/protocol.ts +24 -0
- package/browser/display/service-protocol.ts +28 -0
- package/browser/display/service-readers.ts +96 -0
- package/browser/filesystem-backend.ts +57 -0
- package/browser/filesystem-worker-backend.ts +27 -0
- package/browser/fs-worker.ts +13 -0
- package/browser/gpu/access.ts +62 -0
- package/browser/gpu/buffers.ts +273 -0
- package/browser/gpu/codec.ts +426 -0
- package/browser/gpu/command-reader.ts +90 -0
- package/browser/gpu/completions.ts +437 -0
- package/browser/gpu/generated/tables.ts +7513 -0
- package/browser/gpu/guest.ts +267 -0
- package/browser/gpu/handles.ts +143 -0
- package/browser/gpu/lowering.ts +238 -0
- package/browser/gpu/metadata.ts +364 -0
- package/browser/gpu/method-coverage.json +1933 -0
- package/browser/gpu/payload.ts +117 -0
- package/browser/gpu/protocol.ts +61 -0
- package/browser/gpu/replay.ts +1067 -0
- package/browser/gpu/ring.ts +336 -0
- package/browser/gpu/scheduler.ts +151 -0
- package/browser/gpu/service-worker.ts +20 -0
- package/browser/gpu/service.ts +490 -0
- package/browser/gpu/stream.json +4175 -0
- package/browser/gpu/surfaces.ts +433 -0
- package/browser/gpu/transport.ts +317 -0
- package/browser/gpu/upstream/LICENSE +29 -0
- package/browser/gpu/upstream/webgpu.h +6774 -0
- package/browser/gpu/upstream/webgpu.yml +5532 -0
- package/browser/guarded-stream.ts +63 -0
- package/browser/net/address.ts +132 -0
- package/browser/net/buffer-module.ts +64 -0
- package/browser/net/helper.ts +1237 -0
- package/browser/net/host.ts +982 -0
- package/browser/net/http1.ts +372 -0
- package/browser/net/module.ts +45 -0
- package/browser/net/namespace.ts +416 -0
- package/browser/net/network.buffer.d.ts +10 -0
- package/browser/net/network.buffer.js +11960 -0
- package/browser/net/network.buffer.sha256 +1 -0
- package/browser/net/network.growth.json +1 -0
- package/browser/net/network.input-hash +1 -0
- package/browser/net/network.sha256 +1 -0
- package/browser/net/network.wasm +0 -0
- package/browser/net/outbound-socket.ts +253 -0
- package/browser/net/outbound.ts +42 -0
- package/browser/net/owner.ts +55 -0
- package/browser/net/protocol.ts +136 -0
- package/browser/net/ring.ts +198 -0
- package/browser/net/runtime.ts +235 -0
- package/browser/net/tcp-status.ts +7 -0
- package/browser/net/transport.ts +26 -0
- package/browser/net/unix-paths.ts +260 -0
- package/browser/net/unix-status.ts +39 -0
- package/browser/notification-blocking-wait.ts +54 -0
- package/browser/notification-relay.ts +76 -0
- package/browser/notification-wait.ts +241 -0
- package/browser/notification-worker.ts +105 -0
- package/browser/persistent-resident-owner.ts +368 -0
- package/browser/preview-host.ts +595 -0
- package/browser/preview-protocol.ts +20 -0
- package/browser/preview.ts +179 -0
- package/browser/preview1-network-types.ts +20 -0
- package/browser/preview1-network.ts +77 -0
- package/browser/preview1-socket.ts +278 -0
- package/browser/preview1-worker.ts +18 -0
- package/browser/process-broker.ts +3859 -0
- package/browser/process-context.ts +56 -0
- package/browser/process-start.ts +130 -0
- package/browser/publication-authority.ts +437 -0
- package/browser/runtime-terminals.ts +183 -0
- package/browser/service-worker.ts +237 -0
- package/browser/shared-fs.ts +725 -0
- package/browser/terminal-input.ts +574 -0
- package/browser/terminal-lifetime.ts +42 -0
- package/browser/terminal-output.ts +491 -0
- package/browser/terminal-session.ts +2225 -0
- package/browser/worker-memory.ts +131 -0
- package/browser/worker-pool.ts +17 -0
- package/browser/worker.ts +1589 -0
- package/build.ts +375 -0
- package/core/descriptors.ts +284 -0
- package/core/devices.ts +20 -0
- package/core/fd-reopen.ts +210 -0
- package/core/filesystem.ts +154 -0
- package/core/index.ts +21 -0
- package/core/memory-views.ts +74 -0
- package/core/open-file.ts +173 -0
- package/core/path.ts +26 -0
- package/core/rights.ts +33 -0
- package/core/unwind.ts +2 -0
- package/core/wasi.ts +1459 -0
- package/dist/browser/diagnostic.js +42 -0
- package/dist/browser/display/generated/graphics-layout.js +17 -0
- package/dist/browser/display/guest.js +78 -0
- package/dist/browser/display/launch-retention.js +35 -0
- package/dist/browser/display/open.js +18 -0
- package/dist/browser/display/owner.js +506 -0
- package/dist/browser/display/protocol.js +0 -0
- package/dist/browser/display/service-protocol.js +0 -0
- package/dist/browser/display/service-readers.js +88 -0
- package/dist/browser/filesystem-backend.js +29 -0
- package/dist/browser/filesystem-worker-backend.js +20 -0
- package/dist/browser/fs-worker.js +10 -0
- package/dist/browser/gpu/access.js +65 -0
- package/dist/browser/gpu/buffers.js +212 -0
- package/dist/browser/gpu/codec.js +426 -0
- package/dist/browser/gpu/command-reader.js +82 -0
- package/dist/browser/gpu/completions.js +372 -0
- package/dist/browser/gpu/generated/tables.js +7492 -0
- package/dist/browser/gpu/guest.js +239 -0
- package/dist/browser/gpu/handles.js +147 -0
- package/dist/browser/gpu/lowering.js +234 -0
- package/dist/browser/gpu/metadata.js +311 -0
- package/dist/browser/gpu/payload.js +91 -0
- package/dist/browser/gpu/protocol.js +55 -0
- package/dist/browser/gpu/replay.js +871 -0
- package/dist/browser/gpu/ring.js +244 -0
- package/dist/browser/gpu/scheduler.js +124 -0
- package/dist/browser/gpu/service-worker.js +16 -0
- package/dist/browser/gpu/service.js +460 -0
- package/dist/browser/gpu/surfaces.js +394 -0
- package/dist/browser/gpu/transport.js +293 -0
- package/dist/browser/guarded-stream.js +44 -0
- package/dist/browser/net/address.js +98 -0
- package/dist/browser/net/buffer-module.js +60 -0
- package/dist/browser/net/helper.js +1065 -0
- package/dist/browser/net/host.js +896 -0
- package/dist/browser/net/http1.js +305 -0
- package/dist/browser/net/module.js +36 -0
- package/dist/browser/net/namespace.js +396 -0
- package/dist/browser/net/network.buffer.js +11960 -0
- package/dist/browser/net/network.buffer.sha256 +1 -0
- package/dist/browser/net/network.growth.json +1 -0
- package/dist/browser/net/network.input-hash +1 -0
- package/dist/browser/net/network.sha256 +1 -0
- package/dist/browser/net/network.wasm +0 -0
- package/dist/browser/net/outbound-socket.js +226 -0
- package/dist/browser/net/outbound.js +8 -0
- package/dist/browser/net/owner.js +51 -0
- package/dist/browser/net/protocol.js +23 -0
- package/dist/browser/net/ring.js +143 -0
- package/dist/browser/net/runtime.js +177 -0
- package/dist/browser/net/tcp-status.js +5 -0
- package/dist/browser/net/transport.js +12 -0
- package/dist/browser/net/unix-paths.js +178 -0
- package/dist/browser/net/unix-status.js +33 -0
- package/dist/browser/notification-blocking-wait.js +38 -0
- package/dist/browser/notification-relay.js +50 -0
- package/dist/browser/notification-wait.js +179 -0
- package/dist/browser/notification-worker.js +83 -0
- package/dist/browser/persistent-resident-owner.js +264 -0
- package/dist/browser/preview-host.js +435 -0
- package/dist/browser/preview-protocol.js +0 -0
- package/dist/browser/preview.js +161 -0
- package/dist/browser/preview1-network-types.js +0 -0
- package/dist/browser/preview1-network.js +58 -0
- package/dist/browser/preview1-socket.js +273 -0
- package/dist/browser/preview1-worker.js +13 -0
- package/dist/browser/process-broker.js +3062 -0
- package/dist/browser/process-context.js +22 -0
- package/dist/browser/process-start.js +71 -0
- package/dist/browser/publication-authority.js +404 -0
- package/dist/browser/runtime-terminals.js +97 -0
- package/dist/browser/service-worker.js +196 -0
- package/dist/browser/shared-fs.js +563 -0
- package/dist/browser/terminal-input.js +562 -0
- package/dist/browser/terminal-lifetime.js +30 -0
- package/dist/browser/terminal-output.js +415 -0
- package/dist/browser/terminal-session.js +1854 -0
- package/dist/browser/worker-memory.js +107 -0
- package/dist/browser/worker-pool.js +14 -0
- package/dist/browser/worker.js +1208 -0
- package/dist/core/descriptors.js +216 -0
- package/dist/core/devices.js +16 -0
- package/dist/core/fd-reopen.js +185 -0
- package/dist/core/filesystem.js +38 -0
- package/dist/core/index.js +8 -0
- package/dist/core/memory-views.js +48 -0
- package/dist/core/open-file.js +141 -0
- package/dist/core/path.js +25 -0
- package/dist/core/rights.js +31 -0
- package/dist/core/unwind.js +2 -0
- package/dist/core/wasi.js +1136 -0
- package/dist/fs/backend.js +885 -0
- package/dist/fs/checkpoint-pressure.js +81 -0
- package/dist/fs/cleanup.js +13 -0
- package/dist/fs/client.js +1745 -0
- package/dist/fs/directory-pages.js +166 -0
- package/dist/fs/dirty-admission.js +196 -0
- package/dist/fs/file-identity.js +149 -0
- package/dist/fs/glob.js +154 -0
- package/dist/fs/guest-watch.js +173 -0
- package/dist/fs/identity-allocation.js +24 -0
- package/dist/fs/idle-database.js +113 -0
- package/dist/fs/idle-owner.js +290 -0
- package/dist/fs/idle-walk.js +112 -0
- package/dist/fs/idle-workspace.js +41 -0
- package/dist/fs/index.js +49 -0
- package/dist/fs/indexeddb-chunks.js +109 -0
- package/dist/fs/indexeddb.js +1421 -0
- package/dist/fs/memory-admission.js +18 -0
- package/dist/fs/memory-budget.js +665 -0
- package/dist/fs/memory.js +1103 -0
- package/dist/fs/namespace-cursor.js +241 -0
- package/dist/fs/namespace-projection-memory-budget.js +59 -0
- package/dist/fs/namespace-projection-owner.js +116 -0
- package/dist/fs/namespace-projection-table.js +660 -0
- package/dist/fs/opfs.js +751 -0
- package/dist/fs/persisted-tree.js +44 -0
- package/dist/fs/persistent.js +819 -0
- package/dist/fs/protocol.js +406 -0
- package/dist/fs/publication-attachment.js +1102 -0
- package/dist/fs/publication-grant.js +463 -0
- package/dist/fs/publication-internal.js +16 -0
- package/dist/fs/publication-memory-budget.js +71 -0
- package/dist/fs/publication-workspace.js +231 -0
- package/dist/fs/publication.js +1294 -0
- package/dist/fs/request-memory.js +728 -0
- package/dist/fs/root-construction.js +94 -0
- package/dist/fs/root-memory-budget.js +66 -0
- package/dist/fs/safe-staging.js +547 -0
- package/dist/fs/section.js +37 -0
- package/dist/fs/service.js +1732 -0
- package/dist/fs/shared-capacity.js +5 -0
- package/dist/fs/shared-version-pages.js +46 -0
- package/dist/fs/shared.js +1943 -0
- package/dist/fs/startup.js +26 -0
- package/dist/fs/storage-geometry.js +29 -0
- package/dist/fs/storage-maintenance.js +45 -0
- package/dist/fs/storage.js +306 -0
- package/dist/fs/utf8-size.js +22 -0
- package/dist/fs/vfs-format.js +2 -0
- package/dist/fs/vfs-internal.js +4 -0
- package/dist/fs/vfs.js +121 -0
- package/dist/fs/walk.js +296 -0
- package/dist/fs/watch-account.js +293 -0
- package/dist/fs/watch-arena.js +60 -0
- package/dist/fs/watch-capture.js +77 -0
- package/dist/fs/watch-id-index.js +150 -0
- package/dist/fs/watch-index.js +288 -0
- package/dist/fs/watch-names.js +140 -0
- package/dist/fs/watch-ring.js +172 -0
- package/dist/fs/watch-routing.js +54 -0
- package/dist/fs/watch-service.js +282 -0
- package/dist/fs/watch-subscriptions.js +381 -0
- package/dist/fs/watch.js +78 -0
- package/dist/fs/workspace-archive.js +631 -0
- package/dist/fs/workspace-export.js +309 -0
- package/dist/fs/workspace-import-admission.js +111 -0
- package/dist/fs/workspace-index.js +15 -0
- package/dist/fs/workspace-namespace.js +89 -0
- package/dist/fs/workspace-protocol.js +303 -0
- package/dist/fs/workspace-read.js +576 -0
- package/dist/fs/workspace-search.js +618 -0
- package/dist/fs/workspace-stream.js +210 -0
- package/dist/fs/workspace-types.js +21 -0
- package/dist/fs/workspace.js +557 -0
- package/dist/group/member.js +360 -0
- package/dist/group/protocol.js +35 -0
- package/dist/group/ranges.js +50 -0
- package/dist/group/state.js +846 -0
- package/dist/index.js +27 -0
- package/dist/interrupt/admitted-store.js +180 -0
- package/dist/interrupt/check.js +8 -0
- package/dist/interrupt/index.js +3 -0
- package/dist/interrupt/loader-internal.js +243 -0
- package/dist/interrupt/loader.js +10 -0
- package/dist/interrupt/rewriter-internal.js +942 -0
- package/dist/interrupt/rewriter.js +4 -0
- package/dist/interrupt/wait.js +75 -0
- package/dist/link/code.js +195 -0
- package/dist/link/group.js +258 -0
- package/dist/link/image.js +100 -0
- package/dist/link/index.js +7 -0
- package/dist/link/issuance.js +9 -0
- package/dist/link/metadata.js +455 -0
- package/dist/link/plan.js +264 -0
- package/dist/link/relay.js +46 -0
- package/dist/link/worker.js +44 -0
- package/dist/memory/allocator.js +15 -0
- package/dist/memory/control.js +70 -0
- package/dist/memory/declarations.js +242 -0
- package/dist/memory/graphics-retention.js +10 -0
- package/dist/memory/index.js +8 -0
- package/dist/memory/platform.js +57 -0
- package/dist/memory/reservations.js +970 -0
- package/dist/proc/abi.js +794 -0
- package/dist/proc/access.js +7 -0
- package/dist/proc/admission.js +17 -0
- package/dist/proc/command-runner.js +108 -0
- package/dist/proc/command-stdio.js +176 -0
- package/dist/proc/command.js +8 -0
- package/dist/proc/control.js +145 -0
- package/dist/proc/directory.js +790 -0
- package/dist/proc/errors.js +20 -0
- package/dist/proc/exec.js +37 -0
- package/dist/proc/filesystem-codec.js +60 -0
- package/dist/proc/identity.js +54 -0
- package/dist/proc/index.js +59 -0
- package/dist/proc/intrinsics/core.js +65 -0
- package/dist/proc/intrinsics/host.js +251 -0
- package/dist/proc/intrinsics.js +98 -0
- package/dist/proc/node-wasi.js +312 -0
- package/dist/proc/observation.js +233 -0
- package/dist/proc/outcome.js +237 -0
- package/dist/proc/pipes.js +1301 -0
- package/dist/proc/registry.js +293 -0
- package/dist/proc/signals.js +179 -0
- package/dist/proc/start-diagnostic.js +100 -0
- package/dist/proc/start-errno.js +24 -0
- package/dist/proc/start-failure.js +25 -0
- package/dist/proc/stub.js +17 -0
- package/dist/proc/supervisor.js +1541 -0
- package/dist/proc/table.js +195 -0
- package/dist/proc/terminal-lifetime.js +117 -0
- package/dist/proc/terminal-turn.js +50 -0
- package/dist/proc/types.js +77 -0
- package/dist/proc/wait-status.js +3 -0
- package/dist/proc/worker-access.js +117 -0
- package/dist/proc/worker-broker.js +853 -0
- package/dist/proc/worker-client.js +856 -0
- package/dist/proc/worker-pipes.js +165 -0
- package/dist/programs/catalog.js +27 -0
- package/dist/programs/collection.js +276 -0
- package/dist/programs/download.js +70 -0
- package/dist/programs/index.js +358 -0
- package/dist/runtime.js +761 -0
- package/dist/search/engine.js +299 -0
- package/dist/search/format.js +83 -0
- package/dist/search/index.js +3 -0
- package/dist/search/matcher.js +102 -0
- package/dist/search/paths.js +7 -0
- package/dist/search/search-worker.js +4 -0
- package/dist/search/shard-worker.js +74 -0
- package/dist/search/shards.js +529 -0
- package/dist/search/types.js +7 -0
- package/dist/tests/error-serialization.js +36 -0
- package/dist/tests/page-runner/bootstrap-diagnostics.js +29 -0
- package/dist/tests/page-runner/bootstrap-navigation.js +11 -0
- package/dist/tests/page-runner/browser-observation.js +421 -0
- package/dist/tests/page-runner/collector-fetch.js +70 -0
- package/dist/tests/page-runner/collector.js +635 -0
- package/dist/tests/page-runner/console-observation.js +24 -0
- package/dist/tests/page-runner/continuity-lock-diagnostic.js +301 -0
- package/dist/tests/page-runner/driver.js +41 -0
- package/dist/tests/page-runner/framework-bootstrap.js +9 -0
- package/dist/tests/page-runner/framework-collector.js +219 -0
- package/dist/tests/page-runner/framework-host.js +680 -0
- package/dist/tests/page-runner/framework-http-body.js +47 -0
- package/dist/tests/page-runner/framework-middleware.js +60 -0
- package/dist/tests/page-runner/framework-page.js +12 -0
- package/dist/tests/page-runner/framework-queue.js +344 -0
- package/dist/tests/page-runner/framework-trace.js +458 -0
- package/dist/tests/page-runner/framework-validation.js +44 -0
- package/dist/tests/page-runner/framework.js +7 -0
- package/dist/tests/page-runner/inspector-endpoint-receipt.js +308 -0
- package/dist/tests/page-runner/inspector-endpoint.js +34 -0
- package/dist/tests/page-runner/inspector-plist.js +300 -0
- package/dist/tests/page-runner/inspector-stream.js +99 -0
- package/dist/tests/page-runner/owned-consumers.js +34 -0
- package/dist/tests/page-runner/protocol.js +183 -0
- package/dist/tests/page-runner/report-chunks.js +124 -0
- package/dist/tests/page-runner/report-control.js +7 -0
- package/dist/tests/page-runner/report-stream.js +9 -0
- package/dist/tests/page-runner/result-file.js +15 -0
- package/dist/tests/page-runner/safari-console.js +32 -0
- package/dist/tests/page-runner/safari-driver.js +614 -0
- package/dist/tests/page-runner/safari-observer.js +552 -0
- package/dist/tests/page-runner/service-worker-page.js +93 -0
- package/dist/tests/page-runner/stall-diagnostics.js +506 -0
- package/dist/thread/entry.js +108 -0
- package/dist/thread/guest-bootstrap.js +8 -0
- package/dist/thread/guest-imports.js +272 -0
- package/dist/thread/guest-module.js +4 -0
- package/dist/thread/guest-worker.js +120 -0
- package/dist/thread/lane.js +419 -0
- package/dist/thread/protocol.js +0 -0
- package/dist/thread/runtime-owner.js +561 -0
- package/dist/thread/runtime-protocol.js +0 -0
- package/dist/thread/service-worker.js +81 -0
- package/dist/thread/service.js +396 -0
- package/dist/tooling/program/program-build-tools.js +341 -0
- package/dist/tooling/program/program-build-tools.ts +440 -0
- package/dist/tooling/program/program-derivation.js +102 -0
- package/dist/tooling/program/program-derivation.ts +175 -0
- package/dist/tooling/program/program-optimize.js +246 -0
- package/dist/tooling/program/program-optimize.ts +330 -0
- package/dist/tooling/program/program-transformer.json +1 -0
- package/fs/backend.ts +1111 -0
- package/fs/checkpoint-pressure.ts +102 -0
- package/fs/cleanup.ts +13 -0
- package/fs/client.ts +2187 -0
- package/fs/directory-pages.ts +177 -0
- package/fs/dirty-admission.ts +216 -0
- package/fs/file-identity.ts +175 -0
- package/fs/glob.ts +142 -0
- package/fs/guest-watch.ts +217 -0
- package/fs/identity-allocation.ts +41 -0
- package/fs/idle-database.ts +130 -0
- package/fs/idle-owner.ts +353 -0
- package/fs/idle-walk.ts +126 -0
- package/fs/idle-workspace.ts +88 -0
- package/fs/index.ts +79 -0
- package/fs/indexeddb-chunks.ts +180 -0
- package/fs/indexeddb.ts +1709 -0
- package/fs/memory-admission.ts +19 -0
- package/fs/memory-budget.ts +753 -0
- package/fs/memory.ts +1262 -0
- package/fs/namespace-cursor.ts +260 -0
- package/fs/namespace-projection-memory-budget.ts +58 -0
- package/fs/namespace-projection-owner.ts +149 -0
- package/fs/namespace-projection-table.ts +723 -0
- package/fs/opfs.ts +914 -0
- package/fs/persisted-tree.ts +43 -0
- package/fs/persistent.ts +934 -0
- package/fs/protocol.ts +573 -0
- package/fs/publication-attachment.ts +1269 -0
- package/fs/publication-grant.ts +651 -0
- package/fs/publication-internal.ts +96 -0
- package/fs/publication-memory-budget.ts +77 -0
- package/fs/publication-workspace.ts +242 -0
- package/fs/publication.ts +1820 -0
- package/fs/request-memory.ts +883 -0
- package/fs/root-construction.ts +101 -0
- package/fs/root-memory-budget.ts +64 -0
- package/fs/safe-staging.ts +757 -0
- package/fs/section.ts +42 -0
- package/fs/service.ts +2163 -0
- package/fs/shared-capacity.ts +7 -0
- package/fs/shared-version-pages.ts +59 -0
- package/fs/shared.ts +2454 -0
- package/fs/startup.ts +64 -0
- package/fs/storage-geometry.ts +37 -0
- package/fs/storage-maintenance.ts +95 -0
- package/fs/storage.ts +435 -0
- package/fs/utf8-size.ts +23 -0
- package/fs/vfs-format.ts +3 -0
- package/fs/vfs-internal.ts +10 -0
- package/fs/vfs.ts +203 -0
- package/fs/walk.ts +416 -0
- package/fs/watch-account.ts +312 -0
- package/fs/watch-arena.ts +58 -0
- package/fs/watch-capture.ts +79 -0
- package/fs/watch-id-index.ts +145 -0
- package/fs/watch-index.ts +313 -0
- package/fs/watch-names.ts +139 -0
- package/fs/watch-ring.ts +187 -0
- package/fs/watch-routing.ts +51 -0
- package/fs/watch-service.ts +269 -0
- package/fs/watch-subscriptions.ts +393 -0
- package/fs/watch.ts +81 -0
- package/fs/workspace-archive.ts +721 -0
- package/fs/workspace-export.ts +389 -0
- package/fs/workspace-import-admission.ts +157 -0
- package/fs/workspace-index.ts +16 -0
- package/fs/workspace-namespace.ts +96 -0
- package/fs/workspace-protocol.ts +371 -0
- package/fs/workspace-read.ts +652 -0
- package/fs/workspace-search.ts +788 -0
- package/fs/workspace-stream.ts +274 -0
- package/fs/workspace-types.ts +195 -0
- package/fs/workspace.ts +639 -0
- package/group/member.ts +424 -0
- package/group/protocol.ts +83 -0
- package/group/ranges.ts +51 -0
- package/group/state.ts +1128 -0
- package/index.ts +151 -0
- package/interrupt/admitted-store.ts +245 -0
- package/interrupt/check.ts +15 -0
- package/interrupt/index.ts +3 -0
- package/interrupt/loader-internal.ts +333 -0
- package/interrupt/loader.ts +17 -0
- package/interrupt/rewriter-internal.ts +971 -0
- package/interrupt/rewriter.ts +13 -0
- package/interrupt/wait.ts +111 -0
- package/link/code.ts +145 -0
- package/link/group.ts +396 -0
- package/link/image.ts +124 -0
- package/link/index.ts +12 -0
- package/link/issuance.ts +20 -0
- package/link/metadata.ts +586 -0
- package/link/plan.ts +369 -0
- package/link/relay.ts +80 -0
- package/link/worker.ts +53 -0
- package/memory/allocator.ts +20 -0
- package/memory/control.ts +87 -0
- package/memory/declarations.ts +296 -0
- package/memory/graphics-retention.ts +14 -0
- package/memory/index.ts +21 -0
- package/memory/platform.ts +94 -0
- package/memory/reservations.ts +1421 -0
- package/network/Cargo.toml +26 -0
- package/network/src/abi.rs +100 -0
- package/network/src/lib.rs +440 -0
- package/network/src/module.rs +329 -0
- package/network/src/native.rs +395 -0
- package/network/src/queue.rs +29 -0
- package/network/src/virtual_net.rs +467 -0
- package/network/tests/host_abi.rs +66 -0
- package/network/tests/module.rs +627 -0
- package/network/tests/state.rs +258 -0
- package/network/tests/support/mod.rs +56 -0
- package/network/tests/transport.rs +220 -0
- package/network/tests/virtual.rs +174 -0
- package/package.json +695 -4
- package/patches/wasi-libc/preopen-scan.patch +24 -0
- package/prepare.ts +26 -0
- package/proc/abi.ts +1013 -0
- package/proc/access.ts +21 -0
- package/proc/admission.ts +70 -0
- package/proc/command-runner.ts +131 -0
- package/proc/command-stdio.ts +199 -0
- package/proc/command.ts +53 -0
- package/proc/control.ts +198 -0
- package/proc/directory.ts +928 -0
- package/proc/errors.ts +20 -0
- package/proc/exec.ts +46 -0
- package/proc/filesystem-codec.ts +79 -0
- package/proc/identity.ts +55 -0
- package/proc/index.ts +116 -0
- package/proc/intrinsics/core.ts +81 -0
- package/proc/intrinsics/host.ts +342 -0
- package/proc/intrinsics.ts +98 -0
- package/proc/node-wasi.ts +397 -0
- package/proc/observation.ts +293 -0
- package/proc/outcome.ts +276 -0
- package/proc/pipes.ts +1546 -0
- package/proc/registry.ts +521 -0
- package/proc/signals.ts +247 -0
- package/proc/start-diagnostic.ts +109 -0
- package/proc/start-errno.ts +25 -0
- package/proc/start-failure.ts +49 -0
- package/proc/stub.ts +28 -0
- package/proc/supervisor.ts +1852 -0
- package/proc/table.ts +343 -0
- package/proc/terminal-lifetime.ts +125 -0
- package/proc/terminal-turn.ts +62 -0
- package/proc/types.ts +200 -0
- package/proc/wait-status.ts +5 -0
- package/proc/worker-access.ts +143 -0
- package/proc/worker-broker.ts +1024 -0
- package/proc/worker-client.ts +1133 -0
- package/proc/worker-pipes.ts +212 -0
- package/programs/catalog.ts +44 -0
- package/programs/collection.ts +349 -0
- package/programs/download.ts +92 -0
- package/programs/index.ts +584 -0
- package/runtime.ts +1062 -0
- package/rust-toolchain.toml +5 -0
- package/scripts/browser-command.ts +34 -0
- package/scripts/browser-supervisor.ts +158 -0
- package/scripts/build-c-thread-fixture.ts +430 -0
- package/scripts/build-gpu-fixture.ts +279 -0
- package/scripts/build-memory-group-fixture.ts +147 -0
- package/scripts/build-thread-fixture.ts +205 -0
- package/scripts/build-wasi-libc.sh +87 -0
- package/scripts/c-threads-fixture-producer.test.ts +86 -0
- package/scripts/owned-command.ts +89 -0
- package/scripts/test-browser.ts +109 -0
- package/scripts/test-wasi-libc.ts +108 -0
- package/scripts/threads-fixture-producer.test.ts +177 -0
- package/search/engine.ts +363 -0
- package/search/format.ts +102 -0
- package/search/index.ts +11 -0
- package/search/matcher.ts +134 -0
- package/search/paths.ts +11 -0
- package/search/search-worker.ts +6 -0
- package/search/shard-worker.ts +115 -0
- package/search/shards.ts +683 -0
- package/search/types.ts +46 -0
- package/tests/aggregate-memory-contract.test.ts +620 -0
- package/tests/asset-load-recovery-browser-runner.ts +179 -0
- package/tests/asset-load-recovery.test.ts +117 -0
- package/tests/blocking-read-lock-contention.test.ts +305 -0
- package/tests/bootstrap-arrival-browser-runner.ts +19 -0
- package/tests/bootstrap-arrival-runner.test.ts +89 -0
- package/tests/browser-command-real.test.ts +124 -0
- package/tests/browser-command.test.ts +342 -0
- package/tests/browser-controls-discovery.test.ts +64 -0
- package/tests/browser-filesystem-cancel.test.ts +248 -0
- package/tests/browser-filesystem-disposal.test.ts +469 -0
- package/tests/browser-filesystem-failure.test.ts +74 -0
- package/tests/browser-filesystem-options.test.ts +190 -0
- package/tests/browser-filesystem-service-port.test.ts +239 -0
- package/tests/browser-matrix.test.ts +559 -0
- package/tests/browser-navigation-browser-runner.ts +121 -0
- package/tests/browser-navigation.test.ts +106 -0
- package/tests/browser-navigation.ts +49 -0
- package/tests/browser-net-services.test.ts +472 -0
- package/tests/browser-net.test.ts +310 -0
- package/tests/browser-process-broker.test.ts +4172 -0
- package/tests/browser-runner-lifecycle.test.ts +200 -0
- package/tests/browser-runner-lifecycle.ts +318 -0
- package/tests/browser-worker.test.ts +2736 -0
- package/tests/buffer-boundaries.test.ts +52 -0
- package/tests/c-threads-embedding-runner.ts +84 -0
- package/tests/c-threads-fixture-inspect.ts +23 -0
- package/tests/c-threads-fixture.test.ts +142 -0
- package/tests/c-threads-packet-runner.ts +6 -0
- package/tests/c-threads-packet.ts +132 -0
- package/tests/c-threads-paths.test.ts +83 -0
- package/tests/c-threads-positive-worker.ts +5 -0
- package/tests/c-threads-runtime-browser-runner.ts +122 -0
- package/tests/c-threads-runtime-browser.ts +334 -0
- package/tests/c-threads-runtime-guest.ts +14 -0
- package/tests/c-threads-runtime.test.ts +68 -0
- package/tests/c-threads-safari-runner.ts +178 -0
- package/tests/checkpoint-failure-browser.ts +97 -0
- package/tests/checkpoint-pressure.test.ts +602 -0
- package/tests/child-diagnostic-browser.ts +166 -0
- package/tests/child-diagnostic-worker.ts +25 -0
- package/tests/child-diagnostics.test.ts +114 -0
- package/tests/ci-browser-install.test.ts +244 -0
- package/tests/cold-descriptor-lifecycle.test.ts +170 -0
- package/tests/cold-descriptor-read.test.ts +245 -0
- package/tests/core-import-boundaries.test.ts +92 -0
- package/tests/core-size-contract.test.ts +327 -0
- package/tests/default-allocation-parity.test.ts +184 -0
- package/tests/descendant-preparation.test.ts +726 -0
- package/tests/descendant-real-worker.test.ts +505 -0
- package/tests/descriptors.test.ts +71 -0
- package/tests/dev-null.test.ts +157 -0
- package/tests/diagnostic-drain.test.ts +62 -0
- package/tests/dirty-admission.test.ts +572 -0
- package/tests/durable-file-identity.test.ts +586 -0
- package/tests/durable-identity-storage.test.ts +112 -0
- package/tests/error-serialization.test.ts +94 -0
- package/tests/error-serialization.ts +34 -0
- package/tests/exec-integration.test.ts +94 -0
- package/tests/fd-reopen.test.ts +4 -0
- package/tests/file-offset-contention.test.ts +186 -0
- package/tests/file-times.test.ts +353 -0
- package/tests/filesystem-allocation-context.test.ts +198 -0
- package/tests/filesystem-atomic.test.ts +564 -0
- package/tests/filesystem-capacity.test.ts +34 -0
- package/tests/filesystem-client-intrinsics.test.ts +286 -0
- package/tests/filesystem-codec.test.ts +227 -0
- package/tests/filesystem-conditional-remove.test.ts +200 -0
- package/tests/filesystem-endpoint-observer.test.ts +371 -0
- package/tests/filesystem-glob.test.ts +38 -0
- package/tests/filesystem-io-fastpath.test.ts +339 -0
- package/tests/filesystem-large-file.test.ts +61 -0
- package/tests/filesystem-lazy-backing.test.ts +440 -0
- package/tests/filesystem-nonblocking.test.ts +339 -0
- package/tests/filesystem-permissions.test.ts +348 -0
- package/tests/filesystem-persistence-shared.test.ts +375 -0
- package/tests/filesystem-port-transport.test.ts +275 -0
- package/tests/filesystem-private-input.test.ts +1155 -0
- package/tests/filesystem-publication-grant.test.ts +674 -0
- package/tests/filesystem-publication-workspace.test.ts +2105 -0
- package/tests/filesystem-publication.test.ts +1774 -0
- package/tests/filesystem-quiescence-rearm.test.ts +76 -0
- package/tests/filesystem-quiescence.test.ts +522 -0
- package/tests/filesystem-readlink-shared.test.ts +311 -0
- package/tests/filesystem-ready-disposal-browser-runner.ts +243 -0
- package/tests/filesystem-refcount.test.ts +550 -0
- package/tests/filesystem-request-memory.test.ts +202 -0
- package/tests/filesystem-request-pool.test.ts +408 -0
- package/tests/filesystem-retired-release.test.ts +37 -0
- package/tests/filesystem-review.test.ts +284 -0
- package/tests/filesystem-segment.test.ts +339 -0
- package/tests/filesystem-shared.test.ts +304 -0
- package/tests/filesystem-shutdown-browser-debt.ts +267 -0
- package/tests/filesystem-shutdown-browser-runner.ts +524 -0
- package/tests/filesystem-shutdown-browser.ts +290 -0
- package/tests/filesystem-shutdown-close-observation.test.ts +437 -0
- package/tests/filesystem-shutdown-close-observation.ts +206 -0
- package/tests/filesystem-shutdown-observer.test.ts +93 -0
- package/tests/filesystem-shutdown.test.ts +893 -0
- package/tests/filesystem-staged-write.test.ts +909 -0
- package/tests/filesystem-stop-observer.ts +50 -0
- package/tests/filesystem-storage-geometry.test.ts +404 -0
- package/tests/filesystem-transfer.test.ts +135 -0
- package/tests/filesystem-transport-browser-driver.ts +28 -0
- package/tests/filesystem-transport-browser-runner.ts +134 -0
- package/tests/filesystem-transport-browser.ts +179 -0
- package/tests/filesystem-transport-codec.test.ts +96 -0
- package/tests/filesystem-walk.test.ts +524 -0
- package/tests/filesystem-worker.test.ts +676 -0
- package/tests/first-worker-import.ts +118 -0
- package/tests/fixtures/asset-load-recovery-page.ts +95 -0
- package/tests/fixtures/bigint-hooks.ts +28 -0
- package/tests/fixtures/browser-cell-clone.ts +100 -0
- package/tests/fixtures/browser-process-child.ts +25 -0
- package/tests/fixtures/buffer-boundaries.ts +65 -0
- package/tests/fixtures/cold-descriptor-guest.ts +58 -0
- package/tests/fixtures/cold-descriptor.ts +162 -0
- package/tests/fixtures/cold-range-proof-lifecycle.ts +136 -0
- package/tests/fixtures/default-allocation-capture.ts +239 -0
- package/tests/fixtures/descendant-real-worker.ts +121 -0
- package/tests/fixtures/diagnostic-public.ts +14 -0
- package/tests/fixtures/documented-startup-control.ts +33 -0
- package/tests/fixtures/durable-identity-opfs.ts +123 -0
- package/tests/fixtures/exec-browser-worker.ts +5 -0
- package/tests/fixtures/exec-guest.ts +279 -0
- package/tests/fixtures/exec-integration.ts +305 -0
- package/tests/fixtures/exec-node-control.ts +22 -0
- package/tests/fixtures/exec-node-host.ts +31 -0
- package/tests/fixtures/exec-node-worker.ts +11 -0
- package/tests/fixtures/exec-worker.ts +33 -0
- package/tests/fixtures/fd-kind-cases.ts +81 -0
- package/tests/fixtures/fd-reopen-cases.ts +489 -0
- package/tests/fixtures/file-offset-contention.ts +110 -0
- package/tests/fixtures/file-only-abi.ts +48 -0
- package/tests/fixtures/file-times-guest.ts +151 -0
- package/tests/fixtures/file-times-storage.ts +76 -0
- package/tests/fixtures/file-times-worker.ts +16 -0
- package/tests/fixtures/file-times.ts +16 -0
- package/tests/fixtures/filesystem-atomic-guest.ts +94 -0
- package/tests/fixtures/filesystem-default-service.ts +3 -0
- package/tests/fixtures/filesystem-diagnostic-transfer-failure.ts +15 -0
- package/tests/fixtures/filesystem-endpoint-observer.ts +159 -0
- package/tests/fixtures/filesystem-endpoint-service.ts +53 -0
- package/tests/fixtures/filesystem-file.ts +23 -0
- package/tests/fixtures/filesystem-guest.ts +119 -0
- package/tests/fixtures/filesystem-host.ts +47 -0
- package/tests/fixtures/filesystem-offset-guest.ts +48 -0
- package/tests/fixtures/filesystem-permissions-worker.ts +44 -0
- package/tests/fixtures/filesystem-port-service.ts +32 -0
- package/tests/fixtures/filesystem-port-worker.ts +71 -0
- package/tests/fixtures/filesystem-proc-guest.ts +59 -0
- package/tests/fixtures/filesystem-quiescence-guest.ts +23 -0
- package/tests/fixtures/filesystem-refcount-guest.ts +75 -0
- package/tests/fixtures/filesystem-request-release-worker.ts +32 -0
- package/tests/fixtures/filesystem-segment-guest.ts +46 -0
- package/tests/fixtures/filesystem-service.ts +17 -0
- package/tests/fixtures/filesystem-shutdown-debt-page.ts +178 -0
- package/tests/fixtures/filesystem-shutdown-debt-worker.ts +116 -0
- package/tests/fixtures/filesystem-shutdown-page.ts +288 -0
- package/tests/fixtures/filesystem-shutdown-worker.ts +168 -0
- package/tests/fixtures/filesystem-startup-failure.ts +24 -0
- package/tests/fixtures/filesystem-transport-observation-worker.ts +5 -0
- package/tests/fixtures/filesystem-walk-worker.ts +45 -0
- package/tests/fixtures/generic-memory-node-worker.ts +16 -0
- package/tests/fixtures/global-lock-holder.ts +55 -0
- package/tests/fixtures/gpu/async-expected.json +506 -0
- package/tests/fixtures/gpu/async-host.ts +263 -0
- package/tests/fixtures/gpu/async-native.ts +507 -0
- package/tests/fixtures/gpu/async-page.ts +193 -0
- package/tests/fixtures/gpu/async.c +463 -0
- package/tests/fixtures/gpu/async_encode.h +170 -0
- package/tests/fixtures/gpu/bootstrap-cleanup-worker.ts +135 -0
- package/tests/fixtures/gpu/bundle-query-expected.json +400 -0
- package/tests/fixtures/gpu/bundle-query-fixture.ts +121 -0
- package/tests/fixtures/gpu/bundle-query-native.ts +674 -0
- package/tests/fixtures/gpu/compute-expected.json +187 -0
- package/tests/fixtures/gpu/compute-native.ts +418 -0
- package/tests/fixtures/gpu/copy-draw-expected.json +372 -0
- package/tests/fixtures/gpu/copy-draw-fixture.ts +82 -0
- package/tests/fixtures/gpu/copy-draw-native.ts +690 -0
- package/tests/fixtures/gpu/core-fixture.ts +202 -0
- package/tests/fixtures/gpu/core-transport-worker.ts +76 -0
- package/tests/fixtures/gpu/desktop-arm-contract.ts +180 -0
- package/tests/fixtures/gpu/desktop-fairness-contract.ts +99 -0
- package/tests/fixtures/gpu/desktop-fairness-observation.ts +79 -0
- package/tests/fixtures/gpu/disposal-retirement.ts +21 -0
- package/tests/fixtures/gpu/enums.json +46 -0
- package/tests/fixtures/gpu/expected.json +251 -0
- package/tests/fixtures/gpu/fairness-observer.ts +504 -0
- package/tests/fixtures/gpu/fairness-test-data.ts +164 -0
- package/tests/fixtures/gpu/fairness-validation.ts +325 -0
- package/tests/fixtures/gpu/fixture-runtime.ts +48 -0
- package/tests/fixtures/gpu/gpu_encode.h +236 -0
- package/tests/fixtures/gpu/gpu_fixture.h +237 -0
- package/tests/fixtures/gpu/import-unwind.ts +12 -0
- package/tests/fixtures/gpu/integration-guest.ts +244 -0
- package/tests/fixtures/gpu/integration-page.ts +805 -0
- package/tests/fixtures/gpu/integration-service-worker.ts +113 -0
- package/tests/fixtures/gpu/label-expected.json +219 -0
- package/tests/fixtures/gpu/label-native.ts +280 -0
- package/tests/fixtures/gpu/lazy-page.ts +39 -0
- package/tests/fixtures/gpu/measurement-contract.ts +148 -0
- package/tests/fixtures/gpu/measurement-desktop.ts +121 -0
- package/tests/fixtures/gpu/measurement-page.ts +347 -0
- package/tests/fixtures/gpu/measurement-runtime.ts +82 -0
- package/tests/fixtures/gpu/measurement-worker.ts +310 -0
- package/tests/fixtures/gpu/ownership-reader-terminal-worker.ts +42 -0
- package/tests/fixtures/gpu/ownership-service-worker.ts +920 -0
- package/tests/fixtures/gpu/peer-input.ts +6 -0
- package/tests/fixtures/gpu/qualification-contract.ts +42 -0
- package/tests/fixtures/gpu/qualification-page.ts +67 -0
- package/tests/fixtures/gpu/qualification-webgpu.ts +199 -0
- package/tests/fixtures/gpu/qualification-worker.ts +97 -0
- package/tests/fixtures/gpu/ring-snapshot.ts +25 -0
- package/tests/fixtures/gpu/ring-worker.ts +227 -0
- package/tests/fixtures/gpu/runtime-display-fence-launcher.ts +16 -0
- package/tests/fixtures/gpu/runtime-display-fence.ts +193 -0
- package/tests/fixtures/gpu/runtime-disposal-signal-order.ts +195 -0
- package/tests/fixtures/gpu/runtime-disposal-signal-worker.ts +79 -0
- package/tests/fixtures/gpu/scene-expected.json +360 -0
- package/tests/fixtures/gpu/scene-fixture.ts +73 -0
- package/tests/fixtures/gpu/scene-native.ts +473 -0
- package/tests/fixtures/gpu/scene.c +73 -0
- package/tests/fixtures/gpu/scene_encode.h +302 -0
- package/tests/fixtures/gpu/service-access.ts +39 -0
- package/tests/fixtures/gpu/service-bootstrap-worker.ts +10 -0
- package/tests/fixtures/gpu/service-reader-worker.ts +29 -0
- package/tests/fixtures/gpu/thrown-observation.ts +120 -0
- package/tests/fixtures/gpu/triangle.c +480 -0
- package/tests/fixtures/gpu/waffle_gpu_stream.h +2046 -0
- package/tests/fixtures/group-futex-worker.ts +102 -0
- package/tests/fixtures/group-link-program.ts +18 -0
- package/tests/fixtures/guarded-nonblock-worker.ts +37 -0
- package/tests/fixtures/guest-watch-runtime-worker.ts +115 -0
- package/tests/fixtures/guest-watch-worker.ts +41 -0
- package/tests/fixtures/guest-watch-writer-worker.ts +46 -0
- package/tests/fixtures/host-failure-worker.ts +17 -0
- package/tests/fixtures/indexeddb-background-confirmation.ts +33 -0
- package/tests/fixtures/indexeddb-caller-delivery.ts +100 -0
- package/tests/fixtures/installer-symlinks-support.ts +25 -0
- package/tests/fixtures/interrupt-browser-loops.ts +78 -0
- package/tests/fixtures/interrupt-browser-worker.ts +104 -0
- package/tests/fixtures/interrupt-browser-workload.ts +17 -0
- package/tests/fixtures/interrupt-dom-consumer.ts +9 -0
- package/tests/fixtures/interrupt-wait-wasm.ts +108 -0
- package/tests/fixtures/interrupt-wait-worker.ts +61 -0
- package/tests/fixtures/intrinsics.ts +114 -0
- package/tests/fixtures/isolated-process.ts +98 -0
- package/tests/fixtures/lazy-backing-constructions.ts +117 -0
- package/tests/fixtures/lazy-backing-guest.ts +219 -0
- package/tests/fixtures/lazy-backing.ts +226 -0
- package/tests/fixtures/link-initialization-worker.ts +112 -0
- package/tests/fixtures/link-initialization.ts +169 -0
- package/tests/fixtures/link-member-workers.ts +73 -0
- package/tests/fixtures/link-relay-program.ts +76 -0
- package/tests/fixtures/link-relay-worker.ts +77 -0
- package/tests/fixtures/linked-nested-node-worker.ts +50 -0
- package/tests/fixtures/logical-process-context-guest.ts +37 -0
- package/tests/fixtures/memory-group-abi-worker.ts +108 -0
- package/tests/fixtures/memory-group-member.c +215 -0
- package/tests/fixtures/memory-group-pie.ts +46 -0
- package/tests/fixtures/memory-group-wake-worker.ts +14 -0
- package/tests/fixtures/memory-group-worker.ts +18 -0
- package/tests/fixtures/memory-observation-guest.ts +90 -0
- package/tests/fixtures/metadata-completion-observer-worker.ts +13 -0
- package/tests/fixtures/metadata-enumeration-r173-service.ts +71 -0
- package/tests/fixtures/metadata-enumeration-r173-store.ts +51 -0
- package/tests/fixtures/metadata-enumeration-r173-wasi.ts +168 -0
- package/tests/fixtures/metadata-enumeration-r173-worker.ts +68 -0
- package/tests/fixtures/navigation-wire-child.ts +134 -0
- package/tests/fixtures/nested-wasi.ts +260 -0
- package/tests/fixtures/network-fence-script.ts +46 -0
- package/tests/fixtures/network-hook-positions.json +16 -0
- package/tests/fixtures/network-original-nodes.json +149 -0
- package/tests/fixtures/node-wasi-descriptors.ts +203 -0
- package/tests/fixtures/node-worker-transfers.ts +11 -0
- package/tests/fixtures/notification-collecting-worker.ts +7 -0
- package/tests/fixtures/notification-controlled-relay.ts +57 -0
- package/tests/fixtures/notification-deadline-worker.ts +128 -0
- package/tests/fixtures/notification-mixed-worker.ts +215 -0
- package/tests/fixtures/notification-probed-worker.ts +53 -0
- package/tests/fixtures/notification-reject-worker.ts +7 -0
- package/tests/fixtures/notification-runtime-worker.ts +55 -0
- package/tests/fixtures/notification-send-failure-worker.ts +60 -0
- package/tests/fixtures/notification-stalled-worker.ts +5 -0
- package/tests/fixtures/notification-traffic-worker.ts +71 -0
- package/tests/fixtures/opfs-close-page.ts +94 -0
- package/tests/fixtures/opfs-close-worker.ts +565 -0
- package/tests/fixtures/opfs-range-storage.ts +285 -0
- package/tests/fixtures/owned-job-root-worker.ts +84 -0
- package/tests/fixtures/owned-job-wait-worker.ts +56 -0
- package/tests/fixtures/owner-freeze-guest.ts +81 -0
- package/tests/fixtures/owner-freeze-owner.ts +77 -0
- package/tests/fixtures/page-root-client.ts +33 -0
- package/tests/fixtures/permissions-guest.ts +55 -0
- package/tests/fixtures/permissions-storage.ts +97 -0
- package/tests/fixtures/persistent-authority-observer.ts +27 -0
- package/tests/fixtures/persistent-lifecycle-r2-owner.ts +149 -0
- package/tests/fixtures/persistent-ready.ts +34 -0
- package/tests/fixtures/pipe-filestat-guest.ts +101 -0
- package/tests/fixtures/pipe-filestat-worker.ts +36 -0
- package/tests/fixtures/pipe-reuse-worker.ts +41 -0
- package/tests/fixtures/pipes-intrinsics.ts +63 -0
- package/tests/fixtures/preopen-guest.c +44 -0
- package/tests/fixtures/preopen-node-host.ts +13 -0
- package/tests/fixtures/prepared-program-loading-control.ts +42 -0
- package/tests/fixtures/prepared-runtime-control.ts +80 -0
- package/tests/fixtures/preview-wire-headers-page.ts +84 -0
- package/tests/fixtures/preview1-entry.ts +1 -0
- package/tests/fixtures/preview1-listener.wat +44 -0
- package/tests/fixtures/preview1-relay.wat +24 -0
- package/tests/fixtures/preview1-socket-imports.wat +36 -0
- package/tests/fixtures/preview1-socket-unknown.wat +4 -0
- package/tests/fixtures/preview1-socket-worker.ts +72 -0
- package/tests/fixtures/preview1-socket.c +58 -0
- package/tests/fixtures/preview1-socket.wat +19 -0
- package/tests/fixtures/private-authority-cases.ts +260 -0
- package/tests/fixtures/process-abi-guest.ts +67 -0
- package/tests/fixtures/process-abi-poll-guest.ts +84 -0
- package/tests/fixtures/process-cell-clone.ts +520 -0
- package/tests/fixtures/process-context-guest.ts +22 -0
- package/tests/fixtures/process-filesystem.ts +34 -0
- package/tests/fixtures/process-intrinsics.ts +360 -0
- package/tests/fixtures/process-lookup.ts +6 -0
- package/tests/fixtures/process-observation-acquisition-worker.ts +68 -0
- package/tests/fixtures/process-observation-controls.ts +15 -0
- package/tests/fixtures/process-observation-worker.ts +72 -0
- package/tests/fixtures/process-poll-start-failure.ts +68 -0
- package/tests/fixtures/process-root-navigation-original-bun-lock.txt +333 -0
- package/tests/fixtures/process-root-navigation-original-runner.txt +378 -0
- package/tests/fixtures/program-shell.ts +86 -0
- package/tests/fixtures/publication-channel-observer.ts +144 -0
- package/tests/fixtures/publication-cleanup-failure.ts +16 -0
- package/tests/fixtures/publication-guest.ts +296 -0
- package/tests/fixtures/publication-launch-close.ts +61 -0
- package/tests/fixtures/publication-resident-authority.ts +464 -0
- package/tests/fixtures/publication-resident-guest.ts +331 -0
- package/tests/fixtures/publication-storage.ts +30 -0
- package/tests/fixtures/publication-wasm.ts +103 -0
- package/tests/fixtures/readlink-service.ts +19 -0
- package/tests/fixtures/recovery-r42-owner.ts +49 -0
- package/tests/fixtures/recovery-r42-page.ts +67 -0
- package/tests/fixtures/reservation-waste-worker.ts +16 -0
- package/tests/fixtures/resident-memory.ts +11 -0
- package/tests/fixtures/retained-client.ts +26 -0
- package/tests/fixtures/root-return-gc.ts +121 -0
- package/tests/fixtures/running-member-wasm.ts +55 -0
- package/tests/fixtures/running-member-worker.ts +50 -0
- package/tests/fixtures/runtime-filesystem-close-debt.ts +142 -0
- package/tests/fixtures/runtime-stop-control.ts +229 -0
- package/tests/fixtures/search-count-worker.ts +265 -0
- package/tests/fixtures/search-fault-shard.ts +21 -0
- package/tests/fixtures/search-program-fs-worker.ts +34 -0
- package/tests/fixtures/shared-caller-debt-control.ts +13 -0
- package/tests/fixtures/shared-caller-exec-worker.ts +119 -0
- package/tests/fixtures/shared-caller-exec.ts +597 -0
- package/tests/fixtures/shared-caller-host-failure-control.ts +92 -0
- package/tests/fixtures/shared-memory-platform.ts +6 -0
- package/tests/fixtures/socket-admission-relay.ts +114 -0
- package/tests/fixtures/spawn-diagnostic-guest.ts +44 -0
- package/tests/fixtures/spawn-request.ts +14 -0
- package/tests/fixtures/stable-memory-grow-worker.ts +10 -0
- package/tests/fixtures/stable-memory-reader.ts +253 -0
- package/tests/fixtures/standalone-runtime-process.ts +19 -0
- package/tests/fixtures/start-failure-public.ts +8 -0
- package/tests/fixtures/start-failure-quiet-worker.ts +54 -0
- package/tests/fixtures/startup-diagnostic-request.ts +8 -0
- package/tests/fixtures/startup-diagnostic-worker.ts +62 -0
- package/tests/fixtures/startup-pool-worker.ts +19 -0
- package/tests/fixtures/stop-order-wasm.ts +60 -0
- package/tests/fixtures/stop-order-worker.ts +11 -0
- package/tests/fixtures/storage-lifecycle-fs-prelude.ts +15 -0
- package/tests/fixtures/storage-lifecycle-fs-worker.ts +2 -0
- package/tests/fixtures/storage-lock-startup.ts +70 -0
- package/tests/fixtures/storage-maintenance.ts +16 -0
- package/tests/fixtures/symlink-sizing-probe.ts +59 -0
- package/tests/fixtures/terminal-control-worker.ts +150 -0
- package/tests/fixtures/terminal-input-pause.ts +30 -0
- package/tests/fixtures/terminal-input-producer.ts +18 -0
- package/tests/fixtures/terminal-mode-worker.ts +58 -0
- package/tests/fixtures/terminal-resolver-worker.ts +92 -0
- package/tests/fixtures/thread-admission-control.ts +294 -0
- package/tests/fixtures/threads-c.c +117 -0
- package/tests/fixtures/threads.rs +140 -0
- package/tests/fixtures/truncate-page-work.ts +32 -0
- package/tests/fixtures/wasi-atomic-host.ts +92 -0
- package/tests/fixtures/wasi-cat.ts +177 -0
- package/tests/fixtures/wasi-nonblock-inherited-worker.ts +34 -0
- package/tests/fixtures/wasi-nonblock-worker.ts +33 -0
- package/tests/fixtures/wasi-nonblock.ts +48 -0
- package/tests/fixtures/wasi-poll-guest.ts +45 -0
- package/tests/fixtures/wasi-write.ts +72 -0
- package/tests/fixtures/wasm-start-section.ts +88 -0
- package/tests/fixtures/watch-delivery-error-worker.ts +4 -0
- package/tests/fixtures/watch-guest.ts +141 -0
- package/tests/fixtures/watch-lifecycle-worker.ts +2 -0
- package/tests/fixtures/watch-startup-error-worker.ts +1 -0
- package/tests/fixtures/worker-pipe-transfer-guest.ts +58 -0
- package/tests/fixtures/workspace-endurance.ts +113 -0
- package/tests/fixtures/workspace-read-claim.ts +41 -0
- package/tests/fixtures/workspace-read.ts +104 -0
- package/tests/fixtures/workspace-recovery.ts +133 -0
- package/tests/fs-socket-attachment-browser.ts +184 -0
- package/tests/fs-socket-browser-runner.ts +35 -0
- package/tests/fs-socket-node.test.ts +123 -0
- package/tests/fs-socket-owner.test.ts +106 -0
- package/tests/fs-socket-scope.test.ts +285 -0
- package/tests/gated-indexeddb.test.ts +16 -0
- package/tests/gated-indexeddb.ts +72 -0
- package/tests/git-install.test.ts +25 -0
- package/tests/gpu-admission-browser.ts +763 -0
- package/tests/gpu-admission-controls.test.ts +592 -0
- package/tests/gpu-asset-paths.test.ts +107 -0
- package/tests/gpu-async-assets.ts +29 -0
- package/tests/gpu-async-browser-runner.ts +20 -0
- package/tests/gpu-async-command.test.ts +249 -0
- package/tests/gpu-async-command.ts +272 -0
- package/tests/gpu-async-desktop.ts +78 -0
- package/tests/gpu-async-fixture.test.ts +252 -0
- package/tests/gpu-async-native.test.ts +38 -0
- package/tests/gpu-async-native.ts +70 -0
- package/tests/gpu-async-output.test.ts +49 -0
- package/tests/gpu-async-payload.test.ts +537 -0
- package/tests/gpu-async-replay.test.ts +656 -0
- package/tests/gpu-async-stream.test.ts +166 -0
- package/tests/gpu-bootstrap-cleanup.test.ts +185 -0
- package/tests/gpu-browser-controls.test.ts +64 -0
- package/tests/gpu-browser-qualification.test.ts +102 -0
- package/tests/gpu-browser-qualification.ts +432 -0
- package/tests/gpu-browser-runner.ts +554 -0
- package/tests/gpu-browser-shared.ts +59 -0
- package/tests/gpu-bundle-query-native.test.ts +8 -0
- package/tests/gpu-bundle-query-native.ts +55 -0
- package/tests/gpu-bundle-query-replay.test.ts +406 -0
- package/tests/gpu-bundle-query-stream.test.ts +97 -0
- package/tests/gpu-ci.test.ts +244 -0
- package/tests/gpu-completions.test.ts +404 -0
- package/tests/gpu-compute-native.test.ts +9 -0
- package/tests/gpu-compute-native.ts +47 -0
- package/tests/gpu-compute-replay.test.ts +363 -0
- package/tests/gpu-compute-stream.test.ts +53 -0
- package/tests/gpu-control-retention.test.ts +202 -0
- package/tests/gpu-copy-draw-native.test.ts +9 -0
- package/tests/gpu-copy-draw-native.ts +71 -0
- package/tests/gpu-copy-draw-replay.test.ts +350 -0
- package/tests/gpu-copy-draw-stream.test.ts +78 -0
- package/tests/gpu-coverage.test.ts +250 -0
- package/tests/gpu-desktop-measure.test.ts +344 -0
- package/tests/gpu-display-retirement.test.ts +213 -0
- package/tests/gpu-display-shutdown.test.ts +180 -0
- package/tests/gpu-disposal-browser.ts +685 -0
- package/tests/gpu-disposal-controls.test.ts +738 -0
- package/tests/gpu-disposal-retirement.test.ts +108 -0
- package/tests/gpu-fairness-browser.ts +273 -0
- package/tests/gpu-fairness-fixture.test.ts +202 -0
- package/tests/gpu-fairness.test.ts +203 -0
- package/tests/gpu-fixture-closed.test.ts +232 -0
- package/tests/gpu-fixture-host.ts +253 -0
- package/tests/gpu-fixture.test.ts +569 -0
- package/tests/gpu-grant-quota-browser.ts +767 -0
- package/tests/gpu-grant-quota-controls.test.ts +525 -0
- package/tests/gpu-grant-retirement.test.ts +413 -0
- package/tests/gpu-import-observation.test.ts +472 -0
- package/tests/gpu-integration.test.ts +479 -0
- package/tests/gpu-label-native.test.ts +8 -0
- package/tests/gpu-label-native.ts +37 -0
- package/tests/gpu-label-replay.test.ts +313 -0
- package/tests/gpu-label-stream.test.ts +135 -0
- package/tests/gpu-launch-retention.test.ts +134 -0
- package/tests/gpu-loading-browser.ts +54 -0
- package/tests/gpu-loading.test.ts +97 -0
- package/tests/gpu-malformed-browser.ts +522 -0
- package/tests/gpu-malformed-controls.test.ts +720 -0
- package/tests/gpu-measure.test.ts +281 -0
- package/tests/gpu-native-browser-runner.ts +48 -0
- package/tests/gpu-native-controls.test.ts +181 -0
- package/tests/gpu-native-controls.ts +117 -0
- package/tests/gpu-ownership-browser.ts +642 -0
- package/tests/gpu-ownership-controls.test.ts +373 -0
- package/tests/gpu-payload-pressure-browser.ts +1142 -0
- package/tests/gpu-payload-pressure-controls.test.ts +974 -0
- package/tests/gpu-payload-settlement.test.ts +323 -0
- package/tests/gpu-peer-input.test.ts +98 -0
- package/tests/gpu-reader-terminal.test.ts +194 -0
- package/tests/gpu-regrant-browser.ts +861 -0
- package/tests/gpu-regrant-controls.test.ts +680 -0
- package/tests/gpu-replay.test.ts +511 -0
- package/tests/gpu-ring-snapshot.test.ts +53 -0
- package/tests/gpu-ring.test.ts +497 -0
- package/tests/gpu-scene-fixture.test.ts +272 -0
- package/tests/gpu-scene-native.test.ts +14 -0
- package/tests/gpu-scene-native.ts +36 -0
- package/tests/gpu-scene-replay.test.ts +678 -0
- package/tests/gpu-scene-stream.test.ts +112 -0
- package/tests/gpu-service-bootstrap.test.ts +61 -0
- package/tests/gpu-service-failure-browser.ts +792 -0
- package/tests/gpu-service-failure-controls.test.ts +1035 -0
- package/tests/gpu-service-failure-ordering.test.ts +105 -0
- package/tests/gpu-service-readers.test.ts +247 -0
- package/tests/gpu-stream.test.ts +338 -0
- package/tests/gpu-surface-transfer.test.ts +855 -0
- package/tests/gpu-transport.test.ts +311 -0
- package/tests/gpu-worker-bundle.test.ts +31 -0
- package/tests/group-futex-browser-runner.ts +150 -0
- package/tests/group-futex-browser.ts +141 -0
- package/tests/group-futex.test.ts +798 -0
- package/tests/guarded-stream-nonblock.test.ts +130 -0
- package/tests/guest-watch-browser-cases.test.ts +24 -0
- package/tests/guest-watch-browser-cases.ts +271 -0
- package/tests/guest-watch-browser-runner.ts +66 -0
- package/tests/host-interface.test.ts +115 -0
- package/tests/host.test.ts +349 -0
- package/tests/http1-buffer-boundaries.test.ts +102 -0
- package/tests/http1-framing-limits.test.ts +419 -0
- package/tests/idle-workspace-browser.ts +350 -0
- package/tests/idle-workspace-cancellation-browser.ts +129 -0
- package/tests/idle-workspace-fixtures.ts +25 -0
- package/tests/idle-workspace-maintenance-browser.ts +271 -0
- package/tests/idle-workspace-metadata-browser.ts +287 -0
- package/tests/imports.test.ts +92 -0
- package/tests/indexeddb-checkpoint-decode-browser.ts +232 -0
- package/tests/indexeddb-checkpoint-decode.test.ts +32 -0
- package/tests/indexeddb-chunks-browser-runner.ts +39 -0
- package/tests/indexeddb-chunks-browser.ts +841 -0
- package/tests/indexeddb-chunks.test.ts +57 -0
- package/tests/indexeddb-publication-browser.ts +458 -0
- package/tests/indexeddb-publication.test.ts +89 -0
- package/tests/indexeddb-storage-browser.ts +1357 -0
- package/tests/inherited-fd-review.test.ts +362 -0
- package/tests/inherited-fd.test.ts +82 -0
- package/tests/installer-symlinks-alias.test.ts +266 -0
- package/tests/installer-symlinks-borrow.test.ts +451 -0
- package/tests/installer-symlinks-codec.test.ts +117 -0
- package/tests/installer-symlinks-creation.test.ts +369 -0
- package/tests/installer-symlinks-final-components.test.ts +392 -0
- package/tests/installer-symlinks-history.test.ts +155 -0
- package/tests/installer-symlinks-metadata-types.ts +32 -0
- package/tests/installer-symlinks-metadata.test.ts +140 -0
- package/tests/installer-symlinks-persistence.test.ts +120 -0
- package/tests/installer-symlinks-readlink.test.ts +444 -0
- package/tests/installer-symlinks-service.test.ts +125 -0
- package/tests/installer-symlinks-tree.test.ts +88 -0
- package/tests/installer-symlinks.test.ts +251 -0
- package/tests/interrupt-admitted-browser-runner.ts +290 -0
- package/tests/interrupt-admitted-browser.ts +167 -0
- package/tests/interrupt-admitted-fixture.ts +44 -0
- package/tests/interrupt-admitted-loader.test.ts +324 -0
- package/tests/interrupt-admitted-store.test.ts +195 -0
- package/tests/interrupt-browser-benchmark.ts +208 -0
- package/tests/interrupt-browser-control.ts +55 -0
- package/tests/interrupt-browser-fixtures.test.ts +40 -0
- package/tests/interrupt-browser-runner-control.ts +52 -0
- package/tests/interrupt-browser-runner.test.ts +125 -0
- package/tests/interrupt-browser.ts +251 -0
- package/tests/interrupt-cache-storage-fixture.ts +58 -0
- package/tests/interrupt-check.test.ts +47 -0
- package/tests/interrupt-loader-cache.test.ts +383 -0
- package/tests/interrupt-loader.test.ts +111 -0
- package/tests/interrupt-rewriter-exports.test.ts +11 -0
- package/tests/interrupt-rewriter.test.ts +740 -0
- package/tests/interrupt-standard-eh.test.ts +293 -0
- package/tests/interrupt-transform-pin.test.ts +16 -0
- package/tests/interrupt-wait-profile.test.ts +126 -0
- package/tests/interrupt-wait.test.ts +328 -0
- package/tests/intrinsics-boundary.test.ts +377 -0
- package/tests/isolated-page-runner.ts +186 -0
- package/tests/libc-tooling.test.ts +313 -0
- package/tests/link-browser-runner.ts +94 -0
- package/tests/link-browser.ts +61 -0
- package/tests/link-initialization.test.ts +344 -0
- package/tests/link-member-workers.test.ts +83 -0
- package/tests/link-program.test.ts +1642 -0
- package/tests/link-quickjs-worker.ts +140 -0
- package/tests/link-quickjs.test.ts +83 -0
- package/tests/link-relay-browser.ts +94 -0
- package/tests/link-shared-basic512-fixture.ts +48 -0
- package/tests/link-shared-basic512.test.ts +129 -0
- package/tests/loopback-fetch-bun-consumer.test.ts +121 -0
- package/tests/loopback-fetch-compression.test.ts +204 -0
- package/tests/loopback-fetch-fixture.ts +128 -0
- package/tests/loopback-fetch-redirect.test.ts +321 -0
- package/tests/loopback-fetch-worker.ts +115 -0
- package/tests/memory-budget.test.ts +952 -0
- package/tests/memory-group-browser-runner.ts +123 -0
- package/tests/memory-group-browser.ts +649 -0
- package/tests/memory-group-cap.test.ts +200 -0
- package/tests/memory-group-exit-lock.test.ts +325 -0
- package/tests/memory-group-grow.test.ts +151 -0
- package/tests/memory-group-link.test.ts +485 -0
- package/tests/memory-group-pin-port.test.ts +170 -0
- package/tests/memory-group-pin.test.ts +275 -0
- package/tests/memory-group-review.test.ts +286 -0
- package/tests/memory-group-stack-worker.ts +94 -0
- package/tests/memory-group-state.test.ts +537 -0
- package/tests/memory-reservations.test.ts +804 -0
- package/tests/memory-views.test.ts +168 -0
- package/tests/metadata-directory-contract-r173.test.ts +307 -0
- package/tests/metadata-nlink-r173.test.ts +201 -0
- package/tests/metadata-readdir-r173.test.ts +126 -0
- package/tests/metadata-worker-completion.test.ts +29 -0
- package/tests/namespace-cursor.test.ts +470 -0
- package/tests/namespace-projection-memory-budget.test.ts +250 -0
- package/tests/namespace-projection-owner.test.ts +880 -0
- package/tests/namespace-projection-table.test.ts +1598 -0
- package/tests/nested-wasi.test.ts +7 -0
- package/tests/net-host-watch.test.ts +236 -0
- package/tests/net-transport-metadata.test.ts +81 -0
- package/tests/network-activation-browser.ts +71 -0
- package/tests/network-address.test.ts +412 -0
- package/tests/network-browser-runner.ts +21 -0
- package/tests/network-browser-service-worker.ts +19 -0
- package/tests/network-browser-worker.ts +147 -0
- package/tests/network-browser.test.ts +22 -0
- package/tests/network-browser.ts +679 -0
- package/tests/network-budget.test.ts +103 -0
- package/tests/network-command-controls.ts +87 -0
- package/tests/network-command.test.ts +253 -0
- package/tests/network-command.ts +274 -0
- package/tests/network-control-page.ts +32 -0
- package/tests/network-desktop-driver.ts +66 -0
- package/tests/network-failure-control.ts +332 -0
- package/tests/network-failure.test.ts +14 -0
- package/tests/network-finalizer.test.ts +61 -0
- package/tests/network-finalizer.ts +17 -0
- package/tests/network-flow-cases.ts +146 -0
- package/tests/network-flow-control.test.ts +43 -0
- package/tests/network-growth-control.ts +18 -0
- package/tests/network-growth.test.ts +27 -0
- package/tests/network-lazy.test.ts +260 -0
- package/tests/network-lookup-consumer.test.ts +193 -0
- package/tests/network-lookup-handles.test.ts +527 -0
- package/tests/network-lookup-node.test.ts +32 -0
- package/tests/network-lookup-worker.ts +83 -0
- package/tests/network-lookup.test.ts +134 -0
- package/tests/network-module-host.test.ts +263 -0
- package/tests/network-module.test.ts +76 -0
- package/tests/network-namespace.test.ts +562 -0
- package/tests/network-outbound.test.ts +786 -0
- package/tests/network-page-contract.ts +24 -0
- package/tests/network-page-inputs.ts +79 -0
- package/tests/network-page-suite.ts +183 -0
- package/tests/network-page.ts +14 -0
- package/tests/network-path-scope.test.ts +93 -0
- package/tests/network-relay-browser-runner.ts +10 -0
- package/tests/network-relay-browser.ts +384 -0
- package/tests/network-relay-contract.ts +35 -0
- package/tests/network-relay-fixture.ts +249 -0
- package/tests/network-relay-modules.ts +21 -0
- package/tests/network-relay-page.ts +10 -0
- package/tests/network-relay-runner.test.ts +171 -0
- package/tests/network-relay-worker.ts +137 -0
- package/tests/network-resource-control.ts +73 -0
- package/tests/network-ring-wake.test.ts +186 -0
- package/tests/network-safari-websocket.test.ts +272 -0
- package/tests/network-sentinel-assets.ts +6 -0
- package/tests/network-signal-control.test.ts +8 -0
- package/tests/network-signal-control.ts +101 -0
- package/tests/network-signal-controls.ts +52 -0
- package/tests/network-size.test.ts +22 -0
- package/tests/network-source-parity.test.ts +95 -0
- package/tests/network-source-parity.ts +240 -0
- package/tests/network-unix-fs.test.ts +297 -0
- package/tests/network-unix-guest.ts +41 -0
- package/tests/network-unix-races.test.ts +370 -0
- package/tests/network-unix-support.ts +93 -0
- package/tests/network-unix.test.ts +600 -0
- package/tests/network-wire.test.ts +198 -0
- package/tests/network-worker-peer.ts +88 -0
- package/tests/node-exports.test.ts +229 -0
- package/tests/node-wasi-descriptors.test.ts +32 -0
- package/tests/notification-admission.test.ts +51 -0
- package/tests/notification-browser-runner.ts +92 -0
- package/tests/notification-command.test.ts +130 -0
- package/tests/notification-command.ts +230 -0
- package/tests/notification-fairness-browser-runner.ts +66 -0
- package/tests/notification-fairness-cases.ts +327 -0
- package/tests/notification-lifetime-cases.ts +457 -0
- package/tests/notification-mixed-cases.ts +220 -0
- package/tests/notification-race-browser-runner.ts +26 -0
- package/tests/notification-race-cases.ts +54 -0
- package/tests/notification-relay-retention.test.ts +133 -0
- package/tests/notification-wait.test.ts +100 -0
- package/tests/opfs-close-browser-observer.test.ts +319 -0
- package/tests/opfs-close-browser-runner.ts +434 -0
- package/tests/opfs-close-browser.ts +113 -0
- package/tests/opfs-close.test.ts +504 -0
- package/tests/opfs-qualification-browser.ts +297 -0
- package/tests/opfs-range-browser-runner.ts +86 -0
- package/tests/opfs-range-browser.ts +202 -0
- package/tests/opfs-range.test.ts +331 -0
- package/tests/opfs-snapshot.test.ts +224 -0
- package/tests/opfs-storage-browser.ts +1109 -0
- package/tests/owned-job-cleanup.test.ts +1167 -0
- package/tests/owner-freeze-browser-runner.ts +571 -0
- package/tests/owner-freeze-browser.ts +226 -0
- package/tests/packaging.test.ts +278 -0
- package/tests/page-runner/aggregate-error-fixture.ts +18 -0
- package/tests/page-runner/asset-hold-control-page.ts +7 -0
- package/tests/page-runner/asset-hold-controls.ts +132 -0
- package/tests/page-runner/asset-owner.test.ts +635 -0
- package/tests/page-runner/asset-owner.ts +251 -0
- package/tests/page-runner/bootstrap-arrival-browser.test.ts +139 -0
- package/tests/page-runner/bootstrap-arrival.test.ts +344 -0
- package/tests/page-runner/bootstrap-control.ts +19 -0
- package/tests/page-runner/bootstrap-diagnostics.test.ts +133 -0
- package/tests/page-runner/bootstrap-diagnostics.ts +35 -0
- package/tests/page-runner/bootstrap-navigation.ts +19 -0
- package/tests/page-runner/browser-controls-process-fixture.ts +88 -0
- package/tests/page-runner/browser-controls-runner.test.ts +360 -0
- package/tests/page-runner/browser-controls-runner.ts +129 -0
- package/tests/page-runner/browser-controls-suite.ts +426 -0
- package/tests/page-runner/browser-observation.test.ts +448 -0
- package/tests/page-runner/browser-observation.ts +469 -0
- package/tests/page-runner/collector-fetch.ts +93 -0
- package/tests/page-runner/collector-policy.test.ts +216 -0
- package/tests/page-runner/collector.test.ts +429 -0
- package/tests/page-runner/collector.ts +993 -0
- package/tests/page-runner/command-controls.ts +334 -0
- package/tests/page-runner/command-fixtures.ts +46 -0
- package/tests/page-runner/command-host.test.ts +167 -0
- package/tests/page-runner/command-observation.test.ts +358 -0
- package/tests/page-runner/command-page.ts +21 -0
- package/tests/page-runner/command-suites.ts +142 -0
- package/tests/page-runner/console-control-page.ts +33 -0
- package/tests/page-runner/console-control-worker.ts +14 -0
- package/tests/page-runner/console-controls.ts +174 -0
- package/tests/page-runner/console-first-line-worker.ts +2 -0
- package/tests/page-runner/console-late-control-page.ts +25 -0
- package/tests/page-runner/console-late-control.test.ts +214 -0
- package/tests/page-runner/console-late-control.ts +398 -0
- package/tests/page-runner/console-lifecycle.test.ts +139 -0
- package/tests/page-runner/console-observation.test.ts +73 -0
- package/tests/page-runner/console-observation.ts +49 -0
- package/tests/page-runner/consumer-control-chunk.ts +1 -0
- package/tests/page-runner/consumer-control-page.ts +147 -0
- package/tests/page-runner/consumer-control-worker.ts +4 -0
- package/tests/page-runner/consumer-controls.ts +345 -0
- package/tests/page-runner/consumer-entry.test.ts +856 -0
- package/tests/page-runner/consumer-page.ts +8 -0
- package/tests/page-runner/consumer.ts +39 -0
- package/tests/page-runner/continuity-lock-browser.test.ts +29 -0
- package/tests/page-runner/continuity-lock-control-page.ts +430 -0
- package/tests/page-runner/continuity-lock-diagnostic.test.ts +122 -0
- package/tests/page-runner/continuity-lock-diagnostic.ts +380 -0
- package/tests/page-runner/control-run.test.ts +112 -0
- package/tests/page-runner/control-run.ts +36 -0
- package/tests/page-runner/cross-tab-evaluator.ts +162 -0
- package/tests/page-runner/cross-tab-value.ts +59 -0
- package/tests/page-runner/document-retirement.test.ts +288 -0
- package/tests/page-runner/driver-observation-cleanup.test.ts +63 -0
- package/tests/page-runner/driver-observation-diagnostics.test.ts +93 -0
- package/tests/page-runner/driver.ts +116 -0
- package/tests/page-runner/error-context.test.ts +95 -0
- package/tests/page-runner/fake-driver.ts +192 -0
- package/tests/page-runner/filesystem-transport-browser.test.ts +75 -0
- package/tests/page-runner/filesystem-transport-native.ts +13 -0
- package/tests/page-runner/filesystem-transport-observation.ts +65 -0
- package/tests/page-runner/filesystem-transport-page.ts +48 -0
- package/tests/page-runner/filesystem-transport-suite.test.ts +310 -0
- package/tests/page-runner/filesystem-transport-suite.ts +127 -0
- package/tests/page-runner/fixture-admission.test.ts +167 -0
- package/tests/page-runner/fixture-capability-control-page.ts +24 -0
- package/tests/page-runner/fixture-capability-controls.ts +189 -0
- package/tests/page-runner/fixture-host.test.ts +524 -0
- package/tests/page-runner/fixture-owner.test.ts +176 -0
- package/tests/page-runner/fixture-owner.ts +189 -0
- package/tests/page-runner/fixtures/large-assertion.ts +21 -0
- package/tests/page-runner/framework-bootstrap-main.ts +22 -0
- package/tests/page-runner/framework-bootstrap.ts +311 -0
- package/tests/page-runner/framework-collector.test.ts +277 -0
- package/tests/page-runner/framework-collector.ts +287 -0
- package/tests/page-runner/framework-controls/installed.ts +433 -0
- package/tests/page-runner/framework-dom-controls.ts +685 -0
- package/tests/page-runner/framework-dom-page.ts +136 -0
- package/tests/page-runner/framework-final-ack.test.ts +79 -0
- package/tests/page-runner/framework-host.test.ts +443 -0
- package/tests/page-runner/framework-host.ts +899 -0
- package/tests/page-runner/framework-http-body.ts +44 -0
- package/tests/page-runner/framework-middleware.test.ts +85 -0
- package/tests/page-runner/framework-middleware.ts +73 -0
- package/tests/page-runner/framework-page.ts +37 -0
- package/tests/page-runner/framework-queue.test.ts +405 -0
- package/tests/page-runner/framework-queue.ts +417 -0
- package/tests/page-runner/framework-reporting.test.ts +451 -0
- package/tests/page-runner/framework-trace-host.test.ts +106 -0
- package/tests/page-runner/framework-trace-page.ts +483 -0
- package/tests/page-runner/framework-trace-regression.test.ts +300 -0
- package/tests/page-runner/framework-trace.test.ts +793 -0
- package/tests/page-runner/framework-trace.ts +509 -0
- package/tests/page-runner/framework-types.ts +255 -0
- package/tests/page-runner/framework-validation.test.ts +52 -0
- package/tests/page-runner/framework-validation.ts +65 -0
- package/tests/page-runner/framework-verdict.test.ts +259 -0
- package/tests/page-runner/framework.ts +37 -0
- package/tests/page-runner/gpu-async-controls-runner.ts +108 -0
- package/tests/page-runner/gpu-async-failure-controls.ts +93 -0
- package/tests/page-runner/gpu-async-native.ts +6 -0
- package/tests/page-runner/gpu-async-operations.ts +49 -0
- package/tests/page-runner/gpu-async-page.ts +14 -0
- package/tests/page-runner/gpu-async-request.ts +3 -0
- package/tests/page-runner/gpu-async-suite.test.ts +189 -0
- package/tests/page-runner/gpu-async-suite.ts +120 -0
- package/tests/page-runner/guest-watch-command.ts +11 -0
- package/tests/page-runner/guest-watch-control-phases.ts +20 -0
- package/tests/page-runner/guest-watch-controls-runner.ts +134 -0
- package/tests/page-runner/guest-watch-stalled-helper.ts +5 -0
- package/tests/page-runner/host-drive-control-page.ts +90 -0
- package/tests/page-runner/host-drive-controls.test.ts +91 -0
- package/tests/page-runner/host-drive-controls.ts +318 -0
- package/tests/page-runner/host-drive.test.ts +2222 -0
- package/tests/page-runner/host-drive.ts +1311 -0
- package/tests/page-runner/host-page.test.ts +58 -0
- package/tests/page-runner/host-page.ts +207 -0
- package/tests/page-runner/host-storage-control-page.ts +182 -0
- package/tests/page-runner/host-storage-control-worker.ts +11 -0
- package/tests/page-runner/host-storage-controls.ts +313 -0
- package/tests/page-runner/host.test.ts +133 -0
- package/tests/page-runner/inspector-endpoint-receipt.ts +425 -0
- package/tests/page-runner/inspector-endpoint.test.ts +236 -0
- package/tests/page-runner/inspector-endpoint.ts +69 -0
- package/tests/page-runner/inspector-plist.ts +395 -0
- package/tests/page-runner/inspector-stream.test.ts +149 -0
- package/tests/page-runner/inspector-stream.ts +105 -0
- package/tests/page-runner/json-snapshot.ts +8 -0
- package/tests/page-runner/key-press-control-page.ts +17 -0
- package/tests/page-runner/key-press-controls-native.ts +7 -0
- package/tests/page-runner/key-press-controls.ts +78 -0
- package/tests/page-runner/key-press-fixture.ts +109 -0
- package/tests/page-runner/key-press-observation.ts +129 -0
- package/tests/page-runner/key-press-suite.ts +138 -0
- package/tests/page-runner/large-reporting.test.ts +351 -0
- package/tests/page-runner/lifecycle-queue.test.ts +186 -0
- package/tests/page-runner/memory-group-command.test.ts +227 -0
- package/tests/page-runner/memory-group-command.ts +80 -0
- package/tests/page-runner/memory-group-control-page.ts +7 -0
- package/tests/page-runner/memory-group-controls-runner.ts +126 -0
- package/tests/page-runner/native-cli.test.ts +86 -0
- package/tests/page-runner/native-failure.test.ts +396 -0
- package/tests/page-runner/native.ts +62 -0
- package/tests/page-runner/notification-host.test.ts +264 -0
- package/tests/page-runner/notification-native.ts +6 -0
- package/tests/page-runner/ordered-reporter.ts +305 -0
- package/tests/page-runner/owned-consumers.ts +36 -0
- package/tests/page-runner/page-main.ts +137 -0
- package/tests/page-runner/peer-collector.test.ts +356 -0
- package/tests/page-runner/peer-control-page.ts +33 -0
- package/tests/page-runner/peer-controls.ts +249 -0
- package/tests/page-runner/peer-driver-fixture.test.ts +219 -0
- package/tests/page-runner/peer-driver-fixture.ts +257 -0
- package/tests/page-runner/peer-host.test.ts +248 -0
- package/tests/page-runner/peer-probe.test.ts +131 -0
- package/tests/page-runner/peer-storage-control-page.ts +51 -0
- package/tests/page-runner/peer-storage-controls.ts +116 -0
- package/tests/page-runner/playwright-driver.test.ts +270 -0
- package/tests/page-runner/playwright-driver.ts +229 -0
- package/tests/page-runner/playwright-observer.ts +137 -0
- package/tests/page-runner/prepared-assets.test.ts +91 -0
- package/tests/page-runner/process-recycling-assets.ts +34 -0
- package/tests/page-runner/process-recycling-controls-page.ts +27 -0
- package/tests/page-runner/process-recycling-controls.test.ts +70 -0
- package/tests/page-runner/process-recycling-controls.ts +134 -0
- package/tests/page-runner/process-recycling-error-control-worker.ts +2 -0
- package/tests/page-runner/process-recycling-fs-control-worker.ts +3 -0
- package/tests/page-runner/process-recycling-native.ts +46 -0
- package/tests/page-runner/process-recycling-page.ts +24 -0
- package/tests/page-runner/process-recycling-storage-control.ts +11 -0
- package/tests/page-runner/process-recycling-suite.test.ts +202 -0
- package/tests/page-runner/process-recycling-suite.ts +38 -0
- package/tests/page-runner/protocol.ts +286 -0
- package/tests/page-runner/publication-bootstrap.ts +65 -0
- package/tests/page-runner/publication-cross-tab-browser.test.ts +68 -0
- package/tests/page-runner/publication-cross-tab-host.ts +211 -0
- package/tests/page-runner/publication-cross-tab-native.ts +6 -0
- package/tests/page-runner/publication-cross-tab-page.ts +24 -0
- package/tests/page-runner/publication-cross-tab-suite.test.ts +181 -0
- package/tests/page-runner/publication-cross-tab-suite.ts +87 -0
- package/tests/page-runner/publication-native.ts +11 -0
- package/tests/page-runner/publication-page.ts +46 -0
- package/tests/page-runner/publication-suite.test.ts +100 -0
- package/tests/page-runner/publication-suite.ts +99 -0
- package/tests/page-runner/report-chunks.test.ts +295 -0
- package/tests/page-runner/report-chunks.ts +195 -0
- package/tests/page-runner/report-control.ts +12 -0
- package/tests/page-runner/report-stream.ts +12 -0
- package/tests/page-runner/reporter-control-failure.test.ts +119 -0
- package/tests/page-runner/reporter-control-page.ts +101 -0
- package/tests/page-runner/reporter.test.ts +237 -0
- package/tests/page-runner/reporter.ts +28 -0
- package/tests/page-runner/reporting-cleanup.test.ts +118 -0
- package/tests/page-runner/reporting-contract.test.ts +242 -0
- package/tests/page-runner/reporting-fixture.ts +130 -0
- package/tests/page-runner/reporting-host.test.ts +149 -0
- package/tests/page-runner/reporting-realm.ts +4 -0
- package/tests/page-runner/reporting-types.ts +22 -0
- package/tests/page-runner/result-file.ts +18 -0
- package/tests/page-runner/retained-worker-control-page.ts +23 -0
- package/tests/page-runner/retained-worker-controls.ts +107 -0
- package/tests/page-runner/root-continuity-allocation.ts +21 -0
- package/tests/page-runner/root-continuity-control-fixture.ts +11 -0
- package/tests/page-runner/root-continuity-controls.ts +237 -0
- package/tests/page-runner/root-continuity-gate-page.ts +94 -0
- package/tests/page-runner/root-continuity-page.ts +48 -0
- package/tests/page-runner/root-continuity-suite.test.ts +290 -0
- package/tests/page-runner/root-continuity-suite.ts +102 -0
- package/tests/page-runner/safari-console.ts +40 -0
- package/tests/page-runner/safari-driver-log.test.ts +202 -0
- package/tests/page-runner/safari-driver.test.ts +474 -0
- package/tests/page-runner/safari-driver.ts +763 -0
- package/tests/page-runner/safari-error.test.ts +61 -0
- package/tests/page-runner/safari-navigation.test.ts +220 -0
- package/tests/page-runner/safari-observer.test.ts +868 -0
- package/tests/page-runner/safari-observer.ts +665 -0
- package/tests/page-runner/safari-session-startup.test.ts +139 -0
- package/tests/page-runner/safe-staging-allocation.ts +19 -0
- package/tests/page-runner/safe-staging-control-page.ts +58 -0
- package/tests/page-runner/safe-staging-controls-runner.ts +53 -0
- package/tests/page-runner/safe-staging-page.ts +27 -0
- package/tests/page-runner/safe-staging-suite.ts +70 -0
- package/tests/page-runner/safe-staging.test.ts +145 -0
- package/tests/page-runner/service-worker-page.ts +132 -0
- package/tests/page-runner/stall-diagnostics.test.ts +380 -0
- package/tests/page-runner/stall-diagnostics.ts +627 -0
- package/tests/page-runner/storage-cleanup.ts +83 -0
- package/tests/page-runner/storage-control-page.ts +124 -0
- package/tests/page-runner/storage-control-worker.ts +36 -0
- package/tests/page-runner/storage-host.ts +51 -0
- package/tests/page-runner/storage-page-control-worker.ts +15 -0
- package/tests/page-runner/storage-page.ts +14 -0
- package/tests/page-runner/storage-policy.ts +74 -0
- package/tests/page-runner/storage-worker.test.ts +30 -0
- package/tests/page-runner/storage-worker.ts +154 -0
- package/tests/page-runner/suite-host.ts +1234 -0
- package/tests/page-runner/suite-query.test.ts +164 -0
- package/tests/page-runner/suite-startup.test.ts +63 -0
- package/tests/page-runner/threads-runtime-browser.test.ts +70 -0
- package/tests/page-runner/threads-runtime-native.ts +31 -0
- package/tests/page-runner/threads-runtime-page.ts +19 -0
- package/tests/page-runner/threads-runtime-suite.test.ts +236 -0
- package/tests/page-runner/threads-runtime-suite.ts +162 -0
- package/tests/page-runner/worker-allocation.test.ts +161 -0
- package/tests/page-runner/worker-capability-control-page.ts +91 -0
- package/tests/page-runner/worker-capability-controls.ts +235 -0
- package/tests/page-runner/worker-close-query.test.ts +229 -0
- package/tests/page-runner/worker-lifecycle-browser.test.ts +104 -0
- package/tests/page-runner/worker-lifecycle-control-page.ts +18 -0
- package/tests/persistence-close.test.ts +359 -0
- package/tests/persistence-durability.test.ts +588 -0
- package/tests/persistence-queue.test.ts +324 -0
- package/tests/persistence.test.ts +788 -0
- package/tests/persistent-authority-browser-runner.ts +518 -0
- package/tests/persistent-authority-browser.ts +25 -0
- package/tests/persistent-authority-report.test.ts +216 -0
- package/tests/persistent-authority-report.ts +81 -0
- package/tests/persistent-lifecycle-r2-browser-runner.ts +503 -0
- package/tests/persistent-lifecycle-r2-page.ts +248 -0
- package/tests/persistent-lifecycle-r2.test.ts +114 -0
- package/tests/persistent-native-inspection.test.ts +254 -0
- package/tests/persistent-native-inspection.ts +179 -0
- package/tests/persistent-ready.test.ts +54 -0
- package/tests/persistent-resident-owner.test.ts +612 -0
- package/tests/pinned-truncate.test.ts +137 -0
- package/tests/pipe-description-flags.test.ts +29 -0
- package/tests/pipe-filestat-browser.ts +182 -0
- package/tests/pipe-filestat.test.ts +157 -0
- package/tests/pipe-persistent-lifetime.test.ts +134 -0
- package/tests/pipe-reader-lifetime.test.ts +46 -0
- package/tests/pipe-reader-reuse-races.test.ts +184 -0
- package/tests/pipe-registry-allocator.test.ts +35 -0
- package/tests/pipe-reuse-worker.test.ts +112 -0
- package/tests/pipe-shared-allocator.test.ts +170 -0
- package/tests/pipe-slot-reuse.test.ts +500 -0
- package/tests/pipes.test.ts +1669 -0
- package/tests/preopen-placement.test.ts +236 -0
- package/tests/prepared-platform-boundary.test.ts +26 -0
- package/tests/preview-host-reference.test.ts +51 -0
- package/tests/preview-host-reference.ts +155 -0
- package/tests/preview-host.test.ts +875 -0
- package/tests/preview-network-fixture.ts +150 -0
- package/tests/preview-upgrade-lifetime.test.ts +123 -0
- package/tests/preview-upgrade.test.ts +277 -0
- package/tests/preview-vite.test.ts +296 -0
- package/tests/preview.test.ts +406 -0
- package/tests/preview1-listener-browser.ts +136 -0
- package/tests/preview1-listener-lifecycle.test.ts +55 -0
- package/tests/preview1-listener-module.ts +12 -0
- package/tests/preview1-listener.test.ts +430 -0
- package/tests/preview1-network-launch.test.ts +251 -0
- package/tests/preview1-network-lifetime.test.ts +71 -0
- package/tests/preview1-socket-libc.test.ts +65 -0
- package/tests/preview1-socket-support.ts +213 -0
- package/tests/preview1-socket.test.ts +506 -0
- package/tests/preview1-worker-entry.test.ts +42 -0
- package/tests/preview1-worker-startup.test.ts +74 -0
- package/tests/process-abi.test.ts +1568 -0
- package/tests/process-access.test.ts +653 -0
- package/tests/process-admission.test.ts +413 -0
- package/tests/process-cell-clone-browser.test.ts +24 -0
- package/tests/process-cell-clone-browser.ts +239 -0
- package/tests/process-cell-clone.test.ts +39 -0
- package/tests/process-control.test.ts +166 -0
- package/tests/process-core.test.ts +1528 -0
- package/tests/process-cwd.test.ts +237 -0
- package/tests/process-directory-rejection.test.ts +149 -0
- package/tests/process-entry.test.ts +12 -0
- package/tests/process-execve.test.ts +677 -0
- package/tests/process-host-failure.test.ts +149 -0
- package/tests/process-identity.test.ts +482 -0
- package/tests/process-job.test.ts +504 -0
- package/tests/process-linux-signals.test.ts +535 -0
- package/tests/process-loader-retry.test.ts +137 -0
- package/tests/process-lookup.test.ts +408 -0
- package/tests/process-memory-admission-rollback.test.ts +218 -0
- package/tests/process-navigation-observer.test.ts +362 -0
- package/tests/process-navigation-observer.ts +707 -0
- package/tests/process-observation-boundary.test.ts +103 -0
- package/tests/process-observation-lifecycle.test.ts +279 -0
- package/tests/process-observation-root.test.ts +498 -0
- package/tests/process-observation-standalone.test.ts +236 -0
- package/tests/process-observation.test.ts +243 -0
- package/tests/process-outcome.test.ts +222 -0
- package/tests/process-pipe-recycling.test.ts +336 -0
- package/tests/process-poll-idle.test.ts +345 -0
- package/tests/process-quiescence.test.ts +317 -0
- package/tests/process-recycling-browser-runner-control.ts +103 -0
- package/tests/process-recycling-browser-runner.test.ts +385 -0
- package/tests/process-recycling-browser-runner.ts +410 -0
- package/tests/process-recycling-browser.ts +1720 -0
- package/tests/process-replacement.test.ts +1950 -0
- package/tests/process-root-navigation-diagnostic.test.ts +1146 -0
- package/tests/process-root-navigation-diagnostic.ts +1291 -0
- package/tests/process-signal-poll.test.ts +168 -0
- package/tests/process-spawn-diagnostic.test.ts +388 -0
- package/tests/process-spawn-errno.test.ts +265 -0
- package/tests/process-start-browser-runner.ts +82 -0
- package/tests/process-start-browser.ts +120 -0
- package/tests/process-start-diagnostics.test.ts +301 -0
- package/tests/process-start-failed.test.ts +336 -0
- package/tests/process-start-status.test.ts +512 -0
- package/tests/process-startup-review.test.ts +507 -0
- package/tests/process-worker-lifetime.test.ts +125 -0
- package/tests/process-worker-ownership.test.ts +3153 -0
- package/tests/program-admission-metadata.test.ts +131 -0
- package/tests/program-build-tools.test.ts +271 -0
- package/tests/program-host-command-debt.ts +48 -0
- package/tests/program-host-command-fixture.ts +108 -0
- package/tests/program-host-command-signals.test.ts +271 -0
- package/tests/program-host-command-types.test.ts +46 -0
- package/tests/program-host-command.test.ts +688 -0
- package/tests/program-loading-api.test.ts +475 -0
- package/tests/program-manifest-lookup.test.ts +129 -0
- package/tests/program-script-loading.test.ts +174 -0
- package/tests/program-session-example.test.ts +313 -0
- package/tests/program-url-download.test.ts +380 -0
- package/tests/programs-install-termination-debt.ts +146 -0
- package/tests/programs-install-termination.test.ts +51 -0
- package/tests/programs-install.test.ts +388 -0
- package/tests/public-workspace-endurance.test.ts +244 -0
- package/tests/publication-browser-runner.test.ts +27 -0
- package/tests/publication-browser-runner.ts +96 -0
- package/tests/publication-browser.ts +913 -0
- package/tests/publication-channel-observer.test.ts +92 -0
- package/tests/publication-checkpoint-contract.test.ts +306 -0
- package/tests/publication-command.ts +35 -0
- package/tests/publication-cross-tab-assets.ts +38 -0
- package/tests/publication-cross-tab-browser-runner.ts +37 -0
- package/tests/publication-cross-tab-browser.ts +966 -0
- package/tests/publication-cross-tab-command.ts +1003 -0
- package/tests/publication-cross-tab-host.ts +89 -0
- package/tests/publication-cross-tab-inventory.ts +53 -0
- package/tests/publication-durable-metadata.test.ts +507 -0
- package/tests/publication-limits-contract.test.ts +106 -0
- package/tests/publication-memory-accounting.test.ts +575 -0
- package/tests/readiness-stream.test.ts +405 -0
- package/tests/readiness.test.ts +90 -0
- package/tests/recovery-r42-browser-runner.ts +330 -0
- package/tests/recovery-r42.test.ts +23 -0
- package/tests/reservation-waste.test.ts +243 -0
- package/tests/resident-construction.test.ts +663 -0
- package/tests/root-continuity-browser-runner.ts +62 -0
- package/tests/root-continuity-browser.ts +269 -0
- package/tests/root-continuity-command.ts +23 -0
- package/tests/root-continuity-source-parity.test.ts +77 -0
- package/tests/root-continuity.test.ts +196 -0
- package/tests/root-return-gc.test.ts +36 -0
- package/tests/running-member-reuse-browser-runner.ts +123 -0
- package/tests/running-member-reuse-browser.ts +383 -0
- package/tests/runtime-budget-ownership.test.ts +38 -0
- package/tests/runtime-display-fence.test.ts +20 -0
- package/tests/runtime-disposal-signal-order.test.ts +25 -0
- package/tests/runtime-facade.test.ts +1999 -0
- package/tests/runtime-filesystem-close-debt.test.ts +38 -0
- package/tests/runtime-network-fence.test.ts +8 -0
- package/tests/runtime-network.test.ts +456 -0
- package/tests/runtime-process-context.test.ts +349 -0
- package/tests/runtime-request-pool.test.ts +83 -0
- package/tests/runtime-size.test.ts +102 -0
- package/tests/runtime-startup-proof.test.ts +86 -0
- package/tests/runtime-startup-proof.ts +25 -0
- package/tests/runtime-startup.test.ts +299 -0
- package/tests/runtime-terminals.test.ts +496 -0
- package/tests/safe-staging-browser-runner.ts +22 -0
- package/tests/safe-staging-browser.ts +1224 -0
- package/tests/safe-staging-fixture-hooks.test.ts +63 -0
- package/tests/safe-staging-native.test.ts +29 -0
- package/tests/safe-staging-native.ts +32 -0
- package/tests/safe-staging-runner-contract.test.ts +30 -0
- package/tests/safe-staging.test.ts +96 -0
- package/tests/search-executor-browser-runner.ts +34 -0
- package/tests/search-executor-browser.ts +614 -0
- package/tests/search-file-reader.test.ts +58 -0
- package/tests/search-grep-plan.test.ts +364 -0
- package/tests/search-matcher-differential.test.ts +187 -0
- package/tests/search-matcher.test.ts +173 -0
- package/tests/search-operand-plan.test.ts +30 -0
- package/tests/search-program-browser-runner.ts +146 -0
- package/tests/search-program-browser.ts +388 -0
- package/tests/search-rg-plan.test.ts +407 -0
- package/tests/search-run.test.ts +366 -0
- package/tests/search-source.test.ts +129 -0
- package/tests/sender-admission.test.ts +251 -0
- package/tests/shared-caller-admission.test.ts +121 -0
- package/tests/shared-caller-host-exec.test.ts +119 -0
- package/tests/shared-control-pipes.test.ts +37 -0
- package/tests/shared-guest-backing.test.ts +746 -0
- package/tests/shared-memory-admission.test.ts +203 -0
- package/tests/shared-memory-browser-bundle.test.ts +62 -0
- package/tests/shared-memory-input.test.ts +79 -0
- package/tests/shared-reservation-coverage.test.ts +15 -0
- package/tests/spawn-error-context.test.ts +38 -0
- package/tests/stable-memory-reader.test.ts +26 -0
- package/tests/start-failure-quiet-browser.ts +333 -0
- package/tests/start-failure-quiet.test.ts +24 -0
- package/tests/startup-diagnostic-browser.ts +192 -0
- package/tests/startup-diagnostic.test.ts +43 -0
- package/tests/startup-pool-browser.ts +173 -0
- package/tests/stop-order-browser-runner.ts +135 -0
- package/tests/stop-order-browser.ts +166 -0
- package/tests/storage-allocation.ts +41 -0
- package/tests/storage-browser-helpers.ts +46 -0
- package/tests/storage-browser-runner.ts +205 -0
- package/tests/storage-browser.ts +2 -0
- package/tests/storage-caller-release.test.ts +82 -0
- package/tests/storage-crash-r2-browser.ts +7 -0
- package/tests/storage-crash-r2-indexeddb.ts +307 -0
- package/tests/storage-crash-r2-opfs.ts +224 -0
- package/tests/storage-crash-r2-scheduler.ts +88 -0
- package/tests/storage-crash-r2-state.ts +132 -0
- package/tests/storage-crash-r2.test.ts +109 -0
- package/tests/storage-lifecycle-marker.ts +5 -0
- package/tests/storage-lifecycle-observer.ts +131 -0
- package/tests/storage-lock-adapter.test.ts +82 -0
- package/tests/storage-lock-browser-runner.ts +1033 -0
- package/tests/storage-lock-browser.ts +321 -0
- package/tests/storage-lock-cases.ts +157 -0
- package/tests/storage-lock-host.ts +103 -0
- package/tests/storage-lock-observation.ts +60 -0
- package/tests/storage-lock-page.ts +18 -0
- package/tests/storage-lock-peer.ts +132 -0
- package/tests/storage-lock-recovery-worker.ts +60 -0
- package/tests/storage-lock-schedules.ts +375 -0
- package/tests/storage-lock-startup.test.ts +73 -0
- package/tests/storage-navigation-diagnostics.test.ts +548 -0
- package/tests/storage-navigation-diagnostics.ts +231 -0
- package/tests/storage-open-worker.ts +18 -0
- package/tests/storage-quota-control.ts +12 -0
- package/tests/storage-quota-r2-browser.ts +548 -0
- package/tests/storage-quota-r2-probes.ts +393 -0
- package/tests/storage-quota-r2.test.ts +17 -0
- package/tests/storage-release-browser.ts +129 -0
- package/tests/storage-release.test.ts +442 -0
- package/tests/storage-suite-contract.test.ts +15 -0
- package/tests/storage.test.ts +520 -0
- package/tests/symlink-sizing.test.ts +226 -0
- package/tests/terminal-control.test.ts +639 -0
- package/tests/terminal-deadholder.test.ts +631 -0
- package/tests/terminal-gate-wake.test.ts +360 -0
- package/tests/terminal-handoff.test.ts +86 -0
- package/tests/terminal-input.test.ts +332 -0
- package/tests/terminal-interrupt-flush.test.ts +554 -0
- package/tests/terminal-output.test.ts +711 -0
- package/tests/terminal-read-fds.test.ts +153 -0
- package/tests/terminal-resolver-worker.test.ts +125 -0
- package/tests/terminal-session.test.ts +1794 -0
- package/tests/thread-admission.test.ts +151 -0
- package/tests/threads-browser-contract.ts +32 -0
- package/tests/threads-browser-guest-worker.ts +12 -0
- package/tests/threads-browser-page.ts +552 -0
- package/tests/threads-browser-runner.test.ts +83 -0
- package/tests/threads-browser-runner.ts +120 -0
- package/tests/threads-browser-service-worker.ts +116 -0
- package/tests/threads-fdstat-admission.test.ts +64 -0
- package/tests/threads-fdstat-authority-worker.ts +65 -0
- package/tests/threads-fdstat-authority.test.ts +81 -0
- package/tests/threads-fdstat.test.ts +304 -0
- package/tests/threads-fixture-inspect.ts +179 -0
- package/tests/threads-fixture-producer.test.ts +97 -0
- package/tests/threads-guest-fixture.ts +204 -0
- package/tests/threads-guest-lane.test.ts +64 -0
- package/tests/threads-guest-memory.test.ts +283 -0
- package/tests/threads-guest-module.ts +92 -0
- package/tests/threads-guest-rust-runner.test.ts +52 -0
- package/tests/threads-guest-rust-runner.ts +142 -0
- package/tests/threads-guest-worker.ts +50 -0
- package/tests/threads-guest.test.ts +280 -0
- package/tests/threads-lifecycle-module.ts +41 -0
- package/tests/threads-lifecycle-waiter.ts +38 -0
- package/tests/threads-lifecycle.test.ts +416 -0
- package/tests/threads-memory-growth.test.ts +188 -0
- package/tests/threads-random-control.ts +170 -0
- package/tests/threads-random.test.ts +23 -0
- package/tests/threads-runtime-authority-worker.ts +63 -0
- package/tests/threads-runtime-browser-runner.ts +96 -0
- package/tests/threads-runtime-browser.ts +483 -0
- package/tests/threads-runtime-cases.ts +21 -0
- package/tests/threads-runtime-cleanup.test.ts +58 -0
- package/tests/threads-runtime-cleanup.ts +42 -0
- package/tests/threads-runtime-control.ts +13 -0
- package/tests/threads-runtime-failure-control.ts +338 -0
- package/tests/threads-runtime-failures.test.ts +116 -0
- package/tests/threads-runtime-fault-bootstrap.ts +1 -0
- package/tests/threads-runtime-fault-conditions.test.ts +35 -0
- package/tests/threads-runtime-fault-control.ts +394 -0
- package/tests/threads-runtime-fault-service.ts +56 -0
- package/tests/threads-runtime-fd-control.ts +388 -0
- package/tests/threads-runtime-fd-descriptors.test.ts +43 -0
- package/tests/threads-runtime-fd-filesystem.ts +41 -0
- package/tests/threads-runtime-fd-module.ts +91 -0
- package/tests/threads-runtime-fd-service.ts +54 -0
- package/tests/threads-runtime-host.ts +19 -0
- package/tests/threads-runtime-late-read-service.ts +46 -0
- package/tests/threads-runtime-modules.ts +114 -0
- package/tests/threads-runtime-safari-packet.ts +285 -0
- package/tests/threads-runtime-safari-runner.test.ts +173 -0
- package/tests/threads-runtime-safari-runner.ts +270 -0
- package/tests/threads-runtime-service-barrier.ts +49 -0
- package/tests/threads-runtime.test.ts +143 -0
- package/tests/threads-safari-runner.ts +159 -0
- package/tests/threads-service-edge.test.ts +93 -0
- package/tests/threads-service-fixture.ts +117 -0
- package/tests/threads-service-host.ts +103 -0
- package/tests/threads-service.test.ts +305 -0
- package/tests/threads-wait-owner.test.ts +169 -0
- package/tests/vfs-continuation.test.ts +337 -0
- package/tests/vfs-guest-buffer.test.ts +31 -0
- package/tests/vfs-harness.test.ts +414 -0
- package/tests/vfs.test.ts +167 -0
- package/tests/wasi-clocks.test.ts +152 -0
- package/tests/wasi-exit.test.ts +74 -0
- package/tests/wasi-libc.test.ts +272 -0
- package/tests/wasi-nonblock-inheritance.test.ts +109 -0
- package/tests/wasi-nonblock.test.ts +181 -0
- package/tests/wasi-path-memory.test.ts +225 -0
- package/tests/wasi-size-admission.test.ts +227 -0
- package/tests/wasm-start-section.test.ts +39 -0
- package/tests/watch-account.test.ts +603 -0
- package/tests/watch-admission.test.ts +211 -0
- package/tests/watch-committed.test.ts +1068 -0
- package/tests/watch-direct-worker.ts +35 -0
- package/tests/watch-registration-reap.test.ts +129 -0
- package/tests/watch-root-runtime.test.ts +313 -0
- package/tests/worker-access.test.ts +331 -0
- package/tests/worker-final-completion.test.ts +434 -0
- package/tests/worker-memory-bootstrap.test.ts +219 -0
- package/tests/worker-memory-broker.test.ts +658 -0
- package/tests/worker-memory.test.ts +210 -0
- package/tests/worker-pipes.test.ts +993 -0
- package/tests/worker-pool.test.ts +88 -0
- package/tests/worker-selected-signal.test.ts +429 -0
- package/tests/workspace-archive-pulls.test.ts +501 -0
- package/tests/workspace-archive.test.ts +1281 -0
- package/tests/workspace-browser.ts +444 -0
- package/tests/workspace-capacity.test.ts +627 -0
- package/tests/workspace-continuity-browser-runner.ts +664 -0
- package/tests/workspace-continuity-checkpoint.test.ts +101 -0
- package/tests/workspace-continuity.test.ts +196 -0
- package/tests/workspace-export-public.test.ts +154 -0
- package/tests/workspace-export.test.ts +1709 -0
- package/tests/workspace-import-admission.test.ts +409 -0
- package/tests/workspace-root-release.test.ts +112 -0
- package/tests/workspace-safari-browser.ts +239 -0
- package/tests/workspace-safari-guest.ts +38 -0
- package/tests/workspace-safari-local.ts +33 -0
- package/tests/workspace-safari-runner.test.ts +298 -0
- package/tests/workspace-search.test.ts +892 -0
- package/tests/workspace-vfs-read-browser.ts +388 -0
- package/tests/workspace-vfs-read-cold-lifecycle.test.ts +236 -0
- package/tests/workspace-vfs-read-cold-readiness.test.ts +97 -0
- package/tests/workspace-vfs-read-dirty.test.ts +119 -0
- package/tests/workspace-vfs-read-races.test.ts +863 -0
- package/tests/workspace-vfs-read-serials.test.ts +124 -0
- package/tests/workspace-vfs-read-shutdown.test.ts +217 -0
- package/tests/workspace-vfs-read-stream.test.ts +878 -0
- package/tests/workspace-vfs-read.test.ts +758 -0
- package/tests/workspace-vfs.test.ts +785 -0
- package/thread/entry.ts +140 -0
- package/thread/guest-bootstrap.ts +12 -0
- package/thread/guest-imports.ts +329 -0
- package/thread/guest-module.ts +6 -0
- package/thread/guest-worker.ts +179 -0
- package/thread/lane.ts +461 -0
- package/thread/protocol.ts +18 -0
- package/thread/runtime-owner.ts +619 -0
- package/thread/runtime-protocol.ts +33 -0
- package/thread/service-worker.ts +95 -0
- package/thread/service.ts +482 -0
- package/tooling/build-network.ts +157 -0
- package/tooling/check-network-rust.ts +59 -0
- package/tooling/check-package-metadata.ts +8 -0
- package/tooling/ci-paths.test.ts +1636 -0
- package/tooling/fixtures/page-runner-error-consumer.ts +124 -0
- package/tooling/gpu-coverage.ts +177 -0
- package/tooling/gpu-desktop-measure.ts +100 -0
- package/tooling/gpu-measure-host.ts +59 -0
- package/tooling/gpu-measure.ts +512 -0
- package/tooling/gpu-size.ts +38 -0
- package/tooling/gpu-stream-layout.ts +268 -0
- package/tooling/gpu-stream-model.ts +106 -0
- package/tooling/gpu-stream.ts +951 -0
- package/tooling/host-interface.ts +107 -0
- package/tooling/network-growth.ts +120 -0
- package/tooling/network-size.ts +73 -0
- package/tooling/network-source-smoke.ts +86 -0
- package/tooling/network-translator/bun.lock +15 -0
- package/tooling/network-translator/package.json +7 -0
- package/tooling/network-translator.test.ts +117 -0
- package/tooling/network-translator.ts +147 -0
- package/tooling/package-inputs.ts +25 -0
- package/tooling/prepare-allocation-reference.ts +32 -0
- package/tooling/private-authority.ts +1431 -0
- package/tooling/program/program-build-tools.ts +440 -0
- package/tooling/program/program-derivation.ts +175 -0
- package/tooling/program/program-optimize.ts +330 -0
- package/tooling/program/program-transformer.json +1 -0
- package/tooling/program-tools-package.ts +77 -0
- package/tooling/quality-probes.ts +101 -0
- package/tooling/runtime-size.ts +42 -0
- package/tooling/shared-reservations.ts +57 -0
- package/tooling/storage-crash-r2-mutations.ts +59 -0
- package/tooling/storage-crash-r2.ts +89 -0
- package/tooling/storage-quota-r2.ts +141 -0
- package/tooling/tarball-smoke.ts +554 -0
- package/tooling/typescript-source.test.ts +38 -0
- package/tooling/typescript-source.ts +47 -0
- package/tooling/vfs-benchmark.ts +903 -0
- package/tooling/vfs-browser.ts +320 -0
- package/tooling/vfs-continuation.ts +313 -0
- package/tooling/vfs-guest.ts +235 -0
- package/tooling/vfs-score-config.ts +64 -0
- package/tooling/vfs-score.ts +406 -0
- package/tooling/vfs-startup.ts +21 -0
- package/tooling/vfs-workloads.ts +382 -0
- package/tooling/workspace-safari-runner.ts +313 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1636 @@
|
|
|
1
|
+
import { Glob, YAML } from "bun";
|
|
2
|
+
import { expect, test } from "bun:test";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
6
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function record(value: unknown): Record<string, unknown> {
|
|
10
|
+
if (!isRecord(value)) throw new Error("expected a workflow mapping");
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const workflow = record(
|
|
15
|
+
YAML.parse(readFileSync(new URL("../../../.github/workflows/ci.yml", import.meta.url), "utf8")),
|
|
16
|
+
);
|
|
17
|
+
const jobs = record(workflow.jobs);
|
|
18
|
+
const changes = record(jobs.changes);
|
|
19
|
+
if (!Array.isArray(changes.steps)) throw new Error("expected change-detection steps");
|
|
20
|
+
const paths = changes.steps.map(record).find((step) => step.id === "paths");
|
|
21
|
+
const filters = record(YAML.parse(String(record(paths?.with).filters)));
|
|
22
|
+
|
|
23
|
+
function selected(name: string, path: string): boolean {
|
|
24
|
+
const patterns = filters[name];
|
|
25
|
+
if (!Array.isArray(patterns) || !patterns.every((pattern) => typeof pattern === "string"))
|
|
26
|
+
throw new Error(`expected ${name} path patterns`);
|
|
27
|
+
return patterns.some((pattern: string) => new Glob(pattern).match(path));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (const name of ["browser", "libc"]) {
|
|
31
|
+
test(`${name} waits for paths and runs on manual dispatch or filter failure`, () => {
|
|
32
|
+
const job = record(jobs[name]);
|
|
33
|
+
// libc is also the single producer of the memory group fixture the browser gate consumes.
|
|
34
|
+
expect(job.needs).toEqual(
|
|
35
|
+
name === "browser"
|
|
36
|
+
? ["changes", "network-wasm", "libc", "threads-fixture"]
|
|
37
|
+
: ["changes", "network-wasm"],
|
|
38
|
+
);
|
|
39
|
+
const producer = name === "libc" ? " || needs.changes.outputs.browser == 'true'" : "";
|
|
40
|
+
expect(job.if).toBe(
|
|
41
|
+
`\${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.${name} == 'true'${producer})) }}`,
|
|
42
|
+
);
|
|
43
|
+
expect(record(changes.outputs)[name]).toBe(`\${{ steps.paths.outputs.${name} }}`);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test(`${name} selects runtime, dependency and workflow inputs`, () => {
|
|
47
|
+
for (const path of [
|
|
48
|
+
"packages/waffle/core/wasi.ts",
|
|
49
|
+
"packages/waffle/core/memory-views.ts",
|
|
50
|
+
"packages/waffle/fs/persistent.ts",
|
|
51
|
+
"packages/waffle/proc/abi.ts",
|
|
52
|
+
"packages/waffle/interrupt/rewriter.ts",
|
|
53
|
+
"packages/waffle/browser/net/host.ts",
|
|
54
|
+
"packages/waffle/index.ts",
|
|
55
|
+
"packages/waffle/runtime.ts",
|
|
56
|
+
"package.json",
|
|
57
|
+
"bun.lock",
|
|
58
|
+
".github/workflows/ci.yml",
|
|
59
|
+
])
|
|
60
|
+
expect(selected(name, path), path).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test(`${name} does not run for docs, site or quality-only inputs`, () => {
|
|
64
|
+
for (const path of [
|
|
65
|
+
"README.md",
|
|
66
|
+
"docs/host-abi.md",
|
|
67
|
+
"plans/browser-runtime.md",
|
|
68
|
+
"site/src/pages/index.astro",
|
|
69
|
+
"site/package.json",
|
|
70
|
+
"site/bun.lock",
|
|
71
|
+
"tooling/ci-paths.test.ts",
|
|
72
|
+
"knip.config.ts",
|
|
73
|
+
".oxlintrc.json",
|
|
74
|
+
])
|
|
75
|
+
expect(selected(name, path), path).toBe(false);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
test("browser relay inputs select the normal gate and only its parallel group installs native peers", () => {
|
|
80
|
+
for (const path of [
|
|
81
|
+
"packages/waffle/tests/network-relay-browser-runner.ts",
|
|
82
|
+
"packages/waffle/tests/network-relay-worker.ts",
|
|
83
|
+
"packages/waffle/tests/fixtures/preview1-relay.wat",
|
|
84
|
+
"packages/waffle-relay/src/tcp-client.ts",
|
|
85
|
+
"packages/waffle-relay/src/node-webtransport.ts",
|
|
86
|
+
"packages/waffle-relay/package.json",
|
|
87
|
+
"packages/waffle-relay/scripts/prepare-native.ts",
|
|
88
|
+
"packages/waffle-relay/tests/prepare-native.test.ts",
|
|
89
|
+
"packages/waffle/tooling/workspace-safari-runner.ts",
|
|
90
|
+
])
|
|
91
|
+
expect(selected("browser", path), path).toBe(true);
|
|
92
|
+
const steps = record(jobs.browser).steps;
|
|
93
|
+
if (!Array.isArray(steps)) throw new Error("expected browser steps");
|
|
94
|
+
const native = steps
|
|
95
|
+
.map(record)
|
|
96
|
+
.find((step) => step.name === "Prepare and verify the required native relay prebuild");
|
|
97
|
+
expect(native?.if).toBe("matrix.group == 'parallel'");
|
|
98
|
+
expect(native?.run).toBe("bun packages/waffle-relay/scripts/prepare-native.ts");
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const consumerFilters = [
|
|
102
|
+
"network",
|
|
103
|
+
"coreutils",
|
|
104
|
+
"sed",
|
|
105
|
+
"findutils",
|
|
106
|
+
"grep",
|
|
107
|
+
"ripgrep",
|
|
108
|
+
"base",
|
|
109
|
+
"programs",
|
|
110
|
+
"diffutils",
|
|
111
|
+
"gh",
|
|
112
|
+
"jq",
|
|
113
|
+
"curl",
|
|
114
|
+
"awk",
|
|
115
|
+
"tar",
|
|
116
|
+
"procps",
|
|
117
|
+
"browser",
|
|
118
|
+
"libc",
|
|
119
|
+
"checksums",
|
|
120
|
+
] as const;
|
|
121
|
+
|
|
122
|
+
test("relay image inputs stay out of unrelated consumer gates", () => {
|
|
123
|
+
for (const path of [
|
|
124
|
+
".github/workflows/relay-image.yml",
|
|
125
|
+
"packages/waffle-relay/scripts/relay-image-custody.ts",
|
|
126
|
+
])
|
|
127
|
+
for (const name of consumerFilters)
|
|
128
|
+
expect(selected(name, path), `${name}: ${path}`).toBe(false);
|
|
129
|
+
|
|
130
|
+
for (const name of consumerFilters)
|
|
131
|
+
expect(selected(name, ".github/workflows/ci.yml"), name).toBe(true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test("shared workflow inputs select the gates that consume them", () => {
|
|
135
|
+
const optimizerConsumers = new Set([
|
|
136
|
+
"coreutils",
|
|
137
|
+
"findutils",
|
|
138
|
+
"programs",
|
|
139
|
+
"diffutils",
|
|
140
|
+
"jq",
|
|
141
|
+
"awk",
|
|
142
|
+
"tar",
|
|
143
|
+
"checksums",
|
|
144
|
+
]);
|
|
145
|
+
for (const name of optimizerConsumers)
|
|
146
|
+
expect(selected(name, ".github/actions/program-optimizer/action.yml"), name).toBe(true);
|
|
147
|
+
|
|
148
|
+
for (const name of consumerFilters.filter((name) => !optimizerConsumers.has(name)))
|
|
149
|
+
expect(selected(name, ".github/actions/program-optimizer/action.yml"), name).toBe(false);
|
|
150
|
+
|
|
151
|
+
expect(selected("findutils", ".github/workflows/findutils-xargs.yml")).toBe(true);
|
|
152
|
+
expect(selected("coreutils", ".github/workflows/findutils-xargs.yml")).toBe(true);
|
|
153
|
+
expect(selected("coreutils", ".github/workflows/coreutils-echo.yml")).toBe(true);
|
|
154
|
+
for (const name of consumerFilters.filter((name) => name !== "coreutils" && name !== "findutils"))
|
|
155
|
+
expect(selected(name, ".github/workflows/findutils-xargs.yml"), name).toBe(false);
|
|
156
|
+
for (const name of consumerFilters.filter((name) => name !== "coreutils"))
|
|
157
|
+
expect(selected(name, ".github/workflows/coreutils-echo.yml"), name).toBe(false);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const release = record(
|
|
161
|
+
YAML.parse(
|
|
162
|
+
readFileSync(new URL("../../../.github/workflows/release.yml", import.meta.url), "utf8"),
|
|
163
|
+
),
|
|
164
|
+
);
|
|
165
|
+
const releaseStepValues = record(record(release.jobs).release).steps;
|
|
166
|
+
if (!Array.isArray(releaseStepValues)) throw new Error("expected release steps");
|
|
167
|
+
const releaseSteps = releaseStepValues.map(record);
|
|
168
|
+
|
|
169
|
+
function releaseStep(name: string): string {
|
|
170
|
+
const step = releaseSteps.find((entry) => entry.name === name);
|
|
171
|
+
if (typeof step?.run !== "string") throw new Error(`missing release step: ${name}`);
|
|
172
|
+
return step.run;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
test("release workflow publishes to npm with Changesets and OIDC provenance", () => {
|
|
176
|
+
expect(record(release.permissions).contents).toBe("write");
|
|
177
|
+
expect(record(release.permissions)["pull-requests"]).toBe("write");
|
|
178
|
+
expect(record(release.permissions)["id-token"]).toBe("write");
|
|
179
|
+
const authStep = releaseStep("Configure npm authentication");
|
|
180
|
+
expect(authStep).toContain('if [ -n "${NPM_TOKEN:-}" ]');
|
|
181
|
+
const publishStep = releaseSteps.find(
|
|
182
|
+
(entry) => entry.name === "Create Release Pull Request or Publish to npm",
|
|
183
|
+
);
|
|
184
|
+
expect(publishStep?.uses).toBe("changesets/action@v1");
|
|
185
|
+
const inputs = record(publishStep?.with);
|
|
186
|
+
expect(inputs.publish).toBe("bun run release:publish");
|
|
187
|
+
expect(inputs.createGithubReleases).toBe(true);
|
|
188
|
+
expect(record(publishStep?.env).NPM_CONFIG_PROVENANCE).toBe("true");
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test("browser selects runners, shared controls and guest fixtures", () => {
|
|
192
|
+
for (const path of [
|
|
193
|
+
"packages/waffle/scripts/test-browser.ts",
|
|
194
|
+
"packages/waffle/scripts/browser-command.ts",
|
|
195
|
+
"packages/waffle/scripts/browser-supervisor.ts",
|
|
196
|
+
"packages/waffle/scripts/owned-command.ts",
|
|
197
|
+
"packages/waffle/tests/storage-browser-runner.ts",
|
|
198
|
+
"packages/waffle/tests/publication-browser-runner.ts",
|
|
199
|
+
"packages/waffle/tests/filesystem-transport-browser-runner.ts",
|
|
200
|
+
"packages/waffle/tests/workspace-browser.ts",
|
|
201
|
+
"packages/waffle/tests/fixtures/publication-guest.ts",
|
|
202
|
+
])
|
|
203
|
+
expect(selected("browser", path), path).toBe(true);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
function stepsFor(name: string): Array<Record<string, unknown>> {
|
|
207
|
+
const steps = record(jobs[name]).steps;
|
|
208
|
+
if (!Array.isArray(steps)) throw new Error(`expected ${name} steps`);
|
|
209
|
+
return steps.map(record);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function artifactStep(steps: readonly Record<string, unknown>[], path: string) {
|
|
213
|
+
const step = steps.find(
|
|
214
|
+
(step) => step.uses === "actions/upload-artifact@v4" && record(step.with).path === path,
|
|
215
|
+
);
|
|
216
|
+
if (!step) throw new Error(`expected artifact upload for ${path}`);
|
|
217
|
+
return step;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const threadsWorkflow = record(
|
|
221
|
+
YAML.parse(
|
|
222
|
+
readFileSync(
|
|
223
|
+
new URL("../../../.github/workflows/threads-fixture.yml", import.meta.url),
|
|
224
|
+
"utf8",
|
|
225
|
+
),
|
|
226
|
+
),
|
|
227
|
+
);
|
|
228
|
+
const threadsProducer = record(record(threadsWorkflow.jobs).producer);
|
|
229
|
+
if (!Array.isArray(threadsProducer.steps)) throw new Error("expected threads producer steps");
|
|
230
|
+
const threadsSteps = threadsProducer.steps.map(record);
|
|
231
|
+
|
|
232
|
+
test("thread, memory and producer inputs select the browser and all its fixture dependencies", () => {
|
|
233
|
+
for (const path of [
|
|
234
|
+
"packages/waffle/thread/runtime-owner.ts",
|
|
235
|
+
"packages/waffle/memory/reservations.ts",
|
|
236
|
+
"packages/waffle/tests/fixtures/threads.rs",
|
|
237
|
+
"packages/waffle/tests/threads-fixture-inspect.ts",
|
|
238
|
+
"packages/waffle/tests/threads-runtime-browser-runner.ts",
|
|
239
|
+
"packages/waffle/scripts/build-thread-fixture.ts",
|
|
240
|
+
"packages/waffle/scripts/threads-fixture-producer.test.ts",
|
|
241
|
+
"packages/waffle/rust-toolchain.toml",
|
|
242
|
+
"rust-toolchain.toml",
|
|
243
|
+
".github/workflows/threads-fixture.yml",
|
|
244
|
+
])
|
|
245
|
+
expect(selected("browser", path), path).toBe(true);
|
|
246
|
+
const producer = record(jobs["threads-fixture"]);
|
|
247
|
+
expect(producer.needs).toBe("changes");
|
|
248
|
+
expect(producer.if).toBe(record(jobs.browser).if);
|
|
249
|
+
expect(String(record(jobs.libc).if)).toContain("needs.changes.outputs.browser == 'true'");
|
|
250
|
+
expect(producer.uses).toBe("./.github/workflows/threads-fixture.yml");
|
|
251
|
+
const triggers = record(threadsWorkflow.on);
|
|
252
|
+
expect(Object.keys(triggers).sort()).toEqual(["workflow_call", "workflow_dispatch"]);
|
|
253
|
+
expect(String(record(threadsWorkflow.concurrency).group)).not.toBe(
|
|
254
|
+
String(record(workflow.concurrency).group),
|
|
255
|
+
);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("one pinned Rust producer exports its exact uploaded artifact through the reusable workflow", () => {
|
|
259
|
+
const upload = artifactStep(threadsSteps, "${{ runner.temp }}/threads-fixture");
|
|
260
|
+
expect(record(upload.with)["if-no-files-found"]).toBe("error");
|
|
261
|
+
expect(record(threadsProducer.outputs)["artifact-id"]).toBe(
|
|
262
|
+
`\${{ steps.${upload.id}.outputs.artifact-id }}`,
|
|
263
|
+
);
|
|
264
|
+
const outputs = record(record(record(threadsWorkflow.on).workflow_call).outputs);
|
|
265
|
+
expect(record(outputs["artifact-id"]).value).toBe("${{ jobs.producer.outputs.artifact-id }}");
|
|
266
|
+
const builds = threadsSteps.filter((step) =>
|
|
267
|
+
String(step.run ?? "").includes("threads-fixture-producer.test.ts"),
|
|
268
|
+
);
|
|
269
|
+
expect(builds).toHaveLength(1);
|
|
270
|
+
expect(record(builds[0]?.env).THREAD_FIXTURE_EXPORT_DIR).toBe(record(upload.with).path);
|
|
271
|
+
const compiler = threadsSteps.find((step) => step.uses === "dtolnay/rust-toolchain@stable");
|
|
272
|
+
expect(record(compiler?.with).toolchain).toBe("1.98.1");
|
|
273
|
+
expect(record(compiler?.with).targets).toBe("wasm32-wasip1-threads");
|
|
274
|
+
expect(threadsSteps.some((step) => String(step.run).includes("cache-hit="))).toBe(true);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
test("both browser groups download the producer ID and verify it without compiling Rust", () => {
|
|
278
|
+
const steps = stepsFor("browser");
|
|
279
|
+
const downloads = steps.filter(
|
|
280
|
+
(step) =>
|
|
281
|
+
step.uses === "actions/download-artifact@v8" &&
|
|
282
|
+
record(step.with).path === "${{ runner.temp }}/threads-fixture",
|
|
283
|
+
);
|
|
284
|
+
expect(downloads).toHaveLength(1);
|
|
285
|
+
const download = record(downloads[0]);
|
|
286
|
+
const inputs = record(download.with);
|
|
287
|
+
expect(inputs["artifact-ids"]).toBe("${{ needs.threads-fixture.outputs.artifact-id }}");
|
|
288
|
+
expect(inputs["digest-mismatch"]).toBe("error");
|
|
289
|
+
expect(inputs["merge-multiple"]).toBe(true);
|
|
290
|
+
for (const field of ["name", "pattern", "run-id", "github-token"])
|
|
291
|
+
expect(inputs[field]).toBeUndefined();
|
|
292
|
+
expect(download.if).toBeUndefined();
|
|
293
|
+
const guard = steps.find((step) => step.name === "Require the Rust threads fixture artifact ID");
|
|
294
|
+
expect(record(guard?.env).THREAD_ARTIFACT_ID).toBe(inputs["artifact-ids"]);
|
|
295
|
+
expect(steps.indexOf(record(guard))).toBeLessThan(steps.indexOf(download));
|
|
296
|
+
for (const id of ["", "45678"]) {
|
|
297
|
+
const result = Bun.spawnSync(["bash", "-e", "-c", String(guard?.run)], {
|
|
298
|
+
env: { ...process.env, THREAD_ARTIFACT_ID: id },
|
|
299
|
+
});
|
|
300
|
+
expect(result.exitCode).toBe(id ? 0 : 1);
|
|
301
|
+
}
|
|
302
|
+
const verify = steps.find(
|
|
303
|
+
(step) => step.run === "bun packages/waffle/scripts/build-thread-fixture.ts --verify",
|
|
304
|
+
);
|
|
305
|
+
const browser = steps.find((step) => String(step.run).startsWith("bun run test:browser"));
|
|
306
|
+
expect(record(verify?.env).THREAD_FIXTURE_DIR).toBe(inputs.path);
|
|
307
|
+
expect(record(browser?.env).THREAD_FIXTURE_DIR).toBe(inputs.path);
|
|
308
|
+
expect(steps.indexOf(download)).toBeLessThan(steps.indexOf(record(verify)));
|
|
309
|
+
expect(steps.indexOf(record(verify))).toBeLessThan(steps.indexOf(record(browser)));
|
|
310
|
+
expect(steps.some((step) => /rust-toolchain/.test(String(step.uses)))).toBe(false);
|
|
311
|
+
const commands = steps.map((step) => String(step.run ?? ""));
|
|
312
|
+
expect(commands.some((command) => /\b(cargo|rustc)\s/.test(command))).toBe(false);
|
|
313
|
+
expect(commands.filter((command) => command.includes("build-thread-fixture.ts"))).toEqual([
|
|
314
|
+
"bun packages/waffle/scripts/build-thread-fixture.ts --verify",
|
|
315
|
+
]);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test("Complete CI gate rejects a failed or cancelled required threads producer", () => {
|
|
319
|
+
const gate = record(jobs.gate);
|
|
320
|
+
expect(gate.name).toBe("Complete CI gate");
|
|
321
|
+
expect(gate.if).toBe("always()");
|
|
322
|
+
expect(gate.needs).toContain("threads-fixture");
|
|
323
|
+
const check = stepsFor("gate").find((step) => step.name === "Reject failed or cancelled CI jobs");
|
|
324
|
+
for (const result of ["success", "skipped", "failure", "cancelled"]) {
|
|
325
|
+
const command = Bun.spawnSync(["bash", "-eo", "pipefail", "-c", String(check?.run)], {
|
|
326
|
+
env: {
|
|
327
|
+
...process.env,
|
|
328
|
+
RESULTS: JSON.stringify({
|
|
329
|
+
browser: { result: "skipped" },
|
|
330
|
+
"threads-fixture": { result },
|
|
331
|
+
}),
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
expect(command.exitCode).toBe(result === "success" || result === "skipped" ? 0 : 1);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const recoveryReportPath = "${{ runner.temp }}/recovery-r42-report.json";
|
|
339
|
+
const browserProtocolPath = "${{ runner.temp }}/waffle-browser-protocol.log";
|
|
340
|
+
|
|
341
|
+
test("browser failure retains structured recovery evidence before full protocol", () => {
|
|
342
|
+
const steps = stepsFor("browser");
|
|
343
|
+
const browserTest = steps.find(
|
|
344
|
+
(step) =>
|
|
345
|
+
step.run === 'bun run test:browser 2>&1 | tee "$RUNNER_TEMP/waffle-browser-protocol.log"',
|
|
346
|
+
);
|
|
347
|
+
expect(record(browserTest?.env).DEBUG).toBeUndefined();
|
|
348
|
+
expect(record(browserTest?.env).RECOVERY_R42_REPORT).toBe(recoveryReportPath);
|
|
349
|
+
const recoveryUpload = artifactStep(steps, recoveryReportPath);
|
|
350
|
+
const protocolUpload = artifactStep(steps, browserProtocolPath);
|
|
351
|
+
expect(recoveryUpload.if).toBe("failure()");
|
|
352
|
+
expect(record(recoveryUpload.with).name).toBe(
|
|
353
|
+
"browser-recovery-report-${{ matrix.group }}-${{ github.run_id }}-${{ github.run_attempt }}",
|
|
354
|
+
);
|
|
355
|
+
expect(steps.indexOf(recoveryUpload)).toBeLessThan(steps.indexOf(protocolUpload));
|
|
356
|
+
expect(record(recoveryUpload.with).path).not.toBe(record(protocolUpload.with).path);
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
test("serial browser controls retain durable process evidence even when the command fails", () => {
|
|
360
|
+
const steps = stepsFor("browser");
|
|
361
|
+
const browserTest = steps.find(
|
|
362
|
+
(step) =>
|
|
363
|
+
step.run === 'bun run test:browser 2>&1 | tee "$RUNNER_TEMP/waffle-browser-protocol.log"',
|
|
364
|
+
);
|
|
365
|
+
const result = "${{ runner.temp }}/browser-controls-results.json";
|
|
366
|
+
expect(record(browserTest?.env).BROWSER_CONTROLS_RESULT).toBe(result);
|
|
367
|
+
const upload = artifactStep(steps, `${result}*`);
|
|
368
|
+
expect(upload.if).toBe("always() && matrix.group == 'serial'");
|
|
369
|
+
expect(record(upload.with).name).toBe(
|
|
370
|
+
"browser-controls-${{ github.run_id }}-${{ github.run_attempt }}",
|
|
371
|
+
);
|
|
372
|
+
expect(record(upload.with)["retention-days"]).toBe(7);
|
|
373
|
+
expect(record(upload.with)["if-no-files-found"]).toBe("warn");
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
test("the browser suite runs its two ordered groups on separate runners", () => {
|
|
377
|
+
const browserTest = stepsFor("browser").find(
|
|
378
|
+
(step) =>
|
|
379
|
+
step.run === 'bun run test:browser 2>&1 | tee "$RUNNER_TEMP/waffle-browser-protocol.log"',
|
|
380
|
+
);
|
|
381
|
+
expect(record(browserTest?.env).WAFFLE_BROWSER_GROUP).toBe("${{ matrix.group }}");
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
test("missing recovery report does not replace the browser failure", () => {
|
|
385
|
+
const recoveryUpload = artifactStep(stepsFor("browser"), recoveryReportPath);
|
|
386
|
+
expect(recoveryUpload.if).toBe("failure()");
|
|
387
|
+
expect(record(recoveryUpload.with)["if-no-files-found"]).toBe("ignore");
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
test("package installs share one Bun package-manager cache contract", () => {
|
|
391
|
+
const expectedCacheUses = {
|
|
392
|
+
package: "actions/cache@v4",
|
|
393
|
+
browser: "actions/cache/restore@v4",
|
|
394
|
+
site: "actions/cache/restore@v4",
|
|
395
|
+
};
|
|
396
|
+
let sharedKey: string | undefined;
|
|
397
|
+
for (const name of ["package", "browser", "site"] as const) {
|
|
398
|
+
const steps = stepsFor(name);
|
|
399
|
+
const cacheSteps = steps.filter((step) => {
|
|
400
|
+
if (step.uses !== expectedCacheUses[name]) return false;
|
|
401
|
+
return record(step.with).path === "~/.bun/install/cache";
|
|
402
|
+
});
|
|
403
|
+
expect(cacheSteps).toHaveLength(1);
|
|
404
|
+
|
|
405
|
+
const cache = cacheSteps.at(0);
|
|
406
|
+
if (!cache) throw new Error(`expected ${name} Bun cache`);
|
|
407
|
+
const cachePath = String(record(cache.with).path);
|
|
408
|
+
const cacheKey = String(record(cache.with).key);
|
|
409
|
+
expect(cache.uses).toBe(expectedCacheUses[name]);
|
|
410
|
+
expect(cachePath).toBe("~/.bun/install/cache");
|
|
411
|
+
expect(cachePath).not.toContain("node_modules");
|
|
412
|
+
expect(cacheKey).toContain("${{ runner.os }}");
|
|
413
|
+
expect(cacheKey).toContain("${{ runner.arch }}");
|
|
414
|
+
expect(cacheKey).toContain("${{ env.BUN_VERSION }}");
|
|
415
|
+
expect(cacheKey).toContain("${{ hashFiles('bun.lock', 'site/bun.lock') }}");
|
|
416
|
+
expect(cacheKey).toBe(
|
|
417
|
+
"${{ runner.os }}-${{ runner.arch }}-bun-pm-v2-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock', 'site/bun.lock') }}",
|
|
418
|
+
);
|
|
419
|
+
if (sharedKey === undefined) sharedKey = cacheKey;
|
|
420
|
+
expect(cacheKey).toBe(sharedKey);
|
|
421
|
+
|
|
422
|
+
const cacheIndex = steps.indexOf(cache);
|
|
423
|
+
const installIndexes = steps.flatMap((step, index) =>
|
|
424
|
+
typeof step.run === "string" && step.run.startsWith("bun install") ? [index] : [],
|
|
425
|
+
);
|
|
426
|
+
expect(installIndexes.length).toBeGreaterThan(0);
|
|
427
|
+
expect(cacheIndex).toBeLessThan(Math.min(...installIndexes));
|
|
428
|
+
for (const index of installIndexes) {
|
|
429
|
+
const step = steps[index];
|
|
430
|
+
if (!step) throw new Error(`expected install step ${index}`);
|
|
431
|
+
expect(step.if).toBeUndefined();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
test("package and site gates run for every ready PR", () => {
|
|
437
|
+
for (const name of ["package", "site"]) {
|
|
438
|
+
const job = record(jobs[name]);
|
|
439
|
+
expect(job.if).toBe(
|
|
440
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) }}",
|
|
441
|
+
);
|
|
442
|
+
expect(job.needs).toBe(name === "package" ? "network-wasm" : undefined);
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
test("the package tarball smoke uses the runner temporary directory", () => {
|
|
447
|
+
const smoke = stepsFor("package").find((step) => step.run === "bun run pack:check");
|
|
448
|
+
expect(record(smoke?.env).TMPDIR).toBe("${{ runner.temp }}");
|
|
449
|
+
expect(smoke?.if).toBeUndefined();
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
test("package runs each test root once without repeating preparation", () => {
|
|
453
|
+
const metadata = record(
|
|
454
|
+
JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")),
|
|
455
|
+
);
|
|
456
|
+
const scripts = record(metadata.scripts);
|
|
457
|
+
expect(scripts.test).toBe("bun test ./tests");
|
|
458
|
+
expect(scripts["test:ci"]).toBe("bun test ./tooling/ci-paths.test.ts");
|
|
459
|
+
const steps = record(jobs.package).steps;
|
|
460
|
+
if (!Array.isArray(steps)) throw new Error("expected package steps");
|
|
461
|
+
const commands = steps.map((step) => record(step).run);
|
|
462
|
+
expect(commands.filter((command) => command === "bun run test && bun run test:ci")).toHaveLength(
|
|
463
|
+
1,
|
|
464
|
+
);
|
|
465
|
+
expect(commands).not.toContain("bun run prepare");
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
test("Rust network inputs select one release test/build lane and an exact WASM cache", () => {
|
|
469
|
+
for (const path of [
|
|
470
|
+
"packages/waffle/network/src/lib.rs",
|
|
471
|
+
"packages/waffle/Cargo.lock",
|
|
472
|
+
"packages/waffle/tooling/build-network.ts",
|
|
473
|
+
])
|
|
474
|
+
expect(selected("browser", path), path).toBe(true);
|
|
475
|
+
for (const path of [
|
|
476
|
+
"packages/waffle/Cargo.toml",
|
|
477
|
+
"packages/waffle/Cargo.lock",
|
|
478
|
+
"packages/waffle/rust-toolchain.toml",
|
|
479
|
+
"packages/waffle/network/src/lib.rs",
|
|
480
|
+
"packages/waffle/network/tests/module.rs",
|
|
481
|
+
"packages/waffle/tooling/build-network.ts",
|
|
482
|
+
"packages/waffle/browser/net/module.ts",
|
|
483
|
+
"packages/waffle/tests/network-module.test.ts",
|
|
484
|
+
"packages/waffle/tests/network-module-host.test.ts",
|
|
485
|
+
"packages/waffle/tests/network-wire.test.ts",
|
|
486
|
+
])
|
|
487
|
+
expect(selected("network", path), path).toBe(true);
|
|
488
|
+
expect(selected("network", "docs/network.md")).toBe(false);
|
|
489
|
+
const steps = stepsFor("network-wasm");
|
|
490
|
+
expect(
|
|
491
|
+
steps.filter((step) => typeof step.run === "string" && step.run.includes("cargo test")),
|
|
492
|
+
).toHaveLength(1);
|
|
493
|
+
const testStep = steps.find(
|
|
494
|
+
(step) => typeof step.run === "string" && step.run.includes("cargo test"),
|
|
495
|
+
);
|
|
496
|
+
expect(String(testStep?.run)).toContain("--release");
|
|
497
|
+
expect(String(testStep?.run)).toContain("--features module-tests");
|
|
498
|
+
expect(record(testStep?.env).WAFFLE_TCP_MODULE).toContain("network.wasm");
|
|
499
|
+
const cache = steps.find((step) => step.id === "network-artifact");
|
|
500
|
+
expect(record(cache?.with)["restore-keys"]).toBeUndefined();
|
|
501
|
+
for (const job of ["package", "browser"]) {
|
|
502
|
+
const restore = stepsFor(job).find((step) => step.id === "network-artifact");
|
|
503
|
+
expect(record(restore?.with).key).toBe(record(cache?.with).key);
|
|
504
|
+
expect(record(restore?.with)["fail-on-cache-miss"]).toBe(true);
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
test("network consumers verify restored bytes before install and forbid Cargo", () => {
|
|
509
|
+
for (const name of ["package", "browser"]) {
|
|
510
|
+
const steps = stepsFor(name);
|
|
511
|
+
const restored = steps.findIndex((step) => step.id === "network-artifact");
|
|
512
|
+
const verified = steps.findIndex(
|
|
513
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
514
|
+
);
|
|
515
|
+
const installed = steps.findIndex(
|
|
516
|
+
(step) => typeof step.run === "string" && step.run.startsWith("bun install"),
|
|
517
|
+
);
|
|
518
|
+
expect(verified).toBeGreaterThan(restored);
|
|
519
|
+
expect(verified).toBeLessThan(installed);
|
|
520
|
+
expect(record(record(jobs[name]).env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
521
|
+
expect(steps.some((step) => typeof step.run === "string" && /cargo\s/.test(step.run))).toBe(
|
|
522
|
+
false,
|
|
523
|
+
);
|
|
524
|
+
expect(String(record(steps[restored]?.with).path)).toContain("browser/net/network.sha256");
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
test("network producer checks Rust target ownership with lockfile-sensitive caches", () => {
|
|
529
|
+
const steps = stepsFor("network-wasm");
|
|
530
|
+
const cache = steps.find((step) => step.id === "rust-cache");
|
|
531
|
+
expect(String(record(cache?.with).key)).toContain(
|
|
532
|
+
"hashFiles('packages/waffle/Cargo.lock', 'packages/waffle/rust-toolchain.toml')",
|
|
533
|
+
);
|
|
534
|
+
expect(String(record(cache?.with).path)).toContain("~/.rustup/toolchains");
|
|
535
|
+
expect(String(record(cache?.with).path)).toContain("target");
|
|
536
|
+
const commands = steps.map((step) => step.run).join("\n");
|
|
537
|
+
expect(commands).toContain("bun tooling/check-network-rust.ts");
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
test("network packaging and acceptance inputs select the producer and browser consumer", () => {
|
|
541
|
+
for (const path of [
|
|
542
|
+
"packages/waffle/build.ts",
|
|
543
|
+
"packages/waffle/prepare.ts",
|
|
544
|
+
"packages/waffle/tooling/check-network-rust.ts",
|
|
545
|
+
"packages/waffle/tests/network-lazy.test.ts",
|
|
546
|
+
"packages/waffle/tests/packaging.test.ts",
|
|
547
|
+
"packages/waffle/tests/git-install.test.ts",
|
|
548
|
+
"packages/waffle/tests/node-exports.test.ts",
|
|
549
|
+
"packages/waffle/tests/runtime-size.test.ts",
|
|
550
|
+
])
|
|
551
|
+
for (const name of ["network", "browser"])
|
|
552
|
+
expect(selected(name, path), `${name}: ${path}`).toBe(true);
|
|
553
|
+
for (const path of ["docs/development.md", "site/src/pages/index.astro", "site/bun.lock"])
|
|
554
|
+
expect(selected("network", path), path).toBe(false);
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
test("programs selects every consumed tool, workspace dependency, installer and libc input", () => {
|
|
558
|
+
for (const path of [
|
|
559
|
+
"package.json",
|
|
560
|
+
"bun.lock",
|
|
561
|
+
"Cargo.toml",
|
|
562
|
+
"Cargo.lock",
|
|
563
|
+
"rust-toolchain.toml",
|
|
564
|
+
"tools/source-contract-test.ts",
|
|
565
|
+
"tools/test-family-build-routes.ts",
|
|
566
|
+
"tools/program-family-manifest.test.ts",
|
|
567
|
+
"tools/family-acceptance.ts",
|
|
568
|
+
"tools/program-package.ts",
|
|
569
|
+
"scripts/program-release.ts",
|
|
570
|
+
"scripts/program-release.test.ts",
|
|
571
|
+
"scripts/program-release-fixtures.ts",
|
|
572
|
+
"scripts/program-rebind.ts",
|
|
573
|
+
"scripts/program-rebind.test.ts",
|
|
574
|
+
"scripts/tsconfig.json",
|
|
575
|
+
"tools/program-notices.ts",
|
|
576
|
+
"packages/waffle/programs/index.ts",
|
|
577
|
+
"packages/waffle/runtime.ts",
|
|
578
|
+
"packages/waffle/scripts/build-wasi-libc.sh",
|
|
579
|
+
"packages/waffle/patches/wasi-libc/preopen-scan.patch",
|
|
580
|
+
"packages/coreutils/package-artifacts.json",
|
|
581
|
+
"packages/python/src/launcher.ts",
|
|
582
|
+
])
|
|
583
|
+
expect(selected("programs", path), path).toBe(true);
|
|
584
|
+
expect(String(record(jobs.programs).if)).toContain("needs.changes.outputs.programs");
|
|
585
|
+
for (const path of ["docs/development.md", "site/src/pages/index.astro", "site/bun.lock"])
|
|
586
|
+
expect(selected("programs", path), path).toBe(false);
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
test("programs normal CI runs the release closure test from the folded source checkpoint", () => {
|
|
590
|
+
expect(
|
|
591
|
+
stepsFor("programs").some(
|
|
592
|
+
(step) =>
|
|
593
|
+
step.run ===
|
|
594
|
+
"bun test scripts/program-release.test.ts scripts/program-rebind.test.ts scripts/host-interface.test.ts",
|
|
595
|
+
),
|
|
596
|
+
).toBe(true);
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
test("programs prepares locked Cargo sources after cache restore and before source checks", () => {
|
|
600
|
+
const steps = stepsFor("programs");
|
|
601
|
+
const cache = steps.findIndex(
|
|
602
|
+
(step) =>
|
|
603
|
+
step.uses === "actions/cache@v4" && String(record(step.with).path).includes("~/.cargo/git"),
|
|
604
|
+
);
|
|
605
|
+
const fetches = steps.filter((step) => step.run === "cargo fetch --locked");
|
|
606
|
+
expect(fetches).toHaveLength(1);
|
|
607
|
+
const fetch = fetches[0];
|
|
608
|
+
expect(fetch?.if).toBeUndefined();
|
|
609
|
+
const fetched = steps.indexOf(record(fetch));
|
|
610
|
+
expect(cache).toBeGreaterThanOrEqual(0);
|
|
611
|
+
expect(fetched).toBeGreaterThan(cache);
|
|
612
|
+
for (const command of ["bun run programs:routes", "bun run programs:source"]) {
|
|
613
|
+
const check = steps.findIndex((step) => step.run === command);
|
|
614
|
+
expect(check).toBeGreaterThan(fetched);
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
test("jq has a separate leaf with the shared network artifact prerequisite", () => {
|
|
619
|
+
const job = record(jobs.jq);
|
|
620
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
621
|
+
expect(job.if).toBe(
|
|
622
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.jq == 'true')) }}",
|
|
623
|
+
);
|
|
624
|
+
expect(record(changes.outputs).jq).toBe("${{ steps.paths.outputs.jq }}");
|
|
625
|
+
const steps = stepsFor("jq");
|
|
626
|
+
expect(steps.some((step) => step.run === "bun run prepare:package")).toBe(true);
|
|
627
|
+
expect(steps.some((step) => step.run === "bun run programs:check")).toBe(true);
|
|
628
|
+
expect(steps.some((step) => step.run === "bun run programs:jq")).toBe(true);
|
|
629
|
+
expect(record(job.env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
test("jq selects only its package and shared runtime inputs", () => {
|
|
633
|
+
for (const path of [
|
|
634
|
+
".github/workflows/ci.yml",
|
|
635
|
+
"package.json",
|
|
636
|
+
"bun.lock",
|
|
637
|
+
"rust-toolchain.toml",
|
|
638
|
+
"tools/program-build-tools.ts",
|
|
639
|
+
"tools/program-package.ts",
|
|
640
|
+
"tools/family-acceptance.ts",
|
|
641
|
+
"tools/tsconfig.programs.json",
|
|
642
|
+
"packages/base/src/index.ts",
|
|
643
|
+
"packages/jq/src/index.ts",
|
|
644
|
+
"packages/jq/scripts/build-jaq.ts",
|
|
645
|
+
"packages/jq/tests/jq-wasi.test.ts",
|
|
646
|
+
"packages/waffle/runtime.ts",
|
|
647
|
+
"packages/waffle/programs/collection.ts",
|
|
648
|
+
"packages/waffle/browser/fs-worker.ts",
|
|
649
|
+
])
|
|
650
|
+
expect(selected("jq", path), path).toBe(true);
|
|
651
|
+
for (const path of [
|
|
652
|
+
"Cargo.toml",
|
|
653
|
+
"packages/coreutils/src/lib.rs",
|
|
654
|
+
"packages/findutils/src/index.ts",
|
|
655
|
+
"packages/grep/src/index.ts",
|
|
656
|
+
"packages/sed/src/index.ts",
|
|
657
|
+
"packages/ripgrep/src/index.ts",
|
|
658
|
+
"packages/python/src/launcher.ts",
|
|
659
|
+
"packages/git/src/index.ts",
|
|
660
|
+
"docs/bun-patches.md",
|
|
661
|
+
"site/src/pages/index.astro",
|
|
662
|
+
])
|
|
663
|
+
expect(selected("jq", path), path).toBe(false);
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
test("jq restores and verifies the single network artifact before install", () => {
|
|
667
|
+
const steps = stepsFor("jq");
|
|
668
|
+
const restore = steps.find((step) => step.id === "network-artifact");
|
|
669
|
+
const verify = steps.find(
|
|
670
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
671
|
+
);
|
|
672
|
+
const install = steps.find(
|
|
673
|
+
(step) => typeof step.run === "string" && step.run.startsWith("bun install"),
|
|
674
|
+
);
|
|
675
|
+
expect(restore).toBeDefined();
|
|
676
|
+
expect(verify).toBeDefined();
|
|
677
|
+
expect(install).toBeDefined();
|
|
678
|
+
expect(record(restore?.with)["fail-on-cache-miss"]).toBe(true);
|
|
679
|
+
expect(String(record(restore?.with).path)).toContain("packages/waffle/browser/net/network.wasm");
|
|
680
|
+
expect(steps.indexOf(record(restore))).toBeLessThan(steps.indexOf(record(verify)));
|
|
681
|
+
expect(steps.indexOf(record(verify))).toBeLessThan(steps.indexOf(record(install)));
|
|
682
|
+
expect(
|
|
683
|
+
steps.some((step) => typeof step.run === "string" && step.run.includes("build:network")),
|
|
684
|
+
).toBe(false);
|
|
685
|
+
const cache = steps.find((step) => step.id === "jq-cache");
|
|
686
|
+
expect(cache).toBeDefined();
|
|
687
|
+
for (const path of [
|
|
688
|
+
"~/.rustup/toolchains",
|
|
689
|
+
"~/.cargo/registry",
|
|
690
|
+
"~/.cargo/git",
|
|
691
|
+
".build/jq",
|
|
692
|
+
".build/wasi-libc",
|
|
693
|
+
"packages/jq/.build",
|
|
694
|
+
"packages/jq/.sources",
|
|
695
|
+
])
|
|
696
|
+
expect(String(record(cache?.with).path)).toContain(path);
|
|
697
|
+
expect(String(record(cache?.with).key)).toContain("packages/jq/sources.lock.json");
|
|
698
|
+
expect(String(record(cache?.with).key)).toContain("tools/program-build-tools.ts");
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
test("jq provisions the pinned SDK before its native program build", () => {
|
|
702
|
+
const job = record(jobs.jq);
|
|
703
|
+
expect(record(job.env)).toEqual({ WAFFLE_NETWORK_PREBUILT: "1" });
|
|
704
|
+
const steps = stepsFor("jq");
|
|
705
|
+
const build = steps.find((step) => step.run === "bun run programs:jq");
|
|
706
|
+
expect(record(build?.env).WASI_SDK_PATH).toBe("${{ runner.temp }}/wasi-sdk-34.0-x86_64-linux");
|
|
707
|
+
expect(record(build?.env).WASI_LIBC_SCRATCH_ROOT).toBe("${{ runner.temp }}");
|
|
708
|
+
const sdk = steps.find((step) => step.id === "sdk");
|
|
709
|
+
expect(record(sdk?.with).path).toBe("${{ runner.temp }}/wasi-sdk-34.0-x86_64-linux");
|
|
710
|
+
expect(record(sdk?.with).key).toBe(
|
|
711
|
+
"${{ runner.os }}-wasi-sdk-34-b761e3a0721dbae9c09a0059e5fdb2bf917d1b4a8a7b430fb3b5aafb0984b2c4",
|
|
712
|
+
);
|
|
713
|
+
const provision = steps.find((step) => step.name === "Install pinned wasi-sdk 34");
|
|
714
|
+
expect(provision?.if).toBe("steps.sdk.outputs.cache-hit != 'true'");
|
|
715
|
+
expect(String(provision?.run)).toContain(
|
|
716
|
+
"b761e3a0721dbae9c09a0059e5fdb2bf917d1b4a8a7b430fb3b5aafb0984b2c4 wasi-sdk.tar.gz",
|
|
717
|
+
);
|
|
718
|
+
expect(steps.indexOf(record(provision))).toBeLessThan(
|
|
719
|
+
steps.findIndex((step) => step.run === "bun run programs:jq"),
|
|
720
|
+
);
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
test("jq pins and verifies its native oracle without a host-jq fallback", () => {
|
|
724
|
+
const steps = stepsFor("jq");
|
|
725
|
+
const cache = steps.find((step) => step.id === "jq-native");
|
|
726
|
+
const download = steps.find((step) => step.name === "Download pinned jq native oracle");
|
|
727
|
+
const verify = steps.find((step) => step.name === "Verify and expose pinned jq native oracle");
|
|
728
|
+
const version = steps.find((step) => step.name === "Assert pinned jq native oracle");
|
|
729
|
+
const oracle = steps.find((step) => step.run === "bun run programs:jq");
|
|
730
|
+
expect(cache).toBeDefined();
|
|
731
|
+
expect(record(cache?.with).path).toBe("${{ runner.temp }}/jq-native");
|
|
732
|
+
expect(record(cache?.with).key).toBe(
|
|
733
|
+
"${{ runner.os }}-${{ runner.arch }}-jq-native-1.8.2-x86_64-b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f",
|
|
734
|
+
);
|
|
735
|
+
expect(download?.if).toBe("steps.jq-native.outputs.cache-hit != 'true'");
|
|
736
|
+
expect(record(download?.env).JQ_NATIVE_DIR).toBe("${{ runner.temp }}/jq-native");
|
|
737
|
+
expect(record(download?.env).JQ_NATIVE_URL).toBe(
|
|
738
|
+
"https://github.com/jqlang/jq/releases/download/jq-1.8.2/jq-linux-amd64",
|
|
739
|
+
);
|
|
740
|
+
expect(String(download?.run)).toContain(
|
|
741
|
+
'node "$GITHUB_WORKSPACE/tools/ci-release-download.ts" "$JQ_NATIVE_URL"',
|
|
742
|
+
);
|
|
743
|
+
expect(String(download?.run)).toContain('"$JQ_NATIVE_DIR/jq"');
|
|
744
|
+
expect(record(verify?.env).JQ_NATIVE_DIR).toBe("${{ runner.temp }}/jq-native");
|
|
745
|
+
expect(record(verify?.env).JQ_NATIVE_SHA256).toBe(
|
|
746
|
+
"b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f",
|
|
747
|
+
);
|
|
748
|
+
expect(String(verify?.run)).toContain("sha256sum -c -");
|
|
749
|
+
expect(String(verify?.run)).toContain('chmod 700 "$JQ_NATIVE_DIR/jq"');
|
|
750
|
+
expect(String(verify?.run)).toContain('echo "$JQ_NATIVE_DIR" >> "$GITHUB_PATH"');
|
|
751
|
+
expect(record(version?.env).JQ_NATIVE_DIR).toBe("${{ runner.temp }}/jq-native");
|
|
752
|
+
expect(String(version?.run)).toContain('test "$(command -v jq)" = "$JQ_NATIVE_DIR/jq"');
|
|
753
|
+
expect(String(version?.run)).toContain('test "$(jq --version)" = "jq-1.8.2"');
|
|
754
|
+
expect(String(version?.run)).not.toContain("|| jq");
|
|
755
|
+
expect(String(version?.run)).not.toContain("apt-get");
|
|
756
|
+
expect(steps.indexOf(record(cache))).toBeLessThan(steps.indexOf(record(download)));
|
|
757
|
+
expect(steps.indexOf(record(download))).toBeLessThan(steps.indexOf(record(verify)));
|
|
758
|
+
expect(steps.indexOf(record(verify))).toBeLessThan(steps.indexOf(record(version)));
|
|
759
|
+
expect(steps.indexOf(record(version))).toBeLessThan(steps.indexOf(record(oracle)));
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
test("the browser gate runs memory groups on the fixture built once by libc", () => {
|
|
763
|
+
for (const path of [
|
|
764
|
+
"packages/waffle/group/state.ts",
|
|
765
|
+
"packages/waffle/link/code.ts",
|
|
766
|
+
"packages/waffle/scripts/build-memory-group-fixture.ts",
|
|
767
|
+
"packages/waffle/tests/fixtures/memory-group-member.c",
|
|
768
|
+
])
|
|
769
|
+
expect(selected("browser", path), path).toBe(true);
|
|
770
|
+
const libc = record(jobs.libc).steps as unknown[];
|
|
771
|
+
const browser = record(jobs.browser).steps as unknown[];
|
|
772
|
+
const run = (steps: unknown[]) => steps.map((step) => String(record(step).run ?? ""));
|
|
773
|
+
const uses = (steps: unknown[]) => steps.map((step) => String(record(step).uses ?? ""));
|
|
774
|
+
expect(run(libc).filter((line) => line.includes("build-memory-group-fixture.ts")).length).toBe(2);
|
|
775
|
+
expect(uses(libc)).toContain("actions/upload-artifact@v4");
|
|
776
|
+
expect(uses(browser)).toContain("actions/download-artifact@v8");
|
|
777
|
+
expect(run(browser).some((line) => line.includes("build-memory-group-fixture.ts"))).toBe(false);
|
|
778
|
+
const gate = browser
|
|
779
|
+
.map(record)
|
|
780
|
+
.find((step) => String(step.run).startsWith("bun run test:browser"));
|
|
781
|
+
expect(record(gate?.env).MEMORY_GROUP_FIXTURE_DIR).toBeDefined();
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
test("a browser-only rerun downloads the reused producer's exact fixture artifact", () => {
|
|
785
|
+
const upload = artifactStep(stepsFor("libc"), "${{ runner.temp }}/memory-group-fixture");
|
|
786
|
+
const context: Record<string, string> = {
|
|
787
|
+
"github.run_id": "40899462745",
|
|
788
|
+
"github.run_attempt": "1",
|
|
789
|
+
"steps.memory-group-artifact.outputs.artifact-id": "12345",
|
|
790
|
+
"needs.libc.outputs.memory-group-artifact-id": "12345",
|
|
791
|
+
};
|
|
792
|
+
const expand = (value: unknown) =>
|
|
793
|
+
String(value).replace(/\$\{\{\s*([^{}]+?)\s*\}\}/g, (_, key: string) => {
|
|
794
|
+
const resolved = context[key];
|
|
795
|
+
if (resolved === undefined) throw new Error(`unexpected workflow expression: ${key}`);
|
|
796
|
+
return resolved;
|
|
797
|
+
});
|
|
798
|
+
const artifact = { id: "12345", name: expand(record(upload.with).name) };
|
|
799
|
+
context["github.run_attempt"] = "2";
|
|
800
|
+
|
|
801
|
+
const download = stepsFor("browser").find((step) => step.uses === "actions/download-artifact@v8");
|
|
802
|
+
const inputs = record(download?.with);
|
|
803
|
+
expect(inputs["digest-mismatch"]).toBe("error");
|
|
804
|
+
expect(artifact.name).toBe("memory-group-fixture-40899462745-1");
|
|
805
|
+
expect(expand(inputs.name ?? inputs["artifact-ids"])).toBe(
|
|
806
|
+
inputs.name ? artifact.name : artifact.id,
|
|
807
|
+
);
|
|
808
|
+
expect(upload.id).toBe("memory-group-artifact");
|
|
809
|
+
expect(record(upload.with)["if-no-files-found"]).toBe("error");
|
|
810
|
+
const output = record(record(jobs.libc).outputs)["memory-group-artifact-id"];
|
|
811
|
+
expect(output).toBe("${{ steps.memory-group-artifact.outputs.artifact-id }}");
|
|
812
|
+
expect(expand(output)).toBe(artifact.id);
|
|
813
|
+
expect(inputs["artifact-ids"]).toBe("${{ needs.libc.outputs.memory-group-artifact-id }}");
|
|
814
|
+
expect(expand(inputs["artifact-ids"])).toBe(artifact.id);
|
|
815
|
+
expect(inputs.name).toBeUndefined();
|
|
816
|
+
expect(inputs.pattern).toBeUndefined();
|
|
817
|
+
expect(inputs["merge-multiple"]).toBe(true);
|
|
818
|
+
expect(inputs.path).toBe(record(upload.with).path);
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
test("the browser rejects a missing fixture artifact ID before download", () => {
|
|
822
|
+
const steps = stepsFor("browser");
|
|
823
|
+
const guard = steps.find((step) => step.name === "Require the producer's fixture artifact ID");
|
|
824
|
+
expect(record(guard?.env).MEMORY_GROUP_ARTIFACT_ID).toBe(
|
|
825
|
+
"${{ needs.libc.outputs.memory-group-artifact-id }}",
|
|
826
|
+
);
|
|
827
|
+
expect(guard?.if).toBeUndefined();
|
|
828
|
+
expect(guard?.["continue-on-error"]).toBeUndefined();
|
|
829
|
+
const downloadIndex = steps.findIndex((step) => step.uses === "actions/download-artifact@v8");
|
|
830
|
+
expect(guard).toBeDefined();
|
|
831
|
+
expect(steps.indexOf(record(guard))).toBeLessThan(downloadIndex);
|
|
832
|
+
for (const id of ["", "12345"]) {
|
|
833
|
+
const result = Bun.spawnSync(["bash", "-e", "-c", String(guard?.run)], {
|
|
834
|
+
env: { ...process.env, MEMORY_GROUP_ARTIFACT_ID: id },
|
|
835
|
+
});
|
|
836
|
+
expect(result.exitCode).toBe(id ? 0 : 1);
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
test("program producers explicitly provision the pinned optimizer before running build routes", () => {
|
|
841
|
+
const producers = [
|
|
842
|
+
["programs", "bun run programs:tools"],
|
|
843
|
+
["jq", "bun run programs:jq"],
|
|
844
|
+
["diffutils", "bun run programs:diffutils"],
|
|
845
|
+
] satisfies readonly [string, string][];
|
|
846
|
+
for (const [job, command] of producers) {
|
|
847
|
+
const steps = stepsFor(job);
|
|
848
|
+
const optimizer = steps.findIndex(
|
|
849
|
+
(step) => step.uses === "./.github/actions/program-optimizer",
|
|
850
|
+
);
|
|
851
|
+
const consumer = steps.findIndex((step) => String(step.run).includes(command));
|
|
852
|
+
expect(optimizer).toBeGreaterThanOrEqual(0);
|
|
853
|
+
expect(consumer).toBeGreaterThan(optimizer);
|
|
854
|
+
expect(steps[optimizer]?.if).toBeUndefined();
|
|
855
|
+
expect(steps[optimizer]?.["continue-on-error"]).toBeUndefined();
|
|
856
|
+
}
|
|
857
|
+
expect(
|
|
858
|
+
stepsFor("network-wasm").some((step) => step.uses === "./.github/actions/program-optimizer"),
|
|
859
|
+
).toBe(false);
|
|
860
|
+
for (const path of [
|
|
861
|
+
"ci.yml",
|
|
862
|
+
"coreutils-echo.yml",
|
|
863
|
+
"findutils-xargs.yml",
|
|
864
|
+
"program-release.yml",
|
|
865
|
+
]) {
|
|
866
|
+
const source = readFileSync(
|
|
867
|
+
new URL(`../../../.github/workflows/${path}`, import.meta.url),
|
|
868
|
+
"utf8",
|
|
869
|
+
);
|
|
870
|
+
expect(source).toContain("uses: ./.github/actions/program-optimizer");
|
|
871
|
+
}
|
|
872
|
+
for (const filter of ["programs", "coreutils", "findutils", "jq", "diffutils"]) {
|
|
873
|
+
expect(selected(filter, "tools/program-optimize.ts")).toBe(true);
|
|
874
|
+
expect(selected(filter, "tools/program-derivation.ts")).toBe(true);
|
|
875
|
+
expect(selected(filter, ".github/actions/program-optimizer/action.yml")).toBe(true);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
test("diffutils selects its exact integration inputs", () => {
|
|
880
|
+
const job = record(jobs.diffutils);
|
|
881
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
882
|
+
expect(record(changes.outputs).diffutils).toBe("${{ steps.paths.outputs.diffutils }}");
|
|
883
|
+
expect(job.if).toBe(
|
|
884
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.diffutils == 'true')) }}",
|
|
885
|
+
);
|
|
886
|
+
for (const path of [
|
|
887
|
+
".github/workflows/ci.yml",
|
|
888
|
+
"package.json",
|
|
889
|
+
"bun.lock",
|
|
890
|
+
"tools/program-build-tools.ts",
|
|
891
|
+
"tools/program-package.ts",
|
|
892
|
+
"tools/family-acceptance.ts",
|
|
893
|
+
"tools/tsconfig.programs.json",
|
|
894
|
+
"packages/waffle/core/wasi.ts",
|
|
895
|
+
"packages/base/src/index.ts",
|
|
896
|
+
"packages/diffutils/src/index.ts",
|
|
897
|
+
])
|
|
898
|
+
expect(selected("diffutils", path), path).toBe(true);
|
|
899
|
+
for (const path of [
|
|
900
|
+
"docs/bun-patches.md",
|
|
901
|
+
"site/package.json",
|
|
902
|
+
"packages/grep/src/index.ts",
|
|
903
|
+
"tools/other.ts",
|
|
904
|
+
])
|
|
905
|
+
expect(selected("diffutils", path), path).toBe(false);
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
test("diffutils consumes the single verified network artifact before installation", () => {
|
|
909
|
+
const producer = stepsFor("network-wasm");
|
|
910
|
+
const steps = stepsFor("diffutils");
|
|
911
|
+
const cache = producer.find((step) => step.id === "network-artifact");
|
|
912
|
+
const restore = steps.findIndex((step) => step.id === "network-artifact");
|
|
913
|
+
const verify = steps.findIndex(
|
|
914
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
915
|
+
);
|
|
916
|
+
const install = steps.findIndex(
|
|
917
|
+
(step) => step.run === "bun install --frozen-lockfile --ignore-scripts",
|
|
918
|
+
);
|
|
919
|
+
expect(restore).toBeGreaterThanOrEqual(0);
|
|
920
|
+
expect(verify).toBeGreaterThan(restore);
|
|
921
|
+
expect(install).toBeGreaterThan(verify);
|
|
922
|
+
expect(record(steps[restore]?.with).key).toBe(record(cache?.with).key);
|
|
923
|
+
expect(record(steps[restore]?.with)["fail-on-cache-miss"]).toBe(true);
|
|
924
|
+
expect(record(record(jobs.diffutils).env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
925
|
+
expect(
|
|
926
|
+
producer.filter((step) => step.run === "bun run --cwd packages/waffle build:network"),
|
|
927
|
+
).toHaveLength(1);
|
|
928
|
+
expect(steps.some((step) => /build:network|cargo\s/.test(String(step.run)))).toBe(false);
|
|
929
|
+
expect(
|
|
930
|
+
Object.keys(jobs)
|
|
931
|
+
.filter((name) => Array.isArray(record(jobs[name]).steps))
|
|
932
|
+
.flatMap((name) =>
|
|
933
|
+
stepsFor(name).filter((step) =>
|
|
934
|
+
String(step.run).includes("bun run --cwd packages/waffle build:network"),
|
|
935
|
+
),
|
|
936
|
+
),
|
|
937
|
+
).toHaveLength(1);
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
test("diffutils SDK uses supported step context and runner scratch", () => {
|
|
941
|
+
const job = record(jobs.diffutils);
|
|
942
|
+
expect(JSON.stringify(job.env)).not.toContain("runner.temp");
|
|
943
|
+
const steps = stepsFor("diffutils");
|
|
944
|
+
const sdk = steps.find((step) => step.id === "sdk");
|
|
945
|
+
const libcSdk = stepsFor("libc").find((step) => step.id === "sdk");
|
|
946
|
+
expect(record(sdk?.with)).toEqual(record(libcSdk?.with));
|
|
947
|
+
expect(steps.find((step) => step.name === "Install pinned wasi-sdk 34")?.run).toBe(
|
|
948
|
+
stepsFor("libc").find((step) => step.name === "Install pinned wasi-sdk 34")?.run,
|
|
949
|
+
);
|
|
950
|
+
const build = steps.find((step) => step.name === "Build and test diffutils");
|
|
951
|
+
expect(record(build?.env).WASI_SDK_PATH).toBe("${{ runner.temp }}/wasi-sdk-34.0-x86_64-linux");
|
|
952
|
+
expect(record(build?.env).WASI_LIBC_SCRATCH_ROOT).toBe("${{ runner.temp }}");
|
|
953
|
+
expect(String(build?.run)).toContain("cmake --version");
|
|
954
|
+
expect(String(build?.run)).toContain("ninja --version");
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
test("diffutils provisions one exact native GNU oracle", () => {
|
|
958
|
+
const steps = stepsFor("diffutils");
|
|
959
|
+
const compiler = steps.find((step) => step.id === "native-compiler");
|
|
960
|
+
const cache = steps.find((step) => step.id === "native-oracle");
|
|
961
|
+
const recipe = steps.find((step) => step.name === "Build or verify native GNU diffutils oracle");
|
|
962
|
+
const build = steps.find((step) => step.name === "Build and test diffutils");
|
|
963
|
+
expect(compiler?.run).toContain("cc -dumpmachine");
|
|
964
|
+
expect(compiler?.run).toContain("cc --version");
|
|
965
|
+
expect(cache?.uses).toBe("actions/cache@v4");
|
|
966
|
+
expect(record(cache?.with).path).toBe(".build/diffutils-native-oracle");
|
|
967
|
+
const key = String(record(cache?.with).key);
|
|
968
|
+
expect(key).toContain("${{ runner.os }}");
|
|
969
|
+
expect(key).toContain("${{ runner.arch }}");
|
|
970
|
+
expect(key).toContain("gnu-3.12");
|
|
971
|
+
expect(key).toContain(
|
|
972
|
+
"${{ hashFiles('packages/diffutils/sources.lock.json', 'packages/diffutils/scripts/build-native-oracle.ts') }}",
|
|
973
|
+
);
|
|
974
|
+
expect(key).toContain("${{ steps.native-compiler.outputs.identity }}");
|
|
975
|
+
expect(recipe?.run).toBe("bun run --cwd packages/diffutils native-oracle");
|
|
976
|
+
expect(record(recipe?.env).NATIVE_ORACLE_COMPILER_IDENTITY).toBe(
|
|
977
|
+
"${{ steps.native-compiler.outputs.identity }}",
|
|
978
|
+
);
|
|
979
|
+
if (!compiler || !cache || !recipe || !build) throw new Error("missing native oracle steps");
|
|
980
|
+
expect(steps.indexOf(compiler)).toBeLessThan(steps.indexOf(cache));
|
|
981
|
+
expect(steps.indexOf(cache)).toBeLessThan(steps.indexOf(recipe));
|
|
982
|
+
expect(steps.indexOf(recipe)).toBeLessThan(steps.indexOf(build));
|
|
983
|
+
expect(record(build?.env).GNU_DIFF).toBe(
|
|
984
|
+
"${{ github.workspace }}/.build/diffutils-native-oracle/diff",
|
|
985
|
+
);
|
|
986
|
+
expect(record(build?.env).GNU_CMP).toBe(
|
|
987
|
+
"${{ github.workspace }}/.build/diffutils-native-oracle/cmp",
|
|
988
|
+
);
|
|
989
|
+
expect(
|
|
990
|
+
Object.keys(jobs)
|
|
991
|
+
.filter((name) => Array.isArray(record(jobs[name]).steps))
|
|
992
|
+
.flatMap((name) =>
|
|
993
|
+
stepsFor(name).filter(
|
|
994
|
+
(step) => step.run === "bun run --cwd packages/diffutils native-oracle",
|
|
995
|
+
),
|
|
996
|
+
),
|
|
997
|
+
).toHaveLength(1);
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
test("diffutils package exposes its actual commands", async () => {
|
|
1001
|
+
const { diffutils } = await import("../../diffutils/src/index.ts");
|
|
1002
|
+
expect(diffutils.pick("diff", "/bin/cmp").programs.map((program) => program.path)).toEqual([
|
|
1003
|
+
"/usr/bin/diff",
|
|
1004
|
+
"/usr/bin/cmp",
|
|
1005
|
+
]);
|
|
1006
|
+
expect(diffutils.programs.map((program) => [program.path, program.aliases])).toEqual([
|
|
1007
|
+
["/usr/bin/diff", ["/bin/diff"]],
|
|
1008
|
+
["/usr/bin/cmp", ["/bin/cmp"]],
|
|
1009
|
+
]);
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
test("gh selects its inputs without selecting native program jobs for gh-only changes", () => {
|
|
1013
|
+
const job = record(jobs.gh);
|
|
1014
|
+
expect(record(changes.outputs).gh).toBe("${{ steps.paths.outputs.gh }}");
|
|
1015
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
1016
|
+
expect(String(job.if)).toContain("needs.changes.outputs.gh == 'true'");
|
|
1017
|
+
for (const path of [
|
|
1018
|
+
"packages/gh/src/program.ts",
|
|
1019
|
+
"packages/gh/tests/fixtures.ts",
|
|
1020
|
+
"packages/waffle/runtime.ts",
|
|
1021
|
+
"tools/program-package.ts",
|
|
1022
|
+
"package.json",
|
|
1023
|
+
"bun.lock",
|
|
1024
|
+
".github/workflows/ci.yml",
|
|
1025
|
+
])
|
|
1026
|
+
expect(selected("gh", path), path).toBe(true);
|
|
1027
|
+
for (const path of [
|
|
1028
|
+
"docs/development.md",
|
|
1029
|
+
"site/package.json",
|
|
1030
|
+
"packages/jq/src/index.ts",
|
|
1031
|
+
"packages/git/src/index.ts",
|
|
1032
|
+
])
|
|
1033
|
+
expect(selected("gh", path), path).toBe(false);
|
|
1034
|
+
for (const name of ["programs", "coreutils", "findutils", "network", "browser", "libc"])
|
|
1035
|
+
expect(selected(name, "packages/gh/src/program.ts"), name).toBe(false);
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
test("gh restores the exact network asset and does not set up native compilers", () => {
|
|
1039
|
+
const steps = stepsFor("gh");
|
|
1040
|
+
const producer = stepsFor("network-wasm").find((step) => step.id === "network-artifact");
|
|
1041
|
+
const restore = steps.find((step) => step.id === "network-artifact");
|
|
1042
|
+
expect(record(restore?.with).key).toBe(record(producer?.with).key);
|
|
1043
|
+
expect(record(restore?.with)["fail-on-cache-miss"]).toBe(true);
|
|
1044
|
+
const verify = steps.findIndex(
|
|
1045
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
1046
|
+
);
|
|
1047
|
+
const install = steps.findIndex(
|
|
1048
|
+
(step) => step.run === "bun install --frozen-lockfile --ignore-scripts",
|
|
1049
|
+
);
|
|
1050
|
+
expect(steps.indexOf(record(restore))).toBeLessThan(verify);
|
|
1051
|
+
expect(verify).toBeLessThan(install);
|
|
1052
|
+
expect(record(record(jobs.gh).env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
1053
|
+
expect(
|
|
1054
|
+
steps.some((step) =>
|
|
1055
|
+
/cargo|rust-toolchain|wasi-sdk|wasmtime/i.test(
|
|
1056
|
+
String(step.uses ?? "") + " " + String(step.run ?? ""),
|
|
1057
|
+
),
|
|
1058
|
+
),
|
|
1059
|
+
).toBe(false);
|
|
1060
|
+
expect(
|
|
1061
|
+
record(
|
|
1062
|
+
steps.find(
|
|
1063
|
+
(step) =>
|
|
1064
|
+
step.uses === "./.github/actions/setup-tools" && record(step.with)["node-version"],
|
|
1065
|
+
)?.with,
|
|
1066
|
+
)["node-version"],
|
|
1067
|
+
).toBe("26.12.1");
|
|
1068
|
+
expect(steps.map((step) => step.run)).toContain("bun run programs:gh");
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
test("awk has one bounded leaf using the normal finalizer and verified network bytes", () => {
|
|
1072
|
+
const job = record(jobs.awk);
|
|
1073
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
1074
|
+
expect(job.if).toBe(
|
|
1075
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.awk == 'true')) }}",
|
|
1076
|
+
);
|
|
1077
|
+
expect(record(changes.outputs).awk).toBe("${{ steps.paths.outputs.awk }}");
|
|
1078
|
+
expect(job["timeout-minutes"]).toBe(15);
|
|
1079
|
+
expect(record(job.env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
1080
|
+
const steps = stepsFor("awk");
|
|
1081
|
+
const restore = steps.findIndex((step) => step.id === "network-artifact");
|
|
1082
|
+
const verify = steps.findIndex(
|
|
1083
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
1084
|
+
);
|
|
1085
|
+
const install = steps.findIndex(
|
|
1086
|
+
(step) => step.run === "bun install --frozen-lockfile --ignore-scripts",
|
|
1087
|
+
);
|
|
1088
|
+
const optimizer = steps.findIndex((step) => step.uses === "./.github/actions/program-optimizer");
|
|
1089
|
+
expect(restore).toBeGreaterThanOrEqual(0);
|
|
1090
|
+
expect(verify).toBeGreaterThan(restore);
|
|
1091
|
+
expect(install).toBeGreaterThan(verify);
|
|
1092
|
+
expect(optimizer).toBeGreaterThanOrEqual(0);
|
|
1093
|
+
const producer = steps.find((step) => step.run === "bun run programs:awk");
|
|
1094
|
+
expect(producer).toBeDefined();
|
|
1095
|
+
expect(steps.indexOf(record(producer))).toBeGreaterThan(optimizer);
|
|
1096
|
+
expect(record(producer?.env).AWK_SCRATCH_ROOT).toBe("${{ runner.temp }}");
|
|
1097
|
+
const network = stepsFor("network-wasm").find((step) => step.id === "network-artifact");
|
|
1098
|
+
expect(record(steps[restore]?.with).key).toBe(record(network?.with).key);
|
|
1099
|
+
expect(record(steps[restore]?.with)["fail-on-cache-miss"]).toBe(true);
|
|
1100
|
+
const commands = steps.map((step) => step.run).join("\n");
|
|
1101
|
+
expect(commands).not.toMatch(
|
|
1102
|
+
/cargo\s|programs:(?:integration|check|prepare|pack|packed)|build:network/,
|
|
1103
|
+
);
|
|
1104
|
+
expect(steps.filter((step) => step.run === "bun run programs:awk")).toHaveLength(1);
|
|
1105
|
+
});
|
|
1106
|
+
|
|
1107
|
+
test("awk selects its source and shared transformations without selecting unrelated guests", () => {
|
|
1108
|
+
for (const path of [
|
|
1109
|
+
".github/workflows/ci.yml",
|
|
1110
|
+
".github/actions/program-optimizer/action.yml",
|
|
1111
|
+
"package.json",
|
|
1112
|
+
"bun.lock",
|
|
1113
|
+
"tools/program-build-tools.ts",
|
|
1114
|
+
"tools/program-optimize.ts",
|
|
1115
|
+
"tools/program-derivation.ts",
|
|
1116
|
+
"tools/program-package.ts",
|
|
1117
|
+
"tools/program-notices.ts",
|
|
1118
|
+
"tools/family-acceptance.ts",
|
|
1119
|
+
"tools/tsconfig.programs.json",
|
|
1120
|
+
"packages/waffle/runtime.ts",
|
|
1121
|
+
"packages/waffle/patches/wasi-libc/preopen-scan.patch",
|
|
1122
|
+
"packages/base/src/index.ts",
|
|
1123
|
+
"packages/awk/scripts/build-awk.ts",
|
|
1124
|
+
"packages/awk/tests/awk-wasi.test.ts",
|
|
1125
|
+
])
|
|
1126
|
+
expect(selected("awk", path), path).toBe(true);
|
|
1127
|
+
for (const path of [
|
|
1128
|
+
"Cargo.toml",
|
|
1129
|
+
"packages/coreutils/src/lib.rs",
|
|
1130
|
+
"packages/diffutils/scripts/build-diffutils.ts",
|
|
1131
|
+
"packages/jq/src/index.ts",
|
|
1132
|
+
"packages/curl/src/index.ts",
|
|
1133
|
+
"docs/bun-patches.md",
|
|
1134
|
+
"site/package.json",
|
|
1135
|
+
])
|
|
1136
|
+
expect(selected("awk", path), path).toBe(false);
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
test("tar scratch path is resolved by a runner step, not job-context evaluation", () => {
|
|
1140
|
+
const job = record(jobs.tar);
|
|
1141
|
+
expect(record(job.env).TAR_SCRATCH_ROOT).toBeUndefined();
|
|
1142
|
+
const steps = stepsFor("tar");
|
|
1143
|
+
const scratch = steps.find((step) => step.name === "Set run-owned tar scratch root");
|
|
1144
|
+
const build = steps.find((step) => step.name === "Build matching native and WASI tar");
|
|
1145
|
+
expect(scratch).toBeDefined();
|
|
1146
|
+
expect(build).toBeDefined();
|
|
1147
|
+
expect(String(scratch?.run)).toContain("TAR_SCRATCH_ROOT=%s");
|
|
1148
|
+
expect(String(scratch?.run)).toContain('"$RUNNER_TEMP"');
|
|
1149
|
+
expect(String(scratch?.run)).toContain('"$GITHUB_ENV"');
|
|
1150
|
+
expect(steps.indexOf(record(scratch))).toBeLessThan(steps.indexOf(record(build)));
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
test("procps selects its exact inputs without selecting native work for package-only changes", () => {
|
|
1154
|
+
const job = record(jobs.procps);
|
|
1155
|
+
expect(record(changes.outputs).procps).toBe("${{ steps.paths.outputs.procps }}");
|
|
1156
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
1157
|
+
expect(record(job.env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
1158
|
+
expect(job.if).toBe(
|
|
1159
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.procps == 'true')) }}",
|
|
1160
|
+
);
|
|
1161
|
+
expect(filters.procps).toEqual([
|
|
1162
|
+
".github/workflows/ci.yml",
|
|
1163
|
+
".github/actions/release-downloads/**",
|
|
1164
|
+
".github/actions/save-release-downloads/**",
|
|
1165
|
+
".github/actions/setup-tools/**",
|
|
1166
|
+
"tools/ci-*.ts",
|
|
1167
|
+
"package.json",
|
|
1168
|
+
"bun.lock",
|
|
1169
|
+
"packages/waffle/**",
|
|
1170
|
+
"packages/procps/**",
|
|
1171
|
+
]);
|
|
1172
|
+
for (const path of ["packages/procps/src/index.ts", "packages/procps/tests/oracle.test.ts"])
|
|
1173
|
+
for (const name of [
|
|
1174
|
+
"programs",
|
|
1175
|
+
"coreutils",
|
|
1176
|
+
"findutils",
|
|
1177
|
+
"network",
|
|
1178
|
+
"browser",
|
|
1179
|
+
"libc",
|
|
1180
|
+
"jq",
|
|
1181
|
+
"diffutils",
|
|
1182
|
+
])
|
|
1183
|
+
expect(selected(name, path), `${name}: ${path}`).toBe(false);
|
|
1184
|
+
expect(selected("procps", "packages/procps/src/index.ts")).toBe(true);
|
|
1185
|
+
expect(selected("procps", "packages/gh/src/index.ts")).toBe(false);
|
|
1186
|
+
});
|
|
1187
|
+
|
|
1188
|
+
test("procps runs pure and runtime controls once using verified network bytes without a producer", () => {
|
|
1189
|
+
const steps = stepsFor("procps");
|
|
1190
|
+
const runs = steps.map((step) => String(step.run ?? ""));
|
|
1191
|
+
const restore = steps.findIndex((step) => step.id === "network-artifact");
|
|
1192
|
+
const verify = runs.indexOf("bun run --cwd packages/waffle tooling/build-network.ts --verify");
|
|
1193
|
+
const install = runs.indexOf("bun install --frozen-lockfile --ignore-scripts");
|
|
1194
|
+
const prepare = runs.indexOf("bun run prepare:package");
|
|
1195
|
+
const execute = runs.indexOf("bun run programs:procps");
|
|
1196
|
+
expect(restore).toBeGreaterThanOrEqual(0);
|
|
1197
|
+
expect(verify).toBeGreaterThan(restore);
|
|
1198
|
+
expect(install).toBeGreaterThan(verify);
|
|
1199
|
+
expect(prepare).toBeGreaterThan(install);
|
|
1200
|
+
expect(execute).toBeGreaterThan(prepare);
|
|
1201
|
+
expect(runs.filter((run) => run === "bun run prepare:package")).toHaveLength(1);
|
|
1202
|
+
expect(runs.filter((run) => run === "bun run programs:procps")).toHaveLength(1);
|
|
1203
|
+
const network = stepsFor("network-wasm").find((step) => step.id === "network-artifact");
|
|
1204
|
+
expect(record(steps[restore]?.with).key).toBe(record(network?.with).key);
|
|
1205
|
+
expect(record(steps[restore]?.with)["fail-on-cache-miss"]).toBe(true);
|
|
1206
|
+
expect(runs).toContain(
|
|
1207
|
+
'ln -s "$GITHUB_WORKSPACE/packages/waffle/node_modules/@types" packages/procps/node_modules/@types',
|
|
1208
|
+
);
|
|
1209
|
+
expect(
|
|
1210
|
+
steps.some((step) =>
|
|
1211
|
+
/cargo|rust-toolchain|wasi-sdk|wasmtime|build:network/.test(
|
|
1212
|
+
String(step.uses ?? "") + " " + String(step.run ?? ""),
|
|
1213
|
+
),
|
|
1214
|
+
),
|
|
1215
|
+
).toBe(false);
|
|
1216
|
+
const root = JSON.parse(readFileSync(new URL("../../../package.json", import.meta.url), "utf8"));
|
|
1217
|
+
expect(root.scripts["programs:procps:pure"]).toBe(
|
|
1218
|
+
"bun run --cwd packages/procps test:pure && bun run --cwd packages/procps typecheck && bun run --cwd packages/procps size",
|
|
1219
|
+
);
|
|
1220
|
+
expect(root.scripts["programs:procps"]).toBe(
|
|
1221
|
+
"bun run programs:procps:pure && bun run --cwd packages/procps test:runtime && bun run --cwd packages/procps pack:check && bun run --cwd packages/procps size:commands",
|
|
1222
|
+
);
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
test("checksums has a bounded leaf using the existing producer route", () => {
|
|
1226
|
+
const job = record(jobs["coreutils-checksums"]);
|
|
1227
|
+
expect(job.needs).toEqual(["changes", "network-wasm"]);
|
|
1228
|
+
expect(job.if).toBe(
|
|
1229
|
+
"${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!cancelled() && (github.event_name == 'workflow_dispatch' || needs.changes.result != 'success' || needs.changes.outputs.checksums == 'true')) }}",
|
|
1230
|
+
);
|
|
1231
|
+
expect(record(changes.outputs).checksums).toBe("${{ steps.paths.outputs.checksums }}");
|
|
1232
|
+
expect(job["timeout-minutes"]).toBe(30);
|
|
1233
|
+
expect(record(job.env).WAFFLE_NETWORK_PREBUILT).toBe("1");
|
|
1234
|
+
expect(record(job.env).WASI_LIBC_JOBS).toBe("2");
|
|
1235
|
+
expect(record(job.env).GNU_CHECKSUM_ORACLE_ROOT).toBe(
|
|
1236
|
+
"${{ github.workspace }}/.build/gnu-checksum-native-oracle",
|
|
1237
|
+
);
|
|
1238
|
+
|
|
1239
|
+
const steps = stepsFor("coreutils-checksums");
|
|
1240
|
+
const restore = steps.findIndex((step) => step.id === "network-artifact");
|
|
1241
|
+
const verify = steps.findIndex(
|
|
1242
|
+
(step) => step.run === "bun run --cwd packages/waffle tooling/build-network.ts --verify",
|
|
1243
|
+
);
|
|
1244
|
+
const install = steps.findIndex(
|
|
1245
|
+
(step) => step.run === "bun install --frozen-lockfile --ignore-scripts",
|
|
1246
|
+
);
|
|
1247
|
+
const rust = steps.findIndex((step) => step.uses === "dtolnay/rust-toolchain@stable");
|
|
1248
|
+
const optimizer = steps.findIndex((step) => step.uses === "./.github/actions/program-optimizer");
|
|
1249
|
+
const oracle = steps.findIndex(
|
|
1250
|
+
(step) => step.name === "Verify the pinned GNU 9.12 checksum oracle",
|
|
1251
|
+
);
|
|
1252
|
+
const producer = steps.findIndex(
|
|
1253
|
+
(step) => step.run === "bun run --cwd packages/coreutils build:checksums",
|
|
1254
|
+
);
|
|
1255
|
+
const readback = steps.findIndex(
|
|
1256
|
+
(step) => step.name === "Read back the exact admitted checksum guests",
|
|
1257
|
+
);
|
|
1258
|
+
const acceptance = steps.findIndex(
|
|
1259
|
+
(step) => step.run === "bun run --cwd packages/coreutils test:checksums:wasi",
|
|
1260
|
+
);
|
|
1261
|
+
expect(restore).toBeGreaterThanOrEqual(0);
|
|
1262
|
+
expect(verify).toBeGreaterThan(restore);
|
|
1263
|
+
expect(rust).toBeGreaterThanOrEqual(0);
|
|
1264
|
+
expect(record(steps[rust]?.with).toolchain).toBe("1.98.1");
|
|
1265
|
+
expect(record(steps[rust]?.with).targets).toBe("wasm32-wasip1");
|
|
1266
|
+
expect(optimizer).toBeGreaterThan(verify);
|
|
1267
|
+
expect(install).toBeGreaterThan(verify);
|
|
1268
|
+
expect(oracle).toBeGreaterThan(install);
|
|
1269
|
+
expect(producer).toBeGreaterThan(optimizer);
|
|
1270
|
+
expect(producer).toBeGreaterThan(oracle);
|
|
1271
|
+
expect(readback).toBeGreaterThan(producer);
|
|
1272
|
+
expect(acceptance).toBeGreaterThan(readback);
|
|
1273
|
+
expect(
|
|
1274
|
+
steps.filter((step) => step.run === "bun run --cwd packages/coreutils build:checksums"),
|
|
1275
|
+
).toHaveLength(1);
|
|
1276
|
+
expect(record(steps[acceptance]?.env).CHECKSUM_ARTIFACTS).toBe(
|
|
1277
|
+
"${{ github.workspace }}/.build/checksum-artifact",
|
|
1278
|
+
);
|
|
1279
|
+
expect(String(steps[readback]?.run)).toContain("packages/coreutils/scripts/checksum-artifact.ts");
|
|
1280
|
+
expect(String(steps[readback]?.run)).toContain("$GITHUB_WORKSPACE/.build/checksum-artifact");
|
|
1281
|
+
expect(String(steps[readback]?.run)).not.toContain("build-coreutils");
|
|
1282
|
+
expect(record(steps[readback]?.env).WASI_SDK_PATH).toBe(
|
|
1283
|
+
"${{ runner.temp }}/wasi-sdk-34.0-x86_64-linux",
|
|
1284
|
+
);
|
|
1285
|
+
|
|
1286
|
+
const commands = steps.map((step) => String(step.run ?? "")).join("\n");
|
|
1287
|
+
expect(commands).not.toMatch(
|
|
1288
|
+
/build:network|program-release|programs:(?:integration|check|prepare|pack|packed)/,
|
|
1289
|
+
);
|
|
1290
|
+
expect(commands).not.toContain("build-date");
|
|
1291
|
+
expect(commands).not.toContain("test:checksums:oracle");
|
|
1292
|
+
expect(steps[oracle]?.run).toBe(
|
|
1293
|
+
"node packages/coreutils/scripts/build-native-checksum-oracle.ts --verify-only",
|
|
1294
|
+
);
|
|
1295
|
+
});
|
|
1296
|
+
|
|
1297
|
+
test("checksums fetches pinned Cargo sources before preparing the checksum leaf", () => {
|
|
1298
|
+
const steps = stepsFor("coreutils-checksums");
|
|
1299
|
+
const cache = steps.findIndex((step) => step.id === "checksum-cache");
|
|
1300
|
+
const rust = steps.findIndex((step) => step.uses === "dtolnay/rust-toolchain@stable");
|
|
1301
|
+
const fetches = steps.filter((step) => step.run === "cargo fetch --locked");
|
|
1302
|
+
expect(fetches).toHaveLength(1);
|
|
1303
|
+
const fetch = fetches[0];
|
|
1304
|
+
expect(fetch?.if).toBeUndefined();
|
|
1305
|
+
const fetched = steps.indexOf(record(fetch));
|
|
1306
|
+
const producer = steps.findIndex(
|
|
1307
|
+
(step) => step.run === "bun run --cwd packages/coreutils build:checksums",
|
|
1308
|
+
);
|
|
1309
|
+
expect(cache).toBeGreaterThanOrEqual(0);
|
|
1310
|
+
expect(fetched).toBeGreaterThan(cache);
|
|
1311
|
+
expect(fetched).toBeGreaterThan(rust);
|
|
1312
|
+
expect(producer).toBeGreaterThan(fetched);
|
|
1313
|
+
for (const path of ["Cargo.toml", "Cargo.lock"])
|
|
1314
|
+
expect(selected("checksums", path), path).toBe(true);
|
|
1315
|
+
});
|
|
1316
|
+
|
|
1317
|
+
test("checksums caches the pinned toolchain, Cargo inputs and actual build outputs", () => {
|
|
1318
|
+
const steps = stepsFor("coreutils-checksums");
|
|
1319
|
+
const cache = steps.find((step) => step.id === "checksum-cache");
|
|
1320
|
+
expect(cache).toBeDefined();
|
|
1321
|
+
expect(cache?.uses).toBe("actions/cache@v4");
|
|
1322
|
+
expect(steps.find((step) => step.id === "bun-cache")?.uses).toBe("actions/cache@v4");
|
|
1323
|
+
expect(steps.find((step) => step.id === "sdk")?.uses).toBe("actions/cache@v4");
|
|
1324
|
+
for (const path of [
|
|
1325
|
+
"~/.rustup/toolchains",
|
|
1326
|
+
"~/.cargo/registry",
|
|
1327
|
+
"~/.cargo/git",
|
|
1328
|
+
".build/coreutils-checksums",
|
|
1329
|
+
".build/program-locales",
|
|
1330
|
+
".build/wasi-libc",
|
|
1331
|
+
"packages/coreutils/.sources",
|
|
1332
|
+
])
|
|
1333
|
+
expect(String(record(cache?.with).path)).toContain(path);
|
|
1334
|
+
const key = String(record(cache?.with).key);
|
|
1335
|
+
expect(key).toContain("packages/coreutils/crates/checksums/Cargo.lock");
|
|
1336
|
+
expect(key).toContain("packages/coreutils/crates/checksums/patches/**");
|
|
1337
|
+
expect(key).toContain("packages/coreutils/scripts/build-checksums.ts");
|
|
1338
|
+
expect(key).toContain("tools/program-locales/**");
|
|
1339
|
+
expect(key).toContain("packages/waffle/patches/wasi-libc/**");
|
|
1340
|
+
expect(record(cache?.with)["restore-keys"]).toBe(
|
|
1341
|
+
"${{ runner.os }}-${{ runner.arch }}-program-coreutils-checksums-v1-",
|
|
1342
|
+
);
|
|
1343
|
+
const discardIndex = steps.findIndex(
|
|
1344
|
+
(step) => step.name === "Discard a generated source restored from a different checksum recipe",
|
|
1345
|
+
);
|
|
1346
|
+
expect(discardIndex).toBeGreaterThanOrEqual(0);
|
|
1347
|
+
const discard = steps[discardIndex];
|
|
1348
|
+
expect(discard?.if).toBe("steps.checksum-cache.outputs.cache-hit != 'true'");
|
|
1349
|
+
expect(discard?.run).toBe("rm -rf packages/coreutils/.sources/checksums");
|
|
1350
|
+
expect(discardIndex).toBeLessThan(
|
|
1351
|
+
steps.findIndex((step) => step.run === "bun run --cwd packages/coreutils build:checksums"),
|
|
1352
|
+
);
|
|
1353
|
+
const retained = steps.find(
|
|
1354
|
+
(step) => step.name === "Retain the exact checksum-only producer closure",
|
|
1355
|
+
);
|
|
1356
|
+
expect(retained?.uses).toBe("actions/upload-artifact@v4");
|
|
1357
|
+
expect(String(record(retained?.with).path)).toContain(".build/checksum-artifact");
|
|
1358
|
+
expect(String(record(retained?.with).path)).toContain(
|
|
1359
|
+
".build/gnu-checksum-native-oracle/metadata.json",
|
|
1360
|
+
);
|
|
1361
|
+
const native = steps.find((step) => step.id === "checksum-native-oracle");
|
|
1362
|
+
expect(native?.uses).toBe("actions/cache@v4");
|
|
1363
|
+
expect(record(native?.with).path).toBe(".build/gnu-checksum-native-oracle");
|
|
1364
|
+
expect(String(record(native?.with).key)).toContain("steps.checksum-oracle-identity.outputs.key");
|
|
1365
|
+
expect(String(record(native?.with).key)).toContain(
|
|
1366
|
+
"steps.checksum-oracle-identity.outputs.image",
|
|
1367
|
+
);
|
|
1368
|
+
expect(record(native?.with)["restore-keys"]).toBeUndefined();
|
|
1369
|
+
const nativeBuild = steps.find(
|
|
1370
|
+
(step) => step.name === "Build the nine native GNU oracle programs on cache miss",
|
|
1371
|
+
);
|
|
1372
|
+
expect(nativeBuild?.if).toBe("steps.checksum-native-oracle.outputs.cache-hit != 'true'");
|
|
1373
|
+
expect(nativeBuild?.run).toBe("node packages/coreutils/scripts/build-native-checksum-oracle.ts");
|
|
1374
|
+
});
|
|
1375
|
+
|
|
1376
|
+
test("checksums selects its compiler, locale, libc, runtime and leaf inputs without unrelated guests", () => {
|
|
1377
|
+
for (const path of [
|
|
1378
|
+
".github/workflows/ci.yml",
|
|
1379
|
+
".github/actions/program-optimizer/action.yml",
|
|
1380
|
+
"package.json",
|
|
1381
|
+
"bun.lock",
|
|
1382
|
+
"rust-toolchain.toml",
|
|
1383
|
+
"tools/program-build-tools.ts",
|
|
1384
|
+
"tools/program-optimize.ts",
|
|
1385
|
+
"tools/program-derivation.ts",
|
|
1386
|
+
"tools/program-locales/prepare.ts",
|
|
1387
|
+
"tools/family-acceptance.ts",
|
|
1388
|
+
"tools/tsconfig.programs.json",
|
|
1389
|
+
"packages/waffle/runtime.ts",
|
|
1390
|
+
"packages/waffle/core/wasi.ts",
|
|
1391
|
+
"packages/waffle/fs/index.ts",
|
|
1392
|
+
"packages/waffle/proc/worker-client.ts",
|
|
1393
|
+
"packages/waffle/interrupt/check.ts",
|
|
1394
|
+
"packages/waffle/browser/preview1-worker.ts",
|
|
1395
|
+
"packages/waffle/programs/collection.ts",
|
|
1396
|
+
"packages/waffle/scripts/build-wasi-libc.sh",
|
|
1397
|
+
"packages/waffle/patches/wasi-libc/preopen-scan.patch",
|
|
1398
|
+
"packages/coreutils/src/index.ts",
|
|
1399
|
+
"packages/coreutils/crates/checksums/src/bin/sha256sum.rs",
|
|
1400
|
+
"packages/coreutils/crates/checksums/Cargo.lock",
|
|
1401
|
+
"packages/coreutils/scripts/build-checksums.ts",
|
|
1402
|
+
"packages/coreutils/scripts/checksum-artifact.ts",
|
|
1403
|
+
"packages/coreutils/scripts/checksum-oracle.ts",
|
|
1404
|
+
"packages/coreutils/scripts/build-native-checksum-oracle.ts",
|
|
1405
|
+
"packages/coreutils/scripts/build-native-date-oracle.ts",
|
|
1406
|
+
"packages/coreutils/scripts/gnu-date-source.json",
|
|
1407
|
+
"packages/coreutils/scripts/checksum-source.test.ts",
|
|
1408
|
+
"packages/coreutils/scripts/checksum-parser.test.ts",
|
|
1409
|
+
"packages/coreutils/scripts/prepare-checksum-source.ts",
|
|
1410
|
+
"packages/coreutils/tests/checksums-wasi.test.ts",
|
|
1411
|
+
"packages/coreutils/fixtures/checksums.json",
|
|
1412
|
+
"packages/coreutils/provenance/checksums.source.json",
|
|
1413
|
+
])
|
|
1414
|
+
expect(selected("checksums", path), path).toBe(true);
|
|
1415
|
+
for (const path of [
|
|
1416
|
+
"packages/waffle/browser/net/module.ts",
|
|
1417
|
+
"packages/coreutils/scripts/build-date.ts",
|
|
1418
|
+
"packages/coreutils/scripts/date-source.test.ts",
|
|
1419
|
+
"packages/coreutils/crates/date/src/main.rs",
|
|
1420
|
+
"packages/findutils/src/index.ts",
|
|
1421
|
+
"packages/grep/src/index.ts",
|
|
1422
|
+
"packages/sed/src/index.ts",
|
|
1423
|
+
"packages/ripgrep/src/index.ts",
|
|
1424
|
+
"packages/jq/src/index.ts",
|
|
1425
|
+
"packages/diffutils/src/index.ts",
|
|
1426
|
+
"site/src/pages/index.astro",
|
|
1427
|
+
"docs/development.md",
|
|
1428
|
+
])
|
|
1429
|
+
expect(selected("checksums", path), path).toBe(false);
|
|
1430
|
+
});
|
|
1431
|
+
|
|
1432
|
+
test("procps CLI checks use package-local input paths and explicit configuration", () => {
|
|
1433
|
+
const steps = stepsFor("procps");
|
|
1434
|
+
for (const check of [
|
|
1435
|
+
{
|
|
1436
|
+
name: "Lint procps",
|
|
1437
|
+
run: "../waffle/node_modules/.bin/oxlint --config ../waffle/.oxlintrc.json --deny-warnings --report-unused-disable-directives src tests scripts",
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
name: "Check procps formatting",
|
|
1441
|
+
run: "../waffle/node_modules/.bin/oxfmt --check --config ../waffle/.oxfmtrc.json src tests scripts docs provenance package.json tsconfig.json",
|
|
1442
|
+
},
|
|
1443
|
+
]) {
|
|
1444
|
+
const step = steps.find((entry) => entry.name === check.name);
|
|
1445
|
+
expect(step).toBeDefined();
|
|
1446
|
+
expect(step?.["working-directory"]).toBe("packages/procps");
|
|
1447
|
+
expect(step?.run).toBe(check.run);
|
|
1448
|
+
}
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
test("package prepares exactly the pinned shallow-safe allocation reference before runtime tests", () => {
|
|
1452
|
+
const steps = stepsFor("package");
|
|
1453
|
+
const setup = steps.findIndex(
|
|
1454
|
+
(step) => step.run === "bun packages/waffle/tooling/prepare-allocation-reference.ts",
|
|
1455
|
+
);
|
|
1456
|
+
const tests = steps.findIndex((step) => step.run === "bun run test && bun run test:ci");
|
|
1457
|
+
expect(setup).toBeGreaterThanOrEqual(0);
|
|
1458
|
+
expect(setup).toBeLessThan(tests);
|
|
1459
|
+
const source = readFileSync(
|
|
1460
|
+
new URL("./prepare-allocation-reference.ts", import.meta.url),
|
|
1461
|
+
"utf8",
|
|
1462
|
+
);
|
|
1463
|
+
expect(source).toContain("fd1d23c223acbc854b8113fe1e37a7a183728697");
|
|
1464
|
+
expect(source).toContain('"--depth=1"');
|
|
1465
|
+
expect(source).not.toMatch(/--unshallow|fetch.*--all/);
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1468
|
+
test("G2 producer and native acceptance inputs select the blocking browser job", () => {
|
|
1469
|
+
for (const path of [
|
|
1470
|
+
"packages/waffle/tests/gpu-async-browser-runner.ts",
|
|
1471
|
+
"packages/waffle/tests/gpu-async-fixture.test.ts",
|
|
1472
|
+
"packages/waffle/tests/gpu-async-stream.test.ts",
|
|
1473
|
+
"packages/waffle/tests/gpu-async-native.ts",
|
|
1474
|
+
"packages/waffle/tests/gpu-native-controls.ts",
|
|
1475
|
+
"packages/waffle/tests/fixtures/gpu/async-native.ts",
|
|
1476
|
+
"packages/waffle/tests/fixtures/gpu/async-page.ts",
|
|
1477
|
+
"packages/waffle/tests/fixtures/gpu/async.c",
|
|
1478
|
+
"packages/waffle/tests/fixtures/gpu/async_encode.h",
|
|
1479
|
+
"packages/waffle/tests/fixtures/gpu/async-expected.json",
|
|
1480
|
+
"packages/waffle/browser/gpu/upstream/webgpu.h",
|
|
1481
|
+
])
|
|
1482
|
+
expect(selected("browser", path), path).toBe(true);
|
|
1483
|
+
const browser = record(jobs.browser);
|
|
1484
|
+
expect(browser["continue-on-error"]).toBeUndefined();
|
|
1485
|
+
const command = stepsFor("browser").find((step) =>
|
|
1486
|
+
String(step.run).startsWith("bun run test:browser "),
|
|
1487
|
+
);
|
|
1488
|
+
expect(command).toBeDefined();
|
|
1489
|
+
expect(command?.["continue-on-error"]).toBeUndefined();
|
|
1490
|
+
const source = stepsFor("libc").find((step) =>
|
|
1491
|
+
String(step.run).includes("gpu-async-stream.test.ts"),
|
|
1492
|
+
);
|
|
1493
|
+
expect(source).toBeDefined();
|
|
1494
|
+
expect(source?.if).toBeUndefined();
|
|
1495
|
+
expect(source?.["continue-on-error"]).toBeUndefined();
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1498
|
+
test("normal network matrix uses one complete positive command plus bounded controls", async () => {
|
|
1499
|
+
const matrix = await Bun.file(new URL("../scripts/test-browser.ts", import.meta.url)).text();
|
|
1500
|
+
expect(matrix.match(/"tests\/network-browser-runner.ts"/g)).toHaveLength(2);
|
|
1501
|
+
expect(matrix).toContain('engines: ["--page-controls", "chromium"]');
|
|
1502
|
+
const entry = await Bun.file(
|
|
1503
|
+
new URL("../tests/network-browser-runner.ts", import.meta.url),
|
|
1504
|
+
).text();
|
|
1505
|
+
expect(entry).toContain("completeNetworkCommand");
|
|
1506
|
+
expect(entry).not.toContain("runIsolatedPages");
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
test("native relay setup requires prebuilt bytes before package and parallel browser checks", () => {
|
|
1510
|
+
for (const name of ["package", "browser"]) {
|
|
1511
|
+
const steps = stepsFor(name);
|
|
1512
|
+
const install = steps.findIndex(
|
|
1513
|
+
(step) => step.run === "bun install --frozen-lockfile --ignore-scripts",
|
|
1514
|
+
);
|
|
1515
|
+
const prepare = steps.findIndex(
|
|
1516
|
+
(step) => step.run === "bun packages/waffle-relay/scripts/prepare-native.ts",
|
|
1517
|
+
);
|
|
1518
|
+
const product = steps.findIndex(
|
|
1519
|
+
(step) =>
|
|
1520
|
+
typeof step.run === "string" &&
|
|
1521
|
+
(step.run.includes("relay:check") || step.run.includes("bun run test:browser")),
|
|
1522
|
+
);
|
|
1523
|
+
expect(install).toBeGreaterThanOrEqual(0);
|
|
1524
|
+
expect(prepare).toBeGreaterThan(install);
|
|
1525
|
+
expect(prepare).toBeLessThan(product);
|
|
1526
|
+
const cache = steps.find(
|
|
1527
|
+
(step) => step.name === "Cache standard native relay prebuild downloads",
|
|
1528
|
+
);
|
|
1529
|
+
expect(cache?.uses).toBe("actions/cache@v4");
|
|
1530
|
+
expect(record(cache?.with).path).toBe("~/.npm/_prebuilds");
|
|
1531
|
+
const key = String(record(cache?.with).key);
|
|
1532
|
+
expect(key).toContain("${{ runner.os }}-${{ runner.arch }}");
|
|
1533
|
+
expect(key).toContain("bun.lock");
|
|
1534
|
+
expect(key).toContain("src/webtransport-integrity.ts");
|
|
1535
|
+
expect(record(cache?.with)["restore-keys"]).toBeUndefined();
|
|
1536
|
+
if (!cache) throw new Error("Missing prebuild cache step");
|
|
1537
|
+
expect(steps.indexOf(cache)).toBeLessThan(prepare);
|
|
1538
|
+
expect(cache?.if).toBe(name === "browser" ? "matrix.group == 'parallel'" : undefined);
|
|
1539
|
+
expect(steps[prepare]?.if).toBe(name === "browser" ? "matrix.group == 'parallel'" : undefined);
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
|
|
1543
|
+
test("package setup explicitly prepares Waffle after the script-free install", () => {
|
|
1544
|
+
const steps = stepsFor("package");
|
|
1545
|
+
const native = steps.findIndex(
|
|
1546
|
+
(step) => step.run === "bun packages/waffle-relay/scripts/prepare-native.ts",
|
|
1547
|
+
);
|
|
1548
|
+
const prepare = steps.findIndex((step) => step.run === "bun run prepare:package");
|
|
1549
|
+
const quality = steps.findIndex((step) => step.run === "bun run quality");
|
|
1550
|
+
expect(prepare).toBeGreaterThan(native);
|
|
1551
|
+
expect(prepare).toBeLessThan(quality);
|
|
1552
|
+
const adapter = steps.findIndex(
|
|
1553
|
+
(step) => step.run === "bun run --cwd packages/git/node_modules/bun-wasm prepare",
|
|
1554
|
+
);
|
|
1555
|
+
expect(adapter).toBeGreaterThan(prepare);
|
|
1556
|
+
expect(adapter).toBeLessThan(quality);
|
|
1557
|
+
const tooling = steps.find((step) => step.name === "Check native preparation tooling");
|
|
1558
|
+
expect(String(tooling?.run)).toContain("oxlint");
|
|
1559
|
+
expect(String(tooling?.run)).toContain("oxfmt --check");
|
|
1560
|
+
expect(String(tooling?.run)).toContain("packages/waffle-relay/tests/prepare-native.test.ts");
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
import "../../../tools/ci-release-coverage.test.ts";
|
|
1564
|
+
import "../../../tools/ci-release-download.test.ts";
|
|
1565
|
+
|
|
1566
|
+
test("translated network inputs and assets share every exact cache and only one producer", () => {
|
|
1567
|
+
for (const path of [
|
|
1568
|
+
"tooling/network-translator.ts",
|
|
1569
|
+
"tooling/network-translator/package.json",
|
|
1570
|
+
"tooling/network-translator/bun.lock",
|
|
1571
|
+
"tooling/network-growth.ts",
|
|
1572
|
+
]) {
|
|
1573
|
+
expect(selected("network", `packages/waffle/${path}`), path).toBe(true);
|
|
1574
|
+
expect(selected("browser", `packages/waffle/${path}`), path).toBe(true);
|
|
1575
|
+
}
|
|
1576
|
+
const producer = stepsFor("network-wasm").find((step) => step.id === "network-artifact");
|
|
1577
|
+
const key = String(record(producer?.with).key);
|
|
1578
|
+
expect(key).toContain("network-wasm-v2-");
|
|
1579
|
+
expect(key).toContain("tooling/network-translator/**");
|
|
1580
|
+
expect(key).toContain("tooling/network-growth.ts");
|
|
1581
|
+
for (const name of Object.keys(jobs)) {
|
|
1582
|
+
if (!Array.isArray(record(jobs[name]).steps)) continue;
|
|
1583
|
+
const steps = stepsFor(name);
|
|
1584
|
+
const cache = steps.find((step) => step.id === "network-artifact");
|
|
1585
|
+
if (!cache) continue;
|
|
1586
|
+
expect(record(cache.with).key).toBe(key);
|
|
1587
|
+
for (const artifact of ["network.buffer.js", "network.buffer.sha256", "network.growth.json"])
|
|
1588
|
+
expect(String(record(cache.with).path)).toContain(artifact);
|
|
1589
|
+
if (name === "network-wasm") continue;
|
|
1590
|
+
expect(
|
|
1591
|
+
steps.some(
|
|
1592
|
+
(step) =>
|
|
1593
|
+
typeof step.run === "string" && /build:network|provisionNetworkTranslator/.test(step.run),
|
|
1594
|
+
),
|
|
1595
|
+
).toBe(false);
|
|
1596
|
+
}
|
|
1597
|
+
expect(
|
|
1598
|
+
stepsFor("network-wasm").filter((step) => String(step.run).includes("build:network")),
|
|
1599
|
+
).toHaveLength(1);
|
|
1600
|
+
});
|
|
1601
|
+
|
|
1602
|
+
test("release, echo and xargs restore all translated artifacts under the producer key", async () => {
|
|
1603
|
+
const producer = stepsFor("network-wasm").find((step) => step.id === "network-artifact");
|
|
1604
|
+
const key = record(producer?.with).key;
|
|
1605
|
+
for (const name of ["release", "coreutils-echo", "findutils-xargs"]) {
|
|
1606
|
+
const source = await Bun.file(
|
|
1607
|
+
new URL(`../../../.github/workflows/${name}.yml`, import.meta.url),
|
|
1608
|
+
).text();
|
|
1609
|
+
const value: unknown = Bun.YAML.parse(source);
|
|
1610
|
+
const workflow = record(value);
|
|
1611
|
+
for (const job of Object.values(record(workflow.jobs))) {
|
|
1612
|
+
const steps = record(job).steps;
|
|
1613
|
+
if (!Array.isArray(steps)) continue;
|
|
1614
|
+
const cache = steps
|
|
1615
|
+
.map(record)
|
|
1616
|
+
.find((step) => ["network", "network-artifact"].includes(String(step.id)));
|
|
1617
|
+
if (!cache) continue;
|
|
1618
|
+
expect(record(cache.with).key).toBe(key);
|
|
1619
|
+
for (const artifact of ["network.buffer.js", "network.buffer.sha256", "network.growth.json"])
|
|
1620
|
+
expect(String(record(cache.with).path)).toContain(artifact);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
test("compiler lifecycle and truly raw source proof run only in the network producer", () => {
|
|
1626
|
+
const producer = stepsFor("network-wasm");
|
|
1627
|
+
expect(producer.some((step) => String(step.run).includes("network-source-smoke.ts"))).toBe(true);
|
|
1628
|
+
for (const [name, job] of Object.entries(jobs)) {
|
|
1629
|
+
if (name === "network-wasm" || !Array.isArray(record(job).steps)) continue;
|
|
1630
|
+
expect(
|
|
1631
|
+
stepsFor(name).some((step) =>
|
|
1632
|
+
/network-source-smoke|network-translator.test/.test(String(step.run)),
|
|
1633
|
+
),
|
|
1634
|
+
).toBe(false);
|
|
1635
|
+
}
|
|
1636
|
+
});
|