feat: Grant Data Quality Score (#166) - #183
Merged
Abd-Standard merged 1 commit intoSep 1, 2026
Merged
Conversation
- Extend GrantRecord with optional enrichment fields (description, website, contactEmail, category, amount, currency, recipientName, recipientAddress, updatedAt) and add QualityGrade / QualityField / GrantQualityScore types plus ExportRequester/ExportRole - Add grant-quality.ts with weighted scoring engine (weights sum to 100), scoreGrantQuality(), scoreAllGrants(), listLowQualityGrants(), scoreToGrade(), formatQualitySummary(), formatQualityLabel() - Add 62-test suite in grant-quality.test.ts covering weight integrity, grade thresholds, field presence edge cases, full/partial/empty scoring, admin helpers, and display formatters - Add AdminGrantQualityPanel React component with summary stats, sortable/filterable list, per-row missing-field detail, colour-coded grade badges, and full ARIA accessibility Closes Core-Foundry#166
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
Implements issue #166 — a system that evaluates whether grant records contain the essential information needed by users.
Changes
frontend/src/types/grant.tsGrantRecordwith 8 optional enrichment fields (description,website,contactEmail,category,amount,currency,recipientName,recipientAddress,updatedAt)QualityGrade(A/B/C/D/F),QualityField, andGrantQualityScoretypesExportRequester/ExportRoletypes (already imported bygrant-export.ts)frontend/src/lib/grant-quality.ts(new)QUALITY_FIELD_WEIGHTS— 11 fields with weights summing to exactly 100scoreGrantQuality(grant)— returns 0–100 score, letter grade, present/missing field listsscoreToGrade(score)— A (≥90), B (≥75), C (≥60), D (≥40), F (<40)scoreAllGrants(grants)— scores and sorts worst-firstlistLowQualityGrants(grants, threshold=75)— admin filter helperformatQualitySummary()/formatQualityLabel()— display utilitiesfrontend/src/lib/grant-quality.test.ts(new)frontend/src/components/AdminGrantQualityPanel.tsx(new)Acceptance Criteria
QUALITY_FIELD_WEIGHTS)listLowQualityGrants()+AdminGrantQualityPanel)Tests
All 62 new tests pass. All pre-existing tests unaffected (grant-export: 18/18, grant-import: 22/22).