Repository navigation
Conversation
…le tools - A lockfile run can now be refused: Failure::Refused, which the plan turns into a skipped update (Hold::Blocked) with a standing reason, so no PR is opened or updated with a stale lock. Maintenance is held the same way. - npm (native) and Yarn Berry are refused before they start when any package.json, its overrides or resolutions, a Yarn catalog or packageExtensions entry, or the lock names a source outside an allowlist of registry versions, local paths and plain tarballs: git URLs, forge shorthands, owner/repo, forge archive URLs and exec: all fail it. A regenerated lock that records such a source is thrown away. - npm and Yarn runs get GIT_ALLOW_PROTOCOL=none. npm runs load a guard that stops pacote's git-dependency preparation process (pacote 21.5.1 in the pinned npm prepares whatever --ignore-scripts says, and a commit-pinned GitHub dependency arrives over HTTPS). Yarn runs with enableScripts off, project networkSettings dropped and github.com and codeload.github.com closed in the run's user configuration, which stops its GitHub fetcher. - packages.lock.json is never regenerated: dotnet restore evaluates MSBuild code. The restore path, NuGet tool credentials, the dotnet pin, cache wiring, image ICU setting and image smoke restore are removed. - Real-tool canaries over a loopback registry and Git host: npm and Yarn direct (refused, tool never starts) and transitive (fails, no marker), a Yarn control proving packing would run the scripts, and aube (aube and pnpm locks) and Bun locking git deps directly and transitively with no marker, with each tool's own git guard turned off. - Threat model states the rule with dependency code and no exception, and lists the guard per tool; the lockfiles guide, compatibility and departures pages follow. - Bump the extract, files, config, config-files, catalog and catalog-controls state versions.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 1f4943a | Commit Preview URL Branch Preview URL |
Nov 16 2026, 03:03 AM |
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.
Stacked on #345 (
fix/tools-sandbox).Rule: code a repository or one of its packages chose never runs on the Count's machine. The threat model now says so with no exception and lists the guard for each tool. When a lock can't be regenerated without running such code, the update is skipped with a standing reason, and maintenance is held the same way.
Refusal path
patchula_lockfiles::Failure::Refused(reason)is a refusal that the lockfile layer returns.Plan::lockfiles_failedturns it intoHold::Blocked(reason), the same skipped-with-reason path the dashboard and CLI report already show. Nothing is written. The type is deliberately small and generic. The sibling PRfix/no-exec-python-rubymay build the same thing, and whichever lands second reconciles.Per tool
npm (native engine:
npmEngine = "npm"or format v1 locks)node/sources.rschecks against an allowlist everypackage.jsonin the tree (dependencies,devDependencies,optionalDependencies,peerDependencies,overrides) and the lock (resolved/versiongit sources, plus nested dependency specs at any depth, v1 and v3). Anything outside the allowlist is refused: git URLs,github:/gitlab:/bitbucket:/gist:,owner/repo, forge URLs and archives. The allowlist: registry ranges and tags,npm:aliases,jsr:,workspace:,catalog:, local paths, and.tgz/.tar.gzfiles on a host that is not a forge. A regenerated lock that records a git source is thrown away (Refused). The run getsGIT_ALLOW_PROTOCOL=none, plusNODE_OPTIONS=--require=<guard>. The guard exits any Node process that has_PACOTE_NO_PREPARE_set, which is how pacote starts git-dependency preparation.lib/git.js,#prepareDirspawnsnpm install --forcewith_PACOTE_NO_PREPARE_in its environment and never checksignoreScripts. A hosted dependency with a full SHA goes through#clonewithtarballOkand arrives as a codeload tarball throughRemoteFetcher, soGIT_ALLOW_PROTOCOLdoesn't stop it. That is why the guard exists. Inlib/dir.js,#prepareDirdoes honourignoreScripts.--ignore-scriptsandNPM_CONFIG_IGNORE_SCRIPTS=trueare kept.canary-mid-gitplus→git+http://…/evil.git) runs npm, fails on the Git transport, and leaves no marker.real_npm_prepare_guard_stops_git_dependency_preparationshows the real node exits 97 under the guard with_PACOTE_NO_PREPARE_set and nothing runs; an ordinary process runs normally.Yarn Berry
resolutions),yarn.lock(descriptors,resolution, dependencies;::binding params andpatch:inner sources decoded), and every.yarnrc.ymlfrom the project up to the tree root (catalog,catalogs,packageExtensions).exec:is refused. The run getsGIT_ALLOW_PROTOCOL=noneandYARN_ENABLE_SCRIPTS=0. The run's user.yarnrc.ymlis now always written and closesgithub.comandcodeload.github.com(networkSettings.<host>.enableNetwork: false). The sanitized project rc copies dropnetworkSettings, so a project can't reopen those hosts.GitFetcher(cloneFromRemote) and theGithubFetcher(fetchFromNetwork,https://github.com/<u>/<r>/archive/<treeish>.tar.gz) both callscriptUtils.prepareExternalProject.networkSettingsis matched per hostname andenableNetwork === falsethrows ("has been blocked because of your configuration settings"). Experiment: withenableScripts: 0, agit://dependency still ran itspostinstallandprepackmarkers, and withGIT_ALLOW_PROTOCOL=noneit failed with "transport 'git' not allowed". Transitiveexec:from a registry package is rejected by Yarn itself ("only workspaces can depend on exec: packages"), soexec:is only a direct-dependency concern, and that is refused..yarnrc.yml,approvedGitRepositories: ["**"]turns off Yarn's own guard, as a hostile repository would. The direct dependency is Skipped and Yarn never starts. Transitivecanary-mid-dotgit(http.git) fails with "not allowed" and leaves no marker. Transitivecanary-mid-github(github:…#<sha>) fails with "blocked because of your configuration settings" and leaves no marker. Control: the same transitive dependency with Git reachable does writeevil-*markers (the canary works), and its lock is thrown away as "the regenerated yarn.lock …".exec:, catalogs andpackageExtensions.aube (
aube-lock.yaml,pnpm-lock.yaml), Bun--ignore-scripts, as before. They are not refused.GIT_ALLOW_PROTOCOL=httpin the test) andblockExoticSubdeps: falseinpnpm-workspace.yaml: the directgit+httpdependency and the transitive one throughcanary-mid-gitplusboth reach Planned. The lock recordscanary-eviland no marker appears, for aube-lock, pnpm-lock and bun.lock. Note: by default aube 2.9.0 itself refuses exotic transitive specs (blockExoticSubdeps).dotnet
packages.lock.jsonis refused outright (dotnet::refused), and no dotnet process runs. Removed along with it: the restore code, the NuGet tool credentials (nuget_env/nuget_sources),Bin::Dotnetcache wiring, thedotnetpin (defaults.toml,test:tools,mise.lock),roxmltreefrom patchula-tools, the image'sDOTNET_SYSTEM_GLOBALIZATION_INVARIANT, and the image smoke restore.packages_lock_json_is_refused_without_running_dotnet, for both maintenance and update. Status is Skipped with the MSBuild reason and no dotnet call.uv, Poetry, Bundler: the guards land in the sibling PR (
fix/no-exec-python-ruby). The threat model and the lockfiles guide in this PR already describe them as the brief specifies: uv--no-build/UV_NO_BUILD; Poetry under a launcher with its build entry points disabled, refused otherwise; Bundler on a Count-rendered Gemfile in a scratch directory, refusinggemspec,path:,git:/forge keys,git_source,plugin,eval_gemfile,install_if, unread lines and GIT/PATH/PLUGIN SOURCE lock sections.Docs
internals/threat-model.md: the rule now covers dependency package code. There is no exception section. A new "How each tool keeps to it" section lists every tool. This fixes the contradiction withguide/lockfiles.md.guide/lockfiles.md: the danger box is replaced by a note saying no tool runs repository or package code. A new "What is refused" section is added. The partitions paragraph is rewritten (the "every installation is trusted" and "lockfile tools run repository code anyway" wording is gone). The private-registry text, the Yarn rc sanitizing, and the .NET rows and mentions are updated.renovate/compatibility.mdlockfile table and a newrenovate/departures.mdentry, "Lockfiles that need repository or package code are refused".guide/managers.md,guide/server.mdxandreference/environment.mdlose dotnet restore.Tests run (boat VM)
cargo test -p patchula-tools -p patchula-engine -p patchula-update -p patchula-lockfiles(real tool tests included) and clippy-D warningson those crates: green. The extract, files, config, config-files, catalog and catalog-controls state versions are bumped for theplan.rs,lockfiles/srcandengineedits.Follow-ups
package.jsonin the tree, not only the run's reach (workspaces and local paths). Narrowing it would refuse less in monorepos with unrelated Node projects.packages.lock.jsonsafely.Failure::Refusedwith the sibling PR's skip path.