feat: add image screening slice for #130 #187

Merged
Rockachopa merged 2 commits from fix/130 into main 2026-04-22 02:37:18 +00:00
Owner

Refs #130
Refs #132

What landed

  • add image_screening.py as the currently-unowned image-screening slice under the multimodal crisis epic
  • score OCR text, upstream labels, and operator notes for self-harm / crisis indicators using the canonical text detector where possible
  • return a structured ImageScreeningResult with distress_score, requires_human_review, and detected signals
  • add regression coverage for direct self-harm labels, OCR-triggered crisis text, neutral images, and dataclass serialization

Grounded scope

Verification

  • python3 -m pytest tests/test_image_screening.py tests/test_session_tracker.py crisis/tests.py tests/test_false_positive_fixes.py -q
  • python3 -m py_compile image_screening.py crisis/detect.py crisis/session_tracker.py crisis/gateway.py
Refs #130 Refs #132 ## What landed - add `image_screening.py` as the currently-unowned image-screening slice under the multimodal crisis epic - score OCR text, upstream labels, and operator notes for self-harm / crisis indicators using the canonical text detector where possible - return a structured `ImageScreeningResult` with `distress_score`, `requires_human_review`, and detected signals - add regression coverage for direct self-harm labels, OCR-triggered crisis text, neutral images, and dataclass serialization ## Grounded scope - this PR intentionally avoids the files already owned by open child PRs #173, #182, #184, and #186 - it does not claim raw vision-model inference, gateway wiring, or full epic completion - instead it lands a privacy-first local screening interface that future multimodal wiring can call ## Verification - `python3 -m pytest tests/test_image_screening.py tests/test_session_tracker.py crisis/tests.py tests/test_false_positive_fixes.py -q` - `python3 -m py_compile image_screening.py crisis/detect.py crisis/session_tracker.py crisis/gateway.py`
Rockachopa added 2 commits 2026-04-21 01:35:19 +00:00
feat: add image screening slice for #130
All checks were successful
Sanity Checks / sanity-test (pull_request) Successful in 4s
Smoke Test / smoke (pull_request) Successful in 10s
100cc743c0
Owner

🚫 Cannot merge PR #187 - Merge failed. Reason:

🚫 Cannot merge PR #187 - **Merge failed**. Reason:
Member

Perplexity Review — PR #187

Status: Approve

Summary

Adds image screening module that scores crisis risk from OCR text, object labels, and visual flags. Designed as metadata-level screening (not raw CV), pluggable into future multimodal pipeline.

Strengths

  • Explicit scope boundaries: screens text/labels only, does not claim pixel-level understanding
  • Tiered scoring: direct self-harm labels (0.85), injury (0.55), high-risk scenes (0.4)
  • Human review flag at threshold >= 0.4
  • Reuses existing detect_crisis() for OCR text analysis
  • Clean dataclass with to_dict() serialization
  • Tests cover high-risk, OCR-based, and neutral cases

Concerns

  1. Label set maintenance: Hardcoded keyword sets will need periodic review as language evolves. Consider externalizing to config.
  2. Score aggregation: max() across categories means a single match dominates. Consider weighted combination for nuanced scoring.
  3. No confidence weighting: All labels treated equally regardless of OCR/detection confidence.
  4. Missing edge cases in tests: No test for mixed signals (e.g., injury labels + benign OCR).

Verdict

Well-scoped screening module with clear boundaries and good safety defaults. Keyword maintenance and score aggregation could be improved. Ready to merge.

## Perplexity Review — PR #187 **Status: Approve** ### Summary Adds image screening module that scores crisis risk from OCR text, object labels, and visual flags. Designed as metadata-level screening (not raw CV), pluggable into future multimodal pipeline. ### Strengths - Explicit scope boundaries: screens text/labels only, does not claim pixel-level understanding - Tiered scoring: direct self-harm labels (0.85), injury (0.55), high-risk scenes (0.4) - Human review flag at threshold >= 0.4 - Reuses existing detect_crisis() for OCR text analysis - Clean dataclass with to_dict() serialization - Tests cover high-risk, OCR-based, and neutral cases ### Concerns 1. **Label set maintenance**: Hardcoded keyword sets will need periodic review as language evolves. Consider externalizing to config. 2. **Score aggregation**: max() across categories means a single match dominates. Consider weighted combination for nuanced scoring. 3. **No confidence weighting**: All labels treated equally regardless of OCR/detection confidence. 4. **Missing edge cases in tests**: No test for mixed signals (e.g., injury labels + benign OCR). ### Verdict Well-scoped screening module with clear boundaries and good safety defaults. Keyword maintenance and score aggregation could be improved. Ready to merge.
Rockachopa merged commit 4f040158e4 into main 2026-04-22 02:37:18 +00:00
Sign in to join this conversation.