Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

ci: run Akeru checks on Depot (#13)

Leoa29f2c7bc0c2
diff --git a/.depot/workflows/ci.yml b/.depot/workflows/ci.yml
new file mode 100644
index 000000000..aed7be1a5
--- /dev/null
+++ b/.depot/workflows/ci.yml
@@ -0,0 +1,164 @@
+# Depot CI runs Akeru checks on pull requests and main.
+
+name: CI
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+
+concurrency:
+ group: ci-${{ github.event.pull_request.number || github.sha }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+jobs:
+ public_dependencies:
+ name: Public dependency install
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: false
+
+ - name: Reject dependencies outside the repository
+ run: node scripts/check-public-dependencies.ts
+
+ - name: Install from the committed lockfile
+ run: vp install --frozen-lockfile
+
+ check:
+ name: Lint, types, and builds
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Reject repository-owned PR assets
+ run: |
+ files="$(git ls-files .github/pr-assets)"
+ if test -n "$files"; then
+ printf 'PR evidence must be uploaded to GitHub, not committed:\n%s\n' "$files" >&2
+ exit 1
+ fi
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: true
+
+ - name: Ensure Electron runtime is installed
+ run: vp run --filter @t3tools/desktop ensure:electron
+
+ - name: Lint
+ run: vp run lint
+
+ - name: Check formatting
+ run: vp run fmt:check
+
+ - name: Typecheck
+ run: vp run typecheck
+
+ - name: Build desktop pipeline
+ run: vp run build:desktop
+
+ - name: Verify preload bundle output
+ run: |
+ test -f apps/desktop/dist-electron/preload.cjs
+ grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
+
+ - name: Build marketing site
+ run: vp run build:marketing
+
+ test:
+ name: Focused workspace tests
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: true
+
+ - name: Ensure Electron runtime is installed
+ run: vp run --filter @t3tools/desktop ensure:electron
+
+ - name: Test shipped desktop and shared packages
+ run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!t3code-relay' --filter '!@t3tools/monorepo' --filter '!@t3tools/mobile' test
+
+ test_server:
+ name: Server tests (shard ${{ matrix.shard }}/${{ strategy.job-total }})
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: true
+
+ - name: Test isolated server shard
+ run: >-
+ vp run --filter t3 test
+ --shard ${{ matrix.shard }}/${{ strategy.job-total }}
+ --exclude integration/orchestrationEngine.integration.test.ts
+
+ rust:
+ name: Resource monitor
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 10
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ components: rustfmt
+
+ - name: Check formatting
+ run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
+
+ - name: Test
+ run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
+
+ release_smoke:
+ name: Release smoke
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: true
+
+ - name: Exercise release-only configuration
+ run: vp run release:smoke
diff --git a/.depot/workflows/release.yml b/.depot/workflows/release.yml
new file mode 100644
index 000000000..88183ca6c
--- /dev/null
+++ b/.depot/workflows/release.yml
@@ -0,0 +1,280 @@
+# Depot CI builds smoke artifacts. It does not publish or release them.
+
+name: Release artifact smoke
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: Version used for the smoke artifacts
+ required: true
+ default: 0.0.0-smoke.0
+ type: string
+
+permissions:
+ contents: read
+
+concurrency:
+ group: release-smoke-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ release_smoke:
+ name: Release configuration
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: true
+
+ - name: Check public dependencies
+ run: vp run check:public-dependencies
+
+ - name: Run release smoke
+ run: vp run release:smoke
+
+ desktop:
+ name: ${{ matrix.label }}
+ needs: release_smoke
+ runs-on: ${{ matrix.runner }}
+ timeout-minutes: 45
+ env:
+ RELEASE_VERSION: ${{ inputs.version }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - label: macOS arm64 DMG
+ runner: depot-macos-15
+ platform: mac
+ target: dmg
+ arch: arm64
+ extension: dmg
+ rust_target: aarch64-apple-darwin
+ - label: Windows x64 NSIS
+ runner: depot-windows-2025-8
+ platform: win
+ target: nsis
+ arch: x64
+ extension: exe
+ rust_target: x86_64-pc-windows-msvc
+ - label: Linux x64 AppImage
+ runner: depot-ubuntu-24.04-8
+ platform: linux
+ target: AppImage
+ arch: x64
+ extension: AppImage
+ rust_target: x86_64-unknown-linux-gnu
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: ${{ matrix.platform != 'win' }}
+ run-install: false
+
+ - name: Install desktop dependencies
+ run: vp install --frozen-lockfile --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: ${{ matrix.rust_target }}
+
+ - name: Install ImageMagick
+ if: matrix.platform == 'linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y imagemagick
+
+ - name: Import macOS signing certificate
+ if: matrix.platform == 'mac'
+ uses: apple-actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466 # v7.0.0
+ with:
+ p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_P12 }}
+ p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
+
+ - name: Configure App Store Connect API key
+ if: matrix.platform == 'mac'
+ shell: bash
+ env:
+ APPSTORE_API_KEY_P8: ${{ secrets.APPSTORE_API_KEY_P8 }}
+ APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
+ APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
+ MACOS_SIGNING_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }}
+ run: |
+ for variable in \
+ APPSTORE_API_KEY_P8 \
+ APPSTORE_API_KEY_ID \
+ APPSTORE_ISSUER_ID \
+ MACOS_SIGNING_IDENTITY; do
+ if test -z "${!variable}"; then
+ printf 'Required GitHub secret is empty: %s\n' "$variable" >&2
+ exit 1
+ fi
+ done
+ case "$MACOS_SIGNING_IDENTITY" in
+ "Developer ID Application:"*) ;;
+ *)
+ printf 'MACOS_SIGNING_IDENTITY must name a Developer ID Application certificate.\n' >&2
+ exit 1
+ ;;
+ esac
+ printf '%s' "$APPSTORE_API_KEY_P8" > "$RUNNER_TEMP/notarytool-api-key.p8"
+ chmod 600 "$RUNNER_TEMP/notarytool-api-key.p8"
+
+ - name: Build signed macOS artifact
+ if: matrix.platform == 'mac'
+ shell: bash
+ env:
+ APPLE_API_KEY: ${{ runner.temp }}/notarytool-api-key.p8
+ APPLE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
+ APPLE_API_ISSUER: ${{ secrets.APPSTORE_ISSUER_ID }}
+ CSC_NAME: ${{ secrets.MACOS_SIGNING_IDENTITY }}
+ run: |
+ node scripts/update-release-package-versions.ts "$RELEASE_VERSION"
+ vp run dist:desktop:artifact \
+ --platform mac \
+ --target dmg \
+ --arch arm64 \
+ --build-version "$RELEASE_VERSION" \
+ --signed \
+ --verbose
+
+ - name: Build unsigned desktop artifact
+ if: matrix.platform != 'mac'
+ shell: bash
+ run: |
+ node scripts/update-release-package-versions.ts "$RELEASE_VERSION"
+ vp run dist:desktop:artifact \
+ --platform "${{ matrix.platform }}" \
+ --target "${{ matrix.target }}" \
+ --arch "${{ matrix.arch }}" \
+ --build-version "$RELEASE_VERSION" \
+ --verbose
+
+ - name: Verify artifact
+ shell: bash
+ run: |
+ shopt -s nullglob
+ artifacts=(release/*.${{ matrix.extension }})
+ if (( ${#artifacts[@]} != 1 )); then
+ printf 'Expected one .${{ matrix.extension }} artifact, found %s.\n' "${#artifacts[@]}" >&2
+ exit 1
+ fi
+
+ - name: Notarize, staple, and verify macOS DMG
+ if: matrix.platform == 'mac'
+ shell: bash
+ env:
+ APPLE_API_KEY: ${{ runner.temp }}/notarytool-api-key.p8
+ APPLE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
+ APPLE_API_ISSUER: ${{ secrets.APPSTORE_ISSUER_ID }}
+ run: |
+ shopt -s nullglob
+ artifacts=(release/*.dmg)
+ if (( ${#artifacts[@]} != 1 )); then
+ printf 'Expected one DMG artifact, found %s.\n' "${#artifacts[@]}" >&2
+ exit 1
+ fi
+ dmg="${artifacts[0]}"
+
+ # electron-builder already submitted and stapled the signed app.
+ # This submission owns the DMG that contains that app.
+ xcrun notarytool submit "$dmg" \
+ --key "$APPLE_API_KEY" \
+ --key-id "$APPLE_API_KEY_ID" \
+ --issuer "$APPLE_API_ISSUER" \
+ --wait
+ xcrun stapler staple "$dmg"
+ xcrun stapler validate "$dmg"
+ spctl --assess --type open --context context:primary-signature --verbose=2 "$dmg"
+
+ mount_point="$RUNNER_TEMP/akeru-dmg"
+ mkdir -p "$mount_point"
+ hdiutil attach "$dmg" -nobrowse -readonly -mountpoint "$mount_point"
+ cleanup() {
+ hdiutil detach "$mount_point" >/dev/null 2>&1 || true
+ }
+ trap cleanup EXIT
+
+ apps=("$mount_point"/*.app)
+ if (( ${#apps[@]} != 1 )); then
+ printf 'Expected one app in the DMG, found %s.\n' "${#apps[@]}" >&2
+ exit 1
+ fi
+ codesign --verify --deep --strict --verbose=2 "${apps[0]}"
+ xcrun stapler validate "${apps[0]}"
+ spctl --assess --type execute --verbose=2 "${apps[0]}"
+
+ - name: Upload smoke artifact
+ uses: actions/upload-artifact@v7
+ with:
+ name: akeru-bot-${{ matrix.platform }}-${{ matrix.arch }}
+ path: release/*.${{ matrix.extension }}
+ if-no-files-found: error
+ retention-days: 7
+
+ cli:
+ name: CLI package
+ needs: release_smoke
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 20
+ env:
+ RELEASE_VERSION: ${{ inputs.version }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: |
+ args:
+ - --filter=t3...
+ - --filter=@t3tools/web...
+ - --filter=@t3tools/scripts...
+
+ - name: Build CLI package
+ run: |
+ node scripts/update-release-package-versions.ts "$RELEASE_VERSION"
+ vp run --filter t3 build
+
+ - name: Dry-run CLI package
+ run: node apps/server/scripts/cli.ts publish --dry-run --app-version "$RELEASE_VERSION" --verbose
+
+ marketing:
+ name: Marketing site
+ needs: release_smoke
+ runs-on: depot-ubuntu-24.04-8
+ timeout-minutes: 15
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+
+ - name: Setup Vite+
+ uses: voidzero-dev/setup-vp@v1
+ with:
+ node-version-file: package.json
+ cache: true
+ run-install: |
+ args:
+ - --filter=@t3tools/marketing...
+
+ - name: Typecheck marketing site
+ run: vp run --filter @t3tools/marketing typecheck
+
+ - name: Build marketing site
+ run: vp run --filter @t3tools/marketing build
diff --git a/.github/scripts/thread-transfer-report.cjs b/.github/scripts/thread-transfer-report.cjs
deleted file mode 100644
index 94a02b780..000000000
--- a/.github/scripts/thread-transfer-report.cjs
+++ /dev/null
@@ -1,429 +0,0 @@
-const fs = require("node:fs");
-const path = require("node:path");
-
-const ARTIFACT_NAME = "thread-transfer-results";
-const RESULT_FILE = "thread-transfer-result.json";
-const COMMENT_MARKER = "<!-- t3-thread-transfer-report -->";
-const PROVIDERS = ["codex", "claudeAgent"];
-const OBSERVED_KEYS = [
- "totalWireBytes",
- "threadSnapshotWireBytes",
- "threadSnapshotDecodedBytes",
- "measuredTurnWebSocketWireBytes",
- "measuredTurnWebSocketDecodedBytes",
- "measuredTurnWebSocketMessages",
-];
-const CEILING_KEYS = [
- "totalWireBytes",
- "threadSnapshotWireBytes",
- "measuredTurnWebSocketWireBytes",
- "measuredTurnWebSocketDecodedBytes",
- "measuredTurnWebSocketMessages",
-];
-const SCENARIO_KEYS = [
- "id",
- "historyTurns",
- "historyCommandToolsPerTurn",
- "historyMcpResultBytes",
- "measuredCommandTools",
- "measuredMcpResultBytes",
-];
-
-function resultShaMarker(sha) {
- return `<!-- t3-thread-transfer-result-sha:${sha} -->`;
-}
-
-function assertObject(value, label) {
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
- throw new Error(`${label} must be an object`);
- }
-}
-
-function assertExactKeys(value, expected, label) {
- assertObject(value, label);
- const actual = Object.keys(value).sort();
- const wanted = [...expected].sort();
- if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) {
- throw new Error(`${label} has unexpected fields`);
- }
-}
-
-function assertMetric(value, label) {
- if (!Number.isSafeInteger(value) || value < 0 || value > 1_000_000_000) {
- throw new Error(`${label} must be a non-negative safe integer below 1,000,000,000`);
- }
-}
-
-function validateResult(value) {
- assertExactKeys(value, ["schemaVersion", "scenario", "providers"], "result");
- if (value.schemaVersion !== 1) {
- throw new Error("result.schemaVersion must be 1");
- }
-
- assertExactKeys(value.scenario, SCENARIO_KEYS, "result.scenario");
- if (value.scenario.id !== "thread-transfer-v1") {
- throw new Error("result.scenario.id is not supported");
- }
- for (const key of SCENARIO_KEYS.slice(1)) {
- assertMetric(value.scenario[key], `result.scenario.${key}`);
- }
-
- assertExactKeys(value.providers, PROVIDERS, "result.providers");
- for (const provider of PROVIDERS) {
- const entry = value.providers[provider];
- assertExactKeys(entry, ["observed", "ceiling"], `result.providers.${provider}`);
- assertExactKeys(entry.observed, OBSERVED_KEYS, `result.providers.${provider}.observed`);
- assertExactKeys(entry.ceiling, CEILING_KEYS, `result.providers.${provider}.ceiling`);
- for (const key of OBSERVED_KEYS) {
- assertMetric(entry.observed[key], `result.providers.${provider}.observed.${key}`);
- }
- for (const key of CEILING_KEYS) {
- assertMetric(entry.ceiling[key], `result.providers.${provider}.ceiling.${key}`);
- }
- }
-
- return value;
-}
-
-function readResult(directory) {
- if (!directory) return undefined;
- const file = path.join(directory, RESULT_FILE);
- if (!fs.existsSync(file)) return undefined;
- const stat = fs.lstatSync(file);
- if (!stat.isFile() || stat.size > 64 * 1_024) {
- throw new Error("thread transfer result must be a regular file smaller than 64 KiB");
- }
- return validateResult(JSON.parse(fs.readFileSync(file, "utf8")));
-}
-
-function formatBytes(bytes) {
- if (bytes < 1_024) return `${bytes} B`;
- if (bytes >= 1_024 * 1_024) return `${(bytes / 1_024 / 1_024).toFixed(2)} MiB`;
- return `${(bytes / 1_024).toFixed(1)} KiB`;
-}
-
-function formatValue(value, kind) {
- return kind === "messages" ? value.toLocaleString("en-US") : formatBytes(value);
-}
-
-function formatImpact(current, baseline, kind) {
- if (baseline === undefined) return "—";
- const delta = current - baseline;
- const prefix = delta > 0 ? "+" : delta < 0 ? "−" : "";
- const magnitude = formatValue(Math.abs(delta), kind);
- const percent =
- baseline === 0 ? "" : ` (${prefix}${Math.abs((delta / baseline) * 100).toFixed(1)}%)`;
- return `${prefix}${magnitude}${percent}`;
-}
-
-function sameScenario(left, right) {
- return SCENARIO_KEYS.every((key) => left[key] === right[key]);
-}
-
-const METRICS = [
- { key: "totalWireBytes", label: "Total thread wire", kind: "bytes" },
- { key: "threadSnapshotWireBytes", label: "Thread snapshot wire", kind: "bytes" },
- {
- key: "measuredTurnWebSocketWireBytes",
- label: "Live turn WebSocket wire",
- kind: "bytes",
- },
- {
- key: "measuredTurnWebSocketDecodedBytes",
- label: "Live turn WebSocket decoded",
- kind: "bytes",
- },
- { key: "measuredTurnWebSocketMessages", label: "Live turn messages", kind: "messages" },
-];
-
-function renderComment(input) {
- const current = input.current;
- const baseline = input.baseline;
- const comparable = baseline !== undefined && sameScenario(current.scenario, baseline.scenario);
- const rows = [];
- const ceilingChanges = [];
- let failed = false;
-
- for (const provider of PROVIDERS) {
- for (const metric of METRICS) {
- const observed = current.providers[provider].observed[metric.key];
- const ceiling = current.providers[provider].ceiling[metric.key];
- const baselineObserved = comparable
- ? baseline.providers[provider].observed[metric.key]
- : undefined;
- const pass = observed <= ceiling;
- failed ||= !pass;
- rows.push(
- `| ${provider === "codex" ? "Codex" : "Claude"} | ${metric.label} | ${baselineObserved === undefined ? "—" : formatValue(baselineObserved, metric.kind)} | ${formatValue(observed, metric.kind)} | ${formatImpact(observed, baselineObserved, metric.kind)} | ${formatValue(ceiling, metric.kind)} | ${pass ? "✅" : "❌"} |`,
- );
-
- if (baseline && baseline.providers[provider].ceiling[metric.key] !== ceiling) {
- ceilingChanges.push(
- `- ${provider === "codex" ? "Codex" : "Claude"} ${metric.label}: ${formatValue(baseline.providers[provider].ceiling[metric.key], metric.kind)} → ${formatValue(ceiling, metric.kind)}`,
- );
- }
- }
- }
-
- const baselineLink = input.baselineRun
- ? `[\`${input.baselineRun.sha.slice(0, 7)}\`](${input.baselineRun.url})`
- : "unavailable";
- const currentLink = `[\`${input.currentRun.sha.slice(0, 7)}\`](${input.currentRun.url})`;
- const notices = [];
- if (!baseline) {
- notices.push(
- "> ℹ️ No successful `main` baseline artifact is available yet. This run establishes the initial measurement.",
- );
- } else if (!comparable) {
- notices.push(
- "> ⚠️ The thread fixture changed, so impact percentages are not directly comparable to the `main` baseline.",
- );
- } else if (!input.baselineRun.matchesBase) {
- notices.push(
- "> ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful `main` measurement shown below.",
- );
- }
- if (ceilingChanges.length > 0) {
- notices.push(
- `> ⚠️ **This PR changes transfer ceilings:**\n>\n${ceilingChanges.map((line) => `> ${line}`).join("\n")}`,
- );
- }
-
- return [
- COMMENT_MARKER,
- resultShaMarker(input.currentRun.sha),
- "## Thread transfer impact",
- "",
- failed
- ? "❌ One or more thread transfer ceilings were exceeded."
- : "✅ Thread transfer remains within every enforced ceiling.",
- ...(notices.length > 0 ? ["", ...notices] : []),
- "",
- "| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |",
- "| --- | --- | ---: | ---: | ---: | ---: | --- |",
- ...rows,
- "",
- `Baseline: ${baselineLink} · PR result: ${currentLink} · Source CI: ${input.currentRun.conclusion}`,
- "",
- "<details>",
- "<summary>Scenario and decoded snapshot size</summary>",
- "",
- `${current.scenario.historyTurns} historical turns, ${current.scenario.historyCommandToolsPerTurn} command tools per turn, ${formatBytes(current.scenario.historyMcpResultBytes)} retained MCP result per historical turn, and a ${formatBytes(current.scenario.measuredMcpResultBytes)} retained result in the measured turn.`,
- "",
- ...PROVIDERS.map(
- (provider) =>
- `- ${provider === "codex" ? "Codex" : "Claude"} decoded thread snapshot: ${formatBytes(current.providers[provider].observed.threadSnapshotDecodedBytes)}`,
- ),
- "",
- "</details>",
- "",
- "_Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed._",
- ].join("\n");
-}
-
-async function artifactsForRun(github, owner, repo, runId) {
- return github.paginate(github.rest.actions.listWorkflowRunArtifacts, {
- owner,
- repo,
- run_id: runId,
- per_page: 100,
- });
-}
-
-function findResultArtifact(artifacts) {
- return artifacts.find((artifact) => artifact.name === ARTIFACT_NAME && !artifact.expired);
-}
-
-async function resolve({ github, context, core }) {
- const source = context.payload.workflow_run;
- const { owner, repo } = context.repo;
- if (source.event !== "pull_request") {
- core.setOutput("publish", "false");
- return;
- }
-
- let pullNumber = source.pull_requests?.[0]?.number;
- if (!pullNumber) {
- const associated = await github.paginate(
- github.rest.repos.listPullRequestsAssociatedWithCommit,
- { owner, repo, commit_sha: source.head_sha, per_page: 100 },
- );
- const matchingPulls = associated.filter(
- (pull) =>
- pull.state === "open" &&
- pull.head.sha === source.head_sha &&
- pull.head.ref === source.head_branch,
- );
- if (matchingPulls.length !== 1) {
- core.info(
- `Expected one open pull request for ${source.head_repository?.full_name ?? "unknown repository"}:${source.head_branch ?? "unknown branch"} at ${source.head_sha}; found ${matchingPulls.length}.`,
- );
- core.setOutput("publish", "false");
- return;
- }
- pullNumber = matchingPulls[0].number;
- }
- if (!pullNumber) {
- core.info("No open pull request is associated with the completed CI run.");
- core.setOutput("publish", "false");
- return;
- }
-
- const { data: pull } = await github.rest.pulls.get({ owner, repo, pull_number: pullNumber });
- if (pull.head.sha !== source.head_sha) {
- core.info(`Skipping stale CI result ${source.head_sha}; PR head is ${pull.head.sha}.`);
- core.setOutput("publish", "false");
- return;
- }
-
- const sourceArtifacts = await artifactsForRun(github, owner, repo, source.id);
- const sourceArtifact = findResultArtifact(sourceArtifacts);
- const workflowRuns = await github.paginate(github.rest.actions.listWorkflowRuns, {
- owner,
- repo,
- workflow_id: source.workflow_id,
- branch: pull.base.ref,
- event: "push",
- status: "success",
- per_page: 100,
- });
- const orderedRuns = [
- ...workflowRuns.filter((run) => run.head_sha === pull.base.sha),
- ...workflowRuns.filter((run) => run.head_sha !== pull.base.sha),
- ].slice(0, 20);
-
- let baselineRun;
- for (const run of orderedRuns) {
- const artifacts = await artifactsForRun(github, owner, repo, run.id);
- if (findResultArtifact(artifacts)) {
- baselineRun = run;
- break;
- }
- }
-
- core.setOutput("publish", "true");
- core.setOutput("pull_number", String(pullNumber));
- core.setOutput("pr_artifact", sourceArtifact ? "true" : "false");
- core.setOutput("pr_run_id", String(source.id));
- core.setOutput("pr_sha", source.head_sha);
- core.setOutput("pr_conclusion", source.conclusion ?? "unknown");
- core.setOutput("baseline_artifact", baselineRun ? "true" : "false");
- core.setOutput("baseline_run_id", baselineRun ? String(baselineRun.id) : "");
- core.setOutput("baseline_sha", baselineRun?.head_sha ?? "");
- core.setOutput(
- "baseline_matches_base",
- baselineRun?.head_sha === pull.base.sha ? "true" : "false",
- );
-}
-
-async function upsertComment(github, context, pullNumber, body, options = {}) {
- const { owner, repo } = context.repo;
- const comments = await github.paginate(github.rest.issues.listComments, {
- owner,
- repo,
- issue_number: pullNumber,
- per_page: 100,
- });
- const existing = comments.find(
- (comment) =>
- comment.user?.login === "github-actions[bot]" && comment.body?.includes(COMMENT_MARKER),
- );
- if (
- options.preserveResultSha &&
- existing?.body?.includes(resultShaMarker(options.preserveResultSha))
- ) {
- return;
- }
- if (existing) {
- await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
- } else {
- await github.rest.issues.createComment({ owner, repo, issue_number: pullNumber, body });
- }
-}
-
-async function upsertCommentForCurrentHead(
- github,
- context,
- core,
- pullNumber,
- expectedSha,
- body,
- options,
-) {
- const { owner, repo } = context.repo;
- const { data: pull } = await github.rest.pulls.get({
- owner,
- repo,
- pull_number: pullNumber,
- });
- if (pull.head.sha !== expectedSha) {
- core.info(`Skipping stale CI result ${expectedSha}; PR head is ${pull.head.sha}.`);
- return false;
- }
-
- await upsertComment(github, context, pullNumber, body, options);
- return true;
-}
-
-async function publish({ github, context, core }) {
- const pullNumber = Number(process.env.PR_NUMBER);
- if (!Number.isSafeInteger(pullNumber) || pullNumber <= 0) {
- throw new Error("PR_NUMBER is invalid");
- }
-
- const current = readResult(process.env.PR_RESULT_DIR);
- const currentRun = {
- sha: process.env.PR_SHA,
- conclusion: process.env.PR_CONCLUSION,
- url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.PR_RUN_ID}`,
- };
- if (!current) {
- await upsertCommentForCurrentHead(
- github,
- context,
- core,
- pullNumber,
- currentRun.sha,
- [
- COMMENT_MARKER,
- "## Thread transfer impact",
- "",
- `⚠️ The latest [CI run](${currentRun.url}) did not produce a thread transfer result for \`${currentRun.sha.slice(0, 7)}\`.`,
- "",
- "_This comment will update automatically after the next completed run._",
- ].join("\n"),
- { preserveResultSha: currentRun.sha },
- );
- return;
- }
-
- const baseline = readResult(process.env.BASELINE_RESULT_DIR);
- const baselineRun = baseline
- ? {
- sha: process.env.BASELINE_SHA,
- matchesBase: process.env.BASELINE_MATCHES_BASE === "true",
- url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.BASELINE_RUN_ID}`,
- }
- : undefined;
- const body = renderComment({ current, baseline, currentRun, baselineRun });
- const published = await upsertCommentForCurrentHead(
- github,
- context,
- core,
- pullNumber,
- currentRun.sha,
- body,
- );
- if (published) {
- core.info(`Updated thread transfer report on PR #${pullNumber}.`);
- }
-}
-
-module.exports = {
- publish,
- readResult,
- renderComment,
- resolve,
- upsertCommentForCurrentHead,
- validateResult,
-};
diff --git a/.github/scripts/thread-transfer-report.test.cjs b/.github/scripts/thread-transfer-report.test.cjs
deleted file mode 100644
index 4935864e4..000000000
--- a/.github/scripts/thread-transfer-report.test.cjs
+++ /dev/null
@@ -1,292 +0,0 @@
-const assert = require("node:assert/strict");
-const test = require("node:test");
-
-const {
- renderComment,
- resolve,
- upsertCommentForCurrentHead,
- validateResult,
-} = require("./thread-transfer-report.cjs");
-
-function result(overrides = {}) {
- const observed = {
- totalWireBytes: 2_200_000,
- threadSnapshotWireBytes: 1_950_000,
- threadSnapshotDecodedBytes: 9_100_000,
- measuredTurnWebSocketWireBytes: 250_000,
- measuredTurnWebSocketDecodedBytes: 1_150_000,
- measuredTurnWebSocketMessages: 15,
- };
- const ceiling = {
- totalWireBytes: 2_900_000,
- threadSnapshotWireBytes: 2_600_000,
- measuredTurnWebSocketWireBytes: 320_000,
- measuredTurnWebSocketDecodedBytes: 1_550_000,
- measuredTurnWebSocketMessages: 20,
- };
- return {
- schemaVersion: 1,
- scenario: {
- id: "thread-transfer-v1",
- historyTurns: 10,
- historyCommandToolsPerTurn: 5,
- historyMcpResultBytes: 900_000,
- measuredCommandTools: 20,
- measuredMcpResultBytes: 1_100_000,
- },
- providers: {
- codex: { observed: { ...observed, ...overrides }, ceiling },
- claudeAgent: { observed, ceiling },
- },
- };
-}
-
-test("validates the fixed artifact schema", () => {
- assert.equal(validateResult(result()).schemaVersion, 1);
- assert.throws(
- () => validateResult({ ...result(), injectedMarkdown: "@everyone" }),
- /unexpected fields/,
- );
- assert.throws(
- () => validateResult(result({ totalWireBytes: "lots" })),
- /non-negative safe integer/,
- );
-});
-
-test("renders baseline, impact, ceiling, and ceiling changes", () => {
- const baseline = result();
- const current = result({ measuredTurnWebSocketWireBytes: 260_000 });
- current.providers.codex.ceiling = {
- ...current.providers.codex.ceiling,
- measuredTurnWebSocketWireBytes: 330_000,
- };
- const comment = renderComment({
- current,
- baseline,
- currentRun: {
- sha: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
- conclusion: "success",
- url: "https://github.com/pingdotgg/t3code/actions/runs/2",
- },
- baselineRun: {
- sha: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- matchesBase: true,
- url: "https://github.com/pingdotgg/t3code/actions/runs/1",
- },
- });
-
- assert.match(comment, /Main baseline \| This PR \| Impact \| PR ceiling/);
- assert.match(comment, /\+9\.8 KiB \(\+4\.0%\)/);
- assert.match(comment, /This PR changes transfer ceilings/);
- assert.match(comment, /312\.5 KiB → 322\.3 KiB/);
- assert.match(comment, /<!-- t3-thread-transfer-report -->/);
- assert.match(
- comment,
- /<!-- t3-thread-transfer-result-sha:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -->/,
- );
-});
-
-test("resolves a fallback PR with a redacted head repo and exact main baseline", async () => {
- const outputs = {};
- const listWorkflowRunArtifacts = () => {};
- const listWorkflowRuns = () => {};
- const listPullRequestsAssociatedWithCommit = () => {};
- const github = {
- paginate: async (method, input) => {
- if (method === listPullRequestsAssociatedWithCommit) {
- return [
- {
- number: 5350,
- state: "open",
- head: { sha: "head-sha", ref: "feature-branch", repo: null },
- },
- ];
- }
- if (method === listWorkflowRunArtifacts) {
- return [
- {
- name: "thread-transfer-results",
- expired: false,
- runId: input.run_id,
- },
- ];
- }
- if (method === listWorkflowRuns) {
- return [{ id: 1, head_sha: "base-sha" }];
- }
- throw new Error("unexpected pagination call");
- },
- rest: {
- actions: { listWorkflowRunArtifacts, listWorkflowRuns },
- pulls: {
- get: async () => ({
- data: {
- head: { sha: "head-sha" },
- base: { sha: "base-sha", ref: "main" },
- },
- }),
- },
- repos: { listPullRequestsAssociatedWithCommit },
- },
- };
- await resolve({
- github,
- context: {
- repo: { owner: "pingdotgg", repo: "t3code" },
- payload: {
- workflow_run: {
- id: 2,
- event: "pull_request",
- workflow_id: 3,
- head_sha: "head-sha",
- head_branch: "feature-branch",
- head_repository: { full_name: "pingdotgg/t3code" },
- conclusion: "success",
- pull_requests: [],
- },
- },
- },
- core: {
- info: () => {},
- setOutput: (key, value) => {
- outputs[key] = value;
- },
- },
- });
-
- assert.equal(outputs.publish, "true");
- assert.equal(outputs.pull_number, "5350");
- assert.equal(outputs.pr_artifact, "true");
- assert.equal(outputs.baseline_run_id, "1");
- assert.equal(outputs.baseline_matches_base, "true");
-});
-
-test("does not guess when a fallback commit belongs to multiple PRs", async () => {
- const outputs = {};
- const listPullRequestsAssociatedWithCommit = () => {};
- let fetchedPull = false;
- await resolve({
- github: {
- paginate: async (method) => {
- assert.equal(method, listPullRequestsAssociatedWithCommit);
- return [5350, 5351].map((number) => ({
- number,
- state: "open",
- head: {
- sha: "head-sha",
- ref: "feature-branch",
- repo: { full_name: "pingdotgg/t3code" },
- },
- }));
- },
- rest: {
- actions: {},
- pulls: {
- get: async () => {
- fetchedPull = true;
- },
- },
- repos: { listPullRequestsAssociatedWithCommit },
- },
- },
- context: {
- repo: { owner: "pingdotgg", repo: "t3code" },
- payload: {
- workflow_run: {
- id: 2,
- event: "pull_request",
- workflow_id: 3,
- head_sha: "head-sha",
- head_branch: "feature-branch",
- head_repository: { full_name: "pingdotgg/t3code" },
- conclusion: "success",
- pull_requests: [],
- },
- },
- },
- core: {
- info: () => {},
- setOutput: (key, value) => {
- outputs[key] = value;
- },
- },
- });
-
- assert.equal(outputs.publish, "false");
- assert.equal(fetchedPull, false);
-});
-
-test("does not publish a stale result after the PR head advances", async () => {
- let listedComments = false;
- const info = [];
- const published = await upsertCommentForCurrentHead(
- {
- paginate: async () => {
- listedComments = true;
- return [];
- },
- rest: {
- issues: {
- listComments: () => {},
- createComment: () => {
- throw new Error("must not create a stale comment");
- },
- updateComment: () => {
- throw new Error("must not update a stale comment");
- },
- },
- pulls: {
- get: async () => ({ data: { head: { sha: "new-head-sha" } } }),
- },
- },
- },
- { repo: { owner: "pingdotgg", repo: "t3code" } },
- { info: (message) => info.push(message) },
- 5350,
- "old-head-sha",
- "stale body",
- );
-
- assert.equal(published, false);
- assert.equal(listedComments, false);
- assert.deepEqual(info, ["Skipping stale CI result old-head-sha; PR head is new-head-sha."]);
-});
-
-test("preserves a successful result when a same-SHA rerun has no artifact", async () => {
- let updatedComment = false;
- const sha = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
- const published = await upsertCommentForCurrentHead(
- {
- paginate: async () => [
- {
- id: 1,
- user: { login: "github-actions[bot]" },
- body: `<!-- t3-thread-transfer-report -->\n<!-- t3-thread-transfer-result-sha:${sha} -->`,
- },
- ],
- rest: {
- issues: {
- listComments: () => {},
- createComment: () => {
- updatedComment = true;
- },
- updateComment: () => {
- updatedComment = true;
- },
- },
- pulls: {
- get: async () => ({ data: { head: { sha } } }),
- },
- },
- },
- { repo: { owner: "pingdotgg", repo: "t3code" } },
- { info: () => {} },
- 5350,
- sha,
- "missing artifact warning",
- { preserveResultSha: sha },
- );
-
- assert.equal(published, true);
- assert.equal(updatedComment, false);
-});
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 731707eed..000000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,319 +0,0 @@
-name: CI
-
-on:
- pull_request:
- push:
- branches:
- - main
-
-concurrency:
- group: ci-${{ github.event.pull_request.number || github.sha }}
- cancel-in-progress: ${{ github.event_name == 'pull_request' }}
-
-jobs:
- check:
- name: Check
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Reject repository-owned PR assets
- run: |
- files="$(git ls-files .github/pr-assets)"
- if test -n "$files"; then
- printf 'PR evidence must be uploaded to GitHub, not committed:\n%s\n' "$files" >&2
- exit 1
- fi
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: true
-
- - name: Ensure Electron runtime is installed
- run: vp run --filter @t3tools/desktop ensure:electron
-
- - name: Check
- run: vp check
-
- - name: Typecheck
- run: vpr typecheck
-
- - name: Build desktop pipeline
- run: vp run build:desktop
-
- - name: Verify preload bundle output
- run: |
- test -f apps/desktop/dist-electron/preload.cjs
- grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
- grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
-
- # Everything except `t3` (apps/server). `--parallel` drops the package
- # dependency ordering that `vp run` applies by default: these `test` tasks
- # declare no `dependsOn` and resolve workspace deps from source, so ordering
- # only bought us idle runners between dependency layers. The concurrency
- # limit stays at the default 4 so peak load per runner is unchanged.
- test:
- name: Test
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: true
-
- - name: Ensure Electron runtime is installed
- run: vp run --filter @t3tools/desktop ensure:electron
-
- - name: Test
- run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
-
- # apps/server sets `fileParallelism: false`, so its 239 files run strictly
- # one at a time. Sharding spreads them over separate runners instead of
- # separate workers, so no two server test files ever share a machine and the
- # isolation that flag buys is preserved exactly.
- test_server:
- name: Test Server ${{ matrix.shard }}
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- strategy:
- fail-fast: false
- matrix:
- shard: [1, 2, 3]
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: true
-
- # No Electron setup here: `t3` (apps/server) has no Electron dependency
- # and none of its tests touch the runtime. Only the non-server `test`
- # job, which covers @t3tools/desktop, needs the download.
- - name: Test
- env:
- T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
- T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
- run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
-
- # src/server.test.ts writes the budget report, so exactly one shard
- # produces these files. Gating the upload on their presence keeps a
- # single `thread-transfer-results` artifact per run, which is the name
- # thread-transfer-report.yml resolves.
- - name: Detect transfer budget report
- id: transfer_budget
- if: always()
- run: |
- if test -f "${{ runner.temp }}/thread-transfer-result.json"; then
- echo "present=true" >> "$GITHUB_OUTPUT"
- else
- echo "present=false" >> "$GITHUB_OUTPUT"
- fi
-
- - name: Publish transfer budget report
- if: always() && steps.transfer_budget.outputs.present == 'true'
- run: |
- if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
- tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
- else
- echo "Transfer budget report was not produced." >> "$GITHUB_STEP_SUMMARY"
- fi
-
- - name: Upload thread transfer result
- if: always() && steps.transfer_budget.outputs.present == 'true'
- uses: actions/upload-artifact@v7
- with:
- name: thread-transfer-results
- path: ${{ runner.temp }}/thread-transfer-result.json
- if-no-files-found: ignore
- retention-days: 30
-
- # Split out of Check and Test: both paid ~7-9s to install a Rust toolchain
- # for checks that take under 3s, on the critical path of every PR.
- rust:
- name: Rust
- runs-on: blacksmith-4vcpu-ubuntu-2404
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Rust
- uses: dtolnay/rust-toolchain@stable
- with:
- components: rustfmt
-
- - name: Check resource monitor formatting
- run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
-
- - name: Test resource monitor
- run: cargo test --locked --manifest-path native/resource-monitor/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: blacksmith-2vcpu-ubuntu-2404
- 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: blacksmith-6vcpu-macos-26
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
-
- - name: Install mobile native static analysis tools
- run: brew bundle install --file apps/mobile/Brewfile
-
- - name: Lint mobile native sources
- run: vp run lint:mobile
-
- release_smoke:
- name: Release Smoke
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
-
- - name: Exercise release-only workflow steps
- run: node scripts/release-smoke.ts
diff --git a/.github/workflows/deploy-relay.yml b/.github/workflows/deploy-relay.yml
deleted file mode 100644
index f652844a5..000000000
--- a/.github/workflows/deploy-relay.yml
+++ /dev/null
@@ -1,87 +0,0 @@
-name: Deploy T3 Connect relay
-
-on:
- push:
- branches:
- - main
-
-permissions:
- contents: read
- id-token: none
- statuses: write
-
-concurrency:
- group: relay-production
- cancel-in-progress: false
-
-jobs:
- deploy_relay:
- name: Deploy production relay
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 15
- environment:
- name: production
- env:
- CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
- PLANETSCALE_ORGANIZATION: ${{ vars.PLANETSCALE_ORGANIZATION }}
- AXIOM_ORG_ID: ${{ vars.AXIOM_ORG_ID }}
- RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
- RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
- RELAY_TUNNEL_ZONE_NAME: ${{ vars.RELAY_TUNNEL_ZONE_NAME }}
- CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
- CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
- APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}
- APNS_TEAM_ID: ${{ vars.APNS_TEAM_ID }}
- APNS_KEY_ID: ${{ vars.APNS_KEY_ID }}
- APNS_BUNDLE_ID: ${{ vars.APNS_BUNDLE_ID }}
- ALCHEMY_TELEMETRY_DISABLED: "1"
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=t3code-relay...
-
- - name: Deploy production relay stage
- id: deploy
- run: vp run --filter t3code-relay deploy --stage prod --yes --github-output
- env:
- CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
- PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
- AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
- CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
- APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
-
- - name: Publish relay deploy commit status
- uses: actions/github-script@v8
- with:
- script: |
- const result = "${{ steps.deploy.outputs.result }}";
- const changed = "${{ steps.deploy.outputs.changed }}" === "true";
- const description = changed
- ? "Relay production deploy applied infrastructure changes."
- : result === "noop"
- ? "Relay production deploy was a no-op."
- : `Relay production deploy completed with result: ${result}.`;
-
- await github.rest.repos.createCommitStatus({
- owner: context.repo.owner,
- repo: context.repo.repo,
- sha: context.sha,
- state: "success",
- context: "Relay deploy / production",
- description,
- target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
- });
diff --git a/.github/workflows/desktop-macos-preview.yml b/.github/workflows/desktop-macos-preview.yml
deleted file mode 100644
index 7875aec6f..000000000
--- a/.github/workflows/desktop-macos-preview.yml
+++ /dev/null
@@ -1,361 +0,0 @@
-name: Desktop macOS Preview
-
-on:
- pull_request:
- types: [labeled, unlabeled, synchronize, reopened, closed]
-
-permissions:
- contents: read
-
-# Build events and cleanup events use separate groups: a push must cancel a
-# stale in-flight build, but must never cancel a cleanup run mid-delete. The
-# publish job re-checks PR state before uploading to cover the reverse race.
-concurrency:
- group: desktop-macos-preview-${{ github.event.pull_request.number }}-${{ contains(fromJSON('["closed", "unlabeled"]'), github.event.action) && 'cleanup' || 'build' }}
- # Cleanup runs must complete (a close event right after an unlabel queues
- # behind the running cleanup instead of canceling it mid-delete), and events
- # that skip the build job, such as adding an unrelated label, must not
- # cancel an in-flight build either.
- cancel-in-progress: ${{ !contains(fromJSON('["closed", "unlabeled"]'), github.event.action) && (github.event.action != 'labeled' || github.event.label.name == 'preview:mac') }}
-
-jobs:
- # Builds run PR code, so this job keeps a read-only token. Publishing to the
- # release happens in the publish job below, which never checks out PR code.
- build:
- name: Build macOS Apple Silicon preview
- if: >-
- github.event.action != 'closed' &&
- github.event.action != 'unlabeled' &&
- github.event.pull_request.head.repo.full_name == github.repository &&
- contains(github.event.pull_request.labels.*.name, 'preview:mac') &&
- (github.event.action != 'labeled' || github.event.label.name == 'preview:mac')
- runs-on: blacksmith-12vcpu-macos-26
- timeout-minutes: 30
- outputs:
- dmg_name: ${{ steps.build.outputs.dmg_name }}
- version: ${{ steps.version.outputs.version }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: false
-
- - name: Install desktop dependencies
- run: vp install --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
-
- - name: Cache resource monitor
- id: resource_monitor_cache
- uses: actions/cache@v6
- with:
- path: native/resource-monitor/target/aarch64-apple-darwin/release/t3-resource-monitor
- key: resource-monitor-aarch64-apple-darwin-${{ hashFiles('native/resource-monitor/Cargo.lock', 'native/resource-monitor/Cargo.toml', 'native/resource-monitor/src/**') }}
-
- - name: Setup Rust
- if: steps.resource_monitor_cache.outputs.cache-hit != 'true'
- uses: dtolnay/rust-toolchain@stable
- with:
- targets: aarch64-apple-darwin
-
- - id: version
- name: Set preview version and public configuration
- shell: bash
- env:
- PR_NUMBER: ${{ github.event.pull_request.number }}
- run: |
- set -euo pipefail
-
- base_version="$(node -p "require('./apps/desktop/package.json').version")"
- preview_version="${base_version}-pr.${PR_NUMBER}.${GITHUB_RUN_NUMBER}"
- node scripts/update-release-package-versions.ts "$preview_version"
- cp .env.example .env
-
- echo "version=$preview_version" >> "$GITHUB_OUTPUT"
-
- - id: build
- name: Build unsigned macOS DMG
- shell: bash
- env:
- T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: ${{ steps.resource_monitor_cache.outputs.cache-hit == 'true' }}
- PREVIEW_VERSION: ${{ steps.version.outputs.version }}
- run: |
- set -euo pipefail
-
- vp run dist:desktop:artifact \
- --platform mac \
- --target dmg \
- --arch arm64 \
- --build-version "$PREVIEW_VERSION" \
- --verbose
-
- shopt -s nullglob
- dmg_files=(release/*.dmg)
- if (( ${#dmg_files[@]} != 1 )); then
- printf 'Expected one DMG, found %s.\n' "${#dmg_files[@]}" >&2
- exit 1
- fi
- printf 'dmg_name=%s\n' "$(basename "${dmg_files[0]}")" >> "$GITHUB_OUTPUT"
-
- # archive: false uploads the file as its own artifact named after the
- # file, so the publish job downloads by *.dmg pattern, not by name.
- - name: Upload macOS DMG
- uses: actions/upload-artifact@v7
- with:
- path: release/*.dmg
- if-no-files-found: error
- archive: false
- overwrite: true
- retention-days: 7
-
- # Release assets download without a GitHub account, unlike workflow
- # artifacts. All preview DMGs live on one rolling prerelease tagged
- # "desktop-preview" (release.yml only matches v*.*.* tags), so publishing a
- # build never notifies release watchers. This job holds the write token and
- # only handles the artifact the build job produced; it never runs PR code.
- publish:
- name: Publish anonymous download
- needs: build
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- permissions:
- contents: write
- pull-requests: write
- steps:
- - name: Download macOS DMG
- uses: actions/download-artifact@v8
- with:
- pattern: "*.dmg"
- merge-multiple: true
- path: release
-
- - id: upload
- name: Upload DMG to the rolling preview release
- shell: bash
- env:
- GH_TOKEN: ${{ github.token }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
- run: |
- set -euo pipefail
-
- tag="desktop-preview"
-
- # True while the PR is open and still carries the preview label.
- preview_eligible() {
- [[ "$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" \
- --json state,labels \
- --jq '.state + " " + (.labels | map(.name) | contains(["preview:mac"]) | tostring)')" == "OPEN true" ]]
- }
-
- # The build ran for many minutes. If the PR closed or lost the label
- # meanwhile, cleanup already ran in its own concurrency group, so
- # publishing now would resurrect a deleted download.
- if ! preview_eligible; then
- echo "PR closed or preview label removed while building. Skipping publish."
- exit 0
- fi
-
- dmg_path="$(find release -type f -name '*.dmg' -print -quit)"
- if [[ -z "$dmg_path" ]]; then
- echo "No DMG found in the downloaded artifact." >&2
- exit 1
- fi
-
- # The filename comes out of the build, which runs PR code. Requiring
- # this PR's marker keeps a build from clobbering or deleting another
- # PR's asset, since those names carry a different -pr.N. marker.
- if [[ "$(basename "$dmg_path")" != *"-pr.${PR_NUMBER}."* ]]; then
- echo "DMG name '$(basename "$dmg_path")' does not carry this PR's -pr.${PR_NUMBER}. marker. Refusing to publish." >&2
- exit 1
- fi
-
- if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
- # "|| true" tolerates a concurrent publish job creating the
- # release between the check and the create.
- gh release create "$tag" \
- --repo "$GITHUB_REPOSITORY" \
- --target "$DEFAULT_BRANCH" \
- --prerelease \
- --title "Desktop preview builds" \
- --notes "Rolling unsigned desktop builds from pull requests with a preview label. Each download is removed when its pull request closes or loses the label. Install stable builds from the latest release instead." \
- || true
- fi
-
- # Keep one DMG per PR: drop this PR's older builds first. The
- # trailing dot keeps -pr.12. from matching -pr.123. builds.
- gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' \
- | { grep -F -- "-pr.${PR_NUMBER}." || true; } \
- | while read -r asset; do
- gh release delete-asset "$tag" "$asset" --repo "$GITHUB_REPOSITORY" --yes \
- || echo "Asset $asset was already removed by a concurrent run."
- done
-
- gh release upload "$tag" "$dmg_path" --repo "$GITHUB_REPOSITORY" --clobber
-
- # Re-check after uploading. A cleanup run that started during the
- # upload listed assets before ours existed, so it cannot delete it.
- # Whichever writer acts last sees the final PR state; if the preview
- # became ineligible, delete what we just uploaded.
- if ! preview_eligible; then
- gh release delete-asset "$tag" "$(basename "$dmg_path")" --repo "$GITHUB_REPOSITORY" --yes \
- || echo "Asset was already removed by a concurrent run."
- echo "PR closed or preview label removed during upload. Removed the download."
- exit 0
- fi
-
- echo "download_url=https://github.com/${GITHUB_REPOSITORY}/releases/download/${tag}/$(basename "$dmg_path")" >> "$GITHUB_OUTPUT"
-
- - name: Comment download link
- if: steps.upload.outputs.download_url != ''
- uses: actions/github-script@v8
- env:
- DOWNLOAD_URL: ${{ steps.upload.outputs.download_url }}
- DMG_NAME: ${{ needs.build.outputs.dmg_name }}
- HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- PREVIEW_VERSION: ${{ needs.build.outputs.version }}
- with:
- script: |
- const { data: pullRequest } = await github.rest.pulls.get({
- owner: context.repo.owner,
- repo: context.repo.repo,
- pull_number: context.payload.pull_request.number,
- });
- if (
- pullRequest.head.sha !== process.env.HEAD_SHA ||
- pullRequest.state !== "open" ||
- !pullRequest.labels.some((label) => label.name === "preview:mac")
- ) {
- core.info("Skipping the outdated macOS preview comment.");
- return;
- }
-
- const marker = "<!-- desktop-macos-preview -->";
- const body = [
- marker,
- "### macOS preview",
- "",
- `[Download Apple Silicon DMG](${process.env.DOWNLOAD_URL})`,
- "",
- `Version: ${process.env.PREVIEW_VERSION}`,
- `Commit: ${process.env.HEAD_SHA.slice(0, 7)}`,
- "",
- "Unsigned build. Clear quarantine before opening:",
- "```sh",
- `xattr -d com.apple.quarantine ~/Downloads/${process.env.DMG_NAME}`,
- "```",
- "",
- "No GitHub sign-in is needed. The download stays available until this PR closes or the preview label is removed.",
- ].join("\n");
-
- const comments = await github.paginate(github.rest.issues.listComments, {
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- per_page: 100,
- });
- const existing = comments.find((comment) => comment.body?.includes(marker));
-
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- body,
- });
- }
-
- # The way out: closing the PR or removing the label deletes its DMG from the
- # rolling release and updates the PR comment to say so.
- cleanup:
- name: Remove preview download
- if: >-
- github.event.pull_request.head.repo.full_name == github.repository &&
- ((github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'preview:mac')) ||
- (github.event.action == 'unlabeled' && github.event.label.name == 'preview:mac'))
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- permissions:
- contents: write
- pull-requests: write
- steps:
- - id: delete
- name: Delete this PR's preview assets
- shell: bash
- env:
- GH_TOKEN: ${{ github.token }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
- run: |
- set -euo pipefail
-
- tag="desktop-preview"
-
- # A stale cleanup must not delete a download that became valid
- # again. If the PR is open and labeled once more, the next publish
- # owns this PR's assets and replaces them itself.
- if [[ "$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" \
- --json state,labels \
- --jq '.state + " " + (.labels | map(.name) | contains(["preview:mac"]) | tostring)')" == "OPEN true" ]]; then
- echo "PR is open and labeled again. Skipping cleanup."
- echo "removed=false" >> "$GITHUB_OUTPUT"
- exit 0
- fi
-
- echo "removed=true" >> "$GITHUB_OUTPUT"
-
- if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
- echo "No preview release exists. Nothing to clean up."
- exit 0
- fi
-
- gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' \
- | { grep -F -- "-pr.${PR_NUMBER}." || true; } \
- | while read -r asset; do
- gh release delete-asset "$tag" "$asset" --repo "$GITHUB_REPOSITORY" --yes \
- || echo "Asset $asset was already removed by a concurrent run."
- done
-
- - name: Mark the preview comment as removed
- if: steps.delete.outputs.removed == 'true'
- uses: actions/github-script@v8
- with:
- script: |
- const marker = "<!-- desktop-macos-preview -->";
- const comments = await github.paginate(github.rest.issues.listComments, {
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- per_page: 100,
- });
- const existing = comments.find((comment) => comment.body?.includes(marker));
- if (!existing) {
- return;
- }
-
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body: [
- marker,
- "### macOS preview",
- "",
- "The preview download was removed because this PR closed or the preview label was removed.",
- ].join("\n"),
- });
diff --git a/.github/workflows/mobile-eas-preview.yml b/.github/workflows/mobile-eas-preview.yml
deleted file mode 100644
index d53602f8f..000000000
--- a/.github/workflows/mobile-eas-preview.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-name: Mobile EAS Preview
-
-on:
- pull_request:
- types: [opened, reopened, synchronize, labeled]
-
-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
- concurrency:
- group: mobile-eas-preview-${{ github.event.pull_request.number }}
- cancel-in-progress: true
- permissions:
- contents: read
- pull-requests: write
- env:
- APP_VARIANT: preview
- NODE_OPTIONS: --max-old-space-size=8192
- MOBILE_VERSION_POLICY: fingerprint
- steps:
- - id: expo-token
- name: Check for EXPO_TOKEN
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- if [ -n "$EXPO_TOKEN" ]; then
- echo "present=true" >> "$GITHUB_OUTPUT"
- else
- echo "present=false" >> "$GITHUB_OUTPUT"
- echo "EXPO_TOKEN is not available; skipping EAS preview."
- fi
-
- - name: Checkout
- if: steps.expo-token.outputs.present == 'true'
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- # No sparse-checkout here: it makes actions/checkout fetch with
- # --filter=blob:none, and eas-cli archives the project via
- # `git clone --depth 1 file://<workspace>`, which fails (exit 128)
- # when the partial clone can't serve the unfetched blobs.
-
- - name: Setup Vite+
- if: steps.expo-token.outputs.present == '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.expo-token.outputs.present == '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
-
- - name: Setup EAS
- if: steps.expo-token.outputs.present == 'true'
- uses: expo/expo-github-action@v8
- with:
- eas-version: latest
- token: ${{ secrets.EXPO_TOKEN }}
- # npm, not pnpm: this only installs eas-cli into the action's own
- # tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
- # ignored build script (no allowBuilds config outside the repo).
- packager: npm
-
- - name: Pull preview environment variables
- if: steps.expo-token.outputs.present == 'true'
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: eas env:pull preview --non-interactive
-
- - name: Deploy with fingerprint check
- if: steps.expo-token.outputs.present == 'true'
- uses: expo/expo-github-action/continuous-deploy-fingerprint@main
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- with:
- profile: preview:dev
- branch: pr-${{ github.event.pull_request.number }}
- platform: all
- environment: preview
- working-directory: apps/mobile
- github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/mobile-eas-production.yml b/.github/workflows/mobile-eas-production.yml
deleted file mode 100644
index 4ad9f4f76..000000000
--- a/.github/workflows/mobile-eas-production.yml
+++ /dev/null
@@ -1,290 +0,0 @@
-name: Mobile EAS Production
-
-# Production builds and OTA updates run from CI (Linux) — never from a laptop.
-# Under the fingerprint runtime-version policy the fingerprint must be computed
-# in the same OS/pnpm as the EAS build; a macOS `eas build` computes a different
-# fingerprint (platform-specific deps + pnpm version) and errors. On this Linux
-# runner, with corepack pinning pnpm 10.24 in eas.json, local == build.
-#
-# Every merge to main that touches the mobile app reconciles, per platform:
-# 1. Store builds: if the latest production build's version differs from
-# app.config.ts, cut a new build and submit it (TestFlight + Play internal
-# track). Bumping `version` is therefore all it takes to
-# start the next release train — the first build of a version enters
-# external-TestFlight beta review immediately, and later builds of the
-# same version auto-approve until that version is released. After App
-# Store approval, Apple closes the release train and `version` must be
-# bumped before another iOS build can be submitted. Releasing to the App
-# Store stays a manual App Store Connect step.
-# 2. OTA: publish a production-channel update for each platform where at
-# least one finished production build matches the current native
-# fingerprint. Old-version binaries with a matching fingerprint receive
-# it too. When native drift means no binary could install the update,
-# it is skipped and flagged in the job summary instead of published
-# into the void.
-# workflow_dispatch remains as a manual override for both modes (e.g. to
-# retry an errored build or force an OTA).
-on:
- workflow_dispatch:
- inputs:
- mode:
- description: "build (+ auto-submit to TestFlight) or update (OTA)"
- required: true
- type: choice
- default: build
- options:
- - build
- - update
- platform:
- description: "Target platform"
- required: true
- type: choice
- default: ios
- options:
- - ios
- - android
- - all
- version:
- description: "Optional build version override (blank uses app.config.ts; an override is committed before building)"
- required: false
- type: string
- message:
- description: "OTA update message (mode=update only)"
- required: false
- type: string
- push:
- branches: [main]
- paths:
- - apps/mobile/**
- - packages/client-runtime/**
- - packages/contracts/**
- - packages/shared/**
- - assets/**
- - scripts/**
- - patches/**
- - pnpm-lock.yaml
- - pnpm-workspace.yaml
- - .github/workflows/mobile-eas-production.yml
-
-# Serialize runs so OTAs publish in merge order. GitHub keeps at most one
-# queued run per group, so a burst of merges collapses into one run of the
-# newest commit — intermediate commits don't need their own OTA.
-concurrency:
- group: mobile-eas-production
- cancel-in-progress: false
-
-jobs:
- production:
- name: EAS Production ${{ github.event_name == 'push' && 'auto' || inputs.mode }}
- runs-on: blacksmith-8vcpu-ubuntu-2404
- permissions:
- contents: read
- env:
- APP_VARIANT: production
- NODE_OPTIONS: --max-old-space-size=8192
- steps:
- - id: expo-token
- name: Check for EXPO_TOKEN
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- if [ -n "$EXPO_TOKEN" ]; then
- echo "present=true" >> "$GITHUB_OUTPUT"
- else
- echo "present=false" >> "$GITHUB_OUTPUT"
- echo "EXPO_TOKEN is not available; skipping EAS production job."
- fi
-
- - id: version_app_token
- name: Mint release app token for version override
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.version != ''
- uses: actions/create-github-app-token@v2
- with:
- app-id: ${{ secrets.RELEASE_APP_ID }}
- private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- owner: ${{ github.repository_owner }}
-
- - name: Checkout
- if: steps.expo-token.outputs.present == 'true'
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- token: ${{ steps.version_app_token.outputs.token || github.token }}
- # No sparse-checkout here: it makes actions/checkout fetch with
- # --filter=blob:none, and eas-cli archives the project via
- # `git clone --depth 1 file://<workspace>`, which fails (exit 128)
- # when the partial clone can't serve the unfetched blobs.
-
- - name: Setup Vite+
- if: steps.expo-token.outputs.present == '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.expo-token.outputs.present == '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
-
- - name: Setup EAS
- if: steps.expo-token.outputs.present == 'true'
- uses: expo/expo-github-action@v8
- with:
- eas-version: latest
- token: ${{ secrets.EXPO_TOKEN }}
- # npm, not pnpm: this only installs eas-cli into the action's own
- # tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
- # ignored build script (no allowBuilds config outside the repo).
- packager: npm
-
- - name: Pull production environment variables
- if: steps.expo-token.outputs.present == 'true'
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: eas env:pull production --non-interactive
-
- - name: Apply manual version override
- if: steps.version_app_token.outcome == 'success'
- env:
- GH_TOKEN: ${{ steps.version_app_token.outputs.token }}
- APP_SLUG: ${{ steps.version_app_token.outputs.app-slug }}
- RELEASE_VERSION: ${{ inputs.version }}
- run: |
- if [ "$GITHUB_REF_TYPE" != "branch" ]; then
- echo "Version overrides require dispatching this workflow from a branch; received $GITHUB_REF_TYPE '$GITHUB_REF_NAME'." >&2
- exit 1
- fi
- if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+){1,2}$ ]]; then
- echo "Version override must contain two or three dot-separated integers; received '$RELEASE_VERSION'." >&2
- exit 1
- fi
-
- node --input-type=module -e '
- import fs from "node:fs";
- const path = "apps/mobile/app.config.ts";
- const source = fs.readFileSync(path, "utf8");
- const next = source.replace(
- /^( version: ")[^"]+(".*)$/m,
- `$1${process.env.RELEASE_VERSION}$2`,
- );
- if (next === source && !source.includes(` version: "${process.env.RELEASE_VERSION}"`)) {
- throw new Error("Could not update app version");
- }
- fs.writeFileSync(path, next);
- '
- vp fmt apps/mobile/app.config.ts
-
- if git diff --quiet -- apps/mobile/app.config.ts; then
- echo "app.config.ts is already at $RELEASE_VERSION; no version commit needed."
- exit 0
- fi
-
- user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
- git config user.name "${APP_SLUG}[bot]"
- git config user.email "${user_id}+${APP_SLUG}[bot]@users.noreply.github.com"
- git add apps/mobile/app.config.ts
- git commit \
- -m "chore(mobile): bump app version to $RELEASE_VERSION" \
- -m "Co-authored-by: codex <[email protected]>"
- git push origin "HEAD:refs/heads/${GITHUB_REF_NAME}"
-
- - name: Summarize manual build version
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
- working-directory: apps/mobile
- run: |
- version="$(npx expo config --json --type public | jq -r '.version')"
- {
- echo "## Manual production build"
- echo
- echo "- App version: \`$version\`"
- echo "- Platform: \`${{ inputs.platform }}\`"
- echo
- echo "> Apple closes an iOS release train after App Store approval. Before building iOS, confirm \`$version\` is newer than the approved App Store version."
- } >> "$GITHUB_STEP_SUMMARY"
-
- - name: Build and submit (manual)
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait
-
- - name: Publish OTA update (manual)
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- eas update \
- --channel production \
- --environment production \
- --platform ${{ inputs.platform }} \
- --message "${{ inputs.message || format('Production OTA ({0})', github.sha) }}" \
- --non-interactive
-
- # No --status filter on build:list: an in-queue/in-progress build must
- # count as existing, or every merge during the build window would cut a
- # duplicate. After an errored build, retry via workflow_dispatch
- # mode=build — pushes won't re-trigger it until the app version changes.
- - id: store_builds
- name: Ensure store builds exist for the current app version
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
- continue-on-error: true
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- failed=0
- version="$(npx expo config --json --type public | jq -r '.version')"
- for platform in ios android; do
- latest="$(eas build:list --platform "$platform" --build-profile production --limit 1 --json --non-interactive | jq -r '.[0].appVersion // "none"')"
- if [ "$latest" = "$version" ]; then
- echo "$platform: production build for $version already exists (or is in progress)"
- continue
- fi
- echo "$platform: latest production build is $latest, app.config.ts says $version — building"
- if eas build --platform "$platform" --profile production --auto-submit --non-interactive --no-wait; then
- echo ":building_construction: $platform: scheduled production build and submission for $version" >> "$GITHUB_STEP_SUMMARY"
- else
- failed=1
- echo ":x: $platform: production build or submission failed for $version" >> "$GITHUB_STEP_SUMMARY"
- fi
- done
- exit "$failed"
-
- - name: Publish fingerprint-gated OTA
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
- working-directory: apps/mobile
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- message="$(git log -1 --pretty=%s | head -c 120) ($(git rev-parse --short=9 HEAD))"
- for platform in ios android; do
- # eas-cli prints an environment-loaded notice to stdout before the
- # JSON even with --json, so discard everything before the document.
- hash="$(eas fingerprint:generate --platform "$platform" --environment production --json --non-interactive | sed -n '/^{/,$p' | jq -er '.hash | select(type == "string" and length > 0)')"
- matching="$(eas build:list --platform "$platform" --build-profile production --status finished --fingerprint-hash "$hash" --limit 1 --json --non-interactive | jq 'length')"
- if [ "$matching" -gt 0 ]; then
- eas update \
- --channel production \
- --environment production \
- --platform "$platform" \
- --message "$message" \
- --non-interactive
- echo ":white_check_mark: $platform: OTA published to production (fingerprint \`$hash\`)" >> "$GITHUB_STEP_SUMMARY"
- else
- echo ":warning: $platform: no finished production build matches fingerprint \`$hash\` — OTA skipped; JS changes reach $platform only once a matching build ships" >> "$GITHUB_STEP_SUMMARY"
- fi
- done
-
- - name: Propagate store build failure
- if: steps.store_builds.outcome == 'failure'
- run: exit 1
diff --git a/.github/workflows/mobile-fingerprint-check.yml b/.github/workflows/mobile-fingerprint-check.yml
deleted file mode 100644
index fd98817cd..000000000
--- a/.github/workflows/mobile-fingerprint-check.yml
+++ /dev/null
@@ -1,205 +0,0 @@
-name: Mobile Fingerprint Check
-
-# Detects whether a PR changes the native fingerprint — i.e. whether merging
-# it would leave main un-OTA-able until a new store build ships. Native-change
-# PRs get the "📱 Native Change" label so they can be held and merged as a
-# batch right before the next store submission, keeping main OTA-able for
-# everything else in between. (Once one native PR merges, every later merge
-# inherits the drifted fingerprint and loses OTA reach too — that is why the
-# signal has to fire before merge, not after.)
-#
-# The check is advisory: it always passes, the label is the signal. Both
-# fingerprints are computed in this one job (same OS, same corepack-pinned
-# pnpm), so the comparison is self-consistent; no EXPO_TOKEN needed.
-on:
- pull_request:
- paths:
- - apps/mobile/**
- - packages/client-runtime/**
- - packages/contracts/**
- - packages/shared/**
- - assets/**
- - scripts/**
- - patches/**
- - pnpm-lock.yaml
- - pnpm-workspace.yaml
- - .github/workflows/mobile-fingerprint-check.yml
-
-concurrency:
- group: mobile-fingerprint-check-${{ github.event.pull_request.number }}
- cancel-in-progress: true
-
-jobs:
- fingerprint:
- name: Native fingerprint diff
- runs-on: blacksmith-8vcpu-ubuntu-2404
- permissions:
- contents: read
- issues: write
- pull-requests: write
- env:
- APP_VARIANT: production
- NODE_OPTIONS: --max-old-space-size=8192
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- # Default pull_request checkout is the merge commit (PR applied on
- # top of base), so the "head" fingerprint is the state main would
- # actually be in after merging — stale branches compare cleanly.
- fetch-depth: 0
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/mobile...
-
- - name: Expose pnpm
- 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
-
- - name: Fingerprint merge result
- working-directory: apps/mobile
- run: |
- mkdir -p "$RUNNER_TEMP/fp/head" "$RUNNER_TEMP/fp/base"
- for platform in ios android; do
- npx expo-updates fingerprint:generate --platform "$platform" > "$RUNNER_TEMP/fp/head/$platform.json"
- done
-
- - name: Fingerprint base
- run: |
- git checkout --quiet "${{ github.event.pull_request.base.sha }}"
- # Re-sync node_modules to the base commit's lockfile before
- # fingerprinting — a dep-changing PR must not fingerprint the base
- # against head's installed packages.
- pnpm install --filter=@t3tools/mobile...
- cd apps/mobile
- for platform in ios android; do
- npx expo-updates fingerprint:generate --platform "$platform" > "$RUNNER_TEMP/fp/base/$platform.json"
- done
-
- - id: compare
- name: Compare fingerprints
- run: |
- changed=""
- {
- echo "## Native fingerprint diff"
- echo
- for platform in ios android; do
- head_hash="$(jq -r .hash "$RUNNER_TEMP/fp/head/$platform.json")"
- base_hash="$(jq -r .hash "$RUNNER_TEMP/fp/base/$platform.json")"
- if [ "$head_hash" = "$base_hash" ]; then
- echo "- ✅ **$platform**: unchanged (\`$head_hash\`) — OTA-compatible"
- continue
- fi
- changed="$changed $platform"
- echo "- 📱 **$platform**: \`$base_hash\` → \`$head_hash\` — merging requires a new native build before OTAs work again"
- jq -r -n \
- --slurpfile h "$RUNNER_TEMP/fp/head/$platform.json" \
- --slurpfile b "$RUNNER_TEMP/fp/base/$platform.json" '
- ($b[0].sources | map({ (.filePath // .id): .hash }) | add // {}) as $bm
- | $h[0].sources[]
- | select($bm[(.filePath // .id)] != .hash)
- | " - \(.type): `\(.filePath // .id)`"'
- done
- } >> "$GITHUB_STEP_SUMMARY"
- echo "changed_platforms=${changed# }" >> "$GITHUB_OUTPUT"
-
- - name: Sync native change label
- # Fork PRs get a read-only token under pull_request; the check stays
- # advisory there (summary only). This workflow must not move to
- # pull_request_target — it installs and runs PR code.
- if: github.event.pull_request.head.repo.full_name == github.repository
- uses: actions/github-script@v8
- env:
- CHANGED_PLATFORMS: ${{ steps.compare.outputs.changed_platforms }}
- with:
- script: |
- const managedLabel = {
- name: "📱 Native Change",
- color: "d93f0b",
- description:
- "Changes the native fingerprint; merging blocks production OTAs until a new store build ships.",
- };
- const nativeChanged = (process.env.CHANGED_PLATFORMS ?? "").trim() !== "";
- const issueNumber = context.payload.pull_request.number;
-
- try {
- const { data: existing } = await github.rest.issues.getLabel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- name: managedLabel.name,
- });
-
- if (
- existing.color !== managedLabel.color ||
- (existing.description ?? "") !== managedLabel.description
- ) {
- await github.rest.issues.updateLabel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- name: managedLabel.name,
- color: managedLabel.color,
- description: managedLabel.description,
- });
- }
- } catch (error) {
- if (error.status !== 404) {
- throw error;
- }
-
- try {
- await github.rest.issues.createLabel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- name: managedLabel.name,
- color: managedLabel.color,
- description: managedLabel.description,
- });
- } catch (createError) {
- if (createError.status !== 422) {
- throw createError;
- }
- }
- }
-
- const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issueNumber,
- per_page: 100,
- });
- const hasLabel = currentLabels.some((label) => label.name === managedLabel.name);
-
- if (nativeChanged && !hasLabel) {
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issueNumber,
- labels: [managedLabel.name],
- });
- } else if (!nativeChanged && hasLabel) {
- try {
- await github.rest.issues.removeLabel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issueNumber,
- name: managedLabel.name,
- });
- } catch (removeError) {
- if (removeError.status !== 404) {
- throw removeError;
- }
- }
- }
-
- core.info(
- `PR #${issueNumber}: native fingerprint ${nativeChanged ? `changed (${process.env.CHANGED_PLATFORMS})` : "unchanged"}`,
- );
diff --git a/.github/workflows/mobile-showcase-screenshots.yml b/.github/workflows/mobile-showcase-screenshots.yml
deleted file mode 100644
index 8e3bd2dfd..000000000
--- a/.github/workflows/mobile-showcase-screenshots.yml
+++ /dev/null
@@ -1,170 +0,0 @@
-name: Mobile Showcase Screenshots
-
-on:
- workflow_dispatch:
- inputs:
- platform:
- description: Device platforms to capture
- required: true
- default: all
- type: choice
- options:
- - all
- - ios
- - android
- appearance:
- description: System appearances to capture
- required: true
- default: both
- type: choice
- options:
- - both
- - dark
- - light
- theme:
- description: Palette to capture (all multiplies the run by seven)
- required: true
- default: t3-code
- type: choice
- options:
- - t3-code
- - akeru-paper
- - t3-chat
- - grove
- - ocean
- - ember
- - iris
- - all
-
-permissions:
- contents: read
-
-env:
- NODE_OPTIONS: --max-old-space-size=8192
-
-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
- # Capturing every palette multiplies the device matrix by seven, and only the
- # one native build is shared between them.
- timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/mobile...
- - --filter=@t3tools/scripts...
- - --filter=t3...
-
- - name: Expose pnpm
- 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
-
- - name: Capture iOS showcase
- run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}"
-
- - name: Validate App Store Connect assets
- run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only
-
- - name: Upload iOS screenshots
- if: always()
- uses: actions/upload-artifact@v7
- with:
- name: app-store-connect-screenshots
- path: artifacts/app-store/screenshots/apple/
- if-no-files-found: warn
- retention-days: 14
-
- android:
- name: Android phone, 7-inch tablet, and 10-inch tablet
- if: inputs.platform == 'all' || inputs.platform == 'android'
- runs-on: blacksmith-16vcpu-ubuntu-2404
- # Capturing every palette multiplies the device matrix by seven, and only the
- # one native build is shared between them.
- timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }}
- env:
- T3_SHOWCASE_ANDROID_ABI: x86_64
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/mobile...
- - --filter=@t3tools/scripts...
- - --filter=t3...
-
- - name: Expose pnpm
- 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
-
- - name: Setup Java
- uses: actions/setup-java@v5
- with:
- distribution: temurin
- java-version: 17
-
- - name: Setup Gradle cache
- uses: gradle/actions/setup-gradle@v5
-
- - name: Enable KVM
- run: |
- echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS="static_node=kvm"' \
- | sudo tee /etc/udev/rules.d/99-kvm4all.rules
- sudo udevadm control --reload-rules
- sudo udevadm trigger --name-match=kvm
-
- - name: Capture Android showcase
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: 36
- target: google_apis
- arch: x86_64
- profile: pixel_7_pro
- avd-name: Pixel_10_Pro
- cores: 8
- ram-size: 4096M
- disable-animations: false
- script: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}"
-
- - name: Validate Google Play assets
- run: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only
-
- - name: Upload Android screenshots
- if: always()
- uses: actions/upload-artifact@v7
- with:
- name: google-play-screenshots
- path: artifacts/app-store/screenshots/google-play/
- if-no-files-found: warn
- retention-days: 14
diff --git a/.github/workflows/publish-aur.yml b/.github/workflows/publish-aur.yml
deleted file mode 100644
index 62f8fd1f5..000000000
--- a/.github/workflows/publish-aur.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: Publish AUR package
-
-# See packaging/aur/README.md.
-
-on:
- workflow_call:
- inputs:
- release_tag:
- required: true
- type: string
- pkgrel:
- required: false
- default: "1"
- type: string
- secrets:
- AUR_SSH_PRIVATE_KEY:
- required: true
- workflow_dispatch:
- inputs:
- release_tag:
- description: "Release tag to publish"
- required: true
- type: string
- pkgrel:
- description: "Arch package release override"
- required: false
- default: "1"
- type: string
-
-permissions:
- contents: read
-
-concurrency:
- group: publish-aur
- cancel-in-progress: false
-
-jobs:
- publish:
- name: Validate and publish
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 30
- container:
- image: archlinux:base-devel
-
- steps:
- - name: Install Arch packaging tools
- run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo
-
- - name: Checkout packaging sources
- uses: actions/checkout@v6
-
- - name: Create unprivileged build user
- run: |
- useradd --create-home builder
- install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
- builder ALL=(root) NOPASSWD: /usr/bin/pacman
- EOF
-
- - name: Validate and publish package sources
- env:
- GH_TOKEN: ${{ github.token }}
- RELEASE_TAG: ${{ inputs.release_tag }}
- PKGREL: ${{ inputs.pkgrel || '1' }}
- AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
- run: packaging/aur/scripts/release.sh
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index b8a2fab33..000000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,1189 +0,0 @@
-name: Release
-
-on:
- push:
- tags:
- - "v*.*.*"
- - "!v*-nightly.*"
- schedule:
- # Off minute zero: GitHub delays scheduled runs most at the top of the hour.
- - cron: "7 */3 * * *"
- workflow_dispatch:
- inputs:
- channel:
- description: "Release channel"
- required: false
- default: stable
- type: choice
- options:
- - stable
- - nightly
- version:
- description: "Release version (for example 1.2.3 or v1.2.3)"
- required: false
- type: string
-
-# Serialize nightlies (scheduled and manual) so overlapping runs cannot build
-# the same commit twice or publish out of order. Stable tag releases get their
-# own group so a nightly never blocks them. Running publishers are never
-# canceled, and queue: max keeps every pending run instead of the default
-# newest-wins single slot, so a queued stable tag can never be silently
-# dropped. Queued nightlies with no new commits skip via check_changes.
-concurrency:
- group: release-${{ (github.event_name == 'schedule' || inputs.channel == 'nightly') && 'nightly' || 'stable' }}
- cancel-in-progress: false
- queue: max
-
-permissions:
- contents: read
- id-token: none
-
-jobs:
- check_changes:
- name: Check for changes since last nightly
- if: github.event_name == 'schedule'
- runs-on: blacksmith-8vcpu-ubuntu-2404
- outputs:
- has_changes: ${{ steps.check.outputs.has_changes }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - id: check
- name: Compare HEAD to last nightly tag
- run: |
- last_nightly_tag=$(git tag --list 'v*-nightly.*' 'nightly-v*' --sort=-creatordate | head -n 1)
- if [[ -z "$last_nightly_tag" ]]; then
- echo "No previous nightly tag found. Proceeding with release."
- echo "has_changes=true" >> "$GITHUB_OUTPUT"
- exit 0
- fi
-
- last_nightly_sha=$(git rev-parse "$last_nightly_tag^{commit}")
- head_sha=$(git rev-parse HEAD)
-
- if [[ "$last_nightly_sha" == "$head_sha" ]]; then
- echo "No changes on main since last nightly release ($last_nightly_tag). Skipping."
- echo "has_changes=false" >> "$GITHUB_OUTPUT"
- else
- echo "Changes detected on main since $last_nightly_tag ($last_nightly_sha → $head_sha). Proceeding."
- echo "has_changes=true" >> "$GITHUB_OUTPUT"
- fi
-
- preflight:
- name: Preflight
- needs: [check_changes]
- if: |
- !failure() && !cancelled() &&
- (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- outputs:
- release_channel: ${{ steps.release_meta.outputs.release_channel }}
- version: ${{ steps.release_meta.outputs.version }}
- tag: ${{ steps.release_meta.outputs.tag }}
- release_name: ${{ steps.release_meta.outputs.name }}
- short_sha: ${{ steps.release_meta.outputs.short_sha }}
- previous_tag: ${{ steps.previous_tag.outputs.previous_tag }}
- cli_dist_tag: ${{ steps.release_meta.outputs.cli_dist_tag }}
- is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
- make_latest: ${{ steps.release_meta.outputs.make_latest }}
- ref: ${{ github.sha }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: true
-
- - id: release_meta
- name: Resolve release version
- shell: bash
- env:
- DISPATCH_CHANNEL: ${{ github.event.inputs.channel }}
- DISPATCH_VERSION: ${{ github.event.inputs.version }}
- NIGHTLY_DATE: ${{ github.run_started_at }}
- NIGHTLY_SHA: ${{ github.sha }}
- NIGHTLY_RUN_NUMBER: ${{ github.run_number }}
- run: |
- if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-stable}" == "nightly" ) ]]; then
- nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
-
- node scripts/resolve-nightly-release.ts \
- --date "$nightly_date" \
- --run-number "$NIGHTLY_RUN_NUMBER" \
- --sha "$NIGHTLY_SHA" \
- --github-output
-
- echo "release_channel=nightly" >> "$GITHUB_OUTPUT"
- echo "cli_dist_tag=nightly" >> "$GITHUB_OUTPUT"
- echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
- echo "make_latest=false" >> "$GITHUB_OUTPUT"
- else
- if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
- raw="${DISPATCH_VERSION}"
- if [[ -z "$raw" ]]; then
- echo "workflow_dispatch stable releases require the version input." >&2
- exit 1
- fi
- else
- raw="${GITHUB_REF_NAME}"
- fi
-
- version="${raw#v}"
- if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
- echo "Invalid release version: $raw" >&2
- exit 1
- fi
-
- echo "release_channel=stable" >> "$GITHUB_OUTPUT"
- echo "version=$version" >> "$GITHUB_OUTPUT"
- echo "tag=v$version" >> "$GITHUB_OUTPUT"
- echo "name=T3 Code v$version" >> "$GITHUB_OUTPUT"
- echo "cli_dist_tag=latest" >> "$GITHUB_OUTPUT"
- if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
- echo "make_latest=true" >> "$GITHUB_OUTPUT"
- else
- echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
- echo "make_latest=false" >> "$GITHUB_OUTPUT"
- fi
- fi
-
- - id: previous_tag
- name: Resolve previous release tag
- run: |
- node scripts/resolve-previous-release-tag.ts \
- --channel "${{ steps.release_meta.outputs.release_channel }}" \
- --current-tag "${{ steps.release_meta.outputs.tag }}" \
- --github-output
-
- quality:
- name: Release quality checks
- needs: [preflight]
- if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: true
-
- - name: Ensure Electron runtime is installed
- run: vp run --filter @t3tools/desktop ensure:electron
-
- - name: Check
- run: vp check
-
- - name: Typecheck
- run: vp run typecheck
-
- - name: Test
- run: vp run test
-
- relay_public_config:
- name: Resolve T3 Connect public config
- # Consumes only the commit SHA, not preflight's resolved version, so it runs
- # alongside preflight instead of after it. The condition mirrors preflight's:
- # check_changes is skipped on non-schedule events (skipped is neither failure
- # nor success, so success() would be wrong here).
- needs: [check_changes]
- if: |
- !failure() && !cancelled() &&
- (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 5
- environment:
- name: production
- outputs:
- clerk_publishable_key: ${{ steps.public_config.outputs.clerk_publishable_key }}
- clerk_jwt_template: ${{ steps.public_config.outputs.clerk_jwt_template }}
- clerk_cli_oauth_client_id: ${{ steps.public_config.outputs.clerk_cli_oauth_client_id }}
- relay_url: ${{ steps.public_config.outputs.relay_url }}
- env:
- CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
- CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
- RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
- CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
- CLERK_JWT_TEMPLATE: ${{ vars.CLERK_JWT_TEMPLATE }}
- CLERK_CLI_OAUTH_CLIENT_ID: ${{ vars.CLERK_CLI_OAUTH_CLIENT_ID }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ github.sha }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=t3code-relay...
-
- - id: relay_state
- name: Read production relay tracing config
- shell: bash
- run: |
- vp run --filter t3code-relay deploy \
- --stage prod \
- --read-state \
- --github-output \
- --github-env-file "$RUNNER_TEMP/relay-client-tracing.env"
-
- - name: Upload relay client tracing config
- uses: actions/upload-artifact@v7
- with:
- name: relay-client-tracing-config
- path: ${{ runner.temp }}/relay-client-tracing.env
- if-no-files-found: error
- retention-days: 1
-
- - id: public_config
- name: Resolve production relay public config
- shell: bash
- run: |
- set -euo pipefail
-
- relay_domain="${RELAY_DOMAIN:-}"
- if [[ -z "$relay_domain" && -n "${RELAY_API_ZONE_NAME:-}" ]]; then
- relay_domain="relay.$RELAY_API_ZONE_NAME"
- fi
- required=(
- relay_domain
- CLERK_PUBLISHABLE_KEY
- CLERK_JWT_TEMPLATE
- CLERK_CLI_OAUTH_CLIENT_ID
- )
- missing=()
- for name in "${required[@]}"; do
- if [[ -z "${!name:-}" ]]; then
- missing+=("$name")
- fi
- done
- if (( ${#missing[@]} > 0 )); then
- printf 'Missing required relay deployment configuration: %s\n' "${missing[*]}" >&2
- exit 1
- fi
-
- echo "clerk_publishable_key=$CLERK_PUBLISHABLE_KEY" >> "$GITHUB_OUTPUT"
- echo "clerk_jwt_template=$CLERK_JWT_TEMPLATE" >> "$GITHUB_OUTPUT"
- echo "clerk_cli_oauth_client_id=$CLERK_CLI_OAUTH_CLIENT_ID" >> "$GITHUB_OUTPUT"
- echo "relay_url=https://$relay_domain" >> "$GITHUB_OUTPUT"
-
- # node-pty publishes no Linux prebuilt and the WSL backend runs under the
- # distro's own (Linux) Node, which can't load the Windows/Electron binary. We
- # build the Linux pty.node here, on Linux, and hand it to the Windows packaging
- # job — the Windows artifact then ships a ready WSL backend binary with no
- # cross-compiling and no first-launch compiler/node-gyp/network on the user's
- # machine. node-pty is N-API, so one binary works across all WSL Node versions.
- build_wsl_node_pty:
- name: Build WSL node-pty (linux-x64)
- # Same gating as relay_public_config: only the commit SHA is needed, so this
- # runs alongside preflight. See the condition comment there.
- needs: [check_changes]
- if: |
- !failure() && !cancelled() &&
- (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 15
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ github.sha }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=t3...
-
- - name: Build node-pty linux-x64 prebuild
- shell: bash
- run: |
- set -euo pipefail
- # Resolve node-pty from apps/server (where it's a dependency) and build
- # its native binary from source for Linux. node-addon-api resolves from
- # node-pty's own dependency tree, so node-gyp has everything it needs.
- pty_pkg="$(node -e "console.log(require.resolve('node-pty/package.json', { paths: ['$GITHUB_WORKSPACE/apps/server'] }))")"
- pty_dir="$(dirname "$pty_pkg")"
- ( cd "$pty_dir" && npx --yes node-gyp rebuild )
- mkdir -p wsl-prebuild
- cp "$pty_dir/build/Release/pty.node" wsl-prebuild/pty.node
- file wsl-prebuild/pty.node
-
- - name: Upload node-pty linux-x64 prebuild
- uses: actions/upload-artifact@v7
- with:
- name: wsl-node-pty-x64
- path: wsl-prebuild/pty.node
- if-no-files-found: error
-
- build:
- name: Build ${{ matrix.label }}
- # build_wsl_node_pty stays in `needs` so it runs first and its artifact is
- # available to download, but only the Windows matrix entry consumes it. We
- # therefore gate the job on preflight + relay (must succeed) WITHOUT requiring
- # build_wsl_node_pty, so a failed Linux prebuild doesn't skip the macOS/Linux
- # builds. `!cancelled()` (not `!failure()`) lets the job run even when
- # build_wsl_node_pty failed; the Windows-only download step below then fails
- # that single platform if the prebuild is missing.
- needs: [preflight, relay_public_config, build_wsl_node_pty]
- if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' }}
- runs-on: ${{ matrix.runner }}
- timeout-minutes: 30
- env:
- T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
- T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
- T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
- T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
- strategy:
- fail-fast: false
- matrix:
- include:
- - label: macOS arm64
- runner: blacksmith-12vcpu-macos-26
- platform: mac
- target: dmg
- arch: arm64
- rust_target: aarch64-apple-darwin
- resource_key: darwin-arm64
- - label: macOS x64
- runner: blacksmith-12vcpu-macos-26
- platform: mac
- target: dmg
- arch: x64
- rust_target: x86_64-apple-darwin
- resource_key: darwin-x64
- - label: Linux x64
- runner: blacksmith-32vcpu-ubuntu-2404
- platform: linux
- target: AppImage
- arch: x64
- rust_target: x86_64-unknown-linux-gnu
- resource_key: linux-x64
- - label: Windows x64
- runner: blacksmith-32vcpu-windows-2025
- platform: win
- target: nsis
- arch: x64
- rust_target: x86_64-pc-windows-msvc
- resource_key: win32-x64
- # - label: Windows arm64
- # runner: windows-11-arm
- # platform: win
- # target: nsis
- # arch: arm64
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: ${{ matrix.platform != 'win' }}
- run-install: false
-
- - name: Resolve Windows package cache path
- if: matrix.platform == 'win'
- id: package_cache_path
- shell: pwsh
- run: '"path=$(vp pm cache dir)" >> $env:GITHUB_OUTPUT'
-
- - name: Cache Windows packages
- if: matrix.platform == 'win'
- uses: actions/cache@v6
- with:
- path: ${{ steps.package_cache_path.outputs.path }}
- key: windows-release-packages-v1-${{ matrix.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
-
- - name: Install desktop dependencies
- run: vp install --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
-
- - name: Cache resource monitor
- id: resource_monitor_cache
- uses: actions/cache@v6
- with:
- path: native/resource-monitor/target/${{ matrix.rust_target }}/release/t3-resource-monitor${{ matrix.platform == 'win' && '.exe' || '' }}
- key: resource-monitor-${{ matrix.rust_target }}-${{ hashFiles('native/resource-monitor/Cargo.lock', 'native/resource-monitor/Cargo.toml', 'native/resource-monitor/src/**') }}
-
- - name: Setup Rust
- if: steps.resource_monitor_cache.outputs.cache-hit != 'true'
- uses: dtolnay/rust-toolchain@stable
- with:
- targets: ${{ matrix.rust_target }}
-
- - name: Download relay client tracing config
- uses: actions/download-artifact@v8
- with:
- name: relay-client-tracing-config
- path: ${{ runner.temp }}/relay-client-tracing
-
- - name: Load relay client tracing config
- shell: bash
- run: |
- config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
- tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
- echo "::add-mask::$tracing_token"
- cat "$config_path" >> "$GITHUB_ENV"
-
- - name: Align package versions to release version
- run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
-
- - name: Download WSL node-pty prebuild
- if: matrix.platform == 'win'
- uses: actions/download-artifact@v7
- with:
- name: wsl-node-pty-x64
- path: wsl-prebuild
-
- - name: Install Spectre-mitigated MSVC libs
- if: matrix.platform == 'win'
- shell: pwsh
- run: |
- $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
- $installPath = & $vswhere -products * -latest -property installationPath
- $setupExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe"
- $proc = Start-Process -FilePath $setupExe `
- -ArgumentList "modify", "--installPath", "`"$installPath`"", "--add", `
- "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre", "--quiet", "--norestart" `
- -Wait -PassThru -NoNewWindow
- if ($null -eq $proc -or $proc.ExitCode -ne 0) {
- $code = if ($null -ne $proc) { $proc.ExitCode } else { 1 }
- Write-Error "Visual Studio Installer failed with exit code $code"
- exit $code
- }
-
- - name: Install ImageMagick
- if: matrix.platform == 'linux'
- shell: bash
- run: |
- if ! command -v magick >/dev/null 2>&1 && ! command -v convert >/dev/null 2>&1; then
- sudo apt-get update
- sudo apt-get install -y imagemagick
- fi
-
- if command -v magick >/dev/null 2>&1; then
- magick -version
- else
- convert -version
- fi
-
- - name: Prepare Azure Trusted Signing
- if: matrix.platform == 'win'
- shell: pwsh
- env:
- AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
- AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
- AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
- AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
- AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
- AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
- run: |
- $ErrorActionPreference = "Stop"
-
- $requiredSecrets = @(
- $env:AZURE_TENANT_ID,
- $env:AZURE_CLIENT_ID,
- $env:AZURE_CLIENT_SECRET,
- $env:AZURE_TRUSTED_SIGNING_ENDPOINT,
- $env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
- $env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
- $env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
- )
- if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
- Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
- exit 0
- }
-
- try {
- Install-PackageProvider `
- -Name NuGet `
- -MinimumVersion 2.8.5.201 `
- -Force `
- -Scope CurrentUser `
- -ErrorAction Stop
- } catch {
- Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
- }
-
- Install-Module `
- -Name TrustedSigning `
- -MinimumVersion 0.5.0 `
- -Force `
- -AllowClobber `
- -Repository PSGallery `
- -Scope CurrentUser `
- -ErrorAction Stop
-
- Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
- Get-Command Invoke-TrustedSigning -ErrorAction Stop
-
- $moduleRoots = @(
- [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
- [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
- [System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
- [System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
- )
- $modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
- Where-Object { $_ -and (Test-Path $_) } |
- Select-Object -Unique
- "PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
-
- - name: Build desktop artifact
- shell: bash
- env:
- T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: ${{ steps.resource_monitor_cache.outputs.cache-hit == 'true' }}
- CSC_LINK: ${{ secrets.CSC_LINK }}
- CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
- APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
- APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
- APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
- APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
- MACOS_PROVISIONING_PROFILE: ${{ secrets.MACOS_PROVISIONING_PROFILE }}
- T3CODE_CLERK_PASSKEY_RP_DOMAINS: ${{ vars.CLERK_PASSKEY_RP_DOMAINS }}
- AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
- AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
- AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
- AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
- AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
- AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
- run: |
- args=(
- --platform "${{ matrix.platform }}"
- --target "${{ matrix.target }}"
- --arch "${{ matrix.arch }}"
- --build-version "${{ needs.preflight.outputs.version }}"
- --verbose
- )
-
- has_all() {
- for value in "$@"; do
- if [[ -z "$value" ]]; then
- return 1
- fi
- done
- return 0
- }
-
- if [[ "${{ matrix.platform }}" == "mac" ]]; then
- if has_all "$CSC_LINK" "$CSC_KEY_PASSWORD" "$APPLE_API_KEY" "$APPLE_API_KEY_ID" "$APPLE_API_ISSUER"; then
- if ! has_all "$APPLE_TEAM_ID" "$MACOS_PROVISIONING_PROFILE"; then
- echo "macOS signing is configured, but APPLE_TEAM_ID or MACOS_PROVISIONING_PROFILE is missing." >&2
- exit 1
- fi
-
- key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
- printf '%s' "$APPLE_API_KEY" > "$key_path"
- export APPLE_API_KEY="$key_path"
-
- profile_path="$RUNNER_TEMP/t3code.provisionprofile"
- printf '%s' "$MACOS_PROVISIONING_PROFILE" | base64 -D > "$profile_path"
- security cms -D -i "$profile_path" >/dev/null
- export T3CODE_APPLE_TEAM_ID="$APPLE_TEAM_ID"
- export T3CODE_MACOS_PROVISIONING_PROFILE="$profile_path"
-
- echo "macOS signing enabled."
- args+=(--signed)
- else
- echo "macOS signing disabled (missing one or more Apple signing secrets)."
- fi
- elif [[ "${{ matrix.platform }}" == "win" ]]; then
- # Bundle the Linux node-pty binary built by the build_wsl_node_pty job
- # so the packaged WSL backend ships a ready binary (no first-launch
- # compile). Required for a working WSL backend on Windows.
- args+=(--wsl-prebuild "$GITHUB_WORKSPACE/wsl-prebuild/pty.node")
- if has_all \
- "$AZURE_TENANT_ID" \
- "$AZURE_CLIENT_ID" \
- "$AZURE_CLIENT_SECRET" \
- "$AZURE_TRUSTED_SIGNING_ENDPOINT" \
- "$AZURE_TRUSTED_SIGNING_ACCOUNT_NAME" \
- "$AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME" \
- "$AZURE_TRUSTED_SIGNING_PUBLISHER_NAME"; then
- echo "Windows signing enabled (Azure Trusted Signing)."
- args+=(--signed)
- else
- echo "Windows signing disabled (missing one or more Azure Trusted Signing secrets)."
- fi
- else
- echo "Signing disabled for ${{ matrix.platform }}."
- fi
-
- vp run dist:desktop:artifact "${args[@]}"
-
- - name: Collect release assets
- shell: bash
- run: |
- set -euo pipefail
- mkdir -p release-publish
-
- shopt -s nullglob
- for pattern in \
- "release/*.dmg" \
- "release/*.zip" \
- "release/*.AppImage" \
- "release/*.exe" \
- "release/*.blockmap" \
- "release/*.yml"; do
- for file in $pattern; do
- cp "$file" release-publish/
- done
- done
-
- if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
- shopt -s nullglob
- for manifest in release-publish/*-mac.yml; do
- mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"
- done
- fi
-
- # Enable if Windows arm64 builds are enabled.
- # Windows updater metadata is channel-specific (for example
- # "latest.yml" or "nightly.yml"). Suffix each per-arch copy so the
- # release job can merge matching arm64/x64 manifests back into one
- # canonical manifest per channel.
- # if [[ "${{ matrix.platform }}" == "win" ]]; then
- # shopt -s nullglob
- # for manifest in release-publish/*.yml; do
- # mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml"
- # done
- # fi
-
- - name: Collect resource monitor
- shell: bash
- run: |
- set -euo pipefail
- binary_name="t3-resource-monitor"
- if [[ "${{ matrix.platform }}" == "win" ]]; then
- binary_name="${binary_name}.exe"
- fi
- source_path="native/resource-monitor/target/${{ matrix.rust_target }}/release/${binary_name}"
- target_dir="resource-monitor-publish/${{ matrix.resource_key }}"
- mkdir -p "$target_dir"
- cp "$source_path" "$target_dir/$binary_name"
-
- - name: Upload build artifacts
- uses: actions/upload-artifact@v7
- with:
- name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
- path: release-publish/*
- if-no-files-found: error
-
- - name: Upload resource monitor
- uses: actions/upload-artifact@v7
- with:
- name: resource-monitor-${{ matrix.resource_key }}
- path: resource-monitor-publish/${{ matrix.resource_key }}/*
- if-no-files-found: error
-
- publish_cli:
- name: Publish CLI to npm
- needs: [preflight, relay_public_config, quality, build]
- if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.build.result == 'success' }}
- runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- permissions:
- contents: read
- id-token: write
- env:
- T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
- T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
- T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
- T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=t3...
- - --filter=@t3tools/web...
- - --filter=@t3tools/scripts...
-
- - name: Download relay client tracing config
- uses: actions/download-artifact@v8
- with:
- name: relay-client-tracing-config
- path: ${{ runner.temp }}/relay-client-tracing
-
- - name: Load relay client tracing config
- shell: bash
- run: |
- config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
- tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
- echo "::add-mask::$tracing_token"
- cat "$config_path" >> "$GITHUB_ENV"
-
- - name: Align package versions to release version
- run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
-
- # The t3 build task depends on @t3tools/web#build, so the web client is
- # built (once) as part of this step.
- - name: Build CLI package
- run: vp run --filter t3 build
-
- - name: Download resource monitors
- uses: actions/download-artifact@v8
- with:
- pattern: resource-monitor-*
- path: ${{ runner.temp }}/resource-monitors
-
- - name: Bundle resource monitors into CLI package
- shell: bash
- run: |
- set -euo pipefail
- for artifact_dir in "$RUNNER_TEMP"/resource-monitors/resource-monitor-*; do
- resource_key="${artifact_dir##*/resource-monitor-}"
- target_dir="apps/server/dist/resource-monitor/${resource_key}"
- mkdir -p "$target_dir"
- cp "$artifact_dir"/t3-resource-monitor* "$target_dir/"
- chmod +x "$target_dir"/t3-resource-monitor 2>/dev/null || true
- done
-
- - name: Publish CLI package
- run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
-
- release:
- name: Publish GitHub Release
- needs: [preflight, build, publish_cli]
- if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' && needs.publish_cli.result == 'success' }}
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 30
- permissions:
- contents: write
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
-
- - name: Download all desktop artifacts
- uses: actions/download-artifact@v8
- with:
- pattern: desktop-*
- merge-multiple: true
- path: release-assets
-
- - name: Merge macOS updater manifests
- run: |
- shopt -s nullglob
- for x64_manifest in release-assets/*-mac-x64.yml; do
- arm64_manifest="${x64_manifest%-x64.yml}.yml"
- if [[ -f "$arm64_manifest" ]]; then
- node scripts/merge-update-manifests.ts --platform mac "$arm64_manifest" "$x64_manifest"
- rm -f "$x64_manifest"
- fi
- done
-
- # - name: Merge Windows updater manifests
- # run: |
- # shopt -s nullglob
- # found_windows_manifest=false
- # for x64_manifest in release-assets/*-win-x64.yml; do
- # if [[ "$(basename "$x64_manifest")" == builder-debug-* ]]; then
- # continue
- # fi
-
- # arm64_manifest="${x64_manifest/-x64.yml/-arm64.yml}"
- # output_manifest="${x64_manifest/-win-x64.yml/.yml}"
- # if [[ ! -f "$arm64_manifest" ]]; then
- # echo "Missing matching arm64 Windows manifest for $x64_manifest" >&2
- # exit 1
- # fi
-
- # found_windows_manifest=true
- # node scripts/merge-update-manifests.ts --platform win \
- # "$arm64_manifest" \
- # "$x64_manifest" \
- # "$output_manifest"
- # rm -f "$arm64_manifest" "$x64_manifest"
- # done
-
- # if [[ "$found_windows_manifest" != true ]]; then
- # echo "No Windows updater manifests found to merge." >&2
- # exit 1
- # fi
-
- - name: Publish release
- if: needs.preflight.outputs.previous_tag != ''
- uses: softprops/action-gh-release@v3
- with:
- tag_name: ${{ needs.preflight.outputs.tag }}
- target_commitish: ${{ needs.preflight.outputs.ref }}
- name: ${{ needs.preflight.outputs.release_name }}
- generate_release_notes: true
- previous_tag: ${{ needs.preflight.outputs.previous_tag }}
- prerelease: ${{ needs.preflight.outputs.is_prerelease }}
- make_latest: ${{ needs.preflight.outputs.make_latest }}
- files: |
- release-assets/*.dmg
- release-assets/*.zip
- release-assets/*.AppImage
- release-assets/*.exe
- release-assets/*.blockmap
- release-assets/*.yml
- fail_on_unmatched_files: true
- token: ${{ github.token }}
-
- - name: Publish first release
- if: needs.preflight.outputs.previous_tag == ''
- uses: softprops/action-gh-release@v3
- with:
- tag_name: ${{ needs.preflight.outputs.tag }}
- target_commitish: ${{ needs.preflight.outputs.ref }}
- name: ${{ needs.preflight.outputs.release_name }}
- generate_release_notes: true
- prerelease: ${{ needs.preflight.outputs.is_prerelease }}
- make_latest: ${{ needs.preflight.outputs.make_latest }}
- files: |
- release-assets/*.dmg
- release-assets/*.zip
- release-assets/*.AppImage
- release-assets/*.exe
- release-assets/*.blockmap
- release-assets/*.yml
- fail_on_unmatched_files: true
- token: ${{ github.token }}
-
- publish_aur:
- name: Publish AUR package
- needs: [preflight, release]
- if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
- uses: ./.github/workflows/publish-aur.yml
- with:
- release_tag: ${{ needs.preflight.outputs.tag }}
- secrets:
- AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
-
- 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' }}
- runs-on: blacksmith-8vcpu-ubuntu-2404
- timeout-minutes: 10
- env:
- T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
- T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
- T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
- T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
- VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
- VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
- VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
- T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
- T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
- VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
- - --filter=@t3tools/web...
-
- - name: Download relay client tracing config
- uses: actions/download-artifact@v8
- with:
- name: relay-client-tracing-config
- path: ${{ runner.temp }}/relay-client-tracing
-
- - name: Load relay client tracing config
- shell: bash
- run: |
- config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
- tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
- echo "::add-mask::$tracing_token"
- cat "$config_path" >> "$GITHUB_ENV"
-
- - name: Align package versions to release version
- run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
-
- - name: Refresh release lockfile
- run: vp install --lockfile-only --ignore-scripts
-
- - name: Deploy and alias channel
- shell: bash
- run: |
- set -euo pipefail
-
- if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
- echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
- exit 1
- fi
-
- router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
- latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
- nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
- router_domain="${router_url#http://}"
- router_domain="${router_domain#https://}"
- router_domain="${router_domain%%/*}"
-
- if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
- channel_domain="$latest_domain"
- channel_name="latest"
- else
- channel_domain="$nightly_domain"
- channel_name="nightly"
- fi
-
- vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
- vercel_scope_args=(--scope "$vercel_scope")
-
- echo "Deploying hosted web app for $channel_name channel."
- deployment_url="$(
- vp dlx [email protected] deploy \
- --archive=tgz \
- --prod \
- --skip-domain \
- --yes \
- --token "$VERCEL_TOKEN" \
- "${vercel_scope_args[@]}" \
- --build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
- --build-env "T3CODE_CLERK_PUBLISHABLE_KEY=${T3CODE_CLERK_PUBLISHABLE_KEY:-}" \
- --build-env "T3CODE_CLERK_JWT_TEMPLATE=${T3CODE_CLERK_JWT_TEMPLATE:-}" \
- --build-env "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=${T3CODE_CLERK_CLI_OAUTH_CLIENT_ID:-}" \
- --build-env "T3CODE_RELAY_URL=${T3CODE_RELAY_URL:-}" \
- --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=${T3CODE_RELAY_CLIENT_OTLP_TRACES_URL:-}" \
- --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=${T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET:-}" \
- --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=${T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN:-}" \
- --build-env "VITE_HOSTED_APP_URL=$router_url" \
- --build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
- )"
-
- echo "Aliasing $deployment_url to $channel_domain."
- vp dlx [email protected] alias set "$deployment_url" "$channel_domain" \
- --token "$VERCEL_TOKEN" \
- "${vercel_scope_args[@]}"
-
- if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
- echo "Aliasing $deployment_url to router domain $router_domain."
- vp dlx [email protected] alias set "$deployment_url" "$router_domain" \
- --token "$VERCEL_TOKEN" \
- "${vercel_scope_args[@]}"
- fi
-
- 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
- timeout-minutes: 10
- steps:
- - id: app_token
- name: Mint release app token
- uses: actions/create-github-app-token@v2
- with:
- app-id: ${{ secrets.RELEASE_APP_ID }}
- private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- owner: ${{ github.repository_owner }}
-
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: main
- fetch-depth: 0
- token: ${{ steps.app_token.outputs.token }}
- persist-credentials: true
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - id: app_bot
- name: Resolve GitHub App bot identity
- env:
- GH_TOKEN: ${{ steps.app_token.outputs.token }}
- APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
- run: |
- user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
- echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
- echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
- - --filter=@t3tools/oxlint-plugin-t3code...
-
- - id: update_versions
- name: Update version strings
- env:
- RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
- run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
-
- - name: Format package.json files
- if: steps.update_versions.outputs.changed == 'true'
- run: vp fmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
-
- - name: Refresh lockfile
- if: steps.update_versions.outputs.changed == 'true'
- run: vp install --lockfile-only --ignore-scripts
-
- - name: Commit and push version bump
- if: steps.update_versions.outputs.changed == 'true'
- shell: bash
- env:
- RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
- run: |
- if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml; then
- echo "No version changes to commit."
- exit 0
- fi
-
- git config user.name "${{ steps.app_bot.outputs.name }}"
- git config user.email "${{ steps.app_bot.outputs.email }}"
-
- git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml
- git commit -m "chore(release): prepare $RELEASE_TAG"
- git push origin HEAD:main
-
- announce_discord:
- name: Announce release on Discord
- if: |
- always() && !cancelled() &&
- needs.preflight.result == 'success' &&
- 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
- timeout-minutes: 10
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ needs.preflight.outputs.ref }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
-
- - name: Announce prerelease on Discord
- if: needs.preflight.outputs.is_prerelease == 'true'
- continue-on-error: true
- env:
- DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_NIGHTLY_ROLE_ID }}
- DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
- run: |
- node scripts/notify-discord-release.ts prerelease \
- --role-id "$DISCORD_MENTION_ROLE_ID" \
- --release-name "${{ needs.preflight.outputs.release_name }}" \
- --release-version "${{ needs.preflight.outputs.version }}" \
- --tag "${{ needs.preflight.outputs.tag }}" \
- --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
-
- - name: Announce latest release on Discord
- if: needs.preflight.outputs.make_latest == 'true'
- continue-on-error: true
- env:
- DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_LATEST_ROLE_ID }}
- DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
- run: |
- node scripts/notify-discord-release.ts latest \
- --role-id "$DISCORD_MENTION_ROLE_ID" \
- --release-name "${{ needs.preflight.outputs.release_name }}" \
- --release-version "${{ needs.preflight.outputs.version }}" \
- --tag "${{ needs.preflight.outputs.tag }}" \
- --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
diff --git a/.github/workflows/thread-transfer-report.yml b/.github/workflows/thread-transfer-report.yml
deleted file mode 100644
index 23eec7292..000000000
--- a/.github/workflows/thread-transfer-report.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Thread Transfer Report
-
-on:
- workflow_run:
- workflows: [CI]
- types: [completed]
-
-permissions:
- actions: read
- contents: read
- pull-requests: write
-
-jobs:
- publish:
- name: Publish PR comment
- if: github.event.workflow_run.event == 'pull_request'
- runs-on: ubuntu-24.04
- concurrency:
- group: thread-transfer-report-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.id }}
- cancel-in-progress: true
- steps:
- # workflow_run has a write-capable token even for fork PRs. Only load the
- # publisher from the trusted default branch and never execute PR code.
- - name: Checkout trusted publisher
- uses: actions/checkout@v6
- with:
- ref: ${{ github.event.repository.default_branch }}
- sparse-checkout: .github/scripts
-
- - name: Test trusted publisher
- run: node --test .github/scripts/thread-transfer-report.test.cjs
-
- - id: resolve
- name: Resolve PR and baseline artifacts
- uses: actions/github-script@v8
- with:
- script: |
- const reporter = require("./.github/scripts/thread-transfer-report.cjs");
- await reporter.resolve({ github, context, core });
-
- - name: Download PR result
- if: steps.resolve.outputs.publish == 'true' && steps.resolve.outputs.pr_artifact == 'true'
- uses: actions/download-artifact@v8
- with:
- name: thread-transfer-results
- path: ${{ runner.temp }}/thread-transfer/pr
- github-token: ${{ secrets.GITHUB_TOKEN }}
- run-id: ${{ steps.resolve.outputs.pr_run_id }}
-
- - name: Download main baseline
- if: steps.resolve.outputs.publish == 'true' && steps.resolve.outputs.baseline_artifact == 'true'
- uses: actions/download-artifact@v8
- with:
- name: thread-transfer-results
- path: ${{ runner.temp }}/thread-transfer/main
- github-token: ${{ secrets.GITHUB_TOKEN }}
- run-id: ${{ steps.resolve.outputs.baseline_run_id }}
-
- - name: Update thread transfer comment
- if: steps.resolve.outputs.publish == 'true'
- uses: actions/github-script@v8
- env:
- PR_NUMBER: ${{ steps.resolve.outputs.pull_number }}
- PR_SHA: ${{ steps.resolve.outputs.pr_sha }}
- PR_CONCLUSION: ${{ steps.resolve.outputs.pr_conclusion }}
- PR_RUN_ID: ${{ steps.resolve.outputs.pr_run_id }}
- PR_RESULT_DIR: ${{ runner.temp }}/thread-transfer/pr
- BASELINE_SHA: ${{ steps.resolve.outputs.baseline_sha }}
- BASELINE_MATCHES_BASE: ${{ steps.resolve.outputs.baseline_matches_base }}
- BASELINE_RUN_ID: ${{ steps.resolve.outputs.baseline_run_id }}
- BASELINE_RESULT_DIR: ${{ runner.temp }}/thread-transfer/main
- with:
- script: |
- const reporter = require("./.github/scripts/thread-transfer-report.cjs");
- await reporter.publish({ github, context, core });
diff --git a/.github/workflows/web-preview.yml b/.github/workflows/web-preview.yml
deleted file mode 100644
index f9cc3b063..000000000
--- a/.github/workflows/web-preview.yml
+++ /dev/null
@@ -1,132 +0,0 @@
-name: Web Preview
-
-# Label a PR `preview:web` to get a hosted-web preview deployment on Vercel for
-# that push and every subsequent push. The deployment is a plain (non-prod,
-# non-aliased) deploy into the existing hosted-web Vercel project, so the
-# latest/nightly channel aliases are never touched.
-#
-# The build intentionally omits the T3 Connect cloud config (Clerk keys, relay
-# URL): previews boot as the hosted-static app with manual pairing only. Pair a
-# server into a preview with `t3 pair --tailscale` (or any reachable HTTPS
-# backend) and open the pairing URL against the preview origin.
-#
-# The preview must be opened at the exact deployment URL from the PR comment.
-# Vite bakes that URL in as the hosted origin (via VERCEL_URL), and
-# `isHostedStaticApp` matches on origin, so branch-alias URLs will not
-# self-identify as the hosted app.
-
-on:
- pull_request:
- types: [labeled, synchronize, reopened]
-
-permissions:
- contents: read
- pull-requests: write
-
-concurrency:
- group: web-preview-${{ github.event.pull_request.number }}
- cancel-in-progress: true
-
-jobs:
- deploy:
- name: Deploy web preview
- # Same-repo PRs only: fork PRs do not receive the Vercel secrets, and this
- # 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
- timeout-minutes: 10
- env:
- VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
- VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
- VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
- steps:
- - name: Checkout
- uses: actions/checkout@v6
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- sparse-checkout: |
- /*
- !/.repos/
- sparse-checkout-cone-mode: false
-
- - name: Setup Vite+
- uses: voidzero-dev/setup-vp@v1
- with:
- node-version-file: package.json
- cache: true
- run-install: |
- args:
- - --filter=@t3tools/scripts...
- - --filter=@t3tools/web...
-
- - id: deploy
- name: Deploy preview
- shell: bash
- run: |
- set -euo pipefail
-
- if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
- echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
- exit 1
- fi
-
- vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
-
- deployment_url="$(
- vp dlx [email protected] deploy \
- --archive=tgz \
- --yes \
- --token "$VERCEL_TOKEN" \
- --scope "$vercel_scope"
- )"
-
- echo "Deployed $deployment_url"
- echo "deployment_url=$deployment_url" >> "$GITHUB_OUTPUT"
-
- - name: Comment deployment URL
- uses: actions/github-script@v8
- env:
- DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment_url }}
- HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- with:
- script: |
- const marker = "<!-- web-preview-deploy -->";
- const body = [
- marker,
- "### Web preview",
- "",
- `${process.env.DEPLOYMENT_URL} (for ${process.env.HEAD_SHA.slice(0, 7)})`,
- "",
- "Open this exact URL — the hosted-app origin is baked in at build time.",
- "Pair a server into it with `t3 pair --tailscale`, or paste a host + pairing",
- "code under Settings → Connections.",
- ].join("\n");
-
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- per_page: 100,
- });
- const existing = comments.find((comment) => comment.body?.includes(marker));
-
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.payload.pull_request.number,
- body,
- });
- }
diff --git a/apps/desktop/scripts/electron-launcher.mjs b/apps/desktop/scripts/electron-launcher.mjs
index f5e14f167..5d9a86093 100644
--- a/apps/desktop/scripts/electron-launcher.mjs
+++ b/apps/desktop/scripts/electron-launcher.mjs
@@ -17,8 +17,8 @@ const devBundleIdSuffix = NodePath.basename(repoRoot)
.replaceAll(/[^a-z0-9]+/g, "");
export const APP_DISPLAY_NAME = isDevelopment ? "Akeru Bot (Dev)" : "Akeru Bot (Alpha)";
export const APP_BUNDLE_ID = isDevelopment
- ? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}`
- : "com.t3tools.t3code";
+ ? `dev.leodoes.akeru.dev.${devBundleIdSuffix || "local"}`
+ : "dev.leodoes.akeru";
const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"];
const LAUNCHER_VERSION = 15;
const developmentMacIconPngPath = NodePath.join(
diff --git a/apps/desktop/scripts/electron-launcher.test.mjs b/apps/desktop/scripts/electron-launcher.test.mjs
index 5c1852991..8d853d6a4 100644
--- a/apps/desktop/scripts/electron-launcher.test.mjs
+++ b/apps/desktop/scripts/electron-launcher.test.mjs
@@ -1,6 +1,7 @@
import { assert, describe, it } from "vite-plus/test";
import {
+ APP_BUNDLE_ID,
makeDevelopmentLauncherScript,
resolveElectronBinaryPath,
resolveMacLauncherIconPaths,
@@ -8,6 +9,10 @@ import {
} from "./electron-launcher.mjs";
describe("electron development launcher", () => {
+ it("uses the Akeru desktop bundle identifier", () => {
+ assert.equal(APP_BUNDLE_ID, "dev.leodoes.akeru");
+ });
+
it("uses captured values only as fallbacks for a live runner environment", () => {
const script = makeDevelopmentLauncherScript({
electronBinaryPath: "/repo/node_modules/electron/Electron",
diff --git a/apps/desktop/src/app/DesktopEnvironment.test.ts b/apps/desktop/src/app/DesktopEnvironment.test.ts
index cf0a0a0e8..a3a9ef2ec 100644
--- a/apps/desktop/src/app/DesktopEnvironment.test.ts
+++ b/apps/desktop/src/app/DesktopEnvironment.test.ts
@@ -68,7 +68,7 @@ describe("DesktopEnvironment", () => {
assert.equal(environment.serverRoot, "/repo");
assert.equal(environment.backendEntryPath, "/repo/apps/server/dist/bin.mjs");
assert.equal(environment.backendCwd, "/repo");
- assert.equal(environment.appUserModelId, "com.t3tools.t3code.dev");
+ assert.equal(environment.appUserModelId, "dev.leodoes.akeru.dev");
assert.equal(environment.linuxWmClass, "t3code-dev");
assert.deepEqual(
Option.map(environment.devServerUrl, (url) => url.href),
@@ -96,6 +96,7 @@ describe("DesktopEnvironment", () => {
assert.equal(environment.logDir, "/tmp/t3/userdata/logs");
assert.equal(environment.browserArtifactsDir, "/tmp/t3/userdata/browser-artifacts");
assert.equal(environment.serverSettingsPath, "/tmp/t3/userdata/settings.json");
+ assert.equal(environment.appUserModelId, "dev.leodoes.akeru");
}),
);
@@ -158,12 +159,12 @@ describe("DesktopEnvironment", () => {
const environment = yield* makeEnvironment(
{},
{
- T3CODE_DESKTOP_APP_USER_MODEL_ID: " com.t3tools.t3code.dev.local ",
+ T3CODE_DESKTOP_APP_USER_MODEL_ID: " dev.leodoes.akeru.dev.local ",
VITE_DEV_SERVER_URL: "http://localhost:5173",
},
);
- assert.equal(environment.appUserModelId, "com.t3tools.t3code.dev.local");
+ assert.equal(environment.appUserModelId, "dev.leodoes.akeru.dev.local");
}),
);
diff --git a/apps/desktop/src/app/DesktopEnvironment.ts b/apps/desktop/src/app/DesktopEnvironment.ts
index 6a1135817..49dbf1d1d 100644
--- a/apps/desktop/src/app/DesktopEnvironment.ts
+++ b/apps/desktop/src/app/DesktopEnvironment.ts
@@ -224,7 +224,7 @@ const make = Effect.fn("desktop.environment.make")(function* (
branding,
displayName,
appUserModelId: Option.getOrElse(config.appUserModelIdOverride, () =>
- isDevelopment ? "com.t3tools.t3code.dev" : "com.t3tools.t3code",
+ isDevelopment ? "dev.leodoes.akeru.dev" : "dev.leodoes.akeru",
),
linuxDesktopEntryName: isDevelopment ? "t3code-dev.desktop" : "t3code.desktop",
linuxWmClass: isDevelopment ? "t3code-dev" : "t3code",
diff --git a/apps/desktop/src/settings/DesktopClientSettings.test.ts b/apps/desktop/src/settings/DesktopClientSettings.test.ts
index 11030fcc5..314d52365 100644
--- a/apps/desktop/src/settings/DesktopClientSettings.test.ts
+++ b/apps/desktop/src/settings/DesktopClientSettings.test.ts
@@ -49,6 +49,7 @@ const clientSettings: ClientSettings = {
sidebarThreadPreviewCount: 6,
legacySidebarEnabled: false,
timestampFormat: "24-hour",
+ usageRefreshMinutes: 5,
wordWrap: true,
};
diff --git a/apps/mobile/src/features/archive/archivedThreadList.test.ts b/apps/mobile/src/features/archive/archivedThreadList.test.ts
index 697d13e7c..5ebedfb34 100644
--- a/apps/mobile/src/features/archive/archivedThreadList.test.ts
+++ b/apps/mobile/src/features/archive/archivedThreadList.test.ts
@@ -57,6 +57,8 @@ function makeSnapshot(
snapshotSequence: 1,
projects,
threads,
+ bots: [],
+ groups: [],
updatedAt: "2026-06-04T00:00:00.000Z",
},
};
diff --git a/apps/server/package.json b/apps/server/package.json
index a3bc45048..37737bfd6 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -31,7 +31,7 @@
"@mastra/code-sdk": "1.5.1",
"@mastra/core": "1.63.0",
"@opencode-ai/sdk": "^1.3.15",
- "@opencoredev/sandbox-sdk": "file:../../../sandbox-sdk/packages/sdk",
+ "@opencoredev/sandbox-sdk": "0.2.0",
"@pierre/diffs": "catalog:",
"@upstash/box": "0.5.3",
"@vercel/sandbox": "^2.5.0",
diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
index 843b5c450..a90f70573 100644
--- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
+++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
@@ -3227,7 +3227,7 @@ describe("ProviderCommandReactor", () => {
),
);
- await Effect.runPromise(
+ await harness.runEffect(
harness.engine.dispatch({
type: "thread.session.set",
commandId: CommandId.make("cmd-session-set-for-user-input-error"),
@@ -3245,7 +3245,7 @@ describe("ProviderCommandReactor", () => {
}),
);
- await Effect.runPromise(
+ await harness.runEffect(
harness.engine.dispatch({
type: "thread.activity.append",
commandId: CommandId.make("cmd-user-input-requested"),
@@ -3278,7 +3278,7 @@ describe("ProviderCommandReactor", () => {
}),
);
- await Effect.runPromise(
+ await harness.runEffect(
harness.engine.dispatch({
type: "thread.user-input.respond",
commandId: CommandId.make("cmd-user-input-respond-stale"),
diff --git a/apps/server/src/voiceCall/VoiceCallManager.ts b/apps/server/src/voiceCall/VoiceCallManager.ts
index 8ba713fca..06bef44bf 100644
--- a/apps/server/src/voiceCall/VoiceCallManager.ts
+++ b/apps/server/src/voiceCall/VoiceCallManager.ts
@@ -1,6 +1,6 @@
// @effect-diagnostics globalFetch:off nodeBuiltinImport:off
import * as NodeCrypto from "node:crypto";
-import * as NodeFS from "node:fs/promises";
+import * as NodeFSP from "node:fs/promises";
import * as NodeOS from "node:os";
import * as NodePath from "node:path";
@@ -45,6 +45,7 @@ const CodexCliAuth = Schema.Struct({
account_id: TrimmedNonEmptyString,
}),
});
+const decodeCodexCliAuth = Schema.decodeUnknownSync(CodexCliAuth);
interface ChatGptRealtimeSession {
readonly negotiate: (input: {
@@ -71,7 +72,7 @@ export function parseCodexCliAuth(
encoded: string,
): { readonly accessToken: string; readonly accountId: string } | undefined {
try {
- const decoded = Schema.decodeUnknownSync(CodexCliAuth)(JSON.parse(encoded));
+ const decoded = decodeCodexCliAuth(JSON.parse(encoded));
return { accessToken: decoded.tokens.access_token, accountId: decoded.tokens.account_id };
} catch {
return undefined;
@@ -82,7 +83,7 @@ async function getCodexCliCredential(): Promise<
{ readonly accessToken: string; readonly accountId: string } | undefined
> {
try {
- const encoded = await NodeFS.readFile(
+ const encoded = await NodeFSP.readFile(
NodePath.join(NodeOS.homedir(), ".codex", "auth.json"),
"utf8",
);
diff --git a/apps/web/src/components/plugins/pluginPresentation.test.ts b/apps/web/src/components/plugins/pluginPresentation.test.ts
index 2736564b7..af908cb65 100644
--- a/apps/web/src/components/plugins/pluginPresentation.test.ts
+++ b/apps/web/src/components/plugins/pluginPresentation.test.ts
@@ -9,18 +9,25 @@ import {
const catalog = loadCatalog();
describe("plugin presentation", () => {
- it("builds a featured directory with the two focused categories", () => {
+ it("builds a featured directory with the available categories", () => {
const sections = buildPluginSections({ plugins: catalog, query: "", filter: "All" });
expect(sections[0]?.title).toBe("Featured");
expect(sections[0]?.plugins.map((plugin) => plugin.id)).toEqual([
"context",
"exa",
+ "executor",
"firecrawl",
"parallel-search",
]);
expect(sections.some((section) => section.title === "Data Extraction")).toBe(true);
expect(sections.some((section) => section.title === "Search")).toBe(true);
- expect(PLUGIN_FILTERS).toEqual(["All", "Featured", "Data Extraction", "Search"]);
+ expect(PLUGIN_FILTERS).toEqual([
+ "All",
+ "Featured",
+ "Data Extraction",
+ "Search",
+ "Productivity",
+ ]);
});
it("builds a single searchable installed section", () => {
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 549744bac..f3a9b8ab1 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -1,4 +1,4 @@
-import * as NodeUrl from "node:url";
+import * as NodeURL from "node:url";
import * as NodeZlib from "node:zlib";
import tailwindcss from "@tailwindcss/vite";
@@ -15,7 +15,7 @@ import { DEV_PROXIED_PATH_PREFIXES } from "@t3tools/shared/devProxy";
import { loadRepoEnv } from "../../scripts/lib/public-config";
-const reactGrabEntry = NodeUrl.fileURLToPath(import.meta.resolve("react-grab"));
+const reactGrabEntry = NodeURL.fileURLToPath(import.meta.resolve("react-grab"));
const repoEnv = loadRepoEnv();
Object.assign(process.env, repoEnv);
diff --git a/docs/internals/ci.md b/docs/internals/ci.md
index bb38fd79a..2ebe29406 100644
--- a/docs/internals/ci.md
+++ b/docs/internals/ci.md
@@ -1,30 +1,29 @@
# CI quality gates
-> For maintainers. Using T3 Code? See [docs/user](../user/).
+> For Akeru Bot maintainers.
-[`.github/workflows/ci.yml`](../../.github/workflows/ci.yml) runs these quality gates on pull requests
-and pushes to `main`:
+[`.depot/workflows/ci.yml`](../../.depot/workflows/ci.yml) runs on pull requests and pushes to `main`.
+All jobs use Depot CI on the 8-vCPU `depot-ubuntu-24.04-8` runner.
+Issue-label, PR-vouch, and PR-size jobs stay in GitHub Actions on `ubuntu-24.04` because they write GitHub issue and pull-request labels.
-- **Check**: `vp check` (format and lint; this repo sets `typeCheck: false` in its lint options),
- then `vpr typecheck` for the workspace type check. The same job
- builds the desktop pipeline (`vp run build:desktop`) and verifies the preload bundle exists and
- still exports its expected symbols.
-- **Test**: `vp run test` across the workspace.
-- **Mobile Native Static Analysis**: `vp run lint:mobile` on macOS, wrapping
- `scripts/mobile-native-static-check.ts`. A cheap Linux **Mobile Native Changes** job gates it:
- the macOS runner only boots when the diff touches `apps/mobile` Swift/Kotlin sources, the
- SwiftLint/detekt/ktlint configuration, the `Brewfile`, the check script, the root `package.json`
- that defines `lint:mobile`, or `ci.yml`. Otherwise the job is skipped, which GitHub reports as
- success for the required check. Renames are matched on both their old and new path. The gate fails
- open in every other case: if the changed-file list cannot be resolved, GitHub truncates it, or the
- gate job itself fails, the lint runs.
-- **Release Smoke**: exercises release-only workflow steps through `scripts/release-smoke.ts`, so
- release breakage surfaces on PRs rather than at tag time.
+- **Public dependency install.** The job rejects `file:` and `link:` dependencies that resolve
+ outside the repository, then runs `vp install --frozen-lockfile`.
+- **Lint, types, and builds.** The job checks lint and formatting, runs workspace type checks,
+ builds the desktop pipeline, checks the preload output, and builds the marketing site.
+- **Focused tests.** Separate jobs run the shipped desktop and shared-package tests, the sharded
+ server tests, and the resource-monitor tests. Relay and mobile-production packages are excluded.
+ The server shards exclude `orchestrationEngine.integration.test.ts` until the executor stack
+ restores its test adapter and stops the fixture from calling OpenAI with a test credential.
+- **Release smoke.** `scripts/release-smoke.ts` checks the public dependency rule, the supported
+ artifact matrix, Akeru naming, and the absence of retired publishing and deployment paths.
-`.github/workflows/release.yml` builds macOS (`arm64` and `x64`), Linux (`x64`), and Windows (`x64`)
-desktop artifacts from a single `v*.*.*` tag and publishes one GitHub release. It auto-enables
-signing only when platform credentials are present. macOS passkey builds additionally require
-`APPLE_TEAM_ID` and the `MACOS_PROVISIONING_PROFILE` secret; Windows uses Azure Trusted Signing.
-Without the core signing credentials, it still releases unsigned artifacts.
+[`.depot/workflows/release.yml`](../../.depot/workflows/release.yml) is a manual, non-publishing
+artifact smoke workflow. It uses 8-vCPU Depot runners for Linux and Windows, plus Apple Silicon
+macOS. It builds a Developer ID signed macOS arm64 app. Electron-builder notarizes and staples the
+app before it packages the DMG. The workflow then submits and staples the DMG as a separate object.
+It checks both objects with Apple's verification tools. Windows and Linux artifacts stay unsigned.
+The workflow also builds and dry-runs the CLI package and checks the marketing site. It uploads
+desktop artifacts for seven days. It does not create a GitHub release, publish a package, or deploy
+a site.
-See [Release Checklist](../operations/release.md) for the full release/signing setup checklist.
+See the [release smoke runbook](../operations/release.md) for the exact validation path.
diff --git a/docs/internals/scripts.md b/docs/internals/scripts.md
index b6cb01493..eb7fc355d 100644
--- a/docs/internals/scripts.md
+++ b/docs/internals/scripts.md
@@ -91,9 +91,8 @@ authenticated.
launch.
- To keep staging files for debugging package contents, run: `vp run dist:desktop:dmg --keep-stage`
- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
-- Signed macOS builds also require `T3CODE_APPLE_TEAM_ID` and
- `T3CODE_MACOS_PROVISIONING_PROFILE`. The passkey RP domain is derived from
- `T3CODE_CLERK_PUBLISHABLE_KEY` unless `T3CODE_CLERK_PASSKEY_RP_DOMAINS` overrides it.
+- Signed macOS CI builds use the Developer ID certificate and App Store Connect API secrets
+ documented in `docs/operations/release.md`.
- Windows `--signed` uses Azure Trusted Signing and expects:
`AZURE_TRUSTED_SIGNING_ENDPOINT`, `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`,
`AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`, and `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`.
diff --git a/docs/operations/release.md b/docs/operations/release.md
index 68f2e8da5..ff2e5da20 100644
--- a/docs/operations/release.md
+++ b/docs/operations/release.md
@@ -1,386 +1,75 @@
-# Release Checklist
+# Release smoke runbook
-> For maintainers. Using T3 Code? See [docs/user](../user/).
+> For Akeru Bot maintainers.
-This document covers the unified release workflow for stable and nightly desktop releases.
+`.depot/workflows/release.yml` validates release inputs without publishing or releasing anything.
+Dispatch it from Depot with a version such as `0.0.0-smoke.0`.
-## What the workflow does
+## What it checks
-- Workflow: `.github/workflows/release.yml`
-- Triggers:
- - push tag matching `v*.*.*` for stable releases
- - scheduled nightly check every three hours
- - manual `workflow_dispatch` for either channel
-- Runs lint, typecheck, and tests alongside artifact builds. Publishing waits for every check.
-- Reads the shared production T3 Connect relay URL and Clerk client configuration before packaging clients.
-- Builds four artifacts in parallel for both channels:
- - macOS `arm64` DMG
- - macOS `x64` DMG
- - Linux `x64` AppImage
- - Windows `x64` NSIS installer
-- Publishes one GitHub Release with all produced files.
- - Stable tags with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
- - Only plain stable `X.Y.Z` releases are marked as the repository's latest release.
- - Nightly runs are always GitHub prereleases and never marked latest.
- - Automatically generated release notes are pinned to the previous tag in the same channel, so stable compares to the previous stable tag and nightly compares to the previous nightly tag.
-- Includes Electron auto-update metadata (for example `latest*.yml`, `nightly*.yml`, and `*.blockmap`) in release assets.
-- Publishes the CLI package (`apps/server`, npm package `t3`) with OIDC trusted publishing from the same workflow file:
- - stable releases publish npm dist-tag `latest`
- - nightly releases publish npm dist-tag `nightly`
-- Deploys the hosted web app to Vercel only after a release is published:
- - stable releases are aliased to the `latest` hosted app channel
- - nightly releases are aliased to the `nightly` hosted app channel
-- Signing is optional and auto-detected per platform from secrets.
+- Public dependencies install from the committed lockfile. No dependency may resolve through a
+ local path outside the repository.
+- The release configuration passes `scripts/release-smoke.ts`.
+- macOS builds one arm64 DMG with the `dev.leodoes.akeru` bundle identifier.
+- The macOS app uses a Developer ID Application certificate. Electron-builder submits and staples
+ the app before it packages the DMG. The workflow submits and staples the DMG separately.
+- Signed apps always include the Electron hardened-runtime and microphone entitlements. Associated
+ Domains entitlements are added only when a Clerk passkey configuration is present.
+- The workflow staples and validates the notarization tickets, then runs `codesign` and `spctl`.
+- Windows builds one unsigned x64 NSIS installer.
+- Linux builds one unsigned x64 AppImage.
+- The CLI build includes the web client, then completes a package publish dry-run.
+- The marketing site passes its type check and production build.
-## Required release credentials
+Each desktop job uploads its artifact to the workflow run for seven days. The workflow does not
+create tags, create GitHub releases, publish npm packages, deploy the relay, deploy a site, update
+AUR, or send release announcements.
-Stable releases require these GitHub Actions secrets in addition to the platform and deployment
-credentials documented below:
+## Depot setup
-- `RELEASE_APP_ID`
-- `RELEASE_APP_PRIVATE_KEY`
+CI and release smoke run on Depot CI. Code Access is already installed for `opencoredev/akeru-bot`.
+GitHub Actions no longer owns those jobs. All Depot jobs use a Depot runner label:
-The finalize job uses them to commit and push aligned package versions to `main` as the Release App.
-GitHub Release publication uses the repository-scoped workflow token so it has a rate-limit quota
-independent from the shared Release App installation.
+- Linux uses the 8-vCPU `depot-ubuntu-24.04-8` runner.
+- Windows uses the 8-vCPU `depot-windows-2025-8` runner.
+- macOS uses the Apple Silicon `depot-macos-15` image.
-## T3 Connect relay deployment
+## macOS secrets
-The relay is a shared control plane versioned separately from client releases. Stable and nightly
-client builds must point at the same relay so users see the same linked environments when switching
-release channels.
+Add these Depot CI secrets before running the workflow:
-`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. The
-release workflow reads the relay URL and Clerk client configuration from the existing `production`
-GitHub Actions environment before building desktop, CLI, or hosted web artifacts.
+- `MACOS_CERTIFICATE_P12` contains the base64-encoded `.p12` export of the Developer ID Application
+ certificate and its private key.
+- `MACOS_CERTIFICATE_PASSWORD` contains the `.p12` export password.
+- `MACOS_SIGNING_IDENTITY` contains the full certificate identity. It must start with
+ `Developer ID Application:`.
+- `APPSTORE_API_KEY_P8` contains the App Store Connect API private key text.
+- `APPSTORE_API_KEY_ID` contains the API key ID.
+- `APPSTORE_ISSUER_ID` contains the App Store Connect issuer ID.
-Required repository variables shared by relay deployments:
+The workflow writes the API private key to the temporary runner directory. It imports the
+certificate into an ephemeral keychain. Neither file enters an uploaded artifact.
-- `CLOUDFLARE_ACCOUNT_ID`
-- `PLANETSCALE_ORGANIZATION`
-- `AXIOM_ORG_ID`
+## Local checks
-Required repository secrets shared by relay deployments:
-
-- `CLOUDFLARE_API_TOKEN`
-- `PLANETSCALE_API_TOKEN_ID`
-- `PLANETSCALE_API_TOKEN`
-- `AXIOM_TOKEN`
-
-Required `production` environment variables:
-
-- `RELAY_API_ZONE_NAME`
-- `RELAY_TUNNEL_ZONE_NAME`
-- `CLERK_PUBLISHABLE_KEY`
-- `CLERK_JWT_AUDIENCE`
-- `CLERK_JWT_TEMPLATE`
-- `CLERK_CLI_OAUTH_CLIENT_ID`
-- `APNS_ENVIRONMENT`
-- `APNS_TEAM_ID`
-- `APNS_KEY_ID`
-- `APNS_BUNDLE_ID`
-
-Optional `production` environment variables:
-
-- `RELAY_DOMAIN` when overriding the derived `relay.<RELAY_API_ZONE_NAME>` domain
-
-Required `production` environment secrets:
-
-- `CLERK_SECRET_KEY`
-- `APNS_PRIVATE_KEY`
-
-The account-scoped repository credentials are consumed by Alchemy while provisioning relay stages; they
-are not bound into the relay Worker. The production deployment uses an Axiom personal access token,
-so `AXIOM_ORG_ID` must accompany `AXIOM_TOKEN`. The `prod` stage owns the retained PlanetScale
-database. Local personal stages provision isolated branches from it and are never deployed by CI.
-Production adopts the configured relay API and tunnel DNS zones as retained Cloudflare resources.
-Personal stages reference the production-owned zones.
-
-Developers deploy personal stages locally rather than through pull-request automation:
+Run the focused checks before using the manual workflow:
```sh
-vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local
+vp install --frozen-lockfile
+vp run check:public-dependencies
+vp test run scripts/check-public-dependencies.test.ts scripts/resolve-nightly-release.test.ts
+vp run release:smoke
+vp run build:desktop
+vp run --filter @t3tools/marketing typecheck
+vp run --filter @t3tools/marketing build
```
-## Hosted web app release deployment
-
-The hosted app is intentionally not deployed by Vercel's Git integration. The
-web project disables automatic Git deployments in `apps/web/vercel.ts` via
-`git.deploymentEnabled: false`, and `.github/workflows/release.yml` deploys the
-web app with Vercel CLI after the GitHub Release succeeds.
-
-Required GitHub Actions secrets:
-
-- `VERCEL_TOKEN`
-- `VERCEL_ORG_ID`
-- `VERCEL_PROJECT_ID`
-
-Optional GitHub Actions variables:
-
-- `VERCEL_TEAM_SLUG`: overrides the Vercel CLI scope when the team slug is preferred over the `VERCEL_ORG_ID` secret.
-- `T3CODE_WEB_ROUTER_URL`: defaults to `https://app.t3.codes`.
-- `T3CODE_WEB_LATEST_DOMAIN`: defaults to `latest.app.t3.codes`.
-- `T3CODE_WEB_NIGHTLY_DOMAIN`: defaults to `nightly.app.t3.codes`.
-
-Required Vercel domains:
-
-- `app.t3.codes`: the router domain users open, updated by stable releases.
-- `latest.app.t3.codes`: channel alias updated by stable releases.
-- `nightly.app.t3.codes`: channel alias updated by nightly releases.
-
-The router domain uses `apps/web/vercel.ts` routes. Users opt into a channel by
-visiting `/__t3code/channel?channel=latest` or
-`/__t3code/channel?channel=nightly`; the router stores the
-`t3code_web_channel` cookie and rewrites future requests on `app.t3.codes` to
-the matching channel alias.
-
-The release deploy job rewrites release package versions before upload so the
-hosted app's About panel renders the release version. Stable deploys alias the
-same deployment to both the `latest` channel and the router domain so the router
-rules stay current. Nightly deploys only alias the `nightly` channel. The job
-also passes `VITE_HOSTED_APP_CHANNEL=latest|nightly`, which renders the hosted
-update track selector in the About panel. Changing the selector navigates
-through `/__t3code/channel` on the router domain so the user's channel cookie is
-updated before redirecting to the hosted app root.
-
-One-time Vercel dashboard setup:
-
-1. Confirm the web project root directory remains `apps/web`.
-2. Add the three domains above to the web project.
-3. Disable automatic Git deployments in the dashboard if desired; the committed
- `vercel.ts` setting is the source-of-truth, but disconnecting Git in the
- dashboard is also safe.
-4. Run one stable release deployment, or manually alias the current stable
- deployment, so `app.t3.codes` points at a deployment containing the router
- rules in `apps/web/vercel.ts`. Future stable releases keep this alias current.
-
-## Nightly builds
-
-- Workflow: `.github/workflows/release.yml`
-- Triggers:
- - scheduled check every three hours
- - manual `workflow_dispatch` with `channel=nightly`
-- Runs the same desktop quality gates and artifact matrix as the tagged release flow.
-- Publishes a GitHub prerelease only:
- - current tag format: `vX.Y.Z-nightly.YYYYMMDD.<run_number>`
- - `nightly-v...` is accepted only as a legacy previous-nightly tag
- - release name includes the short commit SHA
- - `make_latest` is always `false`
-- Uses the next stable patch version as the nightly base. For example, `0.0.17` produces nightlies on `0.0.18-nightly.*`.
-- Publishes Electron auto-update metadata to the dedicated `nightly` updater channel, so desktop users can opt into that track independently from stable.
-- Publishes the CLI package (`apps/server`, npm package `t3`) to the `nightly` npm dist-tag using the same nightly version.
-- Does not commit version bumps back to `main`.
-
-## Server self-update release invariant
-
-Connected servers update to the client's exact version, not to an npm dist-tag. Every released
-desktop or hosted client version must therefore have a matching `t3@<version>` package available on
-npm before users can receive that client.
-
-The workflow enforces this ordering:
-
-1. `publish_cli` publishes the exact stable or nightly version to npm.
-2. `release` depends on `publish_cli` before exposing desktop artifacts in GitHub Releases.
-3. `deploy_web` depends on `release` before moving the hosted channel to the new client.
-
-Preserve these dependencies when changing the release graph. Publishing a client first would leave
-the **Update server** action targeting a package version that does not exist yet.
-
-For a release smoke test, confirm `npm view t3@<version> version` returns the expected version, then
-connect the new client to a server on the previous version and verify that the update action
-reconnects to the matching server. When the release adds database migrations, verify that the
-remote update applies them and reconnects. A failed trial must restore the database snapshot and
-restart the previous server. If the installed launcher does not support the target protocol,
-verify that the update stops before restart and run `npx t3@<version> service update` once on the
-server machine. Also test the manual or desktop-managed guidance when those environments are
-available.
-
-## Desktop auto-update notes
-
-- Updater runtime: `apps/desktop/src/updates/DesktopUpdates.ts`.
-- `electron-updater` adapter: `apps/desktop/src/electron/ElectronUpdater.ts`.
-- `apps/desktop/src/main.ts` only wires the updater layers into the desktop runtime.
-- Update UX:
- - Background checks run on startup delay + interval.
- - No automatic download or install.
- - The desktop UI shows a rocket update button when an update is available; click once to download, click again after download to restart/install.
-- Provider: GitHub Releases (`provider: github`) configured at build time.
-- Repository slug source:
- - `T3CODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
- - otherwise `GITHUB_REPOSITORY` from GitHub Actions.
-- Required release assets for updater:
- - platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
- - channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
- - `*.blockmap` files (used for differential downloads)
-- macOS metadata note:
- - `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
- - The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.
-
-### Windows payload topology and update validation
-
-Windows packages the bundled server and only its runtime-external/native
-dependency closure in `resources/server.asar`. Native modules and helper
-executables declared as unpacked by that archive must be present at the matching
-paths below `resources/server.asar.unpacked`. The Windows-native backend reads
-the archive in place through Electron. WSL cannot read ASAR files, so enabling
-the WSL backend extracts the server tree once into the desktop state directory
-under `wsl-server-tree/<version>` and reuses the completed version until the app
-is updated.
+Run the CLI package dry-run after the server build has produced `apps/server/dist/client`:
-The artifact builder rejects a Windows package when any of these invariants
-break:
-
-- `resources/server.asar` is absent or does not contain the server entry.
-- Any file marked unpacked in the ASAR header is absent from
- `resources/server.asar.unpacked`.
-- On same-architecture Windows builds, the packaged primary cannot load the fff
- native library from inside `server.asar` through its `.unpacked` sibling.
-- The isolated, extracted sidecar cannot load the server entry with plain Node.
-- The external Windows resource monitor is absent.
-- The unpacked Windows application contains more than 80 files.
-
-Cross-architecture Windows builds retain every structural and extracted-sidecar
-check, but skip executing the target Electron binary. A same-architecture build
-for each release target must exercise the primary native-load probe.
-
-NSIS differential packaging remains enabled. A sidecar layout transition can
-produce a larger one-time download; subsequent small releases retain their
-blockmaps, with a 60 MB maximum for a representative sidecar-to-sidecar update.
-
-## 0) npm OIDC trusted publishing setup (CLI)
-
-The workflow invokes `node apps/server/scripts/cli.ts publish` after aligning package versions. That
-script temporarily prepares the `t3` package, then runs `vp pm publish --filter t3 ...` from the
-repository root so workspace publish configuration is applied correctly.
-
-Checklist:
-
-1. Confirm npm org/user owns package `t3` (or rename package first if needed).
-2. In npm package settings, configure Trusted Publisher:
- - Provider: GitHub Actions
- - Repository: this repo
- - Workflow file: `.github/workflows/release.yml`
- - Environment (if used): match your npm trusted publishing config
-3. Ensure npm account and org policies allow trusted publishing for the package.
-4. Create release tag `vX.Y.Z` and push; workflow will:
- - align the release package versions to `X.Y.Z`
- - build web + server
- - invoke the CLI publish script with npm dist-tag `latest`
-5. Nightly runs invoke the same publish script with npm dist-tag `nightly`.
-
-## 1) Release validation and unsigned builds
-
-There is no dry-run tag path. Pushing any accepted non-nightly tag, including
-`v0.0.0-test.1`, classifies the run as the stable channel. It publishes `t3` with npm dist-tag
-`latest`, creates a real GitHub Release, aliases the hosted app to `latest.app.t3.codes` and
-`app.t3.codes`, and can commit a version bump to `main` in the finalize job. Do not push a test tag
-to validate the workflow.
-
-The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to
-validate checks and builds without shipping. To exercise the complete release graph at lower stable
-risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub
-prerelease, desktop updater release, and hosted nightly alias, but it does not update stable aliases or
-commit a version bump to `main`. Only run it when a real nightly release is acceptable.
-
-Manual `channel=stable` with a version input is also a real stable-channel release. Omitting signing
-secrets only makes platform artifacts unsigned; it does not prevent publication.
-
-## 2) Apple signing + notarization setup (macOS)
-
-Required secrets used by the workflow:
-
-- `CSC_LINK`
-- `CSC_KEY_PASSWORD`
-- `APPLE_API_KEY`
-- `APPLE_API_KEY_ID`
-- `APPLE_API_ISSUER`
-- `MACOS_PROVISIONING_PROFILE` (base64-encoded provisioning profile with Associated Domains)
-
-Required repository variables:
-
-- `APPLE_TEAM_ID`
-
-Optional repository variables:
-
-- `CLERK_PASSKEY_RP_DOMAINS`: comma-separated RP-domain override. By default, the build derives the
- domain from the production Clerk publishable key.
-
-Checklist:
-
-1. Apple Developer account access:
- - Team has rights to create Developer ID certificates.
-2. Create an explicit App ID for `com.t3tools.t3code` and enable Associated Domains.
-3. Create a `Developer ID Application` certificate and a compatible provisioning profile for that
- App ID with Associated Domains enabled.
-4. Export the certificate + private key as `.p12` from Keychain.
-5. Base64-encode the `.p12` and store as `CSC_LINK`.
-6. Base64-encode the provisioning profile and store it as `MACOS_PROVISIONING_PROFILE`.
-7. Store the `.p12` export password as `CSC_KEY_PASSWORD`, and set `APPLE_TEAM_ID` to the
- 10-character Apple Developer Team ID.
-8. In App Store Connect, create an API key (Team key).
-9. Add API key values:
- - `APPLE_API_KEY`: contents of the downloaded `.p8`
- - `APPLE_API_KEY_ID`: Key ID
- - `APPLE_API_ISSUER`: Issuer ID
-10. Complete the Clerk Native API and AASA setup in [T3 Connect Clerk Setup](../internals/t3-connect.md#desktop-passkeys).
-11. Re-run a tag release and confirm macOS artifacts are signed/notarized and contain the expected
- `com.apple.developer.associated-domains` entitlement.
-
-Notes:
-
-- `APPLE_API_KEY` is stored as raw key text in secrets.
-- The workflow writes it to a temporary `AuthKey_<id>.p8` file at runtime.
-- The workflow decodes `MACOS_PROVISIONING_PROFILE`, validates it with `security cms`, and passes it
- to the desktop packager.
-
-## 3) Azure Trusted Signing setup (Windows)
-
-Required secrets used by the workflow:
-
-- `AZURE_TENANT_ID`
-- `AZURE_CLIENT_ID`
-- `AZURE_CLIENT_SECRET`
-- `AZURE_TRUSTED_SIGNING_ENDPOINT`
-- `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`
-- `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`
-- `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`
-
-Checklist:
-
-1. Create Azure Trusted Signing account and certificate profile.
-2. Record ATS values:
- - Endpoint
- - Account name
- - Certificate profile name
- - Publisher name
-3. Create/choose an Entra app registration (service principal).
-4. Grant service principal permissions required by Trusted Signing.
-5. Create a client secret for the service principal.
-6. Add Azure secrets listed above in GitHub Actions secrets.
-7. Re-run a tag release and confirm Windows installer is signed.
-
-## 4) Ongoing release checklist
-
-1. Ensure `main` is green in CI.
-2. Bump app version as needed.
-3. Create release tag: `vX.Y.Z`.
-4. Push tag.
-5. Verify workflow steps:
- - preflight passes
- - release quality checks pass
- - all matrix builds pass
- - `publish_cli` publishes the exact release version before the release job
- - release job uploads expected files
-6. Smoke test downloaded artifacts.
-
-## 5) Troubleshooting
+```sh
+vp run --filter t3 build
+node apps/server/scripts/cli.ts publish --dry-run --app-version 0.0.0-smoke.0 --verbose
+```
-- macOS build unsigned when expected signed:
- - Check all Apple secrets plus `APPLE_TEAM_ID` are populated and non-empty.
- - Confirm the provisioning profile belongs to `APPLE_TEAM_ID.com.t3tools.t3code` and includes
- Associated Domains.
-- Windows build unsigned when expected signed:
- - Check all Azure ATS and auth secrets are populated and non-empty.
-- Build fails with signing error:
- - Retry with secrets removed to confirm unsigned path still works.
- - Re-check certificate/profile names and tenant/client credentials.
+Do not use this smoke workflow as a release procedure. A publishing workflow must be designed and
+reviewed separately before Akeru Bot ships a public release.
diff --git a/package.json b/package.json
index 3fc66d0dd..f1f4dc869 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
"build:marketing": "vp run --filter @t3tools/marketing build",
"build:desktop": "vp run --filter @t3tools/desktop --filter t3 build",
"build:resource-monitor": "cargo build --locked --release --manifest-path native/resource-monitor/Cargo.toml",
+ "check:public-dependencies": "node scripts/check-public-dependencies.ts",
"typecheck": "vp run -r --concurrency-limit 2 typecheck",
"tc": "vp run -r --concurrency-limit 2 typecheck",
"lint": "vp lint --report-unused-disable-directives",
diff --git a/packages/shared/src/Net.test.ts b/packages/shared/src/Net.test.ts
index 93a1649b2..914339e85 100644
--- a/packages/shared/src/Net.test.ts
+++ b/packages/shared/src/Net.test.ts
@@ -71,13 +71,19 @@ it.layer(NetService.layer)("NetService", (it) => {
),
);
- it.effect("findAvailablePort returns preferred when it is free", () =>
+ it.effect("findAvailablePort respects loopback availability", () =>
Effect.gen(function* () {
const net = yield* NetService.NetService;
const preferred = yield* net.reserveLoopbackPort();
+ const isPreferredAvailable = yield* net.isPortAvailableOnLoopback(preferred);
const resolved = yield* net.findAvailablePort(preferred);
- assert.equal(resolved, preferred);
+ assert.ok(resolved > 0);
+ if (isPreferredAvailable) {
+ assert.equal(resolved, preferred);
+ } else {
+ assert.notEqual(resolved, preferred);
+ }
}),
);
diff --git a/packaging/aur/.gitignore b/packaging/aur/.gitignore
deleted file mode 100644
index e199a3b4e..000000000
--- a/packaging/aur/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-src/
-pkg/
-*.AppImage
-*.pkg.tar.zst
-.SRCINFO
-t3code-bin-*.png
-t3code-bin-*-LICENSE
-t3code-nightly-bin-*.png
-t3code-nightly-bin-*-LICENSE
diff --git a/packaging/aur/README.md b/packaging/aur/README.md
deleted file mode 100644
index b91da505a..000000000
--- a/packaging/aur/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# AUR packaging
-
-This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
-[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
-repackage the official x86_64 AppImage from GitHub Releases.
-
-## Publishing
-
-The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
-the workflow can also be run manually for a specific tag. It selects the stable or nightly
-package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
-to the AUR.
-
-To validate a release on Arch Linux:
-
-```bash
-sudo pacman -Syu --needed base-devel github-cli jq namcap
-GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
- packaging/aur/scripts/release.sh
-```
diff --git a/packaging/aur/scripts/release.sh b/packaging/aur/scripts/release.sh
deleted file mode 100755
index be07391db..000000000
--- a/packaging/aur/scripts/release.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
-repo='pingdotgg/t3code'
-tag="${RELEASE_TAG:?RELEASE_TAG is required}"
-pkgrel="${PKGREL:-1}"
-
-if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- pkgname='t3code-bin'
-elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
- pkgname='t3code-nightly-bin'
-else
- echo "Release $tag does not publish an AUR package."
- exit 0
-fi
-
-version="${tag#v}"
-pkgver="${version//-/_}"
-asset_name="T3-Code-${version}-x86_64.AppImage"
-release_json="$(gh api "repos/$repo/releases/tags/$tag")"
-asset_digest="$(jq -r --arg name "$asset_name" \
- '.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
-appimage_sha256="${asset_digest#sha256:}"
-
-if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
- echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
- exit 1
-fi
-
-work_dir="$(mktemp -d)"
-trap 'rm -rf -- "$work_dir"' EXIT
-gh api -H 'Accept: application/vnd.github.raw' \
- "repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
-license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"
-
-package_dir="$repo_root/packaging/aur/$pkgname"
-cd "$package_dir"
-sed -Ei \
- -e "s/^pkgver=.*/pkgver=$pkgver/" \
- -e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
- -e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
- -e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
- PKGBUILD
-
-run_as_builder() {
- if [[ "$(id -u)" == 0 ]]; then
- runuser -u builder -- "$@"
- else
- "$@"
- fi
-}
-
-if [[ "$(id -u)" == 0 ]]; then
- chown -R builder:builder "$package_dir"
-fi
-run_as_builder namcap PKGBUILD
-run_as_builder makepkg --printsrcinfo > .SRCINFO
-run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
-run_as_builder namcap "$(run_as_builder makepkg --packagelist)"
-
-if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
- echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
- exit 0
-fi
-
-key_file="$work_dir/id_ed25519"
-known_hosts_file="$work_dir/known_hosts"
-aur_dir="$work_dir/$pkgname"
-printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
-chmod 600 "$key_file"
-printf '%s\n' \
- 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
- > "$known_hosts_file"
-export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"
-
-git clone "ssh://[email protected]/$pkgname.git" "$aur_dir"
-cp PKGBUILD .SRCINFO "$aur_dir/"
-cd "$aur_dir"
-git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
-git config user.name 't3code-ci'
-git config user.email '[email protected]'
-git add -A
-
-if git diff --cached --quiet; then
- echo 'AUR package is already up to date.'
- exit 0
-fi
-
-git commit -m "$pkgname: update to $pkgver-$pkgrel"
-git push origin HEAD:master
diff --git a/packaging/aur/t3code-bin/PKGBUILD b/packaging/aur/t3code-bin/PKGBUILD
deleted file mode 100644
index ee11a6a0e..000000000
--- a/packaging/aur/t3code-bin/PKGBUILD
+++ /dev/null
@@ -1,104 +0,0 @@
-# Maintainer: maria-rcks <maria at kuuro dot net>
-
-pkgname=t3code-bin
-pkgver=0.0.33
-pkgrel=1
-pkgdesc='Desktop control surface for local coding agents'
-arch=('x86_64')
-url='https://github.com/pingdotgg/t3code'
-license=('MIT')
-depends=(
- 'alsa-lib'
- 'at-spi2-core'
- 'cairo'
- 'dbus'
- 'expat'
- 'gdk-pixbuf2'
- 'glib2'
- 'glibc'
- 'gtk3'
- 'hicolor-icon-theme'
- 'libcups'
- 'libdrm'
- 'libgcc'
- 'libstdc++'
- 'libx11'
- 'libxcb'
- 'libxcomposite'
- 'libxdamage'
- 'libxext'
- 'libxfixes'
- 'libxkbcommon'
- 'libxrandr'
- 'mesa'
- 'nspr'
- 'nss'
- 'pango'
- 'systemd-libs'
- 'xdg-utils'
- 'zlib'
-)
-optdepends=('openai-codex: use the system-installed Codex CLI')
-provides=("t3code=$pkgver")
-conflicts=('t3code')
-options=('!debug' '!strip')
-
-_appimage="T3-Code-${pkgver}-x86_64.AppImage"
-source=(
- "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
- "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
-)
-sha256sums=(
- '415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
- '935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
-)
-
-prepare() {
- chmod +x "$srcdir/$_appimage"
- rm -rf "$srcdir/squashfs-root"
- "$srcdir/$_appimage" --appimage-extract >/dev/null
-
- if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
- ! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
- echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
- return 1
- fi
-}
-
-package() {
- install -d "$pkgdir/opt/$pkgname"
- cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
- chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
- chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"
-
- install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
-#!/bin/sh
-exec /opt/t3code-bin/AppRun "$@"
-EOF
- ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"
-
- # Icon lookup only sees sizes registered in hicolor's index.theme (max 512x512).
- local icon size_dir
- for icon in "$srcdir"/squashfs-root/usr/share/icons/hicolor/*/apps/t3code.png; do
- size_dir="${icon%/apps/t3code.png}"
- install -Dm644 "$icon" \
- "$pkgdir/usr/share/icons/hicolor/${size_dir##*/}/apps/t3code.png"
- done
-
- install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
-[Desktop Entry]
-Name=Akeru Bot
-Comment=Desktop control surface for local coding agents
-Exec=t3code %U
-TryExec=t3code
-Terminal=false
-Type=Application
-Icon=t3code
-StartupWMClass=t3code
-Categories=Development;
-MimeType=x-scheme-handler/t3code;
-EOF
-
- install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
diff --git a/packaging/aur/t3code-nightly-bin/PKGBUILD b/packaging/aur/t3code-nightly-bin/PKGBUILD
deleted file mode 100644
index e13d77a8e..000000000
--- a/packaging/aur/t3code-nightly-bin/PKGBUILD
+++ /dev/null
@@ -1,105 +0,0 @@
-# Maintainer: maria-rcks <maria at kuuro dot net>
-
-pkgname=t3code-nightly-bin
-pkgver=0.0.34_nightly.20260814.1095
-pkgrel=1
-pkgdesc='Nightly desktop control surface for local coding agents'
-arch=('x86_64')
-url='https://github.com/pingdotgg/t3code'
-license=('MIT')
-depends=(
- 'alsa-lib'
- 'at-spi2-core'
- 'cairo'
- 'dbus'
- 'expat'
- 'gdk-pixbuf2'
- 'glib2'
- 'glibc'
- 'gtk3'
- 'hicolor-icon-theme'
- 'libcups'
- 'libdrm'
- 'libgcc'
- 'libstdc++'
- 'libx11'
- 'libxcb'
- 'libxcomposite'
- 'libxdamage'
- 'libxext'
- 'libxfixes'
- 'libxkbcommon'
- 'libxrandr'
- 'mesa'
- 'nspr'
- 'nss'
- 'pango'
- 'systemd-libs'
- 'xdg-utils'
- 'zlib'
-)
-optdepends=('openai-codex: use the system-installed Codex CLI')
-provides=("t3code-nightly=$pkgver")
-conflicts=('t3code-nightly' 't3code')
-options=('!debug' '!strip')
-
-_upstream_version="${pkgver/_nightly./-nightly.}"
-_appimage="T3-Code-${_upstream_version}-x86_64.AppImage"
-source=(
- "$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${_upstream_version}/$_appimage"
- "${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${_upstream_version}/LICENSE"
-)
-sha256sums=(
- 'c4dea5bba9ed0b51b2f60f2d4a4867e61d62b57c50ea66f2792a73112e054566' # AppImage
- '935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
-)
-
-prepare() {
- chmod +x "$srcdir/$_appimage"
- rm -rf "$srcdir/squashfs-root"
- "$srcdir/$_appimage" --appimage-extract >/dev/null
-
- if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
- ! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
- echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
- return 1
- fi
-}
-
-package() {
- install -d "$pkgdir/opt/$pkgname"
- cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
- chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
- chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"
-
- install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code-nightly" <<'EOF'
-#!/bin/sh
-exec /opt/t3code-nightly-bin/AppRun "$@"
-EOF
- ln -s t3code-nightly "$pkgdir/usr/bin/t3-code-nightly-desktop"
-
- # Icon lookup only sees sizes registered in hicolor's index.theme (max 512x512).
- local icon size_dir
- for icon in "$srcdir"/squashfs-root/usr/share/icons/hicolor/*/apps/t3code.png; do
- size_dir="${icon%/apps/t3code.png}"
- install -Dm644 "$icon" \
- "$pkgdir/usr/share/icons/hicolor/${size_dir##*/}/apps/t3code-nightly.png"
- done
-
- install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
-[Desktop Entry]
-Name=Akeru Bot Nightly
-Comment=Nightly desktop control surface for local coding agents
-Exec=t3code-nightly %U
-TryExec=t3code-nightly
-Terminal=false
-Type=Application
-Icon=t3code-nightly
-StartupWMClass=t3code
-Categories=Development;
-MimeType=x-scheme-handler/t3code;
-EOF
-
- install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
- "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8ba2b9127..0c0f4767f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -485,8 +485,8 @@ importers:
specifier: ^1.3.15
version: 1.15.13
'@opencoredev/sandbox-sdk':
- specifier: file:../../../sandbox-sdk/packages/sdk
+ specifier: 0.2.0
'@pierre/diffs':
specifier: 'catalog:'
version: 1.3.0-beta.10(patch_hash=7ef7cb0cbabb17c15cdb137554068b36f15f6f5265e73fb51452aa3380db91aa)(@shikijs/[email protected])([email protected]([email protected]))([email protected])
@@ -4209,10 +4209,9 @@ packages:
'@opencode-ai/[email protected]':
resolution: {integrity: sha512-4TwojIoQ8EG6/mVBuUVYZXiFcwNmiiytEnjnvyuvSJjGwFIlw2YIBFxtSVC3FbwwbwHT63teh1RHiQUUC4U5xw==}
- '@opencoredev/sandbox-sdk@file:../sandbox-sdk/packages/sdk':
- resolution: {directory: ../sandbox-sdk/packages/sdk, type: directory}
+ '@opencoredev/[email protected]':
+ resolution: {integrity: sha512-VBOz1yE+HmZ2iw6WfE5+3aVN8eu490a5nXtE2ikqjHXDZ5OjoDG3T39fIogUXf4N4f7zo+WpNyMP9SIC6b6sBw==}
engines: {node: '>=22 <26'}
- hasBin: true
peerDependencies:
'@ai-sdk/harness': ^1.0.0
'@asciidev/box-sdk': ^0.0.24
@@ -16915,7 +16914,7 @@ snapshots:
partial-json: 0.1.7
proxy-agent: 6.5.0
- undici: 7.27.1
+ undici: 7.29.0
zod-to-json-schema: 3.25.2([email protected])
transitivePeerDependencies:
- '@modelcontextprotocol/sdk'
@@ -16944,7 +16943,7 @@ snapshots:
minimatch: 10.2.5
proper-lockfile: 4.1.2
strip-ansi: 7.2.0
- undici: 7.27.1
+ undici: 7.29.0
yaml: 2.9.0
optionalDependencies:
'@mariozechner/clipboard': 0.3.9
@@ -17433,7 +17432,7 @@ snapshots:
dependencies:
cross-spawn: 7.0.6
dependencies:
optionalDependencies:
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 582faf647..4d3474850 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -11,6 +11,7 @@ packages:
allowBuilds:
"@google/genai": false
agent-browser: false
+ better-sqlite3: true
browser-tabs-lock: false
bufferutil: false
core-js: false
@@ -19,6 +20,8 @@ allowBuilds:
electron-winstaller: false
esbuild: true
geckodriver: false
+ isolated-vm: true
+ koffi: true
msgpackr-extract: true
msw: false
node-pty: true
diff --git a/scripts/build-desktop-artifact.test.ts b/scripts/build-desktop-artifact.test.ts
index a1c0d90d3..35636da34 100644
--- a/scripts/build-desktop-artifact.test.ts
+++ b/scripts/build-desktop-artifact.test.ts
@@ -30,9 +30,10 @@ import {
MacPasskeySigningConfigurationResolutionError,
MissingMacPasskeyProvisioningProfileError,
packWindowsServerAsar,
- renderMacPasskeyEntitlements,
+ renderMacEntitlements,
resolveClerkPasskeyNativeArtifacts,
resolveMacPasskeySigningConfiguration,
+ resolveOptionalMacPasskeySigningConfiguration,
resolveDesktopRuntimeDependencies,
resolveMacStageDependencies,
resolveFffNativeDependencies,
@@ -42,6 +43,7 @@ import {
resolveDesktopUpdateChannel,
resolveDesktopWebAssetBrand,
resolveResourceMonitorRustTargets,
+ resolveResourceMonitorCargoBuildArgs,
resolveWindowsServerAsarIgnoreGlobs,
resourceMonitorExecutableName,
resolveGitHubPublishConfig,
@@ -804,7 +806,11 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
});
assert.isFalse(
- commands.some((command) => command.options.env?.ELECTRON_RUN_AS_NODE === "1"),
+ commands.some(
+ (command) =>
+ command.command !== process.execPath &&
+ command.options.env?.ELECTRON_RUN_AS_NODE === "1",
+ ),
);
assert.isTrue(
commands.some(
@@ -1074,7 +1080,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
});
assert.deepStrictEqual(configuration, {
- appId: "com.t3tools.t3code",
+ appId: "dev.leodoes.akeru",
teamId: "ABC1234567",
rpDomains: ["example.clerk.accounts.dev"],
provisioningProfilePath: "/tmp/t3code.provisionprofile",
@@ -1088,13 +1094,13 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
T3CODE_CLERK_PASSKEY_RP_DOMAINS:
" Clerk.Example.com,example.clerk.accounts.dev,clerk.example.com ",
});
- const entitlements = renderMacPasskeyEntitlements(configuration);
+ const entitlements = renderMacEntitlements(configuration);
assert.deepStrictEqual(configuration.rpDomains, [
"clerk.example.com",
"example.clerk.accounts.dev",
]);
- assert.include(entitlements, "<string>ABC1234567.com.t3tools.t3code</string>");
+ assert.include(entitlements, "<string>ABC1234567.dev.leodoes.akeru</string>");
assert.include(entitlements, "<string>webcredentials:clerk.example.com</string>");
assert.include(entitlements, "<string>webcredentials:example.clerk.accounts.dev</string>");
assert.include(entitlements, "<key>com.apple.security.cs.allow-jit</key>");
@@ -1160,6 +1166,24 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
assert.notInclude(invalidPublishableKeyError.message, "pk_test_%");
});
+ it("does not require Clerk passkey configuration for signed macOS builds", () => {
+ assert.isUndefined(resolveOptionalMacPasskeySigningConfiguration({}));
+ });
+
+ it("renders signed macOS entitlements without Clerk passkey configuration", () => {
+ const entitlements = renderMacEntitlements();
+
+ assert.include(entitlements, "<key>com.apple.security.cs.allow-jit</key>");
+ assert.include(
+ entitlements,
+ "<key>com.apple.security.cs.allow-unsigned-executable-memory</key>",
+ );
+ assert.include(entitlements, "<key>com.apple.security.cs.disable-library-validation</key>");
+ assert.include(entitlements, "<key>com.apple.security.device.audio-input</key>");
+ assert.notInclude(entitlements, "com.apple.developer.associated-domains");
+ assert.notInclude(entitlements, "com.apple.application-identifier");
+ });
+
it("preserves known passkey signing configuration errors at the build boundary", () => {
const decodingCause = new Error("publishable-key-decode-failed");
const knownError = new InvalidMacPasskeyPublishableKeyError({ cause: decodingCause });
@@ -1190,9 +1214,10 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
});
const mac = config.mac as Record<string, unknown>;
- assert.equal(config.appId, "com.t3tools.t3code");
+ assert.equal(config.appId, "dev.leodoes.akeru");
assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
assert.equal(mac.provisioningProfile, "/tmp/t3code.provisionprofile");
+ assert.equal(mac.notarize, true);
assert.match(String(mac.sign), /\/scripts\/sign-macos\.ts$/);
assert.deepStrictEqual(mac.protocols, [
{ name: "Akeru Bot", schemes: ["t3code", "t3code-dev"] },
@@ -1200,6 +1225,21 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
);
+ it.effect("keeps signed macOS entitlements explicit without Clerk passkeys", () =>
+ Effect.gen(function* () {
+ const config = yield* createBuildConfig("mac", "dmg", "1.2.3", true, false, undefined, {
+ entitlementsPath: "/tmp/entitlements.mac.plist",
+ });
+
+ const mac = config.mac as Record<string, unknown>;
+ assert.equal(config.appId, "dev.leodoes.akeru");
+ assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
+ assert.notProperty(mac, "provisioningProfile");
+ assert.equal(mac.notarize, true);
+ assert.match(String(mac.sign), /\/scripts\/sign-macos\.ts$/);
+ }).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
+ );
+
it.effect("uses the nightly DMG background for nightly macOS builds", () =>
Effect.gen(function* () {
const config = yield* createBuildConfig(
@@ -1216,6 +1256,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
(config.dmg as Record<string, unknown>).background,
"dmg/dmg-background-nightly.png",
);
+ assert.equal((config.mac as Record<string, unknown>).notarize, false);
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
);
@@ -1257,6 +1298,24 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
]);
assert.equal(resourceMonitorExecutableName("mac"), "t3-resource-monitor");
assert.equal(resourceMonitorExecutableName("win"), "t3-resource-monitor.exe");
+ assert.deepStrictEqual(
+ resolveResourceMonitorCargoBuildArgs(
+ "/repo/native/resource-monitor/Cargo.toml",
+ "/repo/native/resource-monitor/target",
+ "aarch64-apple-darwin",
+ ),
+ [
+ "build",
+ "--locked",
+ "--release",
+ "--manifest-path",
+ "/repo/native/resource-monitor/Cargo.toml",
+ "--target-dir",
+ "/repo/native/resource-monitor/target",
+ "--target",
+ "aarch64-apple-darwin",
+ ],
+ );
});
it("promotes target fff binaries to direct staged dependencies", () => {
assert.deepStrictEqual(resolveFffNativeDependencies("mac", "arm64", "0.9.4"), {
diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts
index 3142b4d0a..2f4260f39 100644
--- a/scripts/build-desktop-artifact.ts
+++ b/scripts/build-desktop-artifact.ts
@@ -51,7 +51,7 @@ import { Command, Flag } from "effect/unstable/cli";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
const LINUX_ICON_SIZES = [16, 22, 24, 32, 48, 64, 128, 256, 512] as const;
-const DESKTOP_APP_ID = "com.t3tools.t3code";
+const DESKTOP_APP_ID = "dev.leodoes.akeru";
const APPLE_TEAM_ID_PATTERN = /^[A-Z0-9]{10}$/u;
const BuildPlatform = Schema.Literals(["mac", "linux", "win"]);
@@ -131,6 +131,24 @@ export function resourceMonitorExecutableName(platform: typeof BuildPlatform.Typ
return platform === "win" ? "t3-resource-monitor.exe" : "t3-resource-monitor";
}
+export function resolveResourceMonitorCargoBuildArgs(
+ manifestPath: string,
+ targetDirectory: string,
+ rustTarget: string,
+): ReadonlyArray<string> {
+ return [
+ "build",
+ "--locked",
+ "--release",
+ "--manifest-path",
+ manifestPath,
+ "--target-dir",
+ targetDirectory,
+ "--target",
+ rustTarget,
+ ];
+}
+
const PLATFORM_CONFIG: Record<typeof BuildPlatform.Type, PlatformConfig> = {
mac: {
cliFlag: "--mac",
@@ -1037,6 +1055,21 @@ export function resolveMacPasskeySigningConfiguration(
};
}
+export function resolveOptionalMacPasskeySigningConfiguration(
+ env: Readonly<Record<string, string | undefined>>,
+): MacPasskeySigningConfiguration | undefined {
+ const hasPasskeyConfiguration = [
+ env.T3CODE_APPLE_TEAM_ID,
+ env.T3CODE_MACOS_PROVISIONING_PROFILE,
+ env.T3CODE_CLERK_PASSKEY_RP_DOMAINS,
+ env.T3CODE_CLERK_PUBLISHABLE_KEY,
+ ].some((value) => Boolean(value?.trim()));
+ if (!hasPasskeyConfiguration) {
+ return undefined;
+ }
+ return resolveMacPasskeySigningConfiguration(env);
+}
+
function escapeXml(value: string): string {
return value
.replaceAll("&", "&amp;")
@@ -1046,26 +1079,26 @@ function escapeXml(value: string): string {
.replaceAll("'", "&apos;");
}
-export function renderMacPasskeyEntitlements(
- configuration: MacPasskeySigningConfiguration,
-): string {
- const associatedDomains = configuration.rpDomains
- .map((domain) => ` <string>webcredentials:${escapeXml(domain)}</string>`)
- .join("\n");
-
- return `<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
- <dict>
- <key>com.apple.application-identifier</key>
+export function renderMacEntitlements(configuration?: MacPasskeySigningConfiguration): string {
+ const passkeyEntitlements = configuration
+ ? ` <key>com.apple.application-identifier</key>
<string>${escapeXml(`${configuration.teamId}.${configuration.appId}`)}</string>
<key>com.apple.developer.team-identifier</key>
<string>${escapeXml(configuration.teamId)}</string>
<key>com.apple.developer.associated-domains</key>
<array>
-${associatedDomains}
+${configuration.rpDomains
+ .map((domain) => ` <string>webcredentials:${escapeXml(domain)}</string>`)
+ .join("\n")}
</array>
- <key>com.apple.security.cs.allow-jit</key>
+`
+ : "";
+
+ return `<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+${passkeyEntitlements} <key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
@@ -1688,6 +1721,7 @@ export const stageResourceMonitor = Effect.fn("stageResourceMonitor")(function*
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const manifestPath = path.join(input.repoRoot, "native/resource-monitor/Cargo.toml");
+ const targetDirectory = path.join(input.repoRoot, "native/resource-monitor/target");
const executableName = resourceMonitorExecutableName(input.platform);
const rustTargets = resolveResourceMonitorRustTargets(input.platform, input.arch);
const reuseResourceMonitor = yield* Config.boolean("T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR").pipe(
@@ -1697,15 +1731,10 @@ export const stageResourceMonitor = Effect.fn("stageResourceMonitor")(function*
for (const rustTarget of rustTargets) {
if (!reuseResourceMonitor) {
- const spawnCommand = yield* resolveSpawnCommand("cargo", [
- "build",
- "--locked",
- "--release",
- "--manifest-path",
- manifestPath,
- "--target",
- rustTarget,
- ]);
+ const spawnCommand = yield* resolveSpawnCommand(
+ "cargo",
+ resolveResourceMonitorCargoBuildArgs(manifestPath, targetDirectory, rustTarget),
+ );
yield* runCommand(
ChildProcess.make(spawnCommand.command, spawnCommand.args, {
cwd: input.repoRoot,
@@ -1718,13 +1747,7 @@ export const stageResourceMonitor = Effect.fn("stageResourceMonitor")(function*
);
}
- const binaryPath = path.join(
- input.repoRoot,
- "native/resource-monitor/target",
- rustTarget,
- "release",
- executableName,
- );
+ const binaryPath = path.join(targetDirectory, rustTarget, "release", executableName);
if (!(yield* fs.exists(binaryPath))) {
return yield* new ResourceMonitorBuildOutputMissingError({
binaryPath,
@@ -2073,17 +2096,17 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
signed: boolean,
mockUpdates: boolean,
mockUpdateServerPort: number | undefined,
- macPasskeySigning:
+ macSigning:
| {
readonly entitlementsPath: string;
- readonly provisioningProfilePath: string;
+ readonly provisioningProfilePath?: string;
}
| undefined,
) {
const buildConfig: Record<string, unknown> = {
appId: DESKTOP_APP_ID,
productName: resolveDesktopProductName(version),
- artifactName: "T3-Code-${version}-${arch}.${ext}",
+ artifactName: "Akeru-Bot-${version}-${arch}.${ext}",
electronLanguages: [...DESKTOP_ELECTRON_LANGUAGES],
files: [...DESKTOP_FILE_EXCLUSIONS, ...(platform === "mac" ? MAC_FILE_EXCLUSIONS : [])],
directories: {
@@ -2129,11 +2152,16 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
schemes: ["t3code", "t3code-dev"],
},
],
+ // electron-builder notarizes and staples the signed app before target
+ // builders package the DMG. CI notarizes the resulting DMG separately.
+ notarize: signed,
...(signed ? { sign: path.join(repoRoot, "scripts/sign-macos.ts") } : {}),
- ...(macPasskeySigning
+ ...(macSigning
? {
- entitlements: macPasskeySigning.entitlementsPath,
- provisioningProfile: macPasskeySigning.provisioningProfilePath,
+ entitlements: macSigning.entitlementsPath,
+ ...(macSigning.provisioningProfilePath
+ ? { provisioningProfile: macSigning.provisioningProfilePath }
+ : {}),
}
: {}),
};
@@ -2904,7 +2932,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
const configuredMacPasskeySigning =
options.platform === "mac" && options.signed
? yield* Effect.try({
- try: () => resolveMacPasskeySigningConfiguration(loadRepoEnv({ repoRoot })),
+ try: () => resolveOptionalMacPasskeySigningConfiguration(loadRepoEnv({ repoRoot })),
catch: MacPasskeySigningConfigurationResolutionError.fromCause,
})
: undefined;
@@ -2917,16 +2945,17 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
),
}
: undefined;
- const macEntitlementsPath = macPasskeySigning
- ? path.join(stageAppDir, "entitlements.mac.plist")
- : undefined;
- if (macPasskeySigning && macEntitlementsPath) {
- if (!(yield* fs.exists(macPasskeySigning.provisioningProfilePath))) {
+ const macEntitlementsPath =
+ options.platform === "mac" && options.signed
+ ? path.join(stageAppDir, "entitlements.mac.plist")
+ : undefined;
+ if (macEntitlementsPath) {
+ if (macPasskeySigning && !(yield* fs.exists(macPasskeySigning.provisioningProfilePath))) {
return yield* new MacProvisioningProfileNotFoundError({
provisioningProfilePath: macPasskeySigning.provisioningProfilePath,
});
}
- yield* fs.writeFileString(macEntitlementsPath, renderMacPasskeyEntitlements(macPasskeySigning));
+ yield* fs.writeFileString(macEntitlementsPath, renderMacEntitlements(macPasskeySigning));
}
// Windows splits dependencies per process: app.asar carries only the
@@ -2968,7 +2997,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
t3codeCommitHash: commitHash,
private: true,
packageManager: rootPackageJson.packageManager,
- description: "T3 Code desktop build",
+ description: "Akeru Bot desktop build",
author: "T3 Tools",
main: "apps/desktop/dist-electron/main.cjs",
build: yield* createBuildConfig(
@@ -2978,10 +3007,12 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
options.signed,
options.mockUpdates,
options.mockUpdateServerPort,
- macPasskeySigning && macEntitlementsPath
+ macEntitlementsPath
? {
entitlementsPath: macEntitlementsPath,
- provisioningProfilePath: macPasskeySigning.provisioningProfilePath,
+ ...(macPasskeySigning
+ ? { provisioningProfilePath: macPasskeySigning.provisioningProfilePath }
+ : {}),
}
: undefined,
),
@@ -3226,7 +3257,7 @@ const buildDesktopArtifactCli = Command.make("build-desktop-artifact", {
Flag.optional,
),
}).pipe(
- Command.withDescription("Build a desktop artifact for T3 Code."),
+ Command.withDescription("Build a desktop artifact for Akeru Bot."),
Command.withHandler((input) => Effect.flatMap(resolveBuildOptions(input), buildDesktopArtifact)),
);
diff --git a/scripts/check-public-dependencies.test.ts b/scripts/check-public-dependencies.test.ts
new file mode 100644
index 000000000..430ed6fa8
--- /dev/null
+++ b/scripts/check-public-dependencies.test.ts
@@ -0,0 +1,66 @@
+// @effect-diagnostics nodeBuiltinImport:off
+import * as NodeFS from "node:fs";
+import * as NodeOS from "node:os";
+import * as NodePath from "node:path";
+
+import { assert, it } from "@effect/vitest";
+
+import {
+ checkPublicDependencies,
+ findExternalLocalDependencies,
+} from "./check-public-dependencies.ts";
+
+function writeManifest(root: string, relativePath: string, dependency: string): string {
+ const manifestPath = NodePath.join(root, relativePath);
+ NodeFS.mkdirSync(NodePath.dirname(manifestPath), { recursive: true });
+ NodeFS.writeFileSync(
+ manifestPath,
+ `${JSON.stringify({ dependencies: { example: dependency } }, null, 2)}\n`,
+ );
+ return manifestPath;
+}
+
+it("accepts registry, workspace, and repository-owned file dependencies", () => {
+ const root = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "akeru-public-deps-"));
+ const manifests = [
+ writeManifest(root, "apps/server/package.json", "0.2.0"),
+ writeManifest(root, "packages/example/package.json", "workspace:*"),
+ writeManifest(root, "apps/mobile/package.json", "file:./modules/example"),
+ ];
+
+ assert.deepStrictEqual(findExternalLocalDependencies(root, manifests), []);
+});
+
+it("rejects file dependencies that escape the repository", () => {
+ const root = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "akeru-public-deps-"));
+ const manifestPath = writeManifest(
+ root,
+ "apps/server/package.json",
+ "file:../../../sandbox-sdk/packages/sdk",
+ );
+
+ assert.deepStrictEqual(findExternalLocalDependencies(root, [manifestPath]), [
+ {
+ dependency: "example",
+ manifestPath,
+ specifier: "file:../../../sandbox-sdk/packages/sdk",
+ },
+ ]);
+});
+
+it("rejects external local paths left in the lockfile", () => {
+ const root = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "akeru-public-deps-"));
+ NodeFS.writeFileSync(NodePath.join(root, "package.json"), "{}\n");
+ NodeFS.writeFileSync(
+ NodePath.join(root, "pnpm-lock.yaml"),
+ "packages:\n example:\n resolution: {directory: ../sandbox-sdk, type: directory}\n",
+ );
+
+ assert.deepStrictEqual(checkPublicDependencies(root), [
+ {
+ dependency: "pnpm-lock.yaml",
+ manifestPath: NodePath.join(root, "pnpm-lock.yaml"),
+ specifier: "external local path",
+ },
+ ]);
+});
diff --git a/scripts/check-public-dependencies.ts b/scripts/check-public-dependencies.ts
new file mode 100644
index 000000000..871e0a8db
--- /dev/null
+++ b/scripts/check-public-dependencies.ts
@@ -0,0 +1,117 @@
+#!/usr/bin/env node
+// @effect-diagnostics nodeBuiltinImport:off
+import * as NodeFS from "node:fs";
+import * as NodePath from "node:path";
+import * as NodeURL from "node:url";
+
+const DEPENDENCY_SECTIONS = [
+ "dependencies",
+ "devDependencies",
+ "optionalDependencies",
+ "peerDependencies",
+] as const;
+
+interface PackageManifest {
+ readonly name?: string;
+ readonly dependencies?: Readonly<Record<string, string>>;
+ readonly devDependencies?: Readonly<Record<string, string>>;
+ readonly optionalDependencies?: Readonly<Record<string, string>>;
+ readonly peerDependencies?: Readonly<Record<string, string>>;
+}
+
+export interface PublicDependencyProblem {
+ readonly dependency: string;
+ readonly manifestPath: string;
+ readonly specifier: string;
+}
+
+function workspaceManifestPaths(repoRoot: string): ReadonlyArray<string> {
+ const manifests = [NodePath.join(repoRoot, "package.json")];
+ for (const directory of ["apps", "infra", "packages"]) {
+ const directoryPath = NodePath.join(repoRoot, directory);
+ if (!NodeFS.existsSync(directoryPath)) continue;
+
+ for (const entry of NodeFS.readdirSync(directoryPath, { withFileTypes: true })) {
+ if (!entry.isDirectory()) continue;
+ const manifestPath = NodePath.join(directoryPath, entry.name, "package.json");
+ if (NodeFS.existsSync(manifestPath)) manifests.push(manifestPath);
+ }
+ }
+
+ for (const relativePath of ["oxlint-plugin-t3code/package.json", "scripts/package.json"]) {
+ const manifestPath = NodePath.join(repoRoot, relativePath);
+ if (NodeFS.existsSync(manifestPath)) manifests.push(manifestPath);
+ }
+
+ return manifests;
+}
+
+function escapesRepository(repoRoot: string, manifestPath: string, specifier: string): boolean {
+ const relativeTarget = specifier.replace(/^(?:file|link):/u, "");
+ const target = NodePath.resolve(NodePath.dirname(manifestPath), relativeTarget);
+ const relative = NodePath.relative(repoRoot, target);
+ return (
+ relative === ".." || relative.startsWith(`..${NodePath.sep}`) || NodePath.isAbsolute(relative)
+ );
+}
+
+export function findExternalLocalDependencies(
+ repoRoot: string,
+ manifestPaths: ReadonlyArray<string> = workspaceManifestPaths(repoRoot),
+): ReadonlyArray<PublicDependencyProblem> {
+ const problems: PublicDependencyProblem[] = [];
+
+ for (const manifestPath of manifestPaths) {
+ const manifest = JSON.parse(NodeFS.readFileSync(manifestPath, "utf8")) as PackageManifest;
+ for (const section of DEPENDENCY_SECTIONS) {
+ for (const [dependency, specifier] of Object.entries(manifest[section] ?? {})) {
+ if (!/^(?:file|link):/u.test(specifier)) continue;
+ if (!escapesRepository(repoRoot, manifestPath, specifier)) continue;
+ problems.push({ dependency, manifestPath, specifier });
+ }
+ }
+ }
+
+ return problems;
+}
+
+export function checkPublicDependencies(repoRoot: string): ReadonlyArray<PublicDependencyProblem> {
+ const manifestProblems = findExternalLocalDependencies(repoRoot);
+ const lockfilePath = NodePath.join(repoRoot, "pnpm-lock.yaml");
+ if (!NodeFS.existsSync(lockfilePath)) return manifestProblems;
+
+ const lockfile = NodeFS.readFileSync(lockfilePath, "utf8");
+ if (!/(?:specifier: (?:file|link):\.\.\/|directory: \.\.\/)/u.test(lockfile)) {
+ return manifestProblems;
+ }
+
+ return [
+ ...manifestProblems,
+ {
+ dependency: "pnpm-lock.yaml",
+ manifestPath: lockfilePath,
+ specifier: "external local path",
+ },
+ ];
+}
+
+function main(): void {
+ const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
+ const problems = checkPublicDependencies(repoRoot);
+ if (problems.length === 0) {
+ process.stdout.write(
+ "All workspace dependencies resolve from the repository or a public registry.\n",
+ );
+ return;
+ }
+
+ for (const problem of problems) {
+ const relativePath = NodePath.relative(repoRoot, problem.manifestPath);
+ process.stderr.write(
+ `${relativePath}: ${problem.dependency} uses ${problem.specifier}, which resolves outside the repository.\n`,
+ );
+ }
+ process.exitCode = 1;
+}
+
+if (import.meta.url === NodeURL.pathToFileURL(process.argv[1] ?? "").href) main();
diff --git a/scripts/release-smoke.ts b/scripts/release-smoke.ts
index 45d2dd436..0e864e260 100644
--- a/scripts/release-smoke.ts
+++ b/scripts/release-smoke.ts
@@ -4,410 +4,179 @@ import * as NodeFS from "node:fs";
import * as NodeOS from "node:os";
import * as NodePath from "node:path";
import * as NodeURL from "node:url";
+
import * as Console from "effect/Console";
import * as Effect from "effect/Effect";
-const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
-
-const workspaceFiles = [
- "package.json",
- "pnpm-lock.yaml",
- "pnpm-workspace.yaml",
- "apps/server/package.json",
- "apps/desktop/package.json",
- "apps/web/package.json",
- "apps/mobile/package.json",
- "apps/mobile/deps/react-native-nitro-markdown-0.5.0.tgz",
- "apps/mobile/modules/t3-markdown-text/package.json",
- "apps/mobile/modules/t3-review-diff/package.json",
- "apps/mobile/modules/t3-terminal/package.json",
- "apps/marketing/package.json",
- "infra/relay/package.json",
- "oxlint-plugin-t3code/package.json",
- "packages/client-runtime/package.json",
- "packages/contracts/package.json",
- "packages/shared/package.json",
- "packages/ssh/package.json",
- "packages/tailscale/package.json",
- "packages/effect-acp/package.json",
- "packages/effect-codex-app-server/package.json",
- "scripts/package.json",
-] as const;
+import { checkPublicDependencies } from "./check-public-dependencies.ts";
-function copyWorkspaceManifestFixture(targetRoot: string): void {
- for (const relativePath of workspaceFiles) {
- const sourcePath = NodePath.resolve(repoRoot, relativePath);
- const destinationPath = NodePath.resolve(targetRoot, relativePath);
- NodeFS.mkdirSync(NodePath.dirname(destinationPath), { recursive: true });
- NodeFS.cpSync(sourcePath, destinationPath);
- }
+const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
- const patchesDirectory = NodePath.resolve(repoRoot, "patches");
- if (NodeFS.existsSync(patchesDirectory)) {
- NodeFS.cpSync(patchesDirectory, NodePath.resolve(targetRoot, "patches"), { recursive: true });
- }
+function read(relativePath: string): string {
+ return NodeFS.readFileSync(NodePath.join(repoRoot, relativePath), "utf8");
}
-function writeMacManifestFixtures(targetRoot: string): { arm64Path: string; x64Path: string } {
- const assetDirectory = NodePath.resolve(targetRoot, "release-assets");
- NodeFS.mkdirSync(assetDirectory, { recursive: true });
-
- const arm64Path = NodePath.resolve(assetDirectory, "latest-mac.yml");
- const x64Path = NodePath.resolve(assetDirectory, "latest-mac-x64.yml");
-
- NodeFS.writeFileSync(
- arm64Path,
- `version: 9.9.9-smoke.0
-files:
- - url: T3-Code-9.9.9-smoke.0-arm64.zip
- sha512: arm64zip
- size: 125621344
- - url: T3-Code-9.9.9-smoke.0-arm64.dmg
- sha512: arm64dmg
- size: 131754935
-path: T3-Code-9.9.9-smoke.0-arm64.zip
-sha512: arm64zip
-releaseDate: '2026-03-08T10:32:14.587Z'
-`,
- );
-
- NodeFS.writeFileSync(
- x64Path,
- `version: 9.9.9-smoke.0
-files:
- - url: T3-Code-9.9.9-smoke.0-x64.zip
- sha512: x64zip
- size: 132000112
- - url: T3-Code-9.9.9-smoke.0-x64.dmg
- sha512: x64dmg
- size: 138148807
-path: T3-Code-9.9.9-smoke.0-x64.zip
-sha512: x64zip
-releaseDate: '2026-03-08T10:36:07.540Z'
-`,
- );
-
- return { arm64Path, x64Path };
+function assertContains(haystack: string, needle: string, message: string): void {
+ if (!haystack.includes(needle)) throw new Error(message);
}
-function writeWindowsManifestFixtures(
- targetRoot: string,
- channel: string,
-): { arm64Path: string; x64Path: string } {
- const assetDirectory = NodePath.resolve(targetRoot, "release-assets");
- NodeFS.mkdirSync(assetDirectory, { recursive: true });
-
- const arm64Path = NodePath.resolve(assetDirectory, `${channel}-win-arm64.yml`);
- const x64Path = NodePath.resolve(assetDirectory, `${channel}-win-x64.yml`);
-
- NodeFS.writeFileSync(
- arm64Path,
- `version: 9.9.9-smoke.0
-files:
- - url: T3-Code-9.9.9-smoke.0-arm64.exe
- sha512: arm64exe
- size: 126621344
- - url: T3-Code-9.9.9-smoke.0-arm64.exe.blockmap
- sha512: arm64blockmap
- size: 152344
-path: T3-Code-9.9.9-smoke.0-arm64.exe
-sha512: arm64exe
-releaseDate: '2026-03-08T10:32:14.587Z'
-`,
- );
-
- NodeFS.writeFileSync(
- x64Path,
- `version: 9.9.9-smoke.0
-files:
- - url: T3-Code-9.9.9-smoke.0-x64.exe
- sha512: x64exe
- size: 132000112
- - url: T3-Code-9.9.9-smoke.0-x64.exe.blockmap
- sha512: x64blockmap
- size: 160112
-path: T3-Code-9.9.9-smoke.0-x64.exe
-sha512: x64exe
-releaseDate: '2026-03-08T10:36:07.540Z'
-`,
- );
-
- return { arm64Path, x64Path };
+function assertOmits(haystack: string, needle: string, message: string): void {
+ if (haystack.toLowerCase().includes(needle.toLowerCase())) throw new Error(message);
}
-function writeWindowsBuilderDebugFixtures(targetRoot: string): {
- arm64Path: string;
- x64Path: string;
-} {
- const assetDirectory = NodePath.resolve(targetRoot, "release-assets");
- NodeFS.mkdirSync(assetDirectory, { recursive: true });
-
- const arm64Path = NodePath.resolve(assetDirectory, "builder-debug-win-arm64.yml");
- const x64Path = NodePath.resolve(assetDirectory, "builder-debug-win-x64.yml");
- const debugFixture = `arm64:
- firstOrDefaultFilePatterns:
- - '**/*'
-nsis:
- script: |-
- !include "example.nsh"
-`;
+const releaseWorkflow = read(".depot/workflows/release.yml");
+const ciWorkflow = read(".depot/workflows/ci.yml");
+const desktopArtifactBuilder = read("scripts/build-desktop-artifact.ts");
+const depotWorkflowDirectory = NodePath.join(repoRoot, ".depot/workflows");
- NodeFS.writeFileSync(arm64Path, debugFixture);
- NodeFS.writeFileSync(x64Path, debugFixture);
-
- return { arm64Path, x64Path };
-}
-function assertContains(haystack: string, needle: string, message: string): void {
- if (!haystack.includes(needle)) {
- throw new Error(message);
+for (const workflowFile of NodeFS.readdirSync(depotWorkflowDirectory)) {
+ if (!workflowFile.endsWith(".yml") && !workflowFile.endsWith(".yaml")) continue;
+ const workflow = read(NodePath.join(".depot/workflows", workflowFile));
+ if (/^\s*(?:runs-on|runner): (?:ubuntu|macos|windows)-/mu.test(workflow)) {
+ throw new Error(`Depot workflow still uses a GitHub-hosted runner: ${workflowFile}.`);
}
}
-function assertExists(path: string, message: string): void {
- if (!NodeFS.existsSync(path)) {
- throw new Error(message);
+for (const relativePath of [".github/workflows/ci.yml", ".github/workflows/release.yml"] as const) {
+ if (NodeFS.existsSync(NodePath.join(repoRoot, relativePath))) {
+ throw new Error(`GitHub Actions still owns ${relativePath}; move it to .depot/workflows.`);
}
}
-function assertPackageVersion(path: string, version: string): void {
- const packageJson = JSON.parse(NodeFS.readFileSync(path, "utf8")) as {
- readonly version?: unknown;
- };
+assertContains(
+ desktopArtifactBuilder,
+ 'artifactName: "Akeru-Bot-${version}-${arch}.${ext}"',
+ "Desktop artifacts do not use the Akeru Bot release name.",
+);
+
+for (const [needle, label] of [
+ ["label: macOS arm64 DMG", "macOS arm64 DMG"],
+ ["label: Windows x64 NSIS", "Windows x64 NSIS"],
+ ["label: Linux x64 AppImage", "Linux x64 AppImage"],
+ ["runner: depot-macos-15", "Depot macOS runner"],
+ ["runner: depot-windows-2025-8", "8-vCPU Depot Windows runner"],
+ ["runner: depot-ubuntu-24.04-8", "8-vCPU Depot Linux runner"],
+ [
+ "apple-actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466",
+ "pinned Developer ID certificate import",
+ ],
+ ["--signed", "signed macOS build"],
+ ["xcrun notarytool submit", "DMG notarization"],
+ ["xcrun stapler staple", "DMG ticket stapling"],
+ ["codesign --verify", "app signature verification"],
+ ["spctl --assess", "Gatekeeper verification"],
+ ["vp run --filter t3 build", "CLI and web build"],
+ ["--dry-run", "CLI package dry-run"],
+ ["vp run --filter @t3tools/marketing typecheck", "marketing typecheck"],
+ ["vp run --filter @t3tools/marketing build", "marketing build"],
+] as const) {
+ assertContains(releaseWorkflow, needle, `Release workflow is missing ${label}.`);
+}
- if (packageJson.version !== version) {
- throw new Error(`Expected ${path} to have version ${version}.`);
- }
+for (const [needle, label] of [
+ ["clerk", "Clerk configuration"],
+ ["relay", "relay configuration"],
+ ["publish-aur", "AUR publishing"],
+ ["action-gh-release", "GitHub release publishing"],
+ ["vercel deploy", "hosted deployment"],
+ ["discord", "Discord release announcements"],
+ ["T3 Code", "T3 release naming"],
+ [".env.example", "T3 environment template"],
+] as const) {
+ assertOmits(releaseWorkflow, needle, `Release workflow still contains ${label}.`);
}
-function assertMissing(path: string, message: string): void {
- if (NodeFS.existsSync(path)) {
- throw new Error(message);
+for (const [needle, label] of [
+ ["blacksmith", "private CI runners"],
+ ["thread-transfer", "thread transfer reporting"],
+ ["mobile_native", "mobile production checks"],
+ ["clerk", "Clerk bundle checks"],
+] as const) {
+ assertOmits(ciWorkflow, needle, `CI workflow still contains ${label}.`);
+}
+
+assertContains(ciWorkflow, "runs-on: depot-ubuntu-24.04-8", "CI does not use Depot runners.");
+assertOmits(ciWorkflow, "runs-on: ubuntu-24.04", "GitHub-hosted Linux runners");
+assertOmits(releaseWorkflow, "runner: macos-15", "GitHub-hosted macOS runner");
+assertOmits(releaseWorkflow, "runner: windows-2025", "GitHub-hosted Windows runner");
+assertOmits(releaseWorkflow, "runner: ubuntu-24.04", "GitHub-hosted Linux runner");
+assertOmits(
+ desktopArtifactBuilder,
+ 'const DESKTOP_APP_ID = "com.t3tools.t3code"',
+ "legacy T3 desktop bundle identifier",
+);
+assertContains(
+ desktopArtifactBuilder,
+ 'const DESKTOP_APP_ID = "dev.leodoes.akeru"',
+ "Akeru desktop bundle identifier is missing.",
+);
+
+for (const relativePath of [
+ ".github/workflows/deploy-relay.yml",
+ ".github/workflows/desktop-macos-preview.yml",
+ ".github/workflows/mobile-eas-preview.yml",
+ ".github/workflows/mobile-eas-production.yml",
+ ".github/workflows/mobile-fingerprint-check.yml",
+ ".github/workflows/mobile-showcase-screenshots.yml",
+ ".github/workflows/publish-aur.yml",
+ ".github/workflows/thread-transfer-report.yml",
+ ".github/workflows/web-preview.yml",
+ ".github/scripts/thread-transfer-report.cjs",
+ "packaging/aur/README.md",
+] as const) {
+ if (NodeFS.existsSync(NodePath.join(repoRoot, relativePath))) {
+ throw new Error(`Retired workflow file still exists: ${relativePath}.`);
}
}
-const tempRoot = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-release-smoke-"));
+const dependencyProblems = checkPublicDependencies(repoRoot);
+if (dependencyProblems.length > 0) {
+ throw new Error(
+ `Release inputs contain ${dependencyProblems.length} external local dependency path(s).`,
+ );
+}
+const tempRoot = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "akeru-release-smoke-"));
try {
- copyWorkspaceManifestFixture(tempRoot);
+ for (const relativePath of [
+ "apps/server/package.json",
+ "apps/desktop/package.json",
+ "apps/web/package.json",
+ "packages/contracts/package.json",
+ ] as const) {
+ const destination = NodePath.join(tempRoot, relativePath);
+ NodeFS.mkdirSync(NodePath.dirname(destination), { recursive: true });
+ NodeFS.copyFileSync(NodePath.join(repoRoot, relativePath), destination);
+ }
NodeChildProcess.execFileSync(
process.execPath,
[
- NodePath.resolve(repoRoot, "scripts/update-release-package-versions.ts"),
+ NodePath.join(repoRoot, "scripts/update-release-package-versions.ts"),
"9.9.9-smoke.0",
"--root",
tempRoot,
],
- {
- cwd: repoRoot,
- stdio: "inherit",
- },
+ { cwd: repoRoot, stdio: "inherit" },
);
- NodeFS.rmSync(NodePath.resolve(tempRoot, "pnpm-lock.yaml"), { force: true });
-
- NodeChildProcess.execFileSync("vp", ["install", "--lockfile-only", "--ignore-scripts"], {
- cwd: tempRoot,
- stdio: "inherit",
- });
-
- const lockfile = NodeFS.readFileSync(NodePath.resolve(tempRoot, "pnpm-lock.yaml"), "utf8");
- assertContains(lockfile, "lockfileVersion:", "Expected pnpm-lock.yaml to be regenerated.");
-
for (const relativePath of [
"apps/server/package.json",
"apps/desktop/package.json",
"apps/web/package.json",
"packages/contracts/package.json",
- ]) {
- assertPackageVersion(NodePath.resolve(tempRoot, relativePath), "9.9.9-smoke.0");
+ ] as const) {
+ const manifest = JSON.parse(readFromTemp(relativePath)) as { readonly version?: unknown };
+ if (manifest.version !== "9.9.9-smoke.0") {
+ throw new Error(`Release version did not update ${relativePath}.`);
+ }
}
-
- const nightlyReleaseMetadata = NodeChildProcess.execFileSync(
- process.execPath,
- [
- NodePath.resolve(repoRoot, "scripts/resolve-nightly-release.ts"),
- "--date",
- "20260413",
- "--run-number",
- "321",
- "--sha",
- "abcdef1234567890",
- "--root",
- tempRoot,
- ],
- {
- cwd: repoRoot,
- encoding: "utf8",
- },
- );
- assertContains(
- nightlyReleaseMetadata,
- "version=9.9.10-nightly.20260413.321",
- "Expected nightly metadata to contain the derived nightly version.",
- );
- assertContains(
- nightlyReleaseMetadata,
- "tag=v9.9.10-nightly.20260413.321",
- "Expected nightly metadata to contain the derived nightly tag.",
- );
- assertContains(
- nightlyReleaseMetadata,
- "name=T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
- "Expected nightly metadata to include the short commit SHA in the release name.",
- );
-
- const { arm64Path, x64Path } = writeMacManifestFixtures(tempRoot);
- NodeChildProcess.execFileSync(
- process.execPath,
- [
- NodePath.resolve(repoRoot, "scripts/merge-update-manifests.ts"),
- "--platform",
- "mac",
- arm64Path,
- x64Path,
- ],
- {
- cwd: repoRoot,
- stdio: "inherit",
- },
- );
-
- const mergedManifest = NodeFS.readFileSync(arm64Path, "utf8");
- assertContains(
- mergedManifest,
- "T3-Code-9.9.9-smoke.0-arm64.zip",
- "Merged manifest is missing the arm64 asset.",
- );
- assertContains(
- mergedManifest,
- "T3-Code-9.9.9-smoke.0-x64.zip",
- "Merged manifest is missing the x64 asset.",
- );
-
- const { arm64Path: winArm64Path, x64Path: winX64Path } = writeWindowsManifestFixtures(
- tempRoot,
- "latest",
- );
- const mergedWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/latest.yml");
- const { arm64Path: nightlyWinArm64Path, x64Path: nightlyWinX64Path } =
- writeWindowsManifestFixtures(tempRoot, "nightly");
- const mergedNightlyWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/nightly.yml");
- const { arm64Path: previewWinArm64Path, x64Path: previewWinX64Path } =
- writeWindowsManifestFixtures(tempRoot, "preview");
- const mergedPreviewWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/preview.yml");
- const { arm64Path: winDebugArm64Path, x64Path: winDebugX64Path } =
- writeWindowsBuilderDebugFixtures(tempRoot);
- NodeChildProcess.execFileSync(
- "bash",
- [
- "-lc",
- `
- release_assets_dir=${JSON.stringify(NodePath.resolve(tempRoot, "release-assets"))}
- shopt -s nullglob
- found_windows_manifest=false
- for x64_manifest in "$release_assets_dir"/*-win-x64.yml; do
- if [[ "$(basename "$x64_manifest")" == builder-debug-* ]]; then
- continue
- fi
-
- arm64_manifest="\${x64_manifest/-x64.yml/-arm64.yml}"
- output_manifest="\${x64_manifest/-win-x64.yml/.yml}"
- if [[ ! -f "$arm64_manifest" ]]; then
- echo "Missing matching arm64 Windows manifest for $x64_manifest" >&2
- exit 1
- fi
-
- found_windows_manifest=true
- ${JSON.stringify(process.execPath)} ${JSON.stringify(NodePath.resolve(repoRoot, "scripts/merge-update-manifests.ts"))} --platform win \
- "$arm64_manifest" \
- "$x64_manifest" \
- "$output_manifest"
- rm -f "$arm64_manifest" "$x64_manifest"
- done
-
- if [[ "$found_windows_manifest" != true ]]; then
- echo "No Windows updater manifests found to merge." >&2
- exit 1
- fi
- `,
- ],
- {
- cwd: repoRoot,
- stdio: "inherit",
- },
- );
-
- const mergedWindowsManifest = NodeFS.readFileSync(mergedWindowsManifestPath, "utf8");
- assertContains(
- mergedWindowsManifest,
- "T3-Code-9.9.9-smoke.0-arm64.exe",
- "Merged Windows manifest is missing the arm64 asset.",
- );
- assertContains(
- mergedWindowsManifest,
- "T3-Code-9.9.9-smoke.0-x64.exe",
- "Merged Windows manifest is missing the x64 asset.",
- );
- const mergedNightlyWindowsManifest = NodeFS.readFileSync(
- mergedNightlyWindowsManifestPath,
- "utf8",
- );
- assertContains(
- mergedNightlyWindowsManifest,
- "T3-Code-9.9.9-smoke.0-arm64.exe",
- "Merged nightly Windows manifest is missing the arm64 asset.",
- );
- assertContains(
- mergedNightlyWindowsManifest,
- "T3-Code-9.9.9-smoke.0-x64.exe",
- "Merged nightly Windows manifest is missing the x64 asset.",
- );
- const mergedPreviewWindowsManifest = NodeFS.readFileSync(
- mergedPreviewWindowsManifestPath,
- "utf8",
- );
- assertContains(
- mergedPreviewWindowsManifest,
- "T3-Code-9.9.9-smoke.0-arm64.exe",
- "Merged preview Windows manifest is missing the arm64 asset.",
- );
- assertContains(
- mergedPreviewWindowsManifest,
- "T3-Code-9.9.9-smoke.0-x64.exe",
- "Merged preview Windows manifest is missing the x64 asset.",
- );
- assertMissing(
- winArm64Path,
- "Windows release smoke unexpectedly kept the arm64 updater manifest.",
- );
- assertMissing(winX64Path, "Windows release smoke unexpectedly kept the x64 updater manifest.");
- assertMissing(
- nightlyWinArm64Path,
- "Windows release smoke unexpectedly kept the nightly arm64 updater manifest.",
- );
- assertMissing(
- nightlyWinX64Path,
- "Windows release smoke unexpectedly kept the nightly x64 updater manifest.",
- );
- assertMissing(
- previewWinArm64Path,
- "Windows release smoke unexpectedly kept the preview arm64 updater manifest.",
- );
- assertMissing(
- previewWinX64Path,
- "Windows release smoke unexpectedly kept the preview x64 updater manifest.",
- );
- assertExists(
- winDebugArm64Path,
- "Windows release smoke unexpectedly removed the arm64 builder debug fixture.",
- );
- assertExists(
- winDebugX64Path,
- "Windows release smoke unexpectedly removed the x64 builder debug fixture.",
- );
-
- Effect.runSync(Console.log("Release smoke checks passed."));
} finally {
NodeFS.rmSync(tempRoot, { recursive: true, force: true });
}
+
+function readFromTemp(relativePath: string): string {
+ return NodeFS.readFileSync(NodePath.join(tempRoot, relativePath), "utf8");
+}
+
+Effect.runSync(Console.log("Akeru release smoke checks passed."));
diff --git a/scripts/resolve-nightly-release.test.ts b/scripts/resolve-nightly-release.test.ts
index dda1e7081..68b73b895 100644
--- a/scripts/resolve-nightly-release.test.ts
+++ b/scripts/resolve-nightly-release.test.ts
@@ -46,7 +46,7 @@ it("derives nightly metadata including the short commit sha in the release name"
baseVersion: "9.9.10",
version: "9.9.10-nightly.20260413.321",
tag: "v9.9.10-nightly.20260413.321",
- name: "T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
+ name: "Akeru Bot Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
shortSha: "abcdef123456",
},
);
diff --git a/scripts/resolve-nightly-release.ts b/scripts/resolve-nightly-release.ts
index 5b42f931d..6df3d21e2 100644
--- a/scripts/resolve-nightly-release.ts
+++ b/scripts/resolve-nightly-release.ts
@@ -108,7 +108,7 @@ export const resolveNightlyReleaseMetadata = (
baseVersion,
version,
tag: `v${version}`,
- name: `T3 Code Nightly ${version} (${shortSha})`,
+ name: `Akeru Bot Nightly ${version} (${shortSha})`,
shortSha,
};
};