Skip to main content

check_phase

Function check_phase 

Source
pub fn check_phase(
    store: &Store,
    session: Option<&str>,
    top_cmd: &str,
    sub_cmd: &str,
    force: bool,
) -> Result<()>
Expand description

Per-phase command gate.

A callers passes the top-level command verb (e.g. "task") and the sub-command ("add", "claim"), and this function returns an error if the current phase forbids that operation. Commands not listed here are allowed in every non-terminal phase.

Rules (unchanged from v1):

  • ORIENT: no writes
  • PLAN: no task claim/done/block (only adds)
  • AGREE: no operations (wait for human approval)
  • EXECUTE: no task add/cancel, no spec add (do the agreed plan)
  • REFLECT: no task claim (reflect, don’t execute)
  • REPLAN: no task claim (plan changes, not execution)
  • REPORT: no writes