chore: fix pyright type errors; add pyright config

- Cast res.color to DotColor in run_live loop.
- Add [tool.pyright] extraPaths to pyproject.toml for IDE resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-15 22:26:57 +00:00
parent 51dc1e403f
commit 6cf4b7a570
2 changed files with 11 additions and 1 deletions

View File

@@ -35,3 +35,9 @@ where = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
[tool.pyright]
include = ["src"]
extraPaths = ["src"]
pythonVersion = "3.11"
reportMissingImports = true

View File

@@ -6,9 +6,13 @@ import os
import sys
import time
from pathlib import Path
from typing import TYPE_CHECKING, cast
from atm.config import Config # stdlib-only (tomllib); safe at module level
if TYPE_CHECKING:
from atm.state_machine import DotColor
# Module-level reference — set lazily by _cmd_dryrun; tests may monkeypatch it.
dryrun = None
@@ -208,7 +212,7 @@ def run_live(cfg, duration_s=None, capture_stub: bool = False) -> None:
# detection
res = detector.step(now)
if res.accepted and res.color:
tr = fsm.feed(res.color, now)
tr = fsm.feed(cast("DotColor", res.color), now)
audit.log({
"ts": now, "event": "tick",
"color": res.color, "state": tr.next.value, "reason": tr.reason,