Fix audit findings: bugs B-1..B-11, X-1, dead code, pinning tests, doc drift#202
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…sign) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (Q-2, Q-3, Q-4) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nt (B-2) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eator params (B-1, B-3) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r site (B-1 follow-up) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lve (B-1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r (B-5) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…h (B-6) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…own (B-7, closes D-1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…se (B-8) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ule (B-9, D-6 ruling) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… untouched (B-10, Q-15) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ontainer (X-1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ances survive the cycle; guard closed scope-resolved containers (X-1 refinement, issue-1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cope-selection, alias chains (Q-10..Q-14) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…D-6) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rule (D-7) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ses (D-9, D-10, D-11) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ics, fix websocket example, document close/reopen lifecycle (D-12, D-13, D-14) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…D-6 follow-up) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…D-1, D-3, D-6..14) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
get_type_hints(partial) returns {} on 3.14 instead of raising TypeError, so the
real-partial test no longer exercised the warn-skip branch there (CI failure +
coverage drop under --cov=.). Replace with direct TypeError fault injection plus
a version-stable 'partial does not crash' smoke test.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes selected findings from the 2026-06-12 code & docs audit (
planning/audits/2026-06-12-code-docs-audit-report.md). 24 commits; 179 tests, 100% line coverage, lint/ty clean.Bugs (B-1…B-11)
UnsupportedCreatorParameterErrorat declaration (B-1 allows akwargs/default escape hatch) instead of silently degrading to the origin type or dying with a rawTypeErrorat resolve.get_type_hintsTypeError(e.g.functools.partialcreators) is caught and warn-skipped with a workaround hint, like the existingNameErrorpath.ArgumentResolutionErrorfor unannotated params ("has no usable type annotation") and union params (names both members) instead of "of type None".validate()aggregates a dangling-Aliaserror intoValidationFailedErrorinstead of aborting the whole validation.Container(parent_container=…)constructor enforces the same scope-ordering check asbuild_child_container.close_async(and rejected inclose_sync), instead of leaking an un-awaited coroutine.set_contextinvalidates compiled kwargs so a later resolve picks up the new value.ProvidersRegistrylocks its mutations and iterates snapshots (no "dictionary changed size during iteration" under concurrent registration).DX (X-1) — resolving from / building a child of a closed container raises
ContainerClosedError. Re-entering the context manager (with container:) reopens it;clear_cache=Falseinstances persist across the close→reopen cycle (same object returned),clear_cache=Truerebuild. The closed-guard also covers resolution of a parent-scoped provider through an open child.Internals — removed dead code: unused
TypeVars,_UNSETsentinel, a no-opget_originpass (Q-2, Q-3, Q-4).Tests (Q-10…Q-15) — pinned previously-untested contracts: static-kwargs precedence, creator-failure (nothing cached / retry / LIFO finalize), context scope-selection, alias chains, child→APP-cache identity, duplicate-type-across-groups.
Docs (D-3, D-6…D-14) — fixed the crashing intro example, wrong scope rendering, the broken alias override walkthrough, three troubleshooting pages that quoted error messages the library never raises, false typing claims, the
clear_cache=Falsemigration guidance, and a websocket example that didn't parse; rewrote the context "set before building the child" advice to the correct scope rule (context never propagates between containers); documented the open/close/reopen lifecycle.Design rulings recorded during the work
kwargs/default escape hatch.clear_cache=False→ precisely defined as persist-across-reopen (same instance returned after re-entering the context manager).Deferred (not in this round)
Q-1, Q-5…Q-9, X-2…X-6, D-2, D-4, D-5, G-1…G-11.
Test Plan
just lint-ci— clean (ruff format/check, ty)just test— 179 passed, 100% line coverageuv run pytest benchmarks/ --benchmark-disable— 22 passed🤖 Generated with Claude Code