Repository navigation
fix(server): wake threads when watches and waits go stale #464
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: T3 fork ARC CI | |
| # Self-hosted, repository-scoped ARC only. No paid Blacksmith, macOS/Windows | |
| # runners, new controller or deployment side effects. GitHub-hosted runners are | |
| # forbidden outright, and burst capacity is | |
| # Hetzner ARC nodes only (closura-agent-config scripts/arc_burst_nodes.py). | |
| # .github/scripts/no-hosted-runners.test.cjs fails any workflow that says otherwise. | |
| on: | |
| push: | |
| # Every merged head of the native release branch gets a check run on its | |
| # exact commit; the private fleet rollout builds only commits that passed. | |
| branches: [feat/assemblyai-current, release/native-0.1.10] | |
| pull_request: | |
| # `edited` covers retargeting a PR onto a release branch. Without it, a PR | |
| # whose commits were all pushed before the retarget merged with no ARC run. | |
| # A founder's edit reruns the full job. An edit by anyone else (for example | |
| # CodeRabbit rewriting the description) starts a run whose job is skipped; | |
| # the concurrency group below keeps it from cancelling the real run. | |
| # Draft pull requests skip the three ARC workers, so parked drafts use no | |
| # ARC time. `ready_for_review` starts the full run when a draft is marked ready. | |
| types: [opened, synchronize, reopened, edited, ready_for_review] | |
| branches: [feat/assemblyai-current, release/native-0.1.10] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| # Pushes group by exact commit, so a burst of merges never cancels a queued | |
| # head: every merged head keeps its own check run. PR runs also group by the | |
| # triggering actor, so a bot's edit-triggered (skipped) run never cancels a | |
| # founder's in-progress run. | |
| group: t3-fork-arc-${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.event.pull_request.number || github.ref }}-${{ github.event_name == 'pull_request' && github.triggering_actor || 'x' }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| # The former single job ran every step in series, so one runner held the | |
| # whole 8-15 minute critical path. The work splits into independent workers | |
| # that share nothing but the source tree. The ruleset `release-native-protection` | |
| # requires the check name "Voice + founder inbox (Linux ARC)" exactly, so the | |
| # tiny aggregator job below keeps that name and the workers do the work. | |
| voice-and-inbox-core: | |
| # This is a public fork. Never run untrusted PR code on the private ARC LAN. | |
| # Same-repo PR + trusted human author/actor only; push and manual runs | |
| # require an authorized actor and one of the two exact branches above. | |
| # The one non-human author is the Closura upstream-sync GitHub App | |
| # (CLO-1110), admitted only by its exact login and numeric id, on a | |
| # same-repo `sync/upstream-` branch into the release line, with a | |
| # `Deploy: none` line in the body. A login ending in `[bot]` cannot be | |
| # registered by a person. The same clause gates all three workers; | |
| # .github/scripts/arc-ci-trust-gate.test.cjs keeps them identical. | |
| if: >- | |
| ${{ | |
| github.repository_id == '1372173214' && | |
| ( | |
| (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) && | |
| 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 && | |
| github.event.pull_request.base.ref == 'release/native-0.1.10' && | |
| startsWith(github.event.pull_request.head.ref, 'sync/upstream-') && | |
| github.event.pull_request.user.login == 'closura-t3code-upstream-sync[bot]' && | |
| github.event.pull_request.user.id == 360477638 && | |
| github.actor == 'closura-t3code-upstream-sync[bot]' && | |
| github.actor_id == '360477638' && | |
| github.triggering_actor == 'closura-t3code-upstream-sync[bot]' && | |
| contains(format(fromJSON('"\n{0}\n"'), github.event.pull_request.body), fromJSON('"\nDeploy: none\n"')) && | |
| !contains(github.event.pull_request.body, 'Deploy: fleet')) | |
| || | |
| (github.event_name != 'pull_request' && | |
| (github.ref == 'refs/heads/feat/assemblyai-current' || | |
| github.ref == 'refs/heads/release/native-0.1.10') && | |
| contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor)) | |
| ) | |
| }} | |
| name: Voice + inbox core (Linux ARC) | |
| runs-on: t3code-ci-arc | |
| timeout-minutes: 45 | |
| env: | |
| CI: "true" | |
| GIT_CONFIG_NOSYSTEM: "1" | |
| NODE_OPTIONS: "--max-old-space-size=3072" | |
| GOMAXPROCS: "2" | |
| steps: | |
| # The App's `if:` clause above is only a prefilter. Before any checkout, | |
| # parse its Deploy line exactly as closura-deploy-line.yml does (one | |
| # unfenced `^Deploy:` line, whitespace stripped) and require `none`. Reads | |
| # only the event payload; runs no PR code. | |
| - name: Require Deploy none from the upstream-sync App | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.id == 360477638 }} | |
| shell: bash | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| set -euo pipefail | |
| lines="$(printf '%s\n' "${PR_BODY:-}" | tr -d '\r' \ | |
| | awk '/^[[:space:]]*(```|~~~)/ { fenced = !fenced; next } !fenced && /^Deploy:/' || true)" | |
| count="$(printf '%s' "$lines" | grep -c . || true)" | |
| value="$(printf '%s' "$lines" | sed -E 's/^Deploy:[[:space:]]*//; s/[[:space:]]+$//')" | |
| if test "$count" -ne 1 || test "$value" != none; then | |
| echo "::error::The upstream-sync App runs on ARC only with exactly one 'Deploy: none' line." | |
| exit 1 | |
| fi | |
| - name: Checkout trusted source (no persistent credentials) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 2 | |
| sparse-checkout: | | |
| /* | |
| !/.repos/ | |
| !/apps/mobile/modules/t3-terminal/Vendor/**/*.a | |
| sparse-checkout-cone-mode: false | |
| - name: Prove exact ARC repository and worker | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| test "$GITHUB_REPOSITORY_ID" = '1372173214' | |
| test -n "${RUNNER_NAME:-}" | |
| test "$RUNNER_OS" = Linux | |
| printf 'T3 ARC: repo=%s runner=%s ref=%s source=%s\n' \ | |
| "$GITHUB_REPOSITORY" "$RUNNER_NAME" "$GITHUB_REF" "$(git rev-parse HEAD)" | |
| - name: Provide libatomic for official Node binaries | |
| uses: ./.github/actions/provide-libatomic | |
| # setup-vp's own cache cannot see the pnpm store on a self-hosted runner | |
| # that starts from a clean workspace, so caching goes through the shared | |
| # action: the Vite+ home, the pnpm store and the lockfile verification | |
| # record, keyed on the lockfile. This job installs the whole workspace and | |
| # is the one that saves the store; the other two restore it. | |
| - name: Install locked dependencies from cache | |
| uses: ./.github/actions/setup-ci-deps | |
| # After Node. The ARC image has no `node` until setup-ci-deps, so running | |
| # this earlier exits 127 before the receipt can measure anything. | |
| - name: Fork drift receipt | |
| run: | | |
| # The checkout is shallow (`fetch-depth: 2`) and only has the | |
| # triggering ref. A plain `git fetch` of another ref keeps the | |
| # shallow boundary, and the merge-base between the release line and | |
| # upstream/main sits hundreds of commits behind it, so `git | |
| # merge-base` fails and the receipt exits 2. Drop the boundary first. | |
| # `--unshallow` errors on a complete clone, so only pass it while | |
| # `.git/shallow` exists. `--filter=blob:none` fetches the commit graph | |
| # without file contents. | |
| unshallow=() | |
| if [ -f .git/shallow ]; then unshallow=(--unshallow); fi | |
| git fetch --no-tags --filter=blob:none "${unshallow[@]}" origin "${{ github.base_ref || github.ref_name }}:refs/remotes/origin/${{ github.base_ref || github.ref_name }}" | |
| git fetch --no-tags --filter=blob:none https://github.com/pingdotgg/t3code.git main:refs/remotes/upstream/main | |
| node --test scripts/fork-drift-receipt.test.mjs scripts/fork-sync-plan.test.mjs | |
| # Exit 1 means the release line is past its drift budget, which is | |
| # reported rather than failed. Exit 2 means the receipt itself broke. | |
| node scripts/fork-drift-receipt.mjs --base "origin/${{ github.base_ref || github.ref_name }}" || rc=$? | |
| if [ "${rc:-0}" -eq 2 ]; then exit 2; fi | |
| shell: bash | |
| - name: Guard indispensable AssemblyAI voice implementation | |
| shell: bash | |
| run: | | |
| node --input-type=module <<'NODE' | |
| import { readFileSync } from 'node:fs'; | |
| const required = { | |
| 'apps/server/src/speech/CloudSpeech.ts': ['assemblyai', 'sync.assemblyai.com/v1/transcribe', 'word_boost'], | |
| 'apps/server/src/speech/CloudSpeech.test.ts': ['AssemblyAI', 'assemblyai'], | |
| 'packages/contracts/src/speech.ts': ['assemblyai'], | |
| 'apps/web/src/components/settings/CloudVoiceConfiguration.tsx': ['assemblyai'], | |
| 'packages/contracts/src/threadInbox.ts': ['matchesInboxView', 'matchesInboxFilter', 'agent-only'], | |
| 'packages/client-runtime/src/state/threadListFilter.ts': ['matchesPrimaryInbox', 'matchesListedInboxes', 'hiddenEnvironmentIds'], | |
| 'apps/web/src/components/sidebar/SidebarThreadFilterMenu.tsx': ['Kameron', 'Jeff', 'Agents', 'Environments'], | |
| 'apps/web/src/components/sidebar/threadListFilter.logic.ts': ['matchesListedInboxes', 'hiddenEnvironmentIds'], | |
| }; | |
| for (const [file, needles] of Object.entries(required)) { | |
| const source = readFileSync(file, 'utf8'); | |
| for (const needle of needles) { | |
| if (!source.includes(needle)) throw new Error(file + ' missing ' + needle); | |
| } | |
| } | |
| process.stdout.write('AssemblyAI voice + shared founder inbox source preserved\n'); | |
| NODE | |
| - name: Typecheck contracts, runtime, provider and server | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| vp run --filter @t3tools/contracts typecheck | |
| vp run --filter @t3tools/shared typecheck | |
| vp run --filter @t3tools/client-runtime typecheck | |
| vp run --filter @t3tools/provider-core typecheck | |
| vp run --filter t3 typecheck | |
| vp run --filter @t3tools/mobile typecheck | |
| - name: Test server voice, inbox and placement behavior | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| vp test run \ | |
| apps/server/src/speech/CloudSpeech.test.ts \ | |
| apps/server/src/speech/GroqSpeechStream.test.ts \ | |
| apps/server/src/speech/stream.test.ts \ | |
| packages/contracts/src/threadInbox.test.ts \ | |
| packages/contracts/src/threadInbox.invariants.test.ts \ | |
| packages/contracts/src/threadInbox.upgrade.test.ts \ | |
| packages/contracts/src/threadMetadataMcp.test.ts \ | |
| apps/server/src/orchestration-v2/ThreadLaunchService.test.ts \ | |
| apps/server/src/orchestration-v2/SubagentProjection.test.ts \ | |
| apps/server/src/orchestration-v2/ModelAlertReactor.test.ts \ | |
| apps/server/src/orchestration-v2/ThreadEventAlerts.test.ts \ | |
| apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts \ | |
| packages/shared/src/threadPlacement.test.ts \ | |
| apps/server/src/peer/RemoteDelegation.test.ts \ | |
| apps/server/src/mcp/OrchestratorMcpService.test.ts \ | |
| apps/server/src/cli/thread.test.ts \ | |
| apps/server/src/ws.test.ts \ | |
| packages/contracts/src/environment.test.ts \ | |
| scripts/feature-map.test.ts | |
| - name: Build native T3 server | |
| shell: bash | |
| run: vp run --filter t3 build:bundle | |
| # The fleet rollout ships the single executable, not the bundle. Its import guard | |
| # rejects a file-backed package loaded with import(), so a head that passes the | |
| # bundle build alone still fails the fleet build and never deploys. | |
| - name: Build native T3 single executable | |
| shell: bash | |
| run: node apps/server/scripts/cli.ts build-exe | |
| - name: Verify compiled server output | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| test -f apps/server/dist/bin.mjs | |
| printf 'Exact T3 source %s, server build successful on %s\n' \ | |
| "$(git rev-parse HEAD)" "$RUNNER_NAME" | |
| voice-and-inbox-web: | |
| if: >- | |
| ${{ | |
| github.repository_id == '1372173214' && | |
| ( | |
| (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) && | |
| 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 && | |
| github.event.pull_request.base.ref == 'release/native-0.1.10' && | |
| startsWith(github.event.pull_request.head.ref, 'sync/upstream-') && | |
| github.event.pull_request.user.login == 'closura-t3code-upstream-sync[bot]' && | |
| github.event.pull_request.user.id == 360477638 && | |
| github.actor == 'closura-t3code-upstream-sync[bot]' && | |
| github.actor_id == '360477638' && | |
| github.triggering_actor == 'closura-t3code-upstream-sync[bot]' && | |
| contains(format(fromJSON('"\n{0}\n"'), github.event.pull_request.body), fromJSON('"\nDeploy: none\n"')) && | |
| !contains(github.event.pull_request.body, 'Deploy: fleet')) | |
| || | |
| (github.event_name != 'pull_request' && | |
| (github.ref == 'refs/heads/feat/assemblyai-current' || | |
| github.ref == 'refs/heads/release/native-0.1.10') && | |
| contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor)) | |
| ) | |
| }} | |
| name: Voice + inbox web (Linux ARC) | |
| runs-on: t3code-ci-arc | |
| timeout-minutes: 45 | |
| env: | |
| CI: "true" | |
| GIT_CONFIG_NOSYSTEM: "1" | |
| NODE_OPTIONS: "--max-old-space-size=3072" | |
| GOMAXPROCS: "2" | |
| steps: | |
| # The App's `if:` clause above is only a prefilter. Before any checkout, | |
| # parse its Deploy line exactly as closura-deploy-line.yml does (one | |
| # unfenced `^Deploy:` line, whitespace stripped) and require `none`. Reads | |
| # only the event payload; runs no PR code. | |
| - name: Require Deploy none from the upstream-sync App | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.id == 360477638 }} | |
| shell: bash | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| set -euo pipefail | |
| lines="$(printf '%s\n' "${PR_BODY:-}" | tr -d '\r' \ | |
| | awk '/^[[:space:]]*(```|~~~)/ { fenced = !fenced; next } !fenced && /^Deploy:/' || true)" | |
| count="$(printf '%s' "$lines" | grep -c . || true)" | |
| value="$(printf '%s' "$lines" | sed -E 's/^Deploy:[[:space:]]*//; s/[[:space:]]+$//')" | |
| if test "$count" -ne 1 || test "$value" != none; then | |
| echo "::error::The upstream-sync App runs on ARC only with exactly one 'Deploy: none' line." | |
| exit 1 | |
| fi | |
| - name: Checkout trusted source (no persistent credentials) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 2 | |
| sparse-checkout: | | |
| /* | |
| !/.repos/ | |
| !/apps/mobile/modules/t3-terminal/Vendor/**/*.a | |
| sparse-checkout-cone-mode: false | |
| - name: Provide libatomic for official Node binaries | |
| uses: ./.github/actions/provide-libatomic | |
| # Restores the store the core job saves. save-pnpm-store stays off so two | |
| # jobs never race to reserve the same cache key. | |
| - name: Install locked dependencies from cache | |
| uses: ./.github/actions/setup-ci-deps | |
| with: | |
| save-pnpm-store: "false" | |
| - name: Test web inbox, composer and voice behavior | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| vp test run \ | |
| apps/web/src/components/threadActionMenu.logic.test.ts \ | |
| apps/web/src/components/sidebar/threadListFilter.logic.test.ts \ | |
| packages/client-runtime/src/state/threadAttribution.test.ts \ | |
| apps/web/src/composerDraftStore.test.ts \ | |
| packages/client-runtime/src/voice-input/controller.test.ts \ | |
| apps/web/src/components/chat/composerSend.logic.test.ts \ | |
| apps/web/src/components/chat/chatViewSend.test.ts \ | |
| apps/web/src/components/chat/composerImagePersistence.test.ts \ | |
| apps/web/src/components/chat/draftPlacement.test.ts \ | |
| apps/web/src/components/chat/draftAttachmentUploads.test.ts \ | |
| apps/web/src/components/chat/draftUploadReconcile.test.ts \ | |
| apps/web/src/lib/attachmentUploadQueue.test.ts | |
| - name: Build founder inbox and voice settings web client | |
| shell: bash | |
| run: vp run --filter @t3tools/web build | |
| - name: Verify compiled web output | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| test -d apps/web/dist | |
| printf 'Exact T3 source %s, web build successful on %s\n' \ | |
| "$(git rev-parse HEAD)" "$RUNNER_NAME" | |
| voice-and-inbox-mobile: | |
| if: >- | |
| ${{ | |
| github.repository_id == '1372173214' && | |
| ( | |
| (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) && | |
| 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 && | |
| github.event.pull_request.base.ref == 'release/native-0.1.10' && | |
| startsWith(github.event.pull_request.head.ref, 'sync/upstream-') && | |
| github.event.pull_request.user.login == 'closura-t3code-upstream-sync[bot]' && | |
| github.event.pull_request.user.id == 360477638 && | |
| github.actor == 'closura-t3code-upstream-sync[bot]' && | |
| github.actor_id == '360477638' && | |
| github.triggering_actor == 'closura-t3code-upstream-sync[bot]' && | |
| contains(format(fromJSON('"\n{0}\n"'), github.event.pull_request.body), fromJSON('"\nDeploy: none\n"')) && | |
| !contains(github.event.pull_request.body, 'Deploy: fleet')) | |
| ) | |
| || | |
| ( | |
| github.event_name != 'pull_request' && | |
| (github.ref == 'refs/heads/feat/assemblyai-current' || | |
| github.ref == 'refs/heads/release/native-0.1.10') && | |
| contains(fromJSON('["nullStack65","jeffreysmithclosura"]'), github.actor) | |
| ) | |
| }} | |
| name: Voice + inbox mobile (Linux ARC) | |
| runs-on: t3code-ci-arc | |
| timeout-minutes: 45 | |
| env: | |
| CI: "true" | |
| GIT_CONFIG_NOSYSTEM: "1" | |
| NODE_OPTIONS: "--max-old-space-size=3072" | |
| GOMAXPROCS: "2" | |
| steps: | |
| # The App's `if:` clause above is only a prefilter. Before any checkout, | |
| # parse its Deploy line exactly as closura-deploy-line.yml does (one | |
| # unfenced `^Deploy:` line, whitespace stripped) and require `none`. Reads | |
| # only the event payload; runs no PR code. | |
| - name: Require Deploy none from the upstream-sync App | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.id == 360477638 }} | |
| shell: bash | |
| env: | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| set -euo pipefail | |
| lines="$(printf '%s\n' "${PR_BODY:-}" | tr -d '\r' \ | |
| | awk '/^[[:space:]]*(```|~~~)/ { fenced = !fenced; next } !fenced && /^Deploy:/' || true)" | |
| count="$(printf '%s' "$lines" | grep -c . || true)" | |
| value="$(printf '%s' "$lines" | sed -E 's/^Deploy:[[:space:]]*//; s/[[:space:]]+$//')" | |
| if test "$count" -ne 1 || test "$value" != none; then | |
| echo "::error::The upstream-sync App runs on ARC only with exactly one 'Deploy: none' line." | |
| exit 1 | |
| fi | |
| - name: Checkout trusted source (no persistent credentials) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 2 | |
| sparse-checkout: | | |
| /* | |
| !/.repos/ | |
| !/apps/mobile/modules/t3-terminal/Vendor/**/*.a | |
| sparse-checkout-cone-mode: false | |
| - name: Provide libatomic for official Node binaries | |
| uses: ./.github/actions/provide-libatomic | |
| - name: Install locked dependencies from cache | |
| uses: ./.github/actions/setup-ci-deps | |
| with: | |
| save-pnpm-store: "false" | |
| - name: Gate interaction latency at 400 ms | |
| shell: bash | |
| working-directory: apps/web | |
| run: | | |
| set -euo pipefail | |
| export PLAYWRIGHT_BROWSERS_PATH="$RUNNER_TEMP/ms-playwright" | |
| vp exec playwright install --only-shell chromium | |
| shell=$(find "$PLAYWRIGHT_BROWSERS_PATH" -type f -name chrome-headless-shell | head -1) | |
| if ! test -x "$shell"; then | |
| echo "::error::Playwright installed no chrome-headless-shell under $PLAYWRIGHT_BROWSERS_PATH." | |
| exit 1 | |
| fi | |
| packages=(libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 libatspi2.0-0t64 libcairo2 | |
| libcups2t64 libdbus-1-3 libdrm2 libgbm1 libglib2.0-0t64 libnspr4 libnss3 libpango-1.0-0 | |
| libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2) | |
| # -o Dir::Etc is applied after apt has already read /etc/apt/apt.conf.d, so the | |
| # image Post-Invoke still runs and its rm of /var/cache/apt/archives/partial fails | |
| # the step. APT_CONFIG is read first, which is what points Dir::Etc away from | |
| # those hooks. Downloads stay under the job temp dir. Status stays the image | |
| # dpkg database, so apt fetches only libraries the image does not already have | |
| # and the extract does not replace the image libc. | |
| apt_dir="$RUNNER_TEMP/chromium-apt" | |
| mkdir -p "$apt_dir/etc/apt.conf.d" "$apt_dir/etc/sources.list.d" "$apt_dir/etc/preferences.d" \ | |
| "$apt_dir/lists/partial" "$apt_dir/archives/partial" "$apt_dir/root" | |
| printf '%s\n' \ | |
| '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' \ | |
| > "$apt_dir/etc/sources.list" | |
| cat > "$apt_dir/apt.conf" <<EOF | |
| Dir::Etc "$apt_dir/etc"; | |
| Dir::Etc::sourcelist "$apt_dir/etc/sources.list"; | |
| Dir::Etc::sourceparts "$apt_dir/etc/sources.list.d"; | |
| Dir::Etc::parts "$apt_dir/etc/apt.conf.d"; | |
| Dir::State::lists "$apt_dir/lists"; | |
| Dir::State::status "/var/lib/dpkg/status"; | |
| Dir::Cache::archives "$apt_dir/archives"; | |
| Dir::Cache::pkgcache "$apt_dir/pkgcache.bin"; | |
| Dir::Cache::srcpkgcache "$apt_dir/srcpkgcache.bin"; | |
| Debug::NoLocking "1"; | |
| APT::Get::List-Cleanup "0"; | |
| EOF | |
| sed -i -E 's/^[[:space:]]+//' "$apt_dir/apt.conf" | |
| export APT_CONFIG="$apt_dir/apt.conf" | |
| apt-get update -qq | |
| apt-get -qq install --download-only --no-install-recommends -y "${packages[@]}" | |
| shopt -s nullglob | |
| debs=("$apt_dir"/archives/*.deb) | |
| shopt -u nullglob | |
| for deb in "${debs[@]}"; do dpkg-deb -x "$deb" "$apt_dir/root"; done | |
| export LD_LIBRARY_PATH="$apt_dir/root/usr/lib/x86_64-linux-gnu:$apt_dir/root/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | |
| mkdir -p "$RUNNER_TEMP/fontconfig-cache" | |
| printf '<?xml version="1.0"?>\n<fontconfig><dir>/usr/share/fonts</dir><dir>%s</dir><cachedir>%s</cachedir></fontconfig>\n' \ | |
| "$apt_dir/root/usr/share/fonts" "$RUNNER_TEMP/fontconfig-cache" > "$RUNNER_TEMP/fonts.conf" | |
| export FONTCONFIG_FILE="$RUNNER_TEMP/fonts.conf" | |
| fonts=0 | |
| for font_dir in /usr/share/fonts "$apt_dir/root/usr/share/fonts"; do | |
| if test -d "$font_dir"; then | |
| fonts=$((fonts + $(find "$font_dir" -name '*.ttf' | wc -l))) | |
| fi | |
| done | |
| if test "$fonts" -eq 0; then | |
| echo "::error::No fonts for headless Chromium, so text has no size and is never visible." | |
| exit 1 | |
| fi | |
| printf 'Fonts available to Chromium: %s\n' "$fonts" | |
| if ldd "$shell" | grep 'not found'; then | |
| echo "::error::Headless Chromium still misses the libraries above." | |
| exit 1 | |
| fi | |
| vp run test:latency | |
| - name: Test mobile new-task placement, outbox and uploads | |
| shell: bash | |
| working-directory: apps/mobile | |
| run: | | |
| set -euo pipefail | |
| vp test run \ | |
| src/state/thread-placement.model.test.ts \ | |
| src/state/threadOutboxDelivery.placement.test.ts \ | |
| src/state/composer-attachment-uploads.test.ts \ | |
| src/lib/composerAttachmentUploadQueue.test.ts \ | |
| src/lib/attachmentUpload.test.ts \ | |
| src/state/use-composer-drafts.test.ts \ | |
| src/state/thread-outbox.test.ts \ | |
| src/state/threadOutboxDelivery.permissions.test.ts \ | |
| src/state/threadOutboxDelivery.test.ts \ | |
| src/state/pending-thread-creation.test.ts \ | |
| src/lib/projectThreadStartTurn.test.ts \ | |
| src/features/threads/thread-route-state.test.ts \ | |
| src/features/threads/new-task-flow-provider.test.tsx \ | |
| src/features/home/pendingTaskRoute.test.tsx \ | |
| src/features/threads/NewTaskDraftRouteScreen.test.tsx | |
| - name: Provide Chromium libraries for the voice latency browser test | |
| uses: ./.github/actions/provide-chromium-libs | |
| # The browser binary is the slow download. It is keyed on the Playwright | |
| # version this lockfile resolves, so a bump refetches and everything else | |
| # restores. The path is the runner temp dir, which is wiped between jobs, | |
| # so nothing stale survives a version change. | |
| - name: Restore Playwright Chromium | |
| id: playwright_cache | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ${{ runner.temp }}/playwright-browsers | |
| key: playwright-chromium-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Test voice press-to-recording and release-to-text stay under 400 ms | |
| shell: bash | |
| working-directory: apps/web | |
| env: | |
| PLAYWRIGHT_BROWSERS_PATH: ${{ runner.temp }}/playwright-browsers | |
| run: | | |
| set -euo pipefail | |
| vp exec playwright install --only-shell chromium | |
| vp test run --project browser -t "records within 400 ms" \ | |
| src/speech/voiceInputLatency.browser.test.ts \ | |
| src/speech/useEnvironmentSpeechInput.browser.test.tsx | |
| - name: Save Playwright Chromium | |
| if: steps.playwright_cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ${{ runner.temp }}/playwright-browsers | |
| key: ${{ steps.playwright_cache.outputs.cache-primary-key }} | |
| # Reports the exact check name the release-native-protection ruleset requires. | |
| # It runs no build and installs no workspace dependencies. The ARC image has | |
| # no `node` on PATH, so this job sets up the repo's Node before the coverage | |
| # guard. It fails when any worker failed, was cancelled, or was skipped. A | |
| # skipped worker means the trust gate refused the run, and a required check | |
| # must not turn green for a run that did no work. | |
| # | |
| # `if: always()` would also start this job when the workflow is cancelled, and | |
| # a worker that never started reports `success`. The concurrency group cancels | |
| # the previous in-progress run on every new push, so that would mark the | |
| # required check green for a run whose tests never ran. `!cancelled()` still | |
| # runs when a worker failed or was skipped. | |
| # | |
| # On a draft pull request the workers are skipped and this job fails at its | |
| # first step, so the required check stays red until the full run passes. It | |
| # reads only the event payload there. GitHub-hosted runners are forbidden, | |
| # so even this draft hold runs on the ARC scale set. | |
| voice-and-inbox: | |
| name: Voice + founder inbox (Linux ARC) | |
| needs: [voice-and-inbox-core, voice-and-inbox-web, voice-and-inbox-mobile] | |
| if: ${{ !cancelled() }} | |
| runs-on: t3code-ci-arc | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Hold drafts until ready for review | |
| if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft }} | |
| shell: bash | |
| run: | | |
| echo "::error::Draft pull request: the ARC workers run when it is marked ready for review." | |
| exit 1 | |
| # Before any checkout: a run whose workers failed or were skipped (for | |
| # example a rejected fork PR) fails here without executing PR content. | |
| - name: Report the three workers | |
| shell: bash | |
| env: | |
| CORE: ${{ needs.voice-and-inbox-core.result }} | |
| WEB: ${{ needs.voice-and-inbox-web.result }} | |
| MOBILE: ${{ needs.voice-and-inbox-mobile.result }} | |
| run: | | |
| set -euo pipefail | |
| printf 'core=%s web=%s mobile=%s\n' "$CORE" "$WEB" "$MOBILE" | |
| for result in "$CORE" "$WEB" "$MOBILE"; do | |
| test "$result" = success | |
| done | |
| - name: Checkout trusted source (no persistent credentials) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 2 | |
| # package.json is the Node version file. Cone mode on Git 2.43 accepts | |
| # that root file alongside the .github directory. | |
| sparse-checkout: | | |
| .github | |
| package.json | |
| # Official Node 26 links libatomic.so.1, which this image does not ship. | |
| # The library path has to be set before setup-node runs that binary. | |
| - name: Provide libatomic for official Node binaries | |
| uses: ./.github/actions/provide-libatomic | |
| - name: Setup Node | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version-file: package.json | |
| # Fails the required check when a worker no longer runs one of the 48 | |
| # tests the serial job ran, so coverage cannot shrink without this going red. | |
| - name: Guard the parallel coverage | |
| shell: bash | |
| run: node .github/scripts/arc-ci-coverage.cjs | |
| # Proves the worker gates still admit only the founders and the exact | |
| # upstream-sync App shape, and that all three workers share one gate. | |
| - name: Test the ARC trust gate | |
| shell: bash | |
| run: node --test .github/scripts/arc-ci-trust-gate.test.cjs .github/scripts/no-hosted-runners.test.cjs |