vertebrae.cache.keys

Canonical artifact-key validation and named-output encoding.

Functions

validate_artifact_key(key)

Validate and return a canonical relative artifact key.

named_output_key_segment(output_name)

Encode an exact output name as a readable collision-resistant segment.

named_output_artifact_key(base_key, output_name)

Build a canonical artifact key for one named output.

named_output_artifact_keys(base_key, output_names)

Build and validate all named-output keys before any caller writes them.

Module Contents

vertebrae.cache.keys.validate_artifact_key(key)[source]

Validate and return a canonical relative artifact key.

Artifact keys use forward-slash-separated relative components. Validation is intentionally lossless: valid keys are returned unchanged and invalid keys are rejected instead of being normalized into a potentially colliding key.

Parameters:

key (str)

Return type:

str

vertebrae.cache.keys.named_output_key_segment(output_name)[source]

Encode an exact output name as a readable collision-resistant segment.

Parameters:

output_name (str)

Return type:

str

vertebrae.cache.keys.named_output_artifact_key(base_key, output_name)[source]

Build a canonical artifact key for one named output.

Parameters:
  • base_key (str)

  • output_name (str)

Return type:

str

vertebrae.cache.keys.named_output_artifact_keys(base_key, output_names)[source]

Build and validate all named-output keys before any caller writes them.

Parameters:
  • base_key (str)

  • output_names (Iterable[str])

Return type:

dict[str, str]