Verweis statt Nacherzaehlung: die Engine stempelt den Ursprung (#697, #677)

- Werkzeugkontext kennt Lauf und Aufgabe des Laufs (RunId, RunTaskId); die
  Delegationskette traegt den Lauf des Aufrufers weiter (RunId, CallerRunId)
- Aufgaben tragen origin_run / origin_task (Datei, DB, Taskboard "Arose from"),
  gestempelt, nie vom Agenten behauptet
- Kommentare nennen den Lauf, in dem sie geschrieben wurden
- Laufbeleg: CallerRunId; Laufansicht fuehrt zu "Delegiert von" und "Delegiert an"
- #677: task_update ersetzt den Rumpf nicht mehr, Abnahmekriterien aendert nur der
  Ersteller; Kommentare der Fremdinhalt-Stufe auf fremden Aufgaben kommen gerahmt an
- WebUI: Herkunft auf der Aufgabenkarte mit Link zum Lauf

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 09:27:47 +02:00
co-authored by Claude Opus 5.5
parent 3f90e0d0cd
commit f812dbd856
26 changed files with 493 additions and 47 deletions
+23 -2
View File
@@ -29,7 +29,28 @@ public sealed class DelegationChain
{
private readonly string[] _agents;
private DelegationChain(string[] agents) => _agents = agents;
private DelegationChain(string[] agents, string? runId = null, string? callerRunId = null)
{
_agents = agents;
RunId = runId;
CallerRunId = callerRunId;
}
/// <summary>
/// #697: The run of the last agent in the chain — the one that is handing on. Stamped by
/// the engine when it builds a tool's context, so a delegated run can name the run it
/// came from. <c>null</c> outside a run.
/// </summary>
public string? RunId { get; }
/// <summary>
/// #697: The run of the agent before the last — the run a delegated run was started from.
/// Carried over by <see cref="Append"/>, so the new run can record its origin.
/// </summary>
public string? CallerRunId { get; }
/// <summary>#697: The same chain, stamped with the run of its last agent.</summary>
public DelegationChain WithRun(string runId) => new(_agents, runId, CallerRunId);
/// <summary>Der Anfang: ein Lauf, den niemand delegiert hat.</summary>
public static DelegationChain Root(string agentId) => new([agentId]);
@@ -49,7 +70,7 @@ public sealed class DelegationChain
/// <summary>Die Kette mit einem weiteren Agenten am Ende.</summary>
public DelegationChain Append(string agentId)
=> new([.. _agents, agentId]);
=> new([.. _agents, agentId], runId: null, callerRunId: RunId); // the new agent's run is not known yet
/// <summary>Für Meldungen und Protokoll: <c>A -> B -> C</c>.</summary>
public override string ToString() => string.Join(" -> ", _agents);