Skip to content

docs: complete reference, add middleware page#57

Merged
chris-colinsky merged 2 commits into
mainfrom
docs/reference-and-middleware
May 23, 2026
Merged

docs: complete reference, add middleware page#57
chris-colinsky merged 2 commits into
mainfrom
docs/reference-and-middleware

Conversation

@chris-colinsky
Copy link
Copy Markdown
Member

@chris-colinsky chris-colinsky commented May 23, 2026

Summary

  • Fills 35 silently-omitted entries in the mkdocstrings reference by adding docstrings to every public member of __all__ across graph, prompts, and checkpoint. Before this, add_node, add_edge, set_entry, compile, and the in-memory / SQLite checkpointer methods (among others) were invisible to anyone reading the docs.
  • New Middleware concept page covering the protocol shape, four registration sites (per-node / per-graph / per-branch / per-fan-out-instance), composition order, subgraph boundary, error semantics, and the built-in RetryMiddleware / TimingMiddleware. Nav placement: between Composition and Fan-out, since both reference middleware concepts.
  • Exports NextCall and default_classifier from openarmature.graph so custom middleware can type its next_ parameter and extend the retry classifier without reaching into the submodule.
  • FanOutNode.run and ParallelBranchesNode.run now raise NotImplementedError instead of RuntimeError. Both methods exist only to satisfy the Node protocol; the engine dispatches these node types through run_with_context. NotImplementedError is the right signal and stays backwards-compatible since it subclasses RuntimeError.
  • Em-dash sweep across 155 occurrences in public docstrings (34 files). Docstrings render in mkdocstrings; # comments don't and are left untouched.

Test plan

  • uv run pytest tests/ (697 pass, 64 skip)
  • uv run pyright src/ (0 errors)
  • uv run ruff check src/ (clean)
  • uv run mkdocs build succeeds
  • uv run mkdocs serve and visit /concepts/middleware/, /reference/graph/, /reference/prompts/, /reference/checkpoint/ — confirm new docstrings render and Middleware page looks right
  • Spot-check that from openarmature.graph import NextCall, default_classifier works

The mkdocstrings reference was silently omitting public members
that had no docstring. Add docstrings to 35 affected members
across graph, prompts, and checkpoint so every name in __all__
renders in the reference.

Add a new Middleware concept page covering the protocol shape,
the four registration sites, composition order, subgraph
boundary, error semantics, and the built-in RetryMiddleware and
TimingMiddleware. Place it between Composition and Fan-out in
the nav since both reference middleware concepts.

Export NextCall and default_classifier from openarmature.graph
so custom middleware can type its `next_` parameter and extend
the retry classifier without reaching into the submodule.

Change FanOutNode.run and ParallelBranchesNode.run to raise
NotImplementedError instead of RuntimeError. Both methods exist
only to satisfy the Node protocol; the engine dispatches these
node types through run_with_context. NotImplementedError is the
right signal and stays backwards-compatible since it subclasses
RuntimeError.

Sweep em dashes from public docstrings (155 occurrences across
34 files). Docstrings render in mkdocstrings; comments don't,
and are left untouched.
Copilot AI review requested due to automatic review settings May 23, 2026 03:00
Comment thread src/openarmature/prompts/backend.py
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the completeness and usability of the project documentation by ensuring all public API members render in mkdocstrings, adding a new “Middleware” concept page, and making a couple of small API-surface adjustments to support middleware authors.

Changes:

  • Added/updated docstrings across graph, prompts, checkpoint, llm, and observability so mkdocstrings includes all public __all__ members.
  • Added a new Middleware concept page and linked it into the MkDocs nav and concepts index.
  • Re-exported NextCall and default_classifier from openarmature.graph, and adjusted fan-out / parallel-branches run() stubs to raise NotImplementedError.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/openarmature/init.py Docstring punctuation tweak.
