Skip to content

fix(subscores): seal scientific evidence admission - #1363

Merged
seonghobae merged 13 commits into
mainfrom
fix/subscore-evidence-admission-1362
Aug 25, 2026
Merged

seonghobae merged 13 commits into
mainfrom
fix/subscore-evidence-admission-1362

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1362.
Closes #1364.

Defects

subscore_analysis() originally admitted responses and groups through unrestricted np.asarray(...), so caller-defined __array__ or nested numeric conversion providers could synthesize or replace the person×item score matrix or item→subscale partition while Python validation was deciding what the Rust-owned Haberman/Sinharay analysis would receive.

After that callback boundary was sealed, the exact built-in list/tuple preflight still had no logical-cell, structural-work, or cycle bound. A self-referential container could therefore fail to terminate, malformed zero-cell fan-out could consume unbounded traversal work, and an exact NumPy broadcast leaf with tiny backing storage could expose an oversized logical array before parent-container materialization.

RED → GREEN

Callback-free scientific evidence — #1362

  • RED 2e3462f3f42d3a977a8973468d13f9becfaa4288: hostile top-level response/group array providers execute zero callbacks and fail before compiled-core discovery.
  • GREEN 1c9797483478ef6ec65a0e7b21b1bd2e85a6f12d: admit only exact NumPy numeric arrays or exact built-in list/tuple trees of package-trusted concrete Python/NumPy numeric evidence before NumPy materialization.
  • Compatibility proof 2550d3a17927efaeda6189141b4b254d8005058c: nested hostile numeric providers execute zero callbacks while ordinary built-in sequences containing concrete NumPy scalar values still reach Rust as canonical evidence.
  • Compatibility RED e06e0f7bfad8a8ddd5cbbb90f18bacf030c83aad → GREEN bfc8ad20eaaf39a42dcf66c3b16b66b4f8dea895: preserve exact inert NumPy numeric row leaves inside built-in response containers without admitting ndarray subclasses or generic array protocols.

Bounded/cycle-safe traversal — #1364

  • RED ced9f5bf79d099a70e7d059d6c19e337156c4ae5: exact 20,000,001-cell response evidence and exact broadcast NumPy leaves nested in built-in containers must fail before np.asarray(...) or compiled-core discovery.
  • GREEN c04778c58893354c25035daa66fc3701c236740a: enforce a 20,000,000 logical-cell envelope, charge exact NumPy leaves from inert .size metadata, traverse built-in containers with indexed frames, reject active-path cycles, and cap structural work independently before parent materialization.
  • Boundary proof 373f6af9a277bdc14ca8547ae87b1ed5698ce096: true self-cycles fail before NumPy, zero-cell fan-out obeys the structural budget, and repeated shared acyclic rows remain valid rather than being mistaken for cycles.
  • Governed evidence d232423d64279697996005d229cbdca997fcea0e records both trust and bounded-materialization contracts.

Existing complex-specific diagnostics, response shape/completeness checks, integer/nonnegative group contracts, group-allocation bound, Rust dispatch, and result schema remain unchanged.

Scientific ownership

No Cronbach-alpha, observed/disattenuated-correlation, Haberman PRMSE, augmented-score weight, added-value decision, likelihood, uncertainty, or other production psychometric/statistical arithmetic changes. Those computations remain Rust-owned; this PR changes Python validation, bounded materialization, marshalling, and regression evidence only.

Fresh integration boundary

The branch moved compatibly from d232423d64279697996005d229cbdca997fcea0e to exact current head 9982b85abb3664763c59eb2e9dab72251254271c by absorbing unrelated protected-base multilevel/CAT/fitstats work; the effective diff against current protected main@d77505e9dc8eee5780bf354e13dd4f4bf83df453 remains five subscore files. Current ancestry is 12 commits ahead / 2 behind with merge base f5d6189227545b42d3f384b4728c8d6f611063c7.

Exact-current-head CI, Security Scan, CodeQL and SAST Semgrep are all terminal success, there are no formal reviews or unresolved review threads, and the PR is now Ready for independent review. Merge still requires fresh merge-result/base-sensitive evidence, every applicable protected-central coverage/review/package/fuzz/SBOM/provenance/dependency context, resolved conversations, and the independent approvals required by active rulesets. No gate weakening, self-approval, force update, destructive rebase, or Python numerical substitute is used.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 1 second.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 449ccc93-3285-433e-8552-0808129d6b26

📥 Commits

Reviewing files that changed from the base of the PR and between d77505e and 5b46c87.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/changelog.d/1362-subscore-evidence-admission.md
  • python/fast_mlsirm/subscores.py
  • tests/test_subscore_complex_admission.py
  • tests/test_subscore_resource_admission.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

seonghobae added a commit that referenced this pull request Aug 25, 2026
Pin the baseline to protected main@9c12eab1 (v0.9.0). The open-PR queue
collapsed from 74 to 6 since the previous snapshot; replace the stale PR
table with the current six lanes (#1363, #1345, #1279, #1029, #1005, #998)
including their merge-forward state. Update gap-matrix evidence columns for
landed work: automatic Rust backend (#951/#1070), crossed multiple-membership
(#1014), the Figma design-boundary ADR now at docs/adr/0016 via merged
#1130, and cross-engine conformance (#1082) after #1077 closed as completed.
No production code, formula, estimator, or release surface changed.
@seonghobae

Copy link
Copy Markdown
Contributor Author

Merge-forward: replayed this draft onto main@f5d61892 (carrying the merged CAT administration #1345, fitstats S-X² #1029, longitudinal CT-AR #1005, and gap-baseline docs lanes). Auto-merge was clean; CHANGELOG.md regenerated from the merged fragment set (--check passes). Merge commit 9982b85a. Per the PR's own integration boundary, the Draft state is retained until exact-current-head CI/security/static/coverage/review evidence completes; predecessor-head checks/reviews are historical.

@seonghobae
seonghobae marked this pull request as ready for review August 25, 2026 09:16

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread python/fast_mlsirm/subscores.py
@seonghobae
seonghobae enabled auto-merge (squash) August 25, 2026 11:46
@opencode-agent
opencode-agent Bot disabled auto-merge August 25, 2026 12:03
@seonghobae
seonghobae merged commit dfd585a into main Aug 25, 2026
40 of 41 checks passed
@seonghobae
seonghobae deleted the fix/subscore-evidence-admission-1362 branch August 25, 2026 12:52
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.

fix(subscores): bound nested evidence traversal before NumPy materialization fix(subscores): seal response and group evidence before NumPy protocols

2 participants