feat(tasks): adopt canonical task statuses

This commit is contained in:
2026-05-26 01:32:50 +02:00
parent da5aee6e38
commit 38835e9e79
61 changed files with 692 additions and 342 deletions

View File

@@ -18,7 +18,7 @@ def test_all_assertions_satisfied_reports_reachable_workstations():
id="tasks.all_done",
target="tasks.*.status",
op="all_eq",
value=["done", "cancelled"],
value=["done", "cancel"],
)
],
),
@@ -26,7 +26,7 @@ def test_all_assertions_satisfied_reports_reachable_workstations():
)
result = FlowEngine().evaluate(
{"status": "active", "tasks": [{"status": "done"}, {"status": "cancelled"}]},
{"status": "active", "tasks": [{"status": "done"}, {"status": "cancel"}]},
flow,
)
@@ -47,7 +47,7 @@ def test_failing_exit_assertion_identifies_blocking_assertion():
id="tasks.all_done",
target="tasks.*.status",
op="all_eq",
value=["done", "cancelled"],
value=["done", "cancel"],
)
],
)
@@ -87,7 +87,7 @@ def test_can_reach_checks_current_exit_assertions_before_target_entry():
id="tasks.all_done",
target="tasks.*.status",
op="all_eq",
value=["done", "cancelled"],
value=["done", "cancel"],
)
],
),
@@ -144,7 +144,7 @@ def test_empty_assertions_make_all_workstations_reachable():
entity_type="task",
workstations=[
WorkstationDef(name="todo"),
WorkstationDef(name="in_progress"),
WorkstationDef(name="progress"),
WorkstationDef(name="done"),
],
)
@@ -152,7 +152,7 @@ def test_empty_assertions_make_all_workstations_reachable():
result = FlowEngine().evaluate({"status": "todo"}, flow)
assert result.exit_blocked is False
assert result.reachable == ["todo", "in_progress", "done"]
assert result.reachable == ["todo", "progress", "done"]
def test_circular_reference_in_target_path_does_not_loop_forever():
@@ -194,10 +194,10 @@ def test_yaml_flow_definitions_load_and_evaluate_representative_entities():
assert "blocked" in [item.workstation for item in workstream_result.unreachable]
task_result = FlowEngine().evaluate(
{"status": "blocked", "needs_human": False},
{"status": "wait", "needs_human": False},
flows["task"],
)
assert "in_progress" in task_result.reachable
assert "progress" in task_result.reachable
contribution_result = FlowEngine().evaluate(
{"status": "acknowledged", "previous_workstation": "acknowledged"},