test(guards): add comprehensive unit tests for contradiction guard#454
test(guards): add comprehensive unit tests for contradiction guard#454borjamoskv wants to merge 1 commit into
Conversation
Added tests for happy path, warnings, boundaries, and db error handling for `detect_contradictions` and `scan_all_contradictions` according to C5-REAL standards. Also fixed a bug in db error handling in `contradiction_guard.py` where a connection error during DB setup was not caught gracefully. Co-authored-by: borjamoskv <82632764+borjamoskv@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
∞ MÖBIUS — PR Analysis
Labels applied: Generated by MÖBIUS (Clojure/Babashka) — where code IS data |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
I've added comprehensive unit tests for
cortex/guards/contradiction_guard.pysatisfying the 3 tests per public function rule and following thepytestsetup with anaiosqlitein-memory database andFTS5virtual table. I also corrected a structural error incontradiction_guard.pywhere the database context manager was inside the exception block and causing unhandled exceptions if the database was entirely unreadable.Tests cover:
detect_contradictions: Happy path (clean), rejection (conflict), and boundary (noise / DB error).scan_all_contradictions: Happy path (found pair), boundary (empty DB), and boundary (DB error).PR created automatically by Jules for task 4158951521777795611 started by @borjamoskv