Skip to content

fix(backend): reconcile fail-closed Rust loader handling - #831

Closed
seonghobae wants to merge 8 commits into
mainfrom
fix/backend-core-import-fail-closed-626-main
Closed

fix(backend): reconcile fail-closed Rust loader handling#831
seonghobae wants to merge 8 commits into
mainfrom
fix/backend-core-import-fail-closed-626-main

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Scope

Reconcile fail-closed native-loader handling and harden backend/device control validation without changing numerical ownership.

  • Normalize a discoverable-but-unloadable fast_mlsirm._core (ImportError or OSError) to package-owned RuntimeError("compiled Rust core is present but could not be imported") while preserving the original loader exception as __cause__.
  • Keep the genuinely missing-core path unchanged.
  • Reject non-string and str-subclass backend/device controls before caller-defined conversion or normalization callbacks and before native-core discovery.
  • Preserve case/whitespace normalization and allowlist behavior for exact built-in strings.
  • Record the boundary in executable tests, canonical doctoring and release evidence.

Test-first lineage

  • Existing RED/GREEN lineage covers discoverable-but-unloadable native extensions and stable causal error handling.
  • RED 17843d8b4ea6e866ac73a56732a4eb9cda7e4876 proves backend/device controls fail before hostile object/str callbacks and before native-core discovery.
  • GREEN 8c9713a2e3f1808899b91090fba6f22bd1975a15 requires exact built-in str controls before package-owned whitespace/case normalization and allowlist validation.
  • 80da63a257ab0cdcdcf0fba8f6f6ee76ab2c8dbc records the security and standards boundary.
  • Exact current head a52de8a80acc67409a5cab2d0d4c998239798eaf updates canonical release evidence.

Boundaries

No NumPy production fallback, estimator/formula/optimizer/GPU/dependency change, reflected caller exception text, force update, destructive rebase, gate weakening or self-approval.

Exact current state

  • Protected base: fb67ced09d8ee00542c05d56374537a9a7239751.
  • Exact source head: a52de8a80acc67409a5cab2d0d4c998239798eaf.
  • GitHub reports the PR mergeable and Draft.
  • Repository-local exact-head CI, security, static-analysis, Python/Rust/package/fuzz, coverage/source-tree and OpenCode check contexts are terminal-success; no unresolved current inline thread is present.
  • The formal OpenCode review on this exact head remains CHANGES_REQUESTED. Central run 31840983682 reported that required coverage evidence did not materialize, notwithstanding the separately successful target check contexts. This is central evidence/control-plane failure rather than source-defect proof, but the formal review remains effective until superseded or legitimately resolved.
  • The predecessor review on 6d99e29d6079f9c7e16187364e57046ab66e1586 is historical.
  • Protected integration also requires every live required context and a qualifying independent non-author approval.

No gate, review or approval is dismissed, weakened or bypassed. Any future source-head movement requires fresh exact-head evidence.

Supersedes the stale integration lane of #824 and advances #626.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a870734-3ab7-4c34-a372-941288015fbe

📥 Commits

Reviewing files that changed from the base of the PR and between fb67ced and a52de8a.

📒 Files selected for processing (5)
  • docs/changelog.d/831-rust-core-loader-fail-closed.md
  • docs/doctoring/automatic_backend_rust_authority.md
  • python/fast_mlsirm/backend.py
  • tests/test_backend.py
  • tests/test_backend_import_failure_contract.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
seonghobae marked this pull request as ready for review August 14, 2026 00:56

