Raw configuration is scoped data. Executable configuration is a validated immutable value.
CM_HVNB manages retained scope layers, while ConfigEngine resolves a domain through one fixed pipeline.
1. Why Configuration Exists
Without a config owner, every wrapper carries knobs it does not own:2. Understand the Ownership Split
Contextowns the machine backend and its named Registry namespaces.ConfigManagerowns defaults, scopes, versioned layers, interpolation, and snapshots.ConfigEngineowns deterministic domain resolution and Apply profiles.- Domain engines own LLM, database, workspace, and filesystem policy.
3. Read and Edit Scoped Data
Read one active value withget(...):
scoped(...) as a context manager or decorator:
heavenbase.workspace.docs-demo, resolution reads heavenbase, then heavenbase.workspace, then the complete target scope.
Use snapshot() for repeated immutable reads, layer(...) for one raw scope layer, and history(...) for retained versions:
unset(...) writes a tombstone so a child scope can hide an inherited key. setdef(...) writes only when the resolved value is missing. List paths support items[0], items[], and items[2+].
4. Resolve a Domain Configuration
EveryConfigEngine follows the same stages:
- Preset expands a complete named template.
- Normalize resolves aliases, shorthand, precedence, and canonical values.
- Validate checks the canonical value without repairing it.
- Apply(profile) returns a deterministic detached value.
ConfigSpec:
ConfigSpec.data contains canonical user-facing fields. bindings contains selected executable contracts. raw and meta remain diagnostic. to_dict() and from_dict() preserve the executable envelope.
5. Use Apply Profiles
Apply profiles turn one validated spec into a specific value:validate(restored_spec) and apply(restored_spec, ...) do not reread the original manager or catalog. This makes an executable spec portable across process boundaries that share the same code contract.
6. Use Strict Local File URIs
Explicit local storage uses one grammar:
Writable locations reject the resource alias. Network authorities, backslashes, root escapes, query strings, fragments, and legacy
file: spellings are rejected.
A database field may use a separator-free logical name. DBEngine resolves it below heavenbase.db.local_root and stores the canonical file:/// URI in DBSpec.
scripts/migrate_config_locations.py converts owned legacy config files. It defaults to dry-run and verifies that each replacement resolves to the same native target before writing.7. Understand Caches and Interpolation
Each domain engine has bounded caches for resolved specs and Apply values. Cache identity includes the active scope generations, referenced environment values, root overlay, selected catalog revision, and domain contract revisions. Environment interpolation is enabled by default; command interpolation is disabled:engine.clear_cache() for local domain-cache invalidation and CM_HVNB.refresh() when the next source read must observe the current Registry revision immediately.
8. Extend Configuration Safely
When you add a domain, subclassConfigEngine, declare one stable domain, and implement protected Normalize, Bind, Validate, and default-profile hooks. Register value-returning Apply profiles instead of branching in generic config.
Add tests for idempotence, serialization, source-free restored-spec Apply, cache invalidation, and redaction. Keep provider selection, dialect facts, file policy, SDK behavior, and live resources in the owning domain.

