feat: AI grading v3 — 8 subgrades, card detection, ML dataset#109
Merged
Conversation
… dataset pipeline - 8 subgrades (centering/corners/edges/surface x front/back) with 60/40 weighting - Card boundary detection via Haiku preflight — auto-crops user photos with background - Passive slab image collection from eBay sold listings into grading-dataset Firestore - Token usage + cost tracking per grade - Overall formula: (front*0.60 + back*0.40), capped at lowest subgrade + 1 - 172 unit tests, ~130 API tests
Comment on lines
+19
to
+23
| const imgRes = await axios.get(imageUrl, { | ||
| responseType: "arraybuffer", | ||
| timeout: 15_000, | ||
| maxRedirects: 5, | ||
| }); |
DNS-resolves hostnames and blocks private IPs, cloud metadata endpoints, and non-HTTP(S) schemes in detectAndCropCard and cropCorners.
…ction - Changelog v1.3.0: 8-subgrade grading, card detection, ML dataset, SSRF protection - README: version bump, updated AI grading description - Internals: v3 pipeline, SSRF validation, new Firestore collections, test counts - Preprocessing: SSRF-safe image fetch with DNS resolution + private IP blocking
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
grading-datasetFirestore collection. Owner-only stats endpoint.Test plan
node test/unit-test.js— 172 tests pass (roundGrade, image blocks, v3 formula, price trend edges)/api/grading-dataset/stats,/api/autocomplete,/api/sets/:setCode/api/gradewith front + back images — verify 8 subgrades +mode: "llm-detailed-v3"/api/gradewith front only — verify fallback with limitation notecardDetectionfield populated when user photo has background