Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

`modern-di-faststream` is a FastStream adapter over
[`modern-di`](https://github.com/modern-python/modern-di); [`CONTEXT.md`](CONTEXT.md) opens with
what it does and owns the vocabulary — read it before naming a concept in code, a test name, or an
what it does and owns the vocabulary. Read it before naming a concept in code, a test name, or an
issue title. It is one of that project's integrations, each of which lives in a separate repository
and ships as a separate PyPI package.

## Commands

`just` (task runner) and `uv` (package manager). The [`justfile`](justfile) is the source of truth —
`just` (task runner) and `uv` (package manager). The [`justfile`](justfile) is the source of truth:
`just --list`, or read it.

## Architecture
Expand Down
8 changes: 4 additions & 4 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A term is listed only when there is a synonym to reject, or a meaning subtle eno
docs must agree on it. General programming vocabulary does not belong here, however heavily this
package uses it.

The domain terms are `modern-di`'s — `Container`, `Provider`, `Group`, `Scope`, `Resolution`,
The domain terms are `modern-di`'s: `Container`, `Provider`, `Group`, `Scope`, `Resolution`,
`Override`. That project's `CONTEXT.md` is the authority for all of them; nothing here redefines
one. FastStream owns `broker`, `subscriber`, `middleware`, and `StreamMessage`, and this package
uses each in FastStream's sense. The three below are this package's own.
Expand All @@ -19,18 +19,18 @@ uses each in FastStream's sense. The three below are this package's own.
The `Container` handed to `setup_di` and stored on the app's `ContextRepo`; `fetch_di_container`
reads it back. By default its lifetime tracks the app's, reopened on startup and closed after shutdown;
with `manage_lifespan=False` the user opens and closes it instead.
_Avoid_: app container, app-scoped container — accurate but unnamed; the code calls it the root
_Avoid_: app container, app-scoped container. Both are accurate but unnamed; the code calls it the root
container, and one of the two names has to win.

**Request container**:
The child container the middleware builds for one message and closes when that message is done.
It is where a `FromDI` parameter resolves.
_Avoid_: message container, per-message container. It is built per message, but its name comes
from its scope — `Scope.REQUEST` — so that a reader can match it to modern-di's scope ladder.
from its scope, `Scope.REQUEST`, so that a reader can match it to modern-di's scope ladder.

**Message**:
FastStream's `StreamMessage`, and this integration's whole notion of a unit of work. It is the
`Connection` in modern-di's sense — the framework object a unit of work carries — which is why
`Connection` in modern-di's sense (the framework object a unit of work carries), which is why
`faststream_message_provider` is a `ContextProvider` at `Scope.REQUEST` and why there is only ever
one connection type to derive a child scope from. `REQUEST` here names a scope band, never an HTTP
request; nothing in this package speaks HTTP.
Loading