Stufe 4c (#764): Kommentare in C#, WebUI-Skripten, CSS und HTML auf Englisch
Rund 2.600 Kommentarblöcke in 310 C#-Dateien übersetzt, Begründungen vollständig erhalten: blockweise gleiche Anzahl wie vorher, kein Block unter 60 % seiner Länge, der Code außerhalb der Kommentare per Tokenizer byte-identisch geprüft. Zitate deutscher Oberflächentexte und Testdaten bleiben deutsch. WebUI: Kommentare in JS/CSS/HTML übersetzt, JSDoc-@param an die in 4b umbenannten Parameter angeglichen. Dabei behoben: - 4b hatte "tag" (HTML-Tag) als deutsches "Tag" gelesen und zu "dayValue" gemacht (makeElement, svg, Tagesübersicht) - zurück auf tag/day. - Aufgaben "InProgress" bekamen die Plakettenart "laufend", für die es nie eine CSS-Klasse gab - jetzt "success" wie laufende Instanzen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
da4ceac7d5
commit
837a634a22
@@ -6,24 +6,24 @@ using Shouldly;
|
||||
namespace ClawdDotNet.Core.Tests.Engine;
|
||||
|
||||
/// <summary>
|
||||
/// Test A13 der Teststrategie — Regressionstests für B8 (#206).
|
||||
/// Test A13 of the test strategy — regression tests for B8 (#206).
|
||||
///
|
||||
/// <para><c>send_message</c> ist ein synchroner Aufruf: A hält sein Gate, während es
|
||||
/// auf B wartet. Rief B nun A, wartete B auf ein Gate, das A erst freigibt, wenn B
|
||||
/// geantwortet hat. Beide standen, bis der Timeout des äußeren Laufs sie auflöste.</para>
|
||||
/// <para><c>send_message</c> is a synchronous call: A holds its gate while it
|
||||
/// waits for B. If B then called A, B waited for a gate that A only releases once B
|
||||
/// has answered. Both stood still until the timeout of the outer run resolved it.</para>
|
||||
///
|
||||
/// <para>Die Tests prüfen die drei Zusagen aus <see cref="DelegationChain"/>: kein
|
||||
/// Agent zweimal in einer Kette, höchstens <c>MaxDelegationDepth</c> Weitergaben, und
|
||||
/// die Kette gehört zum Aufruf statt zum Agenten.</para>
|
||||
/// <para>The tests check the three promises from <see cref="DelegationChain"/>: no
|
||||
/// agent twice in a chain, at most <c>MaxDelegationDepth</c> hand-offs, and
|
||||
/// the chain belongs to the call instead of to the agent.</para>
|
||||
///
|
||||
/// <para>Ein Zeitlimit steht bewusst an jedem Test, der verklemmen könnte: Ohne die
|
||||
/// Prüfung liefe er nicht rot, sondern gar nicht mehr weiter.</para>
|
||||
/// <para>A time limit is deliberately on every test that could deadlock: without the
|
||||
/// check it would not turn red, but not continue at all.</para>
|
||||
/// </summary>
|
||||
public sealed class DelegationDepthTests
|
||||
{
|
||||
private static readonly TimeSpan Frist = TimeSpan.FromSeconds(20);
|
||||
|
||||
/// <summary>Wartet auf den Lauf, scheitert aber statt zu hängen.</summary>
|
||||
/// <summary>Waits for the run, but fails instead of hanging.</summary>
|
||||
private static async Task<AgentRunResult> MitFrist(Task<AgentRunResult> lauf)
|
||||
{
|
||||
var fertig = await Task.WhenAny(lauf, Task.Delay(Frist));
|
||||
@@ -32,7 +32,7 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// A13 — der gemeldete Fall
|
||||
// A13 — the reported case
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
@@ -41,7 +41,7 @@ public sealed class DelegationDepthTests
|
||||
var tool = new DelegatingTool(new Dictionary<string, string>
|
||||
{
|
||||
["agent-a"] = "agent-b",
|
||||
["agent-b"] = "agent-a" // zurück zu A — der Zyklus
|
||||
["agent-b"] = "agent-a" // back to A — the cycle
|
||||
});
|
||||
|
||||
var fixture = new EngineFixture().WithTool(tool);
|
||||
@@ -55,7 +55,7 @@ public sealed class DelegationDepthTests
|
||||
|
||||
result.Status.ShouldBe(AgentRunStatus.Completed);
|
||||
|
||||
// Der Rückweg B → A ist abgelehnt worden, der Hinweg A → B nicht.
|
||||
// The way back B → A was rejected, the way there A → B was not.
|
||||
var rueckweg = tool.Handoffs.Single(h => h is { From: "agent-b", To: "agent-a" });
|
||||
rueckweg.Delivered.ShouldBeFalse();
|
||||
rueckweg.Error.ShouldNotBeNull().ShouldContain("Zyklus");
|
||||
@@ -67,8 +67,8 @@ public sealed class DelegationDepthTests
|
||||
[Fact]
|
||||
public async Task Die_Ablehnung_kommt_als_Ergebnis_zurueck_nicht_als_Wurf()
|
||||
{
|
||||
// Der abgewiesene Agent soll weiterarbeiten können — er bekommt einen Grund,
|
||||
// keinen Abbruch. Sonst führte die Zyklusprüfung nur zu einem anderen Ausfall.
|
||||
// The rejected agent should be able to continue working — it gets a reason,
|
||||
// not an abort. Otherwise the cycle check would only lead to a different failure.
|
||||
var tool = new DelegatingTool(new Dictionary<string, string>
|
||||
{
|
||||
["agent-a"] = "agent-b",
|
||||
@@ -89,13 +89,13 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Die Staffel, die keinen Zyklus bildet
|
||||
// The relay that does not form a cycle
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
public async Task Eine_Staffel_endet_an_der_Tiefengrenze()
|
||||
{
|
||||
// A → B → C → D wäre die Tiefe 3. Mit MaxDelegationDepth = 2 ist bei C Schluss.
|
||||
// A → B → C → D would be depth 3. With MaxDelegationDepth = 2 it stops at C.
|
||||
var tool = new DelegatingTool(new Dictionary<string, string>
|
||||
{
|
||||
["agent-a"] = "agent-b",
|
||||
@@ -149,13 +149,13 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Die Kette gehört zum Aufruf, nicht zum Agenten
|
||||
// The chain belongs to the call, not to the agent
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
public async Task Zwei_Laeufe_nacheinander_erben_die_Kette_des_anderen_nicht()
|
||||
{
|
||||
// Sonst könnte ein Agent nach einer tiefen Kette dauerhaft „verbraucht" sein.
|
||||
// Otherwise an agent could be permanently "used up" after a deep chain.
|
||||
var tool = new DelegatingTool(new Dictionary<string, string> { ["agent-a"] = "agent-b" });
|
||||
|
||||
var fixture = new EngineFixture().WithTool(tool);
|
||||
@@ -172,7 +172,7 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// spawn zählt mit
|
||||
// spawn counts too
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
@@ -198,23 +198,23 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// #461 — was die Kette grundsätzlich nicht sehen kann
|
||||
// #461 — what the chain fundamentally cannot see
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
/// <summary>
|
||||
/// Zwei unabhängige Ketten über Kreuz: Lauf 1 startet bei A und beauftragt B, Lauf 2
|
||||
/// startet zeitgleich bei B und beauftragt A. Keine der beiden Ketten enthält den
|
||||
/// Agenten der anderen — beide sind für sich zyklusfrei, und trotzdem hält Lauf 1
|
||||
/// gate(A) und wartet auf gate(B), während Lauf 2 gate(B) hält und auf gate(A) wartet.
|
||||
/// Two independent chains crossing over: run 1 starts at A and commissions B, run 2
|
||||
/// starts at the same time at B and commissions A. Neither chain contains the
|
||||
/// other's agent — both are cycle-free on their own, and yet run 1 holds
|
||||
/// gate(A) and waits for gate(B), while run 2 holds gate(B) and waits for gate(A).
|
||||
///
|
||||
/// <para>Das kann die Delegationskette prinzipiell nicht erkennen; nur eine Frist
|
||||
/// löst es auf. Ein delegierter Lauf wartet deshalb höchstens
|
||||
/// <c>DelegationGateTimeout</c> auf ein fremdes Gate und sagt danach ab.</para>
|
||||
/// <para>The delegation chain fundamentally cannot recognize that; only a deadline
|
||||
/// resolves it. A delegated run therefore waits at most
|
||||
/// <c>DelegationGateTimeout</c> for a foreign gate and refuses afterwards.</para>
|
||||
///
|
||||
/// <para>Die Pause vor der Weitergabe ist der Kern des Aufbaus: Der Fake-Client
|
||||
/// antwortet synchron, ohne sie liefe der erste Chat vollständig durch, bevor der
|
||||
/// zweite beginnt — die Ketten könnten sich gar nicht überschneiden, und der Test
|
||||
/// wäre grün, ohne etwas zu zeigen.</para>
|
||||
/// <para>The pause before the hand-off is the core of the setup: the fake client
|
||||
/// answers synchronously; without it the first chat would run through completely before the
|
||||
/// second begins — the chains could not overlap at all, and the test
|
||||
/// would be green without showing anything.</para>
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Zwei_unabhaengige_Ketten_ueber_Kreuz_verklemmen_sich_nicht()
|
||||
@@ -241,9 +241,9 @@ public sealed class DelegationDepthTests
|
||||
|
||||
fertig.ShouldBe(beide, "Beide Laeufe warten auf das Gate des jeweils anderen (#461).");
|
||||
|
||||
// Beide äußeren Läufe kommen zu Ende. Mindestens eine Weitergabe ist an der
|
||||
// Frist gescheitert — welche, entscheidet die Reihenfolge und ist nicht
|
||||
// festgelegt; dass beide Läufe zurückkommen, schon.
|
||||
// Both outer runs come to an end. At least one hand-off failed at the
|
||||
// deadline — which one is decided by the order and is not
|
||||
// fixed; that both runs come back is.
|
||||
(await laufA).Status.ShouldBe(AgentRunStatus.Completed);
|
||||
(await laufB).Status.ShouldBe(AgentRunStatus.Completed);
|
||||
tool.Handoffs.ShouldContain(h => !h.Delivered && h.Error!.Contains("belegt"));
|
||||
@@ -252,9 +252,9 @@ public sealed class DelegationDepthTests
|
||||
[Fact]
|
||||
public async Task Ein_Chat_vom_Menschen_wartet_weiter_so_lange_es_dauert()
|
||||
{
|
||||
// Die Gegenprobe zur Frist: Sie gilt nur für delegierte Läufe. Ein zweiter
|
||||
// Chat desselben Agenten reiht sich ein und wird bedient, auch wenn der erste
|
||||
// länger braucht als die Delegationsfrist.
|
||||
// The counter-check to the deadline: it only applies to delegated runs. A second
|
||||
// chat of the same agent queues up and is served, even if the first one
|
||||
// takes longer than the delegation deadline.
|
||||
var fixture = new EngineFixture().WithTool(FakeTool.Slow(TimeSpan.FromMilliseconds(600)));
|
||||
fixture.Engine.DelegationGateTimeout = TimeSpan.FromMilliseconds(50);
|
||||
|
||||
@@ -270,7 +270,7 @@ public sealed class DelegationDepthTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Die Kette selbst
|
||||
// The chain itself
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
@@ -285,8 +285,8 @@ public sealed class DelegationDepthTests
|
||||
[Fact]
|
||||
public void Append_veraendert_die_Kette_des_Aufrufers_nicht()
|
||||
{
|
||||
// Unveränderlich: Zwei Weitergaben aus demselben Lauf dürfen sich nicht
|
||||
// gegenseitig sehen — sonst zählte die zweite die erste als Vorgänger.
|
||||
// Immutable: two hand-offs from the same run must not see
|
||||
// each other — otherwise the second would count the first as a predecessor.
|
||||
var kette = DelegationChain.Root("a");
|
||||
|
||||
var nachB = kette.Append("b");
|
||||
|
||||
Reference in New Issue
Block a user