# HomeSyncHub v9.0 — Joshleen AI Enhanced Features & Task Automation

This release adds the requested Joshleen AI task automation layer on top of the existing HomeSyncHub PWA.

## Added

- Microphone button in the Joshleen AI chatbox for voice command capture where the browser supports Speech Recognition.
- File/photo upload directly inside the Joshleen AI chatbox.
- Todo task proof upload workflow for homework, worksheets, assignments, and school tasks.
- Homework verification hook using the OpenAI Responses API when `OPENAI_API_KEY` is configured on the server.
- Safe fallback when no API key is configured: proof is stored and the task waits for parent/admin review instead of being falsely marked complete.
- Chores continue to complete immediately without proof.
- Device unlock grant records after successful task/chore completion.
- Optional HTTPS webhook adapter for a native iOS Screen Time or Android device-management controller.

## Homework verification behavior

1. Create a Task with a homework-related title/category/notes, or tick **Require proof upload before completion**.
2. The Todo List shows **Upload proof & verify** instead of the normal Done button.
3. Shawn uploads a clear photo/file.
4. Joshleen AI checks the proof.
5. If verified correct, the task is completed and rewards/device access are released.
6. If incorrect or unclear, Joshleen AI asks for the work to be redone and re-uploaded.

## Chatbox upload behavior

- Attach a file/photo with the paperclip button.
- Send `homework done` with a proof photo to trigger homework verification against the first pending homework task.
- Send a chore completion message such as `washing dishes done` to complete a matching chore without proof.

## Server configuration

Set these environment variables on your PHP host if you want live AI verification:

```bash
OPENAI_API_KEY=your_api_key_here
# Optional demo/testing only:
# JOSHLEEN_AI_MOCK_VERIFICATION=pass
# JOSHLEEN_AI_MOCK_VERIFICATION=fail
```

Settings page options added:

- **Grant device access after successful completion**
- **Unlock duration minutes**
- **Homework AI model**
- **HTTPS unlock webhook**

## Device unlock integration note

The PWA cannot directly unlock an iPad, iPhone, or Android device by itself. The app now records a secure unlock grant and can call an HTTPS webhook. To enforce real device restrictions, connect that webhook to a native controller:

- iOS/iPadOS: native app using Apple Screen Time frameworks such as FamilyControls, ManagedSettings, and DeviceActivity.
- Android: device-owner / Android Enterprise / Device Policy based controller.

The included PWA layer is integration-ready: it decides **when** access should be granted after the task rules pass, then sends/records the grant.
