eligibleSteps function
The eligible frontier of circuit under cursor at nodePath — the steps
that should currently be MOUNTED, in declaration order (M4-P1 §4 step 2).
circuitById resolves a SubCircuitStep's nested circuit (for terminal-path
dep resolution); now gates the supervised-restart cooldown (injected so the
predicate stays pure — the kernel owns the wall clock).
Implementation
List<CircuitStep> eligibleSteps(
Circuit circuit,
CircuitCursor cursor,
String nodePath, {
required Circuit? Function(String circuitId) circuitById,
required DateTime now,
}) => [
for (final step in circuit.steps)
if (depsSatisfied(
circuit,
step,
cursor,
nodePath,
circuitById: circuitById,
) &&
!isRetired(step, cursor, nodePath) &&
!isStepBroken(circuit, step, cursor, nodePath) &&
_runnableState(circuit, step, cursor, nodePath, now))
step,
];