Repository navigation
fix(fix,zod): TS 7 libs in the fix type-check, uuid() as breaking (UPT-100) - #219
Merged
lucasbraum merged 1 commit intoOct 18, 2026
Merged
Conversation
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.
Closes UPT-100.
On calmcp (zod 3.25.76 → 4.6.5, from the #169 bench), Uptide reported 5 pre-existing type errors on a repository whose own
tscis clean at the parent commit. It also sent every site to the agent.1. False baseline errors (TypeScript 7 libs in the fix type-check)
calmcp runs TypeScript 7.0.2, which ships no compiler API and no
lib.*.d.ts, sofixtype-checks it with the bundled compiler. Its tsconfig hastarget: "ES2022"andlib: ["ES2023"]. The fix phase's host (verify.tsbundledHost) served only the libs a probe program with that target had loaded, andlib.es2023.d.tswas not one of them. That produced TS6053 (/__uptide_lib__/lib.es2023.d.tsnot found) and 4 × TS2550 (Object.hasOwn). UPT-73 fixed the same gap in the analysis (compile.ts), but not in the fix phase's own checker.Fix:
bundledHostloads any lib by name throughcompile.ts'sbundledLib, the same source the analysis uses. Fixture:verify.test.ts, a TS 7-style install withlib: ["ES2023"]undertarget: "ES2022"usingObject.hasOwn. It failed before the fix (TS6053, TS2304Object) and passes now.2. No zod rule fired (
uuid()→guid())Reach and import shape were fine:
checkfoundsrc/tools/create.ts:20 z.string().uuid()asZodString#uuid, fixabilitymechanical. The type diff calls it deprecated, though, andfixselects only breaking sites unless--include-deprecatedis set, sostring-formatnever saw it. The agent then changed it during the verification-feedback round, after 4 tests failed.But
uuid()is a behavior change, not only a deprecation: zod 4'suuid()also checks the RFC version and variant, so ids zod 3 accepted stop validating. That is what broke calmcp's tests.Fix: the zod pack's
foldFindingsmarksZodString#uuidsites breaking (evidencepack, with that reason).string-formatrewrites them toz.guid()without the flag. The other formats (email, url, datetime, base64) stay deprecated and flag-gated. The rule id is unchanged, so ground truth and per-rule scores still line up. Fixture:zod.test.ts, the calmcp shape (const uuid = z.string().uuid()) is promoted and rewritten flagless, andemail()is not..errors→.issuesdid not fire because calmcp has no.errorsreads (nothing to match), not because of a bug.Bench: calmcp, Uptide arm only, before / after
Same harness (
bench/copied from the #169 branch, uncommitted, unchanged), same model (claude-sonnet-5-5, medium), same caps ($1 Uptide budget), same parent commit, andbench/check.shfor the final checks. Before = this branch's base (origin/main 195ae10). After = this branch. One run each.check.sh)create.ts:20bystring-format)uuid()→guid()made byPhases (ms, cost):
The 5 agent-led sites in
src/tools/zodDoc.tsare type-level code over zod internals (ZodTypeAnyparameters,_def,.description). They match the zod pack'stypesrule, which is agent work by design, so they stay agent-led.Not fixed here (follow-up)
The remaining feedback round in the after run is spurious.
verification.buildkeeps the build result from right after the bump (tsc -p tsconfig.jsonfailing onzodDoc.ts), not the build at the final head. At the final head,tsc -p tsconfig.jsonexits 0. The feedback agent got that stale error, found nothing to fix and made no edits. The PR body also says "Build … failed". The before run (and the #169 rerun, "❌ build") has the same defect.Checks
pnpm --filter @uptide/core exec vitest run: 186 files, 2253 passedpnpm typecheck,pnpm exec biome check .: clean (existing warnings only)uuid()sites in the ground truth now count as breaking instead of deprecated, which may move zod's breaking counts inverification.json. Not run locally.No fork PRs were made for these two runs. Nothing was pushed outside this repository.
🤖 Generated with Claude Code