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 jarvis/vision + jarvis/voice (batch 11_3_jarvis part 1)

Ruben Lütkecab02a54873d
diff --git a/jarvis/voice/action_phrases.py b/jarvis/voice/action_phrases.py
index 4ac0d4e060..d807c3fd6a 100644
--- a/jarvis/voice/action_phrases.py
+++ b/jarvis/voice/action_phrases.py
@@ -303,7 +303,7 @@ _CU_REASON_PREFIX_RE = re.compile(
#: anti-oscillation / toggle guards, or the latency "mission profile" summary —
#: NOT the model's human ``fail`` reason. It must never be forwarded into a
#: spoken/displayed readback. Live bug 2026-06-20 (Angela-Merkel x.com mission):
-#: the user heard "Das am Bildschirm hat nicht geklappt: 3 identical screenshots # i18n-allow
+#: the user heard "Das am Bildschirm hat nicht geklappt: 3 identical screenshots # i18n-allow # i18n-allow
#: in a row at step 9 -- the click ..." followed by the raw
#: "[cu] mission profile: steps=9 ..." telemetry line. The exit-code phrases
#: (``cu_exit_*``) exist precisely so these cases degrade to a plain sentence.
@@ -326,7 +326,7 @@ _CU_DIAGNOSTIC_RE = re.compile(
#: verbatim. Live bug 2026-06-21 (Melbourne HTML turn): a "look at my screen and
#: tell me which app is open" mission read out the full structural dump, INCLUDING
#: the verbatim content of an unrelated parallel Claude-Code AskUserQuestion box
-#: ("Eine Detail-Erkenntnis ... Der Melbourne-Guide rendert ..."). A genuine # i18n-allow
+#: ("Eine Detail-Erkenntnis ... Der Melbourne-Guide rendert ..."). A genuine # i18n-allow # i18n-allow
#: content answer ("the browser is open showing tab 'Gmail'", "newest messages:
#: Alice 'hi'") carries none of these structural markers and is still forwarded.
_CU_VERIFIER_DUMP_RE = re.compile(
diff --git a/jarvis/voice/echo_confirmation.py b/jarvis/voice/echo_confirmation.py
index 9aebf99aa8..c8a23fc42f 100644
--- a/jarvis/voice/echo_confirmation.py
+++ b/jarvis/voice/echo_confirmation.py
@@ -1,17 +1,17 @@
-"""End-Focus-Templater + deterministischer Yes/No-Klassifikator (Phase 7.4).
+"""End-focus templater + deterministic yes/no classifier (Phase 7.4).
-Plan-§7.4 Echo-Frage-Templates (DE+EN), End-Focus-Prinzip: der NEUE WERT
-steht in den letzten Tokens des Satzes, damit STT-Misshears beim User
-sofort auffallen.
+Plan-§7.4 echo-question templates (DE+EN), end-focus principle: the NEW
+VALUE sits in the last tokens of the sentence, so STT mis-hears jump out to
+the user immediately.
-Defense-in-Depth gegen TTS-Secret-Leak (Plan-§AP-2):
-Sensitive Pfade (FORBIDDEN_PATTERNS oder `MutableSpec.sensitive=True`)
-verschweigen den Wert komplett — der Echo-Satz endet bei „auf einen
-neuen Wert. Bestätigen?" statt den Klartext zu sprechen.
+Defense-in-depth against a TTS secret leak (Plan-§AP-2):
+sensitive paths (FORBIDDEN_PATTERNS or `MutableSpec.sensitive=True`)
+withhold the value entirely — the echo sentence ends with "a
+new value. Confirm?" instead of speaking the plain-text value.
-Pattern-Match-Klassifikator (Plan-§AP-12): kein LLM-Call. Veto hat
-Priorität vor Confirm (Sicherheits-Bias). Mehrdeutiges (`vielleicht`,
-`warte`) bleibt `ambiguous` — die State-Machine wartet bis Timeout.
+Pattern-match classifier (Plan-§AP-12): no LLM call. Veto takes
+priority over confirm (safety bias). Ambiguous input (hedging words
+like "maybe", "wait") stays `ambiguous` — the state machine waits until timeout.
"""
from __future__ import annotations
@@ -27,15 +27,15 @@ from jarvis.core.self_mod.errors import (
)
# ----------------------------------------------------------------------
-# Pattern-Lists
+# Pattern lists
# ----------------------------------------------------------------------
-# Plan-§7.4 + Prompt-Erweiterung. Veto wird als Wort-Grenze-regex
-# geprüft, damit „nichtig" (Zustimmung in Süddeutsch — selten) nicht
-# fälschlich als Veto greift. Das `nicht`-Pattern ist absichtlich strikt.
+# Plan-§7.4 + prompt extension. Veto is checked via a word-boundary
+# regex, so that "nichtig" (an affirmative in southern German dialect — rare) doesn't # i18n-allow
+# falsely trigger as a veto. The `nicht` pattern is deliberately strict.
_CONFIRM_PATTERNS_DE: tuple[str, ...] = (
r"\bja\b",
- r"\bbest(ä|ae)tig(e|en|t)?\b",
+ r"\bbest(ä|ae)tig(e|en|t)?\b", # i18n-allow
r"\bmach\b",
r"\bmach('s| es)\b",
r"\blos\b",
@@ -65,7 +65,7 @@ _VETO_PATTERNS_DE: tuple[str, ...] = (
r"\bstop+\b",
r"\babbruch\b",
r"\bnicht\b",
- r"\bdoch nicht\b",
+ r"\bdoch nicht\b", # i18n-allow
r"\blass\b",
r"\blass das\b",
r"\bfalsch\b",
@@ -84,8 +84,8 @@ _AMBIGUOUS_PATTERNS_DE: tuple[str, ...] = (
r"\bvielleicht\b",
r"\bwarte\b",
r"\bmoment\b",
- r"\b(öh|öhm|äh|ähm|ehm|hmm|hm)\b",
- r"\bwei(ß|ss) (ich )?nicht\b",
+ r"\b(öh|öhm|äh|ähm|ehm|hmm|hm)\b", # i18n-allow
+ r"\bwei(ß|ss) (ich )?nicht\b", # i18n-allow
r"\bunklar\b",
)
@@ -145,11 +145,11 @@ ResponseVerdict = Literal["confirm", "veto", "ambiguous", "unknown"]
def classify_response(transcript: str, *, language: str = "de") -> ResponseVerdict:
- """Klassifiziert die User-Antwort deterministisch (kein LLM-Call).
+ """Deterministically classifies the user's answer (no LLM call).
- Reihenfolge: Veto > Confirm > Ambiguous > Unknown.
- Veto-Priorität ist eine **Sicherheits-Eigenschaft** (Plan-§AP-12):
- bei „nein, doch ja" wird das `nein` ernst genommen, nicht ignoriert.
+ Order: Veto > Confirm > Ambiguous > Unknown.
+ Veto priority is a **safety property** (Plan-§AP-12): for input like
+ "no, actually yes" the negation is taken seriously, not ignored.
"""
if not transcript:
return "unknown"
@@ -183,17 +183,17 @@ def classify_response(transcript: str, *, language: str = "de") -> ResponseVerdi
# ----------------------------------------------------------------------
-# Sensitive-Path-Check
+# Sensitive path check
# ----------------------------------------------------------------------
def is_sensitive_path(path: str) -> bool:
- """True wenn der Pfad einen Wert enthält, der NICHT vorgelesen werden darf.
+ """True if the path holds a value that must NOT be read aloud.
- Drei Quellen:
+ Three sources:
1. `SelfModRegistry.is_forbidden(path)` (FORBIDDEN_PATTERNS)
- 2. `MutableSpec.sensitive == True` (explizit gesetzt)
- 3. Heuristik: Pfad enthält key/secret/token/password als Substring
+ 2. `MutableSpec.sensitive == True` (explicitly set)
+ 3. Heuristic: path contains key/secret/token/password as a substring
"""
from jarvis.core.self_mod.registry import SelfModRegistry
@@ -202,9 +202,9 @@ def is_sensitive_path(path: str) -> bool:
spec = SelfModRegistry.get_spec(path)
if spec is not None and spec.sensitive:
return True
- # Defense-in-Depth: Heuristik gegen versehentliche Allowlist-Erweiterungen.
- # Sub-Agent-Review-MINOR (2026-04-26): Marker-Liste um `bearer`, `oauth`,
- # `pat` (Personal Access Token), `cookie`, `session_id` erweitert.
+ # Defense-in-depth: heuristic against accidental allowlist expansions.
+ # Sub-agent-review-MINOR (2026-04-26): marker list expanded with `bearer`,
+ # `oauth`, `pat` (Personal Access Token), `cookie`, `session_id`.
lowered = path.lower()
return any(
marker in lowered
@@ -223,36 +223,36 @@ def is_sensitive_path(path: str) -> bool:
"cookie",
)
) or any(
- # `pat` als ganzes Wort (Github-PAT), nicht als Substring von z.B. "patch".
+ # `pat` as a whole word (GitHub PAT), not as a substring of e.g. "patch".
re.search(rf"(?:^|[._-]){marker}(?:$|[._-])", lowered)
for marker in ("pat",)
)
# ----------------------------------------------------------------------
-# Voice-Label-Extraktion
+# Voice label extraction
# ----------------------------------------------------------------------
def _voice_label(description: str) -> str:
- """Voice-tauglicher Label aus der Description.
+ """Voice-friendly label derived from the description.
- Schneidet alles ab der ersten Klammer ab: „TTS-Provider (Hot-Reload
- abgedeckt)" → „TTS-Provider". Trailing-Punctuation wird ebenfalls
- entfernt, damit der Templater eine saubere Phrase einsetzen kann.
+ Cuts everything from the first parenthesis: "TTS provider (hot-reload
+ covered)" → "TTS provider". Trailing punctuation is also stripped, so
+ the templater can slot in a clean phrase.
"""
head = description.split("(")[0].strip()
return head.rstrip(",;:.!?")
def _format_value_for_speech(value: Any) -> str:
- """Voice-tauglicher String aus einem primitiven Wert.
+ """Voice-friendly string from a primitive value.
- Phase 7.4 hält das einfach — Number-Wörterung („eins Komma drei")
- ist Phase 7.6 (TTS macht das idealerweise selbst). Hier: stringify.
+ Phase 7.4 keeps this simple — number verbalization ("one point three")
+ is Phase 7.6 (ideally TTS handles that itself). Here: stringify.
"""
if isinstance(value, bool):
- # bool muss VOR int geprüft werden (bool ist int-Subtype).
+ # bool must be checked BEFORE int (bool is an int subtype).
return "an" if value else "aus"
if value is None:
return "leer"
@@ -260,18 +260,18 @@ def _format_value_for_speech(value: Any) -> str:
# ----------------------------------------------------------------------
-# Echo-Frage-Templates (Plan-§7.4 End-Focus)
+# Echo question templates (Plan-§7.4 end-focus)
# ----------------------------------------------------------------------
_ECHO_TEMPLATE_DE = (
- "Verstanden — {label} wechselt von {old} zu {new}. Bestätigen?"
+ "Verstanden — {label} wechselt von {old} zu {new}. Bestätigen?" # i18n-allow
)
_ECHO_TEMPLATE_EN = (
"Got it — {label} switches from {old} to {new}. Confirm?"
)
_ECHO_TEMPLATE_SENSITIVE_DE = (
- "Verstanden — {label} auf einen neuen Wert. Bestätigen?"
+ "Verstanden — {label} auf einen neuen Wert. Bestätigen?" # i18n-allow
)
_ECHO_TEMPLATE_SENSITIVE_EN = (
"Got it — {label} to a new value. Confirm?"
@@ -281,11 +281,11 @@ _ECHO_TEMPLATE_SENSITIVE_EN = (
def format_confirmation(
pending: PendingMutation, *, language: str = "de"
) -> str:
- """Rendert die Echo-Frage gemäß Plan-§7.4 + Sensitive-Schutz.
+ """Renders the echo question per Plan-§7.4 + sensitive protection.
- End-Focus: der `new_value` steht in den letzten 3 Tokens des Satzes
- (vor `Bestätigen?`/`Confirm?`). Bei Sensitive-Pfaden wird der Wert
- komplett ausgelassen — Defense-in-Depth gegen TTS-Secret-Leak.
+ End-focus: the `new_value` sits in the last 3 tokens of the sentence
+ (right before the localized "Confirm?" word). For sensitive paths, the
+ value is omitted entirely — defense-in-depth against a TTS secret leak.
"""
label = _voice_label(pending.description)
if is_sensitive_path(pending.path):
@@ -300,15 +300,15 @@ def format_confirmation(
# ----------------------------------------------------------------------
-# Outcome-Templates (Plan-§7.4-Tabelle)
+# Outcome templates (Plan-§7.4 table)
# ----------------------------------------------------------------------
OutcomeKind = Literal[
- "safe_applied", # SAFE-Tier-Bypass
- "applied", # SUCCESS, kein Restart
- "applied_restart", # SUCCESS, mit Restart
- "validate_failed", # PRE-VALIDATION-FAIL
+ "safe_applied", # SAFE tier bypass
+ "applied", # SUCCESS, no restart
+ "applied_restart", # SUCCESS, with restart
+ "validate_failed", # PRE-VALIDATION FAIL
"rollback", # ROLLBACK
"vetoed", # REJECT
"timeout", # TIMEOUT
@@ -322,13 +322,13 @@ def format_outcome(
language: str = "de",
short_error: str | None = None,
) -> str:
- """Plan-§7.4 Voice-Output-Templates.
+ """Plan-§7.4 voice-output templates.
- Sub-Agent-Review-BLOCKER (2026-04-26): bei `is_sensitive_path == True`
- werden NICHT NUR `new_value`/`old_value`, sondern AUCH `short_error`
- durch eine generische Phrase ersetzt — eine Pydantic-Pre-Validate-
- Message kann den Klartext-Wert via `repr()` enthalten und würde
- sonst leaken (Plan-§AP-2).
+ Sub-agent-review-BLOCKER (2026-04-26): when `is_sensitive_path == True`,
+ NOT ONLY `new_value`/`old_value` but ALSO `short_error` is
+ replaced with a generic phrase — a Pydantic pre-validate
+ message can contain the plaintext value via `repr()` and would
+ otherwise leak it (Plan-§AP-2).
"""
label = _voice_label(pending.description)
is_sens = is_sensitive_path(pending.path)
@@ -343,7 +343,7 @@ def format_outcome(
else _format_value_for_speech(pending.old_value)
)
if is_sens:
- # Generische Phrase — kein Klartext-Leak via Exception-Message.
+ # Generic phrase — no plaintext leak via the exception message.
err = (
"Validierung schlug fehl"
if language == "de"
@@ -351,7 +351,7 @@ def format_outcome(
)
else:
err = short_error or (
- "unbekannter Fehler" if language == "de" else "unknown error"
+ "unbekannter Fehler" if language == "de" else "unknown error" # i18n-allow
)
if language == "de":
@@ -365,16 +365,16 @@ def format_outcome(
"Bitte einmal Jarvis neustarten, damit's wirkt."
)
if kind == "validate_failed":
- return f"Geht nicht — {err}. Setting bleibt {old_str}."
+ return f"Geht nicht — {err}. Setting bleibt {old_str}." # i18n-allow
if kind == "rollback":
return (
- "Konnte nicht gespeichert werden, hab den vorherigen "
- f"Zustand wiederhergestellt. {err}"
+ "Konnte nicht gespeichert werden, hab den vorherigen " # i18n-allow
+ f"Zustand wiederhergestellt. {err}" # i18n-allow
)
if kind == "vetoed":
return "Okay, lass ich."
if kind == "timeout":
- return f"Hab keine Antwort gehört, brech ich ab. Setting bleibt {old_str}."
+ return f"Hab keine Antwort gehört, brech ich ab. Setting bleibt {old_str}." # i18n-allow
return ""
# English
@@ -401,21 +401,21 @@ def format_outcome(
def short_error_from_exception(exc: BaseException) -> str:
- """Kürzt eine Pipeline-Exception auf eine Voice-taugliche Phrase.
+ """Shortens a pipeline exception to a voice-friendly phrase.
- Sub-Agent-Review-MAJOR (2026-04-26): der Fallback-Branch reichte
- früher beliebige Exception-Strings durch — wenn ein zukünftiger Caller
- den Catch-Block weitet (z.B. `except Exception`), würde der Fallback
- Klartext-Werte ins TTS leiten. Jetzt: nur eine harte Allowlist von
- Phrasen, plus Pydantic-Field-Path (kein Wert) für PreValidateError.
+ Sub-agent-review-MAJOR (2026-04-26): the fallback branch used to pass
+ arbitrary exception strings through — if a future caller
+ widens the catch block (e.g. `except Exception`), the fallback
+ would leak plaintext values into TTS. Now: only a hard allowlist of
+ phrases, plus the Pydantic field path (no value) for PreValidateError.
"""
if isinstance(exc, PreValidateError):
- # `str(exc)` enthält in writer.py:_mutate_locked den `repr(new_value)`.
- # Wir verwerfen die Message komplett und liefern eine generische
- # Phrase. Der detaillierte Trace landet im Audit-Log, nicht im TTS.
- return "Pre-Validate hat den Wert abgelehnt"
+ # `str(exc)` contains `repr(new_value)` in writer.py:_mutate_locked.
+ # We discard the message entirely and return a generic
+ # phrase. The detailed trace lands in the audit log, not in the TTS.
+ return "Pre-Validate hat den Wert abgelehnt" # i18n-allow
if isinstance(exc, ReloadError):
- return "der Reload-Test hat den neuen Wert abgelehnt"
+ return "der Reload-Test hat den neuen Wert abgelehnt" # i18n-allow
if isinstance(exc, RollbackError):
- return "der Rollback selbst ist fehlgeschlagen — manueller Restore nötig"
- return "unerwarteter Fehler in der Mutation-Pipeline"
+ return "der Rollback selbst ist fehlgeschlagen — manueller Restore nötig" # i18n-allow
+ return "unerwarteter Fehler in der Mutation-Pipeline" # i18n-allow
diff --git a/jarvis/voice/self_mod_flow.py b/jarvis/voice/self_mod_flow.py
index 88208e91a3..92f647a100 100644
--- a/jarvis/voice/self_mod_flow.py
+++ b/jarvis/voice/self_mod_flow.py
@@ -1,22 +1,22 @@
-"""SelfModFlowController — State-Machine für die Voice-Echo-Confirmation.
+"""SelfModFlowController — state machine for the voice echo confirmation.
-Plan-§7.4-Konversationsfluss als reiner Library-Layer. Die echte
-Voice-Pipeline (`jarvis/speech/pipeline.py`) bekommt in Phase 7.6
-einen Adapter, der diesen Controller einhängt.
+Plan-§7.4 conversation flow as a pure library layer. The real
+voice pipeline (`jarvis/speech/pipeline.py`) will get an adapter
+in Phase 7.6 that hooks in this controller.
States:
- PARSED — initialer Zustand (intern)
- CONFIRMING — Echo-Frage an TTS gegeben, wartet auf User-Antwort
- APPLYING — Confirmation entdeckt, mutate() läuft
- APPLIED — End-Zustand: erfolgreich persistiert
- VETOED — End-Zustand: User hat abgelehnt
- TIMEOUT — End-Zustand: keine Antwort innerhalb 30s
- FAILED — End-Zustand: Pre-Validate / Reload / Rollback-Fehler
-
-Audit-Trail (Plan-§AP-1, §AP-12 codifiziert):
-- Pre-Audit "voice_confirmed" beim Confirm (mit voice_confirmation-Feld)
-- Reject-Audit "voice_vetoed" oder "voice_timeout" via Pending-Store
-- Mutate-Audit (success/failure) wird vom AtomicConfigWriter geschrieben
+ PARSED — initial state (internal)
+ CONFIRMING — echo question handed to TTS, waiting for the user's answer
+ APPLYING — confirmation detected, mutate() is running
+ APPLIED — terminal state: successfully persisted
+ VETOED — terminal state: user declined
+ TIMEOUT — terminal state: no answer within 30s
+ FAILED — terminal state: pre-validate / reload / rollback error
+
+Audit trail (Plan-§AP-1, §AP-12 codified):
+- Pre-audit "voice_confirmed" on confirm (with the voice_confirmation field)
+- Reject-audit "voice_vetoed" or "voice_timeout" via the pending store
+- Mutate-audit (success/failure) is written by the AtomicConfigWriter
"""
from __future__ import annotations
@@ -70,10 +70,10 @@ _TERMINAL_STATES = frozenset(
@dataclass(frozen=True)
class FlowSession:
- """Snapshot des Flow-State.
+ """Snapshot of the flow state.
- `frozen=True` + `replace()` für State-Übergänge — pure Funktionen,
- keine Mutation, deterministisch testbar.
+ `frozen=True` + `replace()` for state transitions — pure functions,
+ no mutation, deterministically testable.
"""
pending: PendingMutation
@@ -108,9 +108,9 @@ def _voice_confirmation_payload(
class SelfModFlowController:
- """Orchestrator für den Voice-Echo-Confirmation-Flow.
+ """Orchestrator for the voice echo confirmation flow.
- Plan-§7.4 Default-Timeout 30s — über Konstruktor anpassbar.
+ Plan-§7.4 default timeout 30s — configurable via the constructor.
"""
DEFAULT_TIMEOUT_SECONDS: ClassVar[float] = 30.0
@@ -124,14 +124,14 @@ class SelfModFlowController:
default_language: str = "de",
) -> None:
self._pending_store = pending_store
- # Audit für Pre-Events (voice_confirmed). Reject-Events laufen über
- # den Pending-Store, der seinerseits den gleichen Writer-Audit hat.
+ # Audit for pre-events (voice_confirmed). Reject events run through
+ # the pending store, which in turn has the same writer audit.
self._audit: SelfModAudit = audit if audit is not None else pending_store._audit # noqa: SLF001
self._timeout_seconds = timeout_seconds
self._default_language = default_language
# ------------------------------------------------------------------
- # Flow-Übergänge
+ # Flow transitions
# ------------------------------------------------------------------
def begin(
@@ -141,11 +141,11 @@ class SelfModFlowController:
language: str | None = None,
now: float | None = None,
) -> FlowSession:
- """Initiiert den Flow nach erhaltener `PendingMutation`.
+ """Initiates the flow after receiving a `PendingMutation`.
- SAFE-Tier (`pending.applied=True`): Flow startet bereits in
- `APPLIED`-State, weil der Store die Mutation schon persistiert hat.
- Voice-Pipeline rendert nur noch das `safe_applied`-Outcome.
+ SAFE tier (`pending.applied=True`): the flow starts directly in the
+ `APPLIED` state, because the store has already persisted the mutation.
+ The voice pipeline just renders the `safe_applied` outcome.
"""
lang = language or self._default_language
if pending.applied:
@@ -177,17 +177,17 @@ class SelfModFlowController:
confidence: float = 1.0,
now: float | None = None,
) -> FlowSession:
- """Verarbeitet eine User-Antwort.
+ """Processes a user's answer.
- - Confirm → Pending wird konsumiert, Mutate läuft, → APPLIED/FAILED.
- - Veto → Pending wird via Store mit `voice_vetoed` rejected.
- - Ambiguous/Unknown → Session bleibt in CONFIRMING, **ohne** Timeout
- zu verlängern (Plan-Sicherheits-Eigenschaft, kein Soft-Lock).
- - Wenn Timeout bereits überschritten ist: → TIMEOUT.
+ - Confirm → the pending mutation is consumed, mutate runs, → APPLIED/FAILED.
+ - Veto → the pending mutation is rejected via the store with `voice_vetoed`.
+ - Ambiguous/Unknown → the session stays in CONFIRMING, **without** extending
+ the timeout (a plan safety property, no soft-lock).
+ - If the timeout has already elapsed: → TIMEOUT.
"""
if session.state != FlowState.CONFIRMING:
raise ValueError(
- f"receive_answer ist nur in CONFIRMING erlaubt, nicht in {session.state}"
+ f"receive_answer is only allowed in CONFIRMING, not in {session.state}"
)
clock = now if now is not None else time.time()
if clock > session.deadline_ts:
@@ -198,7 +198,7 @@ class SelfModFlowController:
return self._apply(session, transcript=transcript, confidence=confidence)
if verdict == "veto":
return self._veto(session, transcript=transcript, confidence=confidence)
- # ambiguous OR unknown: bleibt im CONFIRMING ohne Timeout-Verlängerung.
+ # ambiguous OR unknown: stays in CONFIRMING without extending the timeout.
return replace(
session, transcript=transcript, confidence=confidence
)
@@ -206,9 +206,9 @@ class SelfModFlowController:
def check_timeout(
self, session: FlowSession, *, now: float | None = None
) -> FlowSession:
- """Soll regelmäßig (z.B. alle 1s) gerufen werden.
+ """Should be called regularly (e.g. every 1s).
- End-Zustände werden unverändert zurückgegeben.
+ Terminal states are returned unchanged.
"""
if session.is_terminal() or session.state != FlowState.CONFIRMING:
return session
@@ -224,7 +224,7 @@ class SelfModFlowController:
def _apply(
self, session: FlowSession, *, transcript: str, confidence: float
) -> FlowSession:
- # Pre-Audit "voice_confirmed" mit Reichern voice_confirmation
+ # Pre-audit "voice_confirmed" enriched with voice_confirmation
voice_payload = _voice_confirmation_payload(transcript, confidence)
try:
self._audit.record(
@@ -241,7 +241,7 @@ class SelfModFlowController:
)
)
except Exception as exc: # noqa: BLE001
- _LOG.warning("voice_confirmed Pre-Audit fehlgeschlagen: %s", exc)
+ _LOG.warning("voice_confirmed pre-audit failed: %s", exc)
try:
mutation_result = self._pending_store.confirm(session.pending.id)
@@ -262,7 +262,7 @@ class SelfModFlowController:
),
)
except KeyError as exc:
- # Pending nach TTL-Ablauf nicht mehr da
+ # Pending mutation no longer there after TTL expiry
return replace(
session,
state=FlowState.TIMEOUT,
@@ -294,7 +294,7 @@ class SelfModFlowController:
self, session: FlowSession, *, transcript: str, confidence: float
) -> FlowSession:
voice_payload = _voice_confirmation_payload(transcript, confidence)
- # Reject-Audit kommt vom Pending-Store mit reason="voice_vetoed".
+ # Reject-audit comes from the pending store with reason="voice_vetoed".
try:
self._pending_store.reject(
session.pending.id,
@@ -303,7 +303,7 @@ class SelfModFlowController:
voice_confirmation=voice_payload,
)
except Exception as exc: # noqa: BLE001
- _LOG.warning("Pending-Store-Reject (vetoed) fehlgeschlagen: %s", exc)
+ _LOG.warning("Pending-store reject (vetoed) failed: %s", exc)
return replace(
session,
state=FlowState.VETOED,
@@ -323,7 +323,7 @@ class SelfModFlowController:
voice_confirmation=None,
)
except Exception as exc: # noqa: BLE001
- _LOG.warning("Pending-Store-Reject (timeout) fehlgeschlagen: %s", exc)
+ _LOG.warning("Pending-store reject (timeout) failed: %s", exc)
return replace(
session,
state=FlowState.TIMEOUT,
@@ -333,7 +333,7 @@ class SelfModFlowController:
)
-# Re-Export für test-friendly access
+# Re-export for test-friendly access
__all__ = [
"FlowSession",
"FlowState",
@@ -341,6 +341,6 @@ __all__ = [
]
-# Suppress lint: `field` import wird für zukünftige FrozenSet-Defaults reserviert
+# Suppress lint: `field` import is reserved for future FrozenSet defaults
_ = field
_ = UUID