workflows/trail

Source: src/workflows/trail.ts

The trail: every result a workflow produced so far, over its own clock.

What a workflow reports besides its answer - the steps it took, what they cost over the time the whole thing took, and the first step that failed - used to be kept by each combinator in its own variables, with its own performance.now() and its own sum. The pool records into a trail as it plays turns, so a combinator reads the envelope instead of keeping one.

Trail

class

export class Trail {
	readonly steps: Result[] = [];
	record<T extends Result>(result: T): T { /* … */ }
	usage(): Usage { /* … */ }
	broken(): Result | undefined { /* … */ }
}

The results a workflow produced, in order, and what they add up to.