fix: source sector compliance baseline from DB instead of hardcoded scores#81
Merged
Merged
Conversation
…cores Replace the hardcoded BASELINE_SCORES map (and its 'migrate to DB' TODO) in SectorComplianceDetail with the DB-driven sectorBenchmarks.list query, so the sector baseline reflects the latest sector_benchmarks snapshot rather than static values baked into the bundle. Co-Authored-By: Patrick Munis <pmunis@gmail.com>
Contributor
Author
Original prompt from Patrick
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Update the phase21 test that previously asserted the hardcoded baseline scores (fintech: 87, healthcare: 92) to instead assert the page sources the baseline from trpc.sectorBenchmarks.list, and guard against reintroducing the hardcoded BASELINE_SCORES map. Co-Authored-By: Patrick Munis <pmunis@gmail.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.
Summary
Full-stack audit of NDSEP
main(frontend↔backend wiring, service/middleware integration, DB schema/indexes, AI/ML, and mock/placeholder/hardcoding scan). The platform is in good shape overall; this PR fixes the one clear "hardcoded value that should be DB-driven" the scan surfaced — a staticBASELINE_SCORESmap inSectorComplianceDetailthat even carried an explicit// TODO: migrate to DB-driven confignote.The page already fetched real data everywhere else; only the "baseline" comparison figure was baked into the bundle, so it never changed per audit cycle without a redeploy. It now reads the latest
sector_benchmarkssnapshot via the existingsectorBenchmarks.listrouter.Renders nothing when no benchmark row exists (no hardcoded fallback).
Audit findings (no code change needed, documented for reference)
trpc.<ns>.<proc>call in the client resolves to a registered router — 0 missing backends.server/_core/index.ts;emitMutationEventpresent across routers.CREATE INDEXstatements across migrations (incl.production-indexes.sql,0021_performance_indexes.sql).XGBClassifiermodels (.joblib) + SHAP + Ray ML engine + FastAPI services; CPU inference verified (~1.3ms/batch). tRPC routers call the Python workers with labeled deterministic fallbacks when a worker is offline.Verification
tsc --noEmit— 0 errorsnpm run build— succeedsLink to Devin session: https://app.devin.ai/sessions/7b19b09de740454faef61082df9c86da
Requested by: @munisp