fix(dashboard): total_dur_h filtert Waisen-Traces via db_matched (#229)#251
Merged
Conversation
total_dur_h summierte bisher ALLE token_runs inkl. Waisen-Traces (Trace- JSONL ohne pipeline_runs-Zeile) — 40,1h angezeigt vs. 31,2h DB-gejoint (~22% zu hoch). total_tokens hat seit PR #226 den db_matched-Filter, total_dur_s fehlte er (Scope-Disziplin in #226 bewusst ausgeklammert). Fix: denselben `if r.get("db_matched", True)`-Filter auf total_dur_s angewendet (eval_dashboard.py:609), analog zu total_tokens direkt daneben.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Befund
Beim #226-Nachbar-KPI-Audit festgestellt:
total_dur_hsummierte weiterhin ALLE Traces inkl. Waisen (Trace-JSONL ohnepipeline_runs-Zeile) — 40,1h angezeigt vs. 31,2h DB-gejoint (~22% zu hoch). Die Nachbar-KPItotal_tokenshat seit PR #226 dendb_matched-Filter,total_dur_sfehlte er (bewusst nicht mitgefixt, Scope-Disziplin in #226).Fix
generative/eval_dashboard.py:609, Funktion_calc_kpis— derselbe Filter wie beitotal_tokensdirekt daneben:db_matchedwird beim Server-Join ingenerative/eval_dashboard_server.py:450gesetzt (tr["db_matched"] = tr.get("run_id","") in _run_info); DB-only-Runs sind per KonstruktionTrue(Zeile 507). DefaultTrueerhält den deprecated Standalone-Pfad (main()/_build_html), der_calc_kpisohne Server-Join aufruft.Scope strikt auf die eine Filter-Zeile begrenzt — Token-Totals und Dauer-Semantik selbst unverändert (das sind #238/#239, separate Issues). Die Strip-Hint-HTML wurde nicht angefasst: sie beschreibt die Laufzeit nicht explizit falsch, nur unspezifisch — mit dem Fix stimmt die implizite DB-Zuordnungs-Basis jetzt ohnehin für Tokens und Laufzeit überein.
TDD
Neuer Test
generative/tests/test_dashboard_total_dur_h_db_matched.py(analog zum #226-Vorbildtest_dashboard_total_tokens_db_matched.py):db_matched=False) wurde mitgezählt —11.0 == 1.0schlug fehl.total_tokens-Tests weiterhin grün (10/10 zusammen).Suite
pytest generative lib/decision_engine/tests shared/tests -q: 5791 passed, 3 skipped, 4 deselected, 0 failed.ruff
ruff check+ruff format --checkauf geänderten Dateien: sauber.Closes #229