Skip to content

docs: record decision to keep the _DIMiddlewareFactory split#20

Merged
lesnik512 merged 1 commit into
mainfrom
docs/decision-keep-dimiddlewarefactory
Jun 25, 2026
Merged

docs: record decision to keep the _DIMiddlewareFactory split#20
lesnik512 merged 1 commit into
mainfrom
docs/decision-keep-dimiddlewarefactory

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

First entry in planning/decisions/ — records the architecture-review verdict to keep _DIMiddlewareFactory as a distinct class rather than collapsing it into _DiMiddleware.

Why

The review flagged the factory as a possible shallow module (a one-method class that only binds di_container and forwards via ParamSpec). The deletion test says leave it: the factory is the adapter to FastStream's middleware-construction contract — add_middleware needs a callable that returns a BaseMiddleware, so the container must be bound ahead of that deferred call. Collapsing into a partial/closure moves that binding complexity rather than concentrating it, and likely keeps the same # ty: ignore.

Recording it with a revisit trigger (FastStream accepts a pre-bound instance, or the ParamSpec forwarding becomes type-clean) means future reviews won't re-litigate it.

Verification

  • just check-planningplanning: OK.
  • just index lists the decision under newest-first Decisions.

Docs-only; no code or behaviour change.

🤖 Generated with Claude Code

An architecture review flagged _DIMiddlewareFactory as a possible shallow
module. The deletion test says otherwise: it's the adapter to FastStream's
middleware-construction contract, so collapsing it moves the
container-binding complexity rather than concentrating it. Record the
"leave alone" verdict with a revisit trigger so future reviews don't
re-litigate it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 merged commit 708b24c into main Jun 25, 2026
6 checks passed
@lesnik512 lesnik512 deleted the docs/decision-keep-dimiddlewarefactory branch June 25, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant