refactor(flips)!: box nested FlipError payloads (#406)#435
Conversation
- Box nested typed `FlipError` payloads and the inserted-simplex witness while keeping scalar and key diagnostics inline. - Preserve typed inspection through `Error::source`, `reason.as_ref()`, and `source.as_ref()` for flip context, predicate, adjacency, simplex, neighbor-wiring, and mutation failures. - Add repository Semgrep checks for the boxed-source policy and document the tooling rationale. - Preserve padded changelog category headings during post-processing. BREAKING CHANGE: `FlipError` variants carrying nested typed errors or inserted-simplex witnesses now store those payloads in `Box`, so direct constructors and pattern matches must use boxed payloads and inspect them through `as_ref()`. Closes #406
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
WalkthroughFlipError variants were converted to use boxed typed payloads and marked as sources; From impls and callers were updated to box reasons; runtime classification and many tests match boxed inner errors via reason.as_ref(); Semgrep rules, fixtures, justfile wiring, and docs were added; changelog heading parsing and codecov target adjusted. ChangesFlipError Payload Boxing
Semgrep Rule Enforcement & Tooling
Changelog & Coverage
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 83.03% diff coverage · +0.03% coverage variation
Metric Results Coverage variation ✅ +0.03% coverage variation (-1.00%) Diff coverage ✅ 83.03% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (289b9b7) 62863 56884 90.49% Head commit (862766d) 63058 (+195) 57077 (+193) 90.52% (+0.03%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#435) 277 230 83.03% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/core/algorithms/flips.rs`:
- Around line 13776-13783: The test test_flip_error_boxes_nested_typed_payloads
uses ABI-dependent byte-size assertions on FlipError (size_of::<FlipError>() <=
48 and size_of::<Result<(), FlipError>>() == size_of::<FlipError>()); change
these to target-agnostic checks: remove hardcoded byte expectations and either
assert structural properties (e.g., that Result<(), FlipError> has the same
alignment/representation intent) or gate exact-size assertions behind
cfg(target_arch/target_pointer_width) so CI platforms don't fail; update the
test to reference FlipError and Result<(), FlipError> and use
platform-conditional checks or loosened bounds instead of fixed 48-byte
assertions.
🪄 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.yml
Review profile: CHILL
Plan: Pro
Run ID: 9020ab7e-fff5-4c0d-aa65-32b64b574297
📒 Files selected for processing (8)
docs/dev/tooling-alignment.mdscripts/postprocess_changelog.pyscripts/tests/test_postprocess_changelog.pysemgrep.yamlsrc/core/algorithms/flips.rssrc/delaunay/construction.rssrc/delaunay/insertion.rstests/semgrep/src/project_rules/rust_style.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #435 +/- ##
==========================================
+ Coverage 90.48% 90.50% +0.02%
==========================================
Files 71 71
Lines 62653 62848 +195
==========================================
+ Hits 56689 56882 +193
- Misses 5964 5966 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
- Isolate Semgrep settings state from generated rule-test config temp dirs. - Replace fixed FlipError byte-size expectations with target-agnostic layout checks.
- Raise the Codecov patch coverage target to 70%. - Run Semgrep fixture tests with isolated per-fixture state so Windows CI avoids shared settings-file races. - Cover boxed simplex-creation repair errors so geometric degeneracies remain soft-fail eligible while duplicate vertices stay hard failures.
FlipErrorpayloads and the inserted-simplex witness while keeping scalar and key diagnostics inline.Error::source,reason.as_ref(), andsource.as_ref()for flip context, predicate, adjacency, simplex, neighbor-wiring, and mutation failures.BREAKING CHANGE:
FlipErrorvariants carrying nested typed errors or inserted-simplex witnesses now store those payloads inBox, so direct constructors and pattern matches must use boxed payloads and inspect them throughas_ref().Closes #406