Skip to content

fix(rag): replay evidence limitation integrity - #1136

Merged
seonghobae merged 5 commits into
mainfrom
fix/rag-evidence-replay-integrity-1135
Aug 24, 2026
Merged

fix(rag): replay evidence limitation integrity#1136
seonghobae merged 5 commits into
mainfrom
fix/rag-evidence-replay-integrity-1135

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Closes #1135. Advances #607.

Defect

RAGEvidenceRegimeLimitations is factory-sealed and frozen, but a legitimate instance can still be rebound after construction with object.__setattr__. The direct to_dict() / limitations_fingerprint paths then serialized live fields, so a caller-defined limitation_codes container could execute iteration while package-owned replay was establishing the evidence-limit contract.

RED → GREEN

  • RED 1a1403eb521d14650fd4666e4dba4e8be62aa523: mutate a legitimate factory-created record with a hostile tuple subclass and require both manifest and fingerprint replay to fail with package-owned evidence-integrity error before caller iteration.
  • GREEN 607e4d24dda97deba898fae91ae42a501d2451ca: re-establish exact record, enum, tuple, text, and package-derived limitation semantics before projection; serialize only a fresh factory-derived record.
  • Coverage simplification fe525d780b82c53b66585fe6b85f3ae4621f473c: consolidate the replay state gate so valid records exercise the complete semantic comparison while the hostile-container regression exercises the fail-closed path.
  • Test documentation 4ded2d01336b6ba726589543785142468ce883ce: document the hostile iterator fixture without changing behavior.
  • Evidence 9a10e212e73e079c264444f1d19ea60f82976210: governed changelog fragment.

Preserved contract

All evidence regimes retain their existing negative-identification codes and deterministic fingerprints for legitimate factory-created records. No raw query/context/response content is introduced and no regime is upgraded into a world-truth authority.

Ownership boundary

Python schema/provenance replay only. No RAG scoring, retrieval, calibration, truth adjudication, likelihood, estimator, uncertainty, or other psychometric/statistical arithmetic changes. Production numerical ownership remains Rust-first.

Verification boundary

This branch is five commits ahead / zero behind protected main@04d0bc21a2a20693bcf16108cd76d394fe844d23 with a three-file effective diff. Keep Draft until exact-current-head CI/security/package/coverage and independent review evidence are terminal and clean; predecessor-head evidence does not transfer.

@coderabbitai

coderabbitai Bot commented Aug 21, 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: 55 minutes

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.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fcc96b7-0757-4ad7-b1cf-926c4b615218

📥 Commits

Reviewing files that changed from the base of the PR and between 04d0bc2 and 9a10e21.

📒 Files selected for processing (3)
  • docs/changelog.d/1135-rag-evidence-replay-integrity.md
  • python/fast_mlsirm/scoring/rag_evidence.py
  • tests/test_scoring_rag_evidence_limitations.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 21, 2026 07:20
@seonghobae
seonghobae enabled auto-merge (squash) August 21, 2026 07:21

@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 2 potential issues.

Open in Devin Review

Comment thread python/fast_mlsirm/scoring/rag_evidence.py
Comment thread python/fast_mlsirm/scoring/rag_evidence.py
@opencode-agent
opencode-agent Bot disabled auto-merge August 21, 2026 09:21
@seonghobae
seonghobae enabled auto-merge (squash) August 21, 2026 10:18
@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior labels Aug 22, 2026
@seonghobae
seonghobae merged commit 46ddb47 into main Aug 24, 2026
38 checks passed
@seonghobae
seonghobae deleted the fix/rag-evidence-replay-integrity-1135 branch August 24, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAG evidence limitation replay can trust post-construction mutation

1 participant