feat(npm): packument GET core serve (S11 Step 11 part 1/4)
📦 Summary
Part 1 of 4 of the npm hosted packument GET handler (S11 Step 11), split into a stacked series for reviewability. This part lands the core serve path:
- Route parsing for
{slug}/npm/{repo}/{package_name}(scoped@scope/namerejoining) Acceptnegotiation (fullkind=0vs abbreviatedkind=2) and the matchingContent-Type- Repository lookup, including the deleted-in-resolve-window race arm returning
404 repository_not_found - Package lookup returning
404 package_not_found(newCodePackageNotFound/MsgPackageNotFoundintransport.go) - Inline packument build via the Step 25 generator, with a strong
ETagover the generated bytes writeServerErrorand base-URL helpers
The cache-hit path (part 2), conditional GET + visibility-varying cache headers (part 3), and the read-side singleflight (part 4) build on this.
🧪 Tests
Unit: full/abbreviated content negotiation, package-not-found. Integration: package-not-found. Further acceptance-criteria coverage arrives with the slices that introduce each behavior; the complete spec-coverage table is satisfied across the full stack.
🗂️ Stack
Part 1/4, targets main. Parts 2–4 stack on top, each targeting its predecessor.
📏 Size justification
~860 reviewable LoC — deliberately above the usual ~600 ceiling. This slice carries the irreducible core handler (~430 LoC of handler plus its doc-comments) and the minimum honest test scaffold to exercise it. Splitting further would only yield a non-servable sub-slice or require stripping doc-comments, so the core ships as one coherent, fully-documented unit; parts 2–4 are each ≤600 LoC.
Related to #129 (closed)
🔗 Stacked MRs (review/merge bottom-up)
- feat(npm): packument GET core serve (S11 Step 1... (!630 - merged) • David Fernandez • 19.2
👈 - feat(npm): packument GET cache-hit serve (S11 S... (!631 - merged) • David Fernandez • 19.2
- feat(npm): packument GET conditional GET + cach... (!632 - merged) • David Fernandez • 19.2
- feat(npm): packument GET inline-build singlefli... (!633 - merged) • David Fernandez • 19.2