fix(multilevel): reject hostile numeric callbacks - #785
Closed
seonghobae wants to merge 2 commits into
Closed
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
|
Superseded by GREEN on current main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reliability/security defect
Protected
mainaccepted subclasses of built-inint/floatfor multilevelmembership_weightand stationary AR coefficients, then coerced them withfloat(value). A hostile numeric subclass could therefore execute caller-controlled__float__code inside a package-owned validation boundary and leak its arbitrary exception instead of the stableMultilevelContractErrorcontract.Test-first RED
Fail-first exact head
0580fee690fa03e750e7284fa1700e5df2aba197was evaluated on synthetic merge0e52c0002ff3a7c837be1214715faac3fe53ad17over protectedmainc91ae210bc8e0340a5b0587cf5289b82a2e8ab92.CI run
31564180125, Python 3.14.6 job94012520401, reached the complete public test boundary and finished 7 failed, 3458 passed, 2 skipped. Five failures were inherited protected-main documentation/fit-statistics inconsistencies. The remaining exact two failures were the intended REDs intests/test_multilevel_hostile_numeric_callbacks.py:build_context_membership(...)andbuild_longitudinal_state_spec(...)dispatched hostile__float__callbacks and leaked their caller exception.Narrow GREEN
Current exact source head:
35bb61f7d70d1ba4993d3bb2f9397ce5b7e7b5a0on protected basec91ae210bc8e0340a5b0587cf5289b82a2e8ab92.The production correction remains limited to
python/fast_mlsirm/multilevel/_validation.py:intorfloatat these scalar contract boundaries;MultilevelContractErrorcodes/paths;Exact-current verification
CI run
31564554574is terminal on the unchanged exact head. Python 3.14.6 job94013619930collected the complete suite; both permanent hostile-callback regressions are GREEN and the final result is 5 failed, 3460 passed, 2 skipped. Python 3.12 failed on the same inherited five-test family.The remaining five failures are outside this two-file slice and reproduce the protected-main baseline line: two canonical documentation-maturity contract literals plus three historical NumPy-fallback expectations that contradict protected-main Rust fail-closed S-X²/person-fit ownership. Rust workspace/PyO3, package/reinstall, fuzz, explicit GPU smoke/parity, Security Scan, and SAST Semgrep succeeded on this exact head.
Merge boundary
Keep Draft. The slice-owned REDs are GREEN, but required repository-wide Python evidence remains non-passing until the protected-main baseline correction integrates. Do not mutate unrelated canonical documentation/fit-statistics paths or restore Python numerical fallbacks here. After the live base moves, regenerate every base-sensitive check/review on the unchanged final head before Ready/merge.
Refs #565.