feat(investigations): add event impact and work-order feedback flows

Add isolated burst and pollution impact evidence, parallel work-order workflows, persisted notifications and graph updates.

Checkpoint current code. Known follow-ups remain for large pollution result previews and graceful geometry failure.
This commit is contained in:
2026-11-14 15:14:02 +08:00
parent 471ad92a47
commit 2e4f6cb93b
49 changed files with 1826 additions and 93 deletions
+13
View File
@@ -675,6 +675,19 @@ async def test_completed_investigation_resumes_once_for_linked_new_field_feedbac
again = await service.external_feedback(task["task_id"], ExternalFeedbackCommand(request_id=uuid4(), **identity))
assert again.task.execution_generation == 2
assert len([event for event in repository.events if event["topic"] == "operational.run.queued"]) == 1
notices = [item for item in repository.notifications if item["kind"] == "work_order_feedback"]
assert len(notices) == 1
assert notices[0]["subject_id"] == str(action.action_id)
assert notices[0]["work_order_action"]["receipt"]["receipt_id"] == child_id
review_notice = next(item for item in repository.notifications if item["kind"] == "action_approval_pending")
assert review_notice["work_order_action"]["approval_status"] == "pending"
assert review_notice["work_order_action"]["receipt"] is None
assert notices[0]["work_order_reference"] == {
"source_event_id": f"peripheral_sample:{child_id}", "source_revision": 2,
"evidence_id": None, "status": "completed",
}
assert any(event["topic"] == "operational.notification.changed"
and event["metadata"].get("kind") == "work_order_feedback" for event in repository.events)
repository.task.update(status="cancelled", lifecycle_status="cancelled")
with pytest.raises(DomainError) as cancelled:
await service.external_feedback(task["task_id"], ExternalFeedbackCommand(