Skip to content

test(scripts): add 26 tests for sudoku/core/generation.py (cycle 82)#1910

Merged
jsboige merged 1 commit into
mainfrom
test/sudoku-core-generation
May 30, 2026
Merged

test(scripts): add 26 tests for sudoku/core/generation.py (cycle 82)#1910
jsboige merged 1 commit into
mainfrom
test/sudoku-core-generation

Conversation

@jsboige
Copy link
Copy Markdown
Owner

@jsboige jsboige commented May 30, 2026

Summary

Adds 26 tests for (puzzle generation utilities).

** (11 tests)**: shape, dtype, values 1-9, no zeros, row/col/box validity (Sudoku constraints), seed determinism, different seeds diverge, no-seed default, solver compatibility.

** (11 tests)**: shape, dtype, solutions complete (no zeros), solutions valid Sudoku, puzzles have empty cells, values in range, given cells match solution, empty count respects range, reproducible, single puzzle, custom empty range.

Cross-invariants (4 tests): generated puzzles solvable by Norvig solver, flat grid compatible with solver, puzzles compatible with graph edge index, hard puzzles (50-55 empties) still solvable.

LIVE verification

5 callers: , , , +2 archived.

Test results

26 passed in 2.76s
Full suite: 1494 passed, 0 regression

po-2024 test-coverage cumulative (cycles 69-82)

Cycle Script Tests PR
69 validate_pr_notebooks 34 #1878
70 weekly_digest 19 #1880
71 validate_sc_notebooks 56 #1882
72 update_sc_navigation 42 #1885 (CLOSED dead-code)
73-79 genai-stack (7 modules) 373 #1886-#1905
80 sudoku/core/solvers.py 24 #1906
81 sudoku/core/graph.py + dataset.py 31 #1907
82 sudoku/core/generation.py 26 this PR
Total 605

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Covers generate_complete_grid (11), generate_puzzles (11), cross-invariants (4).

Grid validity (rows/cols/boxes), seed determinism, empty cell range,

puzzle-solution consistency, solvability via Norvig solver.

LIVE: 5 callers. Full suite: 1494 passed, 0 regression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@myia-ai-01 myia-ai-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED (forensic, ai-01) — test(sudoku): 26 tests for core/generation.py.

Target LIVE verifie : scripts/sudoku/core/generation.py exporte generate_complete_grid (L6) + generate_puzzles (L41) ; callers reels core/init.py:12 (re-export) + cpu_diagnostic.py:28/:100 (lecon dead-code #1876/#1885 appliquee). Tests importent les vraies fonctions + cross-check is_valid_puzzle (compat solveur). +211/-0, 1 fichier scripts/tests/, CI staleness+gitleaks PASS (test-only, pas de notebook touche). Cascade-independent (0 catalog/notebook).

Copy link
Copy Markdown
Collaborator

@clusterManager-Myia clusterManager-Myia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Hermes] — APPROVED

PR: test(scripts): add 26 tests for sudoku/core/generation.py (cycle 82)
SHA reviewed: b8f14bf (HEAD)

Checklist

  • Security scan: CLEAN
  • Cross-repo impact: None (test file only)
  • CI: All green (Staleness, Gitleaks)

Justification

Test-only PR (1 file, 211 lines). No notebooks, no production code modified. Test quality is strong:

  • Deterministic with fixed seeds, cross-seed variance verified
  • Row/col/box validity assertions + solver cross-validation (TestCrossInvariants)
  • Edge cases covered: single puzzle, zero-seed, custom empty ranges, hard puzzles (50-55 empties)
  • Clean class-per-module structure, proper sys.path setup

APPROVE — straightforward test addition, CI passes, no risk.

@jsboige jsboige merged commit 9c0d48d into main May 30, 2026
2 checks passed
@jsboige jsboige deleted the test/sudoku-core-generation branch May 30, 2026 22:37
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.

3 participants