Skip to content

test(sudoku): lock pencil-notes positional 3x3 mini-grid with a snapshot - #778

Merged
wei18 merged 1 commit into
mainfrom
worktree-impl-716
Jul 11, 2026
Merged

wei18 merged 1 commit into
mainfrom
worktree-impl-716

Conversation

@wei18

@wei18 wei18 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What

Triage of #716 (from #688 item 4 / audit-sud-13) found the premise stale: Sudoku pencil notes do NOT render as a top-left vertical list. The only notes renderer in the repo (PencilNotesGrid, BoardCellView.swift, sole call site BoardView+Highlighting.swift) has rendered the conventional positional 3×3 mini-grid — digit N fixed in quadrant (N-1)/3,(N-1)%3, blanks preserved — since its introduction in 99f38ea, never modified since. NotesGrid bit conventions (bits 1..9) match on write and read.

What let the audit claim survive was zero snapshot coverage of notes rendering (every existing board fixture passes noteMask: 0). This PR adds that missing coverage as a regression lock — no production code changes:

  • BoardViewPencilNotesTests renders the full production path (BoardView → cell() → BoardCellView → PencilNotesGrid) with visually diagnostic patterns: {1,5,9} main diagonal · {2,4,6,8} edge midpoints · 1–9 full grid · {3,7} opposite corners
  • Own file because BoardViewTests.swift sits at the SwiftLint file_length ceiling

Verification

  • Record run + assert run green; BoardViewTests still 18/18; swiftlint --strict 0 violations
  • Baseline PNG (786×1704) eyeballed by Leader AND independently by the fact-check reviewer: all four patterns positional, nothing list-like
  • Dual code review APPROVE — the fact-check pass was run adversarially (tasked to refute the already-implemented conclusion) and could not

Closes #716

🤖 Generated with Claude Code

#716 (from #688 item 4 / audit-sud-13) claimed pencil notes render as a
top-left vertical list and asked for the positional 3x3 convention.
Verification against current main shows the premise is stale: the only
notes renderer in the app (PencilNotesGrid in BoardCellView.swift, sole
call site BoardView+Highlighting.swift) has rendered digit N in its own
quadrant (row (N-1)/3, column (N-1)%3) since its introduction in
99f38ea, and the NotesGrid bit convention (bits 1..9) matches on both
write and read sides. Rendered proof: the new committed baseline shows
{1,5,9} as the main diagonal, {2,4,6,8} as the four edge midpoints,
1...9 as the full grid, and {3,7} as opposite corners.

The gap that let the audit claim go unchallenged was zero snapshot
coverage of notes rendering (every existing fixture passes noteMask: 0).
This adds the missing coverage as a regression lock. The test lives in
its own file because BoardViewTests.swift sits at the SwiftLint
file_length ceiling (422 > 400 with the test inlined).

Verification: first run records the baseline, second run passes against
it; BoardViewTests still 18/18; swiftlint --strict 0 violations on both
test files; baseline PNG eyeballed (positional mini-grid patterns
confirmed, not a list).

Closes #716

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18
wei18 enabled auto-merge (squash) July 11, 2026 10:03
@wei18
wei18 merged commit b4a5291 into main Jul 11, 2026
4 checks passed
@wei18
wei18 deleted the worktree-impl-716 branch July 11, 2026 10:03
wei18 added a commit that referenced this pull request Jul 11, 2026
…722) (#782)

Timeline log for the five-issue wave: cross-app coordinate a11y l10n
(#755/PR #776), Sudoku state-suffix l10n (#771/PR #777), the #716 premise
refutation + pencil-notes snapshot regression lock (PR #778), MS practice
personal bests via seed-derived ids (#705/PR #779), and Sudoku digit-first
input (#722/PR #781). Records the three pre-push review catches, the
seed-reuse design decision, and process notes (haiku numeric spot-checks,
reviewer send-report instruction, filtered-batch verification).

Co-authored-by: Claude Fable 5 <[email protected]>
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.

feat(sudoku): render pencil notes as positional 3x3 mini-grid

1 participant