/simplify pass on the issue #27 fix: extract a shared _snake_to_title between entity.py and discovery.py, factor discover()'s two binding loops through one _bind() helper, and close a TOCTOU race the cache merge introduced -- apply() is the sole path StateCache mutations flow through, so the read-then-write is now serialized under one lock instead of two independently-locked calls.