feat(release): publish minimal self-contained Magent source

This commit is contained in:
Magent release tooling
2026-09-19 16:58:12 +12:00
commit 5fa5d45535
272 changed files with 79305 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
from ..models import NormalizedState, TriageRecommendation, TriageResult, Snapshot
def triage_snapshot(snapshot: Snapshot) -> TriageResult:
recommendations = []
root_cause = "unknown"
summary = "No clear blocker detected yet."
confidence = 0.2
if snapshot.state == NormalizedState.requested:
root_cause = "approval"
summary = "The request is waiting for approval in Seerr."
recommendations.append(
TriageRecommendation(
action_id="wait_for_approval",
title="Ask an admin to approve the request",
reason="Seerr has not marked this request as approved.",
risk="low",
)
)
confidence = 0.6
if snapshot.state == NormalizedState.needs_add:
root_cause = "not_added"
summary = "The request is approved but not added to Sonarr/Radarr yet."
recommendations.append(
TriageRecommendation(
action_id="readd_to_arr",
title="Push to Sonarr/Radarr",
reason="Sonarr/Radarr has not created the entry for this request.",
risk="medium",
)
)
confidence = 0.7
if snapshot.state == NormalizedState.added_to_arr:
root_cause = "search"
summary = "The item is in Sonarr/Radarr but has not been downloaded yet."
recommendations.append(
TriageRecommendation(
action_id="search",
title="Re-run search",
reason="A fresh search can locate new releases.",
risk="low",
)
)
confidence = 0.55
if not recommendations:
recommendations.append(
TriageRecommendation(
action_id="diagnostics",
title="Generate diagnostics bundle",
reason="Collect service status and recent errors for review.",
risk="low",
)
)
return TriageResult(
summary=summary,
confidence=confidence,
root_cause=root_cause,
recommendations=recommendations,
)