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
+15 -2
View File
@@ -252,6 +252,10 @@ class InvestigationDiagramNodeRef(_InvestigationDiagramNode):
class InvestigationGraphNodeUpdate(_InvestigationDiagramNode):
label: NonEmptyStr | None = Field(default=None, description=(
"Required for a new node. Omit or use null to retain an existing node's label. "
"Use the same node_id to revise status or detail without adding another step."
))
status: InvestigationNodeAnnotation | None = Field(default=None, description=(
"Optional reference annotation: reference, recorded finding, needs_input, failed attempt, or not_taken. "
"No live node/task binding or per-step synchronization is required."
@@ -752,7 +756,7 @@ class ScadaChartGap(StrictModel):
class ScadaChartContext(StrictModel):
role: Literal["current", "comparison"]
metric: Literal["pressure", "flow"]
metric: Literal["pressure", "flow", "quality"]
unit: Annotated[str, Field(min_length=1, max_length=128)]
window_start: WorkbenchDateTime
window_end: WorkbenchDateTime
@@ -1015,6 +1019,13 @@ class HumanEvidenceCommand(StrictModel):
evidence: EvidenceInput
class WorkOrderNotificationReference(StrictModel):
source_event_id: NonEmptyStr
source_revision: PositiveInt
evidence_id: NonEmptyStr | None = None
status: Literal["scheduled", "assigned", "in_progress", "awaiting_feedback", "completed", "cancelled", "failed"]
class OperationalTaskNotification(StrictModel):
notification_id: UUID
task_id: UUID
@@ -1022,7 +1033,7 @@ class OperationalTaskNotification(StrictModel):
"task_created", "action_pending", "report_updated", "task_completed",
"task_failed", "run_delivery_degraded", "access_approval_pending",
"action_approval_pending", "human_input_required",
"external_coordination_failed"
"external_coordination_failed", "work_order_feedback"
]
title: NonEmptyStr
description: NonEmptyStr
@@ -1031,6 +1042,8 @@ class OperationalTaskNotification(StrictModel):
subject_type: Literal["task", "run", "access_request", "action", "question"] = "task"
subject_id: UUID | None = None
report_reference: InvestigationReportReference | None = None
work_order_action: HumanApprovalAction | None = None
work_order_reference: WorkOrderNotificationReference | None = None
resolved_at: WorkbenchDateTime | None = None
resolution_reason: NonEmptyStr | None = None
status: Literal["unread", "read"]