jeevesagent.core.ids
====================

.. py:module:: jeevesagent.core.ids

.. autoapi-nested-parse::

   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
---------

.. autoapisummary::

   jeevesagent.core.ids.deterministic_hash
   jeevesagent.core.ids.new_id


Module Contents
---------------

.. py:function:: deterministic_hash(*parts: Any) -> str

   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)``.


.. py:function:: new_id(prefix: str = '') -> str

   Return a fresh ULID, optionally prefixed for readability.

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


