flow/bounds

Source: src/flow/bounds.ts

The worst case of a checked flow, computed before the first spawn: how many agent turns each node can ask for, and how long it can take when every bounded wait runs to its bound.

Every loop and every map has a bound written in the file, so both are known. They are shown, never judged: nothing refuses a flow for what it could cost. Sub-flows are unrolled, since a callee’s turns are spent where its call stands, and its agents inherit the caller’s timeout:.

Bound

type

export type Bound = {
	/** Agent turns, every retry counted. */
	readonly turns: number;
	/** Every bounded wait run to its bound, in milliseconds. */
	readonly ms: number;
	/** Whether an `ask` with no `timeout:` can be reached. */
	readonly waits: boolean;
};

The most something can cost. ms counts every wait that has a bound: an agent turn’s timeout: for each attempt retry: allows, a check’s, an ask’s when it has one. waits says an ask with no timeout: can be reached, whose wait for a person no bound covers.

Bounds

type

export type Bounds = {
	/** The flow's, run whole. */
	readonly total: Bound;
	/** By the node's address through the calls, `spec/look` for `look` in the flow `spec` calls. */
	readonly nodes: ReadonlyMap<string, Bound>;
};

A flow’s worst case whole, and each node’s over every visit a run can make of it.

showBound

function

export function showBound({ turns, ms, waits }: Bound): string { /* … */ }

A bound as a plan line shows it: ≤ 4 turns · ≤ 2h, and a person’s answer when an ask with no timeout: waits for one.