Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

chore(i18n): translate committed German to English in tests/contract event+harness+mock_brain tests

Ruben Lütke8043216d9056
diff --git a/tests/contract/test_event_serializer.py b/tests/contract/test_event_serializer.py
index b3417413fa..7ced90450f 100644
--- a/tests/contract/test_event_serializer.py
+++ b/tests/contract/test_event_serializer.py
@@ -1,10 +1,10 @@
-"""Contract-Test: event_to_ws_envelope muss JEDES Event in `core.events`
-verlustfrei serialisieren können.
+"""Contract test: event_to_ws_envelope must serialize EVERY event in
+`core.events` losslessly.
-**Hintergrund:** Das Wire-Format zwischen Backend und Frontend hängt daran,
-dass jedes Event in der Codebase durch den Serializer läuft. Wenn jemand
-ein neues Event mit einem nicht-JSON-fähigen Feld-Typ hinzufügt, muss dieser
-Test rot werden — sonst crashed die UI zur Laufzeit.
+**Background:** the wire format between backend and frontend depends on
+every event in the codebase passing through the serializer. If someone
+adds a new event with a non-JSON-able field type, this test must go
+red — otherwise the UI crashes at runtime.
"""
from __future__ import annotations
@@ -44,12 +44,12 @@ _REQUIRED_KWARGS: dict[str, dict] = {
@pytest.mark.parametrize("event_cls", EVENT_CLASSES, ids=[c.__name__ for c in EVENT_CLASSES])
def test_event_serializes_to_json(event_cls: type[Event]) -> None:
- """Instanziert Event mit Defaults und serialisiert zu JSON."""
+ """Instantiates the event with defaults and serializes it to JSON."""
kwargs = _REQUIRED_KWARGS.get(event_cls.__name__, {})
event = event_cls(**kwargs)
envelope = event_to_ws_envelope(event)
- # JSON-roundtrip muss klappen
+ # JSON round-trip must work
raw = json.dumps(envelope)
decoded = json.loads(raw)
@@ -57,14 +57,14 @@ def test_event_serializes_to_json(event_cls: type[Event]) -> None:
assert decoded["type"] == "event"
assert decoded["event_name"] == event_cls.__name__
assert isinstance(decoded["trace_id"], str)
- # trace_id muss parseable UUID sein
+ # trace_id must be a parseable UUID
UUID(decoded["trace_id"])
assert isinstance(decoded["timestamp_ns"], int)
assert "payload" in decoded
def test_system_state_changed_payload_roundtrip() -> None:
- """Payload-Feldmapping für den am häufigsten gesendeten Event-Typ."""
+ """Payload field mapping for the most frequently sent event type."""
from jarvis.core.events import SystemStateChanged
evt = SystemStateChanged(
diff --git a/tests/contract/test_harness_protocol.py b/tests/contract/test_harness_protocol.py
index 5426569205..33a7a253d4 100644
--- a/tests/contract/test_harness_protocol.py
+++ b/tests/contract/test_harness_protocol.py
@@ -1,4 +1,4 @@
-"""Contract-Tests: alle registrierten Harness-Plugins erfüllen das Protocol."""
+"""Contract tests: every registered harness plugin satisfies the protocol."""
from __future__ import annotations
import inspect
diff --git a/tests/contract/test_mock_brain.py b/tests/contract/test_mock_brain.py
index 02784d96f6..0e59fc991f 100644
--- a/tests/contract/test_mock_brain.py
+++ b/tests/contract/test_mock_brain.py
@@ -1,8 +1,8 @@
-"""Contract-Test: MockBrain reagiert auf MessageSent und triggert State-Flow.
+"""Contract test: MockBrain reacts to MessageSent and triggers the state flow.
-E2E-mini: User-Message → Bus → Mock-Brain → Response + State-Transitions.
-Verifiziert, dass das Event-Wiring in `DesktopApp._run_backend` stehen kann,
-ohne dass wir den echten WebServer starten müssen.
+E2E-mini: user message → bus → mock brain → response + state transitions.
+Verifies that the event wiring can stand in for `DesktopApp._run_backend`
+without us having to start the real WebServer.
"""
from __future__ import annotations
@@ -38,13 +38,13 @@ async def test_mock_brain_produces_assistant_message_and_state_sequence() -> Non
await brain.respond(thread_id="t1", text="Hallo Jarvis", store=store)
- # Es muss mindestens ein SystemStateChanged-Paar geben (THINKING, SPEAKING, IDLE)
+ # There must be at least one SystemStateChanged pair (THINKING, SPEAKING, IDLE)
states = [e.new_state for e in collected if isinstance(e, SystemStateChanged)]
assert "THINKING" in states
assert "SPEAKING" in states
assert states[-1] == "IDLE"
- # Eine ResponseGenerated muss drin sein
+ # A ResponseGenerated must be in there
assert any(isinstance(e, ResponseGenerated) for e in collected)
# Store hat genau einen User-Turn + einen Assistant-Turn
@@ -65,19 +65,19 @@ async def test_message_sent_event_triggers_brain_via_subscribe() -> None:
async def _on_msg(evt: MessageSent) -> None:
if evt.role != "user":
return
- # Skip echoes aus dem ChatStore selbst — sonst Loop.
+ # Skip echoes from the ChatStore itself — otherwise a loop.
if evt.source_layer in ("chat", "brain:mock"):
return
await brain.respond(thread_id=evt.thread_id or "default", text=evt.text, store=store)
bus.subscribe(MessageSent, _on_msg)
- # User-Message reinfahren — das ist was routes_ws macht
+ # Feed in a user message — that's what routes_ws does
await bus.publish(
MessageSent(source_layer="ui.web.ws", thread_id="t1", role="user", text="echo hallo")
)
- # Kurze Pause damit die Event-Chain durchrieselt
+ # Brief pause so the event chain trickles through
await asyncio.sleep(0.6)
thread = store.get_thread("t1")