docs(specs): scope S31's hosted-miss 404 to the tarball route
What
S31 gives two answers for a read of [hosted_a (Miss), remote_b (unhealthy)]. This MR keeps the 503 the merge rules give the metadata routes, and scopes the 404 to the tarball route.
- The Resolution acceptance criterion A hosted miss alongside an unhealthy remote answered
404 package_not_foundon every route. - The merge rules in Cross-upstream packument merge, the merge criterion All-failed is a 503, and the Error Cases row for
UpstreamUnavailableanswer the metadata routes' mixed case (an absence at some positions, a failure at others) with503 upstream_unavailable.
The criterion now gives each route its own answer, and names S13's no-winner rule as the reason the tarball route still answers 404 beside an unanswered position. The tarball half's code also moves from package_not_found to file_not_found, matching the Error Cases row No winner across resolution, an absence established and the remote tarball route. The three mixed-case passages now name a health-marked position next to a transport failure: an unhealthy position fails without sending a request, and "failed on transport" let a reader place it outside the mixed case. The Error Cases row for AllUpstreamsUnhealthy gets the same split: a hosted miss there now leads to the no-winner-with-an-absence row on the tarball route, and to the mixed case of the UpstreamUnavailable row on the metadata routes.
The S31 plan listed this criterion as route-agnostic in Step 12 and Step 13 part 2. Both now record it as a both-routes split, like Nothing holds the package. Step 17 picks up the tarball half's file_not_found, because Step 12's facade table maps every case through the packument route's not-found code. No Step 15, 16 or 17 MR is open, so no in-flight work was built against the old text.
Why 503 on the metadata routes
remote_bwas never asked, so it may hold the package. A packument404invites the client, and any cache in between, to record an absenceremote_bnever reported.- The merge verdict comes from
errAbsenceShortOfEveryPositionininternal/virtual/collect_verdict.go, which Maven's package-level metadata merge shares. Answering404here would change Maven's merge too, or need an npm-only exception.
Evidence
I drove this on a local rig built from the S31 Step 15 branch, with the hosted repository missing the package and the remote's last_health_status set to 2. The packument read answered 503 upstream_unavailable with Retry-After: 300, and sent no upstream request. The log line was virtual: an absence was established, but not at every consulted position: remote: upstream unavailable. With the remote healthy, the same read answered 404 package_not_found.
Spec author review
@dmeshcharakou, this changes an acceptance criterion you wrote, so can you please review it? Two adjacent inconsistencies are left alone here:
- Nothing holds the package asserts
package_not_foundon the tarball route, while the Error Cases table gives that routefile_not_found. I can fold it in if you prefer. - S30's A hosted miss alongside an unhealthy remote is a 404, not a 503 makes the same route-agnostic claim for Maven, while S30's package-level metadata merge answers
503for that list through the sameCollectVerdict. That belongs in an S30 MR.
Related to #896 (closed)