You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide: keep agent mode for every ecosystem, or limit it to Deno and --global installs #1000
v5 defaults to hosted mode. Agent mode (in-place patching of installed files: apply, repair, scan/get --mode agent) is now the largest source of open bugs per line of code. What is its scope from here on?
A. Keep it for every ecosystem (status quo). Keep fixing layout bugs one at a time. Optionally follow review §2.2 and ask the package manager for install layouts (npm query, pnpm list --json, pip show -f, cargo metadata, …) instead of re-implementing them.
B. Limit it to where nothing else works. Those places are Deno (agent is its only mode) and --global/--global-prefix installs (no project lockfile, so hosted and vendored refuse them). Inside a project that hosted or vendored supports, --mode agent warns for one minor and is then refused with a remedy that names --mode hosted|vendored. The engine stays, but per-ecosystem project-layout discovery stops growing.
C. Keep it everywhere, but label it. Document agent mode in a project as "fallback" for the ecosystems whose docs already say "prefer vendored / hosted" (Maven, NuGet, Cargo), and close new layout bugs there as won't-fix with the remedy.
Recommendation: B. It keeps the two cases that really need agent mode and stops the open-ended layout work. Most of today's open agent-mode bugs are project-scope layouts that hosted or vendored already cover. The default change (get --save-only → agent) is user-visible, so this is a v5.x/v6 contract decision.
Evidence (main @ 9c43dfc)
Where agent mode is the only option:
docs/ecosystems.md#L15-L25: every ecosystem except Deno has hosted ✅ and vendored ✅. Deno: "in place (the only mode for Deno)"; vendored refused; hosted not supported.
Global installs: hosted and vendored act on a project's lockfiles, vendor under global scope is a usage error (global_scope_unsupported), and apply/scan --mode agent patch the global copies (CLI_CONTRACT.md#L129). The review didn't list this case.
Go: agent mode is not in-place. It writes a replace to .socket/go-patches/, the same shape as vendored, so Go doesn't need it. The review's "Go local replace" case is covered by vendored. Paid hosted Go is refused with a vendored remedy.
Agent mode is still a default in two places: get --save-only and get --global (CLI_CONTRACT.md#L23).
Footprint (production lines, split at #[cfg(test)]):
CLI: commands/apply.rs 2,963 (2,237 at the review), fetch_stage.rs 437, repair.rs 785, plus the agent arms in scan, get, rollback and remove.
Core, agent-only: patch/rollback.rs 751, patch/sidecars/ 1,107 (708 at the review; the Maven .sha1/.md5 rewriter arrived with Full Gradle support in agent, hosted and vendored modes #646), store_copies.rs 332, shared_store.rs 332, api/blob_fetcher.rs 603, patch/diff.rs 99.
Core, shared with vendored: patch/apply.rs (1,230), patch/package.rs and manifest/, which vendored staging also uses. These stay under every option.
Bug load: about 29 of the 246 open bug issues are agent-mode-specific by title, roughly double the review's ~15. Almost all are project-scope install layouts that the crawlers re-implement:
B: no engine code at first. The project-scope agent paths in apply/scan/get become a refusal, and later majors can delete the project-layout discovery that only agent mode uses: the pnpm/bun/vlt store fan-out, the venv-name hashing and the Cargo/NuGet cache-path resolution. Rough estimate: 3–5K production lines over time.
C: none. Docs and triage policy only.
Constraints
The contract makes --mode agent and get --save-only agent defaults v5.0 behavior, so B is a MAJOR (or a deprecation window in a minor).
[agent] Filed by the scheduled architecture audit routine (CLI and core). Register: discussion #560 register.
Kind: decision. Source: review §5 ("Agent mode overall"), §6 owner question 2; register C55.
Question
v5 defaults to hosted mode. Agent mode (in-place patching of installed files:
apply,repair,scan/get --mode agent) is now the largest source of open bugs per line of code. What is its scope from here on?npm query,pnpm list --json,pip show -f,cargo metadata, …) instead of re-implementing them.--global/--global-prefixinstalls (no project lockfile, so hosted and vendored refuse them). Inside a project that hosted or vendored supports,--mode agentwarns for one minor and is then refused with a remedy that names--mode hosted|vendored. The engine stays, but per-ecosystem project-layout discovery stops growing.Recommendation: B. It keeps the two cases that really need agent mode and stops the open-ended layout work. Most of today's open agent-mode bugs are project-scope layouts that hosted or vendored already cover. The default change (
get --save-only→ agent) is user-visible, so this is a v5.x/v6 contract decision.Evidence (main @
9c43dfc)Where agent mode is the only option:
docs/ecosystems.md#L15-L25: every ecosystem except Deno has hosted ✅ and vendored ✅. Deno: "in place (the only mode for Deno)"; vendored refused; hosted not supported.vendorunder global scope is a usage error (global_scope_unsupported), andapply/scan --mode agentpatch the global copies (CLI_CONTRACT.md#L129). The review didn't list this case.replaceto.socket/go-patches/, the same shape as vendored, so Go doesn't need it. The review's "Go localreplace" case is covered by vendored. Paid hosted Go is refused with a vendored remedy.get --save-onlyandget --global(CLI_CONTRACT.md#L23).Footprint (production lines, split at
#[cfg(test)]):commands/apply.rs2,963 (2,237 at the review),fetch_stage.rs437,repair.rs785, plus the agent arms inscan,get,rollbackandremove.patch/rollback.rs751,patch/sidecars/1,107 (708 at the review; the Maven.sha1/.md5rewriter arrived with Full Gradle support in agent, hosted and vendored modes #646),store_copies.rs332,shared_store.rs332,api/blob_fetcher.rs603,patch/diff.rs99.patch/apply.rs(1,230),patch/package.rsandmanifest/, which vendored staging also uses. These stay under every option.Bug load: about 29 of the 246 open
bugissues are agent-mode-specific by title, roughly double the review's ~15. Almost all are project-scope install layouts that the crawlers re-implement:pnpmStoreFoldermoves it out ofnode_modules: skipped aspackage_not_installed, or refused as "first-party source" #859, Agent-modescan packages/<member>finds nothing in a pnpm workspace (exit 0), whilerollback packages/<member>selects the same packages #778, Agent-mode apply in a pnpm workspace reports each member-linked package twice, inflating the --json skipped count with duplicate already_patched events #633, With Bun's globalStore (Bun ≥ 1.3.14), agent mode patches and rolls back every other project sharing the store, and vex attests unpatched transitive copies as not_affected #635, Global agent mode on pnpm 12 (and 11 without the global virtual store) patches only one of the per-install copies of a package, reports success, and VEX attests not_affected #435, Agent-mode rollback and remove delete empty directories the package shipped when a patch added a file under them (regression from #846) #862, Agent-mode scan ignores socket.yml includePaths / ignorePaths (and the built-in tests/ default) for nested npm projects, patching every nested project's node_modules #554, A report-onlyscan -gtells you to runsocket-patch scan --mode agent [PATHS]without-g, so following the hint scans the cwd project instead of the global install #464, With Bun's isolated linker,vexrefuses every hosted patch as not_applied after the usual in-placebun install, because it checks orphanednode_modules/.bunregistry entries that Bun never removes (regression from #496) #599;{data-dir}in Poetry's virtualenvs.path, agent mode also patches an unrelated activated VIRTUAL_ENV / conda env, even thoughpoetry env usepins the project's env, and hosted VEX then refuses a correctly installed patch #866, Agent mode honours the Pipfile's[pipenv] venv_in_project = truefor every Pipenv, but only 2026.2+ read it, so on Pipenv 2018–2026.1 the WORKON_HOME venv stays unpatched, the system Python is patched instead, and VEX attests not_affected #842, Agent-mode apply of a same-size PyPI patch in the same second aspip installleaves pip's__pycache__bytecode valid, so Python keeps running the unpatched code while apply reports it patched #819, With Poetry virtualenvs.create = false, agent mode patches a stray ./venv (or ./.venv under in-project = false) instead of the system env Poetry installed into, and VEX attests not_affected #671, Agent-mode scan in a Pipenv project without a Pipenv venv patches the system Python's site-packages in place instead of the project's venv/ (regression from #388) #504, Agent-mode rollback in the other scope (rollback -g after a project apply, or rollback after a -g apply) deletes the manifest entry and blobs while the patched copy stays patched, and exits 0 #450;[patch.crates-io], and VEX attests not_affected while the build links the user's unpatched fork #506, Agent-mode cargo rollback leaves a committedcargo vendortree dirty:.cargo-checksum.jsoncomes back pretty-printed instead of cargo's compact bytes #416, Agent-mode cargo apply/rollback has no effect on an already-built project: cargo reuses the cached rlib from target/, while apply reports success and VEX attests not_affected #387, Agent-mode cargo apply patches only the first of several registry/src index dirs (cargo 1.84 vs 1.85+ hashes), so one cargo keeps building the unpatched crate while apply and VEX report success #339, Agent-mode cargo apply patches the wrong copy whencargo vendoruses a custom directory (or apply runs from a workspace member), yet reports success and VEX attests not_affected #338;go mod tidydrop the replace but not restore the module's go.sum lines, so the next defaultgo buildfails with "missing go.sum entry" while rollback exits 0 with no warning #549, Agent-mode Go vex omits an applied patch for a +incompatible module (not_applied, exit 1) because it looks up the manifest with a literal "+" while the API key spells it %2B #484, Agent-mode Go apply writes a go-patches replace for a module version the build graph doesn't select, reports it applied, and on a go 1.16 go.mod apply --check and vex also report it as patched #392, Agent-mode Go vex attests not_affected aftergo getupgrades the patched module, although the go-patches replace no longer applies and the build links the unpatched code #391;scan -g --mode agentthenrollback -gfrom a vendored NuGet project reverts the project's patched package in the shared global packages folder; the locked restore stays "up-to-date" and VEX keeps attesting #489, Agent-mode NuGet apply ignores nuget.config repositoryPath for packages.config projects and patches ~/.nuget/packages instead, reporting success #398, Agent-mode NuGet apply patches ~/.nuget/packages instead of the project's configured globalPackagesFolder / RestorePackagesPath, reports success, and VEX attests not_affected #397;Under B, the project-scope ones close with a "use
--mode hosted|vendored" remedy. Under A, each needs its own fix.What each option deletes
apply/scan/getbecome a refusal, and later majors can delete the project-layout discovery that only agent mode uses: the pnpm/bun/vlt store fan-out, the venv-name hashing and the Cargo/NuGet cache-path resolution. Rough estimate: 3–5K production lines over time.Constraints
--mode agentandget --save-onlyagent defaults v5.0 behavior, so B is a MAJOR (or a deprecation window in a minor).fix/undo/sync) assumes agent mode survives assync. Under B,syncshrinks to global and Deno.Acceptance
An owner picks A, B or C, and for B the deprecation window. The audit then files the mechanical follow-ups.