diff --git a/CHANGELOG.md b/CHANGELOG.md index b52f07917..31c3de5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Carry the narrow disposable-library dependency in emitted Runtime declarations + so strict ES2022 consumers can import the installed package and use close or + async disposal without a broad ESNext library override + ([#981](https://github.com/git-stunts/git-warp/issues/981)). + - Capture a coherent observed writer basis before public live writes, advancing Lamports beyond inspected patches and retaining frontier evidence with the admitted operations across restart ([#957](https://github.com/git-stunts/git-warp/issues/957)). diff --git a/docs/operations/package-payload.md b/docs/operations/package-payload.md index 111c7db81..d6ccdcfda 100644 --- a/docs/operations/package-payload.md +++ b/docs/operations/package-payload.md @@ -8,6 +8,8 @@ extraction, inspection, and supply-chain surface. This contract defines which path classes may cross the npm publication boundary and how the release gate proves that the actual tarball obeys it. +Public declarations carry their required standard-library dependencies. Runtime's emitted declaration preserves a narrow `esnext.disposable` reference so strict ES2022 consumers can import it without a broad ESNext override or `skipLibCheck`. The check of the packed consumer in `scripts/check-packed-disposable.sh` covers all five public entrypoints, explicit disposal typing, and installed close/dispose lifecycle behavior in Docker. + ## Baseline At `e69c2f970`, after a clean publish build, this command: diff --git a/scripts/check-packed-disposable.sh b/scripts/check-packed-disposable.sh new file mode 100644 index 000000000..3eeb57810 --- /dev/null +++ b/scripts/check-packed-disposable.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail +node scripts/RequireDockerTests.ts +repo=$PWD +work=$(mktemp -d "${TMPDIR:-/tmp}/packed-disposable.XXXXXX") +trap 'rm -rf "$work"' EXIT +mkdir -p "$work/pack" "$work/consumer" +node scripts/package-payload/CheckPackagePayload.ts --pack-destination "$work/pack" +cp test/type-check/packed-disposable/* "$work/consumer/" +cd "$work/consumer" +npm install --ignore-scripts --no-audit --no-fund --fetch-retries=0 --fetch-timeout=15000 "$work"/pack/*.tgz >/dev/null +node "$repo/node_modules/typescript/bin/tsc" --version +failed=0 +for config in root-close root-dispose advanced combined explicit-disposable testing diagnostics charts; do + if node "$repo/node_modules/typescript/bin/tsc" -p "tsconfig.$config.json"; then + echo "PACKED_DISPOSABLE_CASE $config PASS" + else + echo "PACKED_DISPOSABLE_CASE $config FAIL" + failed=1 + fi +done +if ! grep -q '^/// import Lane from '../domain/api/Lane.ts'; import type SettlementPreview from '../domain/api/SettlementPreview.ts'; import type SettlementReceipt from '../domain/api/SettlementReceipt.ts'; diff --git a/test/evidence/981-disposable-consumer/README.md b/test/evidence/981-disposable-consumer/README.md new file mode 100644 index 000000000..8861deae6 --- /dev/null +++ b/test/evidence/981-disposable-consumer/README.md @@ -0,0 +1,17 @@ +# Strict installed ES2022 disposable declarations: issue 981 + +Source base 5c82ba6ca168d07b743fac5c6adbf38822ae0302 is the reviewed locked-audit prerequisite. Runtime, public entrypoints and compiler configuration are byte-identical to main/v20.0.0 ceb58e656ec5bc85f0ae5991bf2a55599693bbb3; no disposal fix exists. The initial probe independently installs the actual packed artifact and reproduces TS2550 at emitted Runtime.d.ts:30 with TypeScript 5.9.3, strict NodeNext/ES2022, skipLibCheck=false, explicit ES2022/DOM/DOM.Iterable, types=[] and no source aliases. + +The full matrix repeats with committed portable fixtures: root-close, root-dispose and combined root/advanced fail. Root-dispose additionally fails the consumer symbol access. Advanced-only and explicit ESNext.Disposable controls pass. This isolates the missing narrow declaration dependency rather than a general module-resolution failure. Package payload gates pass 746177 compressed / 3257290 unpacked / 971 entries within unchanged 760000 / 3300000 / 1050 limits. No GREEN or source repair is claimed. + +All execution is COPY-based Docker under the existing git-warp-tests worker/image/build volume and only its concrete resource reservation. Build 20 GiB is monitored, not quota-backed; runtime 3 GiB tmpfs remains within 4 GiB; logs 128 MiB with 16 MiB phase / 96 MiB generated nonobject; 4 CPU / 8 GiB / pids 768 and host / VM 50 GiB floors/timeouts/child cleanup remain active. Matrix peak 50536448 runtime bytes, 50917376 generated nonobject, 1960185856 build, 27 tasks; no guard/OOM/PID refusal. Worker stops before lease release. Raw and normalized/archive hashes retain exact scopes. Mainline merging remains paused. + +## Reviewed narrow repair and GREEN + +Agy approves the one preserved narrow esnext.disposable reference at Runtime's public declaration boundary. Complete original/artifacts/qualification are delivered intact to Reader under receipt e645ff44-1a8a-423f-a8e9-5f9ce8a51716 and posted on 981 before implementation. Unsupported estimates, consumer compiler floor and reviewer authorization language remain qualified; the user already authorizes implementation and PR preparation. Private WarpStorage declarations are pruned and need no new public reference. + +The only production change is the top-of-file preserved reference in Runtime.ts. It adds a standard declaration dependency and no runtime statements. Disposable-green-981-v3 passes source/test types, explicit source/fixture lint without ignored-file warning, all 8 strict installed compiler cases and 3 native lifecycle cases. Root close / direct dispose / combined/advanced/testing/diagnostics/charts/explicit-narrow-library cases pass with TypeScript 5.9.3, no source aliases, types=[], ES2022 and skipLibCheck=false. Installed close, repeated dispose, concurrent close / dispose and closed-runtime refusal retain behavior. Actual payload 746269 compressed / 3257406 unpacked / 971 entries passes unchanged limits. + +Runtime-parity-981-v2 independently strips only the reference prefix in the copied guest source, re-emits the baseline to owned bounded output, and compares generated JavaScript after removing the single new comment. Bytes match exactly. Baseline JS SHA256 b54207d16ecb141d9e79b3785f6561363fc5779f04434439fc86002d3385b3d9; candidate 532e9cd708bc36a84ec4987d7c0ee3831f3078d6a959b19a87dc8eaaa8902716. The differing bytes are the comment, not a hidden runtime change. This identified comparison command is not a claim that its guest source stayed unchanged. + +Earlier attempts remain qualified: GREEN v1 passes 8 compiler cases but fails missing container rg; v2 passes compile / lifecycle but explicitly surfaces an ignored-fixture lint warning; parity v1 refuses at fixture console/no-undef before comparison. The fixture imports Node stdout and v3 / parity v2 verify actual lint cleanly. No threshold, skipLibCheck, engine floor, symbol identity, global configuration or runtime behavior is weakened. This type-only annotation is not a runtime refactor; SSJS is green with no new domain model, boundary leakage, ambient time / entropy or trust casts. Full required project gates, final-head independent review and hosted validation remain open. Mainline merging stays paused. diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v1-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-green-981-v1-console.txt.gz new file mode 100644 index 000000000..c57e944ea Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-green-981-v1-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v1-launch.json b/test/evidence/981-disposable-consumer/disposable-green-981-v1-launch.json new file mode 100644 index 000000000..0379929c9 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v1-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-green-981-v1", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "48eea225c0880a1aac8b7bf6a1e6b75ada140191", + "source_archive_sha256": "242985138c37323bb0b8be0d1d7d0bc6e1b4e5f4dff969a934e158ee322c4b1b", + "source_archive_bytes": 21258240, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "npm run typecheck && node node_modules/eslint/bin/eslint.js src/application/Runtime.ts && bash scripts/check-packed-disposable.sh" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 722965827584, + "host_receipt_bytes": 7500519, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 687134674944, + "initial_build_bytes": 1956798464 +} diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v1-resources.json b/test/evidence/981-disposable-consumer/disposable-green-981-v1-resources.json new file mode 100644 index 000000000..846d37200 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v1-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 1, + "guard_error": null, + "peaks": { + "pids": 23, + "build_bytes": 1960337408, + "/data": 59355136, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 59740160, + "minimum_vm_free_bytes": 687134674944 + }, + "stdout_bytes": 685, + "timeout_seconds": 1700, + "measurement_pauses": 16, + "measurement_pause_seconds": 1.2766263351077214, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v2-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-green-981-v2-console.txt.gz new file mode 100644 index 000000000..1fb340ef7 Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-green-981-v2-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v2-launch.json b/test/evidence/981-disposable-consumer/disposable-green-981-v2-launch.json new file mode 100644 index 000000000..b77357587 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v2-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-green-981-v2", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "48eea225c0880a1aac8b7bf6a1e6b75ada140191", + "source_archive_sha256": "48b860c27078b580689238819f0f087ae93bc2b4902c70c7eb180cbb367f172a", + "source_archive_bytes": 21268480, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "npm run typecheck && node node_modules/eslint/bin/eslint.js src/application/Runtime.ts test/type-check/packed-disposable/lifecycle.mjs && bash scripts/check-packed-disposable.sh" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 722958565376, + "host_receipt_bytes": 7503453, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 687133822976, + "initial_build_bytes": 1957695488 +} diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v2-resources.json b/test/evidence/981-disposable-consumer/disposable-green-981-v2-resources.json new file mode 100644 index 000000000..5d04c6866 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v2-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 0, + "guard_error": null, + "peaks": { + "pids": 23, + "build_bytes": 1961115648, + "/data": 59359232, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 59744256, + "minimum_vm_free_bytes": 687133822976 + }, + "stdout_bytes": 979, + "timeout_seconds": 1700, + "measurement_pauses": 14, + "measurement_pause_seconds": 1.1071061459952034, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v3-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-green-981-v3-console.txt.gz new file mode 100644 index 000000000..c999d4747 Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-green-981-v3-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v3-launch.json b/test/evidence/981-disposable-consumer/disposable-green-981-v3-launch.json new file mode 100644 index 000000000..ae7f36e63 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v3-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-green-981-v3", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "48eea225c0880a1aac8b7bf6a1e6b75ada140191", + "source_archive_sha256": "de53f7401208a7dc19669207bf3dc217767db6d7439a2a047fdaf96851c6cfbb", + "source_archive_bytes": 21268480, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "npm run typecheck && node node_modules/eslint/bin/eslint.js src/application/Runtime.ts && node node_modules/eslint/bin/eslint.js --no-ignore test/type-check/packed-disposable/lifecycle.mjs && bash scripts/check-packed-disposable.sh" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 723051868160, + "host_receipt_bytes": 7513775, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 687203782656, + "initial_build_bytes": 1957703680 +} diff --git a/test/evidence/981-disposable-consumer/disposable-green-981-v3-resources.json b/test/evidence/981-disposable-consumer/disposable-green-981-v3-resources.json new file mode 100644 index 000000000..eaef9ab14 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-green-981-v3-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 0, + "guard_error": null, + "peaks": { + "pids": 27, + "build_bytes": 1961103360, + "/data": 59359232, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 59744256, + "minimum_vm_free_bytes": 687203782656 + }, + "stdout_bytes": 710, + "timeout_seconds": 1700, + "measurement_pauses": 16, + "measurement_pause_seconds": 1.2773066610679962, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-console.txt.gz new file mode 100644 index 000000000..a8a367b9f Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-launch.json b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-launch.json new file mode 100644 index 000000000..a11ea8cce --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-launch.json @@ -0,0 +1,40 @@ +{ + "phase": "disposable-matrix-red-981-v1", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "5c82ba6ca168d07b743fac5c6adbf38822ae0302", + "source_archive_sha256": "0894f4475342a88f455bc98397a0df29812527ef2c2a79c9c397a07f7161dffe", + "source_archive_bytes": 21227520, + "baseline_inputs": {}, + "command": [ + "bash", + "scripts/check-packed-disposable.sh" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 724154601472, + "host_receipt_bytes": 7375569, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 688278384640, + "initial_build_bytes": 1956671488 +} diff --git a/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-resources.json b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-resources.json new file mode 100644 index 000000000..64e7225a5 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-matrix-red-981-v1-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 1, + "guard_error": null, + "peaks": { + "pids": 27, + "build_bytes": 1960185856, + "/data": 50536448, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 50917376, + "minimum_vm_free_bytes": 688278384640 + }, + "stdout_bytes": 1445, + "timeout_seconds": 1700, + "measurement_pauses": 6, + "measurement_pause_seconds": 0.45706846902612597, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-red-981-v1-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-red-981-v1-console.txt.gz new file mode 100644 index 000000000..91cd0f413 Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-red-981-v1-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-red-981-v1-launch.json b/test/evidence/981-disposable-consumer/disposable-red-981-v1-launch.json new file mode 100644 index 000000000..659ddf6d9 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-red-981-v1-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-red-981-v1", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "5c82ba6ca168d07b743fac5c6adbf38822ae0302", + "source_archive_sha256": "455f0cd7a385dca7ac843074b937c11184e47ee8c918b56c96d0b2a47d428c76", + "source_archive_bytes": 21196800, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "set -eu; root=$PWD; work=$(mktemp -d \"${TMPDIR}/disposable981.XXXXXX\"); trap 'rm -rf \"$work\"' EXIT; mkdir -p \"$work/pack\" \"$work/consumer\"; node scripts/package-payload/CheckPackagePayload.ts --pack-destination \"$work/pack\"; cd \"$work/consumer\"; npm init -y >/dev/null; npm pkg set type=module; npm install --ignore-scripts --no-audit --no-fund --fetch-retries=0 --fetch-timeout=15000 \"$work\"/pack/*.tgz >/dev/null; cat > consumer.ts <<'EOF'\nimport { Runtime } from \"@git-stunts/git-warp\";\ndeclare const runtime: Runtime;\nvoid runtime.close();\nEOF\ncat > tsconfig.json <<'EOF'\n{\"compilerOptions\":{\"target\":\"ES2022\",\"module\":\"NodeNext\",\"moduleResolution\":\"NodeNext\",\"lib\":[\"ES2022\",\"DOM\",\"DOM.Iterable\"],\"types\":[],\"strict\":true,\"exactOptionalPropertyTypes\":true,\"noUncheckedIndexedAccess\":true,\"skipLibCheck\":false,\"noEmit\":true},\"files\":[\"consumer.ts\"]}\nEOF\nnode \"$root/node_modules/typescript/bin/tsc\" --version; node \"$root/node_modules/typescript/bin/tsc\" --project tsconfig.json" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 723441881088, + "host_receipt_bytes": 7355421, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 687555317760, + "initial_build_bytes": 1962029056 +} diff --git a/test/evidence/981-disposable-consumer/disposable-red-981-v1-resources.json b/test/evidence/981-disposable-consumer/disposable-red-981-v1-resources.json new file mode 100644 index 000000000..f7f7ea793 --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-red-981-v1-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 2, + "guard_error": null, + "peaks": { + "pids": 27, + "build_bytes": 1960124416, + "/data": 50601984, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 40321024, + "minimum_vm_free_bytes": 687555317760 + }, + "stdout_bytes": 419, + "timeout_seconds": 1700, + "measurement_pauses": 6, + "measurement_pause_seconds": 0.4675887949997559, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-console.txt.gz new file mode 100644 index 000000000..d2c596494 Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-launch.json b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-launch.json new file mode 100644 index 000000000..db0fdae5e --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-runtime-parity-981-v1", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "48eea225c0880a1aac8b7bf6a1e6b75ada140191", + "source_archive_sha256": "57d48998ffbf81a11770b5869b8d84d8cd802d43e632962f551e03efb6932da8", + "source_archive_bytes": 21268480, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "set -eu; node node_modules/eslint/bin/eslint.js --no-ignore test/type-check/packed-disposable/lifecycle.mjs; cp dist/src/application/Runtime.js /data/evidence/runtime-candidate.js; python3 - <<'PY'\nfrom pathlib import Path\np=Path(\"src/application/Runtime.ts\");s=p.read_text();prefix=\"/// \\n\";assert s.startswith(prefix);p.write_text(s[len(prefix):])\nPY\nnode node_modules/typescript/bin/tsc -p tsconfig.publish.json --outDir /data/baseline-dist; python3 - <<'PY'\nfrom pathlib import Path\nimport hashlib\ncandidate=Path(\"/data/evidence/runtime-candidate.js\").read_bytes();baseline=Path(\"/data/baseline-dist/src/application/Runtime.js\").read_bytes();prefix=b\"/// \\n\"\nnormalized=candidate[len(prefix):] if candidate.startswith(prefix) else candidate\nassert normalized==baseline,\"Runtime JavaScript has changed beyond the library-reference comment\"\nprint(\"RUNTIME_JS_PARITY_PASS\", \"baseline_sha256=\"+hashlib.sha256(baseline).hexdigest(),\"candidate_sha256=\"+hashlib.sha256(candidate).hexdigest(),\"comment_removed=\"+str(normalized!=candidate))\nPY" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 722321993728, + "host_receipt_bytes": 7506729, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 686480670720, + "initial_build_bytes": 1957707776 +} diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-resources.json b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-resources.json new file mode 100644 index 000000000..13d2720ec --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v1-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 1, + "guard_error": null, + "peaks": { + "pids": 27, + "build_bytes": 1958051840, + "/data": 1748992, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 2134016, + "minimum_vm_free_bytes": 686480670720 + }, + "stdout_bytes": 166, + "timeout_seconds": 1700, + "measurement_pauses": 4, + "measurement_pause_seconds": 0.32448392204241827, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-console.txt.gz b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-console.txt.gz new file mode 100644 index 000000000..2ccd25387 Binary files /dev/null and b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-console.txt.gz differ diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-launch.json b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-launch.json new file mode 100644 index 000000000..4c5873fcd --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-launch.json @@ -0,0 +1,41 @@ +{ + "phase": "disposable-runtime-parity-981-v2", + "inner_guard_sha256": "2e898488b42ef2d6885c79a124d3deef5cc17086f5b8846e75833145a75dd27d", + "worker": "git-warp-tests", + "image": "sha256:9f145953f6e79a59749a683d11a476133cb7cef0588b79256dc195b1d0c87ad7", + "source_base": "48eea225c0880a1aac8b7bf6a1e6b75ada140191", + "source_archive_sha256": "56852545f6f4b4ff043f24ab91b661aefd3b04a33bcc0e86f666cb75d2f4f971", + "source_archive_bytes": 21268480, + "baseline_inputs": {}, + "command": [ + "bash", + "-c", + "set -eu; node node_modules/eslint/bin/eslint.js --no-ignore test/type-check/packed-disposable/lifecycle.mjs; cp dist/src/application/Runtime.js /data/evidence/runtime-candidate.js; python3 - <<'PY'\nfrom pathlib import Path\np=Path(\"src/application/Runtime.ts\");s=p.read_text();prefix=\"/// \\n\";assert s.startswith(prefix);p.write_text(s[len(prefix):])\nPY\nnode node_modules/typescript/bin/tsc -p tsconfig.publish.json --outDir /data/baseline-dist; python3 - <<'PY'\nfrom pathlib import Path\nimport hashlib\ncandidate=Path(\"/data/evidence/runtime-candidate.js\").read_bytes();baseline=Path(\"/data/baseline-dist/src/application/Runtime.js\").read_bytes();prefix=b\"/// \\n\"\nnormalized=candidate[len(prefix):] if candidate.startswith(prefix) else candidate\nassert normalized==baseline,\"Runtime JavaScript has changed beyond the library-reference comment\"\nprint(\"RUNTIME_JS_PARITY_PASS\", \"baseline_sha256=\"+hashlib.sha256(baseline).hexdigest(),\"candidate_sha256=\"+hashlib.sha256(candidate).hexdigest(),\"comment_removed=\"+str(normalized!=candidate))\nPY" + ], + "lock_store": "workstation.git", + "lock_keys": [ + "host/docker/git-warp-tests/" + ], + "outputs": [ + "build volume /app", + "runtime /data", + "bounded /tmp and and /dev/shm", + "Docker rotated log", + "host receipts" + ], + "host_free_bytes": 723053445120, + "host_receipt_bytes": 7510223, + "build_limit_bytes": 21474836480, + "data_quota_bytes": 3221225472, + "generated_nonobject_limit_bytes": 100663296, + "stdout_limit_bytes": 16777216, + "memory_bytes": 8589934592, + "cpus": 4, + "cpu_affinity": "0-3", + "pids_limit": 768, + "timeout_seconds": 1700, + "stop_boundary": "git-warp-tests", + "guard": "inner guard plus outer host free/log monitor; read-only container root", + "vm_free_bytes": 687203782656, + "initial_build_bytes": 1957707776 +} diff --git a/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-resources.json b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-resources.json new file mode 100644 index 000000000..ebeeeb0dd --- /dev/null +++ b/test/evidence/981-disposable-consumer/disposable-runtime-parity-981-v2-resources.json @@ -0,0 +1,32 @@ +{ + "exit_code": 0, + "guard_error": null, + "peaks": { + "pids": 27, + "build_bytes": 1961119744, + "/data": 10362880, + "": 0, + "/tmp": 0, + "/dev/shm": 0, + "generated_nonobject_bytes": 10747904, + "minimum_vm_free_bytes": 687203782656 + }, + "stdout_bytes": 223, + "timeout_seconds": 1700, + "measurement_pauses": 6, + "measurement_pause_seconds": 0.4706796839600429, + "cgroup": { + "pids.current": "3", + "pids.max": "768", + "pids.events": "max 0", + "memory.events": "low 0\nhigh 0\nmax 0\noom 0\noom_kill 0\noom_group_kill 0\nsock_throttled 0", + "cpu.max": "400000 100000", + "cpuset.cpus.effective": "0-3" + }, + "limits": { + "build_bytes": 21474836480, + "runtime_tmpfs_bytes": 3221225472, + "stdout_bytes": 16777216, + "generated_nonobject_bytes": 100663296 + } +} diff --git a/test/evidence/981-disposable-consumer/manifest.json b/test/evidence/981-disposable-consumer/manifest.json new file mode 100644 index 000000000..502eb39e2 --- /dev/null +++ b/test/evidence/981-disposable-consumer/manifest.json @@ -0,0 +1,184 @@ +[ + { + "phase": "disposable-red-981-v1", + "file": "disposable-red-981-v1-console.txt.gz", + "source_name": "console.log", + "original_sha256": "5db46b7e02cd6712691a826f2f00a408087ce1c17409ff711b5d7aa402138f32", + "public_sha256": "5db46b7e02cd6712691a826f2f00a408087ce1c17409ff711b5d7aa402138f32", + "normalization": "none", + "archive_sha256": "feb32609be9d2c5a678d755bbfda198ad4efe6571c32ff05af23c7029f61dce0", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-red-981-v1", + "file": "disposable-red-981-v1-launch.json", + "source_name": "launch.json", + "original_sha256": "765ab8af382662f89863d0332d31dfc75dba66366a7ed4e34a0c02268590673d", + "public_sha256": "6e4354f4ec6ed60a7be84a761785c62fbbe211f737a617828d5d140743338fe7", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-red-981-v1", + "file": "disposable-red-981-v1-resources.json", + "source_name": "resources.json", + "original_sha256": "a9b4489d33d0b2a22c2b721ffa8b6f2a9e7dd6f4225c21c765bf56c5c88d20c6", + "public_sha256": "75b4e6a49c487272fa24b2dd119eb4577d55c7ae2b5dcae2e6e1c2e36e0b3296", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-matrix-red-981-v1", + "file": "disposable-matrix-red-981-v1-console.txt.gz", + "source_name": "console.log", + "original_sha256": "fef787f641c66a3722b4fd5bcbc8313a1ec8569a9f2e926cd7f5b219ffd709d9", + "public_sha256": "fef787f641c66a3722b4fd5bcbc8313a1ec8569a9f2e926cd7f5b219ffd709d9", + "normalization": "none", + "archive_sha256": "1390ebd23054f6732bd00228cc80d7edb075e7720c7dee267f59ea9c14c60906", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-matrix-red-981-v1", + "file": "disposable-matrix-red-981-v1-launch.json", + "source_name": "launch.json", + "original_sha256": "b1f70f057c94f80a0a2ad8c7ea1b0e53e6c5ea5f17785407a9a6ceae736c88e9", + "public_sha256": "168539bfd8395ae8fcabdc84b62028ab0fb7d410439edfa49cbc866fa5f59ac6", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-matrix-red-981-v1", + "file": "disposable-matrix-red-981-v1-resources.json", + "source_name": "resources.json", + "original_sha256": "56d2f8c1a4adc5c01cdc2dc318df4aa25bf92349fe16ae3e1dd8ce863881e387", + "public_sha256": "b705a2afcdd2583aa25ed50bd9e2d463a8310ce022758fc07840362be7c0126b", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v1", + "file": "disposable-green-981-v1-console.txt.gz", + "source_name": "console.log", + "original_sha256": "9a5d4a8407f5997f4f2e1fad6ce21186750c344551c3a06cc10bc1faa65771f8", + "public_sha256": "9a5d4a8407f5997f4f2e1fad6ce21186750c344551c3a06cc10bc1faa65771f8", + "normalization": "none", + "archive_sha256": "ae5b5ec5c4c3e099e369acb6f83e31a202e2d15a6ae340f6cffb3bfca0848907", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-green-981-v1", + "file": "disposable-green-981-v1-launch.json", + "source_name": "launch.json", + "original_sha256": "b99bb14cb4e3f39509283c325abe20ca02ecb892bb6845afdc7fb1327ac52b2e", + "public_sha256": "90bd1d9cccbccf5d04af1f4e0b743634ee779e0bc864eaf3de679ada73641b47", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v1", + "file": "disposable-green-981-v1-resources.json", + "source_name": "resources.json", + "original_sha256": "f74025a36db25dc07de3c2c297bb32c9f8e58c2802497228da631859ce09c9d9", + "public_sha256": "cb3ae3d34aadef96799bd5e91d536b990762929966c2c67a1e92d89987dc0eaa", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v2", + "file": "disposable-green-981-v2-console.txt.gz", + "source_name": "console.log", + "original_sha256": "ff835712e254dcb8ef037a583605ac6fdae346da5c76a505d07d8a63df532e13", + "public_sha256": "ff835712e254dcb8ef037a583605ac6fdae346da5c76a505d07d8a63df532e13", + "normalization": "none", + "archive_sha256": "431164d07123e1868642df8dc6e3aec289d5827a18c0a3808769376c3ed80d7d", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-green-981-v2", + "file": "disposable-green-981-v2-launch.json", + "source_name": "launch.json", + "original_sha256": "42f72964b953e604cb5bf9d83f621aa40b7021737ef2a6fe1c9646d340321936", + "public_sha256": "b4c815922f6a7eb87d9e73f3bb83a8697b281de46ad8634857e9d11d8360e18c", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v2", + "file": "disposable-green-981-v2-resources.json", + "source_name": "resources.json", + "original_sha256": "952f5b631947d7008453d17b994eaceba5ca0654eda8b8935666e388ed116d2f", + "public_sha256": "0c0e4931d2c77bb53c1e58bdd02ca5be330853f84a4280d62efda6335c8775f0", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v3", + "file": "disposable-green-981-v3-console.txt.gz", + "source_name": "console.log", + "original_sha256": "d2e069e9ff97897440f9e9ecb7603a5a7c8da92bfa03637f318bed7714d0dd8b", + "public_sha256": "d2e069e9ff97897440f9e9ecb7603a5a7c8da92bfa03637f318bed7714d0dd8b", + "normalization": "none", + "archive_sha256": "30315e345edce138d3dd6e71c624cbd8ea3c8281da75ef2b2608ccb212b64124", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-green-981-v3", + "file": "disposable-green-981-v3-launch.json", + "source_name": "launch.json", + "original_sha256": "dba19d35ccee799a93136083c83854ab90fc65afcc3ac4a6cfb87bb02226c2b6", + "public_sha256": "4dcda02e3a49937f8eceb60cf3fdc38532d96aaa2d8ec420268da8be955dfe14", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-green-981-v3", + "file": "disposable-green-981-v3-resources.json", + "source_name": "resources.json", + "original_sha256": "a3007fba306391203359bc6b7ae210d84109f2224d99facee4ab1d0563136839", + "public_sha256": "e4adb9e20436d51dc085398cc22b89cb55483982c8fd087f320ae36c756505ec", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-runtime-parity-981-v1", + "file": "disposable-runtime-parity-981-v1-console.txt.gz", + "source_name": "console.log", + "original_sha256": "7c266da85493a4b6088596fcafe8256c04b256e6fadab3f09d0961efb9a21023", + "public_sha256": "7c266da85493a4b6088596fcafe8256c04b256e6fadab3f09d0961efb9a21023", + "normalization": "none", + "archive_sha256": "764272e8ce62be69ca4e093a3f9c9455544f4b765926b69e20cc8dc3a4c8e387", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-runtime-parity-981-v1", + "file": "disposable-runtime-parity-981-v1-launch.json", + "source_name": "launch.json", + "original_sha256": "d636801e20881c61373d2e62336135bdabb74ac265a505585aa74f0e219e4b33", + "public_sha256": "b39b1d1e91a70c7d33b8705b94ec22bacb6d64b46d532a13e81522b3cff27ed9", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-runtime-parity-981-v1", + "file": "disposable-runtime-parity-981-v1-resources.json", + "source_name": "resources.json", + "original_sha256": "9bb8534c5221fdb63704521ab9b57d00b13831eb9e82fdbe8a54facbc7755691", + "public_sha256": "175b19f838afb95c0f4299ae17104c6e936688806e2841de750fcff0a315b065", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-runtime-parity-981-v2", + "file": "disposable-runtime-parity-981-v2-console.txt.gz", + "source_name": "console.log", + "original_sha256": "89ab8083f78ddc8979996404afb01414f829d4630dc483695ee578f49890f038", + "public_sha256": "89ab8083f78ddc8979996404afb01414f829d4630dc483695ee578f49890f038", + "normalization": "none", + "archive_sha256": "af45cb9de7bcd12fcebe2337856de83826fdcdf349fed987db73d6e86cd1a1e9", + "public_hash_scope": "uncompressed public payload" + }, + { + "phase": "disposable-runtime-parity-981-v2", + "file": "disposable-runtime-parity-981-v2-launch.json", + "source_name": "launch.json", + "original_sha256": "75201390f5275e8395f6afc0e8818eb5ba6a013aeb53763f7c2c7a8ed81445a8", + "public_sha256": "e4a5e968ee2ab2a77f89f46a5bcea52eaa3358a2ce023b40a0e801fd3fef4f9f", + "normalization": "container home replaced with " + }, + { + "phase": "disposable-runtime-parity-981-v2", + "file": "disposable-runtime-parity-981-v2-resources.json", + "source_name": "resources.json", + "original_sha256": "19ff84de7368524dc0f4b198a2d035e9987289e6fd310e2e11861b0eb09de2df", + "public_sha256": "94bfc2923ff688cbb243eb4bc69d056a84af25cc4706e545cb597a43a7d2baae", + "normalization": "container home replaced with " + } +] diff --git a/test/type-check/packed-disposable/advanced.ts b/test/type-check/packed-disposable/advanced.ts new file mode 100644 index 000000000..498c5f7b8 --- /dev/null +++ b/test/type-check/packed-disposable/advanced.ts @@ -0,0 +1,3 @@ +import { createObserver, reading } from "@git-stunts/git-warp/advanced"; +void createObserver; +void reading; diff --git a/test/type-check/packed-disposable/charts.ts b/test/type-check/packed-disposable/charts.ts new file mode 100644 index 000000000..1aa30176a --- /dev/null +++ b/test/type-check/packed-disposable/charts.ts @@ -0,0 +1,2 @@ +import { graph } from "@git-stunts/git-warp/charts"; +void graph; diff --git a/test/type-check/packed-disposable/combined.ts b/test/type-check/packed-disposable/combined.ts new file mode 100644 index 000000000..21d2628d6 --- /dev/null +++ b/test/type-check/packed-disposable/combined.ts @@ -0,0 +1,5 @@ +import { Runtime } from "@git-stunts/git-warp"; +import { createObserver } from "@git-stunts/git-warp/advanced"; +declare const runtime: Runtime; +void runtime.close(); +void createObserver; diff --git a/test/type-check/packed-disposable/diagnostics.ts b/test/type-check/packed-disposable/diagnostics.ts new file mode 100644 index 000000000..5016d1909 --- /dev/null +++ b/test/type-check/packed-disposable/diagnostics.ts @@ -0,0 +1,2 @@ +import { inspectReceipt } from "@git-stunts/git-warp/diagnostics"; +void inspectReceipt; diff --git a/test/type-check/packed-disposable/lifecycle.mjs b/test/type-check/packed-disposable/lifecycle.mjs new file mode 100644 index 000000000..a223a7810 --- /dev/null +++ b/test/type-check/packed-disposable/lifecycle.mjs @@ -0,0 +1,25 @@ +import assert from 'node:assert/strict'; +import { stdout } from 'node:process'; +import { createRuntimeHarness } from '@git-stunts/git-warp/testing'; + +for (const mode of ['close', 'dispose', 'concurrent']) { + const harness = await createRuntimeHarness({ writer: 'disposable-consumer' }); + try { + const runtime = harness.runtime; + assert.equal(typeof runtime[Symbol.asyncDispose], 'function'); + if (mode === 'close') { + const closing = runtime.close(); + assert.equal(runtime.close(), closing); + await closing; + } else if (mode === 'dispose') { + await runtime[Symbol.asyncDispose](); + await runtime[Symbol.asyncDispose](); + } else { + await Promise.all([runtime.close(), runtime[Symbol.asyncDispose](), runtime.close()]); + } + await assert.rejects(runtime.lane('closed'), { code: 'E_RUNTIME_CLOSED' }); + stdout.write(`PACKED_DISPOSABLE_LIFECYCLE ${mode} PASS\n`); + } finally { + await harness.close(); + } +} diff --git a/test/type-check/packed-disposable/package.json b/test/type-check/packed-disposable/package.json new file mode 100644 index 000000000..f84528506 --- /dev/null +++ b/test/type-check/packed-disposable/package.json @@ -0,0 +1 @@ +{"private":true,"type":"module"} diff --git a/test/type-check/packed-disposable/root-close.ts b/test/type-check/packed-disposable/root-close.ts new file mode 100644 index 000000000..e900a3181 --- /dev/null +++ b/test/type-check/packed-disposable/root-close.ts @@ -0,0 +1,3 @@ +import { Runtime } from "@git-stunts/git-warp"; +declare const runtime: Runtime; +void runtime.close(); diff --git a/test/type-check/packed-disposable/root-dispose.ts b/test/type-check/packed-disposable/root-dispose.ts new file mode 100644 index 000000000..59ed460ff --- /dev/null +++ b/test/type-check/packed-disposable/root-dispose.ts @@ -0,0 +1,3 @@ +import { Runtime } from "@git-stunts/git-warp"; +declare const runtime: Runtime; +void runtime[Symbol.asyncDispose](); diff --git a/test/type-check/packed-disposable/testing.ts b/test/type-check/packed-disposable/testing.ts new file mode 100644 index 000000000..25f8ca32a --- /dev/null +++ b/test/type-check/packed-disposable/testing.ts @@ -0,0 +1,5 @@ +import { createRuntimeHarness, type RuntimeHarness } from "@git-stunts/git-warp/testing"; +declare const harness: RuntimeHarness; +void harness.runtime.close(); +void harness.runtime[Symbol.asyncDispose](); +void createRuntimeHarness; diff --git a/test/type-check/packed-disposable/tsconfig.advanced.json b/test/type-check/packed-disposable/tsconfig.advanced.json new file mode 100644 index 000000000..02489f832 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.advanced.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "advanced.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.base.json b/test/type-check/packed-disposable/tsconfig.base.json new file mode 100644 index 000000000..06cf00ab5 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.base.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], + "types": [], + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "skipLibCheck": false, + "noEmit": true + } +} diff --git a/test/type-check/packed-disposable/tsconfig.charts.json b/test/type-check/packed-disposable/tsconfig.charts.json new file mode 100644 index 000000000..c8836759b --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.charts.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "charts.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.combined.json b/test/type-check/packed-disposable/tsconfig.combined.json new file mode 100644 index 000000000..815e2997b --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.combined.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "combined.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.diagnostics.json b/test/type-check/packed-disposable/tsconfig.diagnostics.json new file mode 100644 index 000000000..b86f7db71 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.diagnostics.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "diagnostics.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.explicit-disposable.json b/test/type-check/packed-disposable/tsconfig.explicit-disposable.json new file mode 100644 index 000000000..9b6294962 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.explicit-disposable.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable", + "ESNext.Disposable" + ] + }, + "files": [ + "root-dispose.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.root-close.json b/test/type-check/packed-disposable/tsconfig.root-close.json new file mode 100644 index 000000000..fa85e4063 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.root-close.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "root-close.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.root-dispose.json b/test/type-check/packed-disposable/tsconfig.root-dispose.json new file mode 100644 index 000000000..7ce6d56f8 --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.root-dispose.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "root-dispose.ts" + ] +} diff --git a/test/type-check/packed-disposable/tsconfig.testing.json b/test/type-check/packed-disposable/tsconfig.testing.json new file mode 100644 index 000000000..6acb24aaf --- /dev/null +++ b/test/type-check/packed-disposable/tsconfig.testing.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "testing.ts" + ] +}