Repository navigation
feat(check): one finding at a repository parameter that call sites in several workspaces trip - #50
Closed
lucasbraum wants to merge 1 commit into
Closed
lucasbraum wants to merge 1 commit into
lucasbraum wants to merge 1 commit into
Conversation
… several workspaces trip A parameter cause clustered per workspace compile only, so useTransform(ref) in tldraw, rejected once in apps/examples and once in packages/tldraw by packages/editor's useTransform.ts:6, stayed two findings at the call sites. A lone site now carries the parameter as sharedCause; merging workspaces joins lone sites to the anchor reported for the same declaration, or makes one from two or more of them. The anchor counts its call sites (callSites, additive in the JSON report); check --details and the HTML report print N call sites under it. pack test scores the anchor at the declaration and treats the call sites under it as evidence, never as false positives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKRx4kuV6oi25MP5WguxW9 Signed-off-by: Claude <noreply@anthropic.com>
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.
What and why
Item 3 of the engine issues behind the react pack (#45), after #49. In tldraw,
useTransform(rSvg, …)is rejected once inapps/examplesand once inpackages/tldraw, both by the hook's parameter atpackages/editor/src/lib/hooks/useTransform.ts:6. Upstream fixed it once, at the declaration.compile.tsanchored a repository parameter only when two or more sites in the same workspace compile tripped it, so these stayed two breaking findings at the call sites.adapters/typescript/compile.ts): a diagnostic whose parameter cause only it trips in its workspace keeps its own site there, as before, and carries the cause as a candidate,sharedCause.check/shared-root.ts, called frommergeAcrossWorkspaces): with files made repository-relative, a lone site joins the anchor another workspace already reports for the same declaration (same file, line and symbol). Lone sites of two or more workspaces make one anchor. The result is one breaking finding at the declaration,anchorOnly, with the call sites indownstreamas evidence. A parameter only one site in the whole repository trips stays that site's finding. The cluster builder inunattributed.tsis factored out (clusterFinding) and reused.Finding.callSites: how many call sites trip a parameter anchor, across every workspace.Finding.sharedCause: on a lone site; dropped from the merged report once joined or found alone.check --detailsprintsN call sites trip it at the target, for exampleunder the anchor, with the sites.N call sitesand lists them (first ten, then "and N more") under the anchor's location.packs/tooling/pack-test.ts): an anchored finding is scored at its anchor, so a ground-truth finding at the declaration matches it. The call sites under an anchor (evidenceSites) are excluded from predictions even if another finding also plans them: they are neither true nor false positives.No pack's rules, expectations, ground truth or companions changed.
How it was verified
New tests:
cause.test.ts): a lone site carriessharedCause; sites clustered in one workspace do not.shared-root.test.ts: joins an existing anchor; two lone sites make an anchor under the rule that claimed them; a lone site stays and loses the candidate; different declarations stay apart.check.test.ts:mergeAcrossWorkspaceswith the tldraw shape gives one anchor,callSites: 2, counted as one site.pack-test.test.ts): the declaration matches the anchor, and a call site that is evidence is not a false positive even when planned on its own.format-check-details.test.tsandhtml/render.test.ts, for theN call siteslines.pnpm lint,pnpm typecheck,pnpm testpass (core 918, cli 349).Pack tests, breaking sites. Before is main (2e5c510, i.e. #49) with the react pack from #45's branch, as #49 measured it. After is this branch with the same pack, in a scratch worktree, kept out of this PR.
useTransformcall sites are gone.useTransform.ts:6is still the true positive it was, now withcallSitescounting both workspaces' sites.pack test reactprints FAIL only because feat(packs): react 18 → 19 candidate pack (pack test fails, draft) #45's recordedverification.json(candidate, 96%) no longer matches the run; there is no breaking false positive left. Recording it is feat(packs): react 18 → 19 candidate pack (pack test fails, draft) #45's job.nextjs/saas-starterdoes not install here (pnpm MODULE_NOT_FOUND), before and after, which is the only reasonpack test stripefails here.Checklist
pnpm lint && pnpm typecheck && pnpm testpasspnpm changeset): minor🤖 Generated with Claude Code
https://claude.ai/code/session_01AKRx4kuV6oi25MP5WguxW9
Generated by Claude Code