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
@@ -166,6 +166,19 @@ async def read_calculation_job(scope, binding, tool, args) -> QueryResult:
raise HTTPException(422, "offset requires a collection data_path")
else:
result.data = value
if not args.data_path and binding.task_id:
from app.mcp.presentation_preview import saved_burst_result_preview, saved_presentation_preview
presentation = saved_presentation_preview(result)
if presentation is not None and isinstance(result.data, dict):
result.data = {**result.data, "presentation": presentation}
if len(result.model_dump_json().encode()) > 11000:
preview = saved_burst_result_preview(result, str(binding.task_id))
if preview is not None:
result.data = preview
result.truncated = True
result.data_gaps = [*result.data_gaps,
"Inline burst impact summary only; full node comparisons and geometry are saved in task evidence. Read the evidence resource or select a narrower data_path."]
if len(result.model_dump_json().encode()) > 11000:
raise HTTPException(413, "Select a narrower data_path or smaller result page")
return result