Documentation
¶
Overview ¶
Package helpers provides graph traversal utilities for the Provenance blocked-by dependency graph. These functions perform DFS over the dominikbraun/graph structure and resolve traversed IDs to full Task values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ancestors ¶
func Ancestors(g dgraph.Graph[string, ptypes.Task], db TaskGetter, id ptypes.TaskID) ([]ptypes.Task, error)
Ancestors returns all tasks that transitively block the given task. In the blocked-by graph, A->B means "A is blocked by B". Ancestors of A are B and everything B transitively waits for (outgoing adjacency DFS). The given task itself is never included. Returns an empty slice if none.
func Descendants ¶
func Descendants(g dgraph.Graph[string, ptypes.Task], db TaskGetter, id ptypes.TaskID) ([]ptypes.Task, error)
Descendants returns all tasks that are transitively waiting for the given task to complete. In the blocked-by graph, A->B means "A is blocked by B". Descendants of B are A and everything that transitively depends on A (predecessor DFS). The given task itself is never included. Returns an empty slice if none.
Types ¶
type TaskGetter ¶
TaskGetter is the minimal interface needed by graph traversal helpers. It allows looking up a single task by ID without coupling to the concrete sqlite.DB type, making helpers independently testable with mocks.