topmark.config.resolution.merge¶
topmark / config / resolution / merge
Layer applicability and merge helpers for config resolution.
This module contains pure helpers that
- select which config provenance layers apply to a target path
- merge config provenance layers in stable precedence order
- build effective per-path mutable config drafts
Layer construction from resolved TOML sources lives in
topmark.config.resolution.layers.
merge_layers_globally ¶
Merge config provenance layers into one mutable config draft.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
Iterable[ConfigLayer]
|
Config provenance layers in stable precedence order. |
required |
Returns:
| Type | Description |
|---|---|
MutableConfig
|
|
MutableConfig
|
merging the supplied layers in order. |
Source code in src/topmark/config/resolution/merge.py
select_applicable_layers ¶
Return the config provenance layers that apply to a file path.
Global layers (scope_root is None) always apply. File-backed layers apply
only when the target path is within their declared scope root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
Iterable[ConfigLayer]
|
Candidate config provenance layers. |
required |
path
|
Path
|
Target file path for which applicability should be evaluated. |
required |
Returns:
| Type | Description |
|---|---|
list[ConfigLayer]
|
Applicable layers in their original precedence order. |
Source code in src/topmark/config/resolution/merge.py
build_effective_config_for_path ¶
Build the effective mutable config for a specific file path.
This helper selects the config provenance layers whose scope applies to the
target path, then merges them in stable precedence order using
MutableConfig.merge_with().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layers
|
Iterable[ConfigLayer]
|
Candidate config provenance layers. |
required |
path
|
Path
|
Target file path for which to build the effective config. |
required |
Returns:
| Type | Description |
|---|---|
MutableConfig
|
The merged |
MutableConfig
|
applicable to |