src/openarmature/prompts/init.py Docstring punctuation tweak.
src/openarmature/prompts/backend.py Added PromptBackend.fetch docstring for reference rendering.
src/openarmature/prompts/group.py Docstring punctuation tweak.
src/openarmature/prompts/manager.py Docstring formatting tweaks for rendered reference.
src/openarmature/prompts/backends/filesystem.py Added fetch docstring; docstring punctuation tweaks.
src/openarmature/observability/init.py Docstring punctuation/format tweaks.
src/openarmature/observability/correlation.py Docstring punctuation/format tweaks.
src/openarmature/observability/otel/init.py Docstring punctuation/format tweaks.
src/openarmature/observability/otel/logs.py Docstring punctuation/format tweaks.
src/openarmature/observability/otel/observer.py Docstring punctuation/format tweaks.
src/openarmature/llm/init.py Docstring punctuation tweak.
src/openarmature/llm/errors.py Error-class docstring punctuation tweaks.
src/openarmature/llm/messages.py Docstring punctuation tweaks (list-level invariants section).
src/openarmature/llm/provider.py Docstring punctuation/format tweaks.
src/openarmature/llm/response.py Docstring punctuation tweak.
src/openarmature/llm/providers/init.py Docstring punctuation tweak.
src/openarmature/llm/providers/openai.py Docstring punctuation tweaks.
src/openarmature/graph/init.py Re-export NextCall/default_classifier via package API surface.
src/openarmature/graph/builder.py Added docstrings for key builder methods to appear in reference docs.
src/openarmature/graph/compiled.py Docstring punctuation tweaks.
src/openarmature/graph/edges.py Docstring punctuation tweak.
src/openarmature/graph/errors.py Added docstrings for error types to render in reference docs.
src/openarmature/graph/events.py Docstring punctuation/format tweaks.
src/openarmature/graph/fan_out.py FanOutNode.run now raises NotImplementedError + added docstring.
src/openarmature/graph/nodes.py Added FunctionNode.run docstring.
src/openarmature/graph/observer.py Added/adjusted docstrings for observer protocols/handles.
src/openarmature/graph/parallel_branches.py ParallelBranchesNode.run now raises NotImplementedError + added docstring.
src/openarmature/graph/projection.py Added docstrings for projection strategy methods to render in reference docs.
src/openarmature/graph/subgraph.py Docstring punctuation tweaks (subgraph typing explanation).
src/openarmature/graph/middleware/init.py Docstring punctuation tweak; re-export list includes NextCall and classifier helpers.
src/openarmature/graph/middleware/_core.py Docstring punctuation tweaks describing chain composition and protocol semantics.
src/openarmature/graph/middleware/retry.py Docstring punctuation tweaks for retry semantics/classifier/backoff.
src/openarmature/graph/middleware/timing.py Docstring punctuation tweak.
src/openarmature/checkpoint/init.py Docstring punctuation tweak.
src/openarmature/checkpoint/errors.py Docstring punctuation tweaks for checkpoint error types.
src/openarmature/checkpoint/migration.py Added registry method docstring; punctuation tweaks.
src/openarmature/checkpoint/protocol.py Docstring punctuation/format tweaks for protocol records.
src/openarmature/checkpoint/backends/memory.py Added backend method docstrings for reference rendering.
src/openarmature/checkpoint/backends/sqlite.py Added backend method docstrings for reference rendering; punctuation tweaks.
mkdocs.yml Added Middleware page to nav.
docs/concepts/index.md Linked to new Middleware concept page.
docs/concepts/middleware.md New middleware concept documentation page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openarmature/graph/subgraph.py
Comment thread src/openarmature/llm/messages.py Outdated
The em-dash sweep replaced double em-dashes used as parenthetical
brackets ("X -- inner -- Y") with two semicolons ("X; inner; Y"),
producing grammatically broken sentences in five public docstrings.
Switch the affected sites to parentheses or a colon/period
restructuring as appropriate.

Affected docstrings:
- llm/messages.py (Message module: list-level invariants)
- graph/subgraph.py (module: outer graph sees run(state: ParentT))
- graph/compiled.py (CompiledGraph: observer plumbing)
- checkpoint/protocol.py (CheckpointRecord: frozen)
- observability/otel/logs.py (install_log_bridge: filters note)
@chris-colinsky chris-colinsky merged commit 37fe7d4 into main May 23, 2026
6 checks passed
@chris-colinsky chris-colinsky deleted the docs/reference-and-middleware branch May 23, 2026 03:17
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.

2 participants