fix(scoring): reject executable integer controls - #888
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change hardens governed scoring integer validation. It rejects caller-defined coercion before callbacks execute, preserves bounded ChangesScoring integer callback safety
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized validation change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant Caller
participant ScoringContracts
participant ScoringExecution
participant AssessmentSpecError
Caller->>ScoringContracts: build scoring request, observation, or result
ScoringContracts->>ScoringExecution: validate integer control or score category
ScoringExecution-->>ScoringContracts: normalized trusted integer
ScoringExecution-->>AssessmentSpecError: report invalid integer metadata
ScoringContracts-->>Caller: scored contract or AssessmentSpecError
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Pull request was converted to draft
Intent
Fixes #887 by making governed scoring integer controls inert before normalization. Public request/observation/result factories must reject caller-controlled integer protocols and subclasses before conversion or comparison callbacks can execute.
Test-first lineage
3146e963e40aabddae5f57d14e3d0c1fcd43c0e6adds public-constructor regressions for arbitrary__index__providers, caller-defined Python integer subclasses, caller-defined NumPy integer subclasses, and genuine NumPy scalar compatibility.a37685a5d1d098ea4be9f4538920ceda77545c11adds exact-type built-in/NumPy integer normalization with identity-only trusted-type admission.49fa0da07f37f1b46bfccb7cfd9e3bcd6fa95c9binstalls that boundary through the scoring contract composition surface before public execution factories are exposed.7fab468558008e00dde0c5631bb3c204afb5a049adds canonical changelog evidence.4c24c054af90b7b056e9c1f5306543d1dfcdb74fstrengthens public regressions so rejected arbitrary providers and caller-defined Python/NumPy integer subclasses also prove zero__int__,__repr__, equality, hashing, and rich-comparison callback execution.Preserved boundary
__index__providers, and caller-defined Python/NumPy integer subclasses fail before caller conversion/comparison/equality/hashing code can participate.AssessmentSpecErrorbounds remain authoritative.Exact current state
fb67ced09d8ee00542c05d56374537a9a7239751at the latest refetch.4c24c054af90b7b056e9c1f5306543d1dfcdb74f; GitHub reports the PR mergeable.4c24c054af90b7b056e9c1f5306543d1dfcdb74f; queued or running checks are not treated as predecessor evidence.Protected integration still requires every live exact-head gate plus a qualifying independent non-author approval and last-push approval under the live rulesets; no automated review or author action substitutes for those gates. Any future source-head or protected-base movement invalidates predecessor evidence and requires a fresh sweep.
Summary by CodeRabbit