feat(rag): govern perturbation anchors for privacy-preserving scoring - #798
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR adds governed RAG perturbation anchors. It defines finite perturbation semantics, validates immutable content-addressed identities, exposes a builder API, documents privacy boundaries, and adds fail-closed contract tests. ChangesRAG perturbation anchors
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant AnchorBuilder
participant RAGPerturbationAnchor
participant ArtifactDigest
Caller->>AnchorBuilder: provide anchor ID and request fingerprints
AnchorBuilder->>RAGPerturbationAnchor: validate and construct anchor
RAGPerturbationAnchor->>ArtifactDigest: fingerprint canonical anchor content
ArtifactDigest-->>RAGPerturbationAnchor: return deterministic fingerprint
RAGPerturbationAnchor-->>Caller: return immutable anchor
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
bf320d0 to
f75d376
Compare
|
@cwl-noema-review Independent exact-head review requested for Review only the four-path privacy-preserving RAG perturbation-anchor contract. Verify immutable/content-addressed anchor provenance, strict source/evidence binding, bounded caller-controlled collections, deterministic ordering, privacy/non-retention claims, and that perturbation anchors remain governed evidence rather than a scoring truth or validity claim. Exact-head CI, Security Scan, SAST and CodeRabbit status are successful and no review threads exist. Read-only review; do not modify or merge. |
|
Perform a read-only exact-head review of |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/doctoring/rag_scoring_request_privacy.md`:
- Around line 5-13: Update the references section in
rag_scoring_request_privacy.md by adding a concise mapping section that links
each perturbation direction to primary-source support, covering citation
attribution, evidence removal, robustness invariance, and abstention in addition
to the RAGAS/ARES-supported faithfulness, context relevance, and answer
relevance. If primary-source support cannot be established for any mapping, move
that mapping to an explicit model-design PR instead of presenting it as
literature-backed.
In `@python/fast_mlsirm/scoring/rag.py`:
- Around line 194-212: Update build_rag_perturbation_anchor to resolve the
canonical governed requests identified by baseline_request_fingerprint and
perturbed_request_fingerprint, then validate their kind-specific provenance and
evidence relationship before constructing RAGPerturbationAnchor or deriving its
identity. Reject unrelated request pairs, and add negative tests covering
invalid relationships for each applicable perturbation kind.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9fe00c30-8e17-4f39-a88e-3b3eaa9e74fb
📒 Files selected for processing (4)
docs/changelog.d/777-rag-perturbation-anchors.mddocs/doctoring/rag_scoring_request_privacy.mdpython/fast_mlsirm/scoring/rag.pytests/test_scoring_rag_perturbation_anchors.py
Surgical re-apply of draft #777 unique RAG paths onto current main. Local 13 tests green. Merge when product gates pass.
Summary by CodeRabbit
New Features
Documentation