Stufe 4c (#764): Bezeichner auf Englisch - Typen, Methoden, Felder, Parameter, Locals, Testnamen

Mit Roslyn umbenannt (Verweise folgen, Zeichenketten bleiben unberuehrt).
Nicht umbenannt, weil gespeichert oder ueber die API gebunden (Stufe 4e):
Properties, Record-Parameter, Enum-Member sowie die Parameter der
Endpunkt-Handler (Routen-/Query-Bindung ueber den Namen). Die JSON-Felder
anonymer Objekte bleiben ausdruecklich benannt (JsonFilter: pfad).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-10-04 13:18:43 +02:00
co-authored by Claude Opus 5.5
parent 837a634a22
commit 77062facc9
190 changed files with 4813 additions and 4813 deletions
@@ -43,7 +43,7 @@ public sealed class AuditRepositoryTests : IDisposable
};
[Fact]
public async Task Ein_Eintrag_wird_geschrieben_und_wiedergefunden()
public async Task An_entry_is_written_and_found_again()
{
await _repo.AppendAsync(Entry("run-1", "FileRW"), default);
@@ -55,7 +55,7 @@ public sealed class AuditRepositoryTests : IDisposable
}
[Fact]
public async Task Die_Aufrufe_eines_Laufs_kommen_in_Reihenfolge()
public async Task The_calls_of_a_run_come_in_order()
{
await _repo.AppendAsync(Entry("run-1", "Memory"), default);
await _repo.AppendAsync(Entry("run-1", "FileRW"), default);
@@ -66,7 +66,7 @@ public sealed class AuditRepositoryTests : IDisposable
}
[Fact]
public async Task Die_juengsten_Eintraege_kommen_zuerst()
public async Task The_newest_entries_come_first()
{
await _repo.AppendAsync(Entry("run-1", "erst"), default);
await _repo.AppendAsync(Entry("run-1", "zuletzt"), default);
@@ -75,7 +75,7 @@ public sealed class AuditRepositoryTests : IDisposable
}
[Fact]
public async Task Der_Status_ueberlebt_den_Rundlauf()
public async Task The_status_survives_the_round_trip()
{
await _repo.AppendAsync(Entry("r", "X", AuditStatus.Denied), default);
(await _repo.ListRecentAsync(1, default))[0].Status.ShouldBe(AuditStatus.Denied);
@@ -84,7 +84,7 @@ public sealed class AuditRepositoryTests : IDisposable
// ─── Receipts ───
[Fact]
public async Task Ein_Receipt_verknuepft_Lauf_und_Task()
public async Task A_receipt_links_run_and_task()
{
await _repo.RecordReceiptAsync(new RunReceipt
{
@@ -117,7 +117,7 @@ public sealed class AuditRepositoryTests : IDisposable
}
[Fact]
public async Task Eintraege_ueberdauern_das_Schliessen_der_Datenbank()
public async Task Entries_outlast_closing_the_database()
{
await _repo.AppendAsync(Entry("run-1", "FileRW"), default);
@@ -21,7 +21,7 @@ namespace ClawdDotNet.Core.Tests.Audit;
public sealed class EngineAuditTests
{
[Fact]
public async Task Jeder_Tool_Aufruf_landet_im_Audit_Log()
public async Task Every_tool_call_ends_up_in_the_audit_log()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -50,7 +50,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Die_Herkunft_wird_von_der_Engine_gestempelt()
public async Task The_origin_is_stamped_by_the_engine()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -67,7 +67,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Ein_verweigerter_Aufruf_wird_als_denied_protokolliert()
public async Task A_refused_call_is_logged_as_denied()
{
var audit = new InMemoryAuditRepository();
// Tool is registered but NOT assigned to the agent → PermissionGate applies.
@@ -81,7 +81,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Ein_Tool_Fehler_wird_als_error_protokolliert()
public async Task A_tool_error_is_logged_as_error()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit)
@@ -97,7 +97,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Ein_Lauf_bekommt_einen_Receipt_mit_Task_Verknuepfung()
public async Task A_run_gets_a_receipt_linked_to_the_task()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -116,7 +116,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Receipt_und_Audit_teilen_dieselbe_RunId()
public async Task Receipt_and_audit_share_the_same_RunId()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -130,7 +130,7 @@ public sealed class EngineAuditTests
}
[Fact]
public async Task Ohne_Audit_Repository_laeuft_alles_normal_weiter()
public async Task Without_audit_repository_everything_keeps_running_normally()
{
// Counter-check: A3 is optional — the engine must not run differently without an audit repo.
var fixture = new EngineFixture().WithTool(FakeTool.Returning("ok"));
@@ -8,12 +8,12 @@ namespace ClawdDotNet.Core.Tests.Audit;
/// <summary>
/// Recovery after a hard crash (#554) and the evaluation of the log (#556).
/// </summary>
public class WiederaufnahmeTests
public class RecoveryTests
{
// ─────────────── The "started" entry ───────────────
[Fact]
public async Task Vor_dem_Werkzeug_steht_ein_Eintrag_im_Protokoll()
public async Task Before_the_tool_there_is_an_entry_in_the_log()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -25,16 +25,16 @@ public class WiederaufnahmeTests
await fixture.Engine.RunAsync(agent, "Los", "inst", CancellationToken.None);
var eintraege = audit.Entries.Where(e => e.CallId == "c1").ToList();
var entries = audit.Entries.Where(e => e.CallId == "c1").ToList();
// Exactly two: first the start, then the completion — in this order.
Assert.Equal(2, eintraege.Count);
Assert.Equal(AuditStatus.Started, eintraege[0].Status);
Assert.Equal(AuditStatus.Ok, eintraege[1].Status);
Assert.Equal(2, entries.Count);
Assert.Equal(AuditStatus.Started, entries[0].Status);
Assert.Equal(AuditStatus.Ok, entries[1].Status);
}
[Fact]
public async Task Ein_abgeschlossener_Aufruf_gilt_nicht_als_offen()
public async Task A_completed_call_does_not_count_as_open()
{
var audit = new InMemoryAuditRepository();
var fixture = new EngineFixture(audit).WithTool(FakeTool.Returning("ok"));
@@ -50,7 +50,7 @@ public class WiederaufnahmeTests
}
[Fact]
public async Task Ein_Abbruch_laesst_den_Aufruf_nicht_offen_stehen()
public async Task An_abort_does_not_leave_the_call_open()
{
// Otherwise every ordinary user cancellation would look like a crash at the next start
// — and nobody would look any more.
@@ -63,19 +63,19 @@ public class WiederaufnahmeTests
.RespondsWithToolCall("LangsamTool", id: "c1")
.AlwaysRespondsWithText("Fertig.");
var lauf = fixture.Engine.ChatAsync(agent, "Los", "inst", CancellationToken.None);
var run = fixture.Engine.ChatAsync(agent, "Los", "inst", CancellationToken.None);
await Task.Delay(300);
fixture.Engine.AbortChat("a1");
await lauf;
await run;
Assert.Empty(await audit.ListOpenCallsAsync(CancellationToken.None));
var letzter = audit.Entries.Last(e => e.CallId == "c1");
Assert.Equal(AuditStatus.Cancelled, letzter.Status);
var last = audit.Entries.Last(e => e.CallId == "c1");
Assert.Equal(AuditStatus.Cancelled, last.Status);
}
[Fact]
public async Task Ein_Aufruf_ohne_Abschluss_wird_als_offen_gefunden()
public async Task A_call_without_completion_is_found_as_open()
{
// Simulates the hard crash: the start is in the log, nothing more.
var audit = new InMemoryAuditRepository();
@@ -86,14 +86,14 @@ public class WiederaufnahmeTests
Status = AuditStatus.Started, OccurredAt = DateTime.Now
}, CancellationToken.None);
var offen = await audit.ListOpenCallsAsync(CancellationToken.None);
var open = await audit.ListOpenCallsAsync(CancellationToken.None);
Assert.Single(offen);
Assert.Equal("Mail", offen[0].Tool);
Assert.Single(open);
Assert.Equal("Mail", open[0].Tool);
}
[Fact]
public async Task Alteintraege_ohne_CallId_gelten_nicht_als_offen()
public async Task Legacy_entries_without_CallId_do_not_count_as_open()
{
// Otherwise the first start after the update would present the whole old log
// for review.
@@ -110,11 +110,11 @@ public class WiederaufnahmeTests
// ─────────────── The classification ───────────────
[Fact]
public async Task Ein_wiederholbares_Werkzeug_braucht_keine_Entscheidung()
public async Task A_repeatable_tool_needs_no_decision()
{
var audit = new InMemoryAuditRepository();
var registry = new ToolRegistry();
registry.Register(new WiederholbaresTool());
registry.Register(new RepeatableTool());
await audit.AppendAsync(new AuditEntry
{
@@ -123,15 +123,15 @@ public class WiederaufnahmeTests
}, CancellationToken.None);
var recovery = new CrashRecovery(audit, registry, TestLogging.Factory);
var faelle = await recovery.SichtenAsync(CancellationToken.None);
var cases = await recovery.ReviewAsync(CancellationToken.None);
Assert.Single(faelle);
Assert.Equal(RecoveryVerdict.Repeatable, faelle[0].Verdict);
Assert.True(faelle[0].Erledigt);
Assert.Single(cases);
Assert.Equal(RecoveryVerdict.Repeatable, cases[0].Verdict);
Assert.True(cases[0].Erledigt);
}
[Fact]
public async Task Ein_nicht_wiederholbares_Werkzeug_wird_vorgelegt()
public async Task A_non_repeatable_tool_is_submitted()
{
var audit = new InMemoryAuditRepository();
var registry = new ToolRegistry();
@@ -144,14 +144,14 @@ public class WiederaufnahmeTests
}, CancellationToken.None);
var recovery = new CrashRecovery(audit, registry, TestLogging.Factory);
var faelle = await recovery.SichtenAsync(CancellationToken.None);
var cases = await recovery.ReviewAsync(CancellationToken.None);
Assert.Equal(RecoveryVerdict.NeedsReview, faelle[0].Verdict);
Assert.False(faelle[0].Erledigt);
Assert.Equal(RecoveryVerdict.NeedsReview, cases[0].Verdict);
Assert.False(cases[0].Erledigt);
}
[Fact]
public async Task Ein_verschwundenes_Werkzeug_wird_als_solches_gemeldet()
public async Task A_vanished_tool_is_reported_as_such()
{
var audit = new InMemoryAuditRepository();
await audit.AppendAsync(new AuditEntry
@@ -161,32 +161,32 @@ public class WiederaufnahmeTests
}, CancellationToken.None);
var recovery = new CrashRecovery(audit, new ToolRegistry(), TestLogging.Factory);
var faelle = await recovery.SichtenAsync(CancellationToken.None);
var cases = await recovery.ReviewAsync(CancellationToken.None);
Assert.Equal(RecoveryVerdict.ToolUnknown, faelle[0].Verdict);
Assert.False(faelle[0].Erledigt);
Assert.Equal(RecoveryVerdict.ToolUnknown, cases[0].Verdict);
Assert.False(cases[0].Erledigt);
}
[Fact]
public async Task Nach_geordnetem_Ende_ist_nichts_zu_sichten()
public async Task After_an_orderly_end_there_is_nothing_to_review()
{
var recovery = new CrashRecovery(
new InMemoryAuditRepository(), new ToolRegistry(), TestLogging.Factory);
Assert.Empty(await recovery.SichtenAsync(CancellationToken.None));
Assert.Empty(await recovery.ReviewAsync(CancellationToken.None));
}
// ─────────────── The evaluation (#556) ───────────────
[Fact]
public async Task Die_Kennzahlen_zaehlen_nur_abgeschlossene_Aufrufe()
public async Task The_metrics_count_only_completed_calls()
{
var audit = new InMemoryAuditRepository();
var jetzt = DateTime.Now;
var now = DateTime.Now;
// Two complete calls of 100 ms each, one of them failed,
// plus a third that never ended.
foreach (var (call, status, dauer) in new[]
foreach (var (call, status, duration) in new[]
{
("c1", AuditStatus.Ok, 100L),
("c2", AuditStatus.Error, 100L),
@@ -195,20 +195,20 @@ public class WiederaufnahmeTests
await audit.AppendAsync(new AuditEntry
{
CallId = call, AgentId = "a1", Tool = "T", Status = AuditStatus.Started,
DurationMs = 0, OccurredAt = jetzt
DurationMs = 0, OccurredAt = now
}, CancellationToken.None);
await audit.AppendAsync(new AuditEntry
{
CallId = call, AgentId = "a1", Tool = "T", Status = status,
DurationMs = dauer, OccurredAt = jetzt
DurationMs = duration, OccurredAt = now
}, CancellationToken.None);
}
await audit.AppendAsync(new AuditEntry
{
CallId = "c3", AgentId = "a1", Tool = "T", Status = AuditStatus.Started,
DurationMs = 0, OccurredAt = jetzt
DurationMs = 0, OccurredAt = now
}, CancellationToken.None);
var stats = await audit.SummarizeToolUsageAsync("a1", null, CancellationToken.None);
@@ -226,7 +226,7 @@ public class WiederaufnahmeTests
}
[Fact]
public async Task Die_Abfrage_je_Agent_trennt_die_Agenten()
public async Task The_per_agent_query_separates_the_agents()
{
var audit = new InMemoryAuditRepository();
@@ -239,15 +239,15 @@ public class WiederaufnahmeTests
}, CancellationToken.None);
}
var fuerA1 = await audit.ListForAgentAsync("a1", null, 100, CancellationToken.None);
var forA1 = await audit.ListForAgentAsync("a1", null, 100, CancellationToken.None);
Assert.Equal(2, fuerA1.Count);
Assert.All(fuerA1, e => Assert.Equal("a1", e.AgentId));
Assert.Equal(2, forA1.Count);
Assert.All(forA1, e => Assert.Equal("a1", e.AgentId));
}
}
/// <summary>A tool that declares itself repeatable.</summary>
internal sealed class WiederholbaresTool : IAgentTool
internal sealed class RepeatableTool : IAgentTool
{
public string Name => "Abruf";
public string Description => "Liest nur.";