feat(npm): emit usage events for virtual tarball pulls

What this MR does

A delivered virtual tarball GET emits artifact_pulled, and virtual_cache_miss first where the bytes of the winner answered (ruling E17 of !3111 (merged)). A HEAD or a matching 304 on those bytes emits virtual_cache_miss alone (ruling E22). Both events name the virtual repository, not the winner. VirtualTarballHandlerDeps gains Tracker, and the virtual_cache_miss row of docs/dev/usage-data.md states the npm rule.

vtRedirectBlob moves from virtual_tarball_faults_test.go to virtual_tarball_usagedata_test.go, where the final layout keeps it.

Tests

  • TestVirtualTarballHandler_DeliveredGET_EmitsTheVirtualPullEvents
  • TestVirtualTarballHandler_HeadOr304OnTheWinnersOwnBytes_BooksTheMissAlone
  • TestVirtualTarballHandler_UndeliveredRead_EmitsNoUsageEvent

Split of !3111 (merged)

This MR is one part of a split of !3111 (merged) into six stacked MRs. Each part targets the branch of the part before it, so each diff shows only that part. Merge the parts in order: 1, 2, 3, 4, 5, then !3111 (merged) itself as part 6.

Part MR Contents
1 !3150 (merged) npm_files.created_at to the hosted tarball winner
2 !3147 (merged) Resolver re-entry on a virtual drain failure
3 !3148 (merged) VirtualTarballHandler, not wired
4 !3149 (merged) Copy-fault accounting, kill log, cold HEAD drain failure
5 !3151 (merged) Usage events
6 !3111 (merged) Slot wiring, run recipe, docs

The six parts together are byte-identical to the original !3111 (merged) diff (same git patch-id --stable). The spec coverage table, the rulings (E1 to E22), and the spec gaps stay in the description of !3111 (merged).

E2E scenario catalog and user documentation

This part adds no e2e scenario and changes no file in docs/user/. Nothing wires the virtual tarball handler before part 6, so the route still answers 501 and no client-visible behavior changes.

Related to #898 (closed)

🤖 Generated with Claude Code

Edited by Pawel Rozlach

Merge request reports

Loading
Loading