From 4e33415488b1a52fc611944bd9dd0175e2651466 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 04:22:12 -0500 Subject: [PATCH 1/8] ci(main): route workflows to Closura-owned runners Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .github/scripts/no-hosted-runners.test.cjs | 83 +++++++ .github/workflows/ci.yml | 175 ++++++--------- .github/workflows/cursor-hygiene-webhook.yml | 9 +- .github/workflows/deploy-relay.yml | 8 +- .../desktop-macos-preview-publish.yml | 57 +++-- .github/workflows/desktop-macos-preview.yml | 11 +- .github/workflows/fork-release.yml | 94 ++++++-- .github/workflows/issue-labels.yml | 9 +- .github/workflows/mobile-eas-preview.yml | 14 +- .github/workflows/mobile-eas-production.yml | 11 +- .../workflows/mobile-fingerprint-check.yml | 9 +- .../workflows/mobile-showcase-screenshots.yml | 22 +- .github/workflows/pr-size.yml | 31 ++- .github/workflows/pr-vouch.yml | 20 +- .github/workflows/publish-aur.yml | 9 +- .github/workflows/release-desktop.yml | 29 ++- .github/workflows/release.yml | 207 ++++++++++++++---- .github/workflows/thread-transfer-report.yml | 12 +- .github/workflows/web-preview.yml | 14 +- .github/workflows/windows-tests.yml | 9 +- .../scripts/deploy-relay-workflow.test.ts | 10 +- 21 files changed, 621 insertions(+), 222 deletions(-) create mode 100644 .github/scripts/no-hosted-runners.test.cjs diff --git a/.github/scripts/no-hosted-runners.test.cjs b/.github/scripts/no-hosted-runners.test.cjs new file mode 100644 index 0000000000000..dbe99b0e5af32 --- /dev/null +++ b/.github/scripts/no-hosted-runners.test.cjs @@ -0,0 +1,83 @@ +// Adapted from the native release branch's ARC-only runner guard. +const assert = require("node:assert/strict"); +const fs = require("node:fs"); +const { createRequire } = require("node:module"); +const path = require("node:path"); +const test = require("node:test"); + +const { parse } = createRequire(path.resolve(__dirname, "../../apps/server/package.json"))("yaml"); +const workflows = path.resolve(__dirname, "../workflows"); +const files = fs.readdirSync(workflows).filter((file) => /\.ya?ml$/.test(file)); +const arc = "t3code-ci-arc"; +const desktopRunner = [ + "${{ fromJSON(", + `inputs.platform == 'linux' && '["${arc}"]' ||`, + `inputs.platform == 'mac' && inputs.arch == 'arm64' && '["self-hosted","macOS","ARM64"]' ||`, + `inputs.platform == 'mac' && '["self-hosted","macOS","X64"]' ||`, + `inputs.arch == 'arm64' && '["self-hosted","Windows","ARM64"]' ||`, + `'["self-hosted","Windows","X64"]'`, + ") }}", +].join(" "); + +function violations(file, text) { + const problems = []; + if (/ci_burst_hosted/i.test(text)) problems.push(`${file}: references the retired burst switch`); + const { jobs } = parse(text); + assert.ok(jobs && Object.keys(jobs).length > 0, `${file}: no jobs`); + for (const [name, job] of Object.entries(jobs)) { + if (job.uses) { + const local = /^\.\/\.github\/workflows\/([^/]+\.ya?ml)$/.exec(job.uses); + if (!local || !files.includes(local[1])) { + problems.push(`${file}:${name}: reusable workflow must be local and covered by this check`); + } + continue; + } + const runner = job["runs-on"]; + if (runner === arc) continue; + if (Array.isArray(runner) && runner[0] === "self-hosted") { + if (runner.length === 2 && runner[1] === "macOS") continue; + if (runner.length === 3 && runner[1] === "Windows" && runner[2] === "X64") continue; + } + if ( + file === "release-desktop.yml" && + name === "build" && + typeof runner === "string" && + runner.replace(/\s+/g, " ").trim() === desktopRunner + ) + continue; + problems.push(`${file}:${name}: unsupported runner ${JSON.stringify(runner)}`); + } + return problems; +} + +test("every workflow routes only to the T3 ARC scale set or a self-hosted native runner", () => { + assert.ok(files.length > 0); + assert.deepEqual( + files.flatMap((file) => violations(file, fs.readFileSync(path.join(workflows, file), "utf8"))), + [], + ); +}); + +test("the runner guard rejects hosted labels, variable selectors and remote reusable workflows", () => { + for (const job of [ + "runs-on: ubuntu-latest", + "runs-on: macos-14", + "runs-on: windows-11-arm", + "runs-on: blacksmith-8vcpu-ubuntu-2404", + "runs-on: [self-hosted, ubuntu-latest]", + "runs-on: {group: custom, labels: macos-latest}", + "runs-on: ${{ inputs.runner }}", + "uses: other/repo/.github/workflows/ci.yml@main", + ]) { + assert.ok(violations("fixture.yml", `jobs:\n check:\n ${job}\n`).length > 0, job); + } + assert.deepEqual(violations("fixture.yml", `jobs:\n check:\n runs-on: ${arc}\n`), []); +}); + +test("mobile native static analysis only admits trusted manual runs on a self-hosted Mac", () => { + const ci = parse(fs.readFileSync(path.join(workflows, "ci.yml"), "utf8")); + assert.ok(Object.hasOwn(ci.on, "workflow_dispatch")); + const job = ci.jobs.mobile_native_static_analysis; + assert.match(job.if, /&&\s+\(github\.event_name == 'workflow_dispatch'\)$/); + assert.deepEqual(job["runs-on"], ["self-hosted", "macOS"]); +}); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 284d8e3a18f11..cfc57eae33838 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: CI on: pull_request: + branches: [main] + types: [opened, synchronize, reopened, edited, ready_for_review] + workflow_dispatch: push: branches: - main @@ -10,18 +13,29 @@ permissions: contents: read concurrency: - group: ci-${{ github.event.pull_request.number || github.sha }} + group: ci-${{ github.event.pull_request.number || github.sha }}-${{ github.triggering_actor }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: check: name: Check - runs-on: ubuntu-24.04 - timeout-minutes: 10 + # Public fork: admit only trusted humans and same-repository PR source. + if: &trusted_ci >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + ((github.event_name == 'pull_request' && + !github.event.pull_request.draft && + github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login)) || + (github.event_name == 'push' && github.ref == 'refs/heads/main')) + runs-on: t3code-ci-arc + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ @@ -36,12 +50,17 @@ jobs: fi - name: Setup Vite+ - uses: voidzero-dev/setup-vp@v1 + uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 + env: + VP_DOWNLOAD_TIMEOUT: "120" with: node-version-file: package.json - cache: true + cache: false run-install: true + - name: Reject hosted runners + run: node --test .github/scripts/no-hosted-runners.test.cjs + - name: Ensure Electron runtime is installed run: vp run --filter @t3tools/desktop ensure:electron @@ -62,7 +81,6 @@ jobs: - name: Install browser secret helper build libraries run: | - sudo sed -i 's|http://|https://|g' /etc/apt/t3-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config - name: Build desktop pipeline @@ -78,22 +96,26 @@ jobs: # limit stays at the default 4 so peak load per runner is unchanged. test: name: Test - runs-on: ubuntu-24.04 - timeout-minutes: 10 + if: *trusted_ci + runs-on: t3code-ci-arc + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ sparse-checkout-cone-mode: false - name: Setup Vite+ - uses: voidzero-dev/setup-vp@v1 + uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 + env: + VP_DOWNLOAD_TIMEOUT: "120" with: node-version-file: package.json - cache: true + cache: false run-install: true - name: Ensure Electron runtime is installed @@ -103,7 +125,6 @@ jobs: - name: Install browser secret helper build libraries run: | - sudo sed -i 's|http://|https://|g' /etc/apt/t3-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config - name: Test preview artifact validation @@ -121,8 +142,9 @@ jobs: # isolation that flag buys is preserved exactly. test_server: name: Test Server ${{ matrix.shard }} - runs-on: ubuntu-24.04 - timeout-minutes: 10 + if: *trusted_ci + runs-on: t3code-ci-arc + timeout-minutes: 15 strategy: fail-fast: false matrix: @@ -131,16 +153,19 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ sparse-checkout-cone-mode: false - name: Setup Vite+ - uses: voidzero-dev/setup-vp@v1 + uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 + env: + VP_DOWNLOAD_TIMEOUT: "120" with: node-version-file: package.json - cache: true + cache: false run-install: true # No Electron setup here: `t3` (apps/server) has no Electron dependency @@ -188,12 +213,14 @@ jobs: # for checks that take under 3s, on the critical path of every PR. rust: name: Rust - runs-on: ubuntu-24.04 - timeout-minutes: 10 + if: *trusted_ci + runs-on: t3code-ci-arc + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ @@ -224,106 +251,36 @@ jobs: rustup target add x86_64-pc-windows-gnu cargo check --locked --target x86_64-pc-windows-gnu --manifest-path native/windows-service-host/Cargo.toml - # The static analysis below needs a macOS runner, which bills ~6.7x a Linux - # minute, so gate it on the native sources it actually lints instead of paying - # for it on every push. Detection is API-only (no checkout) and fails open: if - # the diff cannot be resolved, the lint runs. - mobile_native_changes: - name: Mobile Native Changes - runs-on: ubuntu-24.04 - timeout-minutes: 5 - permissions: - contents: read - pull-requests: read - outputs: - changed: ${{ steps.detect.outputs.changed }} - steps: - - name: Detect mobile native changes - id: detect - env: - GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ github.event.pull_request.number }} - BEFORE_SHA: ${{ github.event.before }} - run: | - set -uo pipefail - - fail_open() { - echo "$* Running native static analysis." - echo "changed=true" >> "$GITHUB_OUTPUT" - exit 0 - } - - count_rows() { - printf '%s\n' "$1" | grep -c . || true - } - - # One row per changed file, holding the new path and, for a rename, - # the path it replaced: renaming a matched file out of the matched - # paths removes a lint input just like editing it. - row='[.filename, (.previous_filename // empty)] | @tsv' - - if [[ -n "${PR_NUMBER}" ]]; then - # The PR files endpoint stops at 3000 files and pagination cannot - # extend it, so cross-check against the count the PR itself reports. - expected=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}" --jq '.changed_files') \ - || fail_open "Could not read the pull request." - rows=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" --paginate --jq ".[] | ${row}") \ - || fail_open "Could not resolve changed files." - - listed=$(count_rows "$rows") - if [[ "$listed" -lt "$expected" ]]; then - fail_open "GitHub listed only ${listed} of ${expected} changed files." - fi - else - rows=$(gh api "repos/${GITHUB_REPOSITORY}/compare/${BEFORE_SHA}...${GITHUB_SHA}" --jq ".files[]? | ${row}") \ - || fail_open "Could not resolve changed files." - - # The compare endpoint reports at most 300 files and pagination does - # not extend that list, so a full list may be hiding native changes. - listed=$(count_rows "$rows") - if [[ "$listed" -ge 300 ]]; then - fail_open "GitHub listed ${listed} changed files, the compare endpoint maximum." - fi - fi - - paths=$(tr '\t' '\n' <<< "$rows") - - # Sources scripts/mobile-native-static-check.ts lints, plus the tool - # and rule configuration that decides how it lints them, plus the - # root package.json that defines the lint:mobile command. - pattern='^apps/mobile/.*\.(swift|kt|kts)$|^apps/mobile/(\.swiftlint\.yml|detekt\.yml|\.editorconfig|Brewfile)$|^scripts/mobile-native-static-check\.ts$|^package\.json$|^\.github/workflows/ci\.yml$' - - if grep -qE "$pattern" <<< "$paths"; then - echo "Native sources or lint configuration changed:" - grep -E "$pattern" <<< "$paths" - echo "changed=true" >> "$GITHUB_OUTPUT" - else - echo "No mobile native sources or lint configuration changed." - echo "changed=false" >> "$GITHUB_OUTPUT" - fi - mobile_native_static_analysis: name: Mobile Native Static Analysis - needs: mobile_native_changes - # Skip only on an explicit "no": a gate job that failed or errored leaves the - # output empty, and that must run the lint rather than silently skip it. - if: ${{ !cancelled() && needs.mobile_native_changes.outputs.changed != 'false' }} - runs-on: macos-14 - timeout-minutes: 10 + # Intentionally manual until a self-hosted Mac is available. + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name == 'workflow_dispatch') + runs-on: [self-hosted, macOS] + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ sparse-checkout-cone-mode: false - name: Setup Vite+ - uses: voidzero-dev/setup-vp@v1 + uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 + env: + VP_DOWNLOAD_TIMEOUT: "120" with: node-version-file: package.json - cache: true + cache: false run-install: | args: - --filter=@t3tools/scripts... @@ -336,22 +293,26 @@ jobs: release_smoke: name: Release Smoke - runs-on: ubuntu-24.04 - timeout-minutes: 10 + if: *trusted_ci + runs-on: t3code-ci-arc + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v6 with: + persist-credentials: false sparse-checkout: | /* !/.repos/ sparse-checkout-cone-mode: false - name: Setup Vite+ - uses: voidzero-dev/setup-vp@v1 + uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 + env: + VP_DOWNLOAD_TIMEOUT: "120" with: node-version-file: package.json - cache: true + cache: false run-install: | args: - --filter=@t3tools/scripts... diff --git a/.github/workflows/cursor-hygiene-webhook.yml b/.github/workflows/cursor-hygiene-webhook.yml index ea0f579b4ac6d..6f71705f2eae7 100644 --- a/.github/workflows/cursor-hygiene-webhook.yml +++ b/.github/workflows/cursor-hygiene-webhook.yml @@ -16,7 +16,14 @@ permissions: jobs: forward: name: POST to Cursor - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc steps: - name: POST to Cursor env: diff --git a/.github/workflows/deploy-relay.yml b/.github/workflows/deploy-relay.yml index fe45bb2ac8d82..ef3461f3dfa63 100644 --- a/.github/workflows/deploy-relay.yml +++ b/.github/workflows/deploy-relay.yml @@ -22,14 +22,14 @@ jobs: # Reject before assigning a runner; the script also checks the exact values. if: >- github.event_name == 'workflow_dispatch' && - (github.repository == 'nullStack65/t3code' || github.repository == 'kameron-smith-closura/t3code') && - (github.repository_owner_id == '112618179' || github.repository_owner_id == '274969253') && + ((github.repository == 'nullStack65/t3code' && github.repository_owner_id == '112618179') || + (github.repository == 'kameron-smith-closura/t3code' && github.repository_owner_id == '274969253')) && github.event.repository.default_branch == 'main' && github.ref == 'refs/heads/main' && ((github.actor == 'nullStack65' && github.actor_id == '112618179') || (github.actor == 'kameron-smith-closura' && github.actor_id == '274969253')) && (github.triggering_actor == 'nullStack65' || github.triggering_actor == 'kameron-smith-closura') && github.run_attempt == '1' - runs-on: ubuntu-24.04 + runs-on: t3code-ci-arc timeout-minutes: 5 outputs: source_sha: ${{ steps.validate.outputs.source_sha }} @@ -77,7 +77,7 @@ jobs: contents: read id-token: none statuses: write - runs-on: blacksmith-8vcpu-ubuntu-2404 + runs-on: t3code-ci-arc timeout-minutes: 15 environment: name: production diff --git a/.github/workflows/desktop-macos-preview-publish.yml b/.github/workflows/desktop-macos-preview-publish.yml index 4d141e327c1f7..a2455f1ec9ddf 100644 --- a/.github/workflows/desktop-macos-preview-publish.yml +++ b/.github/workflows/desktop-macos-preview-publish.yml @@ -30,13 +30,20 @@ permissions: jobs: resolve: name: Verify preview eligibility - if: >- - github.event_name == 'workflow_run' && - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' # The build workflow completes for every PR push (its label gate is on the # job), so this runs often and usually finds nothing. Keep it cheap. - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'workflow_run' || github.event.workflow_run.head_repository.full_name == github.repository) + && (github.event_name == 'workflow_run' && + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success') + runs-on: t3code-ci-arc timeout-minutes: 10 permissions: actions: read @@ -280,10 +287,18 @@ jobs: build: name: Package and sign macOS arm64 preview needs: resolve - if: needs.resolve.outputs.eligible == 'true' concurrency: group: desktop-macos-preview-${{ needs.resolve.outputs.pr_number }}-build cancel-in-progress: true + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'workflow_run' || github.event.workflow_run.head_repository.full_name == github.repository) + && (needs.resolve.outputs.eligible == 'true') uses: ./.github/workflows/release-desktop.yml secrets: CSC_LINK: ${{ secrets.CSC_LINK }} @@ -302,7 +317,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.resolve.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.resolve.outputs.relay_url }} label: macOS arm64 preview - runner: blacksmith-12vcpu-macos-26 platform: mac target: dmg arch: arm64 @@ -317,8 +331,16 @@ jobs: publish: name: Publish anonymous download needs: [resolve, build] - if: needs.resolve.outputs.eligible == 'true' && needs.build.result == 'success' - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'workflow_run' || github.event.workflow_run.head_repository.full_name == github.repository) + && (needs.resolve.outputs.eligible == 'true' && needs.build.result == 'success') + runs-on: t3code-ci-arc timeout-minutes: 10 # Its own group, so a publish never cancels a newer commit's signing job # (they would share the build group) and is never cancelled mid-upload. @@ -491,12 +513,19 @@ jobs: # that a cheap no-op for PRs that never had one. A manual unlabel before # the build consumed it withdraws the request and drops any older # download too. - if: >- - github.event_name == 'pull_request_target' && - (github.event.action == 'closed' || - (github.event.action == 'unlabeled' && github.event.label.name == 'preview:mac')) # Runs on every PR close and usually finds nothing. Keep it cheap. - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'workflow_run' || github.event.workflow_run.head_repository.full_name == github.repository) + && (github.event_name == 'pull_request_target' && + (github.event.action == 'closed' || + (github.event.action == 'unlabeled' && github.event.label.name == 'preview:mac'))) + runs-on: t3code-ci-arc timeout-minutes: 10 # Cleanup runs must complete: a close event right after an unlabel queues # behind the running cleanup instead of canceling it mid-delete. diff --git a/.github/workflows/desktop-macos-preview.yml b/.github/workflows/desktop-macos-preview.yml index 43b6c8220aaf3..a3db5f304831a 100644 --- a/.github/workflows/desktop-macos-preview.yml +++ b/.github/workflows/desktop-macos-preview.yml @@ -29,8 +29,15 @@ concurrency: jobs: build: name: Build preview JS bundle - if: github.event.label.name == 'preview:mac' - runs-on: blacksmith-32vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event.label.name == 'preview:mac') + runs-on: t3code-ci-arc timeout-minutes: 30 steps: # This repository is public, so Git needs no credentials. checkout's diff --git a/.github/workflows/fork-release.yml b/.github/workflows/fork-release.yml index 43597e256380c..a68fc18f5b35f 100644 --- a/.github/workflows/fork-release.yml +++ b/.github/workflows/fork-release.yml @@ -81,7 +81,14 @@ concurrency: jobs: preflight: name: Preflight - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc timeout-minutes: 15 outputs: version: ${{ steps.meta.outputs.version }} @@ -182,9 +189,16 @@ jobs: bundle: name: Build JS bundle - if: ${{ !inputs.upload_receipts }} needs: [preflight] - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!inputs.upload_receipts) + runs-on: t3code-ci-arc timeout-minutes: 30 env: T3CODE_RELEASE_BUILD: "1" @@ -250,9 +264,16 @@ jobs: cli_linux_x64: name: Linux x64 runtime archive - if: ${{ !inputs.upload_receipts }} needs: [preflight, bundle] - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!inputs.upload_receipts) + runs-on: t3code-ci-arc timeout-minutes: 30 env: T3CODE_RELEASE_BUILD: "1" @@ -398,8 +419,15 @@ jobs: desktop_win_x64: name: Desktop Windows x64 - if: ${{ !inputs.upload_receipts }} needs: [preflight, bundle, cli_linux_x64] + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!inputs.upload_receipts) uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -411,7 +439,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.preflight.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.preflight.outputs.relay_url }} label: Windows x64 - runner: windows-2025 platform: win target: nsis arch: x64 @@ -425,8 +452,15 @@ jobs: desktop_mac_x64: name: Desktop macOS x64 - if: ${{ !inputs.upload_receipts }} needs: [preflight, bundle] + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!inputs.upload_receipts) uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -438,7 +472,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.preflight.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.preflight.outputs.relay_url }} label: macOS x64 - runner: macos-15-intel platform: mac target: dmg arch: x64 @@ -450,8 +483,15 @@ jobs: desktop_mac_arm64: name: Desktop macOS arm64 - if: ${{ inputs.include_macos_arm64 && !inputs.upload_receipts }} needs: [preflight, bundle] + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (inputs.include_macos_arm64 && !inputs.upload_receipts) uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -463,7 +503,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.preflight.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.preflight.outputs.relay_url }} label: macOS arm64 - runner: macos-15 platform: mac target: dmg arch: arm64 @@ -475,8 +514,15 @@ jobs: qualify: name: Qualify candidate needs: [preflight, desktop_win_x64, desktop_mac_x64, desktop_mac_arm64, cli_linux_x64] - if: ${{ !cancelled() && !inputs.upload_receipts && needs.preflight.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.cli_linux_x64.result == 'success' && (inputs.include_macos_arm64 == false || needs.desktop_mac_arm64.result == 'success') }} - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && !inputs.upload_receipts && needs.preflight.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.cli_linux_x64.result == 'success' && (inputs.include_macos_arm64 == false || needs.desktop_mac_arm64.result == 'success')) + runs-on: t3code-ci-arc timeout-minutes: 20 steps: - name: Bootstrap the release commit @@ -689,8 +735,15 @@ jobs: receipts: name: Import native acceptance receipts needs: [preflight] - if: ${{ !cancelled() && needs.preflight.result == 'success' && inputs.upload_receipts }} - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && inputs.upload_receipts) + runs-on: t3code-ci-arc timeout-minutes: 15 permissions: contents: read @@ -821,8 +874,15 @@ jobs: publish: name: Promote qualified candidate needs: [preflight, qualify] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.qualify.result == 'success' && inputs.publish && inputs.candidate_run_id != '' }} - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.qualify.result == 'success' && inputs.publish && inputs.candidate_run_id != '') + runs-on: t3code-ci-arc timeout-minutes: 20 # Publication is the only job with write access and it runs in a named # environment so it can require manual approval. The job-level concurrency diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/issue-labels.yml index d6571d65d4530..7727458ec1fad 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/issue-labels.yml @@ -15,7 +15,14 @@ permissions: jobs: sync: name: Sync issue labels - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc steps: - name: Ensure managed issue labels exist uses: actions/github-script@v7 diff --git a/.github/workflows/mobile-eas-preview.yml b/.github/workflows/mobile-eas-preview.yml index d53602f8f5e80..b9cd4953c723a 100644 --- a/.github/workflows/mobile-eas-preview.yml +++ b/.github/workflows/mobile-eas-preview.yml @@ -7,10 +7,16 @@ on: jobs: preview: name: EAS Preview - if: | - contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment') && - (github.event.action != 'labeled' || github.event.label.name == '🚀 Mobile Continuous Deployment') - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment') && + (github.event.action != 'labeled' || github.event.label.name == '🚀 Mobile Continuous Deployment')) + runs-on: t3code-ci-arc concurrency: group: mobile-eas-preview-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/mobile-eas-production.yml b/.github/workflows/mobile-eas-production.yml index 227004b4882e3..d34c47f3cef57 100644 --- a/.github/workflows/mobile-eas-production.yml +++ b/.github/workflows/mobile-eas-production.yml @@ -86,7 +86,16 @@ concurrency: jobs: production: name: EAS ${{ inputs.profile || 'production' }} ${{ github.event_name == 'push' && 'auto' || inputs.mode }} - runs-on: blacksmith-8vcpu-ubuntu-2404 + # Only the upstream-style main-default repository auto-publishes from main. + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name == 'workflow_dispatch' || github.event.repository.default_branch == 'main') + runs-on: t3code-ci-arc permissions: contents: read env: diff --git a/.github/workflows/mobile-fingerprint-check.yml b/.github/workflows/mobile-fingerprint-check.yml index 5849b71ddbb8a..449aa86c89715 100644 --- a/.github/workflows/mobile-fingerprint-check.yml +++ b/.github/workflows/mobile-fingerprint-check.yml @@ -24,7 +24,14 @@ concurrency: jobs: fingerprint: name: Native fingerprint diff - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc permissions: contents: read issues: write diff --git a/.github/workflows/mobile-showcase-screenshots.yml b/.github/workflows/mobile-showcase-screenshots.yml index c64bccacdca89..f5088ed8cf5db 100644 --- a/.github/workflows/mobile-showcase-screenshots.yml +++ b/.github/workflows/mobile-showcase-screenshots.yml @@ -44,8 +44,15 @@ env: jobs: ios: name: iPhone 6.9, iPhone 6.5, and iPad 13 - if: inputs.platform == 'all' || inputs.platform == 'ios' - runs-on: blacksmith-12vcpu-macos-26 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (inputs.platform == 'all' || inputs.platform == 'ios') + runs-on: [self-hosted, macOS] # Capturing every palette multiplies the device matrix by six, and only the # one native build is shared between them. timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }} @@ -93,8 +100,15 @@ jobs: android: name: Android phone, 7-inch tablet, and 10-inch tablet - if: inputs.platform == 'all' || inputs.platform == 'android' - runs-on: blacksmith-16vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (inputs.platform == 'all' || inputs.platform == 'android') + runs-on: t3code-ci-arc # Capturing every palette multiplies the device matrix by six, and only the # one native build is shared between them. timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }} diff --git a/.github/workflows/pr-size.yml b/.github/workflows/pr-size.yml index af557dff62df8..71d84942c1f4f 100644 --- a/.github/workflows/pr-size.yml +++ b/.github/workflows/pr-size.yml @@ -10,7 +10,14 @@ permissions: jobs: prepare-config: name: Prepare PR size config - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc outputs: labels_json: ${{ steps.config.outputs.labels_json }} steps: @@ -57,8 +64,15 @@ jobs: sync-label-definitions: name: Sync PR size label definitions needs: prepare-config - if: github.event_name != 'pull_request_target' - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'pull_request_target') + runs-on: t3code-ci-arc permissions: contents: read issues: write @@ -114,8 +128,15 @@ jobs: label: name: Label PR size needs: prepare-config - if: github.event_name == 'pull_request_target' - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name == 'pull_request_target') + runs-on: t3code-ci-arc permissions: contents: read issues: read diff --git a/.github/workflows/pr-vouch.yml b/.github/workflows/pr-vouch.yml index c4abb08b727b2..333f986d31e5c 100644 --- a/.github/workflows/pr-vouch.yml +++ b/.github/workflows/pr-vouch.yml @@ -20,7 +20,14 @@ permissions: jobs: collect-targets: name: Collect PR targets - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc outputs: targets: ${{ steps.collect.outputs.targets }} steps: @@ -65,8 +72,15 @@ jobs: label: name: Label PR ${{ matrix.target.number }} needs: collect-targets - if: ${{ needs.collect-targets.outputs.targets != '[]' }} - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (needs.collect-targets.outputs.targets != '[]') + runs-on: t3code-ci-arc concurrency: group: pr-vouch-${{ matrix.target.number }} cancel-in-progress: true diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml index 62f8fd1f5470c..d8843709a59ac 100644 --- a/.github/workflows/publish-aur.yml +++ b/.github/workflows/publish-aur.yml @@ -37,7 +37,14 @@ concurrency: jobs: publish: name: Validate and publish - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc timeout-minutes: 30 container: image: archlinux:base-devel diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 73360e2ca787d..64db47f28bc37 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -39,9 +39,6 @@ on: label: required: true type: string - runner: - required: true - type: string platform: required: true type: string @@ -104,7 +101,21 @@ permissions: jobs: build: name: Build ${{ inputs.label }} - runs-on: ${{ inputs.runner }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: >- + ${{ fromJSON( + inputs.platform == 'linux' && '["t3code-ci-arc"]' || + inputs.platform == 'mac' && inputs.arch == 'arm64' && '["self-hosted","macOS","ARM64"]' || + inputs.platform == 'mac' && '["self-hosted","macOS","X64"]' || + inputs.arch == 'arm64' && '["self-hosted","Windows","ARM64"]' || + '["self-hosted","Windows","X64"]' + ) }} timeout-minutes: 30 env: T3CODE_CLERK_PUBLISHABLE_KEY: ${{ inputs.clerk_publishable_key }} @@ -112,6 +123,16 @@ jobs: T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ inputs.clerk_cli_oauth_client_id }} T3CODE_RELAY_URL: ${{ inputs.relay_url }} steps: + - name: Require native Linux build architecture + if: inputs.platform == 'linux' + env: + BUILD_ARCH: ${{ inputs.arch }} + run: | + case "${BUILD_ARCH}:${RUNNER_ARCH}" in + x64:X64|arm64:ARM64) ;; + *) echo "::error::The T3 ARC runner cannot build native Linux ${BUILD_ARCH} artifacts on ${RUNNER_ARCH}."; exit 1 ;; + esac + # This repository is public, so Git needs no credentials. checkout's # credential cleanup runs submodule foreach even with submodules disabled, # which fails on the orphaned gitlinks in our vendored .repos tree. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8890de34e7213..76ee0fafd7600 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,14 @@ jobs: # have already run. Scheduled runs also decide here whether a nightly is due. resolve_commit: name: Resolve release commit - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: t3code-ci-arc timeout-minutes: 5 outputs: ref: ${{ steps.resolve.outputs.ref }} @@ -98,10 +105,16 @@ jobs: preflight: name: Preflight needs: [resolve_commit] - if: | - needs.resolve_commit.result == 'success' && - (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true') - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (needs.resolve_commit.result == 'success' && + (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true')) + runs-on: t3code-ci-arc timeout-minutes: 10 outputs: release_channel: ${{ steps.release_meta.outputs.release_channel }} @@ -230,8 +243,15 @@ jobs: quality: name: Release quality checks needs: [preflight] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }} - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success') + runs-on: t3code-ci-arc timeout-minutes: 10 steps: - name: Checkout @@ -272,10 +292,16 @@ jobs: # Consumes only the release commit, not preflight's resolved version, so it # runs alongside preflight instead of after it. The condition mirrors preflight's. needs: [resolve_commit] - if: | - needs.resolve_commit.result == 'success' && - (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true') - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (needs.resolve_commit.result == 'success' && + (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true')) + runs-on: t3code-ci-arc timeout-minutes: 5 environment: name: production @@ -386,8 +412,15 @@ jobs: # Same gating as relay_public_config: only the release commit is needed, so # this runs alongside preflight. See the condition comment there. needs: [preflight, relay_public_config] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' }} - runs-on: blacksmith-32vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success') + runs-on: t3code-ci-arc timeout-minutes: 30 env: T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }} @@ -476,7 +509,14 @@ jobs: desktop_mac_arm64: name: Desktop macOS arm64 needs: [preflight, relay_public_config, build_bundle] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -488,7 +528,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: macOS arm64 - runner: blacksmith-12vcpu-macos-26 platform: mac target: dmg arch: arm64 @@ -499,7 +538,14 @@ jobs: desktop_mac_x64: name: Desktop macOS x64 needs: [preflight, relay_public_config, build_bundle] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -511,7 +557,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: macOS x64 - runner: blacksmith-12vcpu-macos-26 platform: mac target: dmg arch: x64 @@ -525,7 +570,14 @@ jobs: desktop_linux_x64: name: Desktop Linux x64 needs: [preflight, relay_public_config, build_bundle] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -537,7 +589,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: Linux x64 - runner: blacksmith-32vcpu-ubuntu-2404 platform: linux target: AppImage arch: x64 @@ -550,7 +601,14 @@ jobs: desktop_linux_arm64: name: Desktop Linux arm64 needs: [preflight, relay_public_config, build_bundle] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -562,7 +620,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: Linux arm64 - runner: ubuntu-24.04-arm platform: linux target: AppImage arch: arm64 @@ -577,7 +634,14 @@ jobs: desktop_win_x64: name: Desktop Windows x64 needs: [preflight, relay_public_config, build_bundle, desktop_linux_x64] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -589,7 +653,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: Windows x64 - runner: blacksmith-32vcpu-windows-2025 platform: win target: nsis arch: x64 @@ -600,7 +663,14 @@ jobs: desktop_win_arm64: name: Desktop Windows arm64 needs: [preflight, relay_public_config, build_bundle, desktop_linux_arm64] - if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success') uses: ./.github/workflows/release-desktop.yml secrets: inherit with: @@ -612,7 +682,6 @@ jobs: clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }} relay_url: ${{ needs.relay_public_config.outputs.relay_url }} label: Windows arm64 - runner: windows-11-arm platform: win target: nsis arch: arm64 @@ -636,8 +705,15 @@ jobs: desktop_win_x64, desktop_win_arm64, ] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }} - runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success') + runs-on: t3code-ci-arc timeout-minutes: 15 permissions: contents: read @@ -698,8 +774,15 @@ jobs: desktop_win_arm64, publish_cli, ] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' && needs.publish_cli.result == 'success' }} - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' && needs.publish_cli.result == 'success') + runs-on: t3code-ci-arc timeout-minutes: 30 permissions: contents: write @@ -872,7 +955,14 @@ jobs: publish_aur: name: Publish AUR package needs: [preflight, release] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }} + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview') uses: ./.github/workflows/publish-aur.yml with: release_tag: ${{ needs.preflight.outputs.tag }} @@ -882,8 +972,15 @@ jobs: deploy_web: name: Deploy hosted web app needs: [preflight, relay_public_config, release] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }} - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview') + runs-on: t3code-ci-arc timeout-minutes: 10 env: T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }} @@ -1001,8 +1098,15 @@ jobs: deploy_marketing: name: Deploy marketing site needs: [preflight, release] - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'nightly' }} - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'nightly') + runs-on: t3code-ci-arc timeout-minutes: 10 env: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} @@ -1054,9 +1158,16 @@ jobs: finalize: name: Finalize release - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }} needs: [preflight, release] - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (!failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable') + runs-on: t3code-ci-arc timeout-minutes: 10 steps: - id: app_token @@ -1133,16 +1244,22 @@ jobs: announce_discord: name: Announce release on Discord - if: | - always() && !cancelled() && - needs.preflight.result == 'success' && - needs.preflight.outputs.release_channel != 'preview' && - needs.relay_public_config.result == 'success' && - needs.release.result == 'success' && - needs.deploy_web.result == 'success' && - (needs.finalize.result == 'success' || needs.finalize.result == 'skipped') needs: [preflight, relay_public_config, release, deploy_web, finalize] - runs-on: blacksmith-8vcpu-ubuntu-2404 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (always() && !cancelled() && + needs.preflight.result == 'success' && + needs.preflight.outputs.release_channel != 'preview' && + needs.relay_public_config.result == 'success' && + needs.release.result == 'success' && + needs.deploy_web.result == 'success' && + (needs.finalize.result == 'success' || needs.finalize.result == 'skipped')) + runs-on: t3code-ci-arc timeout-minutes: 10 steps: - name: Checkout diff --git a/.github/workflows/thread-transfer-report.yml b/.github/workflows/thread-transfer-report.yml index 23eec72923bd8..e1b472b3a8bee 100644 --- a/.github/workflows/thread-transfer-report.yml +++ b/.github/workflows/thread-transfer-report.yml @@ -13,8 +13,16 @@ permissions: jobs: publish: name: Publish PR comment - if: github.event.workflow_run.event == 'pull_request' - runs-on: ubuntu-24.04 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event_name != 'workflow_run' || github.event.workflow_run.head_repository.full_name == github.repository) + && (github.event.workflow_run.event == 'pull_request') + runs-on: t3code-ci-arc concurrency: group: thread-transfer-report-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.id }} cancel-in-progress: true diff --git a/.github/workflows/web-preview.yml b/.github/workflows/web-preview.yml index f9cc3b063fcdb..3b524b13e8a30 100644 --- a/.github/workflows/web-preview.yml +++ b/.github/workflows/web-preview.yml @@ -34,10 +34,16 @@ jobs: # workflow should skip rather than fail for them. On `labeled` events, only # the preview label itself triggers a deploy. if: >- - github.event.pull_request.head.repo.full_name == github.repository && - contains(github.event.pull_request.labels.*.name, 'preview:web') && - (github.event.action != 'labeled' || github.event.label.name == 'preview:web') - runs-on: blacksmith-8vcpu-ubuntu-2404 + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) && + (github.event.pull_request.head.repo.full_name == github.repository && + contains(github.event.pull_request.labels.*.name, 'preview:web') && + (github.event.action != 'labeled' || github.event.label.name == 'preview:web')) + runs-on: t3code-ci-arc timeout-minutes: 10 env: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 3a70ad5a26a05..094ec570486bf 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -26,7 +26,14 @@ permissions: jobs: test: name: Test (${{ inputs.package || 'all non-server' }}) - runs-on: blacksmith-8vcpu-windows-2025 + if: >- + github.repository_id == '1372173214' && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.triggering_actor) && + (github.event.pull_request == null || + (github.event.pull_request.head.repo.full_name == github.repository && + contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.event.pull_request.user.login))) + runs-on: [self-hosted, Windows, X64] timeout-minutes: 45 steps: - name: Checkout diff --git a/apps/server/scripts/deploy-relay-workflow.test.ts b/apps/server/scripts/deploy-relay-workflow.test.ts index 81f01347cb1d3..53adf81f1044f 100644 --- a/apps/server/scripts/deploy-relay-workflow.test.ts +++ b/apps/server/scripts/deploy-relay-workflow.test.ts @@ -253,7 +253,15 @@ describe("production relay admission", () => { it("rejects unqualified runner admission before using the read-only GitHub token", () => { expect(admit.if.replace(/\s+/g, " ").trim()).toBe( - "github.event_name == 'workflow_dispatch' && github.repository == 'nullStack65/t3code' && github.repository_owner_id == '112618179' && github.event.repository.default_branch == 'main' && github.ref == 'refs/heads/main' && github.actor == 'nullStack65' && github.actor_id == '112618179' && github.triggering_actor == 'nullStack65' && github.run_attempt == '1'", + [ + "github.event_name == 'workflow_dispatch'", + "((github.repository == 'nullStack65/t3code' && github.repository_owner_id == '112618179') || (github.repository == 'kameron-smith-closura/t3code' && github.repository_owner_id == '274969253'))", + "github.event.repository.default_branch == 'main'", + "github.ref == 'refs/heads/main'", + "((github.actor == 'nullStack65' && github.actor_id == '112618179') || (github.actor == 'kameron-smith-closura' && github.actor_id == '274969253'))", + "(github.triggering_actor == 'nullStack65' || github.triggering_actor == 'kameron-smith-closura')", + "github.run_attempt == '1'", + ].join(" && "), ); }); }); From 40d2c80e12a8304fcf1ae3d70d075bd454049a73 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 04:30:26 -0500 Subject: [PATCH 2/8] fix(ci): restore the T3 main test baseline Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .../src/app/DesktopIsolationProfile.ts | 3 +- apps/mobile/package.json | 2 +- .../TransferBudgetScenario.integration.ts | 32 +++++++++++-------- .../src/orchestration/SessionSpendGuard.ts | 2 +- apps/server/src/pathExpansion.ts | 6 +--- .../026_CanonicalizeModelSelectionOptions.ts | 17 +++++----- .../src/project/AgentSessionImporter.test.ts | 32 +++++++++++-------- apps/server/src/server.test.ts | 2 +- .../sourceControl/SourceControlDiscovery.ts | 2 +- packages/shared/src/isolationRoot.ts | 4 +-- pnpm-lock.yaml | 2 +- 11 files changed, 55 insertions(+), 49 deletions(-) diff --git a/apps/desktop/src/app/DesktopIsolationProfile.ts b/apps/desktop/src/app/DesktopIsolationProfile.ts index 4855f1150c276..e629531fb4dcc 100644 --- a/apps/desktop/src/app/DesktopIsolationProfile.ts +++ b/apps/desktop/src/app/DesktopIsolationProfile.ts @@ -9,7 +9,8 @@ import { export const isolationProfile = resolveDesktopIsolationProfile({ argv: process.argv, - isPackaged: Electron.app.isPackaged, + // The Electron npm module exposes no app API when imported by Node. + isPackaged: Electron.app?.isPackaged ?? false, // oxlint-disable-next-line t3code/no-global-process-runtime -- The synchronous pre-ready bootstrap must reject unsupported OS targets before Effect services can start. platform: NodeOS.platform(), }); diff --git a/apps/mobile/package.json b/apps/mobile/package.json index dba137f304722..051bdd80bad93 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -56,7 +56,7 @@ "@noble/curves": "catalog:", "@pierre/diffs": "catalog:", "@react-native-ai/apple": "0.12.0", - "@react-native-menu/menu": "^2.0.0", + "@react-native-menu/menu": "2.0.0", "@react-navigation/elements": "2.9.26", "@react-navigation/native": "7.3.4", "@react-navigation/native-stack": "7.17.6", diff --git a/apps/server/integration/TransferBudgetScenario.integration.ts b/apps/server/integration/TransferBudgetScenario.integration.ts index 4c50d60295601..9d59fa9087298 100644 --- a/apps/server/integration/TransferBudgetScenario.integration.ts +++ b/apps/server/integration/TransferBudgetScenario.integration.ts @@ -100,21 +100,25 @@ export const seedTransferBudgetHistory = Effect.fn("TransferBudget.seedHistory") yield* harness.adapterHarness.queueTurnResponse(TRANSFER_THREAD_ID, response); } - yield* harness.engine.dispatch({ - type: "thread.turn.start", - commandId: CommandId.make(`transfer:${provider}:turn:${turnIndex + 1}`), - threadId: TRANSFER_THREAD_ID, - message: { - messageId: MessageId.make(`transfer-user-${turnIndex + 1}`), - role: "user", - text: `Inspect transfer behavior for historical turn ${turnIndex + 1}.`, - attachments: [], + // Replay the prompts as interactive turns on the imported thread. + yield* harness.engine.dispatch( + { + type: "thread.turn.start", + commandId: CommandId.make(`transfer:${provider}:turn:${turnIndex + 1}`), + threadId: TRANSFER_THREAD_ID, + message: { + messageId: MessageId.make(`transfer-user-${turnIndex + 1}`), + role: "user", + text: `Inspect transfer behavior for historical turn ${turnIndex + 1}.`, + attachments: [], + }, + modelSelection, + runtimeMode: "approval-required", + interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE, + createdAt: turnTimestamp(turnIndex), }, - modelSelection, - runtimeMode: "approval-required", - interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE, - createdAt: turnTimestamp(turnIndex), - }); + { origin: { surface: "web" } }, + ); yield* waitForTurnQuiesced(harness, turnIndex + 1); } }); diff --git a/apps/server/src/orchestration/SessionSpendGuard.ts b/apps/server/src/orchestration/SessionSpendGuard.ts index 8c40b62c554ee..d00224dcb858b 100644 --- a/apps/server/src/orchestration/SessionSpendGuard.ts +++ b/apps/server/src/orchestration/SessionSpendGuard.ts @@ -16,7 +16,7 @@ import { DEFAULT_THREAD_TITLE } from "./threadTitles.ts"; export const SPEND_GUARD_FLAGGED_KIND = "spend-guard.flagged"; export const SPEND_GUARD_STOPPED_KIND = "spend-guard.stopped"; -export const SPEND_GUARD_RELEASED_KIND = "spend-guard.released"; +const SPEND_GUARD_RELEASED_KIND = "spend-guard.released"; export const CONTEXT_WINDOW_KIND = "context-window.updated"; export const SPEND_GUARD_ACTIVITY_KINDS = [ diff --git a/apps/server/src/pathExpansion.ts b/apps/server/src/pathExpansion.ts index 97beed9c0a84f..14b6fc101972f 100644 --- a/apps/server/src/pathExpansion.ts +++ b/apps/server/src/pathExpansion.ts @@ -40,11 +40,7 @@ export function expandHomePathWith(value: string, path: Path.Path): string { return expandHomePathFromWith(value, effectiveHomeDirectory(process.env, []), path); } -export function expandHomePathFromWith( - value: string, - homeDirectory: string, - path: Path.Path, -): string { +function expandHomePathFromWith(value: string, homeDirectory: string, path: Path.Path): string { if (value === "~") return homeDirectory; if (value.startsWith("~/") || value.startsWith("~\\")) { return path.join(homeDirectory, value.slice(2)); diff --git a/apps/server/src/persistence/Migrations/026_CanonicalizeModelSelectionOptions.ts b/apps/server/src/persistence/Migrations/026_CanonicalizeModelSelectionOptions.ts index 15c08debf64c4..f376f4c98aef3 100644 --- a/apps/server/src/persistence/Migrations/026_CanonicalizeModelSelectionOptions.ts +++ b/apps/server/src/persistence/Migrations/026_CanonicalizeModelSelectionOptions.ts @@ -28,12 +28,13 @@ import * as SqlClient from "effect/unstable/sql/SqlClient"; export default Effect.gen(function* () { const sql = yield* SqlClient.SqlClient; + // Reapply the JSON subtype after each subquery so json_set inserts an array. yield* sql` UPDATE projection_threads SET model_selection_json = json_set( model_selection_json, '$.options', - ( + json(( SELECT json_group_array( json_object( 'id', key, @@ -48,7 +49,7 @@ export default Effect.gen(function* () { FROM json_each(json_extract(model_selection_json, '$.options')) WHERE (type = 'text' AND trim(coalesce(atom, '')) != '') OR type IN ('true', 'false') - ) + )) ) WHERE model_selection_json IS NOT NULL AND json_type(model_selection_json, '$.options') = 'object' @@ -59,7 +60,7 @@ export default Effect.gen(function* () { SET default_model_selection_json = json_set( default_model_selection_json, '$.options', - ( + json(( SELECT json_group_array( json_object( 'id', key, @@ -74,7 +75,7 @@ export default Effect.gen(function* () { FROM json_each(json_extract(default_model_selection_json, '$.options')) WHERE (type = 'text' AND trim(coalesce(atom, '')) != '') OR type IN ('true', 'false') - ) + )) ) WHERE default_model_selection_json IS NOT NULL AND json_type(default_model_selection_json, '$.options') = 'object' @@ -85,7 +86,7 @@ export default Effect.gen(function* () { SET payload_json = json_set( payload_json, '$.modelSelection.options', - ( + json(( SELECT json_group_array( json_object( 'id', key, @@ -100,7 +101,7 @@ export default Effect.gen(function* () { FROM json_each(json_extract(payload_json, '$.modelSelection.options')) WHERE (type = 'text' AND trim(coalesce(atom, '')) != '') OR type IN ('true', 'false') - ) + )) ) WHERE event_type IN ( 'thread.created', @@ -115,7 +116,7 @@ export default Effect.gen(function* () { SET payload_json = json_set( payload_json, '$.defaultModelSelection.options', - ( + json(( SELECT json_group_array( json_object( 'id', key, @@ -130,7 +131,7 @@ export default Effect.gen(function* () { FROM json_each(json_extract(payload_json, '$.defaultModelSelection.options')) WHERE (type = 'text' AND trim(coalesce(atom, '')) != '') OR type IN ('true', 'false') - ) + )) ) WHERE event_type IN ('project.created', 'project.meta-updated') AND json_type(payload_json, '$.defaultModelSelection.options') = 'object' diff --git a/apps/server/src/project/AgentSessionImporter.test.ts b/apps/server/src/project/AgentSessionImporter.test.ts index efc65d4f53783..83e1c44736e11 100644 --- a/apps/server/src/project/AgentSessionImporter.test.ts +++ b/apps/server/src/project/AgentSessionImporter.test.ts @@ -969,21 +969,25 @@ it.layer(integrationLayer)("AgentSessionImporter integration", (it) => { expect(importedThread.session).toBeNull(); expect(importedThread.latestTurn).toBeNull(); - yield* engine.dispatch({ - type: "thread.turn.start", - commandId: CommandId.make(`resume-imported-${source}`), - threadId, - message: { - messageId: MessageId.make(`resume-imported-message-${source}`), - role: "user", - text: "Continue this session", - attachments: [], + // Imported sessions are resumed from an interactive client. + yield* engine.dispatch( + { + type: "thread.turn.start", + commandId: CommandId.make(`resume-imported-${source}`), + threadId, + message: { + messageId: MessageId.make(`resume-imported-message-${source}`), + role: "user", + text: "Continue this session", + attachments: [], + }, + modelSelection: importedThread.modelSelection, + runtimeMode: importedThread.runtimeMode, + interactionMode: importedThread.interactionMode, + createdAt: "2026-08-24T10:02:00.000Z", }, - modelSelection: importedThread.modelSelection, - runtimeMode: importedThread.runtimeMode, - interactionMode: importedThread.interactionMode, - createdAt: "2026-08-24T10:02:00.000Z", - }); + { origin: { surface: "web" } }, + ); yield* Deferred.await(turnSent); yield* reactor.drain; expect(startSession).toHaveBeenCalledExactlyOnceWith( diff --git a/apps/server/src/server.test.ts b/apps/server/src/server.test.ts index f9730d7aef662..432a57993d0d4 100644 --- a/apps/server/src/server.test.ts +++ b/apps/server/src/server.test.ts @@ -12691,7 +12691,7 @@ it.live( const baseUrl = yield* getHttpServerUrl(); const cookie = yield* getAuthenticatedSessionCookieHeader(); - const wsUrl = baseUrl.replace(/^http:/, "ws:") + "/ws"; + const wsUrl = baseUrl.replace(/^http:/, "ws:") + "/ws?clientSurface=web"; return yield* Effect.scoped( Effect.gen(function* () { diff --git a/apps/server/src/sourceControl/SourceControlDiscovery.ts b/apps/server/src/sourceControl/SourceControlDiscovery.ts index 90423924e8896..03e73e65b56f9 100644 --- a/apps/server/src/sourceControl/SourceControlDiscovery.ts +++ b/apps/server/src/sourceControl/SourceControlDiscovery.ts @@ -143,7 +143,7 @@ export const make = Effect.gen(function* () { export const layer = Layer.effect(SourceControlDiscovery, make); /** Isolation profiles report no external account discovery or host tool probes. */ -export const layerDisabled = Layer.succeed( +const layerDisabled = Layer.succeed( SourceControlDiscovery, SourceControlDiscovery.of({ discover: Effect.succeed({ diff --git a/packages/shared/src/isolationRoot.ts b/packages/shared/src/isolationRoot.ts index 4734c6fcfc5c6..29b0391a650fd 100644 --- a/packages/shared/src/isolationRoot.ts +++ b/packages/shared/src/isolationRoot.ts @@ -166,7 +166,7 @@ function claimProfile(root: string, accountHomes: ReadonlyArray): void { } } -export function assertClaimedIsolationProfile(root: string): void { +function assertClaimedIsolationProfile(root: string): void { if (!NodePath.isAbsolute(root) || root.includes("\0")) { throw new IsolationRootError("The isolation profile path must be absolute."); } @@ -200,7 +200,7 @@ export function assertClaimedIsolationProfile(root: string): void { } } -export function isolationRootFromEnvironment( +function isolationRootFromEnvironment( environment: Readonly> = process.env, ): string | undefined { const root = parseIsolationRoot([], environment); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6abe9c435482..3dff26a3ee5bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -270,7 +270,7 @@ importers: specifier: 0.12.0 version: 0.12.0(patch_hash=2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d)(react-native@0.86.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6)) '@react-native-menu/menu': - specifier: ^2.0.0 + specifier: 2.0.0 version: 2.0.0(patch_hash=f63d256bf6a97a873b5e628eb595bd6ef0075ddd5bdd890fc920f7a6024290dd)(react-native@0.86.3(@babel/core@7.29.7)(@react-native/metro-config@0.86.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.2.16)(bufferutil@4.1.0)(react@19.2.3)(utf-8-validate@6.0.6))(react@19.2.3) '@react-navigation/elements': specifier: 2.9.26 From e87fc0b78b7b40dbdc6a9cb6080d2ae1de8c3559 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 04:40:17 -0500 Subject: [PATCH 3/8] fix(ci): bootstrap the locked workspace toolchain on ARC Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .github/actions/setup-main-vp/action.yml | 33 +++++++++++++++ .github/workflows/ci.yml | 40 +++---------------- .../workflows/mobile-fingerprint-check.yml | 17 +------- 3 files changed, 41 insertions(+), 49 deletions(-) create mode 100644 .github/actions/setup-main-vp/action.yml diff --git a/.github/actions/setup-main-vp/action.yml b/.github/actions/setup-main-vp/action.yml new file mode 100644 index 0000000000000..8d86e478ad257 --- /dev/null +++ b/.github/actions/setup-main-vp/action.yml @@ -0,0 +1,33 @@ +name: Set up main CI toolchain +description: Install the workspace-pinned Node, Vite+ and pnpm on an ARC worker. +inputs: + filter: + description: Optional pnpm workspace filter. + required: false +runs: + using: composite + steps: + - uses: actions/setup-node@v6 + with: + node-version-file: package.json + package-manager-cache: false + - name: Install pinned pnpm + shell: bash + run: | + set -euo pipefail + pnpm_package=$(node --print "require('./package.json').packageManager") + [[ "$pnpm_package" =~ ^pnpm@[0-9]+\.[0-9]+\.[0-9]+$ ]] + prefix="$RUNNER_TEMP/t3-ci-tools" + npm install --prefix "$prefix" --no-audit --no-fund "$pnpm_package" + echo "$prefix/node_modules/.bin" >> "$GITHUB_PATH" + - name: Install locked dependencies and expose workspace Vite+ + shell: bash + env: + WORKSPACE_FILTER: ${{ inputs.filter }} + run: | + args=(--frozen-lockfile) + if [[ -n "$WORKSPACE_FILTER" ]]; then + args+=(--filter=@t3tools/monorepo "--filter=$WORKSPACE_FILTER") + fi + pnpm install "${args[@]}" + echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfc57eae33838..961e7e61d0022 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,14 +49,7 @@ jobs: exit 1 fi - - name: Setup Vite+ - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 - env: - VP_DOWNLOAD_TIMEOUT: "120" - with: - node-version-file: package.json - cache: false - run-install: true + - uses: ./.github/actions/setup-main-vp - name: Reject hosted runners run: node --test .github/scripts/no-hosted-runners.test.cjs @@ -75,7 +68,7 @@ jobs: run: vp run lint:restyle-ceiling - name: Typecheck - run: vpr typecheck + run: vp run typecheck - uses: ./.github/actions/setup-apt-mirrors @@ -109,14 +102,7 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - name: Setup Vite+ - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 - env: - VP_DOWNLOAD_TIMEOUT: "120" - with: - node-version-file: package.json - cache: false - run-install: true + - uses: ./.github/actions/setup-main-vp - name: Ensure Electron runtime is installed run: vp run --filter @t3tools/desktop ensure:electron @@ -159,14 +145,7 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - name: Setup Vite+ - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 - env: - VP_DOWNLOAD_TIMEOUT: "120" - with: - node-version-file: package.json - cache: false - run-install: true + - uses: ./.github/actions/setup-main-vp # No Electron setup here: `t3` (apps/server) has no Electron dependency # and none of its tests touch the runtime. Only the non-server `test` @@ -306,16 +285,9 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - name: Setup Vite+ - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0 - env: - VP_DOWNLOAD_TIMEOUT: "120" + - uses: ./.github/actions/setup-main-vp with: - node-version-file: package.json - cache: false - run-install: | - args: - - --filter=@t3tools/scripts... + filter: "@t3tools/scripts..." - name: Exercise release-only workflow steps run: node scripts/release-smoke.ts diff --git a/.github/workflows/mobile-fingerprint-check.yml b/.github/workflows/mobile-fingerprint-check.yml index 449aa86c89715..5844f1ff88df1 100644 --- a/.github/workflows/mobile-fingerprint-check.yml +++ b/.github/workflows/mobile-fingerprint-check.yml @@ -64,23 +64,10 @@ jobs: echo "No native fingerprint inputs changed; clearing any stale native change label." >> "$GITHUB_STEP_SUMMARY" fi - - name: Setup Vite+ + - uses: ./.github/actions/setup-main-vp if: steps.changes.outputs.relevant == 'true' - uses: voidzero-dev/setup-vp@v1 with: - node-version-file: package.json - cache: true - run-install: | - args: - - --filter=@t3tools/mobile... - - - name: Expose pnpm - if: steps.changes.outputs.relevant == 'true' - run: | - pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")" - vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin" - echo "$vp_pnpm_bin" >> "$GITHUB_PATH" - "$vp_pnpm_bin/pnpm" --version + filter: "@t3tools/mobile..." - name: Fingerprint merge result if: steps.changes.outputs.relevant == 'true' From 1bbe695f9a00cda007152784c1e492ee613a7402 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 04:49:56 -0500 Subject: [PATCH 4/8] fix(ci): install native build tools on ARC Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .github/actions/setup-main-vp/action.yml | 6 ++++++ .github/workflows/ci.yml | 25 ++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/actions/setup-main-vp/action.yml b/.github/actions/setup-main-vp/action.yml index 8d86e478ad257..7c38cc97ed14a 100644 --- a/.github/actions/setup-main-vp/action.yml +++ b/.github/actions/setup-main-vp/action.yml @@ -20,6 +20,12 @@ runs: prefix="$RUNNER_TEMP/t3-ci-tools" npm install --prefix "$prefix" --no-audit --no-fund "$pnpm_package" echo "$prefix/node_modules/.bin" >> "$GITHUB_PATH" + - name: Install native build dependencies + if: inputs.filter == '' + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y build-essential python3 libsecret-1-dev pkg-config - name: Install locked dependencies and expose workspace Vite+ shell: bash env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 961e7e61d0022..4ffd66d95bc23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,8 @@ jobs: exit 1 fi + - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-vp - name: Reject hosted runners @@ -70,12 +72,6 @@ jobs: - name: Typecheck run: vp run typecheck - - uses: ./.github/actions/setup-apt-mirrors - - - name: Install browser secret helper build libraries - run: | - sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config - - name: Build desktop pipeline run: vp run build:desktop @@ -102,17 +98,13 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false + - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-vp - name: Ensure Electron runtime is installed run: vp run --filter @t3tools/desktop ensure:electron - - uses: ./.github/actions/setup-apt-mirrors - - - name: Install browser secret helper build libraries - run: | - sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config - - name: Test preview artifact validation run: python3 -B .github/scripts/stage-preview-bundle.test.py @@ -145,6 +137,8 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false + - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-vp # No Electron setup here: `t3` (apps/server) has no Electron dependency @@ -205,6 +199,13 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false + - uses: ./.github/actions/setup-apt-mirrors + + - name: Install native and Windows cross-compilers + run: | + sudo apt-get update + sudo apt-get install -y build-essential gcc-mingw-w64-x86-64 + - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: From bb4dd5e814ad049491614ae14b61be5bfb79660c Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 04:59:10 -0500 Subject: [PATCH 5/8] fix(ci): restore the merge checkout after fingerprinting Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .github/workflows/mobile-fingerprint-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mobile-fingerprint-check.yml b/.github/workflows/mobile-fingerprint-check.yml index 5844f1ff88df1..2fda829c3a2ad 100644 --- a/.github/workflows/mobile-fingerprint-check.yml +++ b/.github/workflows/mobile-fingerprint-check.yml @@ -83,6 +83,8 @@ jobs: env: BASE_SHA: ${{ steps.changes.outputs.base_sha }} run: | + # Post steps still need the composite action from the merge commit. + trap 'git -C "$GITHUB_WORKSPACE" checkout --quiet "$GITHUB_SHA"' EXIT git checkout --quiet "$BASE_SHA" # Re-sync node_modules to the base commit's lockfile before # fingerprinting — a dep-changing PR must not fingerprint the base From 49822117844f32404b40bb944bcfd565fdc72458 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 24 Nov 2026 05:04:28 -0500 Subject: [PATCH 6/8] fix(ci): use a job-local native toolchain on ARC Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .../setup-main-native-tools/action.yml | 107 ++++++++++++++++++ .github/actions/setup-main-vp/action.yml | 6 - .github/workflows/ci.yml | 13 +-- 3 files changed, 111 insertions(+), 15 deletions(-) create mode 100644 .github/actions/setup-main-native-tools/action.yml diff --git a/.github/actions/setup-main-native-tools/action.yml b/.github/actions/setup-main-native-tools/action.yml new file mode 100644 index 0000000000000..43fd525389e7b --- /dev/null +++ b/.github/actions/setup-main-native-tools/action.yml @@ -0,0 +1,107 @@ +name: Set up job-local native build tools +description: Verify and unpack the Ubuntu native build closure into this ARC job. +runs: + using: composite + steps: + - name: Prepare and verify job-local native tools + shell: bash + run: | + set -euo pipefail + test "$(id -u)" != 0 + . /etc/os-release + test "$ID" = ubuntu && test "$VERSION_ID" = 24.04 + test "$(dpkg --print-architecture)" = amd64 + test -r /usr/share/keyrings/ubuntu-archive-keyring.gpg + # Adapted from Closura's setup-race-compiler (69421cf91). All APT + # state and extracted tools stay in the job's temporary directory. + apt_root=$(mktemp -d "$RUNNER_TEMP/t3-apt.XXXXXX") + compiler_root="$RUNNER_TEMP/t3-native-tools" + mkdir -p "$apt_root/lists/partial" "$apt_root/archives/partial" "$apt_root/empty" "$apt_root/log" "$compiler_root" + : > "$apt_root/status" + # APT_CONFIG is loaded before host configuration fragments and hooks. + cat > "$apt_root/bootstrap.conf" < "$apt_root/sources.list" <<'SOURCES' + deb [arch=amd64 signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://archive.ubuntu.com/ubuntu noble main universe + deb [arch=amd64 signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://archive.ubuntu.com/ubuntu noble-updates main universe + deb [arch=amd64 signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg] https://security.ubuntu.com/ubuntu noble-security main universe + SOURCES + apt_options=( + -o Dir::Etc::main=/dev/null -o "Dir::Etc::parts=$apt_root/empty" + -o "Dir::Etc::sourcelist=$apt_root/sources.list" -o Dir::Etc::sourceparts=- + -o "Dir::State::status=$apt_root/status" -o "Dir::State::lists=$apt_root/lists" + -o "Dir::State::extended_states=$apt_root/extended_states" + -o "Dir::Cache::archives=$apt_root/archives" -o "Dir::Cache::pkgcache=$apt_root/pkgcache.bin" + -o "Dir::Cache::srcpkgcache=$apt_root/srcpkgcache.bin" -o Debug::NoLocking=1 + -o APT::Get::List-Cleanup=0 + ) + # Download the signed package closure into the job only; never install on the runner. + APT_CONFIG="$apt_root/bootstrap.conf" apt-get "${apt_options[@]}" update + APT_CONFIG="$apt_root/bootstrap.conf" apt-get "${apt_options[@]}" --download-only --yes --no-install-recommends install gcc g++ libc6-dev make libsecret-1-dev pkg-config + shopt -s nullglob + archives=("$apt_root"/archives/*.deb) + test "${#archives[@]}" -gt 0 + for archive in "${archives[@]}"; do dpkg-deb --extract "$archive" "$compiler_root"; done + # Noble packages use merged /usr; the aliases exist only in this sysroot. + test -f "$compiler_root/usr/lib/x86_64-linux-gnu/libc.so.6" + test -f "$compiler_root/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" + test -L "$compiler_root/usr/lib64/ld-linux-x86-64.so.2" + test "$(readlink "$compiler_root/usr/lib64/ld-linux-x86-64.so.2")" = '../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2' + if [[ ! -e "$compiler_root/lib" && ! -L "$compiler_root/lib" ]]; then ln -s usr/lib "$compiler_root/lib"; fi + if [[ ! -e "$compiler_root/lib64" && ! -L "$compiler_root/lib64" ]]; then ln -s usr/lib64 "$compiler_root/lib64"; fi + compiler_real_root=$(realpath -e "$compiler_root") + test "$(realpath -e "$compiler_root/lib/x86_64-linux-gnu/libc.so.6")" = "$compiler_real_root/usr/lib/x86_64-linux-gnu/libc.so.6" + test "$(realpath -e "$compiler_root/lib64/ld-linux-x86-64.so.2")" = "$compiler_real_root/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" + versions=("$compiler_root"/usr/lib/gcc/x86_64-linux-gnu/*) + test "${#versions[@]}" -eq 1 && test -x "$compiler_root/usr/bin/gcc" + # Use staged compiler libraries without replacing the runner's glibc or loader. + mkdir "$compiler_root/compiler-libs" + for lib in "$compiler_root"/usr/lib/x86_64-linux-gnu/lib*.so*; do + case "${lib##*/}" in libc.so*|libm.so*|libdl.so*|libpthread.so*|librt.so*|libresolv.so*) continue ;; esac + ln -s "$lib" "$compiler_root/compiler-libs/${lib##*/}" + done + tools="$compiler_root/tools" + mkdir "$tools" + export T3_NATIVE_ROOT="$compiler_root" T3_GCC_LIB="${versions[0]}" + # Do not add the sysroot's libc or loader to the runner's search path. + export LD_LIBRARY_PATH="$compiler_root/compiler-libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + cat > "$tools/compiler" <<'COMPILER' + #!/usr/bin/env bash + set -euo pipefail + driver=gcc + case "${0##*/}" in c++|g++) driver=g++ ;; esac + exec "$T3_NATIVE_ROOT/usr/bin/$driver" --sysroot="$T3_NATIVE_ROOT" \ + -B"$T3_NATIVE_ROOT/usr/bin/" -B"$T3_GCC_LIB/" \ + -Wl,-rpath-link,"$T3_NATIVE_ROOT/usr/lib/x86_64-linux-gnu" "$@" + COMPILER + cat > "$tools/pkg-config" <<'PKG_CONFIG' + #!/usr/bin/env bash + set -euo pipefail + export PKG_CONFIG_SYSROOT_DIR="$T3_NATIVE_ROOT" + export PKG_CONFIG_LIBDIR="$T3_NATIVE_ROOT/usr/lib/x86_64-linux-gnu/pkgconfig:$T3_NATIVE_ROOT/usr/share/pkgconfig" + exec "$T3_NATIVE_ROOT/usr/bin/pkg-config" "$@" + PKG_CONFIG + chmod 755 "$tools/compiler" "$tools/pkg-config" + for tool in cc gcc c++ g++; do ln -s compiler "$tools/$tool"; done + ln -s "$compiler_root/usr/bin/make" "$tools/make" + export PATH="$tools:$PATH" CC="$tools/cc" CXX="$tools/c++" + make --version + python3 --version + printf 'int main() { return 0; }\n' > "$RUNNER_TEMP/t3-native-smoke.cpp" + "$CXX" "$RUNNER_TEMP/t3-native-smoke.cpp" -o "$RUNNER_TEMP/t3-native-smoke" + "$RUNNER_TEMP/t3-native-smoke" + read -r -a secret_flags <<< "$(pkg-config --cflags --libs libsecret-1)" + "$CC" -std=c11 -Wall -Wextra -Werror native/browser-secret/main.c -o "$RUNNER_TEMP/t3-browser-secret-smoke" "${secret_flags[@]}" + result=0 + "$RUNNER_TEMP/t3-browser-secret-smoke" || result=$? + test "$result" = 64 + printf 'T3_NATIVE_ROOT=%s\nT3_GCC_LIB=%s\nLD_LIBRARY_PATH=%s\nCC=%s\nCXX=%s\n' \ + "$T3_NATIVE_ROOT" "$T3_GCC_LIB" "$LD_LIBRARY_PATH" "$CC" "$CXX" >> "$GITHUB_ENV" + echo "$tools" >> "$GITHUB_PATH" diff --git a/.github/actions/setup-main-vp/action.yml b/.github/actions/setup-main-vp/action.yml index 7c38cc97ed14a..8d86e478ad257 100644 --- a/.github/actions/setup-main-vp/action.yml +++ b/.github/actions/setup-main-vp/action.yml @@ -20,12 +20,6 @@ runs: prefix="$RUNNER_TEMP/t3-ci-tools" npm install --prefix "$prefix" --no-audit --no-fund "$pnpm_package" echo "$prefix/node_modules/.bin" >> "$GITHUB_PATH" - - name: Install native build dependencies - if: inputs.filter == '' - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y build-essential python3 libsecret-1-dev pkg-config - name: Install locked dependencies and expose workspace Vite+ shell: bash env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ffd66d95bc23..5ecd1e00cbbb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: exit 1 fi - - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-native-tools - uses: ./.github/actions/setup-main-vp @@ -98,7 +98,7 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-native-tools - uses: ./.github/actions/setup-main-vp @@ -137,7 +137,7 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-main-native-tools - uses: ./.github/actions/setup-main-vp @@ -199,12 +199,7 @@ jobs: !/.repos/ sparse-checkout-cone-mode: false - - uses: ./.github/actions/setup-apt-mirrors - - - name: Install native and Windows cross-compilers - run: | - sudo apt-get update - sudo apt-get install -y build-essential gcc-mingw-w64-x86-64 + - uses: ./.github/actions/setup-main-native-tools - name: Setup Rust uses: dtolnay/rust-toolchain@stable From 008d7ed3491e0cd50c0751f17bf037c8074fa52e Mon Sep 17 00:00:00 2001 From: Kameron Smith Date: Tue, 24 Nov 2026 05:18:04 -0500 Subject: [PATCH 7/8] fix(ci): format the inherited main baseline Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .agents/skills/verify-t3code/SKILL.md | 26 +-- .../skills/verify-t3code/features/README.md | 28 +-- .../verify-t3code/features/pull-requests.md | 2 +- .../skills/verify-t3code/scripts/browser.mjs | 28 ++- .../verify-t3code/scripts/drive-surfaces.mjs | 184 ++++++++++++++---- .../verify-t3code/scripts/drive-threads.mjs | 96 ++++++--- .agents/skills/verify-t3code/scripts/lib.mjs | 17 +- .agents/skills/verify-t3code/scripts/seed.mjs | 38 +++- .../Layers/ProviderCommandReactor.test.ts | 20 +- .../orchestration/SessionSpendGuard.test.ts | 5 +- 10 files changed, 323 insertions(+), 121 deletions(-) diff --git a/.agents/skills/verify-t3code/SKILL.md b/.agents/skills/verify-t3code/SKILL.md index 1fd7c13fa2c7c..b943965a24ed5 100644 --- a/.agents/skills/verify-t3code/SKILL.md +++ b/.agents/skills/verify-t3code/SKILL.md @@ -104,19 +104,19 @@ screenshots. Stable handles (verified against this head): -| What | Handle | -| --- | --- | -| Thread row | `[data-testid="sidebar-row-card"]` (slim: `sidebar-row-slim`); right-click opens its menu | -| Row menu items | text: `Pin thread`, `Settle thread`, `Snooze` > `In 1 hour`…, `Rename thread`, `Regenerate title`, `Mark unread`, `Filter by `, `Copy`, `Project settings`, `Archive thread`, `Delete` | -| Pinned / unpin | `button[aria-label="Unpin thread"]` (or `[aria-label="Pinned"]` while dragging) | -| Settled / snoozed shelves | `[data-testid="sidebar-settled-shelf-toggle"]`, `[data-testid="sidebar-snoozed-shelf-toggle"]` | -| Wake | `[aria-label="Wake thread now"]` | -| Thread title in header | `button[aria-label^="Thread actions for"]` | -| New thread / new project | `[data-testid="new-thread-button"]` / `button[aria-label="New project"]` | -| Command palette | `Control+K`; `[data-testid="command-palette"]`, results are `[role="option"]` | -| Composer | `[data-testid="composer-editor"]`, button `Send message` | -| Settings | footer gear, then a button per section: General, Appearance, Keybindings, SnapShots, Providers, Integrations, Source Control, Storage, Connections, Archive, and Back | -| Terminal | `button[aria-label="Toggle terminal drawer"]` | +| What | Handle | +| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Thread row | `[data-testid="sidebar-row-card"]` (slim: `sidebar-row-slim`); right-click opens its menu | +| Row menu items | text: `Pin thread`, `Settle thread`, `Snooze` > `In 1 hour`…, `Rename thread`, `Regenerate title`, `Mark unread`, `Filter by `, `Copy`, `Project settings`, `Archive thread`, `Delete` | +| Pinned / unpin | `button[aria-label="Unpin thread"]` (or `[aria-label="Pinned"]` while dragging) | +| Settled / snoozed shelves | `[data-testid="sidebar-settled-shelf-toggle"]`, `[data-testid="sidebar-snoozed-shelf-toggle"]` | +| Wake | `[aria-label="Wake thread now"]` | +| Thread title in header | `button[aria-label^="Thread actions for"]` | +| New thread / new project | `[data-testid="new-thread-button"]` / `button[aria-label="New project"]` | +| Command palette | `Control+K`; `[data-testid="command-palette"]`, results are `[role="option"]` | +| Composer | `[data-testid="composer-editor"]`, button `Send message` | +| Settings | footer gear, then a button per section: General, Appearance, Keybindings, SnapShots, Providers, Integrations, Source Control, Storage, Connections, Archive, and Back | +| Terminal | `button[aria-label="Toggle terminal drawer"]` | `getByRole(..., { name })` with a regex can stall for a minute on a saturated host; prefer the CSS handles above and give clicks 45 s. diff --git a/.agents/skills/verify-t3code/features/README.md b/.agents/skills/verify-t3code/features/README.md index fa7afbe8be17f..084e14e2cd197 100644 --- a/.agents/skills/verify-t3code/features/README.md +++ b/.agents/skills/verify-t3code/features/README.md @@ -4,20 +4,20 @@ Each feature file lists sub-features by stable ID. The ID is also the step name drive scripts write to `$RUN/evidence/observed.log`, so an evidence line maps straight to a sub-feature. -| ID | Feature | Primary proof | -| --- | --- | --- | -| onboarding | First-run setup wizard | `scripts/seed.mjs` | -| projects | Add and filter projects | `scripts/seed.mjs`, `scripts/drive-surfaces.mjs` (`projects.filter`) | -| composer | Model picker, send, agent reply | `scripts/seed.mjs` | -| threads | New, rename, mark unread, list | `scripts/drive-threads.mjs`, `scripts/drive-surfaces.mjs` (`threads.new`) | -| sidebar-lifecycle | Pin, settle, snooze, wake | `scripts/drive-threads.mjs` | -| archive | Archive, Archive page, unarchive | `scripts/drive-threads.mjs` (`archive.thread`), `scripts/drive-surfaces.mjs` | -| search | Command palette thread search | `scripts/drive-threads.mjs` (`search.snoozed`), `scripts/drive-surfaces.mjs` (`search.palette`) | -| terminal | Terminal drawer | `scripts/drive-surfaces.mjs` (`terminal.drawer`) | -| settings | Settings sections | `scripts/drive-surfaces.mjs` (`settings.
`) | -| connections | Environments and network access | `scripts/drive-surfaces.mjs` (`connections.page`) | -| usage | Usage page | `scripts/drive-surfaces.mjs` (`usage.page`) | -| pull-requests | Pull Requests page | `scripts/drive-surfaces.mjs` (`pull-requests.page`) | +| ID | Feature | Primary proof | +| ----------------- | -------------------------------- | ----------------------------------------------------------------------------------------------- | +| onboarding | First-run setup wizard | `scripts/seed.mjs` | +| projects | Add and filter projects | `scripts/seed.mjs`, `scripts/drive-surfaces.mjs` (`projects.filter`) | +| composer | Model picker, send, agent reply | `scripts/seed.mjs` | +| threads | New, rename, mark unread, list | `scripts/drive-threads.mjs`, `scripts/drive-surfaces.mjs` (`threads.new`) | +| sidebar-lifecycle | Pin, settle, snooze, wake | `scripts/drive-threads.mjs` | +| archive | Archive, Archive page, unarchive | `scripts/drive-threads.mjs` (`archive.thread`), `scripts/drive-surfaces.mjs` | +| search | Command palette thread search | `scripts/drive-threads.mjs` (`search.snoozed`), `scripts/drive-surfaces.mjs` (`search.palette`) | +| terminal | Terminal drawer | `scripts/drive-surfaces.mjs` (`terminal.drawer`) | +| settings | Settings sections | `scripts/drive-surfaces.mjs` (`settings.
`) | +| connections | Environments and network access | `scripts/drive-surfaces.mjs` (`connections.page`) | +| usage | Usage page | `scripts/drive-surfaces.mjs` (`usage.page`) | +| pull-requests | Pull Requests page | `scripts/drive-surfaces.mjs` (`pull-requests.page`) | ## Baseline preconditions diff --git a/.agents/skills/verify-t3code/features/pull-requests.md b/.agents/skills/verify-t3code/features/pull-requests.md index caf0126a8abea..66483b48c7770 100644 --- a/.agents/skills/verify-t3code/features/pull-requests.md +++ b/.agents/skills/verify-t3code/features/pull-requests.md @@ -35,7 +35,7 @@ Preconditions: baseline from [README.md](README.md); the host's `gh` is logged i read the loading skeleton). When it fails the page shows "Could not load pull requests" with the internal text "All fibers interrupted without error" and a Retry button. Retry lists the PRs, and later visits in the same instance list them at once. `drive-surfaces.mjs` records this as `FAIL - pull-requests.page`. Do not click Retry to make the step pass or wait it out. The +pull-requests.page`. Do not click Retry to make the step pass or wait it out. The nullStack65/t3code repo has issues disabled, so the report lives here and in the PR that added this file. diff --git a/.agents/skills/verify-t3code/scripts/browser.mjs b/.agents/skills/verify-t3code/scripts/browser.mjs index 34da43b1bb017..e89bb4eaa361b 100644 --- a/.agents/skills/verify-t3code/scripts/browser.mjs +++ b/.agents/skills/verify-t3code/scripts/browser.mjs @@ -16,7 +16,15 @@ import { createRequire } from "node:module"; import { spawn } from "node:child_process"; import { createServer } from "node:net"; -import { appendFileSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, writeFileSync } from "node:fs"; +import { + appendFileSync, + existsSync, + mkdirSync, + openSync, + readFileSync, + readdirSync, + writeFileSync, +} from "node:fs"; import { join } from "node:path"; import { homedir } from "node:os"; import { fileURLToPath } from "node:url"; @@ -42,7 +50,9 @@ function loadPlaywright(repo) { function chromiumPath() { const root = join(homedir(), ".cache/ms-playwright"); // chromium- only: chromium_headless_shell-* and chromium-headless-shell-* have no chrome-linux64/chrome. - const dirs = readdirSync(root).filter((d) => /^chromium-\d+$/.test(d)).sort((a, b) => Number(a.slice(9)) - Number(b.slice(9))); + const dirs = readdirSync(root) + .filter((d) => /^chromium-\d+$/.test(d)) + .sort((a, b) => Number(a.slice(9)) - Number(b.slice(9))); if (!dirs.length) throw new Error("no chromium- in " + root); const p = join(root, dirs.at(-1), "chrome-linux64/chrome"); if (!existsSync(p)) throw new Error("no Chromium at " + p); @@ -84,7 +94,9 @@ export async function up(runDir, { width = 1440, height = 900 } = {}) { { detached: true, stdio: ["ignore", log, log] }, ); child.unref(); - writeFileSync(join(runDir, "browser.env"), `BROWSER_PID=${child.pid}\nCDP_PORT=${port}\n`, { mode: 0o600 }); + writeFileSync(join(runDir, "browser.env"), `BROWSER_PID=${child.pid}\nCDP_PORT=${port}\n`, { + mode: 0o600, + }); const t = await connect(runDir, { retries: 40 }); // Dev mode serves hundreds of modules, so "domcontentloaded" can exceed 30 s on a busy // host. Return at "commit" and let callers wait for real UI. @@ -118,12 +130,18 @@ export async function connect(runDir, { retries = 1 } = {}) { if (m.type() === "error") consoleErrors.push(m.text()); }); return { - page, context, inst, consoleErrors, + page, + context, + inst, + consoleErrors, base: `http://localhost:${inst.WEB_PORT}`, async shot(name) { const path = join(evidence, `${name}.png`); // A saturated host can stall a screenshot; a missing image is reported, never fatal. - return page.screenshot({ path, timeout: 90000 }).then(() => path, (e) => `SCREENSHOT-FAILED ${name}: ${String(e).split("\n")[0]}`); + return page.screenshot({ path, timeout: 90000 }).then( + () => path, + (e) => `SCREENSHOT-FAILED ${name}: ${String(e).split("\n")[0]}`, + ); }, note(line) { appendFileSync(join(evidence, "observed.log"), line + "\n"); diff --git a/.agents/skills/verify-t3code/scripts/drive-surfaces.mjs b/.agents/skills/verify-t3code/scripts/drive-surfaces.mjs index 136aa65edc235..7cb1f206f7d43 100644 --- a/.agents/skills/verify-t3code/scripts/drive-surfaces.mjs +++ b/.agents/skills/verify-t3code/scripts/drive-surfaces.mjs @@ -9,39 +9,90 @@ import { start, ROW, rowTitles, check, searchPalette, mainText as mainTextOf } f const { run, p, step, finish } = await start("drive-surfaces.mjs", 60000); const mainText = (n) => mainTextOf(p, n); -const LABELS = { general: "General", appearance: "Appearance", keybindings: "Keybindings", providers: "Providers", integrations: "Integrations", "source-control": "Source Control", storage: "Storage", connections: "Connections", archived: "Archive" }; +const LABELS = { + general: "General", + appearance: "Appearance", + keybindings: "Keybindings", + providers: "Providers", + integrations: "Integrations", + "source-control": "Source Control", + storage: "Storage", + connections: "Connections", + archived: "Archive", +}; // A string only this section's body contains; the header and URL change before the body. -const MARKER = { general: "New threads", appearance: "Colors & themes", keybindings: "Appearance: Cycle", providers: "Refresh provider status", integrations: "Agent browser access", "source-control": "Repositories", storage: "Worktrees", connections: "Network access", archived: "Archived" }; +const MARKER = { + general: "New threads", + appearance: "Colors & themes", + keybindings: "Appearance: Cycle", + providers: "Refresh provider status", + integrations: "Agent browser access", + "source-control": "Repositories", + storage: "Worktrees", + connections: "Network access", + archived: "Archived", +}; // Settings has its own sidebar of buttons; enter it once from the footer gear. const STEP_ID = { archived: "archive.page", connections: "connections.page" }; const EXTRA = { providers: ["Codex v", "Claude v"], keybindings: [" bindings"] }; const settingsRoute = (slug) => async () => { if (!new URL(p.url()).pathname.startsWith("/settings")) { - await p.locator('button[aria-label="Settings"], li button:has-text("Settings")').first().click(); + await p + .locator('button[aria-label="Settings"], li button:has-text("Settings")') + .first() + .click(); } const t0 = Date.now(); - await p.locator("button", { hasText: new RegExp(`^${LABELS[slug]}$`) }).first().click(); + await p + .locator("button", { hasText: new RegExp(`^${LABELS[slug]}$`) }) + .first() + .click(); await p.waitForURL(new RegExp(`/settings/${slug}$`)); // Settings pages are lazy routes: the URL and header change first, and for a few // seconds the body is still the previous page's. Wait for this section's own marker. - await p.waitForFunction((m) => (document.querySelector("main")?.innerText ?? "").includes(m), MARKER[slug], { timeout: 90000 }); + await p.waitForFunction( + (m) => (document.querySelector("main")?.innerText ?? "").includes(m), + MARKER[slug], + { timeout: 90000 }, + ); const bodyMs = Date.now() - t0; await p.waitForTimeout(500); const body = await mainText(4000); - for (const needle of EXTRA[slug] ?? []) check(body.includes(needle), `section body lacks "${needle}"`); + for (const needle of EXTRA[slug] ?? []) + check(body.includes(needle), `section body lacks "${needle}"`); return `${new URL(p.url()).pathname} | body after ${bodyMs} ms | ${await mainText()}`; }; -for (const slug of ["general", "appearance", "keybindings", "providers", "connections", "storage", "source-control", "integrations", "archived"]) { - await step(STEP_ID[slug] ?? `settings.${slug}`, `open Settings > ${LABELS[slug]}`, settingsRoute(slug)); +for (const slug of [ + "general", + "appearance", + "keybindings", + "providers", + "connections", + "storage", + "source-control", + "integrations", + "archived", +]) { + await step( + STEP_ID[slug] ?? `settings.${slug}`, + `open Settings > ${LABELS[slug]}`, + settingsRoute(slug), + ); if (slug === "archived") { await step("archive.restore", "Archive page: unarchive the archived thread", async () => { - await p.getByRole("button", { name: /unarchive|restore/i }).first().click(); + await p + .getByRole("button", { name: /unarchive|restore/i }) + .first() + .click(); await p.waitForTimeout(1500); const text = await mainText(160); - check(text.includes("No archived threads"), "Archive page still lists a thread after Unarchive"); + check( + text.includes("No archived threads"), + "Archive page still lists a thread after Unarchive", + ); return text; }); } @@ -49,21 +100,39 @@ for (const slug of ["general", "appearance", "keybindings", "providers", "connec // Leave Settings through its Back button before using the thread sidebar again. await step("archive.returns", "after Unarchive, click Back and read the sidebar", async () => { - await p.locator("button", { hasText: /^Back$/ }).first().click(); + await p + .locator("button", { hasText: /^Back$/ }) + .first() + .click(); await p.waitForTimeout(1500); const rows = await rowTitles(p); - check(rows.length === 1 && rows[0].includes("renamed"), `expected the unarchived thread in the sidebar, got ${JSON.stringify(rows)}`); + check( + rows.length === 1 && rows[0].includes("renamed"), + `expected the unarchived thread in the sidebar, got ${JSON.stringify(rows)}`, + ); return JSON.stringify(rows); }); -await step("search.palette", "Control+K, type the thread title (after archive + unarchive)", async () => { - const opts = await searchPalette(p, "renamed"); - check(opts.some((o) => o.includes("verify-t3code: renamed")), 'palette has no result for a thread that is in the sidebar'); - return JSON.stringify(opts.slice(0, 4)); -}); +await step( + "search.palette", + "Control+K, type the thread title (after archive + unarchive)", + async () => { + const opts = await searchPalette(p, "renamed"); + check( + opts.some((o) => o.includes("verify-t3code: renamed")), + "palette has no result for a thread that is in the sidebar", + ); + return JSON.stringify(opts.slice(0, 4)); + }, +); const home = () => - p.locator('a[aria-label="Go to threads"], a[href="/"]').first().click().then(() => p.waitForTimeout(2000)).catch(() => {}); + p + .locator('a[aria-label="Go to threads"], a[href="/"]') + .first() + .click() + .then(() => p.waitForTimeout(2000)) + .catch(() => {}); await step("usage.page", "open Usage from sidebar footer", async () => { await p.getByRole("button", { name: "Usage", exact: true }).click(); @@ -79,9 +148,17 @@ await step("pull-requests.page", "open Pull Requests from sidebar footer", async await p.getByRole("button", { name: "Pull Requests", exact: true }).click(); await p.waitForURL(/\/pull-requests(\?.*)?$/); // The list is a skeleton first: wait for either rows ("#") or the error. - await p.waitForFunction(() => /#\d+\s|Could not load pull requests/.test(document.querySelector("main")?.innerText ?? ""), null, { timeout: 60000 }); + await p.waitForFunction( + () => + /#\d+\s|Could not load pull requests/.test(document.querySelector("main")?.innerText ?? ""), + null, + { timeout: 60000 }, + ); const text = await mainText(300); - if (/Could not load pull requests/.test(text)) throw new Error(`first visit shows: ${text.slice(text.indexOf("Could not load"), text.indexOf("Could not load") + 90)}`); + if (/Could not load pull requests/.test(text)) + throw new Error( + `first visit shows: ${text.slice(text.indexOf("Could not load"), text.indexOf("Could not load") + 90)}`, + ); return `${new URL(p.url()).pathname} | ${text}`; }); await home(); @@ -89,14 +166,22 @@ await home(); await step("projects.filter", "open 'Filter threads by project' and read the options", async () => { await p.locator('[aria-label="Filter threads by project"]').first().click(); await p.waitForTimeout(1200); - const opts = (await p.locator('[role="option"]').allInnerTexts()).map((s) => s.replace(/\s+/g, " ")); + const opts = (await p.locator('[role="option"]').allInnerTexts()).map((s) => + s.replace(/\s+/g, " "), + ); await p.keyboard.press("Escape"); - check(opts.some((o) => o.includes("demo-app")) && opts.some((o) => o.includes("server")), "filter lacks demo-app or server"); + check( + opts.some((o) => o.includes("demo-app")) && opts.some((o) => o.includes("server")), + "filter lacks demo-app or server", + ); return JSON.stringify(opts); }); await step("threads.new", "click New thread", async () => { - await p.locator('[data-testid="new-thread-button"], button[aria-label="New thread"]').first().click(); + await p + .locator('[data-testid="new-thread-button"], button[aria-label="New thread"]') + .first() + .click(); await p.waitForURL(/\/draft\//); await p.waitForTimeout(1500); const text = await mainText(160); @@ -106,24 +191,39 @@ await step("threads.new", "click New thread", async () => { await p.keyboard.press("Escape"); await p.waitForTimeout(500); -await step("terminal.drawer", "toggle the terminal drawer, run a command that writes a file", async () => { - await p.locator('button[aria-label="Toggle terminal drawer"]').first().click(); - await p.waitForTimeout(4000); - // Keystrokes must reach the shell. If the composer has focus instead, Enter would send a - // turn with the default (real, paid) model, so refuse to type. - const inComposer = await p.evaluate(() => !!document.querySelector('[data-testid="composer-editor"]')?.contains(document.activeElement)); - check(!inComposer, "composer has focus, not the terminal; refusing to type"); - const marker = `${run}/fixture/terminal-proof-${Date.now()}.txt`; - await p.keyboard.type(`echo verify-t3code-terminal > ${marker}`); - await p.keyboard.press("Enter"); - const { readFileSync } = await import("node:fs"); - let body = ""; - for (let i = 0; i < 30 && !body; i++) { - await p.waitForTimeout(1000); - body = (() => { try { return readFileSync(marker, "utf8").trim(); } catch { return ""; } })(); - } - if (!body) throw new Error("command typed in the drawer never wrote " + marker); - return `file written by the drawer shell: ${marker.split("/").slice(-1)[0]} = "${body}"`; -}); +await step( + "terminal.drawer", + "toggle the terminal drawer, run a command that writes a file", + async () => { + await p.locator('button[aria-label="Toggle terminal drawer"]').first().click(); + await p.waitForTimeout(4000); + // Keystrokes must reach the shell. If the composer has focus instead, Enter would send a + // turn with the default (real, paid) model, so refuse to type. + const inComposer = await p.evaluate( + () => + !!document + .querySelector('[data-testid="composer-editor"]') + ?.contains(document.activeElement), + ); + check(!inComposer, "composer has focus, not the terminal; refusing to type"); + const marker = `${run}/fixture/terminal-proof-${Date.now()}.txt`; + await p.keyboard.type(`echo verify-t3code-terminal > ${marker}`); + await p.keyboard.press("Enter"); + const { readFileSync } = await import("node:fs"); + let body = ""; + for (let i = 0; i < 30 && !body; i++) { + await p.waitForTimeout(1000); + body = (() => { + try { + return readFileSync(marker, "utf8").trim(); + } catch { + return ""; + } + })(); + } + if (!body) throw new Error("command typed in the drawer never wrote " + marker); + return `file written by the drawer shell: ${marker.split("/").slice(-1)[0]} = "${body}"`; + }, +); finish(); diff --git a/.agents/skills/verify-t3code/scripts/drive-threads.mjs b/.agents/skills/verify-t3code/scripts/drive-threads.mjs index 4631f3e237f55..c7270e7222e6d 100644 --- a/.agents/skills/verify-t3code/scripts/drive-threads.mjs +++ b/.agents/skills/verify-t3code/scripts/drive-threads.mjs @@ -23,8 +23,18 @@ const menu = async (rowText, item) => { const entry = p.getByText(item, { exact: true }).first(); for (let attempt = 0; attempt < 2; attempt++) { await p.keyboard.press("Escape"); - await p.locator(ROW).filter({ hasText: rowText }).first().click({ button: "right", timeout: 45000 }); - if (await entry.waitFor({ state: "visible", timeout: 30000 }).then(() => true, () => false)) break; + await p + .locator(ROW) + .filter({ hasText: rowText }) + .first() + .click({ button: "right", timeout: 45000 }); + if ( + await entry.waitFor({ state: "visible", timeout: 30000 }).then( + () => true, + () => false, + ) + ) + break; } await entry.click({ timeout: 45000 }); await p.waitForTimeout(1200); @@ -39,7 +49,10 @@ const pinned = () => p.locator('[aria-label="Pinned"], button[aria-label="Unpin await step("threads.list", "read sidebar rows", async () => { const rows = await rowTitles(p); - check(rows.length === 1 && rows[0].includes("first message"), "expected one row titled with the first message"); + check( + rows.length === 1 && rows[0].includes("first message"), + "expected one row titled with the first message", + ); return JSON.stringify(rows); }); @@ -62,9 +75,15 @@ await step("threads.rename", "context menu > Rename thread, type new title", asy await p.keyboard.type("verify-t3code: renamed"); await p.keyboard.press("Enter"); await p.waitForTimeout(1200); - const crumb = await p.locator('button[aria-label^="Thread actions for"]').first().getAttribute("aria-label"); + const crumb = await p + .locator('button[aria-label^="Thread actions for"]') + .first() + .getAttribute("aria-label"); const rows = await rowTitles(p); - check(crumb?.includes("verify-t3code: renamed") && rows[0]?.includes("verify-t3code: renamed"), "title not renamed in header and row"); + check( + crumb?.includes("verify-t3code: renamed") && rows[0]?.includes("verify-t3code: renamed"), + "title not renamed in header and row", + ); return JSON.stringify({ breadcrumb: crumb, rows }); }); @@ -72,36 +91,63 @@ await step("sidebar-lifecycle.settle", "context menu > Settle thread", async () await menu("renamed", "Settle thread"); const s = await section(); const rows = await rowTitles(p); - check(/Settled \(1\)/.test(s.settled ?? "") && rows.length === 0, `expected Settled (1) and no active rows, got ${JSON.stringify({ s, rows })}`); + check( + /Settled \(1\)/.test(s.settled ?? "") && rows.length === 0, + `expected Settled (1) and no active rows, got ${JSON.stringify({ s, rows })}`, + ); return JSON.stringify({ ...s, activeRows: rows.length }); }); -await step("sidebar-lifecycle.unsettle", "expand Settled shelf, context menu > Un-settle thread", async () => { - await expand("sidebar-settled-shelf-toggle"); - await menu("renamed", "Un-settle thread"); - const s = await section(); - const rows = await rowTitles(p); - check(rows.length === 1 && !/\(\d+\)/.test(s.settled ?? ""), `expected one active row and no settled count, got ${JSON.stringify({ s, rows })}`); - return JSON.stringify({ ...s, rows }); -}); +await step( + "sidebar-lifecycle.unsettle", + "expand Settled shelf, context menu > Un-settle thread", + async () => { + await expand("sidebar-settled-shelf-toggle"); + await menu("renamed", "Un-settle thread"); + const s = await section(); + const rows = await rowTitles(p); + check( + rows.length === 1 && !/\(\d+\)/.test(s.settled ?? ""), + `expected one active row and no settled count, got ${JSON.stringify({ s, rows })}`, + ); + return JSON.stringify({ ...s, rows }); + }, +); const searchStep = async (what) => { const opts = await searchPalette(p, "renamed"); - check(opts.some((o) => o.includes("verify-t3code: renamed")), `no palette result for ${what}`); + check( + opts.some((o) => o.includes("verify-t3code: renamed")), + `no palette result for ${what}`, + ); return JSON.stringify(opts.slice(0, 4)); }; -await step("search.active", "Control+K, search the title of an active thread", () => searchStep("an active thread")); +await step("search.active", "Control+K, search the title of an active thread", () => + searchStep("an active thread"), +); await step("sidebar-lifecycle.snooze", "context menu > Snooze > In 1 hour", async () => { - await p.locator(ROW).filter({ hasText: "renamed" }).first().click({ button: "right", timeout: 45000 }); + await p + .locator(ROW) + .filter({ hasText: "renamed" }) + .first() + .click({ button: "right", timeout: 45000 }); await p.getByText("Snooze", { exact: true }).first().hover(); - await p.getByText(/^In 1 hour/).first().click({ timeout: 45000 }); + await p + .getByText(/^In 1 hour/) + .first() + .click({ timeout: 45000 }); await p.waitForTimeout(1500); const s = await section(); const rows = await rowTitles(p); - check(/Snoozed \(1\)/.test(s.snoozed ?? "") && rows.length === 0, `expected Snoozed (1) and no active rows, got ${JSON.stringify({ s, rows })}`); + check( + /Snoozed \(1\)/.test(s.snoozed ?? "") && rows.length === 0, + `expected Snoozed (1) and no active rows, got ${JSON.stringify({ s, rows })}`, + ); return JSON.stringify({ ...s, activeRows: rows.length }); }); -await step("search.snoozed", "Control+K, search the title of the snoozed thread", () => searchStep("a snoozed thread")); +await step("search.snoozed", "Control+K, search the title of the snoozed thread", () => + searchStep("a snoozed thread"), +); await step("sidebar-lifecycle.wake", "Snoozed shelf: Wake thread now", async () => { await expand("sidebar-snoozed-shelf-toggle"); // Wake is revealed by row hover (group-hover), which needs the browser's hover capability. @@ -110,7 +156,10 @@ await step("sidebar-lifecycle.wake", "Snoozed shelf: Wake thread now", async () await p.waitForTimeout(1500); const s = await section(); const rows = await rowTitles(p); - check(s.snoozed === null && rows.length === 1, `expected no snoozed shelf and one active row, got ${JSON.stringify({ s, rows })}`); + check( + s.snoozed === null && rows.length === 1, + `expected no snoozed shelf and one active row, got ${JSON.stringify({ s, rows })}`, + ); return JSON.stringify({ ...s, rows }); }); @@ -128,7 +177,10 @@ await step("archive.thread", "context menu > Archive thread", async () => { await p.waitForTimeout(1500); const rows = await rowTitles(p); const path = new URL(p.url()).pathname; - check(rows.length === 0 && path.startsWith("/draft/"), `expected no rows and a /draft/ URL, got ${JSON.stringify({ rows: rows.length, path })}`); + check( + rows.length === 0 && path.startsWith("/draft/"), + `expected no rows and a /draft/ URL, got ${JSON.stringify({ rows: rows.length, path })}`, + ); return JSON.stringify({ rows: rows.length, url: path }); }); diff --git a/.agents/skills/verify-t3code/scripts/lib.mjs b/.agents/skills/verify-t3code/scripts/lib.mjs index e813ac1f7237b..dd65f80ca101c 100644 --- a/.agents/skills/verify-t3code/scripts/lib.mjs +++ b/.agents/skills/verify-t3code/scripts/lib.mjs @@ -17,7 +17,9 @@ export async function start(usage, timeout = 45000) { console.log("OK ", id, "|", seen); } catch (e) { failed++; - const why = String(e.message ?? e).split("\n")[0].slice(0, 200); + const why = String(e.message ?? e) + .split("\n")[0] + .slice(0, 200); t.note(`${id}: ${action} -> FAIL ${why}`); console.log("FAIL", id, "|", why); } @@ -28,7 +30,14 @@ export async function start(usage, timeout = 45000) { } export const mainText = (p, n = 220) => - p.evaluate((len) => (document.querySelector("main")?.innerText ?? document.body.innerText).replace(/\s+/g, " ").trim().slice(0, len), n); + p.evaluate( + (len) => + (document.querySelector("main")?.innerText ?? document.body.innerText) + .replace(/\s+/g, " ") + .trim() + .slice(0, len), + n, + ); export const rowTitles = (p) => p.locator(ROW).evaluateAll((els) => els.map((e) => e.innerText.replace(/\s+/g, " ").trim())); @@ -48,7 +57,9 @@ export async function searchPalette(p, query) { await p.waitForTimeout(1000); if (await p.locator('[role="option"]').count()) break; } - const opts = (await p.locator('[role="option"]').allInnerTexts()).map((s) => s.replace(/\s+/g, " ")); + const opts = (await p.locator('[role="option"]').allInnerTexts()).map((s) => + s.replace(/\s+/g, " "), + ); await p.keyboard.press("Escape"); return opts; } diff --git a/.agents/skills/verify-t3code/scripts/seed.mjs b/.agents/skills/verify-t3code/scripts/seed.mjs index 2b74284c7b878..120eed71d2bc7 100644 --- a/.agents/skills/verify-t3code/scripts/seed.mjs +++ b/.agents/skills/verify-t3code/scripts/seed.mjs @@ -12,7 +12,10 @@ const { run, t, p, step, finish } = await start("seed.mjs", 90000); await step("onboarding.connect", "wait for the wizard, read step 1", async () => { await p.getByRole("button", { name: "Continue" }).waitFor({ timeout: 180000 }); const text = await p.locator("body").innerText(); - check(/Connected/.test(text) && /primary-asus|Computers to set up/.test(text), "Connect step does not show a connected computer"); + check( + /Connected/.test(text) && /primary-asus|Computers to set up/.test(text), + "Connect step does not show a connected computer", + ); return `${new URL(p.url()).pathname} | ${text.replace(/\s+/g, " ").slice(0, 160)}`; }); await step("onboarding.agents", "Continue -> Your agents", async () => { @@ -34,19 +37,26 @@ await step("projects.add.sources", "click New project, read the sources", async await p.getByRole("button", { name: "New project" }).click(); await p.getByRole("option", { name: /Local folder/ }).waitFor(); const text = (await p.locator('[role="dialog"]').first().innerText()).replace(/\s+/g, " "); - for (const s of ["Local folder", "Git URL", "GitHub repository"]) check(text.includes(s), `source "${s}" missing`); + for (const s of ["Local folder", "Git URL", "GitHub repository"]) + check(text.includes(s), `source "${s}" missing`); return text.slice(0, 200); }); await step("projects.add.local", "Local folder, type the fixture path, Add", async () => { await p.getByRole("option", { name: /Local folder/ }).click(); await p.getByRole("combobox").first().fill(`${run}/fixture/demo-app`); await p.getByRole("button", { name: /^Add/ }).click(); - await p.getByRole("heading", { name: /What should we build in/ }).filter({ hasText: "demo-app" }).waitFor(); + await p + .getByRole("heading", { name: /What should we build in/ }) + .filter({ hasText: "demo-app" }) + .waitFor(); return "draft heading names demo-app"; }); await step("composer.model-picker", "open the model picker, Cursor tab", async () => { - await p.getByRole("button", { name: /routing group|Luna|Codex|Claude/ }).first().click(); + await p + .getByRole("button", { name: /routing group|Luna|Codex|Claude/ }) + .first() + .click(); await p.getByRole("button", { name: "Cursor", exact: true }).click(); const auto = p.getByRole("option", { name: /^Auto Cursor/ }); await auto.waitFor(); @@ -58,13 +68,25 @@ await step("composer.send", "choose Auto, type a prompt, Send message", async () await p.locator('[data-testid="composer-editor"]').first().click(); await p.keyboard.type("verify-t3code: first message"); await p.getByRole("button", { name: "Send message" }).click(); - await p.waitForFunction(() => document.body.innerText.includes("verify-t3code mock reply"), null, { timeout: 120000 }); - check(/^\/[^/]+\/[^/]+$/.test(new URL(p.url()).pathname), "URL is not //"); + await p.waitForFunction( + () => document.body.innerText.includes("verify-t3code mock reply"), + null, + { timeout: 120000 }, + ); + check( + /^\/[^/]+\/[^/]+$/.test(new URL(p.url()).pathname), + "URL is not //", + ); return `reply "verify-t3code mock reply" visible at ${new URL(p.url()).pathname}`; }); await step("composer.worktree", "git worktree list in the fixture repo", async () => { - const out = execFileSync("git", ["-C", `${run}/fixture/demo-app`, "worktree", "list"], { encoding: "utf8" }); - check(/\[t3code\/[0-9a-f]+\]/.test(out) && out.includes(`${run}/home/worktrees/`), "no t3code/ worktree under $RUN/home/worktrees"); + const out = execFileSync("git", ["-C", `${run}/fixture/demo-app`, "worktree", "list"], { + encoding: "utf8", + }); + check( + /\[t3code\/[0-9a-f]+\]/.test(out) && out.includes(`${run}/home/worktrees/`), + "no t3code/ worktree under $RUN/home/worktrees", + ); return out.trim().split("\n").slice(1).join(" ; "); }); finish(); diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts index ad193fccedc56..ec36a50fda596 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts @@ -1073,12 +1073,12 @@ describe("ProviderCommandReactor", () => { expect(refusal).toMatchObject({ summary: "Turn refused by the session spend guard", }); - expect(String(refusal?.payload && (refusal.payload as { detail?: string }).detail)).toContain( - "session ceiling", - ); - expect(String(refusal?.payload && (refusal.payload as { detail?: string }).detail)).not.toContain( - "idle limit", - ); + expect( + String(refusal?.payload && (refusal.payload as { detail?: string }).detail), + ).toContain("session ceiling"); + expect( + String(refusal?.payload && (refusal.payload as { detail?: string }).detail), + ).not.toContain("idle limit"); expect(harness.sendTurn).toHaveBeenCalledTimes(2); NodeFS.rmSync(workspacePath, { recursive: true, force: true }); }), @@ -1144,9 +1144,11 @@ describe("ProviderCommandReactor", () => { 'info', 'context-window.updated', 'Context window updated', - ${costly - ? '{"totalProcessedTokens":1,"lastInputTokens":1,"lastOutputTokens":0}' - : '{"totalProcessedTokens":0,"lastInputTokens":0,"lastOutputTokens":0}'}, + ${ + costly + ? '{"totalProcessedTokens":1,"lastInputTokens":1,"lastOutputTokens":0}' + : '{"totalProcessedTokens":0,"lastInputTokens":0,"lastOutputTokens":0}' + }, ${sequence}, '2099-01-01T00:00:00.000Z' ) diff --git a/apps/server/src/orchestration/SessionSpendGuard.test.ts b/apps/server/src/orchestration/SessionSpendGuard.test.ts index 2300fa3455312..addccbbcb6d4e 100644 --- a/apps/server/src/orchestration/SessionSpendGuard.test.ts +++ b/apps/server/src/orchestration/SessionSpendGuard.test.ts @@ -181,10 +181,7 @@ describe("evaluateSpendGuard", () => { it("stops at the session ceiling when a recent pull request keeps idle spend under the idle limit", () => { const result = evaluate({ workSignalAts: ["2026-01-01T00:02:00.000Z"], - activities: [ - priced("2026-01-01T00:01:00.000Z", 6), - priced("2026-01-01T00:03:00.000Z", 4), - ], + activities: [priced("2026-01-01T00:01:00.000Z", 6), priced("2026-01-01T00:03:00.000Z", 4)], }); expect(result.idleUsd).toBe(4); expect(result.sessionUsd).toBe(10); From e6d030b0e1dd1664559e4650308715039eb6763d Mon Sep 17 00:00:00 2001 From: Kameron Smith Date: Tue, 24 Nov 2026 05:21:50 -0500 Subject: [PATCH 8/8] fix(ci): satisfy Node import lint in verification scripts Model: GPT-6 Task: ci-routing-and-baseline Agent: codex-t3-main2 Harness: Codex CLI Model-Family: GPT Model-Generation: 6 Skills-Sha: unknown Co-Authored-By: Codex --- .../skills/verify-t3code/scripts/browser.mjs | 74 +++++++++---------- .agents/skills/verify-t3code/scripts/seed.mjs | 12 ++- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.agents/skills/verify-t3code/scripts/browser.mjs b/.agents/skills/verify-t3code/scripts/browser.mjs index e89bb4eaa361b..95d8c0754ee88 100644 --- a/.agents/skills/verify-t3code/scripts/browser.mjs +++ b/.agents/skills/verify-t3code/scripts/browser.mjs @@ -13,55 +13,49 @@ // ~/.cache/ms-playwright, with a throwaway profile under RUN_DIR. It never touches a // person's browser profile. cleanup.sh kills the browser by the PID recorded in // RUN_DIR/browser.env. -import { createRequire } from "node:module"; -import { spawn } from "node:child_process"; -import { createServer } from "node:net"; -import { - appendFileSync, - existsSync, - mkdirSync, - openSync, - readFileSync, - readdirSync, - writeFileSync, -} from "node:fs"; -import { join } from "node:path"; -import { homedir } from "node:os"; -import { fileURLToPath } from "node:url"; +import * as NodeModule from "node:module"; +import * as NodeChildProcess from "node:child_process"; +import * as NodeNet from "node:net"; +import * as NodeFS from "node:fs"; +import * as NodePath from "node:path"; +import * as NodeOS from "node:os"; +import * as NodeURL from "node:url"; function readEnvFile(path) { return Object.fromEntries( - readFileSync(path, "utf8") + NodeFS.readFileSync(path, "utf8") .split("\n") .filter((l) => l.includes("=")) .map((l) => [l.slice(0, l.indexOf("=")), l.slice(l.indexOf("=") + 1)]), ); } -export const readInstance = (runDir) => readEnvFile(join(runDir, "instance.env")); +export const readInstance = (runDir) => readEnvFile(NodePath.join(runDir, "instance.env")); function loadPlaywright(repo) { - const store = join(repo, "node_modules/.pnpm"); - const dir = readdirSync(store).find((d) => d.startsWith("playwright-core@")); + const store = NodePath.join(repo, "node_modules/.pnpm"); + const dir = NodeFS.readdirSync(store).find((d) => d.startsWith("playwright-core@")); if (!dir) throw new Error("playwright-core not found in " + store); - return createRequire(join(store, dir, "node_modules/playwright-core/"))("playwright-core"); + return NodeModule.createRequire(NodePath.join(store, dir, "node_modules/playwright-core/"))( + "playwright-core", + ); } function chromiumPath() { - const root = join(homedir(), ".cache/ms-playwright"); + const root = NodePath.join(NodeOS.homedir(), ".cache/ms-playwright"); // chromium- only: chromium_headless_shell-* and chromium-headless-shell-* have no chrome-linux64/chrome. - const dirs = readdirSync(root) + const dirs = NodeFS.readdirSync(root) .filter((d) => /^chromium-\d+$/.test(d)) .sort((a, b) => Number(a.slice(9)) - Number(b.slice(9))); if (!dirs.length) throw new Error("no chromium- in " + root); - const p = join(root, dirs.at(-1), "chrome-linux64/chrome"); - if (!existsSync(p)) throw new Error("no Chromium at " + p); + const p = NodePath.join(root, dirs.at(-1), "chrome-linux64/chrome"); + if (!NodeFS.existsSync(p)) throw new Error("no Chromium at " + p); return p; } const freePort = () => new Promise((resolve, reject) => { - const s = createServer(); + const s = NodeNet.createServer(); s.listen(0, "127.0.0.1", () => { const { port } = s.address(); s.close(() => resolve(port)); @@ -72,10 +66,10 @@ const freePort = () => export async function up(runDir, { width = 1440, height = 900 } = {}) { const inst = readInstance(runDir); const port = await freePort(); - const profile = join(runDir, "profile"); - mkdirSync(profile, { recursive: true }); - const log = openSync(join(runDir, "browser.log"), "a"); - const child = spawn( + const profile = NodePath.join(runDir, "profile"); + NodeFS.mkdirSync(profile, { recursive: true }); + const log = NodeFS.openSync(NodePath.join(runDir, "browser.log"), "a"); + const child = NodeChildProcess.spawn( chromiumPath(), [ "--headless=new", @@ -94,9 +88,13 @@ export async function up(runDir, { width = 1440, height = 900 } = {}) { { detached: true, stdio: ["ignore", log, log] }, ); child.unref(); - writeFileSync(join(runDir, "browser.env"), `BROWSER_PID=${child.pid}\nCDP_PORT=${port}\n`, { - mode: 0o600, - }); + NodeFS.writeFileSync( + NodePath.join(runDir, "browser.env"), + `BROWSER_PID=${child.pid}\nCDP_PORT=${port}\n`, + { + mode: 0o600, + }, + ); const t = await connect(runDir, { retries: 40 }); // Dev mode serves hundreds of modules, so "domcontentloaded" can exceed 30 s on a busy // host. Return at "commit" and let callers wait for real UI. @@ -107,7 +105,7 @@ export async function up(runDir, { width = 1440, height = 900 } = {}) { export async function connect(runDir, { retries = 1 } = {}) { const inst = readInstance(runDir); - const { CDP_PORT } = readEnvFile(join(runDir, "browser.env")); + const { CDP_PORT } = readEnvFile(NodePath.join(runDir, "browser.env")); const { chromium } = loadPlaywright(inst.REPO); let browser; for (let i = 0; ; i++) { @@ -122,8 +120,8 @@ export async function connect(runDir, { retries = 1 } = {}) { const context = browser.contexts()[0]; const page = context.pages()[0] ?? (await context.newPage()); page.setDefaultTimeout(60000); - const evidence = join(runDir, "evidence"); - mkdirSync(evidence, { recursive: true }); + const evidence = NodePath.join(runDir, "evidence"); + NodeFS.mkdirSync(evidence, { recursive: true }); const consoleErrors = []; page.on("pageerror", (e) => consoleErrors.push(String(e))); page.on("console", (m) => { @@ -136,7 +134,7 @@ export async function connect(runDir, { retries = 1 } = {}) { consoleErrors, base: `http://localhost:${inst.WEB_PORT}`, async shot(name) { - const path = join(evidence, `${name}.png`); + const path = NodePath.join(evidence, `${name}.png`); // A saturated host can stall a screenshot; a missing image is reported, never fatal. return page.screenshot({ path, timeout: 90000 }).then( () => path, @@ -144,7 +142,7 @@ export async function connect(runDir, { retries = 1 } = {}) { ); }, note(line) { - appendFileSync(join(evidence, "observed.log"), line + "\n"); + NodeFS.appendFileSync(NodePath.join(evidence, "observed.log"), line + "\n"); }, // Drop this script's connection; the browser keeps running for the next script. async detach() { @@ -153,7 +151,7 @@ export async function connect(runDir, { retries = 1 } = {}) { }; } -if (process.argv[1] === fileURLToPath(import.meta.url) && process.argv[2] === "up") { +if (process.argv[1] === NodeURL.fileURLToPath(import.meta.url) && process.argv[2] === "up") { const r = await up(process.argv[3]); console.log(`browser pid=${r.pid} cdp=127.0.0.1:${r.port}`); process.exit(0); diff --git a/.agents/skills/verify-t3code/scripts/seed.mjs b/.agents/skills/verify-t3code/scripts/seed.mjs index 120eed71d2bc7..98da20198c338 100644 --- a/.agents/skills/verify-t3code/scripts/seed.mjs +++ b/.agents/skills/verify-t3code/scripts/seed.mjs @@ -2,7 +2,7 @@ // first-run wizard -> add the fixture project -> send one message with the mock Cursor // provider. Each step logs its sub-feature ID and asserts the end state. // node seed.mjs RUN_DIR -import { execFileSync } from "node:child_process"; +import * as NodeChildProcess from "node:child_process"; import { start, check } from "./lib.mjs"; const { run, t, p, step, finish } = await start("seed.mjs", 90000); @@ -80,9 +80,13 @@ await step("composer.send", "choose Auto, type a prompt, Send message", async () return `reply "verify-t3code mock reply" visible at ${new URL(p.url()).pathname}`; }); await step("composer.worktree", "git worktree list in the fixture repo", async () => { - const out = execFileSync("git", ["-C", `${run}/fixture/demo-app`, "worktree", "list"], { - encoding: "utf8", - }); + const out = NodeChildProcess.execFileSync( + "git", + ["-C", `${run}/fixture/demo-app`, "worktree", "list"], + { + encoding: "utf8", + }, + ); check( /\[t3code\/[0-9a-f]+\]/.test(out) && out.includes(`${run}/home/worktrees/`), "no t3code/ worktree under $RUN/home/worktrees",