From 151d5dda99c9fece70aa737507472746777391af Mon Sep 17 00:00:00 2001 From: m4air Date: Wed, 4 Nov 2026 23:33:20 -0800 Subject: [PATCH] ci(release): sync main's workflows onto release/v1.4.250 The v1.4.250 tag push was rejected twice: GitHub timed out deciding whether the tag changed workflow files relative to main, where #38130 changed 39 of them. Take main's .github/workflows as-is so the tag carries no workflow differences. release-policy.yml also checks out this tree's pre-#38130 release-tag-patterns.mjs path, since release events run it from the tag. Composite actions and scripts stay at this tree's versions to match its script layout. --- .github/workflows/adhoc-mac-build.yml | 22 +++-- .../ci-cache-warmup-platform-jobs.yml | 20 ++-- .../workflows/ci-cache-warmup-platforms.yml | 57 ++++++------ .github/workflows/ci-cache-warmup.yml | 28 +++--- .github/workflows/ci-runner-demand.yml | 2 +- .github/workflows/ci-xterm-cache.yml | 6 +- .github/workflows/computer-e2e.yml | 14 +-- .github/workflows/computer-macos-native.yml | 10 +- .github/workflows/daily-mac-build.yml | 4 +- .github/workflows/dependency-security.yml | 2 +- .github/workflows/dev-channel-win-build.yml | 10 +- .github/workflows/e2e.yml | 63 +++++++++---- .github/workflows/hourly-mac-build.yml | 4 +- .github/workflows/macos-updater-tests.yml | 2 +- .github/workflows/mobile.yml | 25 ++--- .github/workflows/node-server-tests.yml | 40 ++++---- .github/workflows/packaged-browser-e2e.yml | 2 +- .github/workflows/pr.yml | 91 ++++++++++--------- .github/workflows/preflight-benchmark.yml | 10 +- .../preflight-critical-path-benchmark.yml | 4 +- .../workflows/qualified-orcad-template.yml | 2 +- .github/workflows/release-cut.yml | 30 ++++-- .../release-javascript-benchmark.yml | 19 +++- .github/workflows/release-javascript.yml | 17 +++- .github/workflows/release-mac-build.yml | 10 +- .github/workflows/release-policy.yml | 1 + .github/workflows/ssh-hostile-hosts.yml | 19 ++-- .github/workflows/ssh-windows-hosts.yml | 28 +++--- .github/workflows/terminal-perf.yml | 4 +- .github/workflows/unit-plan.yml | 6 +- .github/workflows/unit-selection-evidence.yml | 6 +- .github/workflows/unit-tests.yml | 14 +-- .github/workflows/win-crash-survival-e2e.yml | 2 +- .../workflows/win-orcad-serve-switch-e2e.yml | 8 +- .github/workflows/win-update-survival-e2e.yml | 2 +- .../windows-native-preparation-benchmark.yml | 2 +- .../workflows/windows-signing-rehearsal.yml | 4 +- .../workflows/windows-typecheck-parity.yml | 8 +- .github/workflows/wsl-orcad-e2e.yml | 2 +- 39 files changed, 345 insertions(+), 255 deletions(-) diff --git a/.github/workflows/adhoc-mac-build.yml b/.github/workflows/adhoc-mac-build.yml index fb9cbaff03f..4babea3e568 100644 --- a/.github/workflows/adhoc-mac-build.yml +++ b/.github/workflows/adhoc-mac-build.yml @@ -126,7 +126,7 @@ jobs: id: detect shell: bash run: | - if [[ -f config/scripts/packaged-orcad-template.cjs ]]; then + if [[ -f config/scripts/orcad-distribution/template/packaged-orcad-template.cjs || -f config/scripts/packaged-orcad-template.cjs ]]; then echo "ships=true" >>"$GITHUB_OUTPUT" else echo "ships=false" >>"$GITHUB_OUTPUT" @@ -151,7 +151,7 @@ jobs: set -euo pipefail # Old branch refs may predate adhoc version scripts; report that explicitly. for script in adhoc-build-version dev-channel-base-version; do - if [[ ! -f "config/scripts/$script.mjs" ]]; then + if [[ ! -f "config/scripts/release/versioning/$script.mjs" && ! -f "config/scripts/$script.mjs" ]]; then echo "::error::$REF has no config/scripts/$script.mjs; rebase it onto a main that has the adhoc channel." exit 1 fi @@ -162,7 +162,7 @@ jobs: "repos/$GITHUB_REPOSITORY/git/matching-refs/tags/v" \ --jq '.[].ref | sub("^refs/tags/"; "")' || true)" ORCA_PUBLISHED_VERSIONS="$published" ORCA_ADHOC_LABEL="${LABEL:-$REF}" \ - node config/scripts/adhoc-build-version.mjs \ + node "$(if [ -f config/scripts/release/versioning/adhoc-build-version.mjs ]; then printf %s config/scripts/release/versioning/adhoc-build-version.mjs; else printf %s config/scripts/adhoc-build-version.mjs; fi)" \ >"$RUNNER_TEMP/adhoc-identity.txt" if ! grep -q '^name=' "$RUNNER_TEMP/adhoc-identity.txt"; then echo "::error::adhoc-build-version.mjs emitted no release name; $REF's copy of the script is out of sync with this workflow." @@ -371,7 +371,11 @@ jobs: - name: Build app run: | if [[ "$ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA" != '' ]]; then - node config/scripts/release-javascript-artifact.mjs restore + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + node "$RELEASE_JAVASCRIPT_ARTIFACT" restore pnpm run build:release:host else pnpm build:release @@ -397,7 +401,7 @@ jobs: with: ref: ${{ github.workflow_sha }} path: .workflow-tools - sparse-checkout: config/scripts/adhoc-mac-manifests.mjs + sparse-checkout: config/scripts/desktop-distribution/macos/adhoc-mac-manifests.mjs sparse-checkout-cone-mode: false persist-credentials: false @@ -408,7 +412,7 @@ jobs: timeout_minutes: 45 max_attempts: 2 retry_wait_seconds: 30 - command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON config/scripts/pinned-node-downloads.mjs darwin-arm64 darwin-x64 && node config/scripts/ensure-native-runtime.mjs --runtime=electron && ORCA_MAC_ADHOC=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac dmg zip --${{ matrix.arch }} --publish never + command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON "$(if [ -f config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs; else printf %s config/scripts/pinned-node-downloads.mjs; fi)" darwin-arm64 darwin-x64 && node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && ORCA_MAC_ADHOC=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac dmg zip --${{ matrix.arch }} --publish never env: ORCA_ADHOC_BUILD_VERSION: ${{ needs.orcad-template-support.outputs.version }} ORCA_BUILD_COMMIT: ${{ needs.orcad-template-support.outputs.commit }} @@ -436,7 +440,7 @@ jobs: env: MAC_ARCH: ${{ matrix.arch }} MAC_VERSION: ${{ needs.orcad-template-support.outputs.version }} - run: node .workflow-tools/config/scripts/adhoc-mac-manifests.mjs stage "$MAC_ARCH" "$MAC_VERSION" dist .build/mac-manifests + run: node .workflow-tools/config/scripts/desktop-distribution/macos/adhoc-mac-manifests.mjs stage "$MAC_ARCH" "$MAC_VERSION" dist .build/mac-manifests - name: Mint adhoc repo token id: app_token @@ -501,7 +505,7 @@ jobs: uses: actions/checkout@v6 with: ref: ${{ github.workflow_sha }} - sparse-checkout: config/scripts/adhoc-mac-manifests.mjs + sparse-checkout: config/scripts/desktop-distribution/macos/adhoc-mac-manifests.mjs sparse-checkout-cone-mode: false persist-credentials: false @@ -520,7 +524,7 @@ jobs: run: | set -euo pipefail gh release view "$TAG" --repo "$ADHOC_REPO" --json assets > .build/mac-manifests/assets.json - node config/scripts/adhoc-mac-manifests.mjs merge "$MAC_VERSION" .build/mac-manifests + node "$(if [ -f config/scripts/desktop-distribution/macos/adhoc-mac-manifests.mjs ]; then printf %s config/scripts/desktop-distribution/macos/adhoc-mac-manifests.mjs; else printf %s config/scripts/adhoc-mac-manifests.mjs; fi)" merge "$MAC_VERSION" .build/mac-manifests gh release upload "$TAG" .build/mac-manifests/latest-mac.yml --repo "$ADHOC_REPO" --clobber - name: Confirm final template qualification before publication diff --git a/.github/workflows/ci-cache-warmup-platform-jobs.yml b/.github/workflows/ci-cache-warmup-platform-jobs.yml index 91fa1eac53b..c8aa345bb88 100644 --- a/.github/workflows/ci-cache-warmup-platform-jobs.yml +++ b/.github/workflows/ci-cache-warmup-platform-jobs.yml @@ -41,9 +41,9 @@ jobs: cache-pnpm-store-lookup-only: 'true' - name: Populate shared Electron archive if: startsWith(matrix.runner, 'blacksmith-') - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs - name: Verify native cache is usable - run: node config/scripts/ensure-native-runtime.mjs --check-only + run: node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --check-only # node-server's hosted macOS lane needs nothing; this serves hosted macOS PR contracts and updater tests. warm-macos-runtime: @@ -67,9 +67,9 @@ jobs: cache-electron-package: 'true' cache-pnpm-store: 'false' - name: Populate shared Electron archive - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs - name: Verify native cache is usable - run: node config/scripts/ensure-native-runtime.mjs --check-only + run: node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --check-only warm-windows: concurrency: @@ -93,13 +93,13 @@ jobs: # Windows PR consumers download packages directly; retain only the build caches. cache-pnpm-store: 'false' - name: Verify native cache is usable - run: node config/scripts/ensure-native-runtime.mjs --check-only + run: node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --check-only - name: Resolve the Windows Rust build scope id: rust-scope if: runner.arch == 'X64' && matrix.os != 'windows-2025' shell: bash - run: node config/scripts/windows-rust-build-scope.mjs >> "$GITHUB_OUTPUT" + run: node config/scripts/native-build/windows/windows-rust-build-scope.mjs >> "$GITHUB_OUTPUT" - name: Cache Windows CLI launcher if: runner.arch == 'X64' && matrix.os != 'windows-2025' @@ -111,7 +111,7 @@ jobs: native/windows-agent-hook/.build native/windows-agent-hook/target ~/.cargo/registry - key: windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}-${{ steps.rust-scope.outputs.app-version }}-${{ hashFiles('native/windows-cli-launcher/src/**', 'native/windows-cli-launcher/build.rs', 'native/windows-cli-launcher/Cargo.toml', 'native/windows-cli-launcher/Cargo.lock', 'native/windows-cli-launcher/app.manifest', 'native/windows-cli-launcher/.cargo/**', 'native/windows-agent-hook/src/**', 'native/windows-agent-hook/build.rs', 'native/windows-agent-hook/Cargo.toml', 'native/windows-agent-hook/Cargo.lock', 'native/windows-agent-hook/app.manifest', 'native/windows-agent-hook/.cargo/**', 'config/scripts/build-windows-cli-launcher.mjs', 'config/scripts/build-windows-agent-hook.mjs', 'config/scripts/windows-rust-executable-build.mjs', 'config/scripts/windows-pe-imports.mjs', 'resources/build/icon.ico') }} + key: windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}-${{ steps.rust-scope.outputs.app-version }}-${{ hashFiles('native/windows-cli-launcher/src/**', 'native/windows-cli-launcher/build.rs', 'native/windows-cli-launcher/Cargo.toml', 'native/windows-cli-launcher/Cargo.lock', 'native/windows-cli-launcher/app.manifest', 'native/windows-cli-launcher/.cargo/**', 'native/windows-agent-hook/src/**', 'native/windows-agent-hook/build.rs', 'native/windows-agent-hook/Cargo.toml', 'native/windows-agent-hook/Cargo.lock', 'native/windows-agent-hook/app.manifest', 'native/windows-agent-hook/.cargo/**', 'config/scripts/native-build/windows/build-windows-cli-launcher.mjs', 'config/scripts/native-build/windows/build-windows-agent-hook.mjs', 'config/scripts/native-build/windows/windows-rust-executable-build.mjs', 'config/scripts/native-build/windows/windows-pe-imports.mjs', 'resources/build/icon.ico') }} restore-keys: | windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}- @@ -119,9 +119,9 @@ jobs: if: runner.arch == 'X64' && matrix.os != 'windows-2025' shell: pwsh run: | - node config/scripts/build-windows-agent-hook.mjs + node config/scripts/native-build/windows/build-windows-agent-hook.mjs if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - node config/scripts/build-windows-cli-launcher.mjs + node config/scripts/native-build/windows/build-windows-cli-launcher.mjs if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - name: Warm the Windows ARM server launcher @@ -153,7 +153,7 @@ jobs: if: >- github.event_name != 'pull_request' && matrix.os != 'windows-2025' && steps.orcad-prebuild.outputs.cache-hit != 'true' && steps.orcad-prebuild.outputs.cache-key != '' - run: node config/scripts/orcad-windows-prebuild-cache.mjs --validate + run: node config/scripts/orcad-distribution/prebuilds/orcad-windows-prebuild-cache.mjs --validate - name: Save the Windows server prebuild if: steps.orcad-prebuild-validate.outcome == 'success' continue-on-error: true diff --git a/.github/workflows/ci-cache-warmup-platforms.yml b/.github/workflows/ci-cache-warmup-platforms.yml index b1d6a7c726b..abb7fff7024 100644 --- a/.github/workflows/ci-cache-warmup-platforms.yml +++ b/.github/workflows/ci-cache-warmup-platforms.yml @@ -12,21 +12,22 @@ on: - '.github/actions/prepare-native-runtime/**' - '.github/actions/prepare-windows-cli-launcher/**' - '.github/actions/prepare-windows-agent-hook/**' - - 'config/scripts/windows-rust-build-scope.mjs' + - 'config/scripts/native-build/windows/windows-rust-build-scope.mjs' - '.github/actions/prepare-orcad-prebuilds/**' - - 'config/scripts/native-dependency-lock-digest.mjs' - - 'config/scripts/orcad-windows-prebuild-cache.mjs' - - 'config/scripts/shared-native-build.mjs' - - 'config/scripts/shared-tree-publish.mjs' + - 'config/scripts/native-build/node-addons/native-dependency-lock-digest.mjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-windows-prebuild-cache.mjs' + - 'config/scripts/native-build/node-addons/shared-native-build.mjs' + - 'config/scripts/artifact-storage/atomic-publication/shared-tree-publish.mjs' - 'config/scripts/native-build-entry*.cjs' - - 'config/scripts/orcad-prebuild-node-gyp.mjs' - - 'config/scripts/msbuild-file-tracking.mjs' - - 'config/scripts/windows-pe-imports.mjs' - - 'config/scripts/build-orcad-prebuilds.mjs' - - 'config/scripts/orcad-prebuild-slot-contents.mjs' - - 'config/scripts/pinned-node-downloads.mjs' - - 'config/scripts/update-node-runtime-pin.mjs' - - 'config/scripts/build-workspace-packages.mjs' + - 'config/scripts/native-build/node-addons/native-build-entry*.cjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-prebuild-node-gyp.mjs' + - 'config/scripts/native-build/windows/msbuild-file-tracking.mjs' + - 'config/scripts/native-build/windows/windows-pe-imports.mjs' + - 'config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-prebuild-slot-contents.mjs' + - 'config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs' + - 'config/scripts/node-runtime/archive-identity/update-node-runtime-pin.mjs' + - 'config/scripts/workspace-package-build/build-workspace-packages.mjs' - 'src/shared/node-runtime-pin.ts' - 'src/packages/process-host/**' - '.github/actions/prepare-git-compatibility/**' @@ -39,28 +40,28 @@ on: - 'pnpm-workspace.yaml' - '.npmrc' - 'config/pnpmfile.cjs' - - 'config/scripts/ensure-native-runtime.mjs' - - 'config/scripts/initialize-windows-native-toolchain.mjs' - - 'config/scripts/capture-windows-native-environment.cmd' - - 'config/scripts/rebuild-native-deps.mjs' - - 'config/scripts/node-pty-job-ownership.cjs' - - 'config/scripts/windows-pe-machine.cjs' - - 'config/scripts/windows-process-tree-gyp-rebuild.mjs' - - 'config/scripts/windows-process-tree-creation-time.cjs' - - 'config/scripts/install-electron-package-binary.mjs' - - 'config/scripts/electron-platform-path.mjs' + - 'config/scripts/native-build/node-addons/ensure-native-runtime.mjs' + - 'config/scripts/native-build/windows/initialize-windows-native-toolchain.mjs' + - 'config/scripts/native-build/windows/capture-windows-native-environment.cmd' + - 'config/scripts/native-build/node-addons/rebuild-native-deps.mjs' + - 'config/scripts/native-build/node-addons/node-pty-job-ownership.cjs' + - 'config/scripts/native-build/windows/windows-pe-machine.cjs' + - 'config/scripts/native-build/windows/windows-process-tree-gyp-rebuild.mjs' + - 'config/scripts/native-build/windows/windows-process-tree-creation-time.cjs' + - 'config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs' + - 'config/scripts/electron-installation/platform-layout/electron-platform-path.mjs' - 'config/scripts/zip-extractor-command.mjs' - 'src/shared/zip-extractor-command.ts' - - 'config/scripts/shared-electron-dist-cache.mjs' - - 'config/scripts/space-sharing-copy.mjs' + - 'config/scripts/electron-installation/shared-dist-cache/shared-electron-dist-cache.mjs' + - 'config/scripts/artifact-storage/reflink-copy/space-sharing-copy.mjs' - 'config/patches/**' - 'native/windows-registry/**' - 'native/windows-security/**' - 'native/windows-cli-launcher/**' - 'native/windows-agent-hook/**' - - 'config/scripts/build-windows-cli-launcher.mjs' - - 'config/scripts/build-windows-agent-hook.mjs' - - 'config/scripts/windows-rust-executable-build.mjs' + - 'config/scripts/native-build/windows/build-windows-cli-launcher.mjs' + - 'config/scripts/native-build/windows/build-windows-agent-hook.mjs' + - 'config/scripts/native-build/windows/windows-rust-executable-build.mjs' - 'resources/build/icon.ico' - 'mobile/Gemfile' - 'mobile/Gemfile.lock' diff --git a/.github/workflows/ci-cache-warmup.yml b/.github/workflows/ci-cache-warmup.yml index bebeccef358..89ae707f579 100644 --- a/.github/workflows/ci-cache-warmup.yml +++ b/.github/workflows/ci-cache-warmup.yml @@ -21,7 +21,7 @@ on: - '.github/actions/prepare-linux-package-fixture/**' - '.github/actions/prepare-wayland-clipboard/**' - 'native/wayland-clipboard/**' - - 'config/scripts/build-wayland-clipboard.mjs' + - 'config/scripts/native-build/linux/build-wayland-clipboard.mjs' - 'config/docker/headless-serve-shutdown/**' - 'config/docker/cli-launch-contract/**' - 'config/docker/daemon-shutdown-descendants/**' @@ -30,20 +30,20 @@ on: - 'pnpm-workspace.yaml' - '.npmrc' - 'config/pnpmfile.cjs' - - 'config/scripts/ensure-native-runtime.mjs' - - 'config/scripts/initialize-windows-native-toolchain.mjs' - - 'config/scripts/capture-windows-native-environment.cmd' - - 'config/scripts/rebuild-native-deps.mjs' - - 'config/scripts/node-pty-job-ownership.cjs' - - 'config/scripts/windows-pe-machine.cjs' - - 'config/scripts/windows-process-tree-gyp-rebuild.mjs' - - 'config/scripts/windows-process-tree-creation-time.cjs' - - 'config/scripts/install-electron-package-binary.mjs' - - 'config/scripts/electron-platform-path.mjs' + - 'config/scripts/native-build/node-addons/ensure-native-runtime.mjs' + - 'config/scripts/native-build/windows/initialize-windows-native-toolchain.mjs' + - 'config/scripts/native-build/windows/capture-windows-native-environment.cmd' + - 'config/scripts/native-build/node-addons/rebuild-native-deps.mjs' + - 'config/scripts/native-build/node-addons/node-pty-job-ownership.cjs' + - 'config/scripts/native-build/windows/windows-pe-machine.cjs' + - 'config/scripts/native-build/windows/windows-process-tree-gyp-rebuild.mjs' + - 'config/scripts/native-build/windows/windows-process-tree-creation-time.cjs' + - 'config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs' + - 'config/scripts/electron-installation/platform-layout/electron-platform-path.mjs' - 'config/scripts/zip-extractor-command.mjs' - 'src/shared/zip-extractor-command.ts' - - 'config/scripts/shared-electron-dist-cache.mjs' - - 'config/scripts/space-sharing-copy.mjs' + - 'config/scripts/electron-installation/shared-dist-cache/shared-electron-dist-cache.mjs' + - 'config/scripts/artifact-storage/reflink-copy/space-sharing-copy.mjs' - 'config/patches/**' - 'native/windows-registry/**' - 'native/windows-security/**' @@ -97,7 +97,7 @@ jobs: seed: 'true' - name: Populate shared Electron archive - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs - uses: ./.github/actions/prepare-git-compatibility diff --git a/.github/workflows/ci-runner-demand.yml b/.github/workflows/ci-runner-demand.yml index f9f063ff37d..9a9065cf1d7 100644 --- a/.github/workflows/ci-runner-demand.yml +++ b/.github/workflows/ci-runner-demand.yml @@ -25,7 +25,7 @@ jobs: - name: Measure the previous complete 24 hours env: GH_TOKEN: ${{ github.token }} - run: node config/scripts/ci-runner-demand.mjs + run: node config/scripts/ci/runner-capacity/ci-runner-demand.mjs - uses: actions/upload-artifact@v7 with: name: ci-runner-demand-${{ github.run_id }} diff --git a/.github/workflows/ci-xterm-cache.yml b/.github/workflows/ci-xterm-cache.yml index dc0b17bcbcd..8d02e7a5381 100644 --- a/.github/workflows/ci-xterm-cache.yml +++ b/.github/workflows/ci-xterm-cache.yml @@ -6,8 +6,8 @@ on: - '.github/workflows/ci-xterm-cache.yml' - '.github/actions/prepare-xterm-dependencies/**' - 'config/patches/xterm-upstream.json' - - 'config/scripts/regenerate-xterm-patches.mjs' - - 'config/scripts/xterm-patch-text.mjs' + - 'config/scripts/terminal-dependencies/xterm-patches/regenerate-xterm-patches.mjs' + - 'config/scripts/terminal-dependencies/xterm-patches/xterm-patch-text.mjs' - 'package.json' # Refresh after Node patch releases or cache eviction without rebuilding on hits. schedule: @@ -46,7 +46,7 @@ jobs: id: cache - name: Verify and populate dependencies if: steps.cache.outputs.cache-hit != 'true' - run: node config/scripts/regenerate-xterm-patches.mjs --check --work-dir="$RUNNER_TEMP/xterm-patch-build" + run: node config/scripts/terminal-dependencies/xterm-patches/regenerate-xterm-patches.mjs --check --work-dir="$RUNNER_TEMP/xterm-patch-build" - uses: actions/cache/save@v5 if: steps.cache.outputs.cache-hit != 'true' with: diff --git a/.github/workflows/computer-e2e.yml b/.github/workflows/computer-e2e.yml index 15041012d2a..fa2f0b3b7e0 100644 --- a/.github/workflows/computer-e2e.yml +++ b/.github/workflows/computer-e2e.yml @@ -6,13 +6,13 @@ on: paths: - '.github/workflows/computer-e2e.yml' - 'config/electron-builder.config.cjs' - - 'config/scripts/build-computer-macos.mjs' - - 'config/scripts/build-native-for-platform.mjs' - - 'config/scripts/build-native-for-platform.test.mjs' - - 'config/scripts/pnpm-cli-invocation.mjs' - - 'config/scripts/build-windows-cli-launcher.mjs' - - 'config/scripts/windows-rust-executable-build.mjs' - - 'config/scripts/build-windows-cli-launcher.test.mjs' + - 'config/scripts/native-build/macos/build-computer-macos.mjs' + - 'config/scripts/native-build/composition/build-native-for-platform.mjs' + - 'config/scripts/native-build/composition/build-native-for-platform.test.mjs' + - 'config/scripts/tool-invocation/pnpm-cli-invocation.mjs' + - 'config/scripts/native-build/windows/build-windows-cli-launcher.mjs' + - 'config/scripts/native-build/windows/windows-rust-executable-build.mjs' + - 'config/scripts/native-build/windows/build-windows-cli-launcher.test.mjs' - 'config/scripts/macos-computer-helper-owner-loss-benchmark.mjs' - 'config/scripts/macos-computer-helper-owner-loss-group-recovery.test.mjs' - 'config/scripts/macos-computer-helper-owner-loss-metrics.mjs' diff --git a/.github/workflows/computer-macos-native.yml b/.github/workflows/computer-macos-native.yml index 4a49c77c9d7..a18fdb23b8a 100644 --- a/.github/workflows/computer-macos-native.yml +++ b/.github/workflows/computer-macos-native.yml @@ -9,10 +9,10 @@ on: - '.github/workflows/computer-macos-native.yml' - 'electron.vite.config.ts' - 'config/build-plugins/**' - - 'config/scripts/build-computer-macos.mjs' - - 'config/scripts/build-native-for-platform.mjs' - - 'config/scripts/build-native-for-platform.test.mjs' - - 'config/scripts/pnpm-cli-invocation.mjs' + - 'config/scripts/native-build/macos/build-computer-macos.mjs' + - 'config/scripts/native-build/composition/build-native-for-platform.mjs' + - 'config/scripts/native-build/composition/build-native-for-platform.test.mjs' + - 'config/scripts/tool-invocation/pnpm-cli-invocation.mjs' - 'config/scripts/macos-computer-helper-owner-loss-*' - 'config/scripts/verify-computer-native.mjs' - 'native/computer-use-macos/**' @@ -57,7 +57,7 @@ jobs: - name: Parallel native build launcher cancellation run: >- pnpm vitest run --config config/vitest.config.ts - config/scripts/build-native-for-platform.test.mjs + config/scripts/native-build/composition/build-native-for-platform.test.mjs - name: Authenticated helper owner-loss smoke run: pnpm bench:macos-computer-helper-owner-loss --expect reaped --trials 1 - name: Swift tests and signed universal helper verification diff --git a/.github/workflows/daily-mac-build.yml b/.github/workflows/daily-mac-build.yml index 6707a9a7777..b10859e58f4 100644 --- a/.github/workflows/daily-mac-build.yml +++ b/.github/workflows/daily-mac-build.yml @@ -219,7 +219,7 @@ jobs: published="$main_tags"$'\n'"$channel_tags" echo "Published version sources: $(grep -c . <<<"$main_tags" || true) main tags, $(grep -c . <<<"$channel_tags" || true) channel tags" ORCA_PUBLISHED_VERSIONS="$published" ORCA_DAILY_RELEASE_NAMES="$names" \ - node config/scripts/daily-build-version.mjs \ + node "$(if [ -f config/scripts/release/versioning/daily-build-version.mjs ]; then printf %s config/scripts/release/versioning/daily-build-version.mjs; else printf %s config/scripts/daily-build-version.mjs; fi)" \ >"$RUNNER_TEMP/daily-identity.txt" grep -E '^(version|build_number)=' "$RUNNER_TEMP/daily-identity.txt" # Dispatch YAML can be newer than the pinned source’s version script; reject missing output before publishing an untitled release. @@ -304,7 +304,7 @@ jobs: timeout_minutes: 45 max_attempts: 2 retry_wait_seconds: 30 - command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON config/scripts/pinned-node-downloads.mjs darwin-arm64 darwin-x64 && node config/scripts/ensure-native-runtime.mjs --runtime=electron && if [ -f config/scripts/build-mac-notarization-overlap.mjs ]; then ORCA_MAC_DAILY=1 node config/scripts/build-mac-notarization-overlap.mjs --publish always; else ORCA_MAC_DAILY=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish always; fi + command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON "$(if [ -f config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs; else printf %s config/scripts/pinned-node-downloads.mjs; fi)" darwin-arm64 darwin-x64 && node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && if { [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ] || [ -f config/scripts/build-mac-notarization-overlap.mjs ]; }; then ORCA_MAC_DAILY=1 node "$(if [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ]; then printf %s config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs; else printf %s config/scripts/build-mac-notarization-overlap.mjs; fi)" --publish always; else ORCA_MAC_DAILY=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish always; fi env: # Give the publisher App write access to its configured orca-daily target. GH_TOKEN: ${{ steps.app_token_publish.outputs.token }} diff --git a/.github/workflows/dependency-security.yml b/.github/workflows/dependency-security.yml index 1e1013b8f04..8db6248c50b 100644 --- a/.github/workflows/dependency-security.yml +++ b/.github/workflows/dependency-security.yml @@ -13,7 +13,7 @@ on: - 'config/dependency-security-exceptions.json' - 'config/cargo-deny.toml' - 'config/scripts/*dependency-security*' - - 'config/scripts/pnpm-cli-invocation.mjs' + - 'config/scripts/tool-invocation/pnpm-cli-invocation.mjs' - 'config/pnpmfile.cjs' - '**/patches/**' - '.github/workflows/dependency-security.yml' diff --git a/.github/workflows/dev-channel-win-build.yml b/.github/workflows/dev-channel-win-build.yml index a7ae8202980..fa141d08ca3 100644 --- a/.github/workflows/dev-channel-win-build.yml +++ b/.github/workflows/dev-channel-win-build.yml @@ -241,7 +241,11 @@ jobs: shell: bash run: | if [[ "$ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA" != '' ]]; then - node config/scripts/release-javascript-artifact.mjs restore + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + node "$RELEASE_JAVASCRIPT_ARTIFACT" restore pnpm run build:release:host else pnpm build:release @@ -317,7 +321,7 @@ jobs: timeout_minutes: 30 max_attempts: 2 retry_wait_seconds: 30 - command: node config/scripts/ensure-native-runtime.mjs --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish always + command: node $(if (Test-Path config/scripts/native-build/node-addons/ensure-native-runtime.mjs) { "config/scripts/native-build/node-addons/ensure-native-runtime.mjs" } else { "config/scripts/ensure-native-runtime.mjs" }) --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish always env: GH_TOKEN: ${{ steps.app_token.outputs.token }} ORCA_BUILD_COMMIT: ${{ inputs.ref }} @@ -352,7 +356,7 @@ jobs: timeout_minutes: 30 max_attempts: 2 retry_wait_seconds: 30 - command: node config/scripts/ensure-native-runtime.mjs --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never + command: node $(if (Test-Path config/scripts/native-build/node-addons/ensure-native-runtime.mjs) { "config/scripts/native-build/node-addons/ensure-native-runtime.mjs" } else { "config/scripts/ensure-native-runtime.mjs" }) --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never env: ORCA_BUILD_COMMIT: ${{ inputs.ref }} ORCA_REQUIRE_ORCAD_TEMPLATE: ${{ inputs.orcad_template && '1' || '' }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e263d7046a8..a9901c36161 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -105,7 +105,10 @@ jobs: fi node --input-type=module <<'NODE' import { appendFileSync, existsSync } from 'node:fs' - const modulePath = './config/scripts/ci-e2e-job-selection.mjs' + const canonicalModulePath = './config/scripts/ci/e2e-selection/ci-e2e-job-selection.mjs' + const modulePath = existsSync(canonicalModulePath) + ? canonicalModulePath + : './config/scripts/ci-e2e-job-selection.mjs' const selection = existsSync(modulePath) ? await import(modulePath) : {} const shards = selection.generalE2eShards?.(process.env.TEST_FILES_JSON) ?? ['1/1'] appendFileSync(process.env.GITHUB_OUTPUT, `shards=${JSON.stringify(shards)}\n`) @@ -298,12 +301,16 @@ jobs: ORCA_E2E_FORWARD_APP_LOGS: '1' ORCA_E2E_WEB_CLIENT: '1' run: | + E2E_SHARD_PLAN_SCRIPT=config/scripts/ci/e2e-selection/ci-e2e-shard-plan.mjs + if [ ! -f "$E2E_SHARD_PLAN_SCRIPT" ]; then + E2E_SHARD_PLAN_SCRIPT=config/scripts/ci-e2e-shard-plan.mjs + fi mkdir -p ci-shards pnpm exec playwright test --config tests/playwright.config.ts --project=electron-headless --list --reporter=json > ci-shards/discovery.json export ORCA_SHARD_SOURCE_SHA="$(git rev-parse HEAD)" - node config/scripts/ci-e2e-shard-plan.mjs ci-shards/discovery.json '${{ matrix.shard }}' ci-shards + node "$E2E_SHARD_PLAN_SCRIPT" ci-shards/discovery.json '${{ matrix.shard }}' ci-shards pnpm exec playwright test --config tests/playwright.config.ts --project=electron-headless --test-list=ci-shards/selected.txt --list --reporter=json > ci-shards/selected-discovery.json - node config/scripts/ci-e2e-shard-plan.mjs --verify ci-shards/assignment.json ci-shards/selected-discovery.json + node "$E2E_SHARD_PLAN_SCRIPT" --verify ci-shards/assignment.json ci-shards/selected-discovery.json - name: Run E2E tests (${{ matrix.shard_name }}) env: @@ -313,7 +320,12 @@ jobs: - name: Summarize E2E failures if: always() continue-on-error: true - run: node config/scripts/ci-e2e-failure-summary.mjs ci-shards/results.json + run: | + E2E_FAILURE_SUMMARY_SCRIPT=config/scripts/ci/e2e-failures/ci-e2e-failure-summary.mjs + if [ ! -f "$E2E_FAILURE_SUMMARY_SCRIPT" ]; then + E2E_FAILURE_SUMMARY_SCRIPT=config/scripts/ci-e2e-failure-summary.mjs + fi + node "$E2E_FAILURE_SUMMARY_SCRIPT" ci-shards/results.json - name: Upload E2E shard assignment if: always() @@ -380,8 +392,16 @@ jobs: SHARD: ${{ matrix.shard }} TEST_LEVEL_SHARDS: ${{ inputs.changed_e2e_test_shards != '' }} run: | - if [ -f config/scripts/ci-e2e-job-selection.mjs ]; then - printf '%s\n' "$TEST_FILES_JSON" | node config/scripts/ci-e2e-job-selection.mjs > "$RUNNER_TEMP/general-e2e-specs" + E2E_SELECTION_SCRIPT=config/scripts/ci/e2e-selection/ci-e2e-job-selection.mjs + if [ ! -f "$E2E_SELECTION_SCRIPT" ]; then + E2E_SELECTION_SCRIPT=config/scripts/ci-e2e-job-selection.mjs + fi + E2E_SHARD_PLAN_SCRIPT=config/scripts/ci/e2e-selection/ci-e2e-shard-plan.mjs + if [ ! -f "$E2E_SHARD_PLAN_SCRIPT" ]; then + E2E_SHARD_PLAN_SCRIPT=config/scripts/ci-e2e-shard-plan.mjs + fi + if [ -f "$E2E_SELECTION_SCRIPT" ]; then + printf '%s\n' "$TEST_FILES_JSON" | node "$E2E_SELECTION_SCRIPT" > "$RUNNER_TEMP/general-e2e-specs" else # Dispatching an older ref retains its existing dedicated-owner exclusions. jq -r '.[] | select( @@ -418,13 +438,13 @@ jobs: if [ "$TEST_LEVEL_SHARDS" = true ]; then mkdir -p ci-shards-changed pnpm exec playwright test "${TEST_FILES[@]}" --config tests/playwright.config.ts --project=electron-headless "${E2E_PROJECT_ARGS[@]}" --shard="$SHARD" --list --reporter=json > ci-shards-changed/selected-discovery.json - elif [ -f config/scripts/ci-e2e-shard-plan.mjs ]; then + elif [ -f "$E2E_SHARD_PLAN_SCRIPT" ]; then mkdir -p ci-shards-changed pnpm exec playwright test "${TEST_FILES[@]}" --config tests/playwright.config.ts --project=electron-headless "${E2E_PROJECT_ARGS[@]}" --list --reporter=json > ci-shards-changed/discovery.json export ORCA_SHARD_SOURCE_SHA="$(git rev-parse HEAD)" - node config/scripts/ci-e2e-shard-plan.mjs ci-shards-changed/discovery.json "$SHARD" ci-shards-changed + node "$E2E_SHARD_PLAN_SCRIPT" ci-shards-changed/discovery.json "$SHARD" ci-shards-changed pnpm exec playwright test "${TEST_FILES[@]}" --config tests/playwright.config.ts --project=electron-headless "${E2E_PROJECT_ARGS[@]}" --test-list=ci-shards-changed/selected.txt --list --reporter=json > ci-shards-changed/selected-discovery.json - node config/scripts/ci-e2e-shard-plan.mjs --verify ci-shards-changed/assignment.json ci-shards-changed/selected-discovery.json + node "$E2E_SHARD_PLAN_SCRIPT" --verify ci-shards-changed/assignment.json ci-shards-changed/selected-discovery.json E2E_SELECTION_ARGS=(--test-list=ci-shards-changed/selected.txt) fi xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env "${E2E_ENV[@]}" \ @@ -450,7 +470,11 @@ jobs: for run in $(printf '%s\n' "${runs[@]%.jsonl}" | sed 's/-results\.json$//' | sort -u); do node config/scripts/layout-save-divergence-summary.mjs "$run.jsonl" "$run-summary.json" "$run-results.json" if [ -f "$run-results.json" ]; then - node config/scripts/ci-e2e-failure-summary.mjs "$run-results.json" + E2E_FAILURE_SUMMARY_SCRIPT=config/scripts/ci/e2e-failures/ci-e2e-failure-summary.mjs + if [ ! -f "$E2E_FAILURE_SUMMARY_SCRIPT" ]; then + E2E_FAILURE_SUMMARY_SCRIPT=config/scripts/ci-e2e-failure-summary.mjs + fi + node "$E2E_FAILURE_SUMMARY_SCRIPT" "$run-results.json" fi done @@ -524,19 +548,19 @@ jobs: env: LAYOUT_OWNER: ${{ inputs.layout_owner }} run: | - slot="$(node config/scripts/build-orcad-prebuilds.mjs --print-slot)" + slot="$(node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --print-slot)" pnpm build:orcad-prebuilds pnpm build:orcad-prebuilds --require-slots "$slot" # The orcad host and its materialized template must use the Electron host’s layout owner. if [ -n "$LAYOUT_OWNER" ]; then export ORCA_LAYOUT_OWNER="$LAYOUT_OWNER" pnpm build:orcad - node config/scripts/build-orcad-template.mjs --targets "$slot" --dark-test-template + node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets "$slot" --dark-test-template test -f out/orcad/ORCA_LAYOUT_OWNER_MAIN test -f out/orcad-template/ORCA_LAYOUT_OWNER_MAIN else pnpm build:orcad - node config/scripts/build-orcad-template.mjs --targets "$slot" + node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets "$slot" fi - name: Switch serve hosts on one profile if: inputs.test_files == '' || contains(inputs.test_files, 'tests/e2e/orcad-serve-mode-switch.spec.ts') @@ -634,10 +658,10 @@ jobs: pnpm build:orcad-prebuilds pnpm build:orcad-prebuilds --require-slots linux-x64-glibc if [ -n "$LAYOUT_OWNER" ]; then - ORCA_LAYOUT_OWNER="$LAYOUT_OWNER" node config/scripts/build-orcad-template.mjs --targets linux-x64-glibc --dark-test-template + ORCA_LAYOUT_OWNER="$LAYOUT_OWNER" node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets linux-x64-glibc --dark-test-template test -f out/orcad-template/ORCA_LAYOUT_OWNER_MAIN else - node config/scripts/build-orcad-template.mjs --targets linux-x64-glibc + node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets linux-x64-glibc fi mv out/orcad-template "$RUNNER_TEMP/orcad-convert-template" # The Windows CLI matrix collects here too and skips: it needs a Windows host descriptor. @@ -654,7 +678,10 @@ jobs: run: | node --input-type=module <<'NODE' > "$RUNNER_TEMP/managed-ssh-specs" import { existsSync } from 'node:fs' - const modulePath = './config/scripts/ci-e2e-job-selection.mjs' + const canonicalModulePath = './config/scripts/ci/e2e-selection/ci-e2e-job-selection.mjs' + const modulePath = existsSync(canonicalModulePath) + ? canonicalModulePath + : './config/scripts/ci-e2e-job-selection.mjs' const selection = existsSync(modulePath) ? await import(modulePath) : {} // Older checkout refs retain their full-suite behavior. const specs = selection.selectManagedSshE2eSpecs @@ -732,8 +759,8 @@ jobs: pnpm exec electron-vite build --mode e2e pnpm run build:cli pnpm build:orcad - node config/scripts/build-windows-process-tree-addon.mjs --arch=x64 --reuse-prepared-runtime - node config/scripts/build-orcad-template.mjs --targets win32-x64 + node "$(if [ -f config/scripts/native-build/windows/build-windows-process-tree-addon.mjs ]; then printf %s config/scripts/native-build/windows/build-windows-process-tree-addon.mjs; else printf %s config/scripts/build-windows-process-tree-addon.mjs; fi)" --arch=x64 --reuse-prepared-runtime + node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets win32-x64 # A profile-less Windows session has no roaming AppData; Electron 43 used to crash natively there. - name: Start serve with no AppData folder if: inputs.test_files == '' || contains(inputs.test_files, 'tests/e2e/windows-missing-appdata-startup.spec.ts') diff --git a/.github/workflows/hourly-mac-build.yml b/.github/workflows/hourly-mac-build.yml index a20d188d1eb..e74997afb9e 100644 --- a/.github/workflows/hourly-mac-build.yml +++ b/.github/workflows/hourly-mac-build.yml @@ -209,7 +209,7 @@ jobs: published="$main_tags"$'\n'"$channel_tags" echo "Published version sources: $(grep -c . <<<"$main_tags" || true) main tags, $(grep -c . <<<"$channel_tags" || true) channel tags" ORCA_PUBLISHED_VERSIONS="$published" ORCA_HOURLY_RELEASE_NAMES="$names" \ - node config/scripts/hourly-build-version.mjs \ + node "$(if [ -f config/scripts/release/versioning/hourly-build-version.mjs ]; then printf %s config/scripts/release/versioning/hourly-build-version.mjs; else printf %s config/scripts/hourly-build-version.mjs; fi)" \ >"$RUNNER_TEMP/hourly-identity.txt" grep -E '^(version|build_number)=' "$RUNNER_TEMP/hourly-identity.txt" # Dispatch YAML can be newer than the pinned source’s version script; reject missing output before publishing an untitled release. @@ -283,7 +283,7 @@ jobs: timeout_minutes: 45 max_attempts: 2 retry_wait_seconds: 30 - command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON config/scripts/pinned-node-downloads.mjs darwin-arm64 darwin-x64 && node config/scripts/ensure-native-runtime.mjs --runtime=electron && if [ -f config/scripts/build-mac-notarization-overlap.mjs ]; then ORCA_MAC_HOURLY=1 node config/scripts/build-mac-notarization-overlap.mjs --publish always; else ORCA_MAC_HOURLY=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish always; fi + command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON "$(if [ -f config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs; else printf %s config/scripts/pinned-node-downloads.mjs; fi)" darwin-arm64 darwin-x64 && node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && if { [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ] || [ -f config/scripts/build-mac-notarization-overlap.mjs ]; }; then ORCA_MAC_HOURLY=1 node "$(if [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ]; then printf %s config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs; else printf %s config/scripts/build-mac-notarization-overlap.mjs; fi)" --publish always; else ORCA_MAC_HOURLY=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish always; fi env: # Give publisher token write access to configured orca-hourly repo. GH_TOKEN: ${{ steps.app_token_publish.outputs.token }} diff --git a/.github/workflows/macos-updater-tests.yml b/.github/workflows/macos-updater-tests.yml index 4cf67ba3d3f..4c06783ae88 100644 --- a/.github/workflows/macos-updater-tests.yml +++ b/.github/workflows/macos-updater-tests.yml @@ -44,7 +44,7 @@ jobs: native-runtime: node cache-electron-package: 'true' - name: Install the pinned Electron binary for native updater probes - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs - name: Exercise native application registry and update shutdown env: ORCA_BACKGROUND_LAUNCH: '1' diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index cf7201aa91a..6779999e30d 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -46,9 +46,9 @@ on: - 'config/mobile-ci.vitest.config.mjs' - 'config/scripts/run-mobile-ci-tests.mjs' # Mobile typechecks run through the root compiler selection. - - 'config/scripts/run-typecheck-projects-in-parallel.mjs' - - 'config/scripts/tsrs-typecheck-compiler.mjs' - - 'config/scripts/pinned-bun-executable.mjs' + - 'config/scripts/typecheck/project-execution/run-typecheck-projects-in-parallel.mjs' + - 'config/scripts/typecheck/project-execution/tsrs-typecheck-compiler.mjs' + - 'config/scripts/tool-invocation/pinned-bun-executable.mjs' - 'config/oxlint-code-quality-native-plugins.json' - 'config/.bun-version' - '.github/actions/install-node-dependencies/**' @@ -57,10 +57,11 @@ on: - '.github/workflows/mobile-ios-release.yml' - 'config/scripts/mobile-release-check-scope*' - 'config/scripts/mobile-test-change-scope*' - - 'config/scripts/pr-code-change-scope.mjs' - - 'config/scripts/pr-package-test-paths.mjs' - - 'config/scripts/pr-layout-oracle-route.mjs' - - 'config/scripts/pr-shell-contract-prefixes.mjs' + - 'config/scripts/workflow/source-routing/pr-code-change-scope.mjs' + - 'config/scripts/workflow/source-routing/pr-xterm-patch-prefixes.mjs' + - 'config/scripts/workflow/source-routing/pr-package-test-paths.mjs' + - 'config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs' + - 'config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs' # Desktop suites do not feed mobile; keep fixtures and test/toolchain config inputs. - '!src/shared/**/*.test.[jt]s' - '!src/shared/**/*.test.[jt]sx' @@ -108,9 +109,9 @@ on: - '.github/workflows/mobile.yml' - 'config/mobile-ci.vitest.config.mjs' - 'config/scripts/run-mobile-ci-tests.mjs' - - 'config/scripts/run-typecheck-projects-in-parallel.mjs' - - 'config/scripts/tsrs-typecheck-compiler.mjs' - - 'config/scripts/pinned-bun-executable.mjs' + - 'config/scripts/typecheck/project-execution/run-typecheck-projects-in-parallel.mjs' + - 'config/scripts/typecheck/project-execution/tsrs-typecheck-compiler.mjs' + - 'config/scripts/tool-invocation/pinned-bun-executable.mjs' - 'config/.bun-version' - '.github/actions/install-node-dependencies/**' - '.github/actions/setup-pnpm/**' @@ -224,7 +225,7 @@ jobs: - name: Typecheck id: production-types background: true - run: node ../config/scripts/run-typecheck-projects-in-parallel.mjs --compiler=bun --bun-threads=2 --project=mobile/tsconfig.json + run: node ../config/scripts/typecheck/project-execution/run-typecheck-projects-in-parallel.mjs --compiler=bun --bun-threads=2 --project=mobile/tsconfig.json # Why a ratchet and not the raw typecheck: mobile/tsconfig.json excludes test files, so until # tsconfig.test.json existed nothing checked them, and at introduction 127 of the 632 had @@ -376,7 +377,7 @@ jobs: - name: Typecheck id: production-types background: true - run: node ../config/scripts/run-typecheck-projects-in-parallel.mjs --compiler=bun --bun-threads=2 --project=mobile/tsconfig.json + run: node ../config/scripts/typecheck/project-execution/run-typecheck-projects-in-parallel.mjs --compiler=bun --bun-threads=2 --project=mobile/tsconfig.json - name: Typecheck tests (ratchet) id: test-types diff --git a/.github/workflows/node-server-tests.yml b/.github/workflows/node-server-tests.yml index 7fd95253d27..4d704d4437e 100644 --- a/.github/workflows/node-server-tests.yml +++ b/.github/workflows/node-server-tests.yml @@ -93,7 +93,7 @@ jobs: if git fetch --no-tags --depth=1 origin "$PUSH_BASE" && git diff --name-only --no-renames -z "$PUSH_BASE" HEAD > "$RUNNER_TEMP/node-server-changes" && git diff --name-only --no-renames --diff-filter=M -z "$PUSH_BASE" HEAD > "$RUNNER_TEMP/node-server-modified"; then - node config/scripts/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --defer-graph --full-qualification --modified-paths "$RUNNER_TEMP/node-server-modified" + node config/scripts/node-server/qualification/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --defer-graph --full-qualification --modified-paths "$RUNNER_TEMP/node-server-modified" else echo 'should_run=true' >> "$GITHUB_OUTPUT" fi @@ -107,7 +107,7 @@ jobs: if git diff --name-only --no-renames -z HEAD^1 HEAD > "$RUNNER_TEMP/node-server-changes" && git diff --name-only --no-renames --diff-filter=M -z HEAD^1 HEAD > "$RUNNER_TEMP/node-server-modified" && git diff --raw --no-renames --no-abbrev -z HEAD^1 HEAD > "$RUNNER_TEMP/node-server-native-diff"; then - node config/scripts/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --defer-graph --modified-paths "$RUNNER_TEMP/node-server-modified" "${NATIVE_SCOPE_ARGS[@]}" + node config/scripts/node-server/qualification/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --defer-graph --modified-paths "$RUNNER_TEMP/node-server-modified" "${NATIVE_SCOPE_ARGS[@]}" else echo 'should_run=true' >> "$GITHUB_OUTPUT" fi @@ -127,13 +127,13 @@ jobs: ALLOW_TEST_ONLY_NATIVE_SKIP: ${{ github.event_name == 'pull_request' && !inputs.build_template && inputs.ref == '' }} run: | if [ "$EVENT_NAME" = push ]; then - node config/scripts/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --full-qualification --modified-paths "$RUNNER_TEMP/node-server-modified" + node config/scripts/node-server/qualification/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --full-qualification --modified-paths "$RUNNER_TEMP/node-server-modified" else NATIVE_SCOPE_ARGS=() if [ "$ALLOW_TEST_ONLY_NATIVE_SKIP" = true ]; then NATIVE_SCOPE_ARGS=(--pull-request --diff-paths "$RUNNER_TEMP/node-server-native-diff") fi - node config/scripts/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --modified-paths "$RUNNER_TEMP/node-server-modified" "${NATIVE_SCOPE_ARGS[@]}" + node config/scripts/node-server/qualification/node-server-change-scope.mjs "$RUNNER_TEMP/node-server-changes" --modified-paths "$RUNNER_TEMP/node-server-modified" "${NATIVE_SCOPE_ARGS[@]}" fi persistence: @@ -234,7 +234,7 @@ jobs: BUN_EXECUTABLE: ${{ steps.bun-orcad.outputs.executable }} - name: Build the host-target desktop server template if: runner.os == 'Linux' - run: node config/scripts/build-orcad-template.mjs --targets linux-${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}-glibc + run: node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets linux-${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}-glibc - name: Verify a structured chat from the desktop server template if: runner.os == 'Linux' run: pnpm test:node-server --artifact src/main/orcad/orcad-packaged-structured-chat.integration.test.ts --maxWorkers=2 @@ -246,10 +246,10 @@ jobs: if: inputs.build_template && matrix.os == 'windows-2022' shell: bash run: | - node config/scripts/build-windows-process-tree-addon.mjs --arch=x64 - node config/scripts/build-windows-process-tree-addon.mjs --arch=arm64 + node "$(if [ -f config/scripts/native-build/windows/build-windows-process-tree-addon.mjs ]; then printf %s config/scripts/native-build/windows/build-windows-process-tree-addon.mjs; else printf %s config/scripts/build-windows-process-tree-addon.mjs; fi)" --arch=x64 + node "$(if [ -f config/scripts/native-build/windows/build-windows-process-tree-addon.mjs ]; then printf %s config/scripts/native-build/windows/build-windows-process-tree-addon.mjs; else printf %s config/scripts/build-windows-process-tree-addon.mjs; fi)" --arch=arm64 node -e " - const { assertWindowsProcessTreeCreationTime } = require('./config/scripts/windows-process-tree-creation-time.cjs') + const { assertWindowsProcessTreeCreationTime } = require(require('node:fs').existsSync('./config/scripts/native-build/windows/windows-process-tree-creation-time.cjs') ? './config/scripts/native-build/windows/windows-process-tree-creation-time.cjs' : './config/scripts/windows-process-tree-creation-time.cjs') const addon = require('./.build/windows-process-tree/x64/windows-process-tree.node') assertWindowsProcessTreeCreationTime({ module: addon }) const own = addon.getProcessCreationTime(process.pid) @@ -280,14 +280,14 @@ jobs: # orcad's data-root privacy check fails closed without it, so every Windows slot needs one. # Older requested refs use the previous security implementation and have no addon builder. - name: Build the Windows security addons for the desktop template - if: inputs.build_template && matrix.os == 'windows-2022' && hashFiles('config/scripts/build-windows-security-addon.mjs') != '' + if: inputs.build_template && matrix.os == 'windows-2022' && hashFiles('config/scripts/native-build/windows/build-windows-security-addon.mjs', 'config/scripts/build-windows-security-addon.mjs') != '' shell: bash run: | - node config/scripts/build-windows-security-addon.mjs --arch=x64 - node config/scripts/build-windows-security-addon.mjs --arch=arm64 + node "$(if [ -f config/scripts/native-build/windows/build-windows-security-addon.mjs ]; then printf %s config/scripts/native-build/windows/build-windows-security-addon.mjs; else printf %s config/scripts/build-windows-security-addon.mjs; fi)" --arch=x64 + node "$(if [ -f config/scripts/native-build/windows/build-windows-security-addon.mjs ]; then printf %s config/scripts/native-build/windows/build-windows-security-addon.mjs; else printf %s config/scripts/build-windows-security-addon.mjs; fi)" --arch=arm64 node -e "require('./.build/windows-security/x64/windows-security.node').currentUserSid()" - name: Keep the Windows security addons for the desktop template - if: inputs.build_template && matrix.os == 'windows-2022' && hashFiles('config/scripts/build-windows-security-addon.mjs') != '' + if: inputs.build_template && matrix.os == 'windows-2022' && hashFiles('config/scripts/native-build/windows/build-windows-security-addon.mjs', 'config/scripts/build-windows-security-addon.mjs') != '' uses: actions/upload-artifact@v7 with: name: orcad-windows-security @@ -416,7 +416,7 @@ jobs: - name: Build and smoke this runner's node-pty prebuild slot under the pinned Node run: | pnpm build:orcad-prebuilds - pnpm build:orcad-prebuilds --require-slots "$(node config/scripts/build-orcad-prebuilds.mjs --print-slot)" + pnpm build:orcad-prebuilds --require-slots "$(node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --print-slot)" pnpm build:orcad-prebuilds --smoke - uses: actions/download-artifact@v8 with: @@ -462,7 +462,7 @@ jobs: # smokes with that Node. devtoolset-10 supplies C++20; the slot links libstdc++ statically. - name: Build and smoke the glibc 2.17 compat slot under the glibc-217 Node run: | - compat_node="$(node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --print-runtime)" + compat_node="$(node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --slot=linux-x64-glibc217 --print-runtime)" case "$compat_node" in "$GITHUB_WORKSPACE"/*) ;; *) echo "glibc-217 Node cached outside the workspace: $compat_node" >&2; exit 1 ;; @@ -476,10 +476,10 @@ jobs: quay.io/pypa/manylinux2014_x86_64@sha256:6f74cabeac2432570aa4bfdb29f7c1f30313d4d6654d764c44e574b6ffdd4ed5 bash -s <<'GLIBC217_COMPAT_SLOT' set -eu export PATH="$(dirname "$COMPAT_NODE"):$PATH" - node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 - node config/scripts/build-orcad-prebuilds.mjs --require-slots linux-x64-glibc217 + node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --slot=linux-x64-glibc217 + node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --require-slots linux-x64-glibc217 # The image's devtoolset LD_LIBRARY_PATH must not stand in for a host C++ runtime. - env -u LD_LIBRARY_PATH node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --smoke + env -u LD_LIBRARY_PATH node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --slot=linux-x64-glibc217 --smoke GLIBC217_COMPAT_SLOT - name: Keep the glibc 2.17 compat slot for the desktop template if: inputs.build_template @@ -540,7 +540,7 @@ jobs: npm install -g "$(node -p "require('./package.json').packageManager.split('+')[0]")" pnpm install --frozen-lockfile --ignore-scripts pnpm build:orcad-prebuilds - pnpm build:orcad-prebuilds --require-slots "$(node config/scripts/build-orcad-prebuilds.mjs --print-slot)" + pnpm build:orcad-prebuilds --require-slots "$(node "$(if [ -f config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs; else printf %s config/scripts/build-orcad-prebuilds.mjs; fi)" --print-slot)" pnpm build:orcad-prebuilds --smoke NODE_SERVER_PREPARATION - uses: actions/download-artifact@v8 @@ -637,7 +637,7 @@ jobs: name: orcad-windows-cli-launcher path: .build/windows-cli-launcher - name: Collect the Windows security addons - if: hashFiles('config/scripts/build-windows-security-addon.mjs') != '' + if: hashFiles('config/scripts/native-build/windows/build-windows-security-addon.mjs', 'config/scripts/build-windows-security-addon.mjs') != '' uses: actions/download-artifact@v8 with: name: orcad-windows-security @@ -645,7 +645,7 @@ jobs: - name: Merge the lanes and gate the full slot matrix shell: bash run: | - node config/scripts/merge-orcad-prebuilds.mjs "$RUNNER_TEMP"/orcad-prebuild-lanes/* + node "$(if [ -f config/scripts/orcad-distribution/prebuilds/merge-orcad-prebuilds.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/merge-orcad-prebuilds.mjs; else printf %s config/scripts/merge-orcad-prebuilds.mjs; fi)" "$RUNNER_TEMP"/orcad-prebuild-lanes/* pnpm build:orcad-prebuilds --require-slots pnpm build:orcad-prebuilds --require-slots linux-x64-glibc217 # The page the qualification lanes tested, not a rebuild. diff --git a/.github/workflows/packaged-browser-e2e.yml b/.github/workflows/packaged-browser-e2e.yml index 0ab3e6489ea..06438c5046e 100644 --- a/.github/workflows/packaged-browser-e2e.yml +++ b/.github/workflows/packaged-browser-e2e.yml @@ -59,7 +59,7 @@ jobs: --project=electron-headless --workers=1 --retries=0 --repeat-each=3 --reporter=list,json - name: Require all six compatibility executions if: always() - run: node config/scripts/verify-packaged-browser-participation.mjs test-results/packaged-browser-results.json + run: node "$(if [ -f config/scripts/desktop-distribution/runtime-verification/verify-packaged-browser-participation.mjs ]; then printf %s config/scripts/desktop-distribution/runtime-verification/verify-packaged-browser-participation.mjs; else printf %s config/scripts/verify-packaged-browser-participation.mjs; fi)" test-results/packaged-browser-results.json - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 481e4e6ee38..52e22c3f627 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -66,7 +66,7 @@ jobs: fetch-depth: 50 filter: blob:none sparse-checkout: | - /config/scripts/git-pull-request-diff-base.mjs + /config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs /package.json /README.md /docs/readme/ @@ -75,18 +75,19 @@ jobs: /.github/workflows/ /config/.bun-version /config/scripts/check-readme-local-links.mjs - /config/scripts/pr-code-change-scope.mjs - /config/scripts/pr-shell-contract-prefixes.mjs + /config/scripts/workflow/source-routing/pr-code-change-scope.mjs + /config/scripts/workflow/source-routing/pr-xterm-patch-prefixes.mjs + /config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs /.oxfmtrc.json - /config/scripts/pr-package-test-paths.mjs - /config/scripts/pr-layout-oracle-route.mjs - /config/scripts/pr-e2e-source-routing.mjs - /config/scripts/pr-browser-e2e-source-routes.mjs - /config/scripts/pr-editor-preview-e2e-source-routes.mjs - /config/scripts/pr-feature-area-e2e-source-routes.mjs - /config/scripts/pr-plugin-e2e-source-routes.mjs - /config/scripts/pr-wsl-e2e-source-routes.mjs - /config/scripts/ci-e2e-job-selection.mjs + /config/scripts/workflow/source-routing/pr-package-test-paths.mjs + /config/scripts/workflow/source-routing/pr-layout-oracle-route.mjs + /config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs + /config/scripts/workflow/source-routing/pr-browser-e2e-source-routes.mjs + /config/scripts/workflow/source-routing/pr-editor-preview-e2e-source-routes.mjs + /config/scripts/workflow/source-routing/pr-feature-area-e2e-source-routes.mjs + /config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs + /config/scripts/workflow/source-routing/pr-wsl-e2e-source-routes.mjs + /config/scripts/ci/e2e-selection/ci-e2e-job-selection.mjs /config/scripts/pr-ready-check-reuse.mjs sparse-checkout-cone-mode: false persist-credentials: false @@ -95,7 +96,7 @@ jobs: env: BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" node .github/scripts/check-root-directory-entries.mjs "$DIFF_BASE" HEAD # The full Git index retains link targets outside the sparse working tree. @@ -127,7 +128,7 @@ jobs: run: | set -euo pipefail # PR merge HEAD’s first parent is the base; --merge-base would require the payload SHA/full history. - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" # --no-renames retains code-side deletions when files move into docs. CHANGED="$(git diff --name-only --no-renames --diff-filter=ACDMR "$DIFF_BASE" HEAD)" echo "Changed paths:" @@ -136,7 +137,7 @@ jobs: if git diff --quiet --no-renames --diff-filter=ACDRTUXB "$DIFF_BASE" HEAD; then MOBILE_CI_ARGS=(--mobile-ci-tools --daemon-init-test-support) fi - printf '%s\n' "$CHANGED" | node config/scripts/pr-code-change-scope.mjs "${MOBILE_CI_ARGS[@]}" | tee -a "$GITHUB_OUTPUT" + printf '%s\n' "$CHANGED" | node config/scripts/workflow/source-routing/pr-code-change-scope.mjs "${MOBILE_CI_ARGS[@]}" | tee -a "$GITHUB_OUTPUT" # Reuse the path-detector checkout instead of queuing another runner. - name: Filter changed E2E specs @@ -145,24 +146,24 @@ jobs: run: | set -euo pipefail BASE="${{ github.event.pull_request.base.sha }}" - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE")" CHANGED="$(git diff --name-only --diff-filter=AMCR "$DIFF_BASE" HEAD)" E2E_SCOPE_ARGS=() if git diff --quiet --no-renames --diff-filter=ACDRTUXB "$DIFF_BASE" HEAD; then E2E_SCOPE_ARGS=(--daemon-init-test-support) fi # Executable routes let tests prove authorities/exclusions/sentinels without evaluating shell. - TEST_FILES_JSON="$(printf '%s\n' "$CHANGED" | node config/scripts/pr-e2e-source-routing.mjs "${E2E_SCOPE_ARGS[@]}")" + TEST_FILES_JSON="$(printf '%s\n' "$CHANGED" | node config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs "${E2E_SCOPE_ARGS[@]}")" echo "test_files=$TEST_FILES_JSON" >> "$GITHUB_OUTPUT" - printf '%s\n' "$TEST_FILES_JSON" | node config/scripts/ci-e2e-job-selection.mjs --job-outputs >> "$GITHUB_OUTPUT" + printf '%s\n' "$TEST_FILES_JSON" | node config/scripts/ci/e2e-selection/ci-e2e-job-selection.mjs --job-outputs >> "$GITHUB_OUTPUT" # Real IME runs an entire IBus session; route it by IME source, independently of spec lists. - NATIVE_IME_SOURCE_CHANGED="$(printf '%s\n' "$CHANGED" | node config/scripts/pr-e2e-source-routing.mjs --native-ime-source)" + NATIVE_IME_SOURCE_CHANGED="$(printf '%s\n' "$CHANGED" | node config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs --native-ime-source)" echo "native_ime_source_changed=$NATIVE_IME_SOURCE_CHANGED" >> "$GITHUB_OUTPUT" WSL_CHANGED="$(git diff --name-only --no-renames --diff-filter=ACDMR "$DIFF_BASE" HEAD)" - WSL_SOURCE_CHANGED="$(printf '%s\n' "$WSL_CHANGED" | node config/scripts/pr-e2e-source-routing.mjs --wsl-source)" + WSL_SOURCE_CHANGED="$(printf '%s\n' "$WSL_CHANGED" | node config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs --wsl-source)" echo "wsl_source_changed=$WSL_SOURCE_CHANGED" >> "$GITHUB_OUTPUT" echo "Native IME source changed: $NATIVE_IME_SOURCE_CHANGED" - SHOULD_RUN="$(printf '%s\n' "$CHANGED" | node config/scripts/pr-e2e-source-routing.mjs --reusable-workflow "${E2E_SCOPE_ARGS[@]}")" + SHOULD_RUN="$(printf '%s\n' "$CHANGED" | node config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs --reusable-workflow "${E2E_SCOPE_ARGS[@]}")" if [ "$SHOULD_RUN" = true ]; then echo "should_run=true" >> "$GITHUB_OUTPUT" echo "Changed E2E specs: $TEST_FILES_JSON" @@ -248,7 +249,7 @@ jobs: PREFLIGHT_PRIOR_SUCCESS: ${{ job.status == 'success' }} run: | if [ "$PREFLIGHT_PHASE_SELECTED" != true ] || [ "$PREFLIGHT_PRIOR_SUCCESS" != true ]; then exit 0; fi - bun config/scripts/check-main-sync-spawn-ratchet.mjs + bun config/scripts/static-analysis/process-boundaries/check-main-sync-spawn-ratchet.mjs # Keep each check in its own log while sharing this runner. - name: Lint @@ -334,7 +335,7 @@ jobs: PREFLIGHT_PRIOR_SUCCESS: ${{ job.status == 'success' }} run: | if [ "$PREFLIGHT_PHASE_SELECTED" != true ] || [ "$PREFLIGHT_PRIOR_SUCCESS" != true ]; then exit 0; fi - node config/scripts/check-changed-code-quality.mjs "${{ github.event.pull_request.base.sha }}" + node config/scripts/preflight/changed-checks/check-changed-code-quality.mjs "${{ github.event.pull_request.base.sha }}" - name: Verify locked audit tools if: needs.code_paths.outputs.static_analysis == 'true' @@ -373,9 +374,9 @@ jobs: run: | if [ "$PREFLIGHT_PHASE_SELECTED" != true ] || [ "$PREFLIGHT_PRIOR_SUCCESS" != true ]; then exit 0; fi # Detection failures run the full check; renames retain the removed input path. - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" if git diff --name-only --no-renames -z "$DIFF_BASE" HEAD > "$RUNNER_TEMP/localization-changes" && - scope="$(node config/scripts/localization-extraction-change-scope.mjs "$RUNNER_TEMP/localization-changes")" && [ "$scope" = false ]; then + scope="$(node config/scripts/localization/extraction-policy/localization-extraction-change-scope.mjs "$RUNNER_TEMP/localization-changes")" && [ "$scope" = false ]; then echo "Localization extraction inputs are unchanged." else bun config/scripts/verify-localization-extraction.mjs @@ -392,7 +393,7 @@ jobs: PREFLIGHT_PRIOR_SUCCESS: ${{ job.status == 'success' }} run: | if [ "$PREFLIGHT_PHASE_SELECTED" != true ] || [ "$PREFLIGHT_PRIOR_SUCCESS" != true ]; then exit 0; fi - node config/scripts/run-ratchets.mjs + node config/scripts/static-analysis/ratchet-runner/run-ratchets.mjs - name: Check Zustand selector fan-out budget if: needs.code_paths.outputs.static_analysis == 'true' @@ -415,7 +416,7 @@ jobs: env: BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" if git diff --quiet "$DIFF_BASE" HEAD -- \ src/shared/ephemeral-vm-runtime-store.ts \ src/shared/ephemeral-vm-runtime-feature-store.ts \ @@ -461,9 +462,9 @@ jobs: BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | # Detection failures run the smoke; renames retain the removed input path. - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" if git diff --name-only --no-renames -z "$DIFF_BASE" HEAD > "$RUNNER_TEMP/orcad-smoke-changes" && - scope="$(node config/scripts/orcad-terminal-smoke-change-scope.mjs "$RUNNER_TEMP/orcad-smoke-changes")" && [ "$scope" = false ]; then + scope="$(node config/scripts/orcad-distribution/qualification/orcad-terminal-smoke-change-scope.mjs "$RUNNER_TEMP/orcad-smoke-changes")" && [ "$scope" = false ]; then echo "Orcad terminal smoke inputs are unchanged." echo 'run=false' >> "$GITHUB_OUTPUT" else @@ -562,14 +563,14 @@ jobs: ORCA_BACKGROUND_LAUNCH: '1' ORCA_BALANCE_UNIT_SHARDS: '1' run: >- - node config/scripts/run-vitest.mjs run --config config/vitest.config.ts + node config/scripts/test-runtime/execution-policy/run-vitest.mjs run --config config/vitest.config.ts --maxWorkers=4 --isolate --retry=0 --bail=0 config/scripts/mobile-release-check-scope.test.mjs config/scripts/mobile-test-change-scope.test.mjs config/scripts/pr-ready-check-reuse.test.mjs config/scripts/win32-test-lane-registration.test.mjs - config/scripts/vitest-node-runtime-boundary.test.ts - config/scripts/vitest-sqlite-runtime-boundary.test.ts + config/scripts/test-runtime/node-worker/vitest-node-runtime-boundary.test.ts + config/scripts/test-runtime/sqlite-admission/vitest-sqlite-runtime-boundary.test.ts # Report failure through the separate required check without blocking unrelated consumers. - name: Smoke process-host package on Node 18 @@ -757,7 +758,7 @@ jobs: - name: Verify xterm patches match the pinned upstream build env: WORK_DIR: ${{ runner.temp }}/xterm-patch-build - run: node config/scripts/regenerate-xterm-patches.mjs --check --work-dir="$WORK_DIR" + run: node config/scripts/terminal-dependencies/xterm-patches/regenerate-xterm-patches.mjs --check --work-dir="$WORK_DIR" shell_contracts: name: shell contracts @@ -943,7 +944,7 @@ jobs: - name: Prepare mobile route snapshot id: mobile-routes background: true - run: node config/scripts/run-mobile-web-app-checks.mjs --prepare-route-snapshot "$RUNNER_TEMP/mobile-routes.json" + run: node config/scripts/mobile-web/check-entry/run-mobile-web-app-checks.mjs --prepare-route-snapshot "$RUNNER_TEMP/mobile-routes.json" # Require runner Google Chrome: Ubuntu’s AppArmor userns profile covers its .deb, unlike downloaded Chromium; missing render checks must fail. - name: Resolve Chrome for the render check @@ -969,7 +970,7 @@ jobs: ORCA_MOBILE_WEB_APP_DEPS_REQUIRED: '1' ORCA_MOBILE_WEB_PREPARED_ROUTE_SNAPSHOT: ${{ runner.temp }}/mobile-routes.json run: | - node config/scripts/run-mobile-web-app-checks.mjs + node config/scripts/mobile-web/check-entry/run-mobile-web-app-checks.mjs cross-version-wire: name: cross-version wire compatibility @@ -1007,7 +1008,7 @@ jobs: BASE_SHA: ${{ github.event.pull_request.base.sha }} ORCA_ALLOW_RUNTIME_LAUNCHER_PROTOCOL_BUMP: ${{ contains(github.event.pull_request.labels.*.name, 'allow-runtime-launcher-protocol-bump') }} run: | - DIFF_BASE="$(node config/scripts/git-pull-request-diff-base.mjs "$BASE_SHA")" + DIFF_BASE="$(node config/scripts/git/pr-diff-base/git-pull-request-diff-base.mjs "$BASE_SHA")" pnpm run check:runtime-launcher-protocol-ratchet -- --base "$DIFF_BASE" # Run the entire directory; zero matches fail so new contracts cannot be omitted silently. @@ -1215,7 +1216,7 @@ jobs: # Prepare once with every hook, then isolate the format-specific mutations. run: | pnpm exec electron-builder --config config/electron-builder.config.cjs --linux dir --x64 --publish never - node config/scripts/package-linux-formats.mjs + node config/scripts/desktop-distribution/linux/package-linux-formats.mjs - name: Verify root-package marker payloads run: | @@ -1229,7 +1230,7 @@ jobs: rpm_marker="$(rpm2cpio "$rpm" | cpio --quiet --extract --to-stdout ./opt/Orca/resources/package-type)" [[ "$deb_marker" == deb ]] || { echo "Expected deb marker, got: $deb_marker"; exit 1; } [[ "$rpm_marker" == rpm ]] || { echo "Expected rpm marker, got: $rpm_marker"; exit 1; } - # Only the AppImage carries the pinned Node (config/scripts/appimage-node-runtime.cjs). + # Only the AppImage carries the pinned Node (config/scripts/desktop-distribution/linux/appimage-node-runtime.cjs). if dpkg-deb --fsys-tarfile "$deb" | tar -t | grep '/resources/node-runtime' >/dev/null; then echo "The deb must not carry the AppImage's Node"; exit 1 fi @@ -1329,12 +1330,12 @@ jobs: pnpm exec vitest run --config config/vitest.config.ts --no-file-parallelism config/scripts/nsis-process-check.test.mjs - config/scripts/idle-cpu-process-sampling.test.mjs + config/scripts/performance/idle-cpu/idle-cpu-process-sampling.test.mjs - name: Resolve the Windows Rust build scope id: rust-scope shell: bash - run: node config/scripts/windows-rust-build-scope.mjs >> "$GITHUB_OUTPUT" + run: node config/scripts/native-build/windows/windows-rust-build-scope.mjs >> "$GITHUB_OUTPUT" # Real inputs only: older restores are safe because the build re-checks each exe's fingerprint. - name: Cache Windows CLI launcher @@ -1347,7 +1348,7 @@ jobs: native/windows-agent-hook/.build native/windows-agent-hook/target ~/.cargo/registry - key: windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}-${{ steps.rust-scope.outputs.app-version }}-${{ hashFiles('native/windows-cli-launcher/src/**', 'native/windows-cli-launcher/build.rs', 'native/windows-cli-launcher/Cargo.toml', 'native/windows-cli-launcher/Cargo.lock', 'native/windows-cli-launcher/app.manifest', 'native/windows-cli-launcher/.cargo/**', 'native/windows-agent-hook/src/**', 'native/windows-agent-hook/build.rs', 'native/windows-agent-hook/Cargo.toml', 'native/windows-agent-hook/Cargo.lock', 'native/windows-agent-hook/app.manifest', 'native/windows-agent-hook/.cargo/**', 'config/scripts/build-windows-cli-launcher.mjs', 'config/scripts/build-windows-agent-hook.mjs', 'config/scripts/windows-rust-executable-build.mjs', 'config/scripts/windows-pe-imports.mjs', 'resources/build/icon.ico') }} + key: windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}-${{ steps.rust-scope.outputs.app-version }}-${{ hashFiles('native/windows-cli-launcher/src/**', 'native/windows-cli-launcher/build.rs', 'native/windows-cli-launcher/Cargo.toml', 'native/windows-cli-launcher/Cargo.lock', 'native/windows-cli-launcher/app.manifest', 'native/windows-cli-launcher/.cargo/**', 'native/windows-agent-hook/src/**', 'native/windows-agent-hook/build.rs', 'native/windows-agent-hook/Cargo.toml', 'native/windows-agent-hook/Cargo.lock', 'native/windows-agent-hook/app.manifest', 'native/windows-agent-hook/.cargo/**', 'config/scripts/native-build/windows/build-windows-cli-launcher.mjs', 'config/scripts/native-build/windows/build-windows-agent-hook.mjs', 'config/scripts/native-build/windows/windows-rust-executable-build.mjs', 'config/scripts/native-build/windows/windows-pe-imports.mjs', 'resources/build/icon.ico') }} restore-keys: | windows-cli-launcher-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust-scope.outputs.toolchain }}- @@ -1363,14 +1364,14 @@ jobs: # Build agent-hook once before tests so suites share the binary instead of compiling concurrently. - name: Build the Windows agent hook - run: node config/scripts/build-windows-agent-hook.mjs + run: node config/scripts/native-build/windows/build-windows-agent-hook.mjs - name: Build the Windows CLI launcher - run: node config/scripts/build-windows-cli-launcher.mjs + run: node config/scripts/native-build/windows/build-windows-cli-launcher.mjs # Install Electron once: otherwise each Electron test's require('electron') extracts it into one dist concurrently (EBUSY, 0xC0000005). - name: Install the Electron binary - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs # Files come from WINDOWS_BOUNDARY_TESTS, the same list that decides whether this job runs. - name: Test Windows-specific boundaries @@ -1378,7 +1379,7 @@ jobs: ORCA_BACKGROUND_LAUNCH: '1' ORCA_REAL_WINDOWS_SKILL_TEST: '1' run: | - $files = node config/scripts/pr-package-test-paths.mjs + $files = node config/scripts/workflow/source-routing/pr-package-test-paths.mjs if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts @files diff --git a/.github/workflows/preflight-benchmark.yml b/.github/workflows/preflight-benchmark.yml index 5f8f0b595d3..1d0961e258c 100644 --- a/.github/workflows/preflight-benchmark.yml +++ b/.github/workflows/preflight-benchmark.yml @@ -5,7 +5,7 @@ on: paths: - .github/workflows/preflight-benchmark.yml - config/scripts/benchmark-preflight-*.mjs - - config/scripts/preflight-benchmark-command.mjs + - config/scripts/preflight/benchmarks/preflight-benchmark-command.mjs workflow_dispatch: permissions: contents: read @@ -34,7 +34,7 @@ jobs: bun-version-file: config/.bun-version no-cache: true - name: Compare native and Bun typechecking - run: node config/scripts/benchmark-preflight-compilers.mjs + run: node config/scripts/preflight/benchmarks/benchmark-preflight-compilers.mjs - uses: actions/upload-artifact@v7 if: always() with: @@ -58,7 +58,7 @@ jobs: bun-version-file: config/.bun-version no-cache: true - name: Compare anti-slop patch and script runtimes - run: node config/scripts/benchmark-preflight-static-analysis.mjs + run: node config/scripts/preflight/benchmarks/benchmark-preflight-static-analysis.mjs - uses: actions/upload-artifact@v7 if: always() with: @@ -83,7 +83,7 @@ jobs: bun-version-file: config/.bun-version no-cache: true - name: Compare compatibility-import scan and runtimes - run: node config/scripts/benchmark-preflight-compat-boundary.mjs + run: node config/scripts/preflight/benchmarks/benchmark-preflight-compat-boundary.mjs - uses: actions/upload-artifact@v7 if: always() with: @@ -107,7 +107,7 @@ jobs: bun-version-file: config/.bun-version no-cache: true - name: Compare localization extraction runtimes and complete catalogs - run: node config/scripts/benchmark-preflight-localization-extraction.mjs + run: node config/scripts/preflight/benchmarks/benchmark-preflight-localization-extraction.mjs - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/preflight-critical-path-benchmark.yml b/.github/workflows/preflight-critical-path-benchmark.yml index c6e8eb44b4a..468151b95d3 100644 --- a/.github/workflows/preflight-critical-path-benchmark.yml +++ b/.github/workflows/preflight-critical-path-benchmark.yml @@ -4,7 +4,7 @@ on: types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] paths: - .github/workflows/preflight-critical-path-benchmark.yml - - config/scripts/benchmark-ci-preflight-critical-path.mjs + - config/scripts/preflight/benchmarks/benchmark-ci-preflight-critical-path.mjs workflow_dispatch: permissions: contents: read @@ -38,7 +38,7 @@ jobs: - uses: ./.github/actions/install-mobile-dependencies if: matrix.comparison == 'smoke' - name: Compare checks and verify their results - run: node config/scripts/benchmark-ci-preflight-critical-path.mjs ${{ matrix.comparison }} + run: node config/scripts/preflight/benchmarks/benchmark-ci-preflight-critical-path.mjs ${{ matrix.comparison }} - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/qualified-orcad-template.yml b/.github/workflows/qualified-orcad-template.yml index 6da722eee92..0c2482308b9 100644 --- a/.github/workflows/qualified-orcad-template.yml +++ b/.github/workflows/qualified-orcad-template.yml @@ -60,7 +60,7 @@ jobs: if: steps.restore.outputs.cache-hit == 'true' && steps.restore.outcome == 'success' shell: bash run: | - if node -e "require('./config/dark-build-switches.cjs').assertNotDarkBuild(['out/orcad-template']); require('./config/scripts/verify-packaged-orcad-template.cjs').verifyPackagedOrcadTemplate('out')"; then + if node -e "require('./config/dark-build-switches.cjs').assertNotDarkBuild(['out/orcad-template']); require(require('node:fs').existsSync('./config/scripts/orcad-distribution/template/verify-packaged-orcad-template.cjs') ? './config/scripts/orcad-distribution/template/verify-packaged-orcad-template.cjs' : './config/scripts/verify-packaged-orcad-template.cjs').verifyPackagedOrcadTemplate('out')"; then echo 'valid=true' >> "$GITHUB_OUTPUT" else rm -rf out/orcad-template diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml index 9f520a1f12f..0963948a4ea 100644 --- a/.github/workflows/release-cut.yml +++ b/.github/workflows/release-cut.yml @@ -641,7 +641,7 @@ jobs: TAG: ${{ steps.tag.outputs.tag || steps.version.outputs.recovered_tag }} run: | set -euo pipefail - if git cat-file -e "refs/tags/${TAG}^{commit}:config/scripts/packaged-orcad-template.cjs" 2>/dev/null; then + if git cat-file -e "refs/tags/${TAG}^{commit}:config/scripts/orcad-distribution/template/packaged-orcad-template.cjs" 2>/dev/null || git cat-file -e "refs/tags/${TAG}^{commit}:config/scripts/packaged-orcad-template.cjs" 2>/dev/null; then echo "ships=true" >>"$GITHUB_OUTPUT" else echo "ships=false" >>"$GITHUB_OUTPUT" @@ -850,7 +850,12 @@ jobs: native-runtime: node - name: Install Electron package binary for tests - run: node config/scripts/install-electron-package-binary.mjs + run: | + ELECTRON_INSTALL_SCRIPT=config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs + if [ ! -f "$ELECTRON_INSTALL_SCRIPT" ]; then + ELECTRON_INSTALL_SCRIPT=config/scripts/install-electron-package-binary.mjs + fi + node "$ELECTRON_INSTALL_SCRIPT" - name: Run skill package, transaction, and compatibility suites env: @@ -901,7 +906,12 @@ jobs: native-runtime: node - name: Install Electron package binary for tests - run: node config/scripts/install-electron-package-binary.mjs + run: | + ELECTRON_INSTALL_SCRIPT=config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs + if [ ! -f "$ELECTRON_INSTALL_SCRIPT" ]; then + ELECTRON_INSTALL_SCRIPT=config/scripts/install-electron-package-binary.mjs + fi + node "$ELECTRON_INSTALL_SCRIPT" - name: Run skill package, transaction, and compatibility suites env: @@ -1083,20 +1093,20 @@ jobs: # node-gyp could detect VS 18, breaking native dependency install. - os: windows-2022 platform: win - release_command: 'node config/scripts/ensure-native-runtime.mjs --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never' + release_command: 'node $(if (Test-Path config/scripts/native-build/node-addons/ensure-native-runtime.mjs) { "config/scripts/native-build/node-addons/ensure-native-runtime.mjs" } else { "config/scripts/ensure-native-runtime.mjs" }) --runtime=electron; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never' eb_cache_path: | ~\AppData\Local\electron\Cache ~\AppData\Local\electron-builder\Cache - os: ubuntu-latest platform: linux-x64 - release_command: node config/scripts/ensure-native-runtime.mjs --runtime=electron && pnpm exec electron-builder --config config/electron-builder.config.cjs --linux AppImage deb rpm --x64 --publish always -c.publish.releaseType=draft + release_command: node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && pnpm exec electron-builder --config config/electron-builder.config.cjs --linux AppImage deb rpm --x64 --publish always -c.publish.releaseType=draft unpacked_dir: dist/linux-unpacked eb_cache_path: | ~/.cache/electron ~/.cache/electron-builder - os: ubuntu-24.04-arm platform: linux-arm64 - release_command: node config/scripts/ensure-native-runtime.mjs --runtime=electron && ORCA_LINUX_ARM64_RELEASE=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --linux AppImage deb rpm --arm64 --publish always -c.publish.releaseType=draft + release_command: node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && ORCA_LINUX_ARM64_RELEASE=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --linux AppImage deb rpm --arm64 --publish always -c.publish.releaseType=draft unpacked_dir: dist/linux-arm64-unpacked eb_cache_path: | ~/.cache/electron @@ -1271,7 +1281,11 @@ jobs: shell: bash run: | if [ "$SHARED_JAVASCRIPT" = true ]; then - node config/scripts/release-javascript-artifact.mjs restore + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + node "$RELEASE_JAVASCRIPT_ARTIFACT" restore pnpm run build:release:host else pnpm run build:release @@ -1614,7 +1628,7 @@ jobs: - name: Reseal the orcad template over its signed binaries id: reseal-orcad-template if: matrix.platform == 'win' && github.run_attempt == 1 && steps.restore-signed-inner.outcome == 'success' && needs.cut.outputs.ships_orcad_template == 'true' - run: node config/scripts/packaged-orcad-template.cjs --reseal-signed dist/win-unpacked inner-signing-list.txt + run: node $(if (Test-Path config/scripts/orcad-distribution/template/packaged-orcad-template.cjs) { "config/scripts/orcad-distribution/template/packaged-orcad-template.cjs" } else { "config/scripts/packaged-orcad-template.cjs" }) --reseal-signed dist/win-unpacked inner-signing-list.txt # The uninstaller must return signed before rebuilding the installer. - name: Restore signed uninstaller for the installer rebuild diff --git a/.github/workflows/release-javascript-benchmark.yml b/.github/workflows/release-javascript-benchmark.yml index b82ba4046d1..bdc246c16f7 100644 --- a/.github/workflows/release-javascript-benchmark.yml +++ b/.github/workflows/release-javascript-benchmark.yml @@ -69,7 +69,11 @@ jobs: run: | RELEASE_TAG="v$(node -p 'require("./package.json").version')" export RELEASE_TAG - echo "ORCA_BUILD_IDENTITY=$(node config/scripts/release-javascript-artifact.mjs identity)" >> "$GITHUB_ENV" + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + echo "ORCA_BUILD_IDENTITY=$(node "$RELEASE_JAVASCRIPT_ARTIFACT" identity)" >> "$GITHUB_ENV" - name: Download shared JavaScript if: matrix.mode == 'shared' uses: actions/download-artifact@v8 @@ -81,7 +85,12 @@ jobs: env: MEASUREMENT_MODE: ${{ matrix.mode }} ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA: ${{ needs.bundle.outputs.source_sha }} - run: node config/scripts/release-javascript-benchmark.mjs "$MEASUREMENT_MODE" + run: | + RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then + RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs' + fi + node "$RELEASE_JAVASCRIPT_BENCHMARK" "$MEASUREMENT_MODE" - uses: actions/upload-artifact@v7 with: name: release-javascript-measurement-${{ matrix.mode }}-${{ matrix.host.platform }}-${{ matrix.host.arch }} @@ -113,7 +122,11 @@ jobs: GH_TOKEN: ${{ github.token }} run: | gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/jobs?per_page=100" > .build/release-javascript-measurements/jobs.json - node config/scripts/release-javascript-benchmark.mjs summary + RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release/javascript-artifacts/release-javascript-benchmark.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_BENCHMARK" ]; then + RELEASE_JAVASCRIPT_BENCHMARK='config/scripts/release-javascript-benchmark.mjs' + fi + node "$RELEASE_JAVASCRIPT_BENCHMARK" summary cat .build/release-javascript-measurements/comparison.md >> "$GITHUB_STEP_SUMMARY" - uses: actions/upload-artifact@v7 if: always() diff --git a/.github/workflows/release-javascript.yml b/.github/workflows/release-javascript.yml index 200bec42481..547794d2ab5 100644 --- a/.github/workflows/release-javascript.yml +++ b/.github/workflows/release-javascript.yml @@ -50,10 +50,13 @@ jobs: node <<'NODE' >> "$GITHUB_OUTPUT" const fs = require('node:fs') const { scripts, devDependencies } = require('./package.json') + const artifactScript = fs.existsSync('config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs') + ? 'config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + : 'config/scripts/release-javascript-artifact.mjs' const supported = Boolean(scripts['build:release:javascript'] && scripts['build:release:host']) const devSupported = supported && Boolean( scripts['build:release:javascript:parallel'] && devDependencies?.tsrs && - fs.readFileSync('config/scripts/release-javascript-artifact.mjs', 'utf8') + fs.readFileSync(artifactScript, 'utf8') .includes('ORCA_RELEASE_JAVASCRIPT_BUILD_IDENTITY') ) console.log('supported=' + (process.env.DEV_BUILD === 'true' ? devSupported : supported)) @@ -75,7 +78,11 @@ jobs: run: | RELEASE_TAG="v$(node -p 'require("./package.json").version')" export RELEASE_TAG - echo "value=$(node config/scripts/release-javascript-artifact.mjs identity)" >> "$GITHUB_OUTPUT" + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + echo "value=$(node "$RELEASE_JAVASCRIPT_ARTIFACT" identity)" >> "$GITHUB_OUTPUT" - name: Build and archive release JavaScript if: steps.source.outputs.supported == 'true' @@ -89,7 +96,11 @@ jobs: ORCA_POSTHOG_WRITE_KEY: ${{ !inputs.dev_build && secrets.ORCA_POSTHOG_WRITE_KEY || '' }} run: | pnpm run "$JAVASCRIPT_BUILD_SCRIPT" - node config/scripts/release-javascript-artifact.mjs pack + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + node "$RELEASE_JAVASCRIPT_ARTIFACT" pack - uses: actions/upload-artifact@v7 if: steps.source.outputs.supported == 'true' diff --git a/.github/workflows/release-mac-build.yml b/.github/workflows/release-mac-build.yml index b6a752f6177..49d0813c761 100644 --- a/.github/workflows/release-mac-build.yml +++ b/.github/workflows/release-mac-build.yml @@ -174,7 +174,11 @@ jobs: - name: Build app run: | if [ -n "$ORCA_RELEASE_JAVASCRIPT_SOURCE_SHA" ]; then - node config/scripts/release-javascript-artifact.mjs restore + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release/javascript-artifacts/release-javascript-artifact.mjs' + if [ ! -f "$RELEASE_JAVASCRIPT_ARTIFACT" ]; then + RELEASE_JAVASCRIPT_ARTIFACT='config/scripts/release-javascript-artifact.mjs' + fi + node "$RELEASE_JAVASCRIPT_ARTIFACT" restore pnpm run build:release:host else pnpm run build:release @@ -191,7 +195,7 @@ jobs: # Design D2: the parent release-cut run merged it from every node-server lane at this tag. - name: Download the orcad deployment template from the release run # Why: release-cut skips the template for a tag that predates it. - if: hashFiles('config/scripts/packaged-orcad-template.cjs') != '' + if: hashFiles('config/scripts/orcad-distribution/template/packaged-orcad-template.cjs', 'config/scripts/packaged-orcad-template.cjs') != '' uses: actions/download-artifact@v8 with: name: orcad-template @@ -225,7 +229,7 @@ jobs: timeout_minutes: 45 max_attempts: 3 retry_wait_seconds: 30 - command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON config/scripts/pinned-node-downloads.mjs darwin-arm64 darwin-x64 && node config/scripts/ensure-native-runtime.mjs --runtime=electron && if [ -f config/scripts/build-mac-notarization-overlap.mjs ]; then ORCA_MAC_RELEASE=1 node config/scripts/build-mac-notarization-overlap.mjs --publish "$ORCA_MAC_PUBLISH" --draft; else ORCA_MAC_RELEASE=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish "$ORCA_MAC_PUBLISH" -c.publish.releaseType=draft; fi + command: node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON "$(if [ -f config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs ]; then printf %s config/scripts/orcad-distribution/prebuilds/pinned-node-downloads.mjs; else printf %s config/scripts/pinned-node-downloads.mjs; fi)" darwin-arm64 darwin-x64 && node "$(if [ -f config/scripts/native-build/node-addons/ensure-native-runtime.mjs ]; then printf %s config/scripts/native-build/node-addons/ensure-native-runtime.mjs; else printf %s config/scripts/ensure-native-runtime.mjs; fi)" --runtime=electron && if { [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ] || [ -f config/scripts/build-mac-notarization-overlap.mjs ]; }; then ORCA_MAC_RELEASE=1 node "$(if [ -f config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs ]; then printf %s config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs; else printf %s config/scripts/build-mac-notarization-overlap.mjs; fi)" --publish "$ORCA_MAC_PUBLISH" --draft; else ORCA_MAC_RELEASE=1 pnpm exec electron-builder --config config/electron-builder.config.cjs --mac --publish "$ORCA_MAC_PUBLISH" -c.publish.releaseType=draft; fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ORCA_REQUIRE_ORCAD_TEMPLATE: '1' diff --git a/.github/workflows/release-policy.yml b/.github/workflows/release-policy.yml index bc6bb8136e2..60082c35049 100644 --- a/.github/workflows/release-policy.yml +++ b/.github/workflows/release-policy.yml @@ -24,6 +24,7 @@ jobs: with: sparse-checkout: | config/scripts/release-policy.mjs + config/scripts/release/versioning/release-tag-patterns.mjs config/scripts/release-tag-patterns.mjs sparse-checkout-cone-mode: false persist-credentials: false diff --git a/.github/workflows/ssh-hostile-hosts.yml b/.github/workflows/ssh-hostile-hosts.yml index a862719e06e..d129bec5c17 100644 --- a/.github/workflows/ssh-hostile-hosts.yml +++ b/.github/workflows/ssh-hostile-hosts.yml @@ -23,8 +23,11 @@ on: - 'src/shared/node-runtime-pin.ts' - 'src/shared/orcad-artifacts.ts' - 'config/scripts/build-orcad-*.mjs' + - 'config/scripts/orcad-distribution/prebuilds/build-orcad-*.mjs' + - 'config/scripts/orcad-distribution/template/build-orcad-*.mjs' - 'config/scripts/orcad-prebuild-*.mjs' - - 'config/scripts/verify-packaged-orcad-template.cjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-prebuild-*.mjs' + - 'config/scripts/orcad-distribution/template/verify-packaged-orcad-template.cjs' - 'config/patches/node-pty*' # The deploy runs over this SSH transport. - 'src/main/ssh/connection/**' @@ -149,7 +152,7 @@ jobs: - uses: ./.github/actions/install-node-dependencies - name: Build and smoke the glibc 2.17 compat slot under the glibc-217 Node run: | - compat_node="$(node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --print-runtime)" + compat_node="$(node config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --print-runtime)" case "$compat_node" in "$GITHUB_WORKSPACE"/*) ;; *) echo "glibc-217 Node cached outside the workspace: $compat_node" >&2; exit 1 ;; @@ -163,10 +166,10 @@ jobs: quay.io/pypa/manylinux2014_x86_64@sha256:6f74cabeac2432570aa4bfdb29f7c1f30313d4d6654d764c44e574b6ffdd4ed5 bash -s <<'GLIBC217_COMPAT_SLOT' set -eu export PATH="$(dirname "$COMPAT_NODE"):$PATH" - node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 - node config/scripts/build-orcad-prebuilds.mjs --require-slots linux-x64-glibc217 + node config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 + node config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs --require-slots linux-x64-glibc217 # The image's devtoolset LD_LIBRARY_PATH must not stand in for a host C++ runtime. - env -u LD_LIBRARY_PATH node config/scripts/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --smoke + env -u LD_LIBRARY_PATH node config/scripts/orcad-distribution/prebuilds/build-orcad-prebuilds.mjs --slot=linux-x64-glibc217 --smoke GLIBC217_COMPAT_SLOT - uses: actions/upload-artifact@v7 with: @@ -195,13 +198,13 @@ jobs: path: ${{ runner.temp }}/hostile-host-prebuild-lanes - name: Merge verified Linux slots run: | - node config/scripts/merge-orcad-prebuilds.mjs "$RUNNER_TEMP"/hostile-host-prebuild-lanes/* + node config/scripts/orcad-distribution/prebuilds/merge-orcad-prebuilds.mjs "$RUNNER_TEMP"/hostile-host-prebuild-lanes/* pnpm build:orcad-prebuilds --require-slots linux-x64-glibc,linux-x64-musl,linux-x64-glibc217 # Only the x64 Linux slots exist here, so the template is built for those two, and # glibc217 is staged beside its base. - uses: ./.github/actions/build-mobile-web-bundle - name: Build the orcad template - run: node config/scripts/build-orcad-template.mjs --targets linux-x64-glibc,linux-x64-musl + run: node config/scripts/orcad-distribution/template/build-orcad-template.mjs --targets linux-x64-glibc,linux-x64-musl - name: Run the hostile-host matrix env: ORCA_RUN_SSH_HOSTILE_HOSTS: '1' @@ -240,7 +243,7 @@ jobs: pnpm build:orcad-prebuilds pnpm build:orcad-prebuilds --require-slots ${{ matrix.target }} pnpm build:orcad-prebuilds --smoke - node config/scripts/build-orcad-template.mjs --targets ${{ matrix.target }} + node config/scripts/orcad-distribution/template/build-orcad-template.mjs --targets ${{ matrix.target }} - name: Run the macOS hostile-host cell env: ORCA_RUN_SSH_HOSTILE_HOSTS: '1' diff --git a/.github/workflows/ssh-windows-hosts.yml b/.github/workflows/ssh-windows-hosts.yml index e34a3183812..93b7ef1f134 100644 --- a/.github/workflows/ssh-windows-hosts.yml +++ b/.github/workflows/ssh-windows-hosts.yml @@ -24,22 +24,26 @@ on: - 'src/shared/node-runtime-pin.ts' - 'src/shared/orcad-artifacts.ts' - 'config/scripts/build-orcad-*.mjs' + - 'config/scripts/orcad-distribution/prebuilds/build-orcad-*.mjs' + - 'config/scripts/orcad-distribution/template/build-orcad-*.mjs' - 'config/scripts/orcad-prebuild-*.mjs' - - 'config/scripts/orcad-windows-process-tree.mjs' - - 'config/scripts/orcad-windows-cli-launcher.mjs' - - 'config/scripts/orcad-windows-security.mjs' - - 'config/scripts/build-windows-security-addon.mjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-prebuild-*.mjs' + - 'config/scripts/orcad-distribution/server-bundle/orcad-windows-process-tree.mjs' + - 'config/scripts/orcad-distribution/server-bundle/orcad-windows-cli-launcher.mjs' + - 'config/scripts/orcad-distribution/server-bundle/orcad-windows-security.mjs' + - 'config/scripts/native-build/windows/build-windows-security-addon.mjs' - 'native/windows-security/**' - - 'config/scripts/build-windows-cli-launcher.mjs' - - 'config/scripts/windows-rust-executable-build.mjs' + - 'config/scripts/native-build/windows/build-windows-cli-launcher.mjs' + - 'config/scripts/native-build/windows/windows-rust-executable-build.mjs' - 'native/windows-cli-launcher/**' - 'src/main/orcad/orcad-cli-launcher.ts' - '.github/actions/prepare-windows-cli-launcher/**' - 'config/patches/node-pty*' - 'config/patches/@vscode__windows-process-tree*' - - 'config/scripts/build-windows-process-tree-addon.mjs' + - 'config/scripts/native-build/windows/build-windows-process-tree-addon.mjs' - 'config/scripts/windows-process-tree-prepared-addon*.mjs' - - 'config/scripts/windows-process-tree-gyp-rebuild.mjs' + - 'config/scripts/native-build/windows/windows-process-tree-prepared-addon*.mjs' + - 'config/scripts/native-build/windows/windows-process-tree-gyp-rebuild.mjs' - 'src/shared/windows-breakaway-launch*.ts' - 'src/main/ipc/ssh/ssh-host-server-*.ts' # The deploy runs over this SSH transport. @@ -61,7 +65,7 @@ on: - '.github/workflows/ssh-windows-hosts.yml' - '.github/actions/prepare-orcad-prebuilds/**' - '.github/actions/restore-pnpm-verification/**' - - 'config/scripts/orcad-windows-prebuild-cache.mjs' + - 'config/scripts/orcad-distribution/prebuilds/orcad-windows-prebuild-cache.mjs' workflow_dispatch: inputs: cells: @@ -181,7 +185,7 @@ jobs: if [ "$REUSE_PREPARED_RUNTIME" = true ]; then reuse_args+=(--reuse-prepared-runtime) fi - node config/scripts/build-windows-process-tree-addon.mjs --arch=${{ matrix.arch }} "${reuse_args[@]}" + node config/scripts/native-build/windows/build-windows-process-tree-addon.mjs --arch=${{ matrix.arch }} "${reuse_args[@]}" - uses: ./.github/actions/prepare-orcad-prebuilds with: resolve-windows-cache: ${{ github.event_name == 'pull_request' }} @@ -200,14 +204,14 @@ jobs: if: steps.mobile-bundle.outcome != 'success' - name: Verify the mobile bundle before staging it shell: bash - run: node -e "require('./config/scripts/verify-packaged-mobile-web-bundle.cjs').assertMobileWebBundleBuilt()" + run: node -e "require('./config/scripts/desktop-distribution/runtime-verification/verify-packaged-mobile-web-bundle.cjs').assertMobileWebBundleBuilt()" - name: Build the win32 template shell: bash env: ORCA_REUSE_PREPARED_WINDOWS_SECURITY: ${{ github.event_name == 'pull_request' && steps.dependencies.outcome == 'success' }} run: | pnpm build:orcad-prebuilds --require-slots "win32-${{ matrix.arch }}" - node config/scripts/build-orcad-template.mjs --targets "win32-${{ matrix.arch }}" + node config/scripts/orcad-distribution/template/build-orcad-template.mjs --targets "win32-${{ matrix.arch }}" - wait: inbox-capability - name: Prepare the Windows inbox SSH capability after the builds if: ${{ matrix.server == 'inbox' && matrix.arch == 'arm64' && env.INBOX_PREPARATION_MODE == 'serial' }} diff --git a/.github/workflows/terminal-perf.yml b/.github/workflows/terminal-perf.yml index 6d46bc984e3..11f6a492667 100644 --- a/.github/workflows/terminal-perf.yml +++ b/.github/workflows/terminal-perf.yml @@ -86,7 +86,9 @@ jobs: const action = fs.existsSync(actionPath) ? fs.readFileSync(actionPath, 'utf8') : '' const inputs = action.split(/^inputs:[ \t]*\r?$/m)[1]?.split(/^\S/m)[0] ?? '' const supportedPostinstalls = [ + 'node config/scripts/native-build/node-addons/rebuild-native-deps.mjs', 'node config/scripts/rebuild-native-deps.mjs', + 'pnpm run build:packages && node config/scripts/native-build/node-addons/rebuild-native-deps.mjs', 'pnpm run build:packages && node config/scripts/rebuild-native-deps.mjs' ] const supportedRunner = process.env.RUNNER_KIND === 'github-hosted' || @@ -98,7 +100,7 @@ jobs: supportedPostinstalls.includes(manifest.scripts?.postinstall) && /^ native-runtime:/m.test(inputs) && /^ cache-pnpm-store-lookup-only:/m.test(inputs) && fs.existsSync('.github/actions/prepare-native-runtime/action.yml') && - fs.existsSync('config/scripts/ensure-native-runtime.mjs') + (fs.existsSync('config/scripts/native-build/node-addons/ensure-native-runtime.mjs') || fs.existsSync('config/scripts/ensure-native-runtime.mjs')) fs.appendFileSync(process.env.GITHUB_OUTPUT, `shared=${shared}\n`) NODE diff --git a/.github/workflows/unit-plan.yml b/.github/workflows/unit-plan.yml index 4c1fddbc7a9..f2a88bd2b97 100644 --- a/.github/workflows/unit-plan.yml +++ b/.github/workflows/unit-plan.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 2 - sparse-checkout: ${{ inputs.defer_shadow && '/config/scripts/ci-unit-matrix.mjs' || '' }} + sparse-checkout: ${{ inputs.defer_shadow && '/config/scripts/ci/unit-selection/ci-unit-matrix.mjs' || '' }} sparse-checkout-cone-mode: false persist-credentials: false - uses: ./.github/actions/install-node-dependencies @@ -52,9 +52,9 @@ jobs: ORCA_UNIT_FULL_SHARD_COUNT: ${{ vars.ORCA_UNIT_FULL_SHARD_COUNT || '12' }} run: | if [ "$DEFER_SHADOW" = true ]; then - node config/scripts/ci-unit-matrix.mjs + node config/scripts/ci/unit-selection/ci-unit-matrix.mjs else - node config/scripts/ci-unit-plan.mjs + node config/scripts/ci/unit-selection/ci-unit-plan.mjs fi - uses: actions/upload-artifact@v7 if: env.DEFER_SHADOW != 'true' diff --git a/.github/workflows/unit-selection-evidence.yml b/.github/workflows/unit-selection-evidence.yml index 9979549a11e..0e2904021cb 100644 --- a/.github/workflows/unit-selection-evidence.yml +++ b/.github/workflows/unit-selection-evidence.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 2 - sparse-checkout: ${{ !inputs.rebuild_plan && '/config/scripts/ci-unit-selection-review.mjs' || '' }} + sparse-checkout: ${{ !inputs.rebuild_plan && '/config/scripts/ci/unit-selection/ci-unit-selection-review.mjs' || '' }} sparse-checkout-cone-mode: false persist-credentials: false - uses: ./.github/actions/install-node-dependencies @@ -32,7 +32,7 @@ jobs: ORCA_UNIT_SELECTION_MODE: shadow ORCA_PULL_REQUEST_DRAFT: ${{ github.event.pull_request.draft }} ORCA_UNIT_FULL_SHARD_COUNT: ${{ vars.ORCA_UNIT_FULL_SHARD_COUNT || '12' }} - run: node config/scripts/ci-unit-plan.mjs + run: node config/scripts/ci/unit-selection/ci-unit-plan.mjs - uses: actions/download-artifact@v8 with: pattern: unit-shard-node-*-attempt-${{ github.run_attempt }} @@ -48,7 +48,7 @@ jobs: const env = { ...process.env } delete env['INPUT_GITHUB-TOKEN'] const args = [ - 'config/scripts/ci-unit-selection-review.mjs', + 'config/scripts/ci/unit-selection/ci-unit-selection-review.mjs', 'unit-evidence' ] if (env.REBUILD_SELECTION_PLAN === 'true') args.push('ci-shards/unit-selection.json') diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a9a0c49d77a..a9fedcc18d5 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -93,7 +93,7 @@ jobs: cache-electron-package: 'true' - name: Install Electron package binary for tests - run: node config/scripts/install-electron-package-binary.mjs + run: node config/scripts/electron-installation/platform-layout/install-electron-package-binary.mjs - name: Verify Blacksmith unit runner environment if: runner.os == 'Linux' && startsWith(inputs.runner, 'blacksmith-') @@ -112,7 +112,7 @@ jobs: ORCA_UNIT_SHARD_INDEX: ${{ matrix.shard.index }} ORCA_UNIT_SHARD_COUNT: ${{ matrix.shard.count }} ORCA_UNIT_CACHE_NAMESPACE: ${{ inputs.module_cache_namespace }} - run: node config/scripts/ci-unit-module-cache.mjs identity + run: node config/scripts/ci/unit-cache/ci-unit-module-cache.mjs identity # The key pins config, plugins, lockfile and runtimes; the newest producer for it wins. # Source edits are keyed per module by Vitest plus vitest-module-cache-resolution-key.ts. @@ -131,7 +131,7 @@ jobs: env: ORCA_UNIT_CACHE_RESTORE_HIT: ${{ steps.module-cache-restore.outputs.cache-matched-key != '' }} ORCA_UNIT_CACHE_MODE: ${{ inputs.module_cache }} - run: node config/scripts/ci-unit-module-cache.mjs prepare + run: node config/scripts/ci/unit-cache/ci-unit-module-cache.mjs prepare - uses: actions/download-artifact@v8 if: inputs.download_selection_plan @@ -145,8 +145,8 @@ jobs: continue-on-error: true run: >- node --input-type=module -e ' - import { discoverUnitFiles } from "./config/scripts/ci-unit-files.mjs"; - import { writeAssignment } from "./config/scripts/ci-shard-assignment.mjs"; + import { discoverUnitFiles } from "./config/scripts/ci/unit-selection/dependency-graph/ci-unit-files.mjs"; + import { writeAssignment } from "./config/scripts/ci/sharding/ci-shard-assignment.mjs"; writeAssignment("ci-shards/unit-discovery.json", { files: discoverUnitFiles() });' - name: Test shard @@ -158,7 +158,7 @@ jobs: run: | ORCA_SHARD_SOURCE_SHA="$(git rev-parse HEAD)" export ORCA_SHARD_SOURCE_SHA - node config/scripts/run-vitest.mjs run --config config/vitest.config.ts \ + node config/scripts/test-runtime/execution-policy/run-vitest.mjs run --config config/vitest.config.ts \ --shard=${{ matrix.shard.index }}/${{ matrix.shard.count }} \ ${{ inputs.runner == 'blacksmith-8vcpu-ubuntu-2404' && '--maxWorkers=8' || (runner.arch == 'ARM64' || inputs.runner == 'blacksmith-4vcpu-ubuntu-2404' || inputs.runner == 'ubuntu-24.04') && '--maxWorkers=4' || '' }} @@ -170,7 +170,7 @@ jobs: inputs.module_cache == 'cold' && (github.ref == 'refs/heads/main' && github.event_name != 'pull_request' || inputs.module_cache_seed && github.event_name == 'workflow_dispatch') - run: node config/scripts/ci-unit-module-cache.mjs seal + run: node config/scripts/ci/unit-cache/ci-unit-module-cache.mjs seal - name: Save unit module cache if: steps.module-cache-seal.outputs.ready == 'true' diff --git a/.github/workflows/win-crash-survival-e2e.yml b/.github/workflows/win-crash-survival-e2e.yml index a18a00c6489..0095a9d8116 100644 --- a/.github/workflows/win-crash-survival-e2e.yml +++ b/.github/workflows/win-crash-survival-e2e.yml @@ -119,7 +119,7 @@ jobs: - name: Build Windows installer (unsigned) if: steps.cache-installer.outputs.cache-hit != 'true' run: | - node config/scripts/ensure-native-runtime.mjs --runtime=electron + node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --runtime=electron pnpm run build:desktop pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never diff --git a/.github/workflows/win-orcad-serve-switch-e2e.yml b/.github/workflows/win-orcad-serve-switch-e2e.yml index 2ece63d61e7..a36e170843c 100644 --- a/.github/workflows/win-orcad-serve-switch-e2e.yml +++ b/.github/workflows/win-orcad-serve-switch-e2e.yml @@ -65,7 +65,7 @@ jobs: env: ORCA_REUSE_PREPARED_NATIVE_RUNTIME: '1' run: | - node config/scripts/ensure-native-runtime.mjs --runtime=electron + node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --runtime=electron pnpm run build:desktop:ci pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never @@ -83,9 +83,9 @@ jobs: env: ORCA_REUSE_PREPARED_WINDOWS_SECURITY: 'true' run: | - node config/scripts/ensure-native-runtime.mjs --runtime=node - node config/scripts/build-windows-process-tree-addon.mjs --arch=x64 --reuse-prepared-runtime - node config/scripts/build-orcad-template.mjs --targets win32-x64 + node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --runtime=node + node config/scripts/native-build/windows/build-windows-process-tree-addon.mjs --arch=x64 --reuse-prepared-runtime + node config/scripts/orcad-distribution/template/build-orcad-template.mjs --targets win32-x64 - name: Switch serve hosts on the installed app's profile shell: bash diff --git a/.github/workflows/win-update-survival-e2e.yml b/.github/workflows/win-update-survival-e2e.yml index eab49d27f47..2207a3a9b8b 100644 --- a/.github/workflows/win-update-survival-e2e.yml +++ b/.github/workflows/win-update-survival-e2e.yml @@ -98,7 +98,7 @@ jobs: - name: Build Windows installer (unsigned) if: steps.cache-installer.outputs.cache-hit != 'true' run: | - node config/scripts/ensure-native-runtime.mjs --runtime=electron + node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --runtime=electron pnpm run build:desktop pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never diff --git a/.github/workflows/windows-native-preparation-benchmark.yml b/.github/workflows/windows-native-preparation-benchmark.yml index 8b98ae9f737..91a42724332 100644 --- a/.github/workflows/windows-native-preparation-benchmark.yml +++ b/.github/workflows/windows-native-preparation-benchmark.yml @@ -62,7 +62,7 @@ jobs: env: SOURCE_SHA: ${{ inputs.source_sha }} BENCHMARK_RUNNER: ${{ matrix.os }} - run: node config/scripts/benchmark-windows-native-preparation.mjs + run: node "$(if [ -f config/scripts/native-build/windows/benchmark-windows-native-preparation.mjs ]; then printf %s config/scripts/native-build/windows/benchmark-windows-native-preparation.mjs; else printf %s config/scripts/benchmark-windows-native-preparation.mjs; fi)" - name: Compare warm Windows security builds and qualify fallback if: inputs.comparison == 'windows-security' shell: bash diff --git a/.github/workflows/windows-signing-rehearsal.yml b/.github/workflows/windows-signing-rehearsal.yml index 86a553fc495..542b7ca1e10 100644 --- a/.github/workflows/windows-signing-rehearsal.yml +++ b/.github/workflows/windows-signing-rehearsal.yml @@ -113,7 +113,7 @@ jobs: # Keep capture under runner.temp; all-negation files would include checkout leftovers in app.asar. ORCA_WIN_UNINSTALLER_EXPORT_PATH: ${{ runner.temp }}\uninstaller-signing\unsigned\orca-uninstaller.exe run: | - node config/scripts/ensure-native-runtime.mjs --runtime=electron + node config/scripts/native-build/node-addons/ensure-native-runtime.mjs --runtime=electron if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } @@ -248,7 +248,7 @@ jobs: # Recompute template checksums over the signed bytes, then verify the template as release-cut does. - name: Reseal the orcad template over its signed binaries - run: node config/scripts/packaged-orcad-template.cjs --reseal-signed dist/win-unpacked inner-signing-list.txt + run: node config/scripts/orcad-distribution/template/packaged-orcad-template.cjs --reseal-signed dist/win-unpacked inner-signing-list.txt - name: Restore signed uninstaller for the installer rebuild shell: pwsh diff --git a/.github/workflows/windows-typecheck-parity.yml b/.github/workflows/windows-typecheck-parity.yml index c007455460c..ef69eeab422 100644 --- a/.github/workflows/windows-typecheck-parity.yml +++ b/.github/workflows/windows-typecheck-parity.yml @@ -11,9 +11,9 @@ on: - 'config/.bun-version' - 'config/tsconfig*.json' - 'src/packages/process-host/tsconfig*.json' - - 'config/scripts/run-typecheck-projects-in-parallel.mjs' - - 'config/scripts/benchmark-preflight-compilers.mjs' - - 'config/scripts/preflight-benchmark-command.mjs' + - 'config/scripts/typecheck/project-execution/run-typecheck-projects-in-parallel.mjs' + - 'config/scripts/preflight/benchmarks/benchmark-preflight-compilers.mjs' + - 'config/scripts/preflight/benchmarks/preflight-benchmark-command.mjs' - '.github/workflows/windows-typecheck-parity.yml' workflow_dispatch: @@ -45,7 +45,7 @@ jobs: bun-version-file: config/.bun-version no-cache: true - name: Compare compiler diagnostics and project file lists - run: node config/scripts/benchmark-preflight-compilers.mjs --parity-only + run: node config/scripts/preflight/benchmarks/benchmark-preflight-compilers.mjs --parity-only - uses: actions/upload-artifact@v7 if: always() with: diff --git a/.github/workflows/wsl-orcad-e2e.yml b/.github/workflows/wsl-orcad-e2e.yml index ffe4e4835c1..cf642fe79e1 100644 --- a/.github/workflows/wsl-orcad-e2e.yml +++ b/.github/workflows/wsl-orcad-e2e.yml @@ -106,7 +106,7 @@ jobs: run: | pnpm build:orcad-prebuilds pnpm build:orcad-prebuilds --require-slots linux-x64-glibc - node config/scripts/build-orcad-template.mjs --targets linux-x64-glibc + node config/scripts/orcad-distribution/template/build-orcad-template.mjs --targets linux-x64-glibc - uses: actions/upload-artifact@v7 with: name: wsl-orcad-template