test(codegen): split test_codegen.py into 21 feature-focused files (#419) - #837
Conversation
) The monolithic tests/test_codegen.py (21,225 lines, 161 classes -- the largest file in the tree and the codegen mutation oracle) is split into twenty-one feature files, each under the issue's 1,500-line ceiling, alongside the six pre-existing test_codegen_* modules (untouched): expressions 89 calls 32 infrastructure 24 interpolation 33 effects 65 data_types 67 arrays 82 refinements 57 strings 113 string_builtins 149 numeric 85 io 42 collections 59 json 59 decimal 57 host_effects 57 nat_guards 39 translator_fixes 27 gc_alloc 39 gc_rooting 23 gc_reclamation 21 total: 1,219 (unchanged) The shared harness moves to a new tests/codegen_helpers.py: the eleven _compile*/_run*/WAT-and-GC assertion helpers (four of which lived interspersed between classes mid-file) plus the _IO_PRELUDE and _INLINE_BUILTIN_NAMES fixture constants, preserved in original order. Mechanical and behaviour-preserving: every class, helper def, and constant moves byte-for-byte -- verified by a per-block differential against git HEAD (174/174 blocks byte-identical). All 1,219 tests (including the 10 stress-marked) carry over unchanged; 1,209 pass with the default addopts, 10 deselect. Per-file import blocks are computed from actual body usage (not via ruff --fix, which rewrites function- local imports inside test bodies); ruff is clean without --fix. The issue's original 9-file plan was drawn at 10,019 lines / 118 classes; at 21,225 / 161 the same theme boundaries yield 21 files. Helpers use a plain tests/codegen_helpers.py module rather than the issue's conftest.py suggestion, matching the #420 precedent (they are assertion helpers, not fixtures). An adversarial 4-auditor verification pass (faithfulness / hygiene / docs / AC) ran pre-commit and surfaced stale cross-references the initial sweep missed; all fixed here: tests/test_execute_ characterization.py (13 "# overlaps" pointers), tests/test_browser.py (6 browser-parity docstrings), vera/codegen/assembly.py (2 -- one emitted into generated WAT comments for allocation-using modules), vera/environment.py (clamp fallthrough note), test_runtime_traps / test_int_overflow_codegen / test_string_length_soundness / test_check_changelog_updated (1 each), 5 conformance .vera headers, and the single column-0 @pytest.mark.stress decorator re-attached flush to its class (the split seam had legally-but-uglily separated them; the stress trio was run explicitly to confirm the marker held: 26 stress tests pass). Docs lockstep: TESTING.md (21-row table, 60 -> 80 file count, helpers prose, workflow step, feature-mapping refs), pyproject [tool.mutmut] oracle selection (the functional one -- a dangling path would silently zero the codegen sweep's oracle), CONTRIBUTING.md, KNOWN_ISSUES.md ("Refactoring needed" now empty -> "No files currently need decomposition.", with scripts/check_doc_counts.py taught the empty- section convention), CHANGELOG.md [Unreleased]. ROADMAP.md: #419 was the last Tier 1 item, so the Tier 1 section collapses to a done- sentence alongside Tier 0's. No version bump (no functional change). Closes #419 Co-Authored-By: Claude <noreply@anthropic.invalid>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (39)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📝 WalkthroughWalkthroughThe PR splits ChangesCodegen test suite split
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #837 +/- ##
=======================================
Coverage 92.06% 92.06%
=======================================
Files 90 90
Lines 27321 27321
Branches 324 324
=======================================
Hits 25154 25154
Misses 2159 2159
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review round 1 — pr-review-toolkit (code-reviewer)Clean verdict — no critical or important issues. The reviewer focused on the surfaces the deterministic gates don't cover and verified each against the working tree:
One low-priority suggestion, deliberately held rather than spending a CI round on it: the |
Single HISTORY.md reference at the end instead of one per tier, per review. Also folds in the pr-review-toolkit round-1 suggestion: the pyproject [tool.mutmut] also_copy comment now names all three split files whose tests read examples/ from disk (_infrastructure, _effects, _strings), not just the first. Skip-changelog: prose-only tweak to an [Unreleased]-covered PR (roadmap wording + a config comment) Co-Authored-By: Claude <noreply@anthropic.invalid>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/check_doc_counts.py`:
- Around line 44-49: The sentinel branch in check_doc_counts.py that returns an
empty list for "No files currently need decomposition." is untested, so add a
regression test in tests/test_check_doc_counts.py that explicitly exercises the
parse/check path for that exact message and asserts [] is returned. Use the
existing check_doc_counts flow and the empty-table case as a guide, but make the
new test pin the sentinel string so changes to KNOWN_ISSUES.md wording will fail
loudly.
In `@tests/codegen_helpers.py`:
- Line 141: Add proper type hints to the helper signatures in codegen_helpers:
annotate _compile_with_generator with its return type, and replace the inline
comment on _assert_chain_reclaims’s chain parameter with an explicit Callable
type annotation. Update the module imports to include Callable from typing or
collections.abc so both function signatures comply with the repo’s typing
guidelines.
- Around line 32-46: The _compile helper currently creates a temporary .vera
file with delete=False and never removes it, causing a leak on every call.
Update _compile in codegen_helpers to clean up the temp file after
parse_file/transform/compile complete, while keeping the Windows-safe
create-then-read flow intact. Use the existing _compile, parse_file, transform,
and compile symbols to place the cleanup in the right spot so the temp path is
always unlinked even if parsing or compilation fails.
In `@tests/test_codegen_io.py`:
- Around line 187-215: Replace the manual path normalization in the IO tests
with the preferred pathlib-based conversion. In the affected test helper code
that builds `vera_path` from `tmp_path` (and the analogous `tmp_file` usage in
the roundtrip test), use `Path(...).as_posix()` instead of `replace(os.sep,
"/")`, and add the needed `Path` import near the test imports so the Vera source
string still receives a POSIX-style path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5fdd740b-1bd9-4ac3-a806-0b245c1abf42
⛔ Files ignored due to path filters (5)
tests/conformance/ch07_io_read_char.verais excluded by!**/*.veratests/conformance/ch07_io_sleep.verais excluded by!**/*.veratests/conformance/ch07_io_time_stderr.verais excluded by!**/*.veratests/conformance/ch07_random_effect.verais excluded by!**/*.veratests/conformance/ch09_math_builtins.verais excluded by!**/*.vera
📒 Files selected for processing (38)
CHANGELOG.mdCONTRIBUTING.mdKNOWN_ISSUES.mdROADMAP.mdTESTING.mdpyproject.tomlscripts/check_doc_counts.pytests/codegen_helpers.pytests/test_browser.pytests/test_check_changelog_updated.pytests/test_codegen.pytests/test_codegen_arrays.pytests/test_codegen_calls.pytests/test_codegen_collections.pytests/test_codegen_data_types.pytests/test_codegen_decimal.pytests/test_codegen_effects.pytests/test_codegen_expressions.pytests/test_codegen_gc_alloc.pytests/test_codegen_gc_reclamation.pytests/test_codegen_gc_rooting.pytests/test_codegen_host_effects.pytests/test_codegen_infrastructure.pytests/test_codegen_interpolation.pytests/test_codegen_io.pytests/test_codegen_json.pytests/test_codegen_nat_guards.pytests/test_codegen_numeric.pytests/test_codegen_refinements.pytests/test_codegen_string_builtins.pytests/test_codegen_strings.pytests/test_codegen_translator_fixes.pytests/test_execute_characterization.pytests/test_int_overflow_codegen.pytests/test_runtime_traps.pytests/test_string_length_soundness.pyvera/codegen/assembly.pyvera/environment.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
aallan/vera-bench(manual)
…st (#419) Three of the four findings fixed (the fourth skipped as out of scope, reasoning in the PR thread): - tests/codegen_helpers.py: _compile and _compile_with_generator now unlink their temp .vera file in a finally (the delete=False + manual-unlink Windows-safe pattern from CLAUDE.md; previously every call leaked one temp file). _compile_with_generator gains its tuple[CompileResult, CodeGenerator] return annotation (CodeGenerator promoted to the module import block) and _assert_chain_reclaims's chain param is now Callable[[int], str] instead of comment-typed. These are deliberate post-verification improvements to the new helpers module -- distinct from the byte-identical mechanical move proven at 3e01879. - tests/test_check_doc_counts.py: two regression tests pin the #419 empty-section sentinel in scripts/check_doc_counts.py -- the exact sentence passes, and any other rowless wording still errors (so the carve-out cannot mask a malformed table). Mutation-validated: the sentinel test goes RED when the carve-out is removed. - TESTING.md / ROADMAP.md counts follow (+2 tests -> 5,561). Validated: 1,209 codegen tests + 17 doc-counts tests green, ruff clean, doc-counts gate green. Skip-changelog: test-helper hygiene within the #419 PR, covered by its existing [Unreleased] bullet Co-Authored-By: Claude <noreply@anthropic.invalid>
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_codegen_gc_rooting.py`:
- Around line 146-164: Replace the tempfile workflow in the affected gc-rooting
tests with the existing parser helper: use parse_to_ast(src) instead of
NamedTemporaryFile + parse_file(path) + transform(tree), and pass the resulting
AST directly into compile just like the sibling nat-guards tests. Update the
three test methods named test_map_param_shadow_pushed_after_573,
test_set_param_shadow_pushed_after_573, and
test_decimal_param_shadow_pushed_after_573 accordingly, and remove the unused
temp file path handling (including delete=False) since no on-disk .vera file is
needed.
In `@tests/test_codegen_infrastructure.py`:
- Around line 89-190: The TestExampleRoundTrips methods repeat the same
example-file loading and compile pipeline, so extract that boilerplate into a
shared helper in tests/codegen_helpers.py and reuse it at the call sites. Add a
helper like _compile_example that encapsulates the
Path/read_text/parse_file/transform/compile flow, then update the example
round-trip tests to call it instead of duplicating the setup. Keep the existing
compile/execute helpers and align with the established _compile_ok/_run style
used elsewhere in tests/codegen_helpers.py.
- Around line 139-149: The trap assertion in test_safe_divide_trap_on_zero is
too broad and should target the normalized WasmTrapError raised by execute(...).
Update the test to use pytest.raises(WasmTrapError) and then assert the captured
exception’s kind is "contract_violation", so the check verifies the specific
normalized contract-failure path instead of accepting generic wasmtime or
RuntimeError shapes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: debbfc56-7131-4b60-9d26-f6ee3165dff6
⛔ Files ignored due to path filters (5)
tests/conformance/ch07_io_read_char.verais excluded by!**/*.veratests/conformance/ch07_io_sleep.verais excluded by!**/*.veratests/conformance/ch07_io_time_stderr.verais excluded by!**/*.veratests/conformance/ch07_random_effect.verais excluded by!**/*.veratests/conformance/ch09_math_builtins.verais excluded by!**/*.vera
📒 Files selected for processing (39)
CHANGELOG.mdCONTRIBUTING.mdKNOWN_ISSUES.mdROADMAP.mdTESTING.mdpyproject.tomlscripts/check_doc_counts.pytests/codegen_helpers.pytests/test_browser.pytests/test_check_changelog_updated.pytests/test_check_doc_counts.pytests/test_codegen.pytests/test_codegen_arrays.pytests/test_codegen_calls.pytests/test_codegen_collections.pytests/test_codegen_data_types.pytests/test_codegen_decimal.pytests/test_codegen_effects.pytests/test_codegen_expressions.pytests/test_codegen_gc_alloc.pytests/test_codegen_gc_reclamation.pytests/test_codegen_gc_rooting.pytests/test_codegen_host_effects.pytests/test_codegen_infrastructure.pytests/test_codegen_interpolation.pytests/test_codegen_io.pytests/test_codegen_json.pytests/test_codegen_nat_guards.pytests/test_codegen_numeric.pytests/test_codegen_refinements.pytests/test_codegen_string_builtins.pytests/test_codegen_strings.pytests/test_codegen_translator_fixes.pytests/test_execute_characterization.pytests/test_int_overflow_codegen.pytests/test_runtime_traps.pytests/test_string_length_soundness.pyvera/codegen/assembly.pyvera/environment.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
aallan/vera-bench(manual)
CodeRabbit's round-2 pass on PR #837 flagged three more pre-existing idioms inside byte-identically moved test bodies (tempfile parse dance in gc_rooting, example-loading boilerplate and a broad trap assertion in infrastructure); together with round 1's os.sep path normalisation they are collected in #838 rather than modified mid-split, per the PR's byte-identical-move contract (the #420 -> #835 pattern). Co-Authored-By: Claude <noreply@anthropic.invalid>
Per maintainer preference these land in this PR rather than deferring (#838 closes with it; the byte-identical mechanical move remains provable at 3e01879 in this PR's history): - test_codegen_io.py: tmp_path/tmp_file.replace(os.sep, "/") -> Path(...).as_posix() (the CLAUDE.md fixture convention). - test_codegen_gc_rooting.py: the three shadow-push tests drop the NamedTemporaryFile + parse_file + transform dance for parse_to_ast(src) -- one line, no file on disk, and removes the three per-run tempfile leaks. - test_codegen_infrastructure.py: the eight TestExampleRoundTrips methods route through a new codegen_helpers._compile_example(name) instead of repeating the Path -> read_text -> parse_file -> transform -> compile sequence. - test_codegen_infrastructure.py: the safe_divide precondition test narrows pytest.raises((WasmtimeError, Trap, RuntimeError)) to WasmTrapError with kind == "contract_violation" -- empirically confirmed as the normalised shape execute() produces (CodeRabbit's sketch had the import path wrong: vera.codegen.api, not vera.wasm.trap). Validated: 1,209 codegen tests green, ruff clean without --fix, doc-counts green (TESTING.md line counts follow; the KNOWN_ISSUES #838 row added earlier in this PR is removed again -- fixed, not deferred). Skip-changelog: test-hygiene within the #419 PR, covered by its existing [Unreleased] bullet Co-Authored-By: Claude <noreply@anthropic.invalid>
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
pyproject.toml (1)
129-132: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueComment names only one example file per category; harmless but could be more explicit.
The comment says "example round-trips in test_codegen_infrastructure / _effects / _strings" but doesn't name every split file that reads from
examples/on disk (per PR discussion). Functionally harmless since the CLI-args list below already includes all files needed by the in-process oracle.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyproject.toml` around lines 129 - 132, Clarify the repo-files comment in pyproject.toml by naming all split example tests that read from examples/ on disk, not just one representative per category. Update the existing explanatory comment near the in-process oracle copy list to explicitly mention the relevant test_codegen_infrastructure, test_effects, test_strings, and test_errors cases so the intent is unambiguous while keeping the current file list unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/codegen_helpers.py`:
- Around line 44-56: The tempfile cleanup in the helper that creates the source
file can fail because `path` is assigned only after `write()` and `flush()`
succeed; move the filename capture before the first write so the `finally` block
can always unlink it, even if writing fails. Apply the same fix in both helper
functions, including `_compile_with_generator`, and keep using `parse_file`,
`transform`, and `compile` unchanged.
- Around line 107-113: The _run_trap helper is too broad because it catches
multiple exception types from execute(...) instead of the normalized trap type.
Update _run_trap in codegen_helpers to assert only WasmTrapError, and import
that symbol so the test targets the specific trap path exposed by execute(...)
rather than unrelated RuntimeError or wasmtime exceptions.
---
Duplicate comments:
In `@pyproject.toml`:
- Around line 129-132: Clarify the repo-files comment in pyproject.toml by
naming all split example tests that read from examples/ on disk, not just one
representative per category. Update the existing explanatory comment near the
in-process oracle copy list to explicitly mention the relevant
test_codegen_infrastructure, test_effects, test_strings, and test_errors cases
so the intent is unambiguous while keeping the current file list unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 82ece338-3513-451b-94eb-99403b4ab362
⛔ Files ignored due to path filters (5)
tests/conformance/ch07_io_read_char.verais excluded by!**/*.veratests/conformance/ch07_io_sleep.verais excluded by!**/*.veratests/conformance/ch07_io_time_stderr.verais excluded by!**/*.veratests/conformance/ch07_random_effect.verais excluded by!**/*.veratests/conformance/ch09_math_builtins.verais excluded by!**/*.vera
📒 Files selected for processing (39)
CHANGELOG.mdCONTRIBUTING.mdKNOWN_ISSUES.mdROADMAP.mdTESTING.mdpyproject.tomlscripts/check_doc_counts.pytests/codegen_helpers.pytests/test_browser.pytests/test_check_changelog_updated.pytests/test_check_doc_counts.pytests/test_codegen.pytests/test_codegen_arrays.pytests/test_codegen_calls.pytests/test_codegen_collections.pytests/test_codegen_data_types.pytests/test_codegen_decimal.pytests/test_codegen_effects.pytests/test_codegen_expressions.pytests/test_codegen_gc_alloc.pytests/test_codegen_gc_reclamation.pytests/test_codegen_gc_rooting.pytests/test_codegen_host_effects.pytests/test_codegen_infrastructure.pytests/test_codegen_interpolation.pytests/test_codegen_io.pytests/test_codegen_json.pytests/test_codegen_nat_guards.pytests/test_codegen_numeric.pytests/test_codegen_refinements.pytests/test_codegen_string_builtins.pytests/test_codegen_strings.pytests/test_codegen_translator_fixes.pytests/test_execute_characterization.pytests/test_int_overflow_codegen.pytests/test_runtime_traps.pytests/test_string_length_soundness.pyvera/codegen/assembly.pyvera/environment.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
aallan/vera-bench(manual)
…ime (#419) - _compile / _compile_with_generator restructured so the try/finally encloses the tempfile from creation: the temp .vera is unlinked even when the write itself raises. (CodeRabbit's minimal reorder -- capture f.name before the write -- would not have achieved that: the cleanup lived in a later try block that a write failure never entered. The close-then-read shape is also strictly Windows-friendlier: the file is fully closed before parse_file reopens it.) - _run_trap narrows pytest.raises((WasmtimeError, Trap, RuntimeError)) to the normalised WasmTrapError, empirically validated: all 1,209 codegen-family tests -- every caller of the shared helper -- pass with the narrowed type. The three pre-existing test_codegen_* modules keep their own local helpers and are untouched. Skip-changelog: test-helper hygiene within the #419 PR, covered by its existing [Unreleased] bullet Co-Authored-By: Claude <noreply@anthropic.invalid>
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai Re the duplicate comment on the |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
git show 3119dce -- pyproject.toml
sed -n '110,140p' pyproject.tomlLength of output: 2098
|
What
Splits the monolithic
tests/test_codegen.py(21,225 lines, 161 test classes — the largest file in the tree, and the codegen oracle for the mutation sweep) into twenty-one feature-focused test files, each under the issue's 1,500-line ceiling, with the shared harness extracted to a newtests/codegen_helpers.py. Mechanical and behaviour-preserving — the companion to the #420test_checker.pysplit, and the last Tier 1 roadmap item.How
test_codegen_expressions.pytest_codegen_calls.pytest_codegen_infrastructure.pytest_codegen_interpolation.pytest_codegen_effects.pytest_codegen_data_types.pytest_codegen_arrays.pytest_codegen_refinements.pytest_codegen_strings.pytest_codegen_string_builtins.pytest_codegen_numeric.pytest_codegen_io.pytest_codegen_collections.pytest_codegen_json.pytest_codegen_decimal.pytest_codegen_host_effects.pytest_codegen_nat_guards.py@Natunderflow (#520) + narrowing (#552/#747) runtime guardstest_codegen_translator_fixes.pytest_codegen_gc_alloc.pytest_codegen_gc_rooting.pytest_codegen_gc_reclamation.pystress-marked)The shared harness — the eleven
_compile*/_run*/ WAT-and-GC assertion helpers (four of which lived interspersed between classes mid-file) plus the_IO_PRELUDE/_INLINE_BUILTIN_NAMESfixture constants — moves totests/codegen_helpers.py, imported per file via the repo'sfrom tests.<module> importpattern. The six pre-existingtest_codegen_*modules (closures, contracts, coverage, invariant_e699, modules, monomorphize) are untouched.Faithfulness proof
Every class, helper def, and constant moves byte-for-byte: a per-block differential against
git show HEAD:tests/test_codegen.pyconfirms 174/174 blocks byte-identical (161 classes + 11 defs + 2 consts), each appearing exactly once. Per-file import blocks are computed from actual body usage — not viaruff --fix, which rewrites function-local imports inside test bodies (the #420 lesson) — andruff checkpasses without--fix.An independent 4-auditor adversarial verification pass (faithfulness / hygiene / docs / AC, each finding judged by a separate refuter) ran before commit. It confirmed the split faithful and surfaced stale cross-references the initial sweep missed, all fixed in this PR: 13
# overlapspointers intest_execute_characterization.py, 6 browser-parity docstrings intest_browser.py, 2 invera/codegen/assembly.py(one emitted into generated WAT comments for allocation-using modules), 1 invera/environment.py, 4 more single-ref test files, 5 conformance.veraheaders — plus the one column-0@pytest.mark.stressdecorator the split seam had (legally but visibly) separated from its class, now re-attached flush.CodeRabbit's two review rounds then drove post-verification hygiene commits (distinct from the pure-move commit, which stays provably byte-identical in this PR's history): the compile helpers no longer leak their temp
.verafile and gained full type annotations, thecheck_doc_counts.pyempty-table sentinel is pinned by two mutation-validated regression tests, and the four carried-over test-body idioms were modernised in-PR per maintainer preference (as_posix()path normalisation,parse_to_astinstead of the tempfile parse dance, a shared_compile_example()helper, and the precondition-trap assertion narrowed to the empirically-confirmedWasmTrapError kind == "contract_violation") — closing #838.Deviations from the issue text (both precedented)
tests/codegen_helpers.py, notconftest.py: these are plain assertion helpers, not fixtures — matching the accepted Split tests/test_checker.py (5,522 lines) into phase-focused test files #420checker_helpers.pyprecedent.Roadmap: Tier 1 closed
#419 was the last Tier 1 item, so the ROADMAP's Tier 1 section collapses to a done-sentence alongside Tier 0's, and the tier count in the intro drops to two. KNOWN_ISSUES' "Refactoring needed" table is now empty → replaced with
No files currently need decomposition.(theNo known bugs.convention), withscripts/check_doc_counts.pytaught to accept that state.No version bump
Mechanical refactor — recorded as a CHANGELOG
[Unreleased]bullet; rides the next (feature) release.Verification
pytest --collect-only -m ""→ 1,219 (== original; 1,209 + 10 stress)pytest tests/→ unchanged totals (5,511 passed / 22 by-design skips)pytest tests/ -m stress→ all 26 stress tests pass (incl. the moved Mark the TestHostHandleReclamation573 trio as stress tests #738 GC-reclamation trio, 3m07s) — everything normally deselected was actually runruff check(no--fix) → cleanpython scripts/check_doc_counts.py→ consistent (5,559 tests / 80 files)python scripts/check_site_assets.py,check_version_sync.py→ green (no bump)pyproject.toml[tool.mutmut]oracle selection → the 21 new files (dangling-path check: all exist)Closes #419
Closes #838
Summary by CodeRabbit
test_codegen_*.pymodules.