hermes: enforce maximum quality floor

This commit is contained in:
jenkins 2026-08-15 12:45:54 -03:00
parent 053a9fb6b2
commit 427c68fa59
2 changed files with 21 additions and 21 deletions

View File

@ -563,7 +563,7 @@ data:
classifier_target = "classifier" classifier_target = "classifier"
# Switchyard falls through this list after a request-local target failure. # Switchyard falls through this list after a request-local target failure.
# Keep both xhigh providers first so recovery can escalate, never downgrade. # Keep both xhigh providers first so recovery can escalate, never downgrade.
targets = ["codex_sol_xhigh", "claude_opus_xhigh", "claude_fable_xhigh", "codex_sol_high", "claude_opus_high", "claude_sonnet_high", "claude_fable_high", "codex_terra_high", "codex_sol_medium", "claude_sonnet_medium", "claude_fable_medium", "codex_terra_medium"] targets = ["codex_sol_xhigh", "claude_opus_xhigh", "claude_fable_xhigh", "codex_sol_high", "claude_opus_high", "claude_sonnet_high", "claude_fable_high", "codex_terra_high"]
default_target = "codex_sol_high" default_target = "codex_sol_high"
session_affinity = false session_affinity = false
recent_turn_window = 6 recent_turn_window = 6
@ -575,19 +575,14 @@ data:
model-call boundary. Strongly favor intelligence, verification, and task model-call boundary. Strongly favor intelligence, verification, and task
completion, then apply these rules in order. completion, then apply these rules in order.
1. Set a mandatory minimum effort floor from the whole current objective, 1. This maximum-quality route has an absolute high effort floor for every
recent context, and tool evidence: xhigh for critical security work, risky boundary, including ordinary implementation, tests, tool use, analysis,
production migrations, destructive or data-loss risk, or consequential bounded architecture, lookup, and mechanical work. Raise the floor to
independent final/release review; high for difficult debugging, xhigh for critical security work, risky production migrations, destructive
consequential implementation, adversarial review, major architectural or data-loss risk, or consequential independent final/release review.
tradeoffs, or uncertain production work; medium for ordinary Those xhigh triggers are mandatory: never answer one with a high target.
implementation, tests, tool use, analysis, or bounded architecture; low Medium and low targets are intentionally unavailable on this route.
only for lookup or truly mechanical reversible work. Never choose below the Never choose below the floor or above xhigh.
floor or above xhigh.
If tools are present or the boundary may emit a tool call, the floor is
medium even when the user's wording is short. Filesystem, shell,
repository, cluster, browser, and image-generation/edit operations are
tool work; never route those boundaries to Luna or Haiku.
2. Treat "think hard", "deeply", "carefully", and equivalent intent as a 2. Treat "think hard", "deeply", "carefully", and equivalent intent as a
request to raise capability by at least one tier when the safety floor is request to raise capability by at least one tier when the safety floor is
@ -605,15 +600,15 @@ data:
unavailable, failed, exhausted, rate-limited, or out of capacity; use the unavailable, failed, exhausted, rate-limited, or out of capacity; use the
other provider at the same floor. other provider at the same floor.
4. Choose across Codex Terra/SOL and Claude Fable/Sonnet/Opus at medium 4. Choose across Codex Terra/SOL and Claude Fable/Sonnet/Opus at high or
through xhigh. Prefer Fable for writing and compact synthesis where it xhigh only. Prefer Fable for writing and compact synthesis where it clears
clears the quality floor; use Sonnet or Opus for deeper analysis and the quality floor; use Sonnet or Opus for deeper analysis and independent
independent review. Low-tier targets are intentionally unavailable on review. Medium and low targets are intentionally unavailable on this
this route. Re-evaluate every boundary and resolve "continue" or "do it" route. Re-evaluate every boundary and resolve "continue" or "do it" from
from recent context. recent context.
""" """
response_schema = ''' response_schema = '''
{"type":"object","properties":{"decision":{"type":"object","properties":{"target":{"type":"string","enum":["codex_sol_high","claude_opus_high","claude_sonnet_high","claude_fable_high","codex_terra_high","codex_sol_xhigh","claude_opus_xhigh","claude_fable_xhigh","codex_terra_medium","claude_sonnet_medium","claude_fable_medium","codex_sol_medium"]}},"required":["target"],"additionalProperties":false}},"required":["decision"],"additionalProperties":false} {"type":"object","properties":{"decision":{"type":"object","properties":{"target":{"type":"string","enum":["codex_sol_high","claude_opus_high","claude_sonnet_high","claude_fable_high","codex_terra_high","codex_sol_xhigh","claude_opus_xhigh","claude_fable_xhigh"]}},"required":["target"],"additionalProperties":false}},"required":["decision"],"additionalProperties":false}
''' '''
[routes.auto_maximum.policy] [routes.auto_maximum.policy]

View File

@ -1483,6 +1483,11 @@ def test_local_flux_runtime_and_gpu_handoff_are_flux_managed():
selector_targets = routes[route_name]["response_schema"] selector_targets = routes[route_name]["response_schema"]
assert not any(target.endswith("_low") for target in targets) assert not any(target.endswith("_low") for target in targets)
assert "_low" not in selector_targets assert "_low" not in selector_targets
maximum_targets = routes["auto_maximum"]["targets"]
maximum_selector_targets = routes["auto_maximum"]["response_schema"]
assert not any(target.endswith("_medium") for target in maximum_targets)
assert "_medium" not in maximum_selector_targets
assert "absolute high effort floor" in routes["auto_maximum"]["prompt"]
assert any( assert any(
target.startswith("local_") target.startswith("local_")
for target in routes["manual_local_qwen"]["targets"] for target in routes["manual_local_qwen"]["targets"]