diff --git a/apps/web/components/teams/team-form.tsx b/apps/web/components/teams/team-form.tsx index 1fef9ba5..6ded537f 100644 --- a/apps/web/components/teams/team-form.tsx +++ b/apps/web/components/teams/team-form.tsx @@ -44,7 +44,14 @@ import { autonomyDraft, teamAutonomyInput, type TeamApprovalChoice } from "@/lib import type { AgentTeam, TeamRepository, WorkSource } from "@/lib/types"; import { cn } from "@/lib/utils"; -import { cleanWorkflow, workflowFromSteps, workflowIssues, type Workflow } from "@/lib/workflow"; +import { + agentLabel, + cleanWorkflow, + workflowFromSteps, + workflowIssues, + type AgentListState, + type Workflow, +} from "@/lib/workflow"; import { MODE_HINT, MODE_LABEL, StepNumber, modelLabel, type TeamMode } from "./team-parts"; import { WorkflowEditor } from "./workflow/workflow-editor"; @@ -270,6 +277,9 @@ export function TeamForm({ }); const agentOptions = (agents.data?.items ?? []).filter((agent) => agent.status !== "archived"); + // The editor gets archived agents too, so a step that still names one says "Archived agent". + const workflowAgents = (agents.data?.items ?? []).map((agent) => ({ ...agent, archived: agent.status === "archived" })); + const agentsState: AgentListState = agents.isError ? "error" : agents.isPending ? "loading" : "ready"; const agentById = new Map((agents.data?.items ?? []).map((agent) => [agent.id, agent])); const primary = agentById.get(draft.steps[0]?.agentId ?? ""); const isWorkflow = draft.mode === "workflow"; @@ -511,7 +521,8 @@ export function TeamForm({ set("workflow", next)} - agents={agentOptions} + agents={workflowAgents} + agentsState={agentsState} issues={workflowProblems} revealProblem={revealProblem} /> @@ -549,7 +560,11 @@ export function TeamForm({ {agent.harness ? ` (${brandName(agent.harness)})` : ""} ))} - {step.agentId && !chosenAgent ? : null} + {step.agentId && (!chosenAgent || chosenAgent.status === "archived") ? ( + + ) : null}

