Skip to content

coleman.spec.packs

Config pack resolution — load, merge, and override YAML fragments.

coleman.spec.packs

Config pack resolution.

Packs are small YAML fragments stored under packs/<category>/ that can be referenced from a user config via the packs key.

The resolver deep-merges packs into a base dict and then applies inline overrides, producing a single flat dict ready for :class:RunSpec validation.

resolve_packs

resolve_packs(raw, *, packs_dir='packs')

Resolve pack references and merge into a single config dict.

The packs key (if present) is a list of strings like "policy/linucb" which map to packs/policy/linucb.yaml. Packs are merged left-to-right, then the remaining keys in raw are applied as overrides.

Parameters:

Name Type Description Default
raw dict

User-supplied config dict (may contain a packs key).

required
packs_dir str | Path

Root directory for pack files.

'packs'

Returns:

Type Description
dict

Fully resolved config dict without the packs key.

Raises:

Type Description
FileNotFoundError

If a referenced pack file does not exist.

TypeError

If the packs key is not a list, or if any item is not a string.

ValueError

If any pack reference is an empty string.