Skip to content

Validate flow and postman model inputs - #1162

Merged
GiggleLiu merged 6 commits into
mainfrom
fix/flow-input-validation
Sep 18, 2026
Merged

GiggleLiu merged 6 commits into
mainfrom
fix/flow-input-validation

Conversation

@isPANN

@isPANN isPANN commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Share private constructor checks with deserialization for IntegralFlowBundles, IntegralFlowHomologousArcs, IntegralFlowWithMultipliers, MinimumCostCirculation, MinimumEdgeCostFlow, UndirectedFlowLowerBounds, DirectedTwoCommodityIntegralFlow, UndirectedTwoCommodityIntegralFlow, PathConstrainedNetworkFlow, and MixedChinesePostman; reuse those checks in the five existing create specifications.
  • Reject malformed terminals, capacity/cost arrays, bundles, and homologous arc indices; reject negative capacities, negative internal multipliers, and nonpositive bundle and lower-bounded flow requirements consistently.
  • Preserve public constructors, JSON fields, signed costs, BruteForce dimensions(), and existing capacity-domain limits.
  • Twenty files, based directly on main. Nested DirectedGraph endpoint validation is handled separately in Validate graph invariants during deserialization #1159.

Verification

  • Three create/deserialization regressions fail on main; two cost-flow deserialization regressions, two two-commodity flow regressions, and the lower-bounded flow regression fail before their fixes.
  • Full workspace all-feature tests: 6,488 passed; 2 existing ignored. Documentation tests on the preceding cost-flow commit: 145 passed; 4 existing ignored.
  • Focused graph model coverage run: 1,120 passed. Changed-line coverage: 99.86% across 694 lines; the remaining line is the bundle domain overflow error on narrower usize platforms. Both cost-flow models, both two-commodity models, and the lower-bounded flow model have 100% changed-line coverage.
  • Workspace all-target all-feature Clippy with warnings denied, formatting, and diff whitespace checks passed.
  • Prescribed-path flow and mixed postman deserialization reuse existing fallible constructors; new rejection tests cover malformed paths, terminals, and weight vectors. Both additions have 100% changed-line coverage.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.85591% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.05%. Comparing base (7dd5fcd) to head (effeae4).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/models/graph/integral_flow_bundles.rs 98.48% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1162      +/-   ##
==========================================
+ Coverage   95.93%   96.05%   +0.12%     
==========================================
  Files        1074     1074              
  Lines      132106   132935     +829     
==========================================
+ Hits       126730   127685     +955     
+ Misses       5376     5250     -126     

☔ 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 flow models consistently across input boundaries Validate flow and postman model inputs Sep 17, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@GiggleLiu

Copy link
Copy Markdown
Contributor

Final review notes

  • Pushed one mechanical commit rewriting !(a < b) / !(c > 0) as a >= b / c <= 0 in the three integral-flow models. Older clippy (1.93) denies these under nonminimal_bool; behaviour is identical.
  • Same follow-up as Validate graph, set-system, and database deserialization #1161: consider pub fn try_new on the new constructors so reductions can build these targets fallibly, 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: all new rejections trace to existing asserts; JSON fields preserved; make check passes locally on the merged state after the clippy rewrite. Approving.

@GiggleLiu
GiggleLiu merged commit de81e1f into main Sep 18, 2026
7 checks passed
@GiggleLiu
GiggleLiu deleted the fix/flow-input-validation branch September 18, 2026 03:42
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