Skip to content

feat(longitudinal): replay Rust CT-AR Rasch on current review workflow - #1005

Merged
seonghobae merged 24 commits into
mainfrom
fix/longitudinal-current-review-976
Aug 25, 2026
Merged

feat(longitudinal): replay Rust CT-AR Rasch on current review workflow#1005
seonghobae merged 24 commits into
mainfrom
fix/longitudinal-current-review-976

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Supersedes #976 while preserving the corrected Rust-first scientific tree.

Exact current state

Protected base: main@04d0bc21a2a20693bcf16108cd76d394fe844d23.
Exact current head: fd7b511e62c1f0a24190ef3fa65b06db50e6e32e, open, non-Draft and mergeable.

Repository-local CI, Security Scan, CodeQL, SAST Semgrep and ClusterFuzzLite are terminal-success on this exact head. Predecessor-head checks and reviews remain historical.

Scientific ownership

Production longitudinal/IRT likelihood, continuous-time state transition, MAP optimization, hyperparameter/state uncertainty and recovery arithmetic remain Rust-owned. Python performs validation, bounded materialization and orchestration only.

The current CT-AR variance derivative path differentiates the active exact/series branch and returns zero variance derivatives when the transition-variance floor is active. The simulator validates decay_rate before occasion traversal. Python/native boundaries enforce the current 100,000-occasion and 4,096-item resource ceilings before copying/materializing. Hyperparameter intervals are explicitly labeled conditional observed-information intervals with nuisance item/state blocks fixed; state intervals remain the documented measurement-observed-information approximation.

Review reconciliation

Current-code verification resolved the already-addressed findings for:

  • active-branch/floor CT-AR variance derivatives;
  • conditional hyperparameter interval labeling;
  • upfront simulator decay_rate validation, including single-occasion respondents;
  • response/item resource bounds before Python/native materialization.

The historical request to restore production NumPy fallbacks for the longitudinal estimators is not implemented: current canonical repository authority requires production psychometric arithmetic to remain Rust-first, with Python numerical formulas limited to explicit reference/test use. Informational observations about measurement-only state intervals, respondent-contiguous ordering, states-fixed hyperparameter Hessians, flat floor gradients, response/design canonical alignment and fully-missing-occasion interval identification remain visible rather than being represented as resolved source defects.

Acceptance boundary

The formal OpenCode CHANGES_REQUESTED review is retained. It evaluated predecessor head ed9868c1b3636d0470dc82367e80a43036483018 and reports a central coverage-evidence failure; it is not silently treated as current-head approval. Require fresh exact-head protected contexts and independent approval before merge. No review dismissal, gate weakening, force update or self-approval is used.

cursoragent and others added 16 commits August 17, 2026 16:37
Land a focused successor to #848 on live main: independent per-respondent
OLS trends and caller-supplied discrete AR predictions, with honest
estimand metadata, fail-closed worker joins, checked AR gaps, and
scale-relative slope degeneracy. Number the decision ADR-0018 so it does
not collide with main ADR-0015 or #948 ADRs 0016/0017.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Use two-token snake_case respondent IDs and cover NumPy scalar
observation conversion on the public longitudinal boundary.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
PR 948 already records Angoff delta-plot and Bradley-Terry MM. Carry
those accepted ADRs in this branch so the index does not skip numbers
and a later merge with the citation work does not drop them.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Close the leftover llvm-cov paths in the longitudinal state engine: skip an
unused worker chunk, test first-to-last sequence-span underflow as a helper,
and recover an AR series that starts after a leading missing occasion.
Accept Python int and NumPy integer scalars at the public boundary.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The required default-setup Analyze (actions) job is still the 17:40 UTC
init failure (feature-enablement HTTP 503). The repository CodeQL copy
already passed on a later rerun. This integration cannot call
`gh run rerun` (403, needs actions: write), so retrigger the stale org
check without changing product code.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
* Add joint MAP hierarchical continuous-time AR(1) Rasch slice.

Introduce a Rust-owned jointly estimated longitudinal IRT kernel stacked
on the #976 OLS/AR state layer: shared (mu, tau, lambda), elapsed-day
OU transitions, measurement-information Wald state intervals, and
honest estimand metadata. Multiple-membership u_h and GPU parity are
excluded. Python remains marshalling-only.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

* Accept NumPy intercept vectors and hide test-only scale helpers.

NumPy 2 no longer treats ndarray as a Sequence, so the hierarchical
simulator now accepts both sequences and arrays. Empirical-scale helpers
used only by unit tests are cfg(test) so the production lib stays clean.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 59 minutes.

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: 56e21300-4719-4f35-aefa-986ca436609c

📥 Commits

Reviewing files that changed from the base of the PR and between 9c12eab and 9bde983.

