Skip to content

feat: grade distribution, shareable reports, centering hints#113

Merged
Pyronewbic merged 3 commits into
mainfrom
dev
May 15, 2026
Merged

feat: grade distribution, shareable reports, centering hints#113
Pyronewbic merged 3 commits into
mainfrom
dev

Conversation

@Pyronewbic

Copy link
Copy Markdown
Owner

Summary

  • Grade probability distribution: PSA 8: 65% / 8.5: 12% / 7.5: 23% — shows uncertainty honestly
  • Shareable grade report: GET /api/grade/report/:id returns PNG card with scores, bars, distribution
  • Centering hint: POST /api/grade accepts optional centeringHint for user-measured ratios
  • Tilt correction: 4-corner detection, auto-straighten via sharp rotate
  • Centering ratios: lr/tb fields in centering subgrade responses
  • Demo data upgraded to v3 with centering ratios
  • Changelog trimmed to user-facing changes only
  • 224 unit tests

Test plan

  • node test/unit-test.js — 224 pass
  • CI unit + codeql pass

- 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 {
@Pyronewbic Pyronewbic merged commit 5ef219e into main May 15, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants