HeavenBase runtime defaults are read through the nativeDocumentation Index
Fetch the complete documentation index at: https://ahvn.top/llms.txt
Use this file to discover all available pages before exploring further.
CM_HVNB config manager:
CM_HVNB keeps config values scoped, persistent, and fast to read. The hot path uses immutable in-memory snapshots, so repeated get(...) calls do not run SQL or rebuild merged dictionaries on every access.
Import configuration APIs from
heavenbase.utils when you need the shared runtime config manager or dict-path helpers.Scopes
Configuration is resolved from broad scopes to narrow scopes. A scope such asheavenbase.workspace.demo reads layers in this order:
heavenbaseheavenbase.workspaceheavenbase.workspace.demo
scoped(...) as a context manager or decorator:
Snapshots
For high-volume read paths, keep a snapshot and reuse it:Editing and maintenance
Config writes are persisted immediately. Useset(...), setdef(...), and unset(...) for ordinary edits:
items[0]replaces an item.items[]appends.items[2+]inserts before index 2.
unset(...) writes a tombstone so a child scope can hide a value inherited from its parent scope. Dicts can use __HB_OVERWRITE__ to replace a parent dict instead of recursively merging it.
Use load() for a mutable merged dictionary and layer(scope, version=None) for the raw layer stored in one scope. history(...), version, version_chain, scopes(), compact(...), and remove(...) expose the retained store state for diagnostics and maintenance. save() is a no-op success method because writes are persisted immediately.
resource(...) resolves files under the package resources/ directory when that package can be located. load_default() returns the in-memory default config template used to initialize scopes.
Persistence
Config layers are stored in a local SQLite database through a bootstrap store. By default, each scope keeps the latest 10 versions, so ordinary edits do not accumulate hundreds of historical rows. The bootstrap store exposesConfigLayer and ConfigCompat as system entity projections for future CLI and workspace management views, but config boot does not require creating a normal HeavenBase workspace.
Interpolation
OmegaConf interpolation resolves when a snapshot is compiled:${env:VAR}is allowed by default.${oc.env:VAR,default}works through OmegaConf.${cmd:...}is disabled by default and requires an explicit policy override.

