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
@@ -9,7 +9,7 @@ namespace ClawdDotNet.Core.Tests.Engine;
|
||||
public sealed class PromptCacheTests
|
||||
{
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Aktivierung
|
||||
// Activation
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Theory]
|
||||
@@ -26,7 +26,7 @@ public sealed class PromptCacheTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Platzierung der Breakpoints
|
||||
// Placement of the breakpoints
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
[Fact]
|
||||
@@ -54,7 +54,7 @@ public sealed class PromptCacheTests
|
||||
[Fact]
|
||||
public void Eine_AssistantNachricht_ohne_Inhalt_traegt_keinen_Breakpoint()
|
||||
{
|
||||
// assistant mit tool_calls hat keinen Textinhalt und kann keinen Block tragen.
|
||||
// assistant with tool_calls has no text content and cannot carry a block.
|
||||
var messages = Conversation.Start().User("A").Build();
|
||||
messages.Add(ChatMessage.AssistantWithToolCalls([
|
||||
new ToolCall { Id = "c1", Function = new ToolCallFunction { Name = "T", Arguments = "{}" } }
|
||||
@@ -69,7 +69,7 @@ public sealed class PromptCacheTests
|
||||
[Fact]
|
||||
public void Es_werden_hoechstens_zwei_Breakpoints_gesetzt()
|
||||
{
|
||||
// Anbieter erlauben nur eine begrenzte Zahl — sie dürfen sich nicht ansammeln.
|
||||
// Providers only allow a limited number — they must not accumulate.
|
||||
var messages = Conversation.Start().Repeat(10).Build();
|
||||
|
||||
PromptCache.ApplyBreakpoints(messages);
|
||||
@@ -101,14 +101,14 @@ public sealed class PromptCacheTests
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Präfix-Stabilität — der entscheidende Test
|
||||
// Prefix stability — the decisive test
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
/// <summary>
|
||||
/// Der gecachte Prompt-Abschnitt muss zwischen zwei Schritten zeichengenau identisch
|
||||
/// sein. Ein einziger Zeitstempel im System-Prompt würde den Cache bei jedem Schritt
|
||||
/// verwerfen — die Kosten blieben unverändert, ohne dass es irgendwo auffiele.
|
||||
/// Genau davor schützt dieser Test.
|
||||
/// The cached prompt section must be identical to the character between two
|
||||
/// steps. A single timestamp in the system prompt would discard the cache at every step
|
||||
/// — the costs would stay unchanged without it being noticed anywhere.
|
||||
/// That is exactly what this test protects against.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Der_Praefix_bleibt_ueber_alle_Schritte_zeichengleich()
|
||||
@@ -118,7 +118,7 @@ public sealed class PromptCacheTests
|
||||
agent.Model = "anthropic/claude-sonnet-4-5";
|
||||
agent.PromptCaching = "on";
|
||||
|
||||
// Acht Tool-Schritte, dann eine Textantwort.
|
||||
// Eight tool steps, then a text answer.
|
||||
for (var i = 0; i < 8; i++)
|
||||
fixture.Client.RespondsWithToolCall("TestTool");
|
||||
fixture.Client.RespondsWithText("Fertig");
|
||||
@@ -127,8 +127,8 @@ public sealed class PromptCacheTests
|
||||
|
||||
fixture.Client.ReceivedRequests.Count.ShouldBe(9);
|
||||
|
||||
// Die system-Nachricht ist der stabile Präfix — sie muss in jedem Request
|
||||
// byte-identisch serialisiert werden.
|
||||
// The system message is the stable prefix — it must be serialized
|
||||
// byte-identically in every request.
|
||||
var systemPayloads = fixture.Client.ReceivedRequests
|
||||
.Select(r => JsonSerializer.Serialize(r.Messages[0]))
|
||||
.Distinct()
|
||||
@@ -147,7 +147,7 @@ public sealed class PromptCacheTests
|
||||
var fixture = new EngineFixture().WithTool(FakeTool.Returning("ok"));
|
||||
var agent = fixture.AddAgent("agent-nocache", "TestTool");
|
||||
agent.Model = "openai/gpt-4o";
|
||||
agent.PromptCaching = "auto"; // bei diesem Modell also aus
|
||||
agent.PromptCaching = "auto"; // so off for this model
|
||||
|
||||
fixture.Client.RespondsWithText("Fertig");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user