Skip to content

Handle cycles in cross_file_layers() - #1411

Open
lionel- wants to merge 1 commit into
oak-query/guardrailsfrom
oak-query/cross-file-cycle
Open

lionel- wants to merge 1 commit into
oak-query/guardrailsfrom
oak-query/cross-file-cycle

Conversation

@lionel-

@lionel- lionel- commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Part of #1409

A review pass based on the query guardrails found a cycle through cross-file symbol resolution. In practice it's hard to reach this cycle because it usually occurs via semantic_index(), but it's possible to reliably trigger it with tests, so this should be fixed defensively.

This PR adds a cycle handler for cross_file_layers() that skips attaches in predecessors. It preserves visible files, namespace imports, loader-provided attaches, and the search-path tail. The cycle is linted via the existing SourceCycle warning.

Positron Release Notes

New Features

  • N/A

Bug Fixes

  • N/A

@lionel-
lionel- added this pull request to stack #1412 September 18, 2026 17:36
@lionel-
lionel- force-pushed the oak-query/cross-file-cycle branch from be7d0f8 to fd9ccb0 Compare September 20, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant