fix: Make schema registry building fully deterministic#1220
Merged
Conversation
The `_get_registry()` function used `Path.rglob()` without sorting, making schema resolution dependent on filesystem iteration order. This caused the flow-cytometry bundled units schema (771 defs, missing nM) to override the standalone (773 defs, has nM) on platforms where rglob returned adm/ before qudt/, breaking Biacore T200 Control validation with nM concentrations. Two fixes applied: - Sort rglob results for consistent iteration order across all platforms - Use size comparison for ALL registrations (standalone and bundled), with standalone schemas winning ties over bundled copies Verified deterministic by comparing forward vs reverse iteration — produces identical results regardless of file discovery order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ajcariaga16
approved these changes
Jun 2, 2026
nathan-stender
added a commit
that referenced
this pull request
Jun 2, 2026
### Fixed - Make schema registry building fully deterministic (#1220)
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
_get_registry()that causednMunit validation failures on some platforms (Linux CI) but not others (macOS)Path.rglob()returns files in OS/filesystem-dependent order. When the flow-cytometry bundled units schema (771 defs, missingnM) was processed before the standalone (773 defs, hasnM), the old first-wins logic for standalone registration prevented the correct schema from being usedrglobresults for consistent iteration order across all platformsRoot Cause
The standalone registration path used
if schema_id not in schemas_by_id(first-wins, no size check), while the bundled path usedif bundled_size > sizes_by_id.get(...)(largest-wins). When a bundled subset was encountered first, the standalone could never override it.Test plan
$idsnMresolves correctly regardless of iteration order🤖 Generated with Claude Code