From 657e536c668a59e4c04925c32b43a51138fc606a Mon Sep 17 00:00:00 2001 From: Durable Workflow Date: Sat, 3 Oct 2026 03:00:17 +0000 Subject: [PATCH] fix: admit durable history shape rejection evidence --- regression-corpus/evidence-schema.json | 2 ++ tests/test_regression_evidence_schema.py | 25 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/regression-corpus/evidence-schema.json b/regression-corpus/evidence-schema.json index 736b235..c113c54 100644 --- a/regression-corpus/evidence-schema.json +++ b/regression-corpus/evidence-schema.json @@ -251,6 +251,8 @@ "type": { "enum": [ "malformed_service_response_envelope", + "search_attribute_type_identity_mismatch", + "workflow_history_shape_mismatch", "unsupported_payload_codec" ] }, diff --git a/tests/test_regression_evidence_schema.py b/tests/test_regression_evidence_schema.py index d55c220..37bebb6 100644 --- a/tests/test_regression_evidence_schema.py +++ b/tests/test_regression_evidence_schema.py @@ -80,6 +80,31 @@ def test_success_failure_and_embedded_consumer_fixtures_validate(self) -> None: with self.subTest(name=name): self.assertValid(fixture) + def test_canonical_step_shape_rejection_can_be_retained_as_replay_evidence(self) -> None: + fixture = successful_replay_fixture() + del fixture["expected"] + fixture["history"].append({ + "sequence": 2, + "event_type": "CancellationScopeOpened", + "payload": { + "schema": "durable-workflow.cancellation-scope/v1", + "sequence": 1, + "scope_id": "scope-1", + "parent_scope_id": "root", + "shield_parent": False, + }, + }) + for failure_type in ( + "workflow_history_shape_mismatch", + "search_attribute_type_identity_mismatch", + ): + with self.subTest(failure_type=failure_type): + fixture["expected_failure"] = { + "type": failure_type, + "exception": "Workflow\\V2\\Exceptions\\HistoryEventShapeMismatchException", + } + self.assertValid(fixture) + def test_replay_requires_exactly_one_outcome_form(self) -> None: failure = checked_in_fixture("workflow-fiber-malformed-service-response.json") both = copy.deepcopy(failure)