feat(hermes): graded relevance labels and a per-stage loss report for evaluation #1644
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.42) × (1 − Review Confidence (0.23)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 328 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 37% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1644"
general
weight: 0.35
chatgpt-codex-connector[bot]
Summary
This PR adds two offline evaluation scripts for Hermes retrieval. The answering path is unchanged.
Why: gold cases name only a few target records, so other valid records counted as misses. On 2026-10-02 that made the first stage look weak ("paraphrase targets are outside the top 15"). With graded labels on pooled candidates, the current pair puts a relevant record in the top 30 for 68 of 73 questions.
graded-labels.mjs: pools the gold targets, the shown records, and the top 30 candidates of evaluated runs. JEV grades each question-record pair from 0 to 3, with a rubric worded differently from the production judge. Pairs already labelled are skipped, so a later run only adds its new candidates. The label file holds ids and grades, no record text.graded-score.mjs: scores runs against the labels. It reports the shown records by grade and, for each answer case that showed nothing, the stage that lost it: answered in another form, no relevant record labelled, relevant records outside the judged candidates, or rejected by the judge.hermes-retrieval-accuracy-log.md: the "How to measure" section describes both commands and the self-grading caveat (the judge and the grader are both JEV).Checked on real data: the per-stage loss report matches the hand analysis of the same runs (10 answer cases with nothing shown: 2 asked back, 3 rejected by the judge, 4 outside the judged candidates, 1 with no relevant record).
<!-- deploy-impact:start -->
| Item | Declaration |
| --- | --- |
| Risk | unknown |
| Target machines | pi3, pi4, pi5 |
| Changed surfaces | api, docs, unknown |
| Required files/artifacts | N/A: no new artifact; the two scripts are copied into the API image with the rest of
scripts/hermes-searchand nothing calls them at runtime || Database | no: no schema, query, or migration change |
| Secrets/config delivery | no: no new flag or secret |
| Success evidence |
node --test retrieval/inscripts/hermes-search: 126 passed, including pooling, grade parsing, resumable labelling with a failing batch, and loss attribution. Real-data check as above. || Rollback/cleanup | Revert this PR; no runtime state changes. |
| Production verification | N/A: evaluation scripts and docs only; the answering code does not import them. |
<!-- deploy-impact:end -->
Test plan
node --test retrieval/(macOS, Node 24). Private runs of both scripts against JEV (TypeSafe).🤖 Generated with Claude Code