-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: use Mapping[str, str] for read-only base_sources parameter #858
Copy link
Copy link
Closed
Labels
scope:smallLess than 1 day of workLess than 1 day of worktype:refactorCode restructuring, cleanupCode restructuring, cleanupv0.5Minor version v0.5Minor version v0.5
Description
Summary
The SemanticAnalyzer protocol and all implementations accept base_sources: dict[str, str] but never mutate it. Using Mapping[str, str] would express the read-only contract at the type level.
Finding source
Pre-PR review agents (type-design-analyzer) flagged this during #611 review.
Scope
- Change
base_sourcesparameter type fromdict[str, str]toMapping[str, str]in:SemanticAnalyzerprotocolAstSemanticAnalyzer.analyzeLlmSemanticAnalyzer.analyzeCompositeSemanticAnalyzer.analyze- All four check functions in
semantic_checks.py
- Add
from collections.abc import Mappingimports
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
scope:smallLess than 1 day of workLess than 1 day of worktype:refactorCode restructuring, cleanupCode restructuring, cleanupv0.5Minor version v0.5Minor version v0.5