oc_chat
Loading...
Searching...
No Matches
oc_chat.registry.canonical Namespace Reference

Functions

str canonical_json (Any value)

Detailed Description

Canonical JSON helpers for registry payloads.

Purpose
-------
Serialize operation payloads in the deterministic form required by the
registry operation log and future checkpoint replay.

Responsibilities
----------------
- Provide :func:`canonical_json` with sorted keys and no insignificant
  whitespace.
- Reject non-standard floating values so stored payloads remain JSON.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - lifecycle events
    L3 - semantic details
    L4 - deep tracing

Contracts
---------
- Output is UTF-8 text suitable for storage in ``operation_log.args_json``.
- Serialization uses ``ensure_ascii=False`` to preserve payload text exactly.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- json (deterministic serialisation with sorted keys and compact separators)

Function Documentation

◆ canonical_json()

str oc_chat.registry.canonical.canonical_json ( Any value)
Return deterministic JSON for registry payload storage.

Definition at line 49 of file canonical.py.