vertebrae.cache.fingerprint

Conservative cache fingerprint helpers.

Functions

hash_json(value)

Hash the complete typed value using the canonical identity representation.

hash_json_exact(value)

Hash complete canonical content without sampling large sequences or arrays.

exact_json_value(value)

Return the complete typed JSON representation used by exact hashes.

canonical_json_exact(value)

Return canonical JSON for complete typed content.

hash_exact_json_value(value)

Hash a value that is already in exact_json_value() form.

fingerprint_extractor_recipe(recipe)

Fingerprint a serializable extractor recipe.

Module Contents

vertebrae.cache.fingerprint.hash_json(value)[source]

Hash the complete typed value using the canonical identity representation.

hash_json is the public identity hash. It intentionally has the same exact semantics as hash_json_exact(); the latter name remains useful at call sites that want to emphasize that every value participates in the identity. Unsupported opaque objects fail instead of silently falling back to unstable repr output.

Parameters:

value (Any)

Return type:

str

vertebrae.cache.fingerprint.hash_json_exact(value)[source]

Hash complete canonical content without sampling large sequences or arrays.

This is intended for protocol and evaluation identities where every declared prompt or configuration entry must affect the result key.

Parameters:

value (Any)

Return type:

str

vertebrae.cache.fingerprint.exact_json_value(value)[source]

Return the complete typed JSON representation used by exact hashes.

Parameters:

value (Any)

Return type:

Any

vertebrae.cache.fingerprint.canonical_json_exact(value)[source]

Return canonical JSON for complete typed content.

Parameters:

value (Any)

Return type:

str

vertebrae.cache.fingerprint.hash_exact_json_value(value)[source]

Hash a value that is already in exact_json_value() form.

Parameters:

value (Any)

Return type:

str

vertebrae.cache.fingerprint.fingerprint_extractor_recipe(recipe)[source]

Fingerprint a serializable extractor recipe.

Parameters:

recipe (dict) – Extractor recipe dictionary.

Returns:

SHA-256 hash string.

Return type:

str