Repository navigation
fix(ci-inference): only an ancestor script makes a cycle - #188
Merged
adityankale190895 merged 1 commit intoNov 18, 2026
Merged
Conversation
resolveScript shared one seen set across sibling branches, so a script reached twice (ci runs build and test, test runs build) was reported as a cycle and the step was left not executable. Each nested call now gets its own copy of its ancestors. Fixes DiffCI#187 Signed-off-by: FredApps <[email protected]>
FredApps
added a commit
to FredApps/core
that referenced
this pull request
Nov 17, 2026
…verbs Each nested resolveScript call now gets a copy of its ancestors, as in DiffCI#188. A script reached twice through different branches is not a cycle. Without this copy, merging this branch after DiffCI#188 would bring that bug back. Signed-off-by: FredApps <[email protected]>
FredApps
commented
Nov 17, 2026
FredApps
left a comment
Contributor
Author
There was a problem hiding this comment.
Cross-review (Yandere-san). Head 5a72402.
Checked: each nested resolveScript now gets a copy of seen, so only an ancestor is a cycle. The diamond test fails on main (script cycle through build) and passes here; a real cycle is still UNRESOLVABLE. tests/ci-inference/*.test.ts pass locally. Hosted CI is green (12 success, change-impact neutral on the fork).
Overlap: #198 rewrites the same loop to use packageManagerCommand. On its original head the diamond test still failed. I pushed new Set(seen) and a diamond test to #198 as 166d94b, so merging #198 after this one will not bring the bug back.
No code changes on this branch. Nothing open here.
FredApps
added a commit
to FredApps/core
that referenced
this pull request
Nov 18, 2026
…n either order Both change the nested-script loop in resolveScript; this PR already carried DiffCI#188's fix (each nested call gets new Set(seen)). Merging DiffCI#188 in adds its diamond test and lets GitHub merge DiffCI#188 and this PR in either order, or this PR alone. Signed-off-by: FredApps <[email protected]>
FredApps
marked this pull request as ready for review
November 18, 2026 00:56
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.
Fixes #187
Changed behavior
Each nested
resolveScriptcall now gets a copy of its ancestors instead of the one sharedseenset. A script reached twice through different branches resolves normally, and only a script that reaches one of its own ancestors is reported asscript cycle through <name>.Validation
tests/ci-inference/script-diamond.test.tsis new and added torelease-files.json. The diamond test fails onmain; the output is in CI inference: a script reached twice through package.json (a diamond) is reported as a script cycle #187. The second test pins real-cycle detection.inferPipeline,npm run ciwith the diamond scripts and a lockfile now comes outexecutable: true(falseonmain).npm run typecheck,npm test(1169 pass, 0 fail),npm run build,npm run audit:boundary.Unsupported cases
yarn/pnpmverbs are read, for exampleyarn installinside a script, is unchanged here.Note: #198 includes this PR, with the shared loop already resolved, so the two merge in either order.