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

Classes

class  PreflightResult

Functions

PreflightResult preflight_open (Registry registry, *, int round_no, Sequence[str] plan_ids, GitShim git, str staging_branch)
PreflightResult preflight_resume (Registry registry, *, int round_no, str|None job_id)
dict[str, str] _plan_statuses (Registry registry, Sequence[str] plan_ids)

Variables

 MERGE_READY_STATUSES = frozenset({"ready_for_merge", "integrating"})

Detailed Description

Preflight checks for round open and resume.

Purpose
-------
Validate that a round-close can safely begin (or resume) before any
git or operation-log side effect happens.

Responsibilities
----------------
- Confirm the plan set is non-empty and every plan is merge-ready.
- Confirm there is no orphan staging branch for a fresh open.
- Confirm a resume target job and round both exist.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - preflight pass/fail
    L3 - per-check details
    L4 - deep tracing

Contracts
---------
- Preflight performs reads only; it never mutates the registry or git.
- A failing preflight returns reasons; the caller raises PreflightFailedError.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.api (Registry facade)
- oc_chat.registry.round.git_shim (GitShim seam)

Function Documentation

◆ _plan_statuses()

dict[str, str] oc_chat.registry.round.preflight._plan_statuses ( Registry registry,
Sequence[str] plan_ids )
protected

Definition at line 118 of file preflight.py.

Here is the caller graph for this function:

◆ preflight_open()

PreflightResult oc_chat.registry.round.preflight.preflight_open ( Registry registry,
* ,
int round_no,
Sequence[str] plan_ids,
GitShim git,
str staging_branch )
Validate a fresh round-open request.

Definition at line 63 of file preflight.py.

Here is the call graph for this function:

◆ preflight_resume()

PreflightResult oc_chat.registry.round.preflight.preflight_resume ( Registry registry,
* ,
int round_no,
str | None job_id )
Validate that a resume target job and round exist.

Definition at line 97 of file preflight.py.

Variable Documentation

◆ MERGE_READY_STATUSES

oc_chat.registry.round.preflight.MERGE_READY_STATUSES = frozenset({"ready_for_merge", "integrating"})

Definition at line 52 of file preflight.py.