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

Functions

list[QueueEvent] queue_history (Registry registry, str plan_id)
PlanTimeline plan_lifecycle (Registry registry, str plan_id)
PlanView|None show_plan (Registry registry, str plan_id)
CurrentStatus current_status (Registry registry)
ActorView whoami (Registry registry, str actor_slot)
object _connect (Registry registry)
Mapping[str, object] _payload (object value)
dict[str, object] _row_dict (object row)
str|None _optional_str (object value)
int|None _optional_int (object value)

Variables

dict QUEUE_HISTORY_TYPES

Detailed Description

Read-only registry projection helpers.

Purpose
-------
Expose typed reader libraries for queue history, plan lifecycle, plan
inspection, registry status, and actor identity.

Responsibilities
----------------
- Read current-state and operation-log projections without mutating state.
- Decode canonical JSON payloads into typed dataclass records.
- Keep SQL limited to SELECT statements.

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

Contracts
---------
- Reader functions never call ``execute_domain_command``.
- Missing plan rows return ``None`` for explicit plan views.
- Unknown actor lookups raise ``UnknownActorError``.

Dependencies
------------
- json (payload decoding)
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.dataclasses (typed read models)
- oc_chat.registry.errors (typed unknown-actor error)
- oc_chat.registry.api (Registry facade whose backend connection the readers query)

Function Documentation

◆ _connect()

object oc_chat.registry.readers._connect ( Registry registry)
protected

Definition at line 249 of file readers.py.

Here is the caller graph for this function:

◆ _optional_int()

int | None oc_chat.registry.readers._optional_int ( object value)
protected

Definition at line 274 of file readers.py.

Here is the caller graph for this function:

◆ _optional_str()

str | None oc_chat.registry.readers._optional_str ( object value)
protected

Definition at line 270 of file readers.py.

Here is the caller graph for this function:

◆ _payload()

Mapping[str, object] oc_chat.registry.readers._payload ( object value)
protected

Definition at line 256 of file readers.py.

Here is the caller graph for this function:

◆ _row_dict()

dict[str, object] oc_chat.registry.readers._row_dict ( object row)
protected

Definition at line 265 of file readers.py.

Here is the caller graph for this function:

◆ current_status()

CurrentStatus oc_chat.registry.readers.current_status ( Registry registry)
Return compact registry status counters and active runtime rows.

Definition at line 183 of file readers.py.

Here is the call graph for this function:

◆ plan_lifecycle()

PlanTimeline oc_chat.registry.readers.plan_lifecycle ( Registry registry,
str plan_id )
Return typed status and assignment events for ``plan_id``.

Definition at line 104 of file readers.py.

Here is the call graph for this function:

◆ queue_history()

list[QueueEvent] oc_chat.registry.readers.queue_history ( Registry registry,
str plan_id )
Return typed queue history events for ``plan_id``.

Definition at line 75 of file readers.py.

Here is the call graph for this function:

◆ show_plan()

PlanView | None oc_chat.registry.readers.show_plan ( Registry registry,
str plan_id )
Return the current projected plan row, or ``None`` if absent.

Definition at line 156 of file readers.py.

Here is the call graph for this function:

◆ whoami()

ActorView oc_chat.registry.readers.whoami ( Registry registry,
str actor_slot )
Return current actor metadata for ``actor_slot``.

Definition at line 224 of file readers.py.

Here is the call graph for this function:

Variable Documentation

◆ QUEUE_HISTORY_TYPES

dict oc_chat.registry.readers.QUEUE_HISTORY_TYPES
Initial value:
1= {
2 "queue.enqueue",
3 "queue.move",
4 "queue.dequeue",
5 "queue.complete",
6 "plan.assign",
7 "plan.set_status",
8 "migrate.import.queue_entry",
9}

Definition at line 64 of file readers.py.