Conflict:`middleware-conflict: key '${Key}' is already present on the upstream context`
Sentinel type used to surface a key collision with the upstream context as a
TypeScript error at the call site. Both composition paths put it in the
handler parameter position — pipeline via ValidateEntries, nesting via
NoConflict — because that is the position TypeScript prints:
Argumentoftype'(req, ctx) => …'isnotassignabletoparameteroftype "middleware-conflict: key 'alpha' is already present on the upstream context"
The alternative siting — the sentinel in a failed Base constraint — is
substituted silently. The stack still fails to compile either way, but on that
path the reported error is an overload mismatch on the enclosing call, in
which the inner handler's ctx has collapsed to never (printed as
ctx?: undefined); the collision is never named, and the colliding key may
not appear at all. Keep the sentinel on a parameter.
The two paths differ only in how much surrounds the message: pipeline is a
single signature and reports a one-line TS2345, while Middleware is an
overload set and reports TS2769 with the sentinel on the first line of the
per-overload breakdown.
Sentinel type used to surface a key collision with the upstream context as a TypeScript error at the call site. Both composition paths put it in the handler parameter position —
pipelineviaValidateEntries, nesting viaNoConflict— because that is the position TypeScript prints:The alternative siting — the sentinel in a failed
Baseconstraint — is substituted silently. The stack still fails to compile either way, but on that path the reported error is an overload mismatch on the enclosing call, in which the inner handler'sctxhas collapsed tonever(printed asctx?: undefined); the collision is never named, and the colliding key may not appear at all. Keep the sentinel on a parameter.The two paths differ only in how much surrounds the message:
pipelineis a single signature and reports a one-line TS2345, whileMiddlewareis an overload set and reports TS2769 with the sentinel on the first line of the per-overload breakdown.