📒 Files selected for processing (28)
  • ARCHITECTURE.md
  • crates/fast-mlsirm-py/src/multilevel_bindings.rs
  • crates/mlsirm-core/src/lib.rs
  • crates/mlsirm-core/src/longitudinal.rs
  • crates/mlsirm-core/src/longitudinal_irt.rs
  • crates/mlsirm-core/tests/longitudinal_fail_closed.rs
  • crates/mlsirm-core/tests/longitudinal_short_interval.rs
  • docs/PRD.md
  • docs/TRD.md
  • docs/adr/0007-multilevel-multiple-membership-temporal.md
  • docs/adr/0019-rust-longitudinal-state-engine.md
  • docs/adr/0020-joint-hierarchical-ctar-rasch.md
  • docs/adr/README.md
  • docs/changelog.d/848-rust-longitudinal-state-engine.md
  • docs/changelog.d/hierarchical-ctar-rasch.md
  • docs/doctoring/multilevel_longitudinal_measurement.md
  • docs/documentation_coverage.md
  • docs/multilevel_multiple_membership_longitudinal_rfc.md
  • docs/traceability/requirements-matrix.md
  • docs/traceability/research-basis.md
  • docs/verification_validation_plan.md
  • python/fast_mlsirm/multilevel/__init__.py
  • python/fast_mlsirm/multilevel/contracts.py
  • python/fast_mlsirm/multilevel/estimation.py
  • tests/test_hierarchical_longitudinal_control_boundary.py
  • tests/test_hierarchical_longitudinal_irt.py
  • tests/test_longitudinal_state_estimation.py
  • tests/test_multilevel_core_loader.py
📝 Walkthrough

Walkthrough

The PR adds Rust longitudinal OLS/AR state estimation and joint MAP hierarchical continuous-time AR(1) Rasch estimation. It exposes fitting and simulation through PyO3 and Python APIs, adds validation and recovery tests, and updates architecture and verification documentation.

Changes

Longitudinal estimation

