Skip to content

fix(manager): local npm protocols are not registry versions; manager facts decided once - #228

Merged
sweepies merged 8 commits into
mainfrom
refactor/manager-leftovers
Nov 9, 2026
Merged

sweepies merged 8 commits into
mainfrom
refactor/manager-leftovers

Conversation

@sweepies

@sweepies sweepies commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Manager and config leftovers from the post-refactor sweep: each fact is now decided once.

  • Locked sources come from the ecosystem descriptor (Ecosystem::locked_source) instead of a Cargo-else-npm if.
  • crates.io is recognised by one predicate, cargo::crates_io, used by the lockfile reader, nonpublic_registry and the public-origin rule. Before, there were four copies in three formulations.
  • npm specifiers (fix): npm.rs reads the same local-protocol list (public::LOCAL_SCHEMES) as the public-source verdict. portal:, patch:, exec: and the other local protocols no longer extract as registry versions. The managers guide page is updated. The corpus has no such specifiers, so it is unchanged.
  • Credential checks come from the file-role taxonomy: each credential-bearing file's role carries its CredentialScan, so a file in the taxonomy cannot lack a check.
  • Registry URL acceptance is one function in config (acceptable_registry_url), shared by Registry::from_recorded and manager's registry_url. Recorded bytes sort into the same variants; a test pins the cases.
  • Path normalisation: config's import walk and virtual filesystem share one ./.. normaliser.
  • Action locators are a typed key; the unreachable regex fallback is gone.
  • Role lists: the npm, NuGet and Composer arms compose named constants instead of repeating file lists. The pinned classification test is unchanged.
  • Restating comments removed.

Follow-up noted, not done here: crates/update/src/lockfiles.rs has its own crates.io lock-source check.

View guided diff Turn on auto-fix

sweepies and others added 6 commits November 9, 2026 20:36
npm's registry check kept its own prefix list, so portal:, patch: and
the other protocols the public verdict already calls local still
extracted as registry versions. registry() now reads the same
LOCAL_SCHEMES taxonomy fetch_ok uses; npm: stays, since it aliases a
registry package.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…d once

Locked::dependency() asked the ecosystem descriptor for the source a
lockfile-only package is looked up in instead of guessing npm for
everything that is not Cargo; a manager that records no locked packages
is an explicit unreachable arm. cargo::crates_io answers "is this
crates.io" for lock sources, registry indexes and the public descriptor,
replacing the three formulations that had to agree.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
EcoRoles names the CredentialScan a file's text gets, so
credentials::keyed dispatches through the taxonomy instead of its own
filename match: a credential-bearing file cannot lack a check. The npm,
nuget and composer arms compose the shared name lists rather than
repeating them.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
acceptable_registry_url lives in config, below manager's registry_url,
so the recorded-bytes sort and the producer check cannot drift; the
dot-path normaliser the import walk and the virtual filesystem each
kept is now one function, the /repo rule staying where it applies.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The uses/container/image line patterns are keyed by a Locator enum, so
the lookup cannot ask for a key that has no pattern and the unreachable
fallback is gone.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sweepies sweepies changed the title refactor(manager): locked sources, crates.io, registries and credential scans decided once fix(manager): local npm protocols are not registry versions; manager facts decided once Nov 9, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 17 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/manager/src/public.rs">

<violation number="1" location="crates/manager/src/public.rs:55">
P1: `patch:` is not fetch-free: Yarn patch locators wrap an underlying package that can come from a private archive or registry. Because this shared entry makes `fetch_ok` return `true` before inspecting that locator, a `package.json` can be marked public despite a private patch source; keep the npm extraction taxonomy separate and inspect or fail closed on the inner patch locator for public verdicts.</violation>
</file>

Comment thread crates/manager/src/public.rs Resolved
@sweepies
sweepies merged commit d25f740 into main Nov 9, 2026
12 checks passed
@sweepies
sweepies deleted the refactor/manager-leftovers branch November 9, 2026 21:46
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 9, 2026
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