feat(scada): add calibrated monitoring and incident recovery

This commit is contained in:
2026-11-07 19:44:58 +08:00
parent 26fa5d1909
commit ff8aba4964
109 changed files with 9165 additions and 629 deletions
+11 -3
View File
@@ -10,15 +10,23 @@ import yaml
SKILL_ROOT = Path(__file__).resolve().parents[2] / "resources" / "work-order-skills"
WORKFLOW_SKILLS = {
"scada_anomaly": "scada-anomaly",
"burst_report": "burst-report",
"burst_report": "burst-event-handling",
"water_quality_complaint": "water-quality-complaint",
"general": "appointment-follow-up",
}
def read_work_order_skill(workflow: str | None, *, include_content: bool = False) -> dict[str, Any]:
def skill_name_for_task(workflow: str | None, replay_context: dict | None = None) -> str | None:
if workflow == "burst_report" and replay_context:
return "scada-anomaly"
return WORKFLOW_SKILLS.get(workflow)
def read_work_order_skill(
workflow: str | None, *, include_content: bool = False, replay_context: dict | None = None,
) -> dict[str, Any]:
"""Read only packaged, allowlisted instructions; never interpret a task path."""
name = WORKFLOW_SKILLS.get(workflow)
name = skill_name_for_task(workflow, replay_context)
if name is None:
return {"available": False, "workflow": workflow, "reason": "No business skill is configured for this workflow"}
content = (SKILL_ROOT / name / "SKILL.md").read_text(encoding="utf-8")