feat: grade distribution, shareable reports, centering hints#113
Merged
Conversation
- Card detection returns 4 corner points, calculates tilt angle, rotates to straighten - Centering prompts now output lr/tb ratios (e.g. 55/45, 52/48) - gradeSubgrade passes through lr/tb fields to response - Demo data upgraded to v3 (8 subgrades, centering ratios on all 10 graded items) - 215 unit tests (tilt angle, straight card, extreme tilt cap)
- POST /api/grade accepts optional centeringHint (front/back lr/tb ratios) - Centering hint appended to subgrade prompts as user measurement reference - gradeSubgrade accepts promptSuffix for extensible prompt injection - Changelog trimmed from 171 to 46 lines (user-facing changes only) - docs/internals.md updated for tilt correction + Together AI + centering ratios - 218 unit tests
- computeGradeDistribution(overall, confidence) returns PSA grade probabilities (e.g. PSA 8: 65%, 8.5: 12%, 7.5: 23%) - gradeDistribution added to all grade responses (v3 detailed, Claude single, OpenAI single) - GET /api/grade/report/:id generates shareable PNG card (SVG→sharp→PNG) with scores, bars, distribution, limiter - 224 unit tests (6 new for distribution: high/low confidence, edge grades, half grades, snapping)
Comment on lines
+164
to
+168
| pipeline = sharp(rotated).extract({ left: rx, top: ry, width: rw, height: rh }); | ||
| } else { | ||
| pipeline = sharp(imgBuf).extract({ left: bx, top: by, width: bw, height: bh }); | ||
| } | ||
| } else { |
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
Test plan
node test/unit-test.js— 224 pass