Issues#2486#14
Merged
Merged
Conversation
paynejd
approved these changes
Apr 27, 2026
paynejd
added a commit
that referenced
this pull request
May 12, 2026
Addresses 6 issues from @snyaggarwal's latest PR comments — including two regressions I introduced in 2d96c09 (#11, #14) — plus four target-repo / table-view / bridge-config fixes from @paynejd's local testing. #14 — Score shows NaN%. viewBuilders.getScoreDetails now returns rerankScore='' and algoScore='' when no numeric value is present, instead of parseFloat(null).toFixed(2) yielding the literal string 'NaN%'. The mapped CIEL concept in the Target Code panel shipped a visible NaN% chip because legacyToRowView (introduced 2d96c09) passes search_meta values that may be undefined when the mapping projection lost them. #11 — Rerank fires on every row visit. scheduleRerank now gates on display_name presence: a concept_row is rerank-eligible only when its ConceptDefinition has a usable name. The 2d96c09 fix that filtered name-less rows out of buildRerankRowsForRow correctly stopped the -100000 reranker sentinel, but its corollary — those rows stay rerank_score=undefined forever — caused the scheduler to re-fire on every row open. writeConceptCachePatch now chains into scheduleRerank for every row referencing a concept_key whose patch transitions display_name from absent to present (e.g. ensureLoaded completing on a bridge cascade target). #13 — AutoMatch doesn't auto-select even when top candidate qualifies. Resolves transitively with #11: bridge cascade targets that previously stayed rerank_score=undefined now receive a score after ensureLoaded completes + the chained scheduleRerank fires. pickTopRowView's rerank_score ?? -1 fallback no longer keeps them stuck at the bottom. Target-repo filtering (Quality view + Map button). Quality (score-grouped) view now ONLY shows target-repo concepts. Bridge intermediaries (CIEL when target is ICD/LOINC) are reference metadata about the cascade, not mappable themselves; surfacing them in Quality view double-counted and confused the bucketing. Algorithm view keeps the full mix so users can browse by-algorithm. Implementation: Candidates accepts a `targetCanonical` prop (sourced from buildProjectContext().target_repo.canonical_url, the same canonical the normalizer used to stamp ConceptDefinition.reference.url, so the comparison is exact) and filters qualityRowViews against it. Same canonical gates the Map button everywhere. The action column in both table and card views now hides MapButton for non-target-repo concepts. Concept.jsx Item renders a placeholder spacer for the bridge intermediary's algoScoreFirst row (reverting the 2d96c09 fix that had shown a Map indicator there) — bridge intermediaries can't be mapped, and Unified view no longer surfaces them anyway after this commit. Table view broken (display='table' in Candidates). TableResults reads ALL_COLUMNS['concepts'] paths that expect the legacy concept shape (id, url, names, descriptions, source, search_meta, ...) at top level. The rowsForTable decoration in 2d96c09 only added id/url for click lookup, leaving the table cells blank. Now spreads the conceptForMapping projection first, then the rowView fields (no collision between the two — different keys), then sets id/url/version_url explicitly at the end for handleRowClick. #12 — First-time row click with bridge: API returned candidates, UI shows none. Auto-Match works in the same setup. buildProjectContext's bridge_repo was only constructed when bridgeAlgo.target_repo_url was truthy. When a user adds the bridge algo and accepts the placeholder default '/orgs/CIEL/sources/CIEL/' without editing the field, sel.target_repo_url stays undefined — so on the next fetch, projectContext.bridge_repo is absent, the normalizer's resolveReference returns null for every bridge primary, normalizeAlgoResult returns the empty triple, and rowState ends up with zero candidates. Auto-Match exhibits the same code path but apparently works in Sunny's env (likely his algo state has target_repo_url populated by some other write path; the manual-click flow is the one that surfaces it). Fix: buildProjectContext falls back to a per-type default (BRIDGE_DEFAULT_RELATIVE_URL['ocl-ciel-bridge'] = '/orgs/CIEL/sources/CIEL/') matching the MultiAlgoSelector placeholder. Generic 'ocl-bridge' algos without target_repo_url still fail (no canonical default makes sense), but that's expected per the spec — the user must set it. Verified: 79/79 tests pass, eslint clean. Local in-browser: legacy project loads, candidates render, Quality view shows only target-repo concepts, table view shows full columns, Auto-Match selects correct rows, no rerank re-fire loop on row visits, no NaN% chips. Bridge / scispacy / AI Assistant exercise still gates merge per the original PR description; the remaining open items are S6 (Auto Match no calls with bridge-only algo — pending Sunny's diagnostics) and verifying the above fixes against his environment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Linked Issue
Closes OpenConceptLab/ocl_issues#2486
Screenshots

