Skip to main content

Module phase

Module phase 

Source
Expand description

Workflow phase state machine and enforcement.

The ORIENT → PLAN → AGREE → EXECUTE ↔ REFLECT → REPLAN → REPORT state machine is a workflow concern shared across tools. Synthesist owns the CLI for setting/showing phase. Future tools (seer) that need to respect phase gates call check_phase directly rather than reimplementing the rules.

Per D14, phase is per-session: a Phase claim carries {session_id, name}. Setting a phase appends a new claim that supersedes the prior Phase claim for the same session_id. Migrated v1 data lives under session_id = "global-migrated".

Enums§

Phase
Workflow phase.

Constants§

GLOBAL_SESSION_ID
Session id used for migrated v1 phase data. In v1 there was one global phase row; the v1 → v2 migrator writes it under this synthetic session so the per-session model stays consistent.

Functions§

check_phase
Per-phase command gate.
current_phase_claim
Return (claim_id, phase_name) for the most recent Phase claim in session_id — used by supersession-chain writes that need the previous claim’s id.
current_phase_name
Return the name of the current Phase claim for session_id, or None if no Phase claim exists (caller defaults to orient).