﻿# State-machine preconditions define which synthetic actions can be generated

A practical investigation of state-machine preconditions define which synthetic actions can be generated, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-synthetic-hypothesis-stateful-preconditions-generated-action-eligibility/
Language: en

## The generated-data scenario

A synthetic workflow corpus models opening, editing and submitting a document as state-machine actions. The generator rejects edits when no document is open, but its release report treats all absent edits as examples of action failure. An action that was never eligible for generation has no observed outcome. This investigation follows the distinction from rule selection to exported transition labels.

## The generation mechanism

Hypothesis stateful testing provides precondition predicates that determine whether a rule is eligible in the current machine instance. Documentation distinguishes this from assumptions inside a rule and describes invariants checked after steps. These mechanisms support coherent test sequences. They do not establish how often an action occurs in an operational workload or prove that every possible legal state was sampled.

## Define the dataset contract

Define the state representation, eligibility predicate, transition effect and outcome assertion independently. Retain the pre-state, selected rule, arguments, post-state and any invariant failure. Keep ineligible actions distinct from attempted actions rejected by the system under test. If deliberately invalid actions are useful for training, create an explicit invalid-action rule rather than relabeling unselected possibilities as observed failures.

## A step-by-step protocol

Prepare fixtures with no document, an open editable document and a submitted document. Inspect which rules are eligible in each state before generating a sequence. Exercise actual rules in an isolated model and check their post-state invariants. Export the transition trace with eligibility evidence. Add a control whose precondition is wrong to verify that the review detects missing or impossible coverage.

## Evidence required for acceptance

Acceptance requires each saved transition to match its declared pre-state eligibility and post-state assertions. Report reachable-state and rule coverage separately from the number of records produced. Preserve failures discovered by the test process rather than silently removing every difficult transition. A corpus of entirely valid traces can still omit important legal actions, so validity and coverage must remain distinct report fields.

## Failure cases and limits

A simplified state machine expresses the assumptions encoded by its author, not a proof of complete real workflow behavior. Preconditions can accidentally exclude valid states, and invariants can be too weak. Review those definitions against the intended task. This protocol concerns generated transition labels; it makes no claim that property-based generation reproduces human behavior, operational action probabilities or production failure rates.

## Primary references and related reading

Record rule eligibility separately from action outcomes and real-world frequency. [Hypothesis state-machine preconditions and invariants](https://hypothesis.readthedocs.io/en/latest/stateful.html); [Hypothesis stateful precondition API](https://hypothesis.readthedocs.io/en/latest/reference/api.html).

The proposed investigation of hypothesis stateful preconditions generated action eligibility is a proposed dataset-contract review; no production dataset was generated or evaluated. Related reading: [ManiSkill trajectory conversion: a new controller requires replay validation](/journal/fg2-maniskill-controller-conversion-replayed-outcome-selection/); [JSON Lines for AI data: a record boundary is not a feature schema](/journal/data-guide-jsonlines-explicit-schema/).
