How dhrumilshah-216/rubix26_60_remedy works
Purpose and Runtime
This is a Python 3.10 Streamlit prototype for privacy-focused online-exam proctoring. It monitors a student webcam, records explainable risk events rather than cheating verdicts, stores short anomaly evidence, and provides a separate supervisor-facing review interface. Python 3.10 is a material constraint because of MediaPipe compatibility.
Primary entry points:
• app.py — Streamlit application entry point, expected student/supervisor UI host.
• supervisor.py — supervisor/principal review workflow.
• requirements.txt — Python runtime dependencies, including the CV/UI/AI stack.
Interface Separation
The architecture intentionally separates two roles:
• Student monitoring should expose only a minimal camera-preview experience and keep alerts, risk scores, and logs hidden.
• Supervisor review reads persisted artifacts and presents session risk summaries, timelines, and evidence playback.
The likely implementation boundary is between live capture/monitoring in app.py and post-/near-real-time audit consumption in supervisor.py. Both communicate through disk-backed logs and evidence rather than a shared database or in-memory service.
Live Monitoring and Vision Detection
The student-side monitoring stage acquires webcam frames and applies OpenCV plus MediaPipe face detection. Detection categories are face absence, multiple faces, approximate looking-away/head orientation, and session-level identity consistency against a login reference image.
Architectural characteristics:
• Detections are expected to require persistence/repetition, preventing isolated transient observations from becoming meaningful risk signals.
• Identity comparison is session-local; no external face database is part of the design.
• The monitoring control loop belongs under the Streamlit process launched from app.py.
Relevant path:
• app.py
Event Contract and Durable Audit Boundary
Suspicious observations are converted into append-only JSONL event records. Each record carries student/session identity, event type/subtype, timestamp and duration, confidence, evidence path, and device/session metadata.
Disk persistence is the primary integration contract: monitoring writes records, while supervisor workflows read them. This supports auditability and avoids relying on volatile process state.
Relevant paths:
• logs/.gitkeep — persisted event-log directory.
• app.py
• supervisor.py
Evidence Capture and Privacy Boundary
The system is designed not to continuously record exams. A rolling frame buffer should retain recent context so that a confirmed anomaly can emit a clip containing approximately five seconds before and after the event. Evidence files are persisted separately and referenced by event records.
This is the key privacy boundary: only event-associated clips should cross from live webcam processing into durable storage and supervisor review.
Relevant paths:
• evidence/.gitkeep — evidence-video storage directory.
• logs/.gitkeep — event-to-evidence references.
• app.py
Risk Aggregation and Escalation
Individual detections feed an explainable cumulative 0–100 risk score. Pattern-based accumulation and time-based decay distinguish low-level logging from medium UI highlighting and high supervisor alerts. The system’s stated policy is advisory: risk signals and evidence support human decisions; it must not automatically accuse, label, or punish students.
This stage is logically between detection/event creation and the supervisor presentation layer.
Relevant paths:
• app.py
• supervisor.py
Supervisor Review and External AI
The supervisor interface loads stored session events and evidence, renders risk timelines/summaries, and allows manual clip review. AI-generated audit summaries use the OpenAI API, making OpenAI an external service dependency and a boundary where only appropriately scoped audit context should be sent.
The application also includes an alarm media asset, likely for supervisor-side high-risk notification rather than student interruption.
Relevant paths:
• supervisor.py
• assets/alarm.mp3
• requirements.txt
Main entry points: logs/.gitkeep JSONL event records · supervisor.py Supervisor workflow · evidence/.gitkeep Anomaly clips · app.py Rolling frame buffer
Components 14
Student Monitoring
- Streamlit monitor · Hosts the student-facing camera experience and live control loop.
app.py - Webcam capture
- Vision detection · Detects absence, multiple faces, looking away, and session-local identity mismatch.
app.py - Persistence filter · Requires repeated observations before creating meaningful risk signals.
- Risk aggregation · Accumulates and decays advisory 0–100 session risk.
app.py - Rolling frame buffer · Retains recent context only until a confirmed anomaly needs evidence.
app.py
Audit Storage
- JSONL event records · Records session, event, timing, confidence, evidence reference, and metadata.
logs/.gitkeep - Anomaly clips · Stores event-associated clips rather than continuous exam recording.
evidence/.gitkeep
Supervisor Review
- Supervisor workflow · Loads persisted sessions for human review.
supervisor.py - Session review · Presents risk summaries, event timelines, and manual evidence review.
supervisor.py - High-risk alert · Highlights advisory high-risk sessions without automated punishment.
assets/alarm.mp3 - AI audit summary · Receives appropriately scoped audit context for generated summaries.
supervisor.py
Other components
- OpenAI API
- Python 3.10 CV/UI stack · MediaPipe compatibility makes Python 3.10 material.
requirements.txt
Connections 18
- Python 3.10 CV/UI stack → Streamlit monitor: provides runtime
- Python 3.10 CV/UI stack → Supervisor workflow: provides runtime
- Streamlit monitor → Webcam capture: runs
- Webcam capture → Vision detection: frames
- Vision detection → Persistence filter: observations
- Persistence filter → Risk aggregation: confirmed signals
- Webcam capture → Rolling frame buffer: recent frames
- Persistence filter → JSONL event records: append audit event
- Risk aggregation → JSONL event records: record score context
- Persistence filter → Rolling frame buffer: confirmed anomaly
- Rolling frame buffer → Anomaly clips: emit event clip
- Anomaly clips → JSONL event records: evidence path
- JSONL event records → Supervisor workflow: read persisted events
- Anomaly clips → Supervisor workflow: load clips
- Supervisor workflow → Session review: renders
- Session review → High-risk alert: high-risk notification
- Session review → AI audit summary: scoped audit context
- AI audit summary → OpenAI API: generate summary