pub struct OrchaGraph {
pub graph_id: String,
/* private fields */
}Expand description
A handle to a single execution graph.
Provides Orcha’s typed node-building API and graph-scoped execution control. No lattice types leak past this boundary — callers work entirely in Orcha concepts (tasks, validate steps, synthesize steps, review gates).
Fields§
§graph_id: StringThe lattice graph ID — exposed for logging / monitoring.
Implementations§
Source§impl OrchaGraph
impl OrchaGraph
Sourcepub async fn add_task(
&self,
task: impl Into<String>,
max_retries: Option<u8>,
) -> Result<String, String>
pub async fn add_task( &self, task: impl Into<String>, max_retries: Option<u8>, ) -> Result<String, String>
Add a task node.
Sourcepub async fn add_synthesize(
&self,
task: impl Into<String>,
max_retries: Option<u8>,
) -> Result<String, String>
pub async fn add_synthesize( &self, task: impl Into<String>, max_retries: Option<u8>, ) -> Result<String, String>
Add a synthesize node.
Like task, but graph_runner prepends resolved input tokens as <prior_work> context.
Sourcepub async fn add_validate(
&self,
command: impl Into<String>,
cwd: Option<impl Into<String>>,
max_retries: Option<u8>,
) -> Result<String, String>
pub async fn add_validate( &self, command: impl Into<String>, cwd: Option<impl Into<String>>, max_retries: Option<u8>, ) -> Result<String, String>
Add a validate node.
Orcha runs command in a shell inside cwd (default /workspace).
Sourcepub async fn add_gather(
&self,
strategy: GatherStrategy,
) -> Result<String, String>
pub async fn add_gather( &self, strategy: GatherStrategy, ) -> Result<String, String>
Add a gather node — engine-executed, auto-fires when all inbound tokens arrive.
Sourcepub async fn add_subgraph(
&self,
child_graph_id: impl Into<String>,
) -> Result<String, String>
pub async fn add_subgraph( &self, child_graph_id: impl Into<String>, ) -> Result<String, String>
Add a SubGraph node — when ready, runs the child graph to completion.
Sourcepub fn open_child_graph(&self, graph_id: impl Into<String>) -> OrchaGraph
pub fn open_child_graph(&self, graph_id: impl Into<String>) -> OrchaGraph
Open a sibling graph by ID sharing the same LatticeStorage.
Sourcepub async fn add_plan(&self, task: impl Into<String>) -> Result<String, String>
pub async fn add_plan(&self, task: impl Into<String>) -> Result<String, String>
Add a plan node.
When dispatched, runs Claude to produce a ticket file, compiles it into a child graph, and executes the child graph inline.
Sourcepub async fn add_review(
&self,
prompt: impl Into<String>,
) -> Result<String, String>
pub async fn add_review( &self, prompt: impl Into<String>, ) -> Result<String, String>
Add a review node.
Sourcepub async fn depends_on(
&self,
dependent: &str,
dependency: &str,
) -> Result<(), String>
pub async fn depends_on( &self, dependent: &str, dependency: &str, ) -> Result<(), String>
Declare that dependent waits for dependency to complete first.
graph.depends_on(&validate_node, &task_node)
// validate_node will not start until task_node is completeSourcepub fn watch(
&self,
after_seq: Option<u64>,
) -> impl Stream<Item = LatticeEventEnvelope> + Send + 'static
pub fn watch( &self, after_seq: Option<u64>, ) -> impl Stream<Item = LatticeEventEnvelope> + Send + 'static
Watch this graph’s event stream.
Sourcepub async fn start_node(&self, node_id: &str) -> Result<(), String>
pub async fn start_node(&self, node_id: &str) -> Result<(), String>
Signal that a node started executing.
Sourcepub async fn complete_node(
&self,
node_id: &str,
output: Option<NodeOutput>,
) -> Result<(), String>
pub async fn complete_node( &self, node_id: &str, output: Option<NodeOutput>, ) -> Result<(), String>
Signal that a node completed successfully, optionally carrying output.
Sourcepub async fn fail_node(
&self,
node_id: &str,
error: String,
) -> Result<(), String>
pub async fn fail_node( &self, node_id: &str, error: String, ) -> Result<(), String>
Signal that a node failed.
Sourcepub async fn get_inbound_node_ids(
&self,
node_id: &str,
) -> Result<Vec<String>, String>
pub async fn get_inbound_node_ids( &self, node_id: &str, ) -> Result<Vec<String>, String>
Get IDs of nodes that have an edge pointing into node_id.
Sourcepub async fn get_node_spec(&self, node_id: &str) -> Result<NodeSpec, String>
pub async fn get_node_spec(&self, node_id: &str) -> Result<NodeSpec, String>
Get the spec of an existing node.
Sourcepub async fn get_node_output(
&self,
node_id: &str,
) -> Result<Option<NodeOutput>, String>
pub async fn get_node_output( &self, node_id: &str, ) -> Result<Option<NodeOutput>, String>
Get the stored output of a completed node.
Sourcepub async fn count_nodes(&self) -> Result<usize, String>
pub async fn count_nodes(&self) -> Result<usize, String>
Count the total number of nodes in this graph.
Sourcepub async fn get_terminal_node_ids(&self) -> Result<Vec<String>, String>
pub async fn get_terminal_node_ids(&self) -> Result<Vec<String>, String>
Get the IDs of nodes that have already reached a terminal state (Complete or Failed). Used by run_graph_execution to pre-populate the dispatched set on reconnect.
Sourcepub async fn get_node_inputs(&self, node_id: &str) -> Result<Vec<Token>, String>
pub async fn get_node_inputs(&self, node_id: &str) -> Result<Vec<Token>, String>
Get raw input tokens for a node (what arrived on all inbound edges).
Sourcepub async fn get_resolved_inputs(
&self,
node_id: &str,
arbor: &ArborStorage,
) -> Result<Vec<ResolvedToken>, String>
pub async fn get_resolved_inputs( &self, node_id: &str, arbor: &ArborStorage, ) -> Result<Vec<ResolvedToken>, String>
Get input tokens with Handle payloads resolved to inline Values.
Lattice resolves handles server-side via Arbor.
Returns ResolvedToken { color, data: Option
Trait Implementations§
Source§impl Clone for OrchaGraph
impl Clone for OrchaGraph
Source§fn clone(&self) -> OrchaGraph
fn clone(&self) -> OrchaGraph
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OrchaGraph
impl !RefUnwindSafe for OrchaGraph
impl Send for OrchaGraph
impl Sync for OrchaGraph
impl Unpin for OrchaGraph
impl UnsafeUnpin for OrchaGraph
impl !UnwindSafe for OrchaGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more