HOK-1596: Fix router to aggregate evals from global wavemill install dir#563
Merged
timogilvie merged 1 commit intoauto/integrationfrom May 7, 2026
Merged
Conversation
195e1e2 to
dff80b7
Compare
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.
Summary
gtm-backend), the router only found records from that repo's per-repo eval file, not the cross-repo aggregated data stored in the wavemill installation directoryresolveGlobalAggregatedEvalsPath()inevals-paths.tsthat resolves to<wavemill-install>/.wavemill/evals/aggregated-evals.jsonlusingimport.meta.urlto navigate up fromshared/lib/loadMergedEvalRecords()now tries both the per-repo aggregated path and the global wavemill install path, deduplicating records by ID across both sourcesWAVEMILL_AGGREGATED_EVALS_PATHandWAVEMILL_DIRenv overrides as test hooks for the new path resolutionChanges
shared/lib/evals-paths.ts— AddedresolveWavemillInstallDir()andresolveGlobalAggregatedEvalsPath()with env overrides for testabilityshared/lib/model-router.ts— UpdatedloadMergedEvalRecords()to iterate candidate paths (per-repo + global), merging and deduplicating records from all found sourcesshared/lib/check-routing.ts— Added global aggregated path to the router health check readSource entriesshared/lib/evals-paths.test.ts— Tests for new path resolution functionsshared/lib/model-router.test.ts— Tests covering global fallback, deduplication, missing-file resilience, and error handlingshared/lib/stage-aware-router.test.ts— Tests for stage-aware router with global aggregated evalsshared/lib/check-routing.test.ts— Tests for health check with global aggregated sourceTest plan
WAVEMILL_AGGREGATED_EVALS_PATHenv override allows tests to inject a fixture file without touching the real wavemill installSelf-review
check-routing.ts:169— Two sources share theaggregatedlabel; could useaggregated-globalto avoid ambiguity (cosmetic)model-router.test.ts:95—process.chdir()is fragile if tests are parallelized (currently sequential, safe)eval-aggregator.tsnot updated (writer still writes to per-repo path; global reads from wavemill install where eval-aggregate skill writes).wavemill/context/router.mddocs not updated in this diff