fix(types): add BottleSpec.loaded_manifest to satisfy pyright on union type

BottleSpec.manifest is ManifestIndex | Manifest (pre/post _validate()).
Downstream code always runs post-validate so it needs Manifest, but
pyright flagged every .agent/.bottle access. The new loaded_manifest
property asserts isinstance and returns Manifest, giving pyright a
narrowed type without scattering type: ignore everywhere.

Also remove unused Manifest imports from test files and annotate the
_index() helper in test_manifest_agent_git_user.
This commit is contained in:
2026-06-23 02:08:27 +00:00
committed by didericis
parent 532072931f
commit 5becef0d0b
16 changed files with 31 additions and 22 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ def _manifest(*, bottle_user=None, agent_git=None) -> Manifest: # type: ignore
}).load_for_agent("impl")
def _index(*, bottle_user=None, agent_git=None) -> ManifestIndex:
def _index(*, bottle_user: dict[str, object] | None = None, agent_git: dict[str, object] | None = None) -> ManifestIndex:
"""Build an index with one agent 'impl' without loading it."""
bottle: dict = {} # type: ignore
if bottle_user is not None: