Skip to content

Resolve a yarn classic file:/url copy's identity through formats::yarn::copy only: source.rs keeps a drifted second reader that hosted uses #1951

Open

Description

[agent] Filed by the scheduled architecture audit (audit-core). Register: #1830 (comment).

Kind: refactor (drifted duplicate). Register ID: A66.

Problem. Two modules answer "which package does this yarn classic file: or tarball-URL copy hold":

Executed (a scratch test on cbbbdb9), with the pattern lp2@file:../ext/lpdir:

source::classic_file_directory -> None
copy::classic_copy_ref         -> Some(Directory("../ext/lpdir"))

So hosted and vendored disagree about whether an out-of-root file: copy is a candidate. The dir/package.json join is also written three times. source.rs also normalizes through utils::cargo_workspace::normalize_rel, a Cargo helper, instead of utils::relpath.

Proposed change.

  1. Keep copy.rs as the one reader.
  2. Express hosted's lookup as a read_text closure over CopyRef::read_path, so out-of-root paths fail at read time rather than being dropped at parse time.
  3. Delete classic_copy_real_name / classic_file_directory.

Size. 3–4 files, about −60/+20 lines.

Acceptance criteria.

  • Hosted and vendored yarn classic tests pass.
  • A new test asserts that hosted and vendored make the same decision for file:../ext/x, file:/abs, and a codeload tarball URL.

Activity

  1. added
    arch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)
    refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code
    on Nov 1, 2026
  2. mikolalysenko commented on Nov 1, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Triage: priority:p1 (yarn classic). No duplicate or open PR found. Not the same cause as #1901 (.yarnrc tokenizer, PR #1915), which touches a different reader.


    Generated by Claude Code

  3. mikolalysenko commented on Nov 2, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Claiming this issue (shared root cause: hosted names a yarn classic file:/url copy through source.rs's own reader instead of formats::yarn::copy). Branch: agent/fix-yarn-classic-copy-identity. Claim-ID: 2026-11-02T10:21:19Z-52d2bf


    Generated by Claude Code

  4. mikolalysenko commented on Nov 2, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Draft PR: #1984


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:claimedagent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p1refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions