topmark.config.resolution.layers¶
topmark / config / resolution / layers
Config provenance layer models and construction helpers.
This module defines the immutable provenance objects used during layered config
resolution and provides pure helpers to construct ConfigLayer records from
resolved TOML sources.
DEFAULT_LAYER_ORIGIN
module-attribute
¶
Origin of built-in defaults layer.
DEFAULT_LAYER_PRECEDENCE
module-attribute
¶
Stable precedence assigned to the built-in defaults layer.
FIRST_SOURCE_LAYER_PRECEDENCE
module-attribute
¶
Stable precedence assigned to the first non-default resolved TOML source layer.
ConfigLayerKind ¶
Bases: str, Enum
Provenance kinds used during layered config resolution.
ConfigLayer
dataclass
¶
Immutable config provenance layer used during layered resolution.
Attributes:
| Name | Type | Description |
|---|---|---|
origin |
Path | SyntheticConfigSource
|
Provenance origin for the layer, either a real config file path or a typed synthetic source marker such as built-in defaults. |
scope_root |
Path | None
|
Optional scope root for applicability checks. File-backed
layers usually use the containing config directory; synthetic
layers such as defaults, CLI, or API layers typically use |
precedence |
int
|
Stable merge precedence; lower values are applied earlier. |
kind |
ConfigLayerKind
|
Provenance kind for the layer. |
config |
MutableConfig
|
Parsed layered config fragment contributed by this layer only. |
build_config_layers_from_resolved_toml_sources ¶
Build config provenance layers from resolved TOML source records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
list[ResolvedTopmarkTomlSource]
|
Resolved TOML source records in stable precedence order. |
required |
Returns:
| Type | Description |
|---|---|
list[ConfigLayer]
|
Config provenance layers in stable precedence order, including the |
list[ConfigLayer]
|
built-in defaults layer first followed by one layer per resolved TOML |
list[ConfigLayer]
|
source. |