{index === 0 diff --git a/apps/web/components/teams/workflow/workflow-editor.tsx b/apps/web/components/teams/workflow/workflow-editor.tsx index 2a323cd4..723740de 100644 --- a/apps/web/components/teams/workflow/workflow-editor.tsx +++ b/apps/web/components/teams/workflow/workflow-editor.tsx @@ -28,6 +28,7 @@ import { WORKFLOW_EXAMPLES, WORKFLOW_START, addStep, + agentLabel, apart, conditionOfPort, conditionPhrase, @@ -39,6 +40,8 @@ import { isStartEdge, lastStep, loopSteps, + nextInput, + nextOutput, portOf, patchEdge, patchStep, @@ -51,6 +54,7 @@ import { suggestCondition, tidy, withPositions, + type AgentListState, type Workflow, type WorkflowEdge, type WorkflowIssue, @@ -64,6 +68,8 @@ export interface AgentOption { id: string; name: string; harness?: string | null; + /** Archived agents are passed too, so a step that still names one can say so; they are not offered. */ + archived?: boolean; } /** "success" | "failure" | "always" | "outcome:

+ Every other step already leads here. Change a line's condition, or draw one on the canvas. +

+ ) : null}
@@ -433,16 +447,17 @@ function StepFields({ type="button" size="sm" variant="outline" - onClick={() => { - const suggestion = suggestCondition(workflow, node.id); - // With no other step to go to, the step can still repeat itself. - const target = others.find((item) => !lines.some((edge) => edge.to === item.id)) ?? others[0] ?? node; - const result = connect(workflow, node.id, target.id, suggestion.when, suggestion.outcome); - onChange(result.workflow); - }} + disabled={!addOutput} + // With no other step to go to, the step can still repeat itself. + onClick={() => addOutput && onChange(addOutput)} > Add an output + {!addOutput ? ( +

+ This output already leads to every step. Change a line's condition, or add an outcome first. +

+ ) : null}
{inLoop ? ( @@ -605,12 +620,15 @@ export function WorkflowEditor({ value, onChange, agents, + agentsState = "ready", issues, revealProblem, }: { value: Workflow; onChange: (next: Workflow) => void; agents: AgentOption[]; + /** While the agent list loads (or if it failed), steps do not call their agents unavailable. */ + agentsState?: AgentListState; issues: WorkflowIssue[]; /** Changes when a save was refused: open the first step or line that has a problem. */ revealProblem?: number; @@ -631,6 +649,8 @@ export function WorkflowEditor({ const [, redraw] = useState(0); const change = useCallback( (next: Workflow) => { + // A change that changes nothing ("Add an output" when the line exists) is no Undo step. + if (next === current.current) return; const log = history.current; const now = Date.now(); if (now - log.at > 700) { @@ -671,8 +691,7 @@ export function WorkflowEditor({ return () => document.removeEventListener("keydown", onKeyDown); }, [step]); - const names = useMemo(() => new Map(agents.map((agent) => [agent.id, agent.name])), [agents]); - const agentName = useCallback((id: string) => names.get(id) ?? "Unavailable agent", [names]); + const agentName = useCallback((id: string) => agentLabel(id, agents, agentsState), [agents, agentsState]); const loops = useMemo(() => loopSteps(value), [value]); const problems = useMemo( () => new Set(issues.flatMap((issue) => (issue.nodeId ? [issue.nodeId] : []))), @@ -855,6 +874,7 @@ export function WorkflowEditor({ workflow={value} node={node} agents={agents} + agentsState={agentsState} onChange={change} onSelect={setSelection} inLoop={loops.has(node.id)} @@ -951,6 +971,7 @@ export function WorkflowEditor({ workflow={value} node={selectedNode} agents={agents} + agentsState={agentsState} onChange={change} onSelect={setSelection} inLoop={loops.has(selectedNode.id)} diff --git a/apps/web/lib/workflow.test.ts b/apps/web/lib/workflow.test.ts index 2e707069..7638b92e 100644 --- a/apps/web/lib/workflow.test.ts +++ b/apps/web/lib/workflow.test.ts @@ -1,10 +1,12 @@ import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; import { test } from "node:test"; import { WORKFLOW_EXAMPLES, WORKFLOW_START, addStep, + agentLabel, apart, cleanWorkflow, conditionOfPort, @@ -16,6 +18,8 @@ import { limitReached, liveEdges, loopSteps, + nextInput, + nextOutput, nodeRunStates, nodeHeight, patchStep, @@ -349,3 +353,52 @@ test("names become ids", () => { assert.equal(slugify("Run the tests!"), "run-the-tests"); assert.equal(slugify(" "), ""); }); + +test("the editor agrees with the server on the shared validation cases", () => { + // The same file is asserted by `validate` in crates/orbit-domain/src/workflow.rs. + const fixture = JSON.parse( + readFileSync(new URL("../../../crates/orbit-domain/tests/fixtures/workflow-validation.json", import.meta.url), "utf8"), + ) as { cases: { name: string; valid: boolean; workflow: Workflow }[] }; + assert.ok(fixture.cases.length > 20); + for (const { name, valid, workflow } of fixture.cases) { + const issues = workflowIssues(workflow); + if (valid) assert.deepEqual(issues, [], name); + else assert.ok(issues.length > 0, `${name}: the editor accepts what the server refuses`); + } +}); + +test("adding an input or output never returns the same workflow", () => { + const two: Workflow = { + nodes: [ + { id: "a", name: "A", agentId: "x" }, + { id: "b", name: "B", agentId: "x" }, + ], + edges: [{ id: "s", from: WORKFLOW_START, to: "a", when: "always" }], + }; + const withLine = nextOutput(two, "a"); + assert.ok(withLine); + assert.deepEqual(withLine.edges.at(-1), { id: withLine.edges.at(-1)?.id, from: "a", to: "b", when: "success", outcome: null }); + // The suggested line now exists: nothing is left to add, in either direction. + assert.equal(nextOutput(withLine, "a"), null); + assert.equal(nextInput(withLine, "b"), null); + // b can still feed a. + assert.equal(nextInput(withLine, "a")?.edges.at(-1)?.from, "b"); + // A step on its own can repeat itself once. + const single: Workflow = { nodes: [{ id: "a", name: "A", agentId: "x" }], edges: [] }; + const loop = nextOutput(single, "a"); + assert.equal(loop?.edges[0].to, "a"); + assert.equal(nextOutput(loop!, "a"), null); + assert.equal(nextInput(single, "a"), null); +}); + +test("steps name archived agents and do not call a loading list unavailable", () => { + const agents = [ + { id: "1", name: "Builder" }, + { id: "2", name: "Old reviewer", archived: true }, + ]; + assert.equal(agentLabel("1", agents), "Builder"); + assert.equal(agentLabel("2", agents), "Archived agent: Old reviewer"); + assert.equal(agentLabel("3", agents), "Unavailable agent"); + assert.equal(agentLabel("3", [], "loading"), "Loading agents…"); + assert.equal(agentLabel("3", [], "error"), "Agents could not be loaded"); +}); diff --git a/apps/web/lib/workflow.ts b/apps/web/lib/workflow.ts index 0e9a9e40..33c6e56c 100644 --- a/apps/web/lib/workflow.ts +++ b/apps/web/lib/workflow.ts @@ -9,6 +9,8 @@ export const WORKFLOW_START = "start"; export const DEFAULT_MAX_RUNS = 3; export const MAX_RUNS_LIMIT = 10; export const MAX_STEPS = 30; +export const MAX_LINES = 120; +export const MAX_INSTRUCTIONS = 4000; export type WorkflowWhen = "always" | "success" | "failure" | "outcome"; @@ -172,6 +174,19 @@ export function workflowIssues(workflow: Workflow): WorkflowIssue[] { const issues: WorkflowIssue[] = []; if (!workflow.nodes.length) return [{ message: "Add at least one step." }]; if (workflow.nodes.length > MAX_STEPS) issues.push({ message: `A workflow can have at most ${MAX_STEPS} steps.` }); + if (workflow.edges.length > MAX_LINES) issues.push({ message: `A workflow can have at most ${MAX_LINES} lines.` }); + const stepIds = new Set(); + for (const node of workflow.nodes) { + if (node.id === WORKFLOW_START || node.id.length > 40 || !SLUG.test(node.id)) + issues.push({ message: `${node.name.trim() || "A step"} has an id the server does not accept.`, nodeId: node.id }); + else if (stepIds.has(node.id)) issues.push({ message: `Two steps share the id "${node.id}".`, nodeId: node.id }); + stepIds.add(node.id); + } + const lineIds = new Set(); + for (const edge of workflow.edges) { + if (!edge.id.trim() || lineIds.has(edge.id)) issues.push({ message: "Every line needs its own id.", edgeId: edge.id }); + lineIds.add(edge.id); + } const ids = new Set(workflow.nodes.map((node) => node.id)); const names = new Map(); for (const node of workflow.nodes) { @@ -181,6 +196,8 @@ export function workflowIssues(workflow: Workflow): WorkflowIssue[] { else if (name.length > 60) issues.push({ message: `"${name.slice(0, 24)}…" is longer than 60 characters.`, nodeId: node.id }); names.set(name.toLowerCase(), (names.get(name.toLowerCase()) ?? 0) + 1); if (!node.agentId) issues.push({ message: `${label} has no agent yet.`, nodeId: node.id }); + if ((node.instructions ?? "").length > MAX_INSTRUCTIONS) + issues.push({ message: `${label}: instructions are longer than ${MAX_INSTRUCTIONS} characters.`, nodeId: node.id }); const outcomes = node.outcomes ?? []; if (outcomes.some((outcome) => !isOutcomeLabel(outcome))) issues.push({ message: `${label}: outcomes use lower-case letters, digits, "-" or "_".`, nodeId: node.id }); @@ -205,6 +222,11 @@ export function workflowIssues(workflow: Workflow): WorkflowIssue[] { continue; } const source = workflow.nodes.find((node) => node.id === edge.from); + if (!isStartEdge(edge) && edge.when !== "outcome" && edge.outcome) + issues.push({ + message: `The line from ${source?.name.trim() || "a step"} names an outcome but does not follow one.`, + edgeId: edge.id, + }); if (!isStartEdge(edge) && edge.when === "outcome") { if (!edge.outcome) issues.push({ message: `Choose the outcome for the line from ${source?.name.trim() || "a step"}.`, edgeId: edge.id }); @@ -677,6 +699,56 @@ export function suggestCondition(workflow: Workflow, from: string): { when: Work return { when: "outcome", outcome: outcomes.find((outcome) => !used.has(outcome)) ?? outcomes[0] }; } +/** + * What "Add an input" adds to `nodeId`: a line from the first other step that does not + * lead here yet in the condition it most likely wants. Null when every such line exists, + * so the button can say there is nothing to add instead of doing nothing. + */ +export function nextInput(workflow: Workflow, nodeId: string): Workflow | null { + for (const source of workflow.nodes) { + if (source.id === nodeId) continue; + const suggestion = suggestCondition(workflow, source.id); + const result = connect(workflow, source.id, nodeId, suggestion.when, suggestion.outcome); + if (result.workflow !== workflow) return result.workflow; + } + return null; +} + +/** + * What "Add an output" adds to `nodeId`: a line in the suggested condition to the first + * step it does not lead to yet, or back to itself when there is no other step. Null when + * every such line exists. + */ +export function nextOutput(workflow: Workflow, nodeId: string): Workflow | null { + const suggestion = suggestCondition(workflow, nodeId); + const others = workflow.nodes.filter((item) => item.id !== nodeId); + const targets = others.length ? others : workflow.nodes.filter((item) => item.id === nodeId); + for (const target of targets) { + const result = connect(workflow, nodeId, target.id, suggestion.when, suggestion.outcome); + if (result.workflow !== workflow) return result.workflow; + } + return null; +} + +/** An agent a step can name. Archived agents are listed so their steps can say so. */ +export interface WorkflowAgent { + id: string; + name: string; + archived?: boolean; +} + +/** Whether the list of agents has arrived. */ +export type AgentListState = "loading" | "error" | "ready"; + +/** How a step names its agent: archived ones say so, and a list still loading is not "unavailable". */ +export function agentLabel(id: string, agents: WorkflowAgent[], state: AgentListState = "ready"): string { + const agent = agents.find((item) => item.id === id); + if (agent) return agent.archived ? `Archived agent: ${agent.name}` : agent.name; + if (state === "loading") return "Loading agents…"; + if (state === "error") return "Agents could not be loaded"; + return "Unavailable agent"; +} + export function patchEdge(workflow: Workflow, id: string, patch: Partial): Workflow { return { ...workflow, edges: workflow.edges.map((edge) => (edge.id === id ? { ...edge, ...patch } : edge)) }; } diff --git a/changelog.d/442.fixed.md b/changelog.d/442.fixed.md new file mode 100644 index 00000000..72d9db30 --- /dev/null +++ b/changelog.d/442.fixed.md @@ -0,0 +1,6 @@ +- The workflow editor no longer adds an Undo step for "Add an input" or "Add an output" + when there is nothing to add: the button is disabled and says why. Steps whose agent is + archived read "Archived agent: ", and a list that is still loading or failed to + load no longer calls every agent unavailable. The editor now also checks the server's + 120-line limit, outcomes on lines that do not follow one, instruction length and step + and line ids, and both sides are tested against one shared fixture (#442). diff --git a/crates/orbit-domain/src/workflow.rs b/crates/orbit-domain/src/workflow.rs index 27b1f8dc..7a7c058c 100644 --- a/crates/orbit-domain/src/workflow.rs +++ b/crates/orbit-domain/src/workflow.rs @@ -1028,6 +1028,32 @@ mod tests { assert!(messages(&unknown)[0].contains("unknown step 'ghost'")); } + /// The cases the web editor's `workflowIssues` is tested against too + /// (`apps/web/lib/workflow.test.ts`), so the two checks cannot drift apart. + #[test] + fn shared_validation_fixture() { + let fixture: serde_json::Value = + serde_json::from_str(include_str!("../tests/fixtures/workflow-validation.json")) + .expect("fixture is JSON"); + let cases = fixture["cases"].as_array().expect("cases"); + assert!(cases.len() > 20); + for case in cases { + let name = case["name"].as_str().expect("name"); + let workflow: WorkflowDefinition = + serde_json::from_value(case["workflow"].clone()).expect(name); + let issues = workflow.validate(); + if case["valid"].as_bool().expect("valid") { + assert!(issues.is_empty(), "{name}: {issues:?}"); + } else { + let path = case["path"].as_str().expect("invalid cases name a path"); + assert!( + issues.iter().any(|issue| issue.path == path), + "{name}: expected an issue at {path}, got {issues:?}" + ); + } + } + } + #[test] fn agents_are_listed_once() { let mut second = node("b"); diff --git a/crates/orbit-domain/tests/fixtures/workflow-validation.json b/crates/orbit-domain/tests/fixtures/workflow-validation.json new file mode 100644 index 00000000..78383b19 --- /dev/null +++ b/crates/orbit-domain/tests/fixtures/workflow-validation.json @@ -0,0 +1,2328 @@ +{ + "_comment": "Workflow validation cases shared by crates/orbit-domain/src/workflow.rs (validate) and apps/web/lib/workflow.test.ts (workflowIssues). valid=false cases name the path of the server's first matching issue.", + "cases": [ + { + "name": "a line of two steps", + "valid": true, + "workflow": { + "nodes": [ + { + "id": "build", + "name": "Build", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "test", + "name": "Test", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "build", + "when": "always" + }, + { + "id": "e1", + "from": "build", + "to": "test", + "when": "success" + } + ] + } + }, + { + "name": "a review loop with outcomes and a run limit", + "valid": true, + "workflow": { + "nodes": [ + { + "id": "build", + "name": "Build", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "review", + "name": "Review", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "approved", + "changes" + ], + "maxRuns": 5 + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "build", + "when": "always" + }, + { + "id": "e1", + "from": "build", + "to": "review", + "when": "success" + }, + { + "id": "e2", + "from": "review", + "to": "build", + "when": "outcome", + "outcome": "changes" + }, + { + "id": "e3", + "from": "review", + "to": "build", + "when": "failure" + } + ] + } + }, + { + "name": "two starting steps and a join", + "valid": true, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "c", + "name": "C", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s1", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "s2", + "from": "start", + "to": "b", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "c", + "when": "success" + }, + { + "id": "e2", + "from": "b", + "to": "c", + "when": "always" + } + ] + } + }, + { + "name": "a start line may carry a leftover outcome", + "valid": true, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always", + "outcome": "x" + } + ] + } + }, + { + "name": "no steps", + "valid": false, + "workflow": { + "nodes": [], + "edges": [] + }, + "path": "workflow.nodes" + }, + { + "name": "no starting step", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [] + }, + "path": "workflow.edges" + }, + { + "name": "a step nothing leads to", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[1]" + }, + { + "name": "an outcome line without an outcome", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "pass" + ] + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "outcome" + } + ] + }, + "path": "workflow.edges[1].outcome" + }, + { + "name": "an outcome line for an outcome the step does not have", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "outcome", + "outcome": "pass" + } + ] + }, + "path": "workflow.edges[1].outcome" + }, + { + "name": "a success line that names an outcome", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "pass" + ] + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "success", + "outcome": "pass" + } + ] + }, + "path": "workflow.edges[1].outcome" + }, + { + "name": "a failure line that names an outcome", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "failure", + "outcome": "oops" + } + ] + }, + "path": "workflow.edges[1].outcome" + }, + { + "name": "two steps with the same name", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "Build", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "build", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "success" + } + ] + }, + "path": "workflow.nodes[1].name" + }, + { + "name": "a step without a name", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": " ", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].name" + }, + { + "name": "a name longer than 60 characters", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].name" + }, + { + "name": "instructions longer than 4000 characters", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "instructions": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].instructions" + }, + { + "name": "more than 8 outcomes", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "o0", + "o1", + "o2", + "o3", + "o4", + "o5", + "o6", + "o7", + "o8" + ] + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].outcomes" + }, + { + "name": "an outcome that is not a slug", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "Pass" + ] + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].outcomes" + }, + { + "name": "an outcome listed twice", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "outcomes": [ + "pass", + "pass" + ] + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].outcomes" + }, + { + "name": "a run limit of 0", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "maxRuns": 0 + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].maxRuns" + }, + { + "name": "a run limit of 11", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001", + "maxRuns": 11 + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].maxRuns" + }, + { + "name": "a step called start", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "start", + "name": "Begin", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "start", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].id" + }, + { + "name": "a step id that is not a slug", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "Build Step", + "name": "Build", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "Build Step", + "when": "always" + } + ] + }, + "path": "workflow.nodes[0].id" + }, + { + "name": "two steps with one id", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "One", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "a", + "name": "Two", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + } + ] + }, + "path": "workflow.nodes[1].id" + }, + { + "name": "two lines with one id", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "x", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "x", + "from": "a", + "to": "b", + "when": "success" + } + ] + }, + "path": "workflow.edges[1].id" + }, + { + "name": "the same line twice", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "b", + "name": "B", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "b", + "when": "success" + }, + { + "id": "e2", + "from": "a", + "to": "b", + "when": "success" + } + ] + }, + "path": "workflow.edges[2].to" + }, + { + "name": "a line to a step that does not exist", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "a", + "name": "A", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "s", + "from": "start", + "to": "a", + "when": "always" + }, + { + "id": "e1", + "from": "a", + "to": "ghost", + "when": "success" + } + ] + }, + "path": "workflow.edges[1].to" + }, + { + "name": "more than 120 lines", + "valid": false, + "workflow": { + "nodes": [ + { + "id": "s0", + "name": "S0", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s1", + "name": "S1", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s2", + "name": "S2", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s3", + "name": "S3", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s4", + "name": "S4", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s5", + "name": "S5", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s6", + "name": "S6", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s7", + "name": "S7", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s8", + "name": "S8", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s9", + "name": "S9", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s10", + "name": "S10", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "sts0", + "from": "start", + "to": "s0", + "when": "always" + }, + { + "id": "sts1", + "from": "start", + "to": "s1", + "when": "always" + }, + { + "id": "sts2", + "from": "start", + "to": "s2", + "when": "always" + }, + { + "id": "sts3", + "from": "start", + "to": "s3", + "when": "always" + }, + { + "id": "sts4", + "from": "start", + "to": "s4", + "when": "always" + }, + { + "id": "sts5", + "from": "start", + "to": "s5", + "when": "always" + }, + { + "id": "sts6", + "from": "start", + "to": "s6", + "when": "always" + }, + { + "id": "sts7", + "from": "start", + "to": "s7", + "when": "always" + }, + { + "id": "sts8", + "from": "start", + "to": "s8", + "when": "always" + }, + { + "id": "sts9", + "from": "start", + "to": "s9", + "when": "always" + }, + { + "id": "sts10", + "from": "start", + "to": "s10", + "when": "always" + }, + { + "id": "l0", + "from": "s0", + "to": "s1", + "when": "success" + }, + { + "id": "l1", + "from": "s0", + "to": "s2", + "when": "success" + }, + { + "id": "l2", + "from": "s0", + "to": "s3", + "when": "success" + }, + { + "id": "l3", + "from": "s0", + "to": "s4", + "when": "success" + }, + { + "id": "l4", + "from": "s0", + "to": "s5", + "when": "success" + }, + { + "id": "l5", + "from": "s0", + "to": "s6", + "when": "success" + }, + { + "id": "l6", + "from": "s0", + "to": "s7", + "when": "success" + }, + { + "id": "l7", + "from": "s0", + "to": "s8", + "when": "success" + }, + { + "id": "l8", + "from": "s0", + "to": "s9", + "when": "success" + }, + { + "id": "l9", + "from": "s0", + "to": "s10", + "when": "success" + }, + { + "id": "l10", + "from": "s1", + "to": "s0", + "when": "success" + }, + { + "id": "l11", + "from": "s1", + "to": "s2", + "when": "success" + }, + { + "id": "l12", + "from": "s1", + "to": "s3", + "when": "success" + }, + { + "id": "l13", + "from": "s1", + "to": "s4", + "when": "success" + }, + { + "id": "l14", + "from": "s1", + "to": "s5", + "when": "success" + }, + { + "id": "l15", + "from": "s1", + "to": "s6", + "when": "success" + }, + { + "id": "l16", + "from": "s1", + "to": "s7", + "when": "success" + }, + { + "id": "l17", + "from": "s1", + "to": "s8", + "when": "success" + }, + { + "id": "l18", + "from": "s1", + "to": "s9", + "when": "success" + }, + { + "id": "l19", + "from": "s1", + "to": "s10", + "when": "success" + }, + { + "id": "l20", + "from": "s2", + "to": "s0", + "when": "success" + }, + { + "id": "l21", + "from": "s2", + "to": "s1", + "when": "success" + }, + { + "id": "l22", + "from": "s2", + "to": "s3", + "when": "success" + }, + { + "id": "l23", + "from": "s2", + "to": "s4", + "when": "success" + }, + { + "id": "l24", + "from": "s2", + "to": "s5", + "when": "success" + }, + { + "id": "l25", + "from": "s2", + "to": "s6", + "when": "success" + }, + { + "id": "l26", + "from": "s2", + "to": "s7", + "when": "success" + }, + { + "id": "l27", + "from": "s2", + "to": "s8", + "when": "success" + }, + { + "id": "l28", + "from": "s2", + "to": "s9", + "when": "success" + }, + { + "id": "l29", + "from": "s2", + "to": "s10", + "when": "success" + }, + { + "id": "l30", + "from": "s3", + "to": "s0", + "when": "success" + }, + { + "id": "l31", + "from": "s3", + "to": "s1", + "when": "success" + }, + { + "id": "l32", + "from": "s3", + "to": "s2", + "when": "success" + }, + { + "id": "l33", + "from": "s3", + "to": "s4", + "when": "success" + }, + { + "id": "l34", + "from": "s3", + "to": "s5", + "when": "success" + }, + { + "id": "l35", + "from": "s3", + "to": "s6", + "when": "success" + }, + { + "id": "l36", + "from": "s3", + "to": "s7", + "when": "success" + }, + { + "id": "l37", + "from": "s3", + "to": "s8", + "when": "success" + }, + { + "id": "l38", + "from": "s3", + "to": "s9", + "when": "success" + }, + { + "id": "l39", + "from": "s3", + "to": "s10", + "when": "success" + }, + { + "id": "l40", + "from": "s4", + "to": "s0", + "when": "success" + }, + { + "id": "l41", + "from": "s4", + "to": "s1", + "when": "success" + }, + { + "id": "l42", + "from": "s4", + "to": "s2", + "when": "success" + }, + { + "id": "l43", + "from": "s4", + "to": "s3", + "when": "success" + }, + { + "id": "l44", + "from": "s4", + "to": "s5", + "when": "success" + }, + { + "id": "l45", + "from": "s4", + "to": "s6", + "when": "success" + }, + { + "id": "l46", + "from": "s4", + "to": "s7", + "when": "success" + }, + { + "id": "l47", + "from": "s4", + "to": "s8", + "when": "success" + }, + { + "id": "l48", + "from": "s4", + "to": "s9", + "when": "success" + }, + { + "id": "l49", + "from": "s4", + "to": "s10", + "when": "success" + }, + { + "id": "l50", + "from": "s5", + "to": "s0", + "when": "success" + }, + { + "id": "l51", + "from": "s5", + "to": "s1", + "when": "success" + }, + { + "id": "l52", + "from": "s5", + "to": "s2", + "when": "success" + }, + { + "id": "l53", + "from": "s5", + "to": "s3", + "when": "success" + }, + { + "id": "l54", + "from": "s5", + "to": "s4", + "when": "success" + }, + { + "id": "l55", + "from": "s5", + "to": "s6", + "when": "success" + }, + { + "id": "l56", + "from": "s5", + "to": "s7", + "when": "success" + }, + { + "id": "l57", + "from": "s5", + "to": "s8", + "when": "success" + }, + { + "id": "l58", + "from": "s5", + "to": "s9", + "when": "success" + }, + { + "id": "l59", + "from": "s5", + "to": "s10", + "when": "success" + }, + { + "id": "l60", + "from": "s6", + "to": "s0", + "when": "success" + }, + { + "id": "l61", + "from": "s6", + "to": "s1", + "when": "success" + }, + { + "id": "l62", + "from": "s6", + "to": "s2", + "when": "success" + }, + { + "id": "l63", + "from": "s6", + "to": "s3", + "when": "success" + }, + { + "id": "l64", + "from": "s6", + "to": "s4", + "when": "success" + }, + { + "id": "l65", + "from": "s6", + "to": "s5", + "when": "success" + }, + { + "id": "l66", + "from": "s6", + "to": "s7", + "when": "success" + }, + { + "id": "l67", + "from": "s6", + "to": "s8", + "when": "success" + }, + { + "id": "l68", + "from": "s6", + "to": "s9", + "when": "success" + }, + { + "id": "l69", + "from": "s6", + "to": "s10", + "when": "success" + }, + { + "id": "l70", + "from": "s7", + "to": "s0", + "when": "success" + }, + { + "id": "l71", + "from": "s7", + "to": "s1", + "when": "success" + }, + { + "id": "l72", + "from": "s7", + "to": "s2", + "when": "success" + }, + { + "id": "l73", + "from": "s7", + "to": "s3", + "when": "success" + }, + { + "id": "l74", + "from": "s7", + "to": "s4", + "when": "success" + }, + { + "id": "l75", + "from": "s7", + "to": "s5", + "when": "success" + }, + { + "id": "l76", + "from": "s7", + "to": "s6", + "when": "success" + }, + { + "id": "l77", + "from": "s7", + "to": "s8", + "when": "success" + }, + { + "id": "l78", + "from": "s7", + "to": "s9", + "when": "success" + }, + { + "id": "l79", + "from": "s7", + "to": "s10", + "when": "success" + }, + { + "id": "l80", + "from": "s8", + "to": "s0", + "when": "success" + }, + { + "id": "l81", + "from": "s8", + "to": "s1", + "when": "success" + }, + { + "id": "l82", + "from": "s8", + "to": "s2", + "when": "success" + }, + { + "id": "l83", + "from": "s8", + "to": "s3", + "when": "success" + }, + { + "id": "l84", + "from": "s8", + "to": "s4", + "when": "success" + }, + { + "id": "l85", + "from": "s8", + "to": "s5", + "when": "success" + }, + { + "id": "l86", + "from": "s8", + "to": "s6", + "when": "success" + }, + { + "id": "l87", + "from": "s8", + "to": "s7", + "when": "success" + }, + { + "id": "l88", + "from": "s8", + "to": "s9", + "when": "success" + }, + { + "id": "l89", + "from": "s8", + "to": "s10", + "when": "success" + }, + { + "id": "l90", + "from": "s9", + "to": "s0", + "when": "success" + }, + { + "id": "l91", + "from": "s9", + "to": "s1", + "when": "success" + }, + { + "id": "l92", + "from": "s9", + "to": "s2", + "when": "success" + }, + { + "id": "l93", + "from": "s9", + "to": "s3", + "when": "success" + }, + { + "id": "l94", + "from": "s9", + "to": "s4", + "when": "success" + }, + { + "id": "l95", + "from": "s9", + "to": "s5", + "when": "success" + }, + { + "id": "l96", + "from": "s9", + "to": "s6", + "when": "success" + }, + { + "id": "l97", + "from": "s9", + "to": "s7", + "when": "success" + }, + { + "id": "l98", + "from": "s9", + "to": "s8", + "when": "success" + }, + { + "id": "l99", + "from": "s9", + "to": "s10", + "when": "success" + }, + { + "id": "l100", + "from": "s10", + "to": "s0", + "when": "success" + }, + { + "id": "l101", + "from": "s10", + "to": "s1", + "when": "success" + }, + { + "id": "l102", + "from": "s10", + "to": "s2", + "when": "success" + }, + { + "id": "l103", + "from": "s10", + "to": "s3", + "when": "success" + }, + { + "id": "l104", + "from": "s10", + "to": "s4", + "when": "success" + }, + { + "id": "l105", + "from": "s10", + "to": "s5", + "when": "success" + }, + { + "id": "l106", + "from": "s10", + "to": "s6", + "when": "success" + }, + { + "id": "l107", + "from": "s10", + "to": "s7", + "when": "success" + }, + { + "id": "l108", + "from": "s10", + "to": "s8", + "when": "success" + }, + { + "id": "l109", + "from": "s10", + "to": "s9", + "when": "success" + } + ] + }, + "path": "workflow.edges" + }, + { + "name": "exactly 120 lines", + "valid": true, + "workflow": { + "nodes": [ + { + "id": "s0", + "name": "S0", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s1", + "name": "S1", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s2", + "name": "S2", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s3", + "name": "S3", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s4", + "name": "S4", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s5", + "name": "S5", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s6", + "name": "S6", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s7", + "name": "S7", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s8", + "name": "S8", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s9", + "name": "S9", + "agentId": "00000000-0000-4000-8000-000000000001" + }, + { + "id": "s10", + "name": "S10", + "agentId": "00000000-0000-4000-8000-000000000001" + } + ], + "edges": [ + { + "id": "sts0", + "from": "start", + "to": "s0", + "when": "always" + }, + { + "id": "sts1", + "from": "start", + "to": "s1", + "when": "always" + }, + { + "id": "sts2", + "from": "start", + "to": "s2", + "when": "always" + }, + { + "id": "sts3", + "from": "start", + "to": "s3", + "when": "always" + }, + { + "id": "sts4", + "from": "start", + "to": "s4", + "when": "always" + }, + { + "id": "sts5", + "from": "start", + "to": "s5", + "when": "always" + }, + { + "id": "sts6", + "from": "start", + "to": "s6", + "when": "always" + }, + { + "id": "sts7", + "from": "start", + "to": "s7", + "when": "always" + }, + { + "id": "sts8", + "from": "start", + "to": "s8", + "when": "always" + }, + { + "id": "sts9", + "from": "start", + "to": "s9", + "when": "always" + }, + { + "id": "sts10", + "from": "start", + "to": "s10", + "when": "always" + }, + { + "id": "l0", + "from": "s0", + "to": "s1", + "when": "success" + }, + { + "id": "l1", + "from": "s0", + "to": "s2", + "when": "success" + }, + { + "id": "l2", + "from": "s0", + "to": "s3", + "when": "success" + }, + { + "id": "l3", + "from": "s0", + "to": "s4", + "when": "success" + }, + { + "id": "l4", + "from": "s0", + "to": "s5", + "when": "success" + }, + { + "id": "l5", + "from": "s0", + "to": "s6", + "when": "success" + }, + { + "id": "l6", + "from": "s0", + "to": "s7", + "when": "success" + }, + { + "id": "l7", + "from": "s0", + "to": "s8", + "when": "success" + }, + { + "id": "l8", + "from": "s0", + "to": "s9", + "when": "success" + }, + { + "id": "l9", + "from": "s0", + "to": "s10", + "when": "success" + }, + { + "id": "l10", + "from": "s1", + "to": "s0", + "when": "success" + }, + { + "id": "l11", + "from": "s1", + "to": "s2", + "when": "success" + }, + { + "id": "l12", + "from": "s1", + "to": "s3", + "when": "success" + }, + { + "id": "l13", + "from": "s1", + "to": "s4", + "when": "success" + }, + { + "id": "l14", + "from": "s1", + "to": "s5", + "when": "success" + }, + { + "id": "l15", + "from": "s1", + "to": "s6", + "when": "success" + }, + { + "id": "l16", + "from": "s1", + "to": "s7", + "when": "success" + }, + { + "id": "l17", + "from": "s1", + "to": "s8", + "when": "success" + }, + { + "id": "l18", + "from": "s1", + "to": "s9", + "when": "success" + }, + { + "id": "l19", + "from": "s1", + "to": "s10", + "when": "success" + }, + { + "id": "l20", + "from": "s2", + "to": "s0", + "when": "success" + }, + { + "id": "l21", + "from": "s2", + "to": "s1", + "when": "success" + }, + { + "id": "l22", + "from": "s2", + "to": "s3", + "when": "success" + }, + { + "id": "l23", + "from": "s2", + "to": "s4", + "when": "success" + }, + { + "id": "l24", + "from": "s2", + "to": "s5", + "when": "success" + }, + { + "id": "l25", + "from": "s2", + "to": "s6", + "when": "success" + }, + { + "id": "l26", + "from": "s2", + "to": "s7", + "when": "success" + }, + { + "id": "l27", + "from": "s2", + "to": "s8", + "when": "success" + }, + { + "id": "l28", + "from": "s2", + "to": "s9", + "when": "success" + }, + { + "id": "l29", + "from": "s2", + "to": "s10", + "when": "success" + }, + { + "id": "l30", + "from": "s3", + "to": "s0", + "when": "success" + }, + { + "id": "l31", + "from": "s3", + "to": "s1", + "when": "success" + }, + { + "id": "l32", + "from": "s3", + "to": "s2", + "when": "success" + }, + { + "id": "l33", + "from": "s3", + "to": "s4", + "when": "success" + }, + { + "id": "l34", + "from": "s3", + "to": "s5", + "when": "success" + }, + { + "id": "l35", + "from": "s3", + "to": "s6", + "when": "success" + }, + { + "id": "l36", + "from": "s3", + "to": "s7", + "when": "success" + }, + { + "id": "l37", + "from": "s3", + "to": "s8", + "when": "success" + }, + { + "id": "l38", + "from": "s3", + "to": "s9", + "when": "success" + }, + { + "id": "l39", + "from": "s3", + "to": "s10", + "when": "success" + }, + { + "id": "l40", + "from": "s4", + "to": "s0", + "when": "success" + }, + { + "id": "l41", + "from": "s4", + "to": "s1", + "when": "success" + }, + { + "id": "l42", + "from": "s4", + "to": "s2", + "when": "success" + }, + { + "id": "l43", + "from": "s4", + "to": "s3", + "when": "success" + }, + { + "id": "l44", + "from": "s4", + "to": "s5", + "when": "success" + }, + { + "id": "l45", + "from": "s4", + "to": "s6", + "when": "success" + }, + { + "id": "l46", + "from": "s4", + "to": "s7", + "when": "success" + }, + { + "id": "l47", + "from": "s4", + "to": "s8", + "when": "success" + }, + { + "id": "l48", + "from": "s4", + "to": "s9", + "when": "success" + }, + { + "id": "l49", + "from": "s4", + "to": "s10", + "when": "success" + }, + { + "id": "l50", + "from": "s5", + "to": "s0", + "when": "success" + }, + { + "id": "l51", + "from": "s5", + "to": "s1", + "when": "success" + }, + { + "id": "l52", + "from": "s5", + "to": "s2", + "when": "success" + }, + { + "id": "l53", + "from": "s5", + "to": "s3", + "when": "success" + }, + { + "id": "l54", + "from": "s5", + "to": "s4", + "when": "success" + }, + { + "id": "l55", + "from": "s5", + "to": "s6", + "when": "success" + }, + { + "id": "l56", + "from": "s5", + "to": "s7", + "when": "success" + }, + { + "id": "l57", + "from": "s5", + "to": "s8", + "when": "success" + }, + { + "id": "l58", + "from": "s5", + "to": "s9", + "when": "success" + }, + { + "id": "l59", + "from": "s5", + "to": "s10", + "when": "success" + }, + { + "id": "l60", + "from": "s6", + "to": "s0", + "when": "success" + }, + { + "id": "l61", + "from": "s6", + "to": "s1", + "when": "success" + }, + { + "id": "l62", + "from": "s6", + "to": "s2", + "when": "success" + }, + { + "id": "l63", + "from": "s6", + "to": "s3", + "when": "success" + }, + { + "id": "l64", + "from": "s6", + "to": "s4", + "when": "success" + }, + { + "id": "l65", + "from": "s6", + "to": "s5", + "when": "success" + }, + { + "id": "l66", + "from": "s6", + "to": "s7", + "when": "success" + }, + { + "id": "l67", + "from": "s6", + "to": "s8", + "when": "success" + }, + { + "id": "l68", + "from": "s6", + "to": "s9", + "when": "success" + }, + { + "id": "l69", + "from": "s6", + "to": "s10", + "when": "success" + }, + { + "id": "l70", + "from": "s7", + "to": "s0", + "when": "success" + }, + { + "id": "l71", + "from": "s7", + "to": "s1", + "when": "success" + }, + { + "id": "l72", + "from": "s7", + "to": "s2", + "when": "success" + }, + { + "id": "l73", + "from": "s7", + "to": "s3", + "when": "success" + }, + { + "id": "l74", + "from": "s7", + "to": "s4", + "when": "success" + }, + { + "id": "l75", + "from": "s7", + "to": "s5", + "when": "success" + }, + { + "id": "l76", + "from": "s7", + "to": "s6", + "when": "success" + }, + { + "id": "l77", + "from": "s7", + "to": "s8", + "when": "success" + }, + { + "id": "l78", + "from": "s7", + "to": "s9", + "when": "success" + }, + { + "id": "l79", + "from": "s7", + "to": "s10", + "when": "success" + }, + { + "id": "l80", + "from": "s8", + "to": "s0", + "when": "success" + }, + { + "id": "l81", + "from": "s8", + "to": "s1", + "when": "success" + }, + { + "id": "l82", + "from": "s8", + "to": "s2", + "when": "success" + }, + { + "id": "l83", + "from": "s8", + "to": "s3", + "when": "success" + }, + { + "id": "l84", + "from": "s8", + "to": "s4", + "when": "success" + }, + { + "id": "l85", + "from": "s8", + "to": "s5", + "when": "success" + }, + { + "id": "l86", + "from": "s8", + "to": "s6", + "when": "success" + }, + { + "id": "l87", + "from": "s8", + "to": "s7", + "when": "success" + }, + { + "id": "l88", + "from": "s8", + "to": "s9", + "when": "success" + }, + { + "id": "l89", + "from": "s8", + "to": "s10", + "when": "success" + }, + { + "id": "l90", + "from": "s9", + "to": "s0", + "when": "success" + }, + { + "id": "l91", + "from": "s9", + "to": "s1", + "when": "success" + }, + { + "id": "l92", + "from": "s9", + "to": "s2", + "when": "success" + }, + { + "id": "l93", + "from": "s9", + "to": "s3", + "when": "success" + }, + { + "id": "l94", + "from": "s9", + "to": "s4", + "when": "success" + }, + { + "id": "l95", + "from": "s9", + "to": "s5", + "when": "success" + }, + { + "id": "l96", + "from": "s9", + "to": "s6", + "when": "success" + }, + { + "id": "l97", + "from": "s9", + "to": "s7", + "when": "success" + }, + { + "id": "l98", + "from": "s9", + "to": "s8", + "when": "success" + }, + { + "id": "l99", + "from": "s9", + "to": "s10", + "when": "success" + }, + { + "id": "l100", + "from": "s10", + "to": "s0", + "when": "success" + }, + { + "id": "l101", + "from": "s10", + "to": "s1", + "when": "success" + }, + { + "id": "l102", + "from": "s10", + "to": "s2", + "when": "success" + }, + { + "id": "l103", + "from": "s10", + "to": "s3", + "when": "success" + }, + { + "id": "l104", + "from": "s10", + "to": "s4", + "when": "success" + }, + { + "id": "l105", + "from": "s10", + "to": "s5", + "when": "success" + }, + { + "id": "l106", + "from": "s10", + "to": "s6", + "when": "success" + }, + { + "id": "l107", + "from": "s10", + "to": "s7", + "when": "success" + }, + { + "id": "l108", + "from": "s10", + "to": "s8", + "when": "success" + } + ] + } + } + ] +}