chore(F542): @implements Batch 2a — 4 Multi-Feature-Dateien @implements: [F-542]
This commit is contained in:
@@ -52,6 +52,10 @@ class ContradictionResult:
|
||||
class RoutingWiderspruchDetector:
|
||||
"""Erkennt textuelle Widersprüche gegen Routing-Entscheidungen via Regex.
|
||||
|
||||
# @implements: [F-080] — Auto-Route-Widerspruch-Flow
|
||||
# @implements: [F-081] — Widerspruch-Clarify nur nach Auto-Route
|
||||
# @implements: [F-082] — Widerspruch-Clarify Originalnachricht Dispatch
|
||||
|
||||
Vier Regex-Gruppen, absteigend nach Spezifität:
|
||||
|
||||
a) **Hauptmuster** — „Nein, das passt nicht in X"
|
||||
|
||||
@@ -12,6 +12,9 @@ Sicherheitsanforderungen:
|
||||
- HOME-relativ wird normalisiert
|
||||
"""
|
||||
|
||||
# @implements: [F-012] — Auto-Onboarding
|
||||
# @implements: [F-065] — P-065 Onboarding ACTIVE-Guard aufspalten
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
@@ -28,6 +28,8 @@ WICHTIG — Sync-Hooks (P-024):
|
||||
Zero external dependencies — stdlib only.
|
||||
"""
|
||||
|
||||
# @implements: [F-042] — Presence-Engine Basis
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
@@ -157,6 +159,8 @@ def resolve_phase_from_hs(h: bool, s: bool) -> Phase:
|
||||
def resolve_phase(counters: Dict[str, int]) -> Phase:
|
||||
"""Bestimme die Phase aus einem Counter-Snapshot (pure Funktion).
|
||||
|
||||
# @implements: [F-043] — V9 GELB-Logik + Pulsieren
|
||||
|
||||
Invariante I1: deterministisch + pure.
|
||||
|
||||
P-096: Auf das Zwei-Person-States-Modell abgebildet. Die Counter sind
|
||||
@@ -198,6 +202,8 @@ def resolve_phase(counters: Dict[str, int]) -> Phase:
|
||||
class _Mediator:
|
||||
"""V10 Mediator: Reagiert auf Phasen-Übergänge, steuert Puls-Timer.
|
||||
|
||||
# @implements: [F-045] — V10 Presence-Engine Mediator Layer
|
||||
|
||||
Verantwortlichkeiten:
|
||||
- Empfängt Phase-Transition-Events von Schicht 1
|
||||
- Hält aktuelle Phase + Puls-Timer
|
||||
@@ -649,6 +655,8 @@ class _Mediator:
|
||||
def set_rest_cooldown(self) -> None:
|
||||
"""Setze REST-Cooldown mit exponentiellem Backoff (P-036 Fix 1).
|
||||
|
||||
# @implements: [F-044] — V9 429-Circuit-Breaker
|
||||
|
||||
Formel: cooldown = min(5 * 2^n + random(0,1), 60)
|
||||
Sequence: 5s -> 10s -> 20s -> 40s -> 60s (cap).
|
||||
|
||||
@@ -2978,6 +2986,8 @@ class PresenceEngine:
|
||||
def on_kanban_worker_spawned(self, **kwargs) -> None:
|
||||
"""Hook: on_kanban_worker_spawned → kanban_worker += 1 (GELB Start).
|
||||
|
||||
# @implements: [F-097] — Kanban-Worker-Presence
|
||||
|
||||
F97: Kanban-Worker sind separate `hermes -p <profile> chat -q`
|
||||
Subprozesse aus dem Dispatcher. Sie feuern NICHT subagent_start/stop
|
||||
(delegate_task), sondern eigene Core-Hooks. Der Worker wird als
|
||||
|
||||
@@ -25,6 +25,8 @@ der Check erkennen. Es verwendet nur stdlib (urllib, json, os, pathlib) plus
|
||||
`config` (das selbst nur json/os importiert).
|
||||
"""
|
||||
|
||||
# @implements: [F-092] — Archivar Self-Check nach Gateway-Start
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
@@ -230,6 +232,8 @@ def _probe_llm_room_e2e(
|
||||
) -> Tuple[bool, float, str]:
|
||||
"""Stufe 4b (F100): Router-E2E-Probe — POST /api/generate mit Mini-Prompt.
|
||||
|
||||
# @implements: [F-100] — Archivar Self-Check Stufe 4b + Runtime-Watchdog
|
||||
|
||||
Smoke-Test (K1): prüft, dass Modell + Endpoint überhaupt antworten.
|
||||
Antwort-Validierung: enthält "STAY" (case-insensitive trim) UND Latenz
|
||||
≤ timeout. Bei jedem Fehler (HTTP, Timeout, Parse): ok=False.
|
||||
|
||||
Reference in New Issue
Block a user