From 203f05855ae11c6ad5e1dbd0ff3eb2625ee26b6f Mon Sep 17 00:00:00 2001 From: Joongi Kim Date: Mon, 27 Jul 2026 03:28:50 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20variant-proxy=20=E2=80=94=20server-comp?= =?UTF-8?q?uted=20variant=20index=20(Phase=20B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cmd/variant-proxy is a stateless reverse proxy in front of any V2 registry that serves GET /v2//_variants/ by running the same BuildIndex tag-scan used by `index update`, so plain `docker push` of labeled images is sufficient — no client-side index maintenance. Everything else passes through unchanged (docker push/pull work through the proxy). Errors use the OCI distribution error envelope; the served index advertises the proxy authority as its repository. Client side: FetchIndex now tries the _variants extension endpoint first and falls back to the "-variants" tag artifact, with a size cap on the accepted document. e2e: new proxy section — variants pushed only via plain docker push through the proxy (asserting no index artifact tag exists upstream), endpoint content and 404 behavior, and variant pull via the proxy selecting cu128/null per mocked hardware. Claude-Session: https://claude.ai/code/session_01D383U8kkQkJc1yzyC5H5Nk --- cmd/variant-proxy/main.go | 112 ++++++++++++++++++++++++++++++++++++++ e2e/run.sh | 43 ++++++++++++++- pkg/oci/index.go | 42 +++++++++++++- 3 files changed, 194 insertions(+), 3 deletions(-) create mode 100644 cmd/variant-proxy/main.go diff --git a/cmd/variant-proxy/main.go b/cmd/variant-proxy/main.go new file mode 100644 index 0000000..94ad67b --- /dev/null +++ b/cmd/variant-proxy/main.go @@ -0,0 +1,112 @@ +// variant-proxy is the Phase B registry-side component (DESIGN.md §6): a +// stateless reverse proxy in front of any V2 registry that additionally +// serves computed variant indexes at +// +// GET /v2//_variants/ +// +// The index is built on demand by scanning the upstream repository's +// "-