feat(cli): --include-dependencies upgrades and validates the import closure#27
Merged
Conversation
Extract the validation BFS (_walk_validation_sources) and overlay-root computation (_overlay_roots) so one traversal both copies overlay sources and returns the resolved import closure. Add public ImportClosure + resolve_import_closure, split materialize_target_overlay out of target_overlay (writes into a caller-owned root), and make engine.candidate_sources public. Fix _copy_project_configs recursion when the destination is nested under the project root. Foundation for opt-in dependency-closure upgrade (#23); exposes the resolved closure needed by #22.
Add a keyword-only include_dependencies flag to target_overlay and materialize_target_overlay. In closure mode the full import closure -- including external configured-search-path dependencies -- is materialized import-root-relative (e.g. <root>/snekmate/utils/math.vy), overlay.paths maps every closure member, and source_roots becomes the import roots so target compiles resolve strictly against the materialized tree. A destination-collision ledger dedupes identical bytes and raises OverlayLayoutConflictError on genuine ambiguity; the default path stays byte-identical to prior behavior. Foundation for --include-dependencies (#23).
…losure Add opt-in --include-dependencies (alias --upgrade-closure). Resolved .vy/.vyi closure members become dependency-role migration requests in the shared batch; the engine runs the shared target overlay in closure mode so dependencies cross-validate against each other's upgraded bytes. Dependency sources are structurally excluded from the migration plan and never written in place. Report schema v2 adds files[].role and a top-level closure block; --check/--diff cover dependencies; --write with --include-dependencies exits 4 until a closure destination exists; import layout conflicts exit 4. A read-only dependency source no longer crashes the final-newline retry. Part of opt-in dependency-closure upgrade (#23).
# Conflicts: # CHANGELOG.md
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.
co-authored by claude opus 4.8
This adds opt-in
--include-dependencies(with--upgrade-closureas an alias) so resolved.vyand.vyidependencies join the migration batch and are cross-validated against the upgraded closure. Dependency results participate in--check,--diff, and report schema v2, but dependency sources are never written in place.--writewith closure upgrades is rejected until a closure destination is supplied, and import-layout conflicts are reported as usage errors.Stacked on:
issue-23-overlay-closure-mode. This is part of the stacked series implementing issue #23.Tests: CLI and engine unit tests, real-compiler integration tests, and the full test suite are green.