# Scope errors

> What counts as out of scope, why it is an error, and the only way to fix it.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://cases.docs.sypnia.com/contract/scope-errors/

For agents: Scope error kinds: unmapped (code implements a use case no case describes), unbuilt (an approved case in a delivered milestone has no code), drift (code and case disagree on data written, outcomes, failures or allowed actors), broken promise (landing promise without cases). Fix: change the map first via a proposal; never silence the check except with an explicit, reviewed waiver in map.yaml.

A **scope error** is a difference between what the contract says and what the code does. It is an error, not a warning, because every one of them is a surprise for someone: a client who gets what nobody agreed, or one who does not get what was promised.

| Kind               | What happened                                         | Example                                                                                                                  |
| ------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Unmapped**       | The code does something no case describes             | a «gift card» use case appears in the code; the map has no gift cards                                                    |
| **Unbuilt**        | An approved case in a delivered milestone has no code | _order-ready-notice_ is in milestone 2, which is marked delivered                                                        |
| **Drift**          | The code and the case disagree                        | the case says it writes `order`; the code also writes `customer_points`, or ends in an outcome the case does not declare |
| **Broken promise** | The landing promises something with no cases          | «Pay online» on the landing, no payment cases                                                                            |

The check reports other errors too, about the map itself: a case nothing can start, a place that does not exist, a loop with no stop. Those are mistakes in the map, not differences between map and code; the full list is in [The check](https://cases.docs.sypnia.com/contract/the-check#every-finding).

## The only fix

Change the map first, on purpose: a **proposal** that adds the gift cards, or removes the promise, or updates the case's data. When it is approved, the code is in scope again. The check never asks you to change code to match a map nobody approved.

## Waivers

Some differences are fine for a while: an internal admin script, a case kept for one more release. A waiver says so, in the map, with a reason and an end date, and it is reviewed like any change:

`cases/map.yaml (waivers)`

```yaml
waivers:
  - kind: unmapped
    target: rebuild-search-index
    reason: Internal maintenance job, not a user flow
    until: 2027-03-01
```
