Structured response contracts
Structured contracts compile into standard EDSL questions and a data-only validation contract in step metadata. The coordinator revalidates submissions, so correctness does not depend on a particular Humanize form or model adapter.ChoiceTable requires every declared row, validates cell values against the
shared option set, and can enforce monotone movement through the ordered
options. StrategyTable has the same tabular representation without implying
monotonicity and is intended for complete contingent plans.
AllocationVector requires exactly the declared targets, nonnegative numeric
allocations, and either equality with or an upper bound on the budget. All
three contract definitions have to_dict() and from_dict() representations;
compiled workflows retain the dictionaries under response_contracts.
A table answer is an ordinary mapping-valued workflow expression. Dynamic row
selection therefore uses the general get_item operator:
seeded_integer() samples both endpoints inclusively and is useful for selecting
rows, rounds, and treatment cells.
Dynamic answer bounds are enforced when an answer is submitted:
Bounded repetition
Many workflows are conceptually loops: Delphi rounds, revision cycles, negotiations, repeated games, and retry-until-accepted tasks. Use a repeat block to avoid manually defining every round:build callable is authoring sugar. It runs while constructing the
definition and is not serialized. The compiled HumanWorkflow contains a
RepeatBlock with bounds, iteration numbers, materialized step names, typed
stop conditions, and repeat metadata on each step.
This distinction is important:
- bounded iterations are materialized during authoring;
- the persisted definition contains only data;
- execution after deserialization does not need
build_round; and - future iterations are skipped when the prior stop condition succeeds.
min_iterations forces early rounds to run even if their stop conditions are
already true. max_iterations is a hard safety bound.
The current implementation is not an unbounded runtime loop. Large or
data-dependent iteration counts will eventually require runtime materialization
of a serializable subworkflow template.