Context
There is already a draft RFC for reducing Any in runtime helpers, but the current code has broader Any usage than the RFC's old counts and the work has not landed. This is a good bounded typing cleanup that strengthens refactoring safety without changing public behavior.
Evidence
plan/rfc-template-helpers-any-reduction.md is still Status: Draft.
- A current scan shows 576
Any/dict[str, Any]/cast( matches under src/kida.
- Hotspots include
src/kida/template/helpers.py, src/kida/template/render_helpers.py, src/kida/environment/core.py, and src/kida/compiler/partial_eval.py.
- The RFC's current-state counts are stale; for example,
template/helpers.py now has many more Any usages than the four listed in the RFC.
Proposed Scope
- Refresh the RFC counts against current code.
- Land a narrow first PR focused on helper/filter/render-helper signatures where
object or Protocols are clearly better than Any.
- Leave inherently dynamic template context APIs alone unless there is a clear type contract.
Done When
- The RFC is either updated and active, or closed with implemented work linked.
- A first bounded
Any reduction lands with make ty clean.
- No runtime behavior changes are introduced.
Context
There is already a draft RFC for reducing
Anyin runtime helpers, but the current code has broaderAnyusage than the RFC's old counts and the work has not landed. This is a good bounded typing cleanup that strengthens refactoring safety without changing public behavior.Evidence
plan/rfc-template-helpers-any-reduction.mdis stillStatus: Draft.Any/dict[str, Any]/cast(matches undersrc/kida.src/kida/template/helpers.py,src/kida/template/render_helpers.py,src/kida/environment/core.py, andsrc/kida/compiler/partial_eval.py.template/helpers.pynow has many moreAnyusages than the four listed in the RFC.Proposed Scope
objector Protocols are clearly better thanAny.Done When
Anyreduction lands withmake tyclean.