fix(crm): bound response structural traversal - #1367
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 (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CRM response validator now limits structural traversal of built-in list and tuple containers to 40,000,000 visits. Tests cover rejection before NumPy or native-core processing and preserve valid matrix marshalling. ChangesCRM structural admission
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change bounds malformed response traversal before materialization without changing valid response handling; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 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 |
|
@coderabbitai review |
|
Closes #1366.
Defect
crm._trusted_response_array()already rejected callback-bearing response carriers, active-path cycles, and evidence above the 20,000,000 logical-cell envelope before NumPy materialization. Exact built-in list/tuple traversal still had no independent structural-work ceiling, so malformed zero-cell/deep container fan-out could consume unbounded Python traversal while contributing no logical response cells.RED → GREEN
5d8965445c69dbd465a8a65d6201eb12d9d116d4: a nine-node empty-container fan-out with a test-only structural ceiling of eight must fail with zeronp.asarray(...)and compiled-core calls.1e336ccfd273041e1a431e46053286099ebb5df2: add a structural-visit counter bounded at2 ×the existing logical-cell ceiling during callback-free exact built-in traversal.537af70905e71155c8cc41d7bea8100d2455c9ef: with a two-cell logical ceiling and four-node structural ceiling, a valid two-person × one-item built-in response matrix still reaches the Rust boundary unchanged.b4e00a17f7a9ad9efda16fd5aae791950c3fd579records the resource contract.For every valid non-empty 2-D built-in persons×items matrix with N scalar cells, traversal visits at most N row entries plus N scalar entries, so the 2N structural envelope preserves the complete valid matrix domain inside the existing logical-cell limit while bounding malformed container-only work.
Existing cycle rejection, shared acyclic subtree handling, exact NumPy row/scalar compatibility, complex/non-real/object/text diagnostics, NaN-only missingness, and logical-cell accounting remain unchanged.
Scientific ownership
Python validation/bounded materialization only. Samejima CRM likelihood, Gauss-Hermite integration, marginal-ML EM/WLS item updates, identification, convergence, uncertainty, EAP scoring, and all other production psychometric/statistical arithmetic remain unchanged and Rust-owned.
Fresh integration boundary
Protected base immediately before PR creation is
main@9c12eab15fb8a187b135f9be1961f0693a431c23. Exact branch head isb4e00a17f7a9ad9efda16fd5aae791950c3fd579. Fresh same-scope PR/branch checks found no competing CRM response-admission writer. All predecessor checks/reviews are non-transferable; keep Draft until exact-current-head repository and applicable protected central acceptance evidence are complete. No gate weakening, self-approval, force update, destructive rebase, or Python numerical substitute is used.Summary by CodeRabbit
Bug Fixes
Tests