# Lessons on your project

> How a lesson finds the right case, table or trace in your own project, and what it uses when you have none.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://learn.docs.sypnia.com/courses/lessons-on-your-project/

For agents: Binding: each lesson declares `uses` selectors (case with failures / case that writes 2+ tables / case with where / table with RLS / trace with an error / landing promise). On opening, Learn picks a match from the learner's project (read through Cases, Data schema, Telemetry with the person's permissions), shows which one it chose and lets them pick another. No match or no project: the sample project La Espiga (public repo sespinosav/sypnia-learn-espiga) is used. The lesson text has slots ({{case.title}}…) filled from the chosen item. Data rows are never used by default, only schema and case text; traces only from preview/test environments unless the person chooses production (masked).

A lesson about failures is clearer when the failure is yours. So every lesson says what kind of example it needs, and Learn finds one in your project.

## How Learn picks the example

### 1. The lesson asks

The lesson file says what it needs, for example «a case with at least one failure» or «a case that writes to two tables».

### 2. Learn looks in your project

It reads your map from Cases, your tables from Data and your traces from Telemetry, with **your** permissions.

### 3. It shows its choice

At the top of the lesson: «This lesson uses your case “Order for today”». Choose **Use another** to pick a different one.

## What a lesson can ask for

| It asks for                              | Example from La Espiga                                                     |
| ---------------------------------------- | -------------------------------------------------------------------------- |
| a case with failures                     | «Order for today», with `OutOfStock` and `Closed`                          |
| a case that writes to several tables     | «Order for today» writes `order` and `order_item`: the transactions lesson |
| a case with a place in the app (`where`) | «Order for today» at `shop.order-for-today`                                |
| a table with row-level security          | `order`: a customer sees only their own orders                             |
| a trace with an error                    | a failed «Order for today» in the preview                                  |
| a promise of the landing page            | «Order before 9 and pick up warm bread»                                    |

## No project yet

Lessons use **La Espiga**, Sypnia's sample bakery, until you have a project of your own. It is an open repository with a full map, a design guide, tables and a preview, so every lesson has something real to point at. Exercises on the sample run on your own copy.

## What a lesson never takes

- **Rows of your data.** Lessons use the names of your tables and columns, never their contents, unless you choose **Use my rows** for that lesson.
- **Production traces**, unless you choose them. By default lessons use traces from previews and tests, and production traces are always masked the way Telemetry masks them.
