+13. **No raw primitives in type annotations.** Never use `str`, `int`, `float`, `list`, `dict`, `set`, or `tuple` as type annotations on Type_Safe class fields, `@type_safe` method parameters, or return types. Use `Safe_Str__*`, `Safe_UInt`, `Safe_Float`, `Node_Id`, `Edge_Id`, `Type_Safe__Dict` subclass, `Type_Safe__List` subclass, etc. The only exception is `bool` (permitted because explicit `is True`/`is False` checks provide sufficient safety) and `-> int` for simple count/len returns. For `Dict[str, X]` patterns, create a named `Dict__*` subclass with proper `expected_key_type` and `expected_value_type`. For `Node_Id()`/`Edge_Id()`, never call without a value — use `Node_Id(Obj_Id())` to generate unique IDs. See `docs/development/llm-briefs/type-safety/v0.4.0__for_llms__no_raw_primitives_policy.md` for the full policy and replacement reference.
0 commit comments