Skip to content

Commit b46d2f2

Browse files
authored
Merge branch 'main' into fix/chat-beside-details-shift
2 parents c391306 + 37fbefd commit b46d2f2

466 files changed

Lines changed: 29013 additions & 5585 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/test-t3-mobile/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This installs the dev client for the checkout's native fingerprint: from the
3838
device, the local cache, or the shared cache in seconds, building once only
3939
when no machine has that fingerprint yet (5-15 minutes, logged to the file it
4040
names). The device id may be omitted when exactly one device is booted. It
41-
prints one JSON line; on failure it names the next command. Authorized mobile
42-
verification includes that step unless the user prohibits it.
41+
prints one JSON line; on failure it names the next command. Mobile verification
42+
includes that step unless the user prohibits it.
4343

4444
For a device you opened in an agent-device session elsewhere (a device pool,
4545
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ github:myacoub91
5959
github:naMqe-h
6060
github:nateEc
6161
github:naveed949
62+
github:nexxeln
6263
github:nmggithub
6364
github:Noojuno
6465
github:notkainoa

‎.github/workflows/agent-context-budget.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ jobs:
5151
echo "Accepted by the agent-context-increase label."
5252
exit 0
5353
fi
54-
echo "::error file=$BUDGET::Agent context grew compared to main. Cut the added text, or ask a maintainer to add the agent-context-increase label."
54+
echo "::error file=$BUDGET::Agent context grew compared to main. Cut the added text and rerun the evals that cover it (evals/README.md), or ask a maintainer to add the agent-context-increase label."
5555
exit 1

‎.github/workflows/desktop-macos-preview-publish.yml‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,19 @@ jobs:
7777
return;
7878
}
7979
80-
// workflow_run.pull_requests is empty for fork PRs, so resolve the
81-
// PR from the built commit instead and require exactly one open PR
82-
// from the same head repository and branch. The build baked its
80+
// workflow_run.pull_requests and the commit-to-PR lookup are both
81+
// empty for fork PRs, so list open PRs by head owner and branch
82+
// and require exactly one at the built commit. The build baked its
8383
// PR number into the version, so two candidates would mean the
8484
// asset name could belong to either.
85-
const associated = await github.paginate(
86-
github.rest.repos.listPullRequestsAssociatedWithCommit,
87-
{ owner, repo, commit_sha: run.head_sha, per_page: 100 },
88-
);
89-
const matching = associated.filter(
85+
const open = await github.paginate(github.rest.pulls.list, {
86+
owner,
87+
repo,
88+
state: "open",
89+
head: `${run.head_repository?.owner?.login}:${run.head_branch}`,
90+
per_page: 100,
91+
});
92+
const matching = open.filter(
9093
(candidate) =>
9194
candidate.state === "open" &&
9295
candidate.head.sha === run.head_sha &&

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,20 @@ jobs:
160160
working-directory: apps/mobile
161161
env:
162162
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
163-
run: eas env:pull production --non-interactive
163+
run: |
164+
eas env:pull production --non-interactive
165+
# EAS commands skip dotenv, and the Android fingerprint hashes this
166+
# file. Without it every merge misses the build's hash and rebuilds.
167+
node --input-type=module <<'NODE'
168+
import { appendFileSync, readFileSync } from "node:fs";
169+
import { parseEnv } from "node:util";
170+
const env = parseEnv(readFileSync(".env.local", "utf8"));
171+
const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE;
172+
if (!googleServicesFile) {
173+
throw new Error("T3CODE_ANDROID_GOOGLE_SERVICES_FILE is missing from the production environment");
174+
}
175+
appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`);
176+
NODE
164177
165178
- name: Apply manual version override
166179
if: steps.version_app_token.outcome == 'success'

‎.github/workflows/mobile-fingerprint-check.yml‎

Lines changed: 15 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Mobile Fingerprint Check
22

33
# Detects whether a PR changes the native fingerprint — i.e. whether merging
44
# it would leave main un-OTA-able until a new store build ships. Native-change
5-
# PRs get the "📱 Native Change" label so they can be held and merged as a
5+
# PRs get the "📱 Native Change" label (applied by mobile-fingerprint-label.yml,
6+
# which runs from main so fork PRs get it too) so they can be held and merged as a
67
# batch right before the next store submission, keeping main OTA-able for
78
# everything else in between. (Once one native PR merges, every later merge
89
# inherits the drifted fingerprint and loses OTA reach too — that is why the
@@ -27,8 +28,6 @@ jobs:
2728
runs-on: blacksmith-8vcpu-ubuntu-2404
2829
permissions:
2930
contents: read
30-
issues: write
31-
pull-requests: write
3231
env:
3332
APP_VARIANT: production
3433
NODE_OPTIONS: --max-old-space-size=8192
@@ -127,94 +126,19 @@ jobs:
127126
} >> "$GITHUB_STEP_SUMMARY"
128127
echo "changed_platforms=${changed# }" >> "$GITHUB_OUTPUT"
129128
130-
- name: Sync native change label
131-
# Fork PRs get a read-only token under pull_request; the check stays
132-
# advisory there (summary only). This workflow must not move to
133-
# pull_request_target — it installs and runs PR code.
134-
if: github.event.pull_request.head.repo.full_name == github.repository
135-
uses: actions/github-script@v8
129+
# mobile-fingerprint-label.yml reads this from main with a write token
130+
# and syncs the label; this job's token is read-only for fork PRs.
131+
- name: Record changed platforms
136132
env:
137133
CHANGED_PLATFORMS: ${{ steps.compare.outputs.changed_platforms }}
138-
with:
139-
script: |
140-
const managedLabel = {
141-
name: "📱 Native Change",
142-
color: "d93f0b",
143-
description:
144-
"Changes the native fingerprint; merging blocks production OTAs until a new store build ships.",
145-
};
146-
const nativeChanged = (process.env.CHANGED_PLATFORMS ?? "").trim() !== "";
147-
const issueNumber = context.payload.pull_request.number;
148-
149-
try {
150-
const { data: existing } = await github.rest.issues.getLabel({
151-
owner: context.repo.owner,
152-
repo: context.repo.repo,
153-
name: managedLabel.name,
154-
});
155-
156-
if (
157-
existing.color !== managedLabel.color ||
158-
(existing.description ?? "") !== managedLabel.description
159-
) {
160-
await github.rest.issues.updateLabel({
161-
owner: context.repo.owner,
162-
repo: context.repo.repo,
163-
name: managedLabel.name,
164-
color: managedLabel.color,
165-
description: managedLabel.description,
166-
});
167-
}
168-
} catch (error) {
169-
if (error.status !== 404) {
170-
throw error;
171-
}
172-
173-
try {
174-
await github.rest.issues.createLabel({
175-
owner: context.repo.owner,
176-
repo: context.repo.repo,
177-
name: managedLabel.name,
178-
color: managedLabel.color,
179-
description: managedLabel.description,
180-
});
181-
} catch (createError) {
182-
if (createError.status !== 422) {
183-
throw createError;
184-
}
185-
}
186-
}
187-
188-
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
189-
owner: context.repo.owner,
190-
repo: context.repo.repo,
191-
issue_number: issueNumber,
192-
per_page: 100,
193-
});
194-
const hasLabel = currentLabels.some((label) => label.name === managedLabel.name);
195-
196-
if (nativeChanged && !hasLabel) {
197-
await github.rest.issues.addLabels({
198-
owner: context.repo.owner,
199-
repo: context.repo.repo,
200-
issue_number: issueNumber,
201-
labels: [managedLabel.name],
202-
});
203-
} else if (!nativeChanged && hasLabel) {
204-
try {
205-
await github.rest.issues.removeLabel({
206-
owner: context.repo.owner,
207-
repo: context.repo.repo,
208-
issue_number: issueNumber,
209-
name: managedLabel.name,
210-
});
211-
} catch (removeError) {
212-
if (removeError.status !== 404) {
213-
throw removeError;
214-
}
215-
}
216-
}
134+
run: |
135+
mkdir -p "$RUNNER_TEMP/fingerprint-result"
136+
printf '%s\n' "$CHANGED_PLATFORMS" > "$RUNNER_TEMP/fingerprint-result/changed-platforms"
217137
218-
core.info(
219-
`PR #${issueNumber}: native fingerprint ${nativeChanged ? `changed (${process.env.CHANGED_PLATFORMS})` : "unchanged"}`,
220-
);
138+
- name: Upload changed platforms
139+
uses: actions/upload-artifact@v7
140+
with:
141+
name: fingerprint-result
142+
path: ${{ runner.temp }}/fingerprint-result
143+
if-no-files-found: error
144+
retention-days: 1
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: Mobile Fingerprint Label
2+
3+
# Trusted half of mobile-fingerprint-check.yml. That workflow runs PR code
4+
# (fork PRs included) with a read-only token and records which platforms'
5+
# fingerprints changed. This one runs from main with a write token and syncs
6+
# the "📱 Native Change" label. It never checks out or runs PR code.
7+
#
8+
# A PR can edit the check workflow it runs under, so the recorded result is
9+
# untrusted data: it is validated, and at worst a PR mislabels itself.
10+
11+
on:
12+
workflow_run:
13+
workflows: [Mobile Fingerprint Check]
14+
types: [completed]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
label:
21+
name: Sync native change label
22+
# A cancelled run was superseded by a newer push, whose run labels instead.
23+
if: >-
24+
github.event.workflow_run.event == 'pull_request' &&
25+
github.event.workflow_run.conclusion == 'success'
26+
runs-on: ubuntu-24.04
27+
timeout-minutes: 5
28+
permissions:
29+
actions: read
30+
contents: read
31+
issues: write
32+
pull-requests: write
33+
steps:
34+
- id: pr
35+
name: Resolve the pull request behind the check
36+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
37+
with:
38+
script: |
39+
const run = context.payload.workflow_run;
40+
const { owner, repo } = context.repo;
41+
42+
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, {
43+
owner,
44+
repo,
45+
run_id: run.id,
46+
per_page: 100,
47+
});
48+
const results = artifacts.filter(
49+
(artifact) => artifact.name === "fingerprint-result" && !artifact.expired,
50+
);
51+
if (results.length !== 1) {
52+
core.info(`Expected one fingerprint-result artifact; found ${results.length}. Skipping.`);
53+
return;
54+
}
55+
56+
// workflow_run.pull_requests and the commit-to-PR lookup are both
57+
// empty for fork PRs, so list open PRs by head owner and branch.
58+
// Requiring the PR's current head to be the checked commit keeps a
59+
// slow run for an older push from overwriting a newer result.
60+
const open = await github.paginate(github.rest.pulls.list, {
61+
owner,
62+
repo,
63+
state: "open",
64+
head: `${run.head_repository?.owner?.login}:${run.head_branch}`,
65+
per_page: 100,
66+
});
67+
const matching = open.filter(
68+
(candidate) =>
69+
candidate.state === "open" &&
70+
candidate.head.sha === run.head_sha &&
71+
candidate.head.ref === run.head_branch &&
72+
candidate.head.repo?.full_name === run.head_repository?.full_name,
73+
);
74+
if (matching.length !== 1) {
75+
core.info(`Expected one open PR at ${run.head_sha}; found ${matching.length}. Skipping.`);
76+
return;
77+
}
78+
79+
core.setOutput("artifact_id", String(results[0].id));
80+
core.setOutput("pr_number", String(matching[0].number));
81+
82+
# Read the archive as bytes; never extract PR-produced files into a
83+
# workspace this job runs code from.
84+
- id: result
85+
name: Read changed platforms
86+
if: steps.pr.outputs.pr_number != ''
87+
shell: bash
88+
env:
89+
GH_TOKEN: ${{ github.token }}
90+
ARTIFACT_ID: ${{ steps.pr.outputs.artifact_id }}
91+
run: |
92+
set -euo pipefail
93+
gh api "repos/${GITHUB_REPOSITORY}/actions/artifacts/${ARTIFACT_ID}/zip" > "$RUNNER_TEMP/fingerprint-result.zip"
94+
changed="$(unzip -p "$RUNNER_TEMP/fingerprint-result.zip" changed-platforms)"
95+
if [[ ! "$changed" =~ ^((ios|android)( (ios|android))?)?$ ]]; then
96+
echo "Unexpected changed-platforms value '$changed'." >&2
97+
exit 1
98+
fi
99+
echo "changed_platforms=$changed" >> "$GITHUB_OUTPUT"
100+
101+
- name: Sync native change label
102+
if: steps.pr.outputs.pr_number != ''
103+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
104+
env:
105+
PR_NUMBER: ${{ steps.pr.outputs.pr_number }}
106+
CHANGED_PLATFORMS: ${{ steps.result.outputs.changed_platforms }}
107+
with:
108+
script: |
109+
const managedLabel = {
110+
name: "📱 Native Change",
111+
color: "d93f0b",
112+
description:
113+
"Changes the native fingerprint; merging blocks production OTAs until a new store build ships.",
114+
};
115+
const nativeChanged = (process.env.CHANGED_PLATFORMS ?? "").trim() !== "";
116+
const issueNumber = Number(process.env.PR_NUMBER);
117+
118+
try {
119+
const { data: existing } = await github.rest.issues.getLabel({
120+
owner: context.repo.owner,
121+
repo: context.repo.repo,
122+
name: managedLabel.name,
123+
});
124+
125+
if (
126+
existing.color !== managedLabel.color ||
127+
(existing.description ?? "") !== managedLabel.description
128+
) {
129+
await github.rest.issues.updateLabel({
130+
owner: context.repo.owner,
131+
repo: context.repo.repo,
132+
name: managedLabel.name,
133+
color: managedLabel.color,
134+
description: managedLabel.description,
135+
});
136+
}
137+
} catch (error) {
138+
if (error.status !== 404) {
139+
throw error;
140+
}
141+
142+
try {
143+
await github.rest.issues.createLabel({
144+
owner: context.repo.owner,
145+
repo: context.repo.repo,
146+
name: managedLabel.name,
147+
color: managedLabel.color,
148+
description: managedLabel.description,
149+
});
150+
} catch (createError) {
151+
if (createError.status !== 422) {
152+
throw createError;
153+
}
154+
}
155+
}
156+
157+
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
158+
owner: context.repo.owner,
159+
repo: context.repo.repo,
160+
issue_number: issueNumber,
161+
per_page: 100,
162+
});
163+
const hasLabel = currentLabels.some((label) => label.name === managedLabel.name);
164+
165+
if (nativeChanged && !hasLabel) {
166+
await github.rest.issues.addLabels({
167+
owner: context.repo.owner,
168+
repo: context.repo.repo,
169+
issue_number: issueNumber,
170+
labels: [managedLabel.name],
171+
});
172+
} else if (!nativeChanged && hasLabel) {
173+
try {
174+
await github.rest.issues.removeLabel({
175+
owner: context.repo.owner,
176+
repo: context.repo.repo,
177+
issue_number: issueNumber,
178+
name: managedLabel.name,
179+
});
180+
} catch (removeError) {
181+
if (removeError.status !== 404) {
182+
throw removeError;
183+
}
184+
}
185+
}
186+
187+
core.info(
188+
`PR #${issueNumber}: native fingerprint ${nativeChanged ? `changed (${process.env.CHANGED_PLATFORMS})` : "unchanged"}`,
189+
);

0 commit comments

Comments
 (0)