Repository navigation
feat(fix): say when the baseline is unhealthy and verification can only compare - #98
Merged
Merged
Conversation
… compare On a repository that does not type-check before the upgrade, `fix` said "verification failed", which read as Uptide's fault. It now measures the baseline (type errors, failing test runs, TS2307 grouped by path alias or package), puts an unhealthy baseline first in the terminal summary and the PR body, reads `no new errors` instead of `verification passed` when such a run adds nothing, and splits a failure into errors introduced by the upgrade and pre-existing ones. The gate is unchanged. `check` prints the pre-existing count under each compiled package, and the stored report carries `verification.baselineHealth`. 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]>
Merged
lucasbraum
pushed a commit
that referenced
this pull request
Oct 13, 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] ### Patch Changes - [#98](#98) [`ef7a1ae`](ef7a1ae) Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` measures the repository before the upgrade and says first when it is unhealthy: "this repository does not type-check before the upgrade (205 errors, 129 from missing modules: …); verification can only compare, not prove". On such a baseline, a run that adds no error reads `no new errors` instead of `verification passed`, and a failing run says how many type errors the upgrade introduced and how many were already there. The gate is unchanged. `check` prints the pre-existing type errors under each compiled package, and the stored report carries `verification.baselineHealth` (type errors, failing test runs, missing modules grouped by path alias or package). Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
Merged
lucasbraum
pushed a commit
that referenced
this pull request
Oct 13, 2026
…om pre-existing publicationBlockers said "verification failed: N new type errors" and listed every failing test run, including runs that were already failing before the upgrade. On an unhealthy baseline that blames the migration for what was already broken. It now uses #98's wording: "N type errors introduced by the upgrade, M pre-existing", and names a pre-existing failing run as "already failing before the upgrade". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RniwUAvitpghJF4MuodRZz Signed-off-by: Claude <[email protected]>
7 tasks done
lucasbraum
added a commit
that referenced
this pull request
Oct 13, 2026
…mp; the App's bot as commit author (#107) UPT-19 ## What and why The rest of the engine work behind the first Action run on uptide-test/saas-starter-kit. There is one commit per item; each can be reviewed on its own. ### 1. Companions analyzed at the versions their lead gives them (`fix(check)`) **Cause.** No later companion plan overrode react-dom. The plan was correct: react moved `react-dom` and `@types/react` to 19. The bug was in how `check` builds the lead's group for each workspace. It built the group only from the workspace's *analyzable* packages, and that list leaves out `@types/*` and anything the workspace never imports. In a Next app, `react-dom` is never imported and `@types/react` is types-only, so both fell out of react's group before analysis. Each then hit the "type-only / never imported, skipped" early return, which reports the **installed** version as the target. That produced `18.3.1 → 18.3.1, up to date`. #104 fixed only how this was shown, not the cause. Reproduced locally on boxyhq/saas-starter-kit @abc9b68 (`npm ci --ignore-scripts`). I ran the same `check` the Action makes, with the first 10 used packages from `uptide list` (next, next-i18next, @prisma/client, react, svix, zod, stripe, react-i18next, @sentry/nextjs, nodemailer): | | before | after | | --- | --- | --- | | `react` | `18.3.1 → 19.3.0`; react-dom and @types/react only in `companions` | `18.3.1 → 19.3.0`, members `@types/react 18.3.13 → 19.3.0`, `react-dom 18.3.1 → 19.3.0` | | `react-dom` | own row, `18.3.1 → 18.3.1 not-imported` | no own row: analyzed in react's group | | `@types/react` | own row, `18.3.13 → 18.3.13 not-imported` | no own row: analyzed in react's group | | `nodemailer` | `@types/nodemailer` in `companions` only | members `nodemailer`, `@types/nodemailer 7.0.4 → 8.0.2` | **Fix.** - A lead's companions join its group whether or not the workspace imports them, and they are no longer skipped on their own. - In `checkGroup`, a companion with no usages of its own is linked into the target overlay, and the baseline, at the version the plan gives it. That is the install `fix` makes. It is also listed in the report's `members`. - A types package that the lead is typed through (`@types/react` for `react`) is linked once, as the lead's declarations. Linking it twice failed with `EEXIST` on the real repo. - The Action gives a companion analyzed this way its own row, `moves with react`, as #104 does for the old shape. ### 2. `verification.typecheck.afterUpgrade` (`feat(report)`) These are the errors right after the version bump and before any fix: the `verification.target` that `fix` already records. - `uptide.run/v1` and `schema/uptide.run.v1.json`: optional and additive, next to `before` and `after`. - Job summary: `types 0 → 4 with the upgrade → 0 after Uptide`. - PR body and terminal: `✅ the upgrade broke 4 · Uptide left 0`. When the baseline had errors, it adds `(1 pre-existing, not counted)`. "Broke" counts errors after the bump that the baseline did not have. The bump moves no source line, so they compare as they are. - README and `docs/commands/fix.md` examples are updated to the new line. ### 3. Commits authored by the App's own bot (`fix(action)`) The Action resolves the bot with the installation token: - The slug comes from the token-exchange answer (`appSlug`, read when present). Otherwise the Action tries `GET /app` with the installation token, if GitHub answers it. - The id comes from `GET /users/<slug>[bot]`, which must answer with that exact login. Commits in `fix` and in `uptide pr` are authored and committed as `<slug>[bot] <<id>+<slug>[bot]@users.noreply.github.com>`. If the identity cannot be resolved, they keep `uptide[bot] <[email protected]>` and the job log gets a `::warning`. The token never appears in a URL or message. `docs/ci.md` describes this. **Needs the app side:** GitHub documents `GET /app` as JWT-only, so the reliable source is the Uptide app adding `appSlug` to its `/api/action/token` answer. Until it does, expect the fallback and its warning. ### 4. `verification.baselineHealth` in `uptide.run/v1` (`feat(report)`) Counts only: `typeErrors`, `failingTests`, `missingModules { local, packages }`. These are the TS2307 errors among the baseline's errors, split between the repository's own paths (relative imports, path aliases) and packages. No specifier or alias group name leaves the fix report, and a test checks that. The field is optional, and the schema is regenerated. The `uptide/report` declarations embed the schema as a literal type, so items 2 and 4 together pushed `index.d.ts` to 17.3 KB. Its budget in `libs-export.test.ts` goes from 16 KB to 20 KB; the JS budget is unchanged at 9.8 of 24 KB. ### 5. Refusal wording (`fix(publish)`) `publicationBlockers` now uses #98's words: `1 type error introduced by the upgrade, 2 pre-existing` instead of `1 new type error`. A test run that was already failing before the upgrade is named `tests in X already failing before the upgrade`. Before, it was listed as a failure of the migration. ### Sample job summary: a stripe fix run Rendered by `renderSummary` from the stripe fix fixture in this repo (`packages/core/src/fix/__fixtures__/stripe.json`: 0 errors before, 4 after the bump, 0 after), with the versions set to 17.7.0 → 23.0.0: ```markdown | Package | Upgrade | Status | Breaking sites | Verification | Pull request | LLM cost | | --- | --- | --- | --- | --- | --- | --- | | `stripe` | 17.7.0 → 23.0.0 (major) | fixed | 4 | types 0 → 4 with the upgrade → 0 after Uptide, lint 0 → 0, no tests | [#2](https://github.com/acme/saas/pull/2) | $0.05 | ``` ## How it was verified - **Item 1:** `check/companion-group.test.ts` is a synthetic `ui` / `ui-dom` / `@types/ui` repo shaped like react. It checks one report with all three members at 2.0.0, `[email protected]` fetched into the overlay, and `@types/[email protected]` fetched once. It fails on main and passes here. The real-repo before and after are in the table above. `action/run.test.ts` checks companion rows when `check` returns only the lead. - **Item 2:** `run-report/report.test.ts` covers the new field, the summary wording, a report without the field, and schema rejection of a negative value. The PR-body snapshots and terminal tests are updated. - **Item 3:** `action/github.test.ts` covers the slug from the exchange, the `GET /app` fallback on a GHE API URL, and undefined for: no slug, a malformed slug, 404, network down, another login, a non-integer id. `oidc.test.ts` covers `appSlug` from the exchange and `engineEnv` / `publishEnv` with an identity. `run.test.ts` checks the bot passed to `fix` and `pr`, and the fallback with its warning. - **Item 4:** `report.test.ts` checks the counts, that no module or alias name appears, and that older reports still validate. - **Item 5:** `publish.test.ts` covers an unhealthy baseline with one new and one pre-existing failing run. - `pnpm lint && pnpm typecheck && pnpm test` pass: core 1387 passed (32 skipped), CLI 433 passed. Lint shows one warning, an unused import in `fix/report.test.ts` that is already on main. `scripts/public-tree.mjs` and `scripts/check-links.mjs` are clean. `scripts/private-material.mjs` needs the `UPTIDE_PRIVATE_DENYLIST` secret, so it runs in CI. ## Checklist - [x] Tests for the change (a bug fix starts with a failing test) - [x] `pnpm lint && pnpm typecheck && pnpm test` pass - [x] README and docs updated if behavior changed (`README.md`, `docs/ci.md`, `docs/commands/fix.md`) - [x] Changeset added if a user would notice (one per item) - [x] No new dependency, or it was agreed in an issue - [x] No private code, names or paths in fixtures, tests or docs - [x] The rules in CONTRIBUTING.md ("Rules that do not bend") still hold 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RniwUAvitpghJF4MuodRZz --- _Generated by [Claude Code](https://claude.ai/code/session_01RniwUAvitpghJF4MuodRZz)_ --------- Signed-off-by: Claude <[email protected]> Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UPT-25.
On a repository that does not type-check before the upgrade,
fixprintedverification failedwith nothing to say the repository was already broken, so it read as Uptide's fault. papermark/papermark @ed19717 has 205 type errors before anything changes.What changes
packages/core/src/fix/baseline.ts), measured from whatfixalready collects before the bump: type errors, test runs that failed or timed out, and TS2307 grouped by where the specifier points (a path alias folder like@/ee/, or a package).verification passed, as beforeno new errorsverification failed: N type errors introduced by the upgrade, M pre-existing(205 pre-existing, 56 introduced by the upgrade).passedand the exit code are computed exactly as before, so it stays strict for healthy baselines. An unhealthy baseline only changes the wording.checkprints the pre-existing count on the coverage line under each compiled package.verification.baselineHealth={ healthy, typeErrors, failingTests, missingModules: [{ under, errors, modules }] }. The field is optional; stored runs without it are measured frombaselineandbaselineTests(baselineHealthOf).Files PR #92 touches (
core/src/action,fix/publish.ts,run-report/*) are untouched.publish.tsstill says "verification failed" when it refuses to publish; changing that wording is left for after #92.papermark @ed19717,
--no-llmRun locally on a scratch clone,
uptide fix zod zod-openapi --target 4.6.7 --no-llm(zod-openapi because check reports it as a peer blocker). Nothing pushed, no PR opened there.Before:
After:
PR body head:
check zodon the same tree:With
--no-llm, 53 of 57 sites stay manual, so this run still fails on its own errors (56 introduced). It now says so instead of blaming the repository's 205.Notes for review
@/ee/; the rest are@/lib/(11),@react-email/components(8) and@/public/(2).tscon the ungenerated tree reports 1596. Check's line says "in these files" to keep the scope visible.preexistingand didn't fail the gate; now they show in the headline too.Tests
baseline.test.tsbuilds healthy, unhealthy and missing-module repositories on disk (a@/*path alias and an undeclared package) and measures them with the samediagnosticsfixuses. It covers health, grouping, headline, verdict, the PR body and the Types cell, plus a stored run without the field. The CLI tests cover the warning line and verdict in the fix summary and the check line. The storefront-zod snapshot gains the warning and the split Types cell.pnpm test,pnpm typecheck,pnpm lintandpublic:checkall pass.🤖 Generated with Claude Code