prefer-nominal-mapping-keys
Declare record shapes or nominal keys at primitive-keyed mapping boundaries.
Why
A primitive mapping erases both fixed record keys and the domain identity of dynamic keys.
Fix
Use a TypedDict or validated model for a fixed record; for a dynamic domain mapping use a nominal NewType identifier or enum key. Preserve intentionally open transport and algorithm contracts with a reasoned local exception.
Examples
class Report: timings: dict[str, float]from typing import TypedDict
class Timings(TypedDict): total: float
class Report: timings: Timings