Skip to content

Commit 72e9b3d

Browse files
authored
Merge branch 'main' into perf-opencode-usage-scan
2 parents 6a6c182 + 58e60bf commit 72e9b3d

191 files changed

Lines changed: 6360 additions & 1216 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-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+
);

‎AGENTS.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
9898

9999
## Verifying
100100

101-
- Before you push, run `vp run check:changed`. It runs CI's fast checks for changed files: format, lint, knip, typecheck of affected packages and dependents, and tests beside changes. CI still runs the full test suites.
101+
- Before you push, run `vp run check:changed`. It runs CI's fast checks for changed files: format, lint, knip, typecheck of affected packages and dependents, tests beside changes, and the cross-file checks those miss. CI still runs the full test suites.
102102
- While you iterate, run `vp test run <files>`. For big files, add `-t "<name>"`.
103103
- Use `vp run typecheck`, not `npx tsc`; it caches per package. Both run tsc-rs (`typescript` is the `@tsc-rs/typescript` drop-in).
104104
- Run `node -e` snippets from `apps/server` or the owning package. `effect` does not resolve from the repo root.
@@ -135,11 +135,11 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
135135
});
136136
```
137137

138-
- Upon request, user-visible frontend changes should get one integrated pass in a real client: `test-t3-app` for web, `test-t3-mobile` for mobile. The primary agent does this once after integrating. Subagents do not launch their own dev servers. Ask permission before doing computer use or spinning up browsers.
138+
- User-visible frontend changes should get one integrated pass in a real client: `test-t3-app` for web, `test-t3-mobile` for mobile. The primary agent does this once after integrating. Subagents do not launch their own dev servers.
139139

140140
- Real agent turns cost money. To watch a turn stream through the pipeline and UI, use the free `Replay (dev)` provider that `vp run dev` registers; [test-t3-app](.agents/skills/test-t3-app/SKILL.md) shows how to start one. Use a real provider only when the change depends on that provider's behavior, and then pick its cheapest model, such as Haiku for Claude or Luna for Codex.
141141

142-
For authorized mobile verification, a missing or outdated native client is an install step, not a blocker. Run `vp run mobile:install <ios|android> [device-id]` on the device host before starting Metro; it targets the only booted simulator or connected Android device when the id is omitted. It installs the dev client for this checkout's native fingerprint from the shared cache in seconds and builds only when no machine has built it yet, so prefer it over `expo run:*`, `xcodebuild`, or `gradlew`, which rebuild from scratch. Its stdout is one JSON line; build output goes to the log it names. See `test-t3-mobile` for the full workflow.
142+
For mobile verification, a missing or outdated native client is an install step, not a blocker. Run `vp run mobile:install <ios|android> [device-id]` on the device host before starting Metro; it targets the only booted simulator or connected Android device when the id is omitted. It installs the dev client for this checkout's native fingerprint from the shared cache in seconds and builds only when no machine has built it yet, so prefer it over `expo run:*`, `xcodebuild`, or `gradlew`, which rebuild from scratch. Its stdout is one JSON line; build output goes to the log it names. See `test-t3-mobile` for the full workflow.
143143

144144
## Evals
145145

@@ -209,5 +209,4 @@ Architecture and its constraints: `docs/internals/overview.md`. Glossary: `docs/
209209

210210
## Additional tips
211211

212-
- Don't verify with browsers or computer use unless the user explicitly agrees or requests it.
213212
- Security is important, but should not be over-indexed on, especially for dev mode/maintainer-only features.

0 commit comments

Comments
 (0)