nkdsl.cfg

cfg = ConfigManager(options=7, runtime_locked=False)

Typed, hookable, and singleton configuration manager for nkDSL.

Options are declared with typed helpers (e.g. define_bool(), define_enum()) and bound to NKDSL_-prefixed environment variables which are matched case-insensitively.

Effective value precedence (highest to lowest):

  1. Forced environment value (env_force)

  2. Thread-local override (ConfigMutability.RUNTIME options only)

  3. User global override

  4. Environment default value (env_default)

  5. Built-in option default

Notes

  • Forced environment values are intentionally immutable from Python.

  • ConfigMutability.STARTUP options become immutable once lock_runtime() is called.

  • ConfigMutability.RUNTIME options can be changed globally or per-thread via patch() and thread_local_override().