core: Registry, Skills, Router, Executor, Verifier, Runner mit Tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 00:36:21 +02:00
co-authored by Claude Opus 5.5
parent fef930d176
commit f79e2a8556
24 changed files with 2581 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
"""Kalibrierung des effektiven Kontexts aus beobachteten Pass-Rates nach Prompt-Länge."""
from __future__ import annotations
from collections.abc import Iterable
DEFAULT_BUCKETS = (2048, 4096, 8192, 16384, 32768, 65536, 131072)
def effective_context(
observations: Iterable[tuple[int, bool]],
*,
target: float = 0.9,
min_n: int = 20,
buckets: tuple[int, ...] = DEFAULT_BUCKETS,
) -> int | None:
"""observations: (prompt_tokens, bestanden).
Liefert die Obergrenze des größten Buckets, bis zu dem alle Buckets mit genug Daten
die Ziel-Pass-Rate erreichen. Buckets ohne genug Daten unterbrechen die Kette nicht,
zählen aber auch nicht als Nachweis. Ohne Nachweis: None.
"""
counts = {b: [0, 0] for b in buckets} # [n, passed]
for tokens, passed in observations:
for b in buckets:
if tokens <= b:
counts[b][0] += 1
counts[b][1] += int(passed)
break
result = None
for b in buckets:
n, ok = counts[b]
if n < min_n:
continue
if ok / n >= target:
result = b
else:
break
return result