examples, docs, ergonomics and code review fixes

This commit is contained in:
lda
2026-05-25 15:48:39 +07:00 Verified
parent 7aa562c619
commit 6e3a6cac48
12 changed files with 255 additions and 33 deletions
+15
View File
@@ -281,6 +281,21 @@ def test_build_and_commit_patch_matches_apply_output_bindings() -> None:
assert state_from_apply["person"]["name"] == state_from_patch["person"]["name"]
def test_state_patch_rejects_inconsistent_trace_changes_and_writes() -> None:
with pytest.raises(ValueError, match="inconsistent changes and writes"):
StatePatch(
changes={"state.value": "trace"},
writes=[
StateWrite(
path=StatePath(("value",)),
incoming_value="actual",
visible_value="actual",
reducer=ReducerRef(name="wf.std.replace"),
)
],
)
def test_barrier_rejects_sibling_same_path_writes_without_reducer() -> None:
workflow = _workflow(fields={"value": StateField(type="string")})