compass.utilities.workflow#

Map of a jurisdiction’s run, linking event logs to its steps

The map (compass/data/workflow.json5) lists every step, decision, LLM call, and decision tree of a jurisdiction’s run as a graph. Events name the node they happened in with a step tag, and decisions record which way they went as branch events, so a replay of the log can show the path taken against every path that was possible.

Module attributes

WORKFLOW_FP

Path to the workflow map

NODE_KINDS

Kinds of node the workflow map may contain

Functions

load_workflow()

dict: The workflow map, as parsed from its JSON5 file

node_edges(node)

list: (target, when) pairs for each edge leaving node

node_outcomes(node)

list of str: The outcomes a decision at node can record

parent_id(node_id)

str or None: ID of the group holding the node node_id

workflow_nodes([workflow])

dict: Workflow nodes by ID, in the order they are listed

workflow_problems([workflow])

Check that the workflow map is consistent