TX-APP1C: extract local-path dependency redirection — Package.Manifest.Clause + Package.Manifest.Redirection - #8
Merged
Conversation
…n — the URL-clause -> .package(path:) rewrite with byte-for-byte restore Extracted from the Institute Application's Composition area; org-layout resolution and the reversal ledger stay with the Application, which will consume this unit and delete its copy in a companion PR. Record: #7 (Goal swift-institute/.github#145).
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.
TX-APP1C — extract local-path dependency redirection (destination side)
Record: #7 (Goal swift-institute/.github#145; TX-G1 swift-institute/.github#85 comment 5217978427).
Moves the URL-clause ->
.package(path:)rewrite with byte-for-byte restore out of the Institute Application's Composition area into its semantic owner:Package.Manifest.Clause— locating.package(...)clauses over raw manifest bytes (paren-matched, string-literal aware), verbatim clause text and byte range, url/path extraction, SwiftPM identity derivation, byte-exact replacement.Package.Manifest.Redirection— the pure source-to-source operations:redirect(_:dependency:to:)producing aRewrite(rewritten source + verbatim declared clause + planned clause) andrestore(_:planned:declared:)returning the declared clause byte-for-byte.Package.Manifest.Redirection.Rewrite,Package.Manifest.Redirection.Error— result and typed failure.Org-layout resolution, checkout discovery, and the reversal ledger stay in the Application core, which will consume this unit and delete its in-Application copy in a companion PR (negative control).
Tests: the Clause suite is moved from the Application; the Redirection suite adds redirect/restore round-trip (byte-identical), identity-based matching, and both refusal edges.
One adaptation over the moved source:
UInt8(ascii:)call sites are disambiguated with explicitUnicode.Scalarliterals because this module set also seesASCII_Primitives'UInt8.init?(ascii: Character).