--- id: SG-20 family: RT-SG level: core profiles: [runtime] posture: normative-target added: "1.0" changed: "1.0" source: https://flowdrop.io/spec/rules/rt-sg/sg-20 specification: FlowDrop Workflow Specification 1.0 licence: CC BY 4.0 --- # SG-20 — A data port no live producer can still fill fails its consumer *RT-SG (Part II) · level: core · profiles: runtime · added in 1.0* The round barrier on its own turns a gateway that routes away from an in-loop source into a silent hang. This is the clause that makes it terminate, and the restrictions are what keep it from failing workflows that were doing nothing wrong. ## The rule > **Normative.** This is the rule. > > 1. A data port held back by the round comparison MUST stop waiting once no job still to run, pending or running can reach the source node over the forward graph, with the source counted as able to reach itself. > > 2. A live loop head, being an ancestor of everything in its own body, therefore holds the port open across a re-entry, and so does an ancestor outside the loop still on its way. > > 3. A job whose own round is behind the consumer's MUST NOT count as live, or a job left waiting for a branch the run never took would hold the port open for the rest of the run. > > 4. Four restrictions bound the verdict. > > 5. It MUST NOT apply to an edge that is not a data edge, nor to a consumer that has an incoming trigger edge or an incoming error edge. > > 6. It MUST NOT apply unless every source on the port shares a loop with the consumer: one out-of-loop source keeps the port fillable. > > 7. It MUST NOT apply unless at least one edge on the port has actually been held back by the round comparison; a source that was simply never dispatched is an ordinary skipped branch and none of this rule's business, which is what makes this a termination clause for the round comparison rather than a general unfillable-port rule. > > 8. It MUST NOT apply unless the run carries the reachability sets the test needs. > > 9. Where the verdict applies, the consumer MUST fail with a node-level error (ERR-1), like any other node failure. > > 10. Where the consumer has an error edge of its own, the failure MUST be routed along it (EDGE-6), so an author catches an unfillable port in the same place as anything else. > > 11. Otherwise the failure MUST fail the run (ERR-8). > > 12. The failure MUST name the port, the source, and the consumer's round on the innermost loop the two share. > > 13. Where the gateway that routed away is determinable from the source's own incoming branch edges, the failure MUST name it; otherwise the failure MUST say only that no value for this round can still be produced. ## What it means The round barrier in SG-19 stops a stale source from satisfying an edge, but on its own that turns a gateway that routes away from an in-loop source into a silent hang: the consumer waits for a round that will never come. This rule is what ends the wait. A data port held back by the round comparison stops waiting once no execution still to run, pending or in progress can reach the source over the forward graph — the source counted as able to reach itself. A live loop head, being an ancestor of everything in its own body, holds the port open across a re-entry on that basis alone, and so does an out-of-loop ancestor still on its way; an execution whose own round is already behind the consumer's does not count as live, or a branch the run never took would hold the port open forever. Four restrictions keep this from over-firing. It applies to data edges only, and only to a consumer with no incoming trigger edge and no incoming error edge. Every source on the port shares a loop with the consumer — one out-of-loop source is enough to keep the port fillable regardless of the rest. At least one edge on the port has actually been held back by the round comparison; a source that was simply never dispatched is an ordinary skipped branch, not this rule's business. And the run carries the reachability sets the check depends on. Where it fires, the port's consumer fails exactly like any other node failure — routed down an error edge if the author wired one, failing the run if not. The failure names the port, the source, and the consumer's round on the innermost loop the two share; it names the gateway that routed away only where that is determinable from the source's own incoming branch edges, and otherwise says only that no value for this round can still be produced. ## Example A gateway heading the loop routes only to `write` on round one, so `fact_check` — the only in-loop source of `assembler`'s `citations` port — is never redispatched, and nothing still running can reach it. ```json title="What the round-one failure reports" verdict="failed" "port 'citations' cannot be satisfied in round 1 — its only in-loop source 'fact_check' was skipped by gateway 'planner'" ``` ## Why Recorded under [OPEN-25](https://flowdrop.io/spec/rulings/open-25), [OPEN-37](https://flowdrop.io/spec/rulings/open-37), [OPEN-45](https://flowdrop.io/spec/rulings/open-45). ## Related rules - Names: SG-17, SG-19, DATA-4 - Referenced by: BR-6, DATA-4, SG-17, SG-19 --- Rule identifiers are permanent and are never renumbered. This specification carries no implementation status: each implementation publishes its own standing against these rules. Licensed CC BY 4.0.