@@ -241,3 +241,48 @@ name, so the older could stay the signer (`Keys.rotate!/1` now makes the new key
241241- The ` TrustedHeaders ` profile, only if a deployment asks (deviation 2).
242242- The ` [::1] ` origin in ` Server.Plug.loopback_origins/0 ` is a browser ` Origin ` header (bracketed there,
243243 rightly); F2 is about ` URI.host ` , not that list.
244+
245+ ## Correction, 2026-09-22, after the tag: the release build was broken
246+
247+ ** F5, found by the ` package ` workflow at the ` slice/062 ` tag** (run 35786247006, the first run of
248+ that workflow over this slice: its push trigger is tags only). The linux and windows legs failed to
249+ compile:
250+
251+ ```
252+ == Compilation error in file lib/trinity_web/endpoint.ex ==
253+ ** (ArgumentError) cannot escape #Function<0.132933281/1 in Trinity.MCP.Server.Plug.init/1>.
254+ The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote
255+ functions in the format &Mod.fun/arity
256+ ```
257+
258+ ` Plug.Builder ` calls a plug's ` init/1 ` ** at compile time** when ` MIX_ENV=prod ` and escapes what it
259+ returns into the compiled endpoint. Slice 062 replaced 061's ` authorize: &Auth.Local.authorize/1 `
260+ (a remote capture, which escapes) with an anonymous function closing over the process-dictionary
261+ key (which cannot be escaped). ` mix gate ` runs in ` MIX_ENV=test ` , where ` init/1 ` is called per
262+ request, so the local gate and all three CI legs were green over a tree whose release could not
263+ compile. Reproduced on ` main ` at ` 9859fbe ` in one command, before any fix:
264+
265+ ```
266+ $ MIX_ENV=prod mix compile
267+ == Compilation error in file lib/trinity_web/endpoint.ex ==
268+ ** (ArgumentError) cannot escape #Function<0.132933281/1 in Trinity.MCP.Server.Plug.init/1>. …
269+ exit 1
270+ ```
271+
272+ Fixed in ` fix(s062) ` on ` fix/s062-prod-compile ` : the hook is ` &__MODULE__.authorized/1 ` , a public
273+ function with the same body, as 061's was a remote capture. The regression test is
274+ ` test/trinity/mcp/server_test.exs ` , "every option the plug's init returns can be escaped, as a
275+ compile-time init must be": it runs ` Macro.escape/1 ` over ` Plug.init([]) ` , which is the compile-time
276+ step that failed. Demonstrated red against the closure first, with the same message CI printed.
277+
278+ The slice is not rewritten and the tag is not moved: this is a fix commit referencing the original,
279+ as CLAUDE.md section 4 and docs/04 require.
280+
281+ ** Follow-up (new, and the reason this was missed): the gate never compiles ` :prod ` .** Nothing in
282+ ` mix gate ` or in the push-triggered CI builds a release, and ` package.yml ` only triggers on tags,
283+ so a compile-time defect in a plug's options, a release-only config error, or anything else that
284+ differs between ` :test ` and ` :prod ` is invisible until a tag exists, which is after approval. Two
285+ candidate fixes, for the owner: add a ` MIX_ENV=prod mix compile ` step to the gate (about a minute
286+ per run, catches this whole class), or give ` package.yml ` a ` branches: ` push trigger beside its
287+ tags one (slower, but proves the bundle too). Owner's call; not done here, since the gate is every
288+ slice's contract and this slice does not own it.
0 commit comments