Repository navigation
Stop fetching patch views during hosted scans - #2021
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
A hosted scan fetched the full patch view (every patched file's blob content) for each confirmed redirect, only to judge installed copies and feed the same run's VEX. It now makes no view call at all: - In-run `--vex` fetches the records it attests from itself, through the same record path the standalone `vex` uses, so the scan pipeline never asks for them. - The gem stale-install probe judges an installed gem by the archive RubyGems installed it from (`<home>/cache/<leaf>.gem`) against the patched artifact's sha256. - The Python stale-install probe downloads the patched wheel the lock now pins, through its grant URL and verified against the pinned sha256, and compares the installed copy with the wheel's own RECORD when the installed WHEEL tags match. It downloads only when a copy is installed. - Both probes still treat an agent-mode manifest record of the same patch as proof of an in-place patch. - The vlt warm-tree heal judges a store entry by vlt's hidden lock alone: the pinned integrity there is healthy, another is stale, and without a readable hidden lock the copy is kept and reported as unchecked. - The in-memory hosted engine no longer calls the provider's `fetchPatch` or warns `record_fetch_failed`. The Node binding still accepts a `fetchPatch` provider method and ignores it, so existing providers keep working. Assisted-by: Claude Code:claude-opus-5-5
…c) e2e judge_installed_wheel read the installed WHEEL and every RECORD path with bare std::fs reads. Site-packages is user-writable, so a FIFO there would block the hosted scan's blocking pool. Read through read_regular_*_sync so a FIFO or device counts as unreadable, and add a regression test for both the WHEEL and a RECORD path. The real-vlt e2e for heal rule (c) without a hidden lock still expected the old record-based heal (copies invalidated). Hosted scans no longer fetch patch records, so that case is now undeterminable: the copies are kept and the advisory says to run `vlt ci`. Match the in-process test and check that `vlt ci` then installs the patched package. Co-Authored-By: Claude <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fb3d418. Configure here.
|
Labeled Ready for review by the burn-down agent.
Generated by Claude Code |
Final review brief (for the human approver)What it does: hosted scans stop calling Risk: medium. I found no security problem and nothing that makes the probes warn wrongly. The risk is in the Python probe: it now judges an installed copy only when its Look here
Verified: I read the PR's own diff ( Changes I made: none. Open questions / nits (none block merging)
Auto-merge is not armed. This PR targets #2015's branch, which has no review rule, so arming it would merge it immediately. Approve and merge it after #2015, or retarget it to Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Stacked on #2015 (which is on #2013).
Summary
Hosted scans no longer call
/patches/view. A view carries every patched file's blob contents, and v5 keeps no hosted ledger, so the scan was fetching full patch bodies only to feed checks that run within the same scan. Each of those checks now uses data the scan already has, or fetches its own:--vexvex_sources::fetch_records, the same path standalonevexuses; output unchanged<home>/cache/<leaf>.gem, and committedvendor/cache) vs. the grant's artifact sha256RECORD, downloaded through its grant URL (sha256-checked) only when an installed copy exists and itsWHEELtags match; never under--offlinefetchPatchprovider, presence-checked onlyfetchPatchmethod and ignores it, so existing hosts (depscan's autopatch provider) keep workingWhen an agent-mode manifest holds a record for the same patch, the gem and Python probes use that local record instead, so an agent→hosted migration stays quiet.
Vendored mode, agent mode,
get <uuid>, vendor eject and standalonevexare unchanged and still use the view.Behavior changes
record_fetch_failedno longer exists. A view failure during in-run VEX is reported asvex_record_fetch_failed.--vexwhere every record fetch fails ends with arecord_unavailableskip instead ofmanifest_not_found.direct_url.jsonarchive hash, but not every installer writes one, so I kept the wheelRECORD.vlt ci, as it does when there is no hidden lock (new test). The advisory names the missing or unreadable hidden lock.CLI_CONTRACT.md,index.d.tsanddocs/testing/poetry-compatibility.mdare updated.Validation
cargo fmt --checkcargo clippy --workspace --all-features -- -D warnings--lib(isolatedHOME, see #2015 for the NuGet cache test)e2e_redirect_gem_stale_installe2e_vex_lockfilehosted_memory_enginein_process_redirectscanAn earlier run also passed
cli,get,cli_parse_scan,cli_parse_get,hosted_memory_parity,hosted_memory_rollout,in_process_rollback_hosted,in_process_scan,in_process_vendor_bun_takeover,mode_migration_vltandmode_migration_bun.Tests that used a view request as proof that a redirect was confirmed now assert zero view calls, or confirm the redirect through a re-scan's envelope. Fixtures that lay down a gem install by hand now write the cache archive RubyGems would. The pdm, pipenv and poetry stale-install tests now serve a real patched wheel from the mock server.
Not run: the hatch and uv real-toolchain e2e suites, which already serve real wheels.
🤖 Generated with Claude Code
Note
Medium Risk
Changes hosted post-rewrite behavior (new wheel downloads, vlt heal rules, and in-run VEX fetch timing) without altering vendored/agent modes or standalone vex’s overall model.
Overview
Hosted
scan/get --mode hostedno longer call/patches/viewafter a rewrite. v5 does not persist hosted records, and views were only feeding same-run checks that now use data the scan already has or fetch narrowly on their own.In-run
--vextakes confirmed pin UUIDs and loads records throughvex_sources::fetch_records(like standalonevex), instead of a pre-built map from the scan.record_fetch_failedis gone; view failures show up asvex_record_fetch_failed/record_unavailable.Stale-install probes no longer depend on fetched patch bodies: gems compare the installed
cache/<leaf>.gem(and committed vendor cache) to grant artifact shas, with agentmanifest.jsonafterHashstill used when present; Python downloads the pinned wheel once (RECORD+ matchingWHEELtags) via the grant URL when a copy is installed—not under--offline; vlt heal/stale checks usenode_modules/.vlt-lock.jsonintegrity only, so missing/unreadable hidden lock keeps store entries and advisesvlt ciinstead of record-driven invalidation.Contract docs and tests are updated (including zero-view assertions and gem cache fixtures).
Reviewed by Cursor Bugbot for commit fb3d418. Configure here.
Generated by Claude Code