The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(shared-metrics): limit bench alias to committed rows
mnajafian-nva7445c5081d7
diff --git a/hermes_cli/observability/shared_metrics_fields.py b/hermes_cli/observability/shared_metrics_fields.pyindex 059ee9bfdd7..f9a7eb961ff 100644--- a/hermes_cli/observability/shared_metrics_fields.py+++ b/hermes_cli/observability/shared_metrics_fields.py@@ -131,8 +131,8 @@ _COMPRESSION_OUTCOMES = {}-# Attempt-log classes the closed set names under an existing value: a summary model benched after repeated-# fallbacks is a pre-LLM skip to the deterministic summary, which is what ``feasibility_skip`` counts.+# On a committed attempt, a benched summary model led to a deterministic summary;+# the existing ``feasibility_skip`` class counts that fallback._COMPRESSION_FAILURE_CLASS_ALIASES = {"summary_model_benched": "feasibility_skip"}@@ -142,9 +142,10 @@ def compression_failure_class(outcome: str, failure_class: Any) -> str:through a fallback (``feasibility_skip``, ``summary_generation_failed``, ``aux_model_fallback``, ...),which keeps that class so a fallback commit never reads as a clean one."""value = _norm(failure_class if isinstance(failure_class, str) else None).split(":", 1)[0]- value = _COMPRESSION_FAILURE_CLASS_ALIASES.get(value, value)- if outcome == "success" and value in {"", "none"}:- return "none"+ if outcome == "success":+ value = _COMPRESSION_FAILURE_CLASS_ALIASES.get(value, value)+ if value in {"", "none"}:+ return "none"if not value:return "unknown"return value if value in contract.COMPRESSION_FAILURE_CLASSES - {"none", "unknown"} else "other"diff --git a/tests/hermes_cli/test_shared_metrics_compression_outcome.py b/tests/hermes_cli/test_shared_metrics_compression_outcome.pyindex 3bbe4eda8ec..ededc9c2f10 100644--- a/tests/hermes_cli/test_shared_metrics_compression_outcome.py+++ b/tests/hermes_cli/test_shared_metrics_compression_outcome.py@@ -53,6 +53,10 @@ def test_aborted_attempts_keep_their_skip_and_failure_verdicts(monkeypatch):assert _finish(monkeypatch, "aborted", "summary_auth_failure") == [("failed", "summary_auth_failure")]+def test_benched_attempt_when_aborted_keeps_failed_other_class(monkeypatch):+ assert _finish(monkeypatch, "aborted", "summary_model_benched") == [("failed", "other")]++def test_committed_fallback_row_validates_against_the_package_schema(tmp_path):jsonschema = pytest.importorskip("jsonschema")store = SharedMetricsStore(tmp_path / "metrics.sqlite3", tmp_path / "outbox")