@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 6d99e29d6079f9c7e16187364e57046ab66e1586.

  • Head SHA: 6d99e29d6079f9c7e16187364e57046ab66e1586

  • Workflow run: 31765769047

  • 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: backend.py"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: backend.py"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_backend_import_failure_contract.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_backend_import_failure_contract.py"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: a52de8a80acc67409a5cab2d0d4c998239798eaf
  • Workflow run: 31840983682
  • 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 a52de8a80acc67409a5cab2d0d4c998239798eaf.

  • Head SHA: a52de8a80acc67409a5cab2d0d4c998239798eaf

  • Workflow run: 31840983682

  • 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["Docs (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["Changed file: backend.py"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: backend.py"]
  R2 --> V2["required checks"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (2 files)"]
  R3 --> V3["targeted test run"]
Loading

Copy link
Copy Markdown
Contributor Author

Fresh RCA on exact head 6d99e29d6079f9c7e16187364e57046ab66e1586: the current OpenCode CHANGES_REQUESTED maps to central dispatch run ContextualWisdomLab/.github #31765769047, not to a source/test failure in this PR. The central run validated live metadata, materialized the current merge tree, passed the replay guard and changed-file syntax gate, then failed at the first trusted infrastructure boundary before PR-controlled tests executed: Could not materialize base Python locks: trusted uv archive download failed: HTTPError. The central coverage job therefore failed and the model review was correctly skipped. Target-repository CI/Security/SAST success does not substitute for that missing central evidence, so the formal review remains effective and this PR must not merge until a fresh current-head central review completes successfully. No gate is being weakened or dismissed here; this records the owning-layer RCA so the source lane is not misdiagnosed.

@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 08:10

Copy link
Copy Markdown
Contributor Author

@opencode-agent review the current exact PR head after the release-note commit. Preserve all protected-main gates; do not merge or update the branch.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 14, 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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 14, 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 marked this pull request as draft August 14, 2026 09:15
auto-merge was automatically disabled August 14, 2026 09:15

Pull request was converted to draft

@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 09:15
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 09:15
@seonghobae
seonghobae marked this pull request as draft August 14, 2026 13:50
auto-merge was automatically disabled August 14, 2026 13:50

Pull request was converted to draft

@seonghobae
seonghobae marked this pull request as ready for review August 14, 2026 20:04
@seonghobae
seonghobae enabled auto-merge (squash) August 14, 2026 20:09

@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 a52de8a80acc67409a5cab2d0d4c998239798eaf.

  • Head SHA: a52de8a80acc67409a5cab2d0d4c998239798eaf

  • Workflow run: 31840983682

  • 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["Docs (2 files)"]
  S1 --> I1["operator or user guidance"]
  I1 --> R1["Review risk: Docs (2 files)"]
  R1 --> V1["docs review"]
  Evidence --> S2["Changed file: backend.py"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file: backend.py"]
  R2 --> V2["required checks"]
  Evidence --> S3["Test (2 files)"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test (2 files)"]
  R3 --> V3["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 14, 2026 21:56
@seonghobae
seonghobae marked this pull request as draft August 15, 2026 06:21
@seonghobae
seonghobae marked this pull request as ready for review August 15, 2026 15:05
@seonghobae
seonghobae marked this pull request as draft August 16, 2026 04:39

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please re-review exact unchanged head a52de8a80acc67409a5cab2d0d4c998239798eaf against the current central review implementation at protected .github main c47afc2dc68488292c1db7c9d6f82dcd5360f181. The effective current-head CHANGES_REQUESTED came from run 31840983682 on the older central review implementation and reported only missing/failed coverage evidence rather than a backend source finding. Review only; do not update this branch or merge.

Copy link
Copy Markdown
Contributor Author

Superseded without merge by #951 after same-scope reconciliation. #951 now contains this lane's package-owned normalization for discoverable-but-unloadable _core (ImportError/OSError with preserved __cause__), exact-built-in backend/device selector admission before caller callbacks/native discovery, the dedicated unloadable-core regression, callback-safety regressions, changelog evidence, and the consolidated automatic_backend_rust_authority doctoring while preserving #951's buyer-facing automatic-Rust contract. Keeping both PRs open would leave competing writers on backend.py, tests/test_backend.py, and the canonical doctoring file. #951 remains Draft/diverged and must still be reconciled to live main and re-proven on its own exact head; no #831 check/review is transferred as merge authority.

@seonghobae seonghobae closed this Aug 17, 2026
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.

1 participant