Skip to content

Validate string and scheduling model inputs - #1166

Merged
GiggleLiu merged 8 commits into
mainfrom
fix/scheduling-model-deserialization
Sep 18, 2026
Merged

GiggleLiu merged 8 commits into
mainfrom
fix/scheduling-model-deserialization

Conversation

@isPANN

@isPANN isPANN commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reuse constructor validation when loading six string models and eight scheduling models.
  • Rebuild derived string length bounds rather than trusting persisted caches.
  • Share checks with existing create specifications and remove duplicated validation.
  • Reject malformed precedence indices and deadline arrays at JSON loading boundaries; preserve integer range checks for finite schedule slots.
  • Preserve public constructors, solver/reduction APIs, and JSON field names. CLI tests use shared constructor diagnostics.
  • Scope: 30 files and 859 additions, based directly on main.

Verification

  • Workspace all-feature unit and integration tests: 6,495 passed, 2 ignored.
  • Changed-line coverage against main: 99.33% (593 of 597 instrumented lines). Four uncovered lines: three empty-alphabet error branches and one platform-width overflow error branch.
  • Workspace all-target all-feature Clippy, formatting, and whitespace checks pass.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.32886% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.14%. Comparing base (4ceac5a) to head (ab760ea).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/models/misc/closest_string.rs 96.15% 1 Missing ⚠️
src/models/misc/grouping_by_swapping.rs 95.45% 1 Missing ⚠️
...odels/misc/scheduling_with_individual_deadlines.rs 97.77% 1 Missing ⚠️
src/models/misc/string_to_string_correction.rs 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1166      +/-   ##
==========================================
+ Coverage   96.00%   96.14%   +0.13%     
==========================================
  Files        1074     1074              
  Lines      132526   133475     +949     
==========================================
+ Hits       127233   128328    +1095     
+ Misses       5293     5147     -146     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@isPANN isPANN changed the title Validate scheduling model deserialization and creation Validate string and scheduling model inputs Sep 17, 2026
@GiggleLiu

Copy link
Copy Markdown
Contributor

Final review notes

  • Pushed one mechanical commit rewriting !(!string.is_empty() || budget == 0) as string.is_empty() && budget != 0 in grouping_by_swapping.rs; clippy 1.93 denies the original under nonminimal_bool. Behaviour identical.
  • Same series follow-up as Validate graph, set-system, and database deserialization #1161: consider pub fn try_new on the new constructors, and the test_ prefix on new tests.

@GiggleLiu GiggleLiu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Final review: cached length bounds rebuilt on load, JSON shapes preserved, rejections trace to existing asserts; make check passes locally on the merged state after the clippy rewrite. Approving.

@GiggleLiu
GiggleLiu merged commit 7d0a221 into main Sep 18, 2026
7 checks passed
@isPANN
isPANN deleted the fix/scheduling-model-deserialization branch September 18, 2026 10:22
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.

2 participants