Layer / File(s) Summary
Longitudinal state engine
crates/mlsirm-core/src/lib.rs, crates/mlsirm-core/src/longitudinal.rs, crates/mlsirm-core/tests/*, docs/adr/0018-rust-longitudinal-state-engine.md
Adds independent respondent OLS trends and caller-supplied discrete AR predictions. The engine preserves missing occasions, validates inputs, runs deterministic worker sharding, and reports diagnostics.
Hierarchical CT-AR Rasch engine
crates/mlsirm-core/src/longitudinal_irt.rs, docs/adr/0019-joint-hierarchical-ctar-rasch.md
Adds joint MAP Rasch estimation with elapsed-day OU transitions, population parameters, latent states, Wald intervals, metadata, and deterministic simulation.
Python and PyO3 integration
crates/fast-mlsirm-py/src/multilevel_bindings.rs, python/fast_mlsirm/multilevel/*, tests/test_*longitudinal*, tests/test_multilevel_core_loader.py
Adds Python and extension bindings for state fitting, hierarchical fitting, and simulation. Validation, bounded marshalling, GIL release, metadata conversion, and end-to-end tests are included.
Scope and verification documentation
ARCHITECTURE.md, docs/PRD.md, docs/TRD.md, docs/adr/0007-multilevel-multiple-membership-temporal.md, docs/adr/README.md, docs/changelog.d/*, docs/doctoring/*, docs/documentation_coverage.md, docs/multilevel_multiple_membership_longitudinal_rfc.md, docs/traceability/*, docs/verification_validation_plan.md
Documents the separate OLS/AR and hierarchical CT-AR Rasch semantics, acceptance evidence, and excluded capabilities.

Estimated code review effort: 5 (Critical) | ~120 minutes

Merge Risk: 🟡 Moderate · up to c0c01

This PR adds longitudinal CT-AR fitting and simulation, but the current implementation can produce inconsistent optimization gradients or misleading uncertainty intervals, accept invalid simulation parameters, allocate from oversized inputs before rejecting them, and fail when the documented backend options are unavailable. The PR is not merge-ready until these bounded correctness, resource-safety, and API-contract risks are fixed or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant PythonCaller
  participant EstimationAPI
  participant PyO3Extension
  participant RustEstimator
  PythonCaller->>EstimationAPI: submit design and longitudinal data
  EstimationAPI->>PyO3Extension: marshal validated arrays
  PyO3Extension->>RustEstimator: fit state or hierarchical CT-AR Rasch model
  RustEstimator-->>PyO3Extension: return estimates, intervals, and diagnostics
  PyO3Extension-->>EstimationAPI: return Python mapping
  EstimationAPI-->>PythonCaller: return fitted result
Loading
sequenceDiagram
  participant PythonCaller
  participant EstimationAPI
  participant RustSimulator
  PythonCaller->>EstimationAPI: submit design, item intercepts, and seed
  EstimationAPI->>RustSimulator: request hierarchical CT-AR Rasch simulation
  RustSimulator-->>EstimationAPI: return states and responses
  EstimationAPI-->>PythonCaller: return occasion-major simulation result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 128 functions across 13 files. (15 skipped: 15 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the longitudinal CT-AR Rasch replay and the review-workflow purpose of this successor pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/longitudinal-current-review-976

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.

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review Please independently review exact current head ed9868c1b3636d0470dc82367e80a43036483018 against live main. Security Scan 32207235049, CodeQL 32207235160, Semgrep 32207235183, ClusterFuzzLite 32207235198, and every required Python/Rust/package/fuzz job in CI 32207235125 are terminal-success; the workflow-level CI conclusion is cancelled only because gpu-smoke exhausted its 30-minute budget inside Vulkan APT provisioning, a repository-owned first causal boundary now isolated in #1021. Inline review threads and formal reviews are empty. Verify the Rust CT-AR Rasch likelihood/state transition/MAP/Hessian/recovery ownership, zero raw-coordinate gradients outside clamped log-scale support, and fail-closed boundary Hessian/interval contract without transferring #976 predecessor evidence.

@opencode-agent opencode-agent Bot 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.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head ed9868c1b3636d0470dc82367e80a43036483018.

  • Head SHA: ed9868c1b3636d0470dc82367e80a43036483018

  • Workflow run: 32213322481

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (10 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (10 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (14 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (14 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test (4 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (4 files)"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: ed9868c1b3636d0470dc82367e80a43036483018
  • Workflow run: 32213322481
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head ed9868c1b3636d0470dc82367e80a43036483018.

  • Head SHA: ed9868c1b3636d0470dc82367e80a43036483018

  • Workflow run: 32213322481

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (10 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (10 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Docs (14 files)"]
  S2 --> I2["operator or user guidance"]
  I2 --> R2["Review risk: Docs (14 files)"]
  R2 --> V2["docs review"]
  Evidence --> S3["Test (4 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (4 files)"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 19, 2026 04:58

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review

Fresh re-review request: ContextualWisdomLab/.github#1136 has merged, fixing the central coverage-evidence bug (_install_trusted_uv() target-triple validation) that caused the prior REQUEST_CHANGES verdict on this PR. Please re-review exact current head ed9868c1b3636d0470dc82367e80a43036483018 — the underlying infrastructure blocker is now resolved on .github main. Do not transfer evidence from any prior head.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review

Re-dispatch unchanged exact head ed9868c1b3636d0470dc82367e80a43036483018 under central .github@bbedc1a51ec1a2421f129955c629b3cd0507a4ec. Current Security Scan, CodeQL, Semgrep, and ClusterFuzzLite are terminal-success; an earlier full CI on this same SHA is success, while the latest run was cancelled only at the known pre-#1021 GPU APT boundary. Inline threads are empty. The sole formal CHANGES_REQUESTED came from central coverage run 32213322481 before #1136 corrected trusted-uv verification; central main now also includes #1140's scheduler-caller OIDC repair. Reacquire same-head coverage/formal review evidence without transferring the old infrastructure verdict.

@seonghobae seonghobae closed this Aug 19, 2026
@seonghobae seonghobae reopened this Aug 19, 2026
@seonghobae seonghobae closed this Aug 19, 2026
@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 01:08
@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 02:19
@opencode-agent

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: fd7b511e62c1f0a24190ef3fa65b06db50e6e32e

@opencode-agent

Copy link
Copy Markdown
Contributor

Scheduled review-feedback autofix for this PR head.

  • Head SHA: fd7b511e62c1f0a24190ef3fa65b06db50e6e32e

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review disposition (5f65f4d)

  • The quadratic state-interval finding is already fixed in this head: the diagonal observed-information path returns 1 / diag[i] and retains the general tridiagonal path.
  • The raw-binding length-bound finding is already fixed in this head; the longitudinal arrays are bounded before ownership conversion.
  • The CT-AR derivative, single-occasion decay_rate validation, response-axis bounds, item-intercept bounds, and conditional hyperparameter-interval wording are present in this head and covered by the targeted Rust/Python tests.
  • The backend-fallback request is not adopted: the repository PRD/TRD make Rust the production numerical owner and reserve NumPy for the explicit reference/parity API. Adding a second production backend to these longitudinal APIs would violate that boundary.
  • Informational findings about canonical occasion order, measurement-only state intervals, fixed-nuisance hyperparameter information, and the intentional variance-floor gradient are documented design constraints, not unresolved source defects.

No valid unresolved source finding remains on the exact head. Hosted required checks and fresh reviewer verdicts remain authoritative.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge (squash) August 24, 2026 13:55
devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent
opencode-agent Bot disabled auto-merge August 24, 2026 14:43
devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae seonghobae closed this Aug 25, 2026
@seonghobae seonghobae reopened this Aug 25, 2026
@seonghobae seonghobae closed this Aug 25, 2026
@seonghobae seonghobae reopened this Aug 25, 2026
# Conflicts:
#	python/fast_mlsirm/multilevel/__init__.py

@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 new potential issue.

Open in Devin Review

Comment thread crates/mlsirm-core/src/longitudinal_irt.rs
@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
seonghobae merged commit 3dc3fe9 into main Aug 25, 2026
39 of 41 checks passed
@seonghobae
seonghobae deleted the fix/longitudinal-current-review-976 branch August 25, 2026 05:41
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants