docs(specs): specify the container Manifest tab in monolith/S06
Summary
monolith/S06 mentioned the Docker and OCI page's raw Manifest tab only in its Phase 2 table. It had no GraphQL surface, client method, view behavior, acceptance criteria, or security note for it. So Step 7 of the container manifest detail plan stayed on hold even after AR began serving getContainerManifestRaw (122f14488). This amendment specifies the tab. The status stays Approved.
What S06 now specifies:
- GraphQL: a nullable
payloadstring on the manifest details type. It follows the referrers connection on the same type and makes its own raw read, only when selected. Unlike the other AR fields, whose limit is one call per distinct operation document,payloadcan be read at most once per HTTP request, counted across every operation of a multiplex. Without that, one request could carry about 50 payload operations: roughly 200 MB in one worker at the default cap, and about 100 AR requests against one repository, up to about 150 across repositories. The counter lives inGitlab::SafeRequestStore, becauseFieldCallCountkeys on each operation's fingerprint and so cannot count across a multiplex. The page's own operation never selects it. The Manifest tab selects it in a separate cache-first operation, which costs three AR requests (repository, manifest, raw). Cache-first is safe because a digest names fixed bytes, so returning to the tab issues no request. The tab mounts only after the page's operation has resolved, so landing on?tab=manifestcosts six AR requests over two operations in sequence. The media type comes from the existingmediaTypefield, because AR serves the payload under the stored media type and never negotiates it. - Bytes to text: the resolver reads the body as UTF-8 without converting it, and never parses, re-indents, or scrubs it, so the value hashes to the digest. When the bytes are not valid UTF-8, the field resolves null and the resolver logs the digest. This is a real case: live AR accepted a push with an invalid byte in a non-annotation field and served it back byte for byte. In the monolith such a string either raises
GraphQL::StringEncodingError(binary-tagged) or makesGitlab::Jsonwrite invalid UTF-8 into the response (UTF-8-tagged). Either way the whole GraphQL response breaks, not just this field. - Client: one method,
Get manifest payload. It is container-format only, returnsnilon404, and returns the body without parsing it. The connection parses JSON only for a media type of exactlyapplication/json, so a vendor+jsonbody arrives as a string. If AR ever sent a parsed JSON body, the method treats it as an unexpected success. - View: the payload renders verbatim (soft-wrapped, no re-indent, no highlighting) and in full. Its bound is AR's
container.manifest_max_payload: 4,000,000 bytes by default, which an operator can raise as far ascontainer.blob_max_size(50 GB by default). The S02 client holds the whole body, and JSON escaping can grow the response to about six times its size. A caption labels it as the stored copy, or the cached copy on a remote repository. Each bidi control and invisible character in an enumerated set displays as a code-point label such as⟨U+202E⟩, written into the text itself. So a control cannot reorder the text after it, and a payload of any size costs no element per character; the copied string is unchanged. The monolith's source viewer isn't reused: its marker keeps the raw character inside an element, which neither stops the reordering nor bounds the element count. The tab has a states table: loading, populated, cannot-display, not-found, and error. The page and the tab share one cached manifest field, so a manifest that the tab's operation resolves null with no error makes the whole page not-found. The tab's operation keeps Apollo's defaulterrorPolicy, so an AR failure writes nothing to the cache and shows the error state instead. A null payload shows the neutral cannot-display state rather than the referrers tab's failure alert, because its readings (such as invalid UTF-8) are properties of the stored data. Loading and cannot-display announce through the live region; the error alert announces itself, as on the Referrers tab. - Errors and security:
401/403/404resolve null silently. A5xx, including the500for an unreadable payload blob, maps to service-unavailable through the S02/S03 error classes and shows inside the tab region. A429, a5xx, another4xx, or a transport failure on the tab operation's repository or manifest read also shows the tab's error state, not the page's not-found. The payload is untrusted text: it is never rendered as HTML, never parsed, and never turned into links. The shared AR feature flag is the tab's accepted kill switch; there is no tab-scoped flag. - Tab set: the container row is Overview, Manifest, Referrers, with
?tab=manifest. Referrers is hidden at a zero count, as it is on the shipped page, so a remote repository, where AR always serves the count as0, shows Overview and Manifest.
Each decision has a Resolutions entry listing the rejected alternatives. Seven acceptance criteria are appended, each naming its test.
What this settles in the plan
- Open Question 4 (who settles the GraphQL shape for a raw-bytes resource): settled here by this amendment's author. The plan had routed it to #1150 (closed)'s DRI, and #1150 (closed) closed without settling it. This clears Step 7's second gate.
- Open Question 1, tab half: the container tab set is now specified. The container sidebar half stays open.
The plan itself is amended afterwards, in a separate docs(plans) MR via /monolith-planner.
Also touched
- The S17 container-redesign fast-follow row in Cross-spec moves from
PlannedtoImplemented: all 21 steps of its plan have merged, andgetContainerManifestRawis served. - The S06 row in
docs/specs/README.mdnow lists the raw manifest payload tab. - The Summary, the Phase 2 page row, and the Format scope resolution no longer say, in the present tense, that AR serves no single-manifest read. They now record that this was true when Phase 1 was specified, and that the fast-follow has since merged.
- The rest of the stale fast-follow text (the Phase 2 rows' field lists and Required S17 amendments) points at #1186, which tracks exactly that.
- The container read surface that shipped ahead of S06 specifying it (the single-manifest field, details type, referrers connection, and sidebar) is a separate Follow-ups entry. It points at the plan's Open Question 1, not at #1186, whose Ask doesn't cover it. This MR specifies only what the Manifest tab adds on top of that surface.
- Counts and closed lists that are now Phase 1 only say so: the S02 row's and the Ruby client's "four read methods", criterion 1's "four Phase 1 read methods", the list of fields with a call-count limit, the Resolutions entry's "four fields", and the Phase 1 aliasing criterion. The ones describing the call-count limit also now say "each distinct operation document", which is what the limit actually keys on.
- The Phase 2 table gains a Download manifest row, the home the Out of scope bullet points at. It waits on the container page's kebab, not on an AR route.
- Claims about repository kind now hold as written: the slice gates on kind only to hide the sidebar Size row, no read gates on kind, and apart from the kind badge the Manifest tab's caption is the one text that changes with kind.
- The Out of scope container bullet no longer says, in the present tense, that the page is gated on the fast-follow.
Overlap and merge order
This MR merges first, and !2798 (merged) (the delete-surface promotion) rebases onto it afterwards. Both are mine. This MR targets main and does not stack on !2798 (merged).
git merge-tree against the !2798 (merged) head (bfd8b1d29) finds 8 conflict hunks in S06 and 1 in the README's S06 row. The S06 hunks are in the Summary, the Cross-spec fast-follow row, the Phase 2 intro and page row, Authorization, the Ruby client, criterion 1, Out of scope, and the Format scope and Write actions resolutions. The two MRs make opposite claims in several of them. When !2798 (merged) rebases, each hunk keeps this MR's fast-follow and Platforms facts and !2798 (merged)'s delete scope.
Four places need more than taking a side, and the !2798 (merged) rebase fixes them by hand:
- The Out of scope bullet says the slice gates on kind only to hide the sidebar Size row. !2798 (merged)'s
kind-gated dist-tag removal control is a second gate to add there. - The S02 row counts the four Phase 1 read methods and the Manifest tab's one more. It must also name the
delete_npm_dist_tagwrite that !2798 (merged) adds. - !2798 (merged)'s "four read methods" in the Ruby client and criterion 1 stay scoped to Phase 1, because the payload method is a fifth read method.
- !2798 (merged)'s Phase 2 intro ("Every row but one is blocked on the named AR gap") must account for this MR's page row and its Download manifest row, neither of which waits on an AR gap.
Noticed, not changed here
- Live AR accepts a manifest push whose bytes are not valid UTF-8 anywhere except an annotation value. An invalid byte in an annotation key becomes U+FFFD in the detail's
annotations, while the raw payload is still served byte for byte. An invalid byte in an annotation value fails the push with a500atpersist_manifest(oci.manifest.partial_persist: true). No existing issue covers either behavior. I have not filed one; this spec handles the accepted case either way, since a remote payload is whatever the upstream served. - Phase 1's version tab operation may have the same shared-cache behavior as the container tab (a null version in the tab's operation overwriting the page's entry). I have not changed or verified that here.
Governing ADRs
The mirror is current (./scripts/adr-freshness.sh exits 0). No conflict:
- ADR-014: GraphQL is the browser's read surface, which is why the payload is a GraphQL field and not a Rails download route. The credential stays server-side.
- ADR-009: its Management API category lists JSON responses and also a raw-bytes file download. S17 already places the raw route in that unreconciled area rather than a forbidden one. This spec consumes the route and adds no AR behavior.
- ADR-021: a missing or unreadable manifest resolves null, which is the existing existence-hiding behavior.
Testing
This is a docs-only spec change, so there is no code to test. The docs lint that CI runs passes on the changed files. The AR contract claims were checked against a local AR built from main: 200 with the stored media type and nosniff, a body whose SHA-256 equals the digest, HEAD, 404 on an unknown digest, 405 on POST, compact referrer payloads, invalid-UTF-8 payloads (outside annotation values) accepted and served byte for byte, and the body's encoding tag varying (UTF-8 or binary) through the monolith's Faraday setup. The monolith claims were checked against origin/master 3fffb654e87f: the query size limit and call-count keying, the source viewer's bidi list and marker, the manifest page's live-region handling, and the referrers fetch policy.
How to set up and validate locally
From the worktree root:
mise exec -- markdownlint-cli2 docs/specs/monolith/S06-version-detail.md docs/specs/README.md
mise exec -- vale --minAlertLevel error docs/specs/monolith/S06-version-detail.md docs/specs/README.md
mise exec -- lychee --offline --include-fragments docs/specs/monolith/S06-version-detail.md docs/specs/README.md
./scripts/adr-freshness.shAgainst a running AR with a hosted Docker repository and a per-user JWT in AR_TOKEN:
BASE="$AR_URL/api/v1/$SLUG/repositories/$REPO/docker/images/$IMAGE_ID/manifests/$DIGEST"
curl -sD - -o /tmp/raw.bin -H "Authorization: Bearer $AR_TOKEN" "$BASE/raw" | grep -iE '^(HTTP|content-type|x-content-type)'
echo "sha256:$(shasum -a 256 /tmp/raw.bin | cut -d' ' -f1)" # equals $DIGEST
curl -s -o /dev/null -w '%{http_code}\n' -X POST -H "Authorization: Bearer $AR_TOKEN" "$BASE/raw" # 405Expected: 200, a manifest media type, X-Content-Type-Options: nosniff, the digest echoed back, and 405.
Related to gitlab-org/gitlab#630652