Eskalation, Konflikt und Beschluss als eigene Vorgaenge (#689, Stufe 1+2)

- Cases/Decisions in der Instanz-DB; CaseDesk fuehrt die Regeln, der Brett-Task traegt
  den Vorgang zum jeweiligen Halter
- Eskalation nur nach oben, eine Ebene je Schritt; die Leitung entscheidet (mit Begruendung,
  bindet ihren Bereich), erledigt selbst oder reicht mit Einschaetzung weiter
- Erst nachsehen: bindende Beschluesse werden vor dem Eskalieren gezeigt; dieselbe Frage
  aus derselben Einheit schliesst sich dem offenen Vorgang an
- Tagesdeckel je Einheit; nach der Frist wird ein Mensch gerufen (Anschluss fuer #644)
- Konflikt: zuerst die Gegenseite, dann Zustellung an die niedrigste gemeinsame Leitung;
  Ebenen dazwischen vermerkt, nicht befragt
- Fremdinhalt-Stufe (#715): Eskalation ohne eigenen Text, kein Konflikt mit Position
- Jede Ebene haengt an (#697), beim Halter gerahmt als Daten
- Escalation ist ein implizites Werkzeug jedes Agenten; Briefing nennt den Weg
- Scanner behaelt einen im Lauf gesetzten Status blockiert/abgebrochen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 09:46:20 +02:00
co-authored by Claude Opus 5.5
parent c03664cf29
commit 36fe1ad2aa
19 changed files with 1878 additions and 7 deletions
@@ -25,7 +25,7 @@ public static class OrgBriefing
private const int MaxDescription = 120;
public static string? For(OrgChart org, string agentId, DateTime nowUtc, AgentTrust? trust = null)
public static string? For(OrgChart org, string agentId, DateTime nowUtc, AgentTrust? trust = null, bool canEscalate = false)
{
if (!org.HasUnits || org.Agent(agentId) is not { } agent)
return null;
@@ -101,6 +101,8 @@ public static class OrgBriefing
AppendWorkspaces(sb, org, agentId);
AppendWayUp(sb, lead, trust ?? AgentTrust.Standard);
if (canEscalate)
AppendCases(sb, lead, org.LedBy(agentId) is not null);
sb.Append("Agents not named here cannot be reached from your position — go through your lead.");
return sb.ToString();
@@ -124,6 +126,20 @@ public static class OrgBriefing
"on your lead's tasks, but not change them, and nothing goes past your lead.");
}
/// <summary>
/// #689: Escalation, conflict and decision — so the agent knows the way before it is stuck.
/// </summary>
private static void AppendCases(StringBuilder sb, AgentConfig? lead, bool leads)
{
sb.AppendLine("When you cannot get on and it is not yours to decide, escalate with the Escalation tool — it goes to " +
(lead is null ? "a human" : $"your lead {lead.AgentId}") +
". It first shows decisions that already answer the question: they bind you. Do not guess instead of asking.");
if (leads)
sb.AppendLine("As a lead you receive escalations and conflicts from below: decide them (with reasons — the decision binds your area), " +
"handle them yourself, or pass an escalation on to your own lead. Never send a case back down unresolved. " +
"If you disagree with a lead beside you, open a conflict — it goes to the lowest place above both of you.");
}
/// <summary>
/// #684: The shared workspaces the agent may use. FileRW's own description cannot name
/// them — it is the same for every agent — so they are listed here, where the agent's