Skip to main content

Graph

Struct Graph 

Source
pub struct Graph {
    pub project: Option<ProjectMeta>,
    pub nodes: Vec<Node>,
    pub edges: Vec<Edge>,
}
Expand description

A complete GID graph with nodes and edges.

Fields§

§project: Option<ProjectMeta>§nodes: Vec<Node>§edges: Vec<Edge>

Implementations§

Source§

impl Graph

Source

pub fn new() -> Self

Source

pub fn get_node(&self, id: &str) -> Option<&Node>

Source

pub fn get_node_mut(&mut self, id: &str) -> Option<&mut Node>

Source

pub fn add_node(&mut self, node: Node)

Source

pub fn remove_node(&mut self, id: &str) -> Option<Node>

Source

pub fn update_status(&mut self, id: &str, status: NodeStatus) -> bool

Source

pub fn add_edge(&mut self, edge: Edge)

Source

pub fn remove_edge(&mut self, from: &str, to: &str, relation: Option<&str>)

Source

pub fn edges_from(&self, id: &str) -> Vec<&Edge>

Source

pub fn edges_to(&self, id: &str) -> Vec<&Edge>

Source

pub fn ready_tasks(&self) -> Vec<&Node>

Get tasks that are ready (todo + all depends_on are done).

Source

pub fn tasks_by_status(&self, status: &NodeStatus) -> Vec<&Node>

Get tasks by status.

Source

pub fn summary(&self) -> GraphSummary

Summary statistics.

Source

pub fn summary_text(&self) -> String

Get a human-readable text summary of the graph state.

Source

pub fn health(&self) -> f64

Calculate graph health score (0.0 to 1.0).

Health is based on:

  • Progress: ratio of done tasks to total
  • Flow: ratio of ready tasks to remaining (non-blocked) tasks
  • Connectivity: graphs with edges are healthier than isolated nodes

Returns 1.0 for a fully complete graph, 0.0 for an empty or stuck graph.

Source

pub fn mark_task_done(&mut self, node_id: &str) -> bool

Mark a task as done. Returns true if found and updated.

Source

pub fn get_executable_tasks(&self) -> Vec<Task>

Get executable tasks (alias for ready_tasks, returns owned Task structs).

Trait Implementations§

Source§

impl Clone for Graph

Source§

fn clone(&self) -> Graph

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Graph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Graph

Source§

fn default() -> Graph

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Graph

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl KnowledgeGraph for Graph

Source§

fn get_knowledge_mut(&mut self, node_id: &str) -> Option<&mut KnowledgeNode>

Get mutable access to a node’s knowledge storage
Source§

fn get_knowledge(&self, node_id: &str) -> Option<&KnowledgeNode>

Get read access to a node’s knowledge storage
Source§

fn get_incoming_edges(&self, node_id: &str) -> Vec<String>

Get edges pointing to a node (for upstream lookups)
Source§

impl KnowledgeManagement for Graph

Source§

fn store_finding(&mut self, node_id: &str, key: &str, value: &str) -> Result<()>

Store a finding in a node
Source§

fn get_finding(&self, node_id: &str, key: &str) -> Option<String>

Get a finding from a node or any upstream node
Source§

fn get_upstream_findings(&self, node_id: &str, key: &str) -> Option<String>

Get finding from upstream nodes recursively
Source§

fn cache_file(&mut self, node_id: &str, path: &str, content: &str) -> Result<()>

Cache file content in a node
Source§

fn get_cached_file(&self, node_id: &str, path: &str) -> Option<String>

Get cached file from this node or upstream
Source§

fn record_tool_call( &mut self, node_id: &str, tool_name: &str, summary: &str, ) -> Result<()>

Record a tool call
Source§

fn get_tool_history(&self, node_id: &str) -> Vec<ToolCallRecord>

Get all tool calls from this and upstream nodes
Source§

fn get_knowledge_context(&self, node_id: &str) -> String

Get all findings from this and upstream nodes as formatted context
Source§

fn collect_upstream_findings_all( &self, node_id: &str, findings: &mut HashMap<String, String>, )

Helper to collect all findings recursively
Source§

impl Serialize for Graph

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Graph

§

impl RefUnwindSafe for Graph

§

impl Send for Graph

§

impl Sync for Graph

§

impl Unpin for Graph

§

impl UnsafeUnpin for Graph

§

impl UnwindSafe for Graph

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,