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
Run the Bun and vlt vendored preflights as one vendor_preflight with one per-purl refusal map #1839
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T05.
Problem
Every vendored caller runs the Bun preflight and the vlt preflight back to back, then checks each purl against both refusal types with its own glue code:
agent_download.rs L1255-L1268,`` with glue in VendorRefusals::for_purl (L759)
Both refusal types are {code: &'static str, detail: String}. The two modules (bun_preflight.rs,````` vlt_preflight.rs) duplicate several pieces:
the npm-only scope check;
selection_pairs;
the vendor_state_unreadable mapping;
the vlt_routes probe, which bun runs to opt out and vlt runs again to opt in.
Bun also exposes three one-line forwarders (bun_vendor_preflight, _with_ledger, _pairs). It has an Option<LedgerLoad> lazy-load mode, and its only caller (get.rs L2326) loads the ledger itself on the next line anyway. The callers also disagree on the root:
get runs Bun on project_root() but vlt on cwd;
agent_download runs both on cwd;
vendor_flow loads the ledger at cwd.
Proposed change
Add one vendor_preflight(cwd, pairs, ledger) -> HashMap<purl, (code, detail)>. Bun's project-level verdict is expanded per purl after its exemptions.
Collapse the three Bun forwarders and the lazy-load mode.
Each caller does one lookup per purl.
Pick one root, following the #745 rule (the ledger and lock at project_root()).
Size
6 files. About −150 / +60 lines.
Acceptance criteria
Every Bun/vlt refusal code, and its envelope and exit code, is unchanged.
The bun_preflight/vlt_preflight unit tests and the e2e_vendor_bun_build/e2e_redirect_vlt_build suites stay green.
Activity
audit-cli-tests: first run, args.rs through get.rs (15.9K lines); file …