Skip to content

fix: a repo build the upgrade broke opens only as a draft that says so (UPT-110) - #236

Merged
lucasbraum merged 2 commits into
mainfrom
lucasbraum/upt-110-parent-build
Oct 18, 2026
Merged

lucasbraum merged 2 commits into
mainfrom
lucasbraum/upt-110-parent-build

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #233 (UPT-110).

What and why

#233 runs the repository's build on the final head when the pack doesn't gate on it, and reports the result without blocking. So a PR could open as ready for review with ❌ build … in its checks. This PR doesn't add a baseline build to every run. Instead, a failing head build is compared with the parent commit.

Change

  • Parent build, only when the final-head build fails (run.ts, buildAtParent). It runs in the same clone: git switch --detach <baseHead>, frozen install, generated clients, build. Then it resets, switches back to the branch, and reinstalls and regenerates.
    • Parent fails too: not blocking. The build line reads ❌ build: <first error> — already failing before this upgrade (not required by the pack).
    • Parent passes: the upgrade broke the build. verification.passed is false and the verdict reads verification failed: build broken by this upgrade. The PR body opens with > ❌ **Build broken by this upgrade.** … (in the shortened body too). The build line ends — broken by this upgrade.
  • Draft, not refused. verification.buildBroken is set only when the broken build is the run's sole failure. In that case publicationBlockers lets it through, and publish forces --draft (and gh pr ready --undo on an open PR), the same way it handles agent-led drafts. If other checks also fail, the run is refused as before.
  • verify (reverify.ts) keeps the stored parentBuild while its own head build still fails (the parent commit hasn't changed), and drops it once the head builds.
  • No duplicate head build. Before the head build, the consumed builds are brought up to date (no-op when the tree is unchanged). Any workspace they already built on this head is skipped. The verification build case is unchanged: it already skips the head build entirely.

Decisions to flag

  1. The UPT-104 build counts are one above pre-fix: the PR's build line states the build's result, never "not required" in its place (UPT-110) #233, not equal to them (agreed in review: 4 / 3 stays). The duplicate (packages/internal built twice on the head) is gone. The root is still built once, because no other build covers it on the head, and that's the build this check is for. Counts: judged-on-head 3 → 5 (fix: the PR's build line states the build's result, never "not required" in its place (UPT-110) #233) → 4; nothing-changed 2 calls / 2 runs → 3 / 4 (fix: the PR's build line states the build's result, never "not required" in its place (UPT-110) #233) → 3 / 3. Getting back to exactly 3 / 2 would mean not building the root at all.
  2. A parent that can't be checked out, installed or built is recorded as verification.parentUnchecked (for example install failed: <first line>). The run still fails and publishes only as a draft. The PR opens with > ❌ **Build fails on this upgrade; the parent build could not be checked (<reason>).**, the build line ends — the parent build could not be checked, and the verdict says the same. Nothing claims the parent passed.
  3. The clone's build output is the parent's after the comparison. Nothing later in fix reads it, and verify builds again. Marked ponytail:.
  4. The GitHub Action publishes agent-led runs whose verification passed (every Action PR is a draft through uptide pr). A run whose only failure is the broken build now opens the same way: its gate is passed || buildBroken, so the PR is a draft with the banner at the top. Its run-report row stays failed with verification failed: build broken by this upgrade (or the build fails and the parent build could not be checked) and links the PR.
  5. Not covered: verify doesn't build the parent itself (ReverifyServices has no install). If a head passed in fix and fails in verify, it gets the fix: the PR's build line states the build's result, never "not required" in its place (UPT-110) #233 behavior: reported, not blocking. Runs that already gate on the build (generic, requiresBuild) are unchanged: their failing build still refuses publication.

Tests

  • required-build.test.ts: two fixtures. The build mock fails on the branch and tells the parent apart by detached HEAD.
    • Parent also fails: built on the branch then the parent, two frozen installs, back on the branch at the verified head, — already failing before this upgrade in the line, passes, no blockers.
    • Parent passes: fails, buildBroken, verdict text, body opens with the banner, no blockers (refused without buildBroken). verify keeps it while the head fails and drops it once the head passes.
  • publish.test.ts: a buildBroken run publishes with --draft even when draft: false is passed.
  • required-build.test.ts, third fixture: the parent's install throws. The run never builds at the parent, comes back on the branch, fails with parentUnchecked: install failed: …, the body opens with the "could not be checked" banner and never says "passed at the parent", and it publishes as a draft.
  • action/run.test.ts: a build-broken run is published by the Action, with a failed row that links the PR and names the reason.
  • fix.test.ts: the UPT-104 tests and "records baseline builds…" assert the head build of ['.'] only, with the counts above.
  • pnpm lint (only the warning and info already on main), pnpm typecheck, pnpm build, then core 2300 passed / 32 skipped, cli 517 passed (second commit). No bench runs.

🤖 Generated with Claude Code

lucasbraum and others added 2 commits October 18, 2026 12:00
…o (UPT-110)

When the final-head build fails, fix builds the parent commit in the same
clone (its own frozen install and generated clients, the branch's restored
after). Parent fails too: the build line says "already failing before this
upgrade" and nothing blocks. Parent passes: verification fails, the PR is a
draft and opens with "Build broken by this upgrade". verify keeps the stored
parent result only while its head still fails.

The head build no longer rebuilds a workspace the consumed builds already
built on that head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
… build-broken drafts (UPT-110)

A parent that can't be checked out, installed or built is recorded as
verification.parentUnchecked with the reason. The run still fails and
publishes only as a draft, and the PR says "Build fails on this upgrade; the
parent build could not be checked (<reason>)". It never claims the parent
passed.

The Action opens agent-led runs whose verification passed as drafts. A run
that only failed on a build the upgrade broke now opens the same way: a
draft, with the banner at the top. Its run-report row stays failed and names
the reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum force-pushed the lucasbraum/upt-110-parent-build branch from 459fb83 to 3f4f453 Compare October 18, 2026 19:04
@lucasbraum
lucasbraum merged commit 9b35b9d into main Oct 18, 2026
28 checks passed
@lucasbraum
lucasbraum deleted the lucasbraum/upt-110-parent-build branch October 18, 2026 19:20
@uptide-release uptide-release Bot mentioned this pull request Oct 18, 2026
lucasbraum pushed a commit that referenced this pull request Oct 18, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#237](#237)
[`717468a`](717468a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `npx uptide fix`
gets the Agent SDK executor. The package stays as small as before:
`@anthropic-ai/claude-agent-sdk` is not installed with Uptide. An SDK
installed next to Uptide is used as it is; otherwise the first `fix`
that needs it installs the version Uptide is tested with into Uptide's
cache (`~/.cache/uptide/agent-sdk/<version>`), says so in one line with
its size, and later runs reuse it. When that install fails (offline, a
proxy) or the SDK cannot run, `fix` runs the patch executor and says so
on the first line of its output and at the top of the PR body, with the
reason and how to get the SDK executor. `report.json` records
`llm.executor` and, after a fallback, the reason in `llm.sdkMissing`.
The privacy notice names the SDK only when the SDK will run, and the LLM
line names the executor. `--agent sdk` without a usable SDK stops before
any work instead of failing mid-run.

- [#239](#239)
[`e1e8c40`](e1e8c40)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide fix` runs
only with the Claude Agent SDK; if it can't, it doesn't run. Before the
first download, an interactive terminal asks once: `uptide fix needs the
Claude Agent SDK (about 300 MB, downloaded once to <cache>). Download
now? [Y/n]` (default yes). With `--yes`, or without a terminal, it
downloads and says so in one line. Once cached, it never asks again.
Answering `n`, an SDK that can't be fetched or loaded (offline, a proxy,
no binary for the platform), a missing `ANTHROPIC_API_KEY`, another
provider, or `llm.enabled: false` / `executor: patch` in `uptide.yml`
all stop `fix` with exit 2 before any clone or spending. The run prints
one message with the reason and the fix, and `--json` returns it as
`error.code: "SDK_UNAVAILABLE"`. There is no fallback to the patch
executor anywhere: the Uptide Action stops the run with the same
message. `--no-llm`, `--agent` and `--provider` are gone from help and
docs. `llm.sdkMissing` is gone from `report.json`, and `uptide init` no
longer writes `executor`.

### Patch Changes

- [#236](#236)
[`9b35b9d`](9b35b9d)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - A repository
build that fails on the final head is no longer published as a ready PR.
When it fails, `fix` builds the parent commit in the same clone to
compare. If the parent fails too, the build line says "already failing
before this upgrade" and nothing is blocked. If the parent passes, the
upgrade broke the build: verification fails, and the PR opens only as a
draft with "Build broken by this upgrade" at the top. If the parent
can't be checked out, installed or built, verification still fails and
the PR says "Build fails on this upgrade; the parent build could not be
checked" with the reason, never that the parent passed. The GitHub
Action opens these runs as draft PRs, the same way it opens agent-led
runs. The head build also skips workspaces already built on that head,
so a workspace whose output a consumer reads is no longer built twice.

- [#233](#233)
[`1ad8071`](1ad8071)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The PR
description's build check now gives the build's actual result: passed,
failed with its first error, or not run and why. When a migration pack
doesn't require a build, `fix` still runs the repository's build once on
the final head, and `uptide verify` runs it again, and reports what
happened. "Not required by the pack" now appears next to that result
instead of replacing it. Before, the line read "build not required" even
when the repository's build failed. A build the pack doesn't require
still doesn't block verification or publishing.

- [#238](#238)
[`6f07d3f`](6f07d3f)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - An SDK session's
edits are no longer thrown away because of one flaky test. Before the
gate rejects a session on test failures, it runs the failing test files
once more, alone, with their runner and the same isolation as the full
run. A file that passes then is recorded as flaky (`llm.tasks[].flaky`
in `report.json`, and a line in the PR body's review list) and the edits
stay. A file that fails twice still rejects them, and a failure that
names no test file (a build, a timeout) is never rerun. Final
verification keeps its full gate: it runs the flaky files again, and if
one fails there, verification fails and the PR body says so. `fix` also
stops starting verification feedback sessions when what is left of
`--max-cost` is below the mean cost of the run's sessions so far, so it
no longer starts a session it can't afford; the PR's feedback line says
when this happened.

- [#234](#234)
[`066deab`](066deab)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` on npm no
longer loses a package the repo imports without declaring it when the
ERESOLVE retry re-resolves the lockfile. If the retry drops such a
package from the top of `node_modules`, it runs again keeping that
package and the locked packages that require it at their old versions;
if that conflicts, the first retry stands. Either way the summary and
the PR body name the package under "Imported but not declared" and
suggest adding it to package.json. `fix` never adds it for you.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
lucasbraum added a commit that referenced this pull request Oct 19, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant