Context
PR #5158 enables BasedPyright strict checking across nanobot/. The strict-clean baseline currently contains 31 file-level directives such as:
# pyright: reportMissingTypeStubs=false, reportPrivateUsage=false
A file-level directive also suppresses future diagnostics of that category elsewhere in the same module, so its blast radius grows as the file evolves.
Goal
Gradually replace file-level Pyright suppressions with the narrowest justified alternative while keeping runtime behavior unchanged.
Approach
- Inventory the 31 current file-level directives and group them by cause: missing third-party stubs, private API usage, heterogeneous tool overrides, generated/dynamic SDK surfaces, and genuinely dead-code diagnostics.
- Remove suppressions made obsolete by better annotations or public APIs.
- Prefer a typed adapter,
Protocol, local stub, or narrow runtime normalizer when that improves the owning boundary.
- When suppression remains necessary, prefer a line-level
# pyright: ignore[rule] with the smallest possible scope and a clear local reason.
- Split the work into reviewable subsystem-sized PRs; do not combine it with unrelated runtime refactors.
Acceptance criteria
- No net increase in file-level Pyright directives.
- Each retained file-level directive has a documented reason that cannot reasonably be scoped to a line.
- Converted suppressions remain BasedPyright strict-clean with no global diagnostic downgrade.
- Closest subsystem tests and the full configured CI matrix stay green.
- Progress is measurable against the initial baseline of 31 file-level directives.
Non-goals
- Removing justified line-level suppressions solely to reach zero ignores.
- Adding behavior changes to satisfy the checker.
- Maintaining third-party packages' complete type stubs inside nanobot.
Related: #5158
Context
PR #5158 enables BasedPyright
strictchecking acrossnanobot/. The strict-clean baseline currently contains 31 file-level directives such as:# pyright: reportMissingTypeStubs=false, reportPrivateUsage=falseA file-level directive also suppresses future diagnostics of that category elsewhere in the same module, so its blast radius grows as the file evolves.
Goal
Gradually replace file-level Pyright suppressions with the narrowest justified alternative while keeping runtime behavior unchanged.
Approach
Protocol, local stub, or narrow runtime normalizer when that improves the owning boundary.# pyright: ignore[rule]with the smallest possible scope and a clear local reason.Acceptance criteria
Non-goals
Related: #5158