---
name: diffusion-lora-coreai lesson 08
description: >-
  Agent recipe for lesson 08: verify licensed data, Mac training, merge, Core AI
  export, on-device generation, and generation eval as one on-device delivery.
---
# End-to-end checklist

**Lesson id:** `08`  
**One-line goal:** Verify the baked diffusion personalization path from local data to a measured and evaluated on-device generator.

## Why this matters on a phone

The delivery is a baked resource (merge the LoRA into the base and export one model file), rebuild notes, and a device measurement. Not a notebook. Not a runtime adapter.

## Prerequisites

Lessons 01 through 05 and 07 completed on one project.

## Inputs

Contract, adapter, merged pipeline, export folder, Xcode app, device or intended simulator.

## Outputs and artifacts

A confirmed checklist note with checksums, prompt, seed, elapsed time, and `runtime_lora_swap: false`.

## Executable steps

1. Recreate or confirm the `uv` environment and `xcodebuild -version`.
2. Confirm base `sd-1.5` or `sd-2.1`, revision, license, subject or style, holdout, privacy plan.
3. Confirm MPS or CPU training, manifest, and holdout previews.
4. Confirm merge-before-export and that the adapter still exists.
5. Confirm `coreai.diffusion.export` or `torch.export` plus `coreai-torch` produced the resource folder.
6. Confirm the app prepared once and generated from the baked resource only.
7. Confirm lesson 07 golden-set grids, open codes, axial buckets, and yes-or-no checks exist.

## Constraints

No CUDA, quizzes, Mermaid, or em dashes. No hot-swap claim. Link the four prior courses and the writing-style sibling.

## Failure modes

Adapter treated as the product, missing holdout or device time, runtime swap language, lost adapter.

## Key concepts

- Delivery is the baked resource, rebuild notes, device measurement, and eval artifacts.
- Before train: licensed data, holdout, and a contract that forbids runtime LoRA swap.
- At ship: merge, export, intact folder, Xcode 27 prepare-once, and lesson 07 eval.
- Keep the adapter separately for retrain and rebuild.

## Takeaways

- Missing holdout or device time is an untested claim.
- A new engineer should rebuild from the manifest without guessing flags.
- The product is the baked `.aimodel` plus notes, not the adapter alone.

## Done when

Contract, adapter, merge, export, device measurement, and lesson 07 eval artifacts exist. A new engineer can rebuild from the manifest.

**Human lesson:** [End-to-end checklist](08-checklist.html)
