Repository navigation
feat(contracts/fraud-detect): implement fraud risk flag schema and cross-contract scoring integration (#361) - #365
Draft
s6pa1rta3n-lab wants to merge 1 commit into
Draft
s6pa1rta3n-lab wants to merge 1 commit into
s6pa1rta3n-lab wants to merge 1 commit into
Conversation
…oss-contract scoring integration (nexoraorg#361) - Add RiskFlag schema, RiskLevel enum (Low=1, Medium=2, High=3, Critical=4), and WriterRegistry in common-utils - Implement monotonic flag ID sequence generator and bounded ring-buffer history (cap 50) - Implement O(1) effective risk cache and administrative override lifecycle - Add distinct events: flg_sub, flg_res, and override - Add WriterRegistry role-based authorization for multi-model flag submission - Implement cross-contract synchronous fraud checks in credit-score contract - Add comprehensive unit, boundary, and cross-contract integration tests - Add contract documentation and cross-contract integration ADR in docs/contracts/fraud-detect.md
|
@s6pa1rta3n-lab is attempting to deploy a commit to the Isaac Gellu's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the fraud risk flag schema, role-based writer registry, monotonic sequence ID generation, and O(1) effective risk query cache for
fraud-detect, addressing #361. Additionally implements synchronous on-chain cross-contract fraud verification incredit-scoreand provides comprehensive architectural documentation and ADR.Closes #361.
Key Architectural Deliverables:
Low (1),Medium (2),High (3),Critical (4).u64sequence generator in instance storage.flg_sub(FlagSubmitted),flg_res(FlagResolved),override(StatusOverridden).fraud-detectreturnsCriticalrisk.docs/contracts/fraud-detect.md.Testing done
cargo fmt --manifest-path contracts/Cargo.toml --all -- --checkcargo clippy --manifest-path contracts/Cargo.toml -p fraud-detect -p credit-score -p common-utils -- -D warningscargo test --manifest-path contracts/Cargo.toml --workspace(all 116 unit & integration tests pass across all workspace crates)contracts/fraud-detect/src/test/test_risk_flags.rscovering writer registry, monotonic sequence generation, duplicate resolution prevention, O(1) cache accuracy, admin override lifecycle, bounded capacity eviction, and real cross-contract interaction withcredit-score.Screenshots
N/A — no UI surface.
Checklist
feat/,fix/,chore/,docs/,refactor/)type(scope): summary)CONTRIBUTING.md)Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC