cadrumo.core._config_runtime module

Private runtime observations supporting the public configuration owner.

active_profile_pointer_observation(*, normalizer, storage_root)[source]

Identify the current active-profile pointer through its native coordinate.

Settings construction is not a pure function of the environment: when cadrumo_database_url is unset, the post-validator reads the active-profile pointer file and derives the bucket’s database route from it. That makes the pointer a construction INPUT, and it moves whenever config login/logout writes it — inside a live process, for a long-running interactive or external session.

Holding one settings instance across such a switch would keep serving the previous profile’s database route, so the canonical durable transition coordinate is folded into the cache key. A fresh root observes the initial absent coordinate zero; a later clear is a distinct persisted tombstone.

The root is read straight from the environment: that read is deliberately independent of the settings model it guards, because it has to answer “which pointer would the next construction see” BEFORE any settings exist to ask.

Return type:

tuple[Path, BucketPointer]

Parameters:
  • normalizer (Callable[[Path | None], Path | None])

  • storage_root (Callable[[], Path])