# Safety Judge V13 Complete

Safety Judge is a native desktop safety-monitor prototype. It uses local OCR and a local, explainable classifier. It does **not** need an API key.

## What is fully implemented

- Profile chooser instead of a login screen
- Create, edit, switch, and delete profiles
- Separate report email, scan settings, enabled categories, and report history for every profile
- Overview dashboard with profile-specific totals
- Live full-screen OCR scanning
- One row per detected screen line
- Category, risk, active application, timestamp, and screen coordinates
- Temporary colored screen highlights
- Live scanning while the main window is hidden
- Protection starts automatically when the app is hidden (enabled by default per profile)
- Menu-bar controls when `pystray` is available
- Manual multi-line text analyzer
- Scam, dangerous advice, misinformation, spam, promotion, toxic, profanity, and safe categories
- Repeat-warning cooldown so the same line is not saved every few seconds
- Local JSONL report history
- Report filtering, search, deletion, and CSV export
- Email drafts to the profile's report address
- Optional SMTP auto-send using a password stored in the system keychain
- Optional desktop notifications
- macOS launch-at-login for the selected profile

## Run on macOS

1. Unzip the project.
2. Double-click `run_mac.command`.
3. Create a profile.
4. For screen scanning, grant Screen Recording permission to Terminal or Python:
   **System Settings → Privacy & Security → Screen & System Audio Recording**.
5. Restart the app after granting permission.

The launcher creates a private `.venv` and installs the Python packages. If Tesseract is missing, it offers to install it through Homebrew.

## Profile data

Data is stored locally in:

```text
~/.safety_judge_v13/
```

Each profile has its own folder and `reports.jsonl` file. Screenshots are processed in memory and are not saved by the app.

## Email behavior

The profile email is the report destination.

- **Email draft:** works through the default email application and does not store a password.
- **Automatic email:** configure SMTP in Profile & Settings. The app password is stored through the operating system keychain when available.

For Gmail automatic sending, use a Google App Password rather than the normal account password.

## Important limitation

The included classifier is a deterministic educational classifier, not a professional safety service. It warns about patterns it recognizes; it can miss harmful content or flag harmless content. It does not block apps, record keystrokes, or upload screenshots.

## Test

```bash
source .venv/bin/activate
python -m unittest discover -s tests -v
```
