Skip to content

fix(ptsChart): tolerate sets without points-to-set tuples (SCORING-102) - #183

Merged
CourtHive merged 1 commit into
devfrom
fix/pts-chart-optional-needed
Nov 20, 2026
Merged

CourtHive merged 1 commit into
devfrom
fix/pts-chart-optional-needed

Conversation

@CourtHive

Copy link
Copy Markdown
Owner

Summary

The factory's v2 kernel omits needed tuples for timed, aggregate and outs sets. ptsChart update() read
pointsToSet[0] unguarded, so SET1-S:T10 (no tuples) and SET3-S:TB7-F:T10 (3 of 17 absent) threw
Cannot read properties of undefined (reading '0') and the whole chart died.

  • Points without a tuple stay undefined in place and draw as a line gap (line().defined). No [0,0] is substituted. Their breakpoint circles are hidden and point order is kept.
  • The y-domain and the pre-match start come from the tuples that exist.
  • ptsMatch hides a set's series entirely when none of its points carries a tuple.

Tests

src/__tests__/ptsChartOptionalNeeded.test.ts (happy-dom, real ScoringEngine → buildEpisodes → ptsMatch().update()):
complete (TB7), all-timed (T10), mixed (TB7-F:T10) and a mid-set gap (vertex counts, monotonic x, gap width).

  • Negative control: on origin/dev 3 of 4 fail with the reported TypeError (the complete case passes as a control).
  • pnpm lint (0 warnings), pnpm check-types, pnpm test: 15 files, 199 tests pass.

Companion: epixodic fix/points-to-support-gate (real supportsPointsToVisualization).

🤖 Generated with Claude Code

The factory's v2 kernel omits `needed` tuples for timed, aggregate and outs sets. update()
read `pointsToSet[0]` unguarded, so SET1-S:T10 and SET3-S:TB7-F:T10 threw and the whole
chart died.

- points without a tuple stay undefined in place and draw as a line gap (line.defined),
  never a substituted [0,0]; their breakpoint circles are hidden; point order is kept
- the y-domain and pre-match start come from the tuples that exist
- ptsMatch hides a set's series entirely when none of its points carries a tuple

Tests: complete (TB7), all-timed (T10), mixed (TB7-F:T10) and a mid-set gap, rendered from
a real ScoringEngine through buildEpisodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016hSeUnCAQmFm1Cf6UvzPo5
@CourtHive
CourtHive merged commit 136b125 into dev Nov 20, 2026
1 check passed
@CourtHive
CourtHive deleted the fix/pts-chart-optional-needed branch November 20, 2026 20:50
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.

1 participant