Push readiness frontier
State: open/verified · Kind: component · Audience: system
Summary
Section titled “Summary”- The core query: given a graph and caller-supplied state,
get_ready(graph, state, opts)returns up tolimitnodes runnable now — the parallel-safe frontier. - Push model: the caller updates state, the engine recomputes the frontier;
a pure function of
(graph, state). - Sub-capability of C-D2GO-readiness-scheduling.
Statement
Section titled “Statement”The push readiness frontier is the load-bearing feature. A node is in the
frontier iff its status is Pending and its parents’ statuses satisfy its
trigger rule (C-PPXU-status-model-and-trigger-rules) — dependency
satisfaction is just the default trigger rule. get_ready is the pure kernel: it computes that set,
applies only the call-time where_fn and order from ReadyOptions, and returns the
top limit. Schedule::ready layers registered filters
(C-GUGX-eligibility-filters) and sorters (C-V44L-priority-ordering-sorters) on
top. Neither executes anything or holds state of its own: the caller owns state and
re-queries after each change.
This is the surface the work-runner engine calls in-process on its dispatcher tick, which is why the crate is Rust — the tick carries no child-process boundary.
What it provides
Section titled “What it provides”get_ready(&Graph, &impl StatusSource, &ReadyOptions) -> Vec<ReadyNode>.- Query-time options on
ReadyOptions:where_fn(per-node predicate),order(a sorter),limit(the parallel cap),toward(goal rank). - Capacity via “ask for N” — no separate capacity primitive.
use graph_scheduler::{Done, ReadyOptions, get_ready};
let opts = ReadyOptions::new().limit(4);get_ready(&g, &Done::new(["T-1"]), &opts);// up to 4 nodes unlocked by T-1 whose trigger rules are satisfiedReadyOptions is #[non_exhaustive]; build it with ReadyOptions::new() and its
builder methods.
Inputs
Section titled “Inputs”- A graph (C-409J-dag-core) and any
StatusSource— a status map, theDoneid-list sugar, or a closure (C-PPXU-status-model-and-trigger-rules). - Options:
limit,where_fn,order,toward.
Outputs
Section titled “Outputs”- An ordered list of up to N runnable nodes (id + attributes).
Hook points
Section titled “Hook points”get_readytakes only the call-timewhere_fnandorder. Registered filters (C-GUGX-eligibility-filters) and sorters (C-V44L-priority-ordering-sorters) compose into the query throughSchedule::ready.
Underlying implementation
Section titled “Underlying implementation”- Built and tested, at
packages/rust/graph-scheduler/src/ready.rs(packages/rust/graph-scheduler/tests/ready.rs).
- Pure:
get_readyis a function of graph and state — no hidden state, safe under concurrency. Computing the frontier isO(V + E); the cap is a bounded top-N selection. - An unknown dependency target reads
Pendingand so never satisfies the default rule, keeping its dependent out of the frontier. That is deliberate fail-safe behaviour, matching whatsdlc task nextdoes with an unresolveddepends_on.
Locations
Section titled “Locations”packages/rust/graph-scheduler/src/ready.rs