oc_chat
Loading...
Searching...
No Matches
oc_chat.registry.round.escalation Namespace Reference

Classes

class  EscalationCode
class  Escalation
class  RoundEscalation

Functions

Escalation make_escalation (EscalationCode code, *, int round_no, str phase, str message, str|None resume_command=None, Mapping[str, object]|None details=None)
str resume_command_for (int round_no, *, str|None slot=None)

Variables

str ESCALATION_SCHEMA_VERSION = "1.0"
 NON_RESUMABLE_CODES = frozenset({EscalationCode.STAGING_BRANCH_DIVERGED})

Detailed Description

Versioned escalation contract for round-close failures.

Purpose
-------
Render a stable, machine-readable escalation document (OI-218, OI-316)
whenever a round-close step stops and needs operator attention.

Responsibilities
----------------
- Enumerate the stable error-code set for round-close stops.
- Carry a ``resume_command`` except where recovery is rollback-only.
- Serialize deterministically for logs and operator prompts.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - escalation raised
    L3 - code and resume-command details
    L4 - deep tracing

Contracts
---------
- ``STAGING_BRANCH_DIVERGED`` always renders an empty ``resume_command``.
- The schema is versioned; consumers branch on ``schema_version``.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- dataclasses (the frozen Escalation record)
- enum (the EscalationCode enum)

Function Documentation

◆ make_escalation()

Escalation oc_chat.registry.round.escalation.make_escalation ( EscalationCode code,
* ,
int round_no,
str phase,
str message,
str | None resume_command = None,
Mapping[str, object] | None details = None )
Build an :class:`Escalation`, enforcing the non-resumable policy.

Definition at line 112 of file escalation.py.

◆ resume_command_for()

str oc_chat.registry.round.escalation.resume_command_for ( int round_no,
* ,
str | None slot = None )
Return the canonical resume command string for a round.

Definition at line 136 of file escalation.py.

Variable Documentation

◆ ESCALATION_SCHEMA_VERSION

str oc_chat.registry.round.escalation.ESCALATION_SCHEMA_VERSION = "1.0"

Definition at line 50 of file escalation.py.

◆ NON_RESUMABLE_CODES

oc_chat.registry.round.escalation.NON_RESUMABLE_CODES = frozenset({EscalationCode.STAGING_BRANCH_DIVERGED})

Definition at line 71 of file escalation.py.