# Step 15 — Implementation Detail 1. **Customer case** is a glossary term (`CONTEXT.md`): a caller-supplied slug grouping the Executions for one customer workload. An Execution started without one belongs to `unassigned`, so every Execution sits under a case. 2. **Layout.** `deliverables/cases//executions//` holds an Execution's files. `execution_dir`, `case_dir` and `lessons_file` in `app/states/execution_state.py` are the only places these paths are built. 3. **`execution.json`** in each Execution folder names the case, the Execution, the Session, the Workflow request, and for each Deliverable its document and attachments. 4. **`intent/`** in each case folder records the customer's Intent and its history (`app/customer_case.py`). Each Workflow request is written as given to `intent/001.md`, `002.md` and so on when its Execution starts. `intent/history.json` lists every statement in order with the Execution it started, that Execution's status (`in_progress`, `completed`, `completed_with_warnings`) and the path to its files. This replaced the `case.json` index first built for this step; `execution.json` carries `intent_version`. 5. **Lesson candidates** are grouped the same way: `lessons/candidates//.json`, and the record carries `customer_case`. 6. **Callers.** `ExecutionEngine.start(customer_case=...)`; `/generate` takes `customer_case` in its body and answers 400 for an unsafe one; A2A reads `customer_case` from the message metadata. The evaluation uses each benchmark case's id. 7. **The case id** must be 1 to 64 lowercase letters, digits or hyphens, starting and ending with a letter or digit. It becomes a directory name, so anything else is refused before the Execution starts. 8. **Existing content moved.** `deliverables/as-is`, `target`, `validation`, `guides` and the 68 old `executions` folders are now under `deliverables/cases/legacy-baseline/`, with an `intent/` folder built from the request recorded in each old run's `requirements.md`, ordered by file time. `scripts/validate_artifacts.py` and `tests/test_artifacts.py` look there. Limits: - An Execution that ends with warnings writes no Deliverable files (an existing rule). Its request is still in the Intent history, with its status and no path, and its lesson candidates are grouped under its case. - The 68 old runs were asked 12 different things but share one case, `legacy-baseline`. They can be split into a case per request from `intent/history.json` if that matters. - `/generate`'s response keys are unchanged, so it does not return the case; `execution.json` does. - The database rows carry the case only inside the status details, not as a column. Tests: `tests/execution/test_engine.py` (grouping, manifest, index, `unassigned`, refused ids), `tests/a2a/test_server.py` (`/generate`), `tests/execution/test_lessons.py`.