Skip to content

Main content

Random Workflow Loop Budget Fixture Generator

Walk supplied transitions with an explicit per-state visit budget, retaining the first violation or terminal/step-limit stop and whole-graph cycle status.

Loading tool…

Description

Walk supplied transitions with an explicit per-state visit budget, retaining the first violation or terminal/step-limit stop and whole-graph cycle status.

A workflow or scheduling fixture makes ordering, dependencies, capacity, and timing explicit. Returning both the constructed records and their checks helps consumers distinguish a valid arrangement from a simulated failure case.

Walk supplied transitions with an explicit per-state visit budget, retaining the first violation or terminal/step-limit stop and whole-graph cycle status.

When to use this tool

Use this generator to create reproducible workflow loop budget fixture cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply states, transitions, start, visitBudget, steps in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read graphHasCycle, trace, visits, finalState, stop. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.

Count the initial state as its first visit, then randomly choose outgoing transitions up to the step limit. Record each destination’s visit count before and after the move, including the first move that exceeds visitBudget, and stop at that violation, a terminal state or the step limit.1

Delegated operations used for this result: cycle checker. Their calculation or parsing conventions apply to the corresponding result fields.2

Input fieldMeaning and unitsAccepted input
statesStatesRequired. Array of Text; minimum UTF-16 length 1; maximum UTF-16 length 128.; minimum items 1; maximum items 16.
transitionsTransitionsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 64.
transitions[].fromFromRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
transitions[].toToRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
startStartRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
visitBudgetVisit BudgetRequired. Safe integer; minimum 1; maximum 64.
stepsStepsRequired. Safe integer; minimum 1; maximum 64.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
graphHasCycleGraph Has CycleRequired. Boolean.
traceTraceRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 64.
trace[].fromFromRequired. Text; maximum UTF-16 length 65536.
trace[].toToRequired. Text; maximum UTF-16 length 65536.
trace[].visitsBeforeVisits BeforeRequired. Safe integer; minimum 0; maximum 64.
trace[].visitsAfterVisits AfterRequired. Safe integer; minimum 1; maximum 65.
trace[].violationViolationRequired. Boolean.
visitsVisitsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 16.
visits[].stateStateRequired. Text; maximum UTF-16 length 65536.
visits[].countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 0; maximum 65.
finalStateFinal StateRequired. Text; maximum UTF-16 length 65536.
stopStopRequired. Text; one of "budget", "terminal", "step-limit".
randomnessReplay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source.Required. Object; no unknown keys.
randomness.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "states": [
      "a"
    ],
    "transitions": [
      {
        "from": "a",
        "to": "a"
      }
    ],
    "start": "a",
    "visitBudget": 2,
    "steps": 5,
    "seed": 42
  },
  "output": {
    "graphHasCycle": true,
    "trace": [
      {
        "from": "a",
        "to": "a",
        "visitsBefore": 1,
        "visitsAfter": 2,
        "violation": false
      },
      {
        "from": "a",
        "to": "a",
        "visitsBefore": 2,
        "visitsAfter": 3,
        "violation": true
      }
    ],
    "visits": [
      {
        "state": "a",
        "count": 3
      }
    ],
    "finalState": "a",
    "stop": "budget",
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • graphHasCycle describes the whole supplied graph, including unreachable cycles. A budget violation is recorded rather than silently prevented; a graph cycle does not guarantee that the sampled walk encounters it.
  • A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Workflow Loop Budget Fixture Generator — tool.io

  2. Calculation or validation: graph/cycle-checker — tool.io

Similar or alternative tools