agora.core.project
Project state machine with the approve/loop-back gate.
Position: the project-level state above individual tasks. Where task
tracks one unit’s status, this tracks the whole project’s phase and the
approve/loop-back decision — the gate that either advances the project or sends
a phase back for re-work (feeding the retry that the learning flywheel annotates).
Invariant: phase changes go through the validated PhaseTransition set;
an illegal jump raises InvalidTransition rather than
being silently applied.
Functions
|
Whether all tasks have reached a terminal state (DONE). |
|
Tasks relevant to the current phase (active / not done). |
|
Validate and apply a phase transition. |
Classes
A single phase transition recorded on a |
|
One edge in the project phase state machine. |
|
A run-in-progress: agents, the task DAG, the phase state machine. |
- class agora.core.project.PhaseTransition[source]
Bases:
NamedTupleOne edge in the project phase state machine.
The
conditionstring is human-readable rationale shown in the observer surface; it does not gate the transition. Validity is determined by membership inVALID_TRANSITIONS.- from_phase: ProjectPhase
Alias for field number 0
- to_phase: ProjectPhase
Alias for field number 1
- static __new__(_cls, from_phase, to_phase, condition)
Create new instance of PhaseTransition(from_phase, to_phase, condition)
- class agora.core.project.PhaseChange[source]
Bases:
objectA single phase transition recorded on a
Project.Appended to
Project.phase_historybytransition_phase()with a UTC ISO timestamp so the run timeline is reconstructable from the project state alone.- from_phase: ProjectPhase
- to_phase: ProjectPhase
- __init__(from_phase, to_phase, reason, timestamp)
- class agora.core.project.Project[source]
Bases:
objectA run-in-progress: agents, the task DAG, the phase state machine.
Projects are immutable; mutations return a new instance via
dataclasses.replace().phaseadvances through theProjectPhasestate machine viatransition_phase(), with each transition appended tophase_historyfor audit.git_repo_pathis the per-project work tree where the orchestrator writes artefacts and runs auto-commits.- phase: ProjectPhase = 'init'
- phase_history: tuple[PhaseChange, ...] = ()
- __init__(id, name, phase=ProjectPhase.INIT, agents=(), tasks=(), phase_history=(), git_repo_path='', created_at='')
- agora.core.project.transition_phase(project, new_phase, reason)[source]
Validate and apply a phase transition. Returns a new Project.