Repository navigation
feat(check): fold downstream compile errors into the breaking site they come from (UPT-99) - #222
Merged
lucasbraum merged 4 commits intoOct 18, 2026
Conversation
lucasbraum
force-pushed
the
lucasbraum/upt-95-ground-truth-generators
branch
from
October 18, 2026 00:59
34419e2 to
daacbbe
Compare
lucasbraum
force-pushed
the
lucasbraum/upt-99-fold-cascade-diagnostics
branch
from
October 18, 2026 00:59
6f92c13 to
f86fe3c
Compare
… from (UPT-99) Declares the rule before any re-score: a new compile error whose value the compiler traces (declarations, destructuring, any receivers, returned object members, repository function calls) to the expression of another new, breaking error folds into that finding as a downstream error. The default view counts them, --details and --json list them, fix still verifies against every diagnostic, and pack test scores them as neither hit nor false positive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…ey come from (UPT-99) A new compile error whose value the compiler traces to another new error's expression is that site's consequence. flowOrigin (cause.ts) follows the value back through variable and destructured declarations, a callback's any receiver, returned object members, casts to a type whose import is itself a new error, and calls of repository functions whose changed returns all lead to such an expression. Types are compared by an order-free shape, since the two programs list members and union or intersection constituents differently. There is no line-distance fallback: no trace, no origin. check keeps the origin on the unattributed finding and, once the pack has run, foldConsequences moves it into the innermost breaking finding at that position as a downstream error, recounting the verdict. The plan counts them per group (+N downstream errors), --details lists them under their root, --json carries them as downstream. They are not sites, so fix selects only the root. fix verification still compiles everything. Fixtures: issues-v1/v2, where a .errors read folds its map(e => e.message) and narrowing errors, a removed import in the same file stays, and a call whose return changed elsewhere is not followed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
…UPT-99) pnpm uptide pack test zod --write, then pnpm docs:packs. With #218's generator step and this branch's folding: breaking found at any severity 216/249, as breaking 117/249, 0 breaking false positives, verified, the numbers CI measured for this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lucas Braum <lucasbraum@gmail.com>
lucasbraum
force-pushed
the
lucasbraum/upt-95-ground-truth-generators
branch
from
October 18, 2026 04:30
daacbbe to
f64e72f
Compare
lucasbraum
force-pushed
the
lucasbraum/upt-99-fold-cascade-diagnostics
branch
from
October 18, 2026 04:30
f86fe3c to
d68c342
Compare
lucasbraum
merged commit Oct 18, 2026
d2f42e8
into
lucasbraum/upt-95-ground-truth-generators
28 checks passed
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.
Closes UPT-99. Stacked on #218 (base:
lucasbraum/upt-95-ground-truth-generators).Rule first. The folding rule went into docs/concepts.md ("One root cause, one finding") and docs/packs.md (Scoring) in 2cb4eef, before any scoring run. The engine change is 7f66699.
What changes
A new compile error whose value the compiler traces to another new error's expression is that site's consequence. It folds into the breaking finding there as a downstream error. It no longer counts as a breaking site of its own.
Tracing is compiler-only (
flowOrigin, adapters/typescript/cause.ts). It starts at the expression at the error and follows the value back through:anyreceiver (errors.map(e => …));as SafeParseReturnType<…>);A call is followed only when every return whose type changed between the installed program and the target leads to such an expression. Types are compared by an order-free shape (members, unions and intersections sorted), because the two programs print the same Prisma payload types in a different member order. There is no line-distance fallback: no trace means no origin.
Folding (
foldConsequences, check/root-cause.ts) runs per workspace after the pack has run. The root is the innermost breaking finding (not a cause cluster) whose span holds the origin. Chains go to the first root, and loops don't fold. A diagnostic with no breaking finding at its origin stays as it was. The verdict is recounted.Output:
49 sites, +54 downstream errorson the rule's line;--details: each folded error listed under its root;--json: the root finding'sdownstream, plusplan[].downstream.Downstream errors are not sites, so
fixselects only the root. Cause clusters no longer leak theirdownstreamonto their expanded sites.fixverification is unchanged: it still compiles the whole workspace and compares every diagnostic with the baseline. Folding changes what is reported, never what has to compile.Fixtures (
fixtures/deps/issues-v1/-v2,cause.test.ts):.errorsread whosemap(e => e.message)(TS7006) and lost narrowing (TS18048) fold into the root;root-cause.test.tscovers the fold: chains, orphans, non-breaking roots, loops and the plan count.No ground-truth, gate or threshold change, and no
verification.jsonrewrite.Before / after
"Before" is #218's CI run 39076300528 at 34419e2 (pack-test artifacts). "After" is a local re-score of this branch: zod first, then one pack at a time, each with its own cache, deleted after. The columns are #212's: breaking ground-truth sites found by a finding at any severity, and found as breaking.
No pack loses a true positive. Site by site, every true-positive site of every pack in the "before" run is still found, with one exception: zod's 17, which #218 itself loses (see below).
zod, with vzdc-artcc compiling
The CI "before" is not the state this issue is about. On #218's CI, vzdc-artcc's
prisma generatefailed. The artifact reportsgenerator failed: prisma generate … ECONNREFUSED 127.0.0.1:9: Prisma 7 fetchesschema-engineon the Linux runner, and #218's engine-download block refuses it. So vzdc-artcc did not compile there, and zod stayed at its pre-generator numbers. Locally the engines are already in~/.cache/prisma, so the project generates and compiles. #218's own local re-score at the same commit (34419e2) is the meaningful zod "before":All 58 vzdc-artcc false positives fold:
error-issuessites (return {errors: result.error.errors}in the server actions), from the forms'errors.map(e => e.message)(TS7006) and the lost narrowing (savedAirportpossibly undefined, TS18048).SafeParseReturnTypeimport inactions/event.ts/actions/eventPosition.ts(removed-exports). Those actions cast the parse result to it, so their.errorsisanywithout an error of its own.The 17 vzdc misses are the same before and after. They are #218's: the 15
{ message }generic sites that compile clean under zod 4, plus the two.errorsreads behind that cast.The CI generator failure is #218's. Once this PR is merged into #218's branch, CI will still score vzdc-artcc without the generated client. The zod gate will pass there either way. The folding is only exercised where
prisma generatesucceeds.Local notes
feedback.test.tsandfix.test.tscases time out on both. Run alone, all 89 pass on this branch.🤖 Generated with Claude Code