jeevesagent.core.ids

ID and hash helpers used across the harness.

ULIDs are preferred over UUIDs because they are time-sortable, which makes journal scans, audit log queries, and episode timelines cheap.

Functions

deterministic_hash(→ str)

Stable hash of arbitrary JSON-serializable parts.

new_id(→ str)

Return a fresh ULID, optionally prefixed for readability.

Module Contents

jeevesagent.core.ids.deterministic_hash(*parts: Any) str[source]

Stable hash of arbitrary JSON-serializable parts.

Used as an idempotency key for journaled steps. The hash is stable across processes and Python versions because the input is canonicalised via json.dumps(..., sort_keys=True).

jeevesagent.core.ids.new_id(prefix: str = '') str[source]

Return a fresh ULID, optionally prefixed for readability.

>>> new_id("ep").startswith("ep_")
True