# NEXT Athlete OS v97 RC3 – ChatGPT Image Handoff Workflow QA

## Scope

RC3 implements the controlled manual ChatGPT image-production workflow. It does **not** generate new exercise figures in-app and does **not** connect a paid AI provider.

The release adds the production-safe workflow Daniel described:

1. Choose one exercise in Bildadmin.
2. Choose one master athlete reference.
3. Copy/download one complete ChatGPT handoff package.
4. Generate exactly one image externally in ChatGPT.
5. Upload the generated image as a WebP draft.
6. Review it in the existing layered app preview.
7. Approve it into `assets/img/exercises/figures/<exerciseKey>.webp`.

## Implementation summary

### Added athlete templates

- `assets/img/athlete-templates/next-athlete-blond-b/reference.webp`
- `assets/img/athlete-templates/next-athlete-blond-b/reference.png`
- `assets/img/athlete-templates/next-athlete-blond-b/thumb.webp`
- `assets/img/athlete-templates/next-athlete-blond-a/reference.webp`
- `assets/img/athlete-templates/next-athlete-blond-a/reference.png`
- `assets/img/athlete-templates/next-athlete-blond-a/thumb.webp`

Default template is now:

```text
next-athlete-blond-b
```

### Added data files

- `assets/data/image-admin/master-prompts.json`
- `assets/data/image-admin/exercise-motion-prompts.json`

Pilot motion prompts are included for:

- `linear-pogos`
- `bear-crawl`
- `burpee-broad-jump`
- `burpee`
- `single-arm-row`

### Updated frontend

- `assets/js/services/image-admin-service.js`
  - loads templates, master prompts and motion prompts
  - builds full ChatGPT handoff packages
  - converts uploaded PNG/JPEG/WebP in-browser to 1600×900 WebP where supported
  - supports manual draft upload

- `assets/js/renderers/image-admin-renderer.js`
  - shows reference-athlete card
  - shows full prompt and exercise motion prompt separately
  - exposes copy/download buttons
  - exposes manual ChatGPT image upload CTA

- `assets/js/actions/image-admin-actions.js`
  - coordinates template/prompt/handoff state
  - handles copy/download/upload/mock draft/approve

### Updated backend

- `api/image-admin/upload-draft.php`
  - accepts manual WebP draft uploads
  - writes drafts under `assets/img/exercises/generated-drafts/<exerciseKey>/<templateId>/`
  - updates `assets/data/image-admin/status.json`

- `api/image-admin/health.php`
  - now reports file upload support and upload limits

## Positive prompt rule

The master prompt is written as a positive production instruction. It describes the target output and avoids building the generation on lists of negatives.

## Browser upload behavior

The browser attempts to convert selected images to:

```text
image/webp, 1600×900
```

before sending them to PHP. The PHP backend accepts only WebP drafts. This protects the active image convention:

```text
assets/img/exercises/figures/<exerciseKey>.webp
```

## QA executed

```bash
find assets/js -name '*.js' -print0 | xargs -0 -n1 node --check
find api/image-admin -name '*.php' -print0 | xargs -0 -n1 php -l
node tests/rc122_chatgpt_image_handoff_smoke.js
node tests/rc121_image_admin_foundation_smoke.js
python3 tests/rc121_image_admin_real_dom_qa.py
```

A local PHP server was also used to verify:

- `api/image-admin/health.php`
- `api/image-admin/upload-draft.php`

The upload endpoint accepted a WebP draft and wrote status correctly. The temporary QA draft was removed before packaging.

## Screenshots

- `qa_screenshots/rc122_chatgpt_handoff_mobile_390x844.png`
- `qa_screenshots/rc122_chatgpt_handoff_ipad_820x1180.png`
- `qa_screenshots/rc122_chatgpt_handoff_desktop_1440x1024.png`

## Caveats

- No real AI provider is connected in this release.
- No new final exercise figures are included in this release.
- Real iPhone/Safari upload conversion should be tested on the hosted environment.
- The current workflow is intentionally manual: ChatGPT generates externally, Bildadmin stores and approves.
