Functions
_json_default
Handle non-JSON-serializable types for hashing.
Converts Path, set, frozenset, and other types to …
_json_default
def _json_default(obj: Any) -> str
Handle non-JSON-serializable types for hashing.
Converts Path, set, frozenset, and other types to strings for consistent serialization.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
obj |
Any |
— | Object to convert |
Returns
String representation suitable for hashingstr
—
compute_config_hash
Compute deterministic SHA-256 hash of configuration state.
The hash is computed from the *resolved…
compute_config_hash
def compute_config_hash(config: dict[str, Any]) -> str
Compute deterministic SHA-256 hash of configuration state.
The hash is computed from the resolved configuration dictionary, capturing all effective settings including:
- Base configuration from config files
- Environment variable overrides
- Profile-specific settings
- Merged split config files
Algorithm:
1. Recursively sort all dictionary keys (deterministic ordering)
2. Serialize to JSON with custom handler for non-JSON types
3. Compute SHA-256 hash
4. Return first 16 characters (sufficient for uniqueness)
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
config |
dict[str, Any] |
— | Resolved configuration dictionary |
Returns
16-character hex string (truncated SHA-256)str
—