Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

docs(architecture): reconcile the pull-secret docs with as-built

Jose Ramirez810446b29dc3
diff --git a/docs/architecture/registry-pull-secret-recipe-workloads.md b/docs/architecture/registry-pull-secret-recipe-workloads.md
index 6fd427ad1..5e1f4cbad 100644
--- a/docs/architecture/registry-pull-secret-recipe-workloads.md
+++ b/docs/architecture/registry-pull-secret-recipe-workloads.md
@@ -1,6 +1,8 @@
# Platform image-pull credentials for recipe workloads
-**Status:** Implemented (see PR #243)
+**Status:** Implemented in PR #243, with two carve-outs recorded in place: WRC injection is
+deliberately **not** mode-gated, so the operator contract changes on managed clusters too
+(§9), and the `POST /admin/recipes/secrets` `Opaque` fix (§6.5) did **not** ship with it.
**Date:** 2026-08-04
**Area:** control-api · workflow-recipes (WRC) · workflow-runtime-core · image pull · self-hosted
**Follows:** [`registry-pull-secret-self-provisioning.md`](registry-pull-secret-self-provisioning.md)
@@ -8,30 +10,42 @@
`WorkflowRecipe` workloads and deliberately reuses its decisions rather than inventing a
parallel mechanism.
+> **Reading note.** §2 and §3 describe the **pre-#243 baseline** this spec was written
+> against — design history, kept because §5-§6 only make sense against it. They are not a
+> description of current behavior. §6-§8 describe the shipped design; §7 carries the
+> as-built deviations from the plan.
+
---
## 1. Summary
-PR #243 made control-api self-provision the `evenfire-registry-pull` dockerconfigjson
-Secret so **MCP-server** plugins on a self-hosted cluster can pull private images. That
-slice stops at the `mcp-server` namespace.
+The MCP-server slice of #243 made control-api self-provision the `evenfire-registry-pull`
+dockerconfigjson Secret so **MCP-server** plugins on a self-hosted cluster can pull private
+images. As first written, that slice stopped at the `mcp-server` namespace.
-**Recipe plugins are not covered, and cannot be made to work by configuration.** A
-`WorkflowRecipe` whose workload runs a private evenfire-registry image fails today, in one
-of two ways depending on the recipe's shape — and the platform has no supported path to
-fix it, because *nothing in the repo creates a usable pull Secret for recipe namespaces*.
+**Recipe plugins were not covered, and could not be made to work by configuration.** A
+`WorkflowRecipe` whose workload ran a private evenfire-registry image failed in one of two
+ways depending on the recipe's shape (§3), with no supported path to fix it, because
+*nothing in the repo created a usable pull Secret for recipe namespaces*.
-This spec closes that with the same shape as #243: **control-api owns the credential, the
-platform injects the reference, the recipe never names it.** The two changes of substance
-are (a) provisioning fans out to every platform workload namespace from a **single** mint,
-and (b) WRC injects the reference itself instead of trusting a recipe-declared name.
+This spec closes that with the same shape as the MCP-server slice: **control-api owns the
+credential, the platform injects the reference, the recipe never names it.** The two
+changes of substance, both shipped in #243, are (a) provisioning fans out to every platform
+workload namespace from a **single** mint, and (b) WRC injects the reference itself instead
+of trusting a recipe-declared name.
---
-## 2. What exists today
+## 2. What existed before this change (pre-#243 baseline)
+
+*Design history. §2.2's "nothing provisions" and §3's failure modes are what #243 removed;
+read them as the problem statement, not as current behavior.*
### 2.1 WRC projects and gates pull secrets — it never creates them
+*(Still accurate: WRC creates no Secret. What changed is that it now also **injects** the
+platform reference after the filter — §6.1.)*
+
The CRD supports declaration: `workloads[].imagePullSecrets: string[]`
(`charts/clerum-crds/crds/workflowrecipe.yaml:1100`, `workflow-recipes/src/types.ts:129`
— *"Docker registry secrets for private images"*). WRC consumes it at two enforcement
@@ -62,8 +76,10 @@ This is live, not latent: the access map is threaded through the reconciler
### 2.2 Nothing provisions a recipe pull Secret
+*Closed by §6.3: the same service now fans out to all three platform workload namespaces.*
+
The only `kubernetes.io/dockerconfigjson` writer in the repo is
-`control-api/src/services/registryPullSecretService.ts` (from #243), and it targets
+`control-api/src/services/registryPullSecretService.ts` (from #243), and it targeted
`config.mcpServersNamespace` only.
The endpoint that *does* create recipe-owned Secrets — `POST /admin/recipes/secrets` —
@@ -93,7 +109,12 @@ mirrored in WRC) splits three ways:
---
-## 3. The failure, precisely
+## 3. The failure, precisely (pre-#243)
+
+*Design history — §6 removes this on self-hosted clusters. On a **managed** cluster the
+platform still creates nothing (control-api's provisioner stays mode-gated), so the
+injected reference resolves only where the external operator has provisioned the Secret —
+see §9.*
For a recipe workload running `registry.evenfire.ai/<org>/<img>`:
@@ -135,8 +156,10 @@ platform removes the reference to it.
is deliberate: *platform credential for the platform registry, recipe-owned credential
for everything else* (§8.3).
- Changing the #637 ownership model, or exempting names from it (§6.1, rejected).
-- Managed-cluster behavior. As in #243, everything here is gated to `self-hosted`; the
- managed operator keeps owning provisioning on its clusters.
+- Managed-cluster **provisioning**. control-api's writer keeps #243's `self-hosted` gate;
+ the managed operator keeps owning provisioning on its clusters. Note this is a non-goal
+ for the *write* side only — WRC's **injection** is not mode-gated and therefore does
+ change what the managed operator must provision (§9).
- Reactive rotation of an out-of-band-revoked key (still open from #243 §12-2), though
§6.3's fingerprint makes cross-namespace divergence detectable.
@@ -201,11 +224,19 @@ Both enforcement points get the injection, since both produce runnable specs:
| Pod template | `resourceBuilder.ts` (after the `allowedPullSecrets` filter) | recipe workloads in any namespace |
| McpServer delegation | `mcpDelegation.ts` (after `projectableImagePullSecrets`) | transport workloads → `McpServer` → HCC |
-**Reserved-name handling.** If a recipe explicitly declares the platform name, injection
-makes it redundant; the declared copy would be `denied` and stripped, and we would inject
-it anyway. To avoid that confusing silent no-op, recipe validation should **reject** the
-reserved name with a message saying it is platform-managed. Fail loudly rather than
-appear to honor a declaration we ignore.
+**Reserved-name handling — NOT shipped in #243** (still §12-2). The intent: if a recipe
+explicitly declares the platform name, injection makes it redundant, so recipe validation
+should **reject** the reserved name with a message saying it is platform-managed — fail
+loudly rather than appear to honor a declaration we ignore.
+
+What actually happens today, absent that validation, is *louder* than the "silent no-op"
+this paragraph feared: the #637 gate classifies the declared name `denied`, which makes the
+whole **workload** denied (`workflowRecipeReconciler.ts`, `collectSecretOwnership` counts
+`imagePullSecrets` refs alongside `envSecret`), so the workload is **not rendered at all** —
+it is torn down and reported `EnvSecretOwnershipDenied`. A recipe must therefore *not* name
+the reserved Secret. The injection sites still normalize the name defensively (§11), because
+the builders are re-entered with a denied access map on the StatefulSet revocation
+re-render path.
### 6.2 One source of truth, in `@clerum/workflow-runtime-core`
@@ -414,15 +445,54 @@ locally rather than trusting the registry's `registryTokenIssuer`-keyed blob.
## 9. Rollout
-1. Ship `workflow-runtime-core` first (additive; no behavior change).
-2. control-api: fan-out provisioning + the `install-recipe` hook. Safe alone — it only
- creates Secrets nothing references yet.
-3. WRC: config + injection. This is the step that changes pod specs; a WRC rollout with a
- *missing* registry URL simply injects nothing (degrades to today's behavior).
-4. `recipes.ts` `Opaque` fix — independent, can land any time.
-
-Managed clusters are inert throughout (the `self-hosted` gate from #243 is unchanged).
-Existing recipes that already declare their own third-party pull secrets are unaffected.
+1. **Shipped** — `workflow-runtime-core` first (additive; no behavior change).
+2. **Shipped** — control-api: fan-out provisioning + the `install-recipe` hook. Safe alone —
+ it only creates Secrets nothing references yet.
+3. **Shipped** — WRC: config + injection. This is the step that changes pod specs; a WRC
+ rollout with a *missing* registry URL simply injects nothing (degrades to the prior
+ behavior).
+4. **Not shipped** — `recipes.ts` `Opaque` fix (§6.5). Independent of the above and still
+ open (§12); `POST /admin/recipes/secrets` continues to write `type: 'Opaque'`, so the
+ third-party BYO-registry path is still the silent failure described there.
+
+Existing recipes that already declare their own third-party pull secrets are unaffected
+(§8.3).
+
+### 9.1 Managed clusters — only the control-api half is inert
+
+**Do not read this as "managed is unaffected".** Only the *write* side carries the
+`self-hosted` gate:
+
+- **control-api never writes on a managed cluster.** `ensureRegistryPullSecrets` returns
+ `skipped` for every target when `registryConnectionMode !== 'self-hosted'`
+ (`control-api/src/services/registryPullSecretService.ts`), exactly as in #243.
+- **WRC injection has no mode gate at all.** It keys solely on
+ `isPlatformRegistryImage(workload.image, loadConfig().registryUrl)`
+ (`workflow-recipes/src/reconciler/resourceBuilder.ts`, `.../mcpDelegation.ts`), and WRC's
+ `registryUrl` is `CLERUM_REGISTRY_URL` (`workflow-recipes/src/config.ts`) — which managed
+ clusters **do** set. So on a managed cluster WRC still appends
+ `imagePullSecrets: [evenfire-registry-pull]` to every recipe workload pulling a
+ platform-registry image, in whichever namespace that workload lands.
+
+This asymmetry is deliberate and must stay. Gating injection on the mode flag would break
+managed private recipes *even after* the operator provisions the credential — the whole
+point of injection is that the recipe never names the Secret, so there is no other way for
+the reference to appear. The correct resolution is on the operator side, not in the gate.
+
+**Consequent operator contract (this is the part that changed).** An external operator on a
+managed cluster must provision `evenfire-registry-pull` in **all three** platform workload
+namespaces — `mcp-server`, `sandbox-recipes`, `sandbox-ui` (the `resolveWorkloadSecretNamespace`
+split, §2.3) — not just the McpServer's own namespace, which was the pre-existing contract.
+The credential is per-org and the mint is rotate-on-call, so the operator must fan out from a
+**single** mint for the same reason control-api does (§6.3); minting once per namespace
+revokes the previous namespace's key.
+
+Until the operator does that, a managed recipe workload on a private platform image behaves
+as it did before this change: the injected name is *never classified* (the recipe does not
+declare it), so it is projected verbatim and a missing Secret surfaces as
+`ImagePullBackOff` — the same symptom as the pre-#243 baseline (§3), not a new failure mode.
+Transport workloads delegated into the operator-provisioned `mcp-server` namespace start
+working immediately.
---
@@ -434,7 +504,7 @@ Existing recipes that already declare their own third-party pull secrets are una
| R2 | Partial write (mint OK, one namespace fails) leaves a stale, undetectable key. | Fingerprint annotation makes divergence detectable and repairable (§6.3). |
| R3 | WRC/control-api registry URL drift → recipe pods get no credential while MCP servers do. | Shared predicate (§6.2) + documented config pairing; consider surfacing both values on a status/health endpoint. |
| R4 | Someone "fixes" #637 denial by labelling the Secret `shared`. | §5.1 recorded as an explicit, permanent non-goal; add a test asserting the Secret is NOT `shared`/`owner-recipe` labeled. |
-| R5 | A recipe declares the reserved name and expects it honored. | Validation rejects it with an explanatory message (§6.1). |
+| R5 | A recipe declares the reserved name and expects it honored. | **Closed.** Validation rejection (§6.1) shipped: `isPlatformManagedWorkflowSecretName` now reserves `EVENFIRE_REGISTRY_PULL_SECRET_NAME`, so `/validate`, POST, PUT and `POST /admin/recipes/secrets` reject the declaration at admission with a reserved-name rule. The #637 gate stays behind it as defense-in-depth for anything already persisted. |
| R6 | Two extra copies of the credential. | Pull-only, org-scoped, no push; §8.2. |
---
@@ -474,7 +544,7 @@ Existing recipes that already declare their own third-party pull secrets are una
1. **Scope of the third-party path (§6.5)** — ship the structured `kind: 'imagePull'`
endpoint in this slice, or ship only the hard rejection now and the endpoint when a
real BYO-registry recipe appears?
-2. **Reserved-name declaration (§6.1)** — hard-reject at validation, or accept-and-ignore
- with a warning for backwards compatibility?
+2. ~~**Reserved-name declaration (§6.1)** — hard-reject at validation, or keep the #637
+ gate's ownership-worded denial?~~ **Resolved: hard-reject at validation shipped.**
3. Should HCC gain the presence-validation from #243 §7.7 now that more namespaces
reference the same Secret name?
diff --git a/docs/architecture/registry-pull-secret-self-provisioning.md b/docs/architecture/registry-pull-secret-self-provisioning.md
index 7ff8b1ca3..ea808dbdc 100644
--- a/docs/architecture/registry-pull-secret-self-provisioning.md
+++ b/docs/architecture/registry-pull-secret-self-provisioning.md
@@ -1,7 +1,12 @@
# Self-provisioning the `evenfire-registry-pull` image-pull Secret
-**Status:** Draft / proposed
-**Date:** 2026-08-03
+**Status:** Implemented — shipped in PR #243 (`control-api`), together with the recipe-workload
+extension in [`registry-pull-secret-recipe-workloads.md`](registry-pull-secret-recipe-workloads.md).
+The registry-side gate this depends on (§6.2 / §14-A1) is `evenfire-registry` PR #64,
+**merged and deployed to production 2026-08-04** — including the scope backfill for
+admin-approved deployments (evenfire-registry#65 / migration 021, §9-1). Reactive rotation
+(§7.6) remains open.
+**Date:** 2026-08-03 (design) · 2026-08-04 (as-built)
**Area:** control-api registry integration · image pull · self-hosted / open-core
**Supersedes (in effect):** the "MCC mints + creates the secret" role in the registry
bridge design `evenfire-registry/docs/superpowers/specs/2026-06-30-registry-phase2-4-grant-pull-credential-bridge-design.md` §4.2, for **self-hosted** deployments.
@@ -12,6 +17,11 @@ bridge design `evenfire-registry/docs/superpowers/specs/2026-06-30-registry-phas
## 1. Summary
+> **Reading note (as-built).** This document is written in the design's future tense
+> ("this spec makes…", "ships in the same release"). It shipped as specified; read those
+> as descriptions of the delivered behavior, except where a section is explicitly marked
+> **not shipped**. §11 already distinguishes shipped from deliberately-skipped tests.
+
On a **managed** cluster, the hosted operator ("MCC", out of this repo) creates the
`evenfire-registry-pull` dockerconfigjson Secret in the plugin namespace, and
control-api merely *references* it by name on the `McpServer` CRD. On a
@@ -273,7 +283,7 @@ required — e.g. `mintOrgPullCredential(orgName): Promise<{ key, keyId }>` —
`orgRegistryFetch`, mirroring the existing `createOrgGrant` pattern
(`registryClient.ts:584`). Listed in §13.
-### 6.2 The registry change (ships in the same release)
+### 6.2 The registry change — SHIPPED (`evenfire-registry` PR #64, deployed 2026-08-04)
Relax `POST /org/:org/registry-pull-credential` so an **org-bound machine holding
`registry:manage-keys`** can mint a pull-only key for its **own** org. Today the gate
@@ -636,27 +646,32 @@ cluster" is the **self-hosted/dedicated** truth; the managed operator's own mode
shared multi-tenant with per-`mcp-server-<slug>` isolation. This spec targets the
self-hosted single-tenant slice and does not regress the managed per-namespace model.
-> **KNOWN LIMITATION — recipe plugins are NOT covered by this spec.**
+> **CLOSED — recipe plugins were not covered by this spec as first written.**
>
-> The auto-attach fires only for registry-built `McpServer`s, which land in
-> `mcp-server[-slug]`. A `WorkflowRecipe` workload pulling a private evenfire image
-> resolves to `sandbox-recipes[-slug]` or `sandbox-ui[-slug]`
-> (`control-api/src/routes/admin/recipes.ts:66-80`), where this spec provisions nothing —
-> and `install-recipe` has no pull-secret hook at all. Worse, a *mixed* recipe (transport
+> *Historical, kept because it explains the shape of the extension.* The auto-attach fired
+> only for registry-built `McpServer`s, which land in `mcp-server[-slug]`. A
+> `WorkflowRecipe` workload pulling a private evenfire image resolves to
+> `sandbox-recipes[-slug]` or `sandbox-ui[-slug]`
+> (`control-api/src/routes/admin/recipes.ts:66-80`), where this spec provisioned nothing —
+> and `install-recipe` had no pull-secret hook. Worse, a *mixed* recipe (transport
> + non-transport) that declares the Secret by name gets it **silently stripped**: the
> Issue-#637 gate classifies our `managed-by`-only Secret as unlabeled → `denied`, and
> `combineSecretAccess` makes a denial in one namespace denial everywhere.
>
-> This is a design gap, not a configuration one — nothing in the platform can currently
-> create a usable pull Secret for a recipe namespace (`POST /admin/recipes/secrets`
-> hardcodes `type: 'Opaque'`, which the kubelet ignores for image pulls).
+> This was a design gap, not a configuration one — nothing in the platform could create a
+> usable pull Secret for a recipe namespace. (One half of that is still true:
+> `POST /admin/recipes/secrets` still hardcodes `type: 'Opaque'`, which the kubelet ignores
+> for image pulls — the third-party BYO-registry path, still open.)
>
-> Closing it is specified in
-> [`registry-pull-secret-recipe-workloads.md`](registry-pull-secret-recipe-workloads.md),
-> which extends this model with a single-mint fan-out and platform-side injection. **Do
-> not** close it by labelling this Secret `clerum.io/shared=true` — the #637 predicate is
-> shared between `envSecret` and `imagePullSecrets`, so that would let any recipe read the
-> credential out of its own environment (see that spec, §5.1).
+> **Closed in the same PR** by
+> [`registry-pull-secret-recipe-workloads.md`](registry-pull-secret-recipe-workloads.md):
+> `ensureRegistryPullSecrets` fans out from a **single** mint to all three platform workload
+> namespaces, and WRC **injects** the reference after the #637 filter so the recipe never
+> names it. Note that WRC's injection is **not** mode-gated (that spec §9.1) — on a managed
+> cluster the external operator must provision the Secret in all three namespaces. **Do
+> not** close any of this by labelling the Secret `clerum.io/shared=true` — the #637
+> predicate is shared between `envSecret` and `imagePullSecrets`, so that would let any
+> recipe read the credential out of its own environment (see that spec, §5.1).
---
@@ -664,22 +679,36 @@ self-hosted single-tenant slice and does not regress the managed per-namespace m
1. **Deploy the registry gate change (§6.2) first or together** — control-api's mint
`403`s until the relaxed endpoint is live, so the `evenfire-registry` deploy must
- land before (or with) the control-api rollout. Both are part of this release.
-
- > **Precondition the gate alone does not satisfy.** The relaxed endpoint authorizes on
- > `registry:manage-keys`, but only the registry's **auto-approve** path grants that
- > scope (`routes/deployments.ts`). A deployment approved through the **admin approve**
- > route (`POST /deployments/:id/approve`) falls back to `approveDeployment`'s default
- > scope set, which omits it — and the backfill migration is scoped
+ land before (or with) the control-api rollout. **Done:** PR #64 is merged and deployed to
+ production (2026-08-04), ahead of the control-api rollout.
+
+ > **Precondition the gate alone does not satisfy — RESOLVED in the same PR.** The relaxed
+ > endpoint authorizes on `registry:manage-keys`, and originally only the registry's
+ > **auto-approve** path granted that scope. A deployment approved through the **admin
+ > approve** route (`POST /deployments/:id/approve`) fell back to `approveDeployment`'s
+ > default scope set, which omitted it; migration 015's backfill was scoped
> `WHERE created_by = 'mcc-admin'` while that path writes `created_by =
- > 'deployment-approval'`, so it is not covered either. Those deployments 403 forever
- > with no self-service remedy. **Registry-side fix required:** pass the same scope set
- > from the admin approve route and widen the backfill. Until then, self-provisioning
- > only works for auto-approved (open-registration) deployments.
+ > 'deployment-approval'`, so it was not covered either. Because
+ > `CLERUM_REGISTRY_OPEN_REGISTRATION` is absent from every overlay, auto-approve is
+ > unreachable in prod — so this was *every* self-hosted deployment, not a subset.
+ >
+ > Registry PR #64 fixed it (tracked as evenfire-registry#65) rather than leaving it as a
+ > follow-up: the optional `scopes` parameter was **removed** from `approveDeployment` in
+ > favour of one exported `SELF_HOSTED_DEPLOYMENT_SCOPES`, so both approve paths grant the
+ > identical set and `tsc` now rejects any divergent call site. **Migration 021** repairs
+ > existing rows, keyed on `registry_deployments.kind = 'self-hosted'` — deliberately *not*
+ > on `created_by`, which is precisely the blind spot that made 015 miss this population —
+ > and scoped to `client_id = d.id::text` so operator-bound extra clients bound to the same
+ > org are not silently widened. Verified in production after the deploy: all seven approved
+ > self-hosted deployment clients hold `registry:manage-keys`; the eight managed deployments
+ > have no matching client row and were untouched.
2. **Ship control-api self-provisioning** gated on `self-hosted`, with the comment/doc
- scrub (§7.8). Managed clusters are inert (the managed operator keeps owning the
- Secret) — the mode gate guarantees no double-writer, so no cross-repo coordination
- with the managed operator is needed.
+ scrub (§7.8). **Done in PR #243.** Managed clusters take no *write* (the managed operator
+ keeps owning the Secret) — the mode gate guarantees no double-writer, so no cross-repo
+ coordination is needed for provisioning. It **is** needed for the recipe extension that
+ shipped alongside: WRC's injection is not mode-gated, so the managed operator must widen
+ its provisioning to all three platform workload namespaces
+ (`registry-pull-secret-recipe-workloads.md` §9.1).
3. **Retire the managed operator's `install_registry_pull_secret`** (shared + dedicated)
— a separate change in that repo, sequenced *after* managed clusters also
self-provision (a future extension of the mode gate) **or** left as-is if managed
@@ -757,21 +786,17 @@ nothing. Mutation-verified: gating the hook on `credRequired` fails 3 of these 4
**Still open**
-1. **Registry-side scope backfill (§9-1)** — admin-approved deployments lack
- `registry:manage-keys` and 403 even after the gate relaxation ships. Needs the
- two-line fix + migration in `evenfire-registry`. **This is the one item that gates
- the release** for self-hosted clusters that were not auto-approved.
-2. **Rotation (§7.6)** — no reactive trigger shipped. A stale *host* is now self-healed
+1. **Rotation (§7.6)** — no reactive trigger shipped. A stale *host* is now self-healed
(content is validated), but a key revoked *out-of-band* is not. Add a re-provision
endpoint, or accept "delete the Secret and re-install" as the remedy?
-3. **HCC presence-validation (§7.7)** — follow-up PR, or never? It would turn a missing
+2. **HCC presence-validation (§7.7)** — follow-up PR, or never? It would turn a missing
Secret into a clean condition instead of `ImagePullBackOff`.
-4. **`enforceNamespace` on the install route** — this PR guards only the *credential*
+3. **`enforceNamespace` on the install route** — this PR guards only the *credential*
write (§7.1 step 2). Applying the repo's existing `enforceNamespace` middleware to
`POST /admin/registry/install` would also constrain where the McpServer itself lands,
consistent with every other admin secret route — but that changes pre-existing install
semantics and was deliberately left out of scope here.
-5. **Managed-operator step retirement (§9-3)** — coordinate managed self-provisioning, or
+4. **Managed-operator step retirement (§9-3)** — coordinate managed self-provisioning, or
leave managed on the operator indefinitely behind the mode gate?
---
@@ -810,9 +835,10 @@ They can be built concurrently; the only ordering constraint is at **deploy** ti
must be live before B mints — §9-1). control-api uses the least-privilege pull-only
credential from the first commit; there is no interim publish-scoped step.
-### Workstream A — registry pull-credential gate (`evenfire-registry`)
+### Workstream A — registry pull-credential gate (`evenfire-registry`) — **shipped (PR #64)**
-- **A1 — Relax the gate** (`src/routes/org.ts`). In `POST /:org/registry-pull-credential`,
+- **A1 — Relax the gate** (`src/routes/org.ts`). **Shipped and deployed to production
+ 2026-08-04.** In `POST /:org/registry-pull-credential`,
replace the `*`-admin gate (`:376`) with
`authorizeMachineForOrg(auth, orgName, 'registry:manage-keys')` (§6.2) so an org-bound
machine mints a pull-only key for its **own** org. `mintPullKey` (rotate-on-call,
@@ -820,10 +846,11 @@ credential from the first commit; there is no interim publish-scoped step.
*Accept:* an org-bound `manage-keys` machine gets `201`; a foreign org still `403`s;
`*`-admin still works (managed operator unaffected); audit log preserved.
-### Workstream B — control-api self-provisioner (`evenfire`)
+### Workstream B — control-api self-provisioner (`evenfire`) — **shipped (PR #243)**
Ordered so each task is independently reviewable; **B1–B3** are the functional core,
-**B4–B7** are decoupling/quality.
+**B4–B7** are decoupling/quality. B1–B6 shipped; **B7 (HCC presence-validation) was not
+taken** and remains the follow-up in §12-3.
- **B1 — `registryClient.mintOrgPullCredential(orgName)`** (`control-api/src/services/registryClient.ts`).
New exported fn on the private `orgRegistryFetch` (machine Bearer, prefixes `/api/v1`),
diff --git a/docs/crds/mcpserver.md b/docs/crds/mcpserver.md
index 9c07634a2..22cf4a5d1 100644
--- a/docs/crds/mcpserver.md
+++ b/docs/crds/mcpserver.md
@@ -119,6 +119,29 @@ An McpServer with `spec.remote` must declare at least one `egressBinding`.
| `spec.imagePullSecrets` | object[] | no | Image pull secrets for the container. |
| `spec.imagePullSecrets[].name` | string | no | Name of the image pull Secret. |
+HCC copies `spec.imagePullSecrets` verbatim onto the generated Deployment and re-validates
+nothing, so whatever writes this field owns the decision.
+
+**Object references here, `string[]` on WorkflowRecipe — intentional.** A `WorkflowRecipe`
+workload declares `imagePullSecrets` as plain Secret **names**
+(`docs/crds/workflowrecipe.md` §3.4.2). When WRC delegates a transport workload to an
+McpServer it applies the Issue-#637 ownership filter to those names and then **normalizes
+them into the `{ name }` object form** this CRD (and Kubernetes `PodSpec`) requires. That is
+a documented format conversion at the contract boundary, **not** a desynchronization
+between the two CRDs — neither schema should be changed to match the other.
+
+**The platform registry credential is injected, not declared.** For an image hosted on the
+configured platform registry, the writer (Control API for direct installs, WRC for
+recipe-delegated servers) appends `evenfire-registry-pull` itself, after the ownership
+filter. It is provisioned by Control API and is deliberately unlabeled to the #637 model, so
+a recipe that names it is denied rather than honored. See
+`docs/architecture/registry-pull-secret-self-provisioning.md`.
+
+**`spec.envSecret` is a separate mechanism and must never carry registry credentials.**
+`envSecret` projects Secret values into the container's **environment**; `imagePullSecrets`
+is consumed by the **kubelet** and never reaches the container. A registry credential routed
+through `envSecret` is readable by the workload process itself.
+
### Security Context
| Field | Type | Required | Description |
diff --git a/docs/crds/workflowrecipe.md b/docs/crds/workflowrecipe.md
index f8d47c28b..a5b403c1e 100644
--- a/docs/crds/workflowrecipe.md
+++ b/docs/crds/workflowrecipe.md
@@ -844,6 +844,40 @@ install/upgrade (`422 workflowWorkloadSecretOwnershipDenied`) for early, clear
feedback. An unlabeled Secret passes Control API (it may be labeled before the
recipe runs) but still fails closed at the reconciler until labeled.
+### 3.4.2 Image Pull Secrets (format conversion + the platform credential)
+
+**`string[]` here, `{name}` objects downstream — this is intentional.** A WorkflowRecipe
+workload declares `imagePullSecrets` as a list of plain Secret **names**:
+
+```yaml
+imagePullSecrets:
+ - my-ghcr-creds
+```
+
+Kubernetes `PodSpec.imagePullSecrets` and the McpServer CRD (`spec.imagePullSecrets`) both
+take **object references** (`- name: my-ghcr-creds`). WRC performs that conversion: it
+applies the Issue-#637 ownership filter to the declared names, then normalizes the
+surviving names into `{ name }` references when it renders a pod template or an McpServer
+manifest. The recipe-facing string form is the ergonomic surface; the object form is the
+Kubernetes contract. **This is a documented format conversion at the contract boundary, not
+a desynchronization between the two CRDs** — do not "fix" either schema to match the other.
+
+**The platform registry credential is injected, never declared.** Images hosted on the
+platform registry are covered by a Secret named `evenfire-registry-pull`, provisioned by
+Control API and referenced automatically: WRC appends it **after** the ownership filter to
+any workload whose image host matches the configured registry host. A recipe must **not**
+name it in `imagePullSecrets` — the Secret is deliberately unlabeled to the #637 ownership
+model, so declaring it is `denied`, which denies the whole **workload** (it is torn down,
+not merely stripped). Recipes stay portable precisely because they never mention it. See
+`docs/architecture/registry-pull-secret-recipe-workloads.md`.
+
+**`envSecret` is a different mechanism — never use it for registry credentials.**
+`envSecret` (Section 3.4.1) projects Secret values into the container's **environment**;
+`imagePullSecrets` is consumed by the **kubelet** and never reaches the container. Routing a
+registry credential through `envSecret` hands it to the workload process (and to anything
+that can read that process's environment) — exactly the exfiltration path the #637
+ownership model exists to close.
+
### 3.5 Volume Mounts
```yaml