Repository navigation
bench: UpgradeBench v1 pre-run (5 repos) - #256
lucasbraum wants to merge 14 commits into
Conversation
…uth (UPT-24) Three public repositories with a human's merged upgrade in a verified pack's range (zod, stripe, react), recorded before either arm runs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
… pilot (UPT-24) run.sh starts both arms from the same fresh clone of the parent, with lifecycle scripts off and pushes disabled; the Claude Code arm runs Bash only inside Claude Code's sandbox. check.sh runs the repository's own checks, judge.sh opens a pull request on an uptide-bench fork, and score.mjs scores every run the same way without reading its arm. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
…e (UPT-24) Probes showed headless Claude Code denying git commit and compound commands that need approval; every Bash call already runs inside the OS sandbox, so all Bash is allowed. Claude Code reports an unknown model's cost at older rates, so its tokens are priced with Uptide's table. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
… sandbox (UPT-24) The first run showed Uptide refusing an uninstalled checkout (a developer's is installed) and the sandbox failing supertest's local listen, so Claude Code could not run tests Uptide runs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
…s without commits (UPT-24) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
…uild (UPT-24) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to register and finish (UPT-24) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… model and Claude Code's own cost (UPT-24) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h --max-cost, keep Uptide on Sonnet (UPT-24) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
…rms fixed before any run (UPT-24) The rule as given, the 2026-10-19T10:04Z amendment (bot major-bump pull requests a human fixed before merge), the 5 pre-run repositories with their checks, the next ones for the full bench, every dropped candidate with its reason, and both arms' commands. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
Uptide names the branch after the pack's lead package (uptide/react-router-* for react-router-dom), which the uptide/<package>-* glob missed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
Uptide 0.17.1 (Sonnet, $1): 2/5 mergeable, $0.72, 12.3 min. Claude Code (Fable, $5): 3/5 mergeable, $12.55, 32.6 min. Per-run meta, checks, fork CI and scores; four Uptide engine issues written up in results.md, not fixed here. One infrastructure rerun (LlamaDesk's Uptide arm, harness branch lookup). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
|
Review complete. 🟠 2 high · 🟡 2 medium 💬 Inline comments (4)
🧹 Nitpicks (2) — 🟢 2 low
The change introduces an agent benchmark:
Note: review coverage did not include the Reviewed commit: ae04d53 |
There was a problem hiding this comment.
This PR adds a benchmark harness (shell driver, scorer, candidate finder) plus committed pre5 run artifacts and reports; two high-severity issues affect reproducibility and correctness of the human-arm ground truth.
Key findings
- 🟠
run.shdefaults contradict the pre-registered arm spec — run.sh:21 - 🟠 Squash-merged bot PRs classified as human commits — find-candidates.mjs:218
- 🟡 Scoring crashes on a run with no
meta.jsonor unknown id — score.mjs:56 - 🟡 Push-to-upstream protection is one remote-URL rewrite — run.sh:31
| const meta = read(join(dir, 'meta.json')); | ||
| const entry = selection.repos.find((r) => r.id === meta.id); | ||
| const repo = join(dir, 'repo'); | ||
| const human = hunks(git(repo, 'diff', '-U0', '--no-renames', entry.parent, entry.upgrade)); |
There was a problem hiding this comment.
🟡 bug · medium
Scoring crashes on a run with no meta.json or unknown id
score() reads meta.json with a fallback of undefined and immediately dereferences meta.id, throwing a bare TypeError (bench/score.mjs:56-57). A run directory can legitimately lack meta.json: bench/run.sh creates the directory and appends to key.tsv before cloning and installing, but writes meta.json only at the very end, so any set -e abort (clone, untimed install, agent invocation) leaves an incomplete run. A parseable meta.json whose id is missing from the selection file crashes the same way at entry.parent (bench/score.mjs:59). Since scoring enumerates every directory under runs/, one such run aborts scoring of all runs and no scores.json is written.
📋 Prompt for AI Agents
In bench/score.mjs function score() lines 55-59, harden the two unguarded dereferences: when read(join(dir, 'meta.json')) returns undefined (missing or invalid JSON) or selection.repos.find((r) => r.id === meta.id) finds no entry, print a warning naming the run directory and return null (filter nulls out of rows in the main block around line 142) instead of proceeding to meta.id / entry.parent, which throws a bare TypeError that aborts scoring of every run. Incomplete run directories occur whenever bench/run.sh exits via set -e before writing meta.json, and unselected ids occur when re-scoring an output dir against a different selection file.
| # Uptide's default executor model and effort (packages/core/src/llm/pricing.ts DEFAULT_MODELS, | ||
| # capabilities.ts defaultEffort), used by both arms. | ||
| # BENCH_MODEL swaps the Claude Code arm's model; Uptide always runs its default. | ||
| model=${BENCH_MODEL:-claude-sonnet-5-5} effort=medium |
There was a problem hiding this comment.
🟠 bug · high
run.sh defaults contradict the pre-registered arm spec
bench/run.sh defaults the Claude arm's model to claude-sonnet-5-5 (bench/run.sh:21), while bench/v1/arms.md fixes the Claude Code arm's model as claude-fable-5-1 before any run. The same drift affects the spend cap, where the script defaults --max-budget-usd to 6 versus the spec's 5 (bench/run.sh:53), and the prompt, which omits the two trailing sentences the spec fixes (bench/run.sh:47). A rerun of the committed script without the undocumented BENCH_MODEL, CLAUDE_CAP_USD, and CLAUDE_PROMPT_EXTRA variables silently executes a different arm than the pre-registered protocol, invalidating reproducibility and cross-run comparability of the benchmark.
📋 Prompt for AI Agents
In bench/run.sh, make the Claude-arm defaults match bench/v1/arms.md: around line 21 change model=${BENCH_MODEL:-claude-sonnet-5-5} to default to claude-fable-5-1 (keep the uptide arm forced to claude-sonnet-5-5 on line 22); around line 47 append "When done, commit all your changes on the current branch. Do not ask for review." to the prompt string; around line 53 change ${CLAUDE_CAP_USD:-6} to ${CLAUDE_CAP_USD:-5}. arms.md fixes the Claude arm's model, prompt, and $5 cap before any run, so the script's built-in defaults must match it for reruns to reproduce the registered protocol.
| if (!bot && /from \S+\/(dependabot|renovate)\//i.test(item.commit.message)) { | ||
| drop('merge of a bot pull request'); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
🟠 bug · high
Squash-merged bot PRs classified as human commits
The bot-merge guard only matches the merge-commit message form 'Merge pull request #N from owner/dependabot/...' (bench/v1/find-candidates.mjs:218). A human squash-merging a Dependabot/Renovate PR produces a single commit whose message is the PR title and whose author is the human who clicked merge, so neither the message regex nor the bot-author test (bench/v1/find-candidates.mjs:212) fires. Found through the commit-search source, the bot's major upgrade is then counted as a human upgrade in the non---bots run, contaminating the benchmark's human arm with bot-driven bumps.
📋 Prompt for AI Agents
In bench/v1/find-candidates.mjs around lines 216-221, the regex /from \S+/(dependabot|renovate)//i misses squash-merged bot pull requests because the squash commit message is the PR title and its author is the human merger. Add a structural check for each commit-search candidate before the bot-author test: look up the pull request associated with the commit (e.g. the commit's associated PRs via the GitHub API) and drop the candidate when that PR's author is a bot, in addition to keeping the message-based regex.
| git clone -q "https://github.com/$repo.git" "$dir/repo" | ||
| cd "$dir/repo" | ||
| git checkout -q -b bench-base "$parent" | ||
| git remote set-url --push origin no-push |
There was a problem hiding this comment.
🟡 bug · medium
Push-to-upstream protection is one remote-URL rewrite
The guarantee that the original repository is never written to rests solely on git remote set-url --push origin no-push (bench/run.sh:31). The Claude arm's sandbox allows all Bash commands when sandboxed and permits network access to github.com (bench/claude-sandbox.json), and the harness machine holds working GitHub push credentials (judge.sh uses them), so git push https://github.com/<repo>.git HEAD — an explicit-URL push that bypasses the origin rewrite — can reach the upstream repository, including when triggered by content the agent reads. An explicit push to the original repo violates the protocol's hard guarantee, not just its scoring.
📋 Prompt for AI Agents
In bench/run.sh after line 31, harden push protection beyond the single origin push-URL rewrite by adding git config --local url."no-push@invalid".insteadOf "https://github.com/$repo.git" and the ssh form url."no-push@invalid".insteadOf "ssh://[email protected]/$repo.git", so any push — to origin or an explicit URL — targeting the upstream repository fails even if the sandboxed agent adds new remotes. Optionally also deny such pushes in bench/claude-sandbox.json for defense in depth.
…e is not checked, not failed (UPT-122) (#260) Fixes UPT-122, from the UpgradeBench v1 pre-run (#256, issue 4, run 0e732dab). On sCypher-me/cypher-browser (lucide-react 0.468 → 1.57), `npm run build` starts with `pwsh` scripts. On machines without PowerShell it exits 127 (`sh: pwsh: command not found`) before `tsc` or `vite` run, both at baseline and after the bump. The lucide-react pack sets `requiresBuild`, so `verification.passed` was false and the run exited 1, on an upgrade that matches the human's. ## Change Builds are now compared to the baseline the same way tests are (`markPreexisting`): - `markPreexistingBuilds` (`baseline.ts`) marks a failed or timed-out build `preexisting: true` when the baseline build in the same workspace ran the same command, with the same status and the same output. Only durations (`2.4s`, `340ms`) and clock times may differ; error codes, positions and counts may not. - `fix` and `verify` skip preexisting builds in both build gates, the required-build gate included. `verify` compares against the stored `baselineBuild`. - **Verified by** row: `⚠️ build: failing at baseline, not checked`. The build details header says `(failing at baseline, not checked)`. - Verdict: `no new errors` (compared), not `verification passed`, because a build that checks nothing proves nothing. - The required-build publication blocker skips preexisting builds. Unchanged: a build that passed at baseline and fails after still fails verification, and so does one that failed at baseline but fails differently after (tested). ## Interaction with #236 (UPT-110, parent build on failure) There's no overlap. The parent build only runs when the pack does not require a build (`!needsBuild`), and it already reports `already failing before this upgrade` without failing the run. When the build is required, or there's no pack, the baseline build was taken on the same commit before anything changed, so it plays the parent's role. No second parent build is added. ## Decisions to flag - **A required build failing at baseline no longer blocks publication.** This follows "compare the build to the baseline as tests are": a test failing at baseline doesn't block a packed run either. The cost is that a contract only the bundler would catch (lucide deep imports) goes unchecked on such repos. The PR says so in its **Verified by** row, and the verdict is `no new errors`, not `verification passed`. Say if you want a required build that wasn't checked to keep blocking publication, or to open as a draft. - **Without a pack, it still does not publish.** It adds `no pack yet: the build fails, already before the upgrade, so it cannot verify it`, the same rule as for tests failing at baseline. Before this change the run failed verification instead. - **"The same way" is a match on the whole output with only durations and clock times normalized**, not on the first error line: the pwsh output has no `error` line at all. A failure output that varies in any other way falls back to today's behavior (fails), which is the safe direction. ## Reproduction - **Fork** (`uptide-bench/sCypher-me--cypher-browser` at `9e770c9e`): after `npm ci --ignore-scripts`, Uptide's own `buildWorkspaces`, run twice, gives the same `failed` result both times (`sh: pwsh: command not found`), and `markPreexistingBuilds` marks the second one preexisting. The full `fix` run, with the paid agent, was not rerun. - **Fixtures:** `required-build.test.ts` (the pwsh output, which differs only in its duration, fails the same way at baseline and after → passed, compared, published; it fails differently → still fails) and `generic.test.ts` (no-pack case → passed, blocked by the new no-pack reason). Both "same way" tests fail without the fix. Two existing tests that mocked a build failing identically at baseline now pass at baseline, so they still test "broken by the upgrade". ## Checks `pnpm typecheck`, `pnpm lint` and `pnpm test` all pass (core: 2370 passed, 32 skipped; CLI: 536 passed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Lucas Braum <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…rtial edit (UPT-123) (#261) UPT-123. In the UpgradeBench v1 pre-run (#256, lion-reader, run 3caac4a1), the agent "kept v10 behavior" on `@sentry/nextjs` 11 with `cookies: { deny: ["-ip", "forwarded"] }`. As a deny list, that sends every other cookie, session cookies included. It also left `urlQueryParams`, `queues` and `graphQL` at v11's defaults. No check caught it. ## What changes - **Behavior record `data-collection-defaults`** (ADR 0017), filed under each Sentry lead (`@sentry/nextjs/data-collection-defaults`, …), in `packs/sentry/records.json`. - **Sources:** quoted from the migration guide at tag 11.7.0. The guide is MIT, vendored as `sources/MIGRATION-11.7.0.md.txt` like zod's snapshots, so the contract test checks quotes and sha256 offline. - **`keepOld`:** the guide's "preserves the v10 default" block, `exact`. - **Sites** (`check`, and `fix` before the session): `Sentry.init` options, plus options objects typed as Sentry's, with no `dataCollection` and `sendDefaultPii` unset or `false`. They are resolved with the checker: - through consts, imports, the function that returns the options, conditional spreads, and typed spreads (a `...config` whose type has no `dataCollection` hides nothing); - including `import('@sentry/react').then(({ init }) => …)`, which needs Promise, so the program uses `fix/verify`'s `bundledHost` libs, now exported. - **Not sites:** `sendDefaultPii: true`, an existing `dataCollection`, `enabled: false`, test files, nested packages, and spreads the checker can't see. - **Decision:** a computed `sendDefaultPii`. - **Kept** (`fix`, after the session): only when every category is at least as restrictive as the baseline: - `userInfo`, `cookies`, `databaseQueryData`, `queues` set to `false`; - `httpBodies: []`; - `genAI` and `graphQL` both off; - headers and query parameters `false`, or a deny list holding every baseline key. A cookie deny list, a category left at v11's default, or a value the checker can't see leaves the site open. The PR body then says "Not applied at …" with the exact edit, instead of reporting it kept. - **Agent.** A new prompt rule: to keep an old privacy or data-collection setting where no cited edit gives the exact value, choose the most restrictive option (`false`) and say so in decisions, or leave it as a decision. Never a partial deny list. The Sentry pack instructions say the same for `dataCollection`. ## Repro on the bench fork `dataCollectionSites` on uptide-bench/brendanlong--lion-reader: | state | phase | open sites | |---|---|---| | parent `57c03c32` | before | `src/lib/sentry/client-sdk.ts:13`, `src/server/sentry.ts:96` | | human `cb4729a7` (constant in `data-collection.ts`, server options moved into a function) | after | none (kept) | | Uptide run 3caac4a1, head `b3276715` (cookie deny list) | after | both still open | `data-collection.test.ts` covers the same cases as fixtures: the partial edit stays open, and the human's imported constant plus options function counts as kept. It also covers the no-site cases, the decision cases, the lazy import and typed spreads, and the prompt and PR-body text. ## Measurement (silent ground truth, from each upgrade's diff) lion-reader stays out of `ground-truth.json`. Ground truth comes from the packs' existing public upgrades, labelled from each human's diff after the record was written. `required` means the human set a restrictive `dataCollection` at that init (moved files and imported constants included). `product-choice` means the human upgraded the init and accepted v11's defaults. | pack | silent TP | FP | FN | status | |---|---|---|---|---| | `@sentry/nextjs` | 9 | 0 | 0 | verified | | `@sentry/browser` | 4 | 0 | 0 | verified | | `@sentry/react` | 11 | 4 | 0 | candidate (already, with 3 breaking FPs) | - **The react FPs:** - cleanslate, ricochet-app and cucumber-reports upgraded with no `dataCollection` (`product-choice`). - Hyrox-Companion's server init: that upgrade kept `@sentry/node` at 10, the same release-group move behind its breaking FP. - **How I checked recall:** I scanned every upgrade's diff for added `dataCollection`. That scan found the lazy-import, conditional-spread and typed-spread misses, which are fixed here. - **CI:** react's job stays a warning through the existing `FP_CANDIDATES` path. `verification.json` was re-recorded for all three; react's also gains the coverage fields it predated, so `docs/compatibility.md` shows them. ## Decisions for you - **Labelling humans who accepted v11's defaults.** Should a human who upgraded and accepted the permissive defaults be `product-choice`, so the record is a false positive there (what I did, per `docs/packs.md`)? Or `required` (the human shipped the same widening)? `product-choice` is the conservative reading, and it keeps react's record at candidate. - **`frameContextLines`.** The guide's baseline leaves it at 5 (v10: 7). It is fewer source lines, not more data, so `keepOld` stays `exact` as the guide calls it. - **lion-reader's bench entry.** It belongs in #256's `bench/v1/pre5/selection.json`, which is not on main, so it isn't in this PR. From the human's diff (`57c03c32` → `cb4729a7`): ```json "silent": [ { "file": "src/lib/sentry/client-sdk.ts", "line": 13, "record": "@sentry/nextjs/data-collection-defaults", "keep": "cookies:\\s*false|SENTRY_DATA_COLLECTION" }, { "file": "src/server/sentry.ts", "line": 96, "record": "@sentry/nextjs/data-collection-defaults", "keep": "cookies:\\s*false|SENTRY_DATA_COLLECTION" } ] ``` The `keep` regex has to accept the human's shape, a constant imported from another file. `score.mjs` reads only the site's file. ## Checks `pnpm lint`, `pnpm typecheck`, `pnpm test`, `pnpm docs:packs --check`, and `uptide pack test` for sentry-nextjs, sentry-browser and sentry-react, all run locally. The local pnpm 12 shim and git-lfs pass-through are machine-only; no repo change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Lucas Braum <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
UpgradeBench v1 pre-run (UPT-24): 5 repositories Uptide has never seen, two arms, once each.
Selection first:
bench/v1/repos.mdholds the rule, its 2026-10-19T10:04Z amendment and every dropped candidate.bench/v1/arms.mdfixes both arms. Both were committed and pushed in 018e1ce before any arm ran.The amendment: a second source, merged Renovate/Dependabot major bumps a human fixed before merge. Human commit search alone found too few qualifying upgrades. The amendment also states "tsc clean at parent" and "license OK" explicitly.
Harness:
BENCH_SELECTIONpoints the scripts atbench/v1/pre5/selection.json.[email protected]runs with--max-cost 1, and the Uptide arm stays on Sonnet whenBENCH_MODELchanges Claude Code's model.--json, a fix found during the run that caused the one rerun.Results (
bench/v1/pre5/results.md)frontend/not foundresults.mdalso holds four Linear-ready Uptide engine issues, which aren't fixed here:packageManagernpm pin refuses a run that would install fine.Forks are only in uptide-bench. Nothing was pushed, commented or opened upstream.
🤖 Generated with Claude Code