# Diagnostics

URL: /code/diagnostics · Id: `page:code/diagnostics`

> What every save and push checks before it compiles, and the errors it fails with, each naming its file, its line and the fix.

Every save under `npx startup-builder dev`, and every push, is checked before it compiles. A failing check stops the [Change](/business/nouns/change), names the file and the line, and states the fix.

## When each check runs
| Step | Stops on |
| --- | --- |
| Parse | A syntax error, a secret-shaped value, a key set twice, or a computed value in a file that takes literals only |
| Resolve | A route to `code/` with no reason, or a [Setting](/business/nouns/setting) set in two files |
| Build | A [Verb](/business/nouns/verb) with two bodies, such as a Verb function and a [Workflow](/business/nouns/workflow) on the same Verb |
| Check | A failing Verb test, [Role](/business/nouns/role) test, scenario test or [Evaluator](/business/nouns/evaluator) on the preview |

A Change whose checks fail cannot merge. Each [Builder](/business/nouns/builder) runs its part of the compile, and [one compile](/code/builders) walks all six steps.

## The errors a push fails with
Each is a standard problem document with a `type` URL, the file and the line.

| Error | Cause | Fix |
| --- | --- | --- |
| [Missing key](/code/api/errors/missing-key) | The Startup root file leaves out a key it requires, such as the Startup’s name. | Add the key named in the error to the root file, then push again. |
| [Wrong type](/code/api/errors/wrong-type) | A key in the Startup root file holds a value of another type than the key takes. | Change the value to the type the key reference lists, then push again. |
| [Not literal](/code/api/errors/not-literal) | A key in the Startup root file is computed by a loop, a call or an expression, so it cannot be parsed. | Write the value as a literal or a Template spread; move code that has to run into code/. |
| [Setting set twice](/code/api/errors/setting-set-twice) | A Setting is set both in the Startup root file and in the Settings file, so its value has two homes. | Keep the Setting in one file and delete it from the other, then push again. |

## Codes per convention
Each diagnostic carries a stable code and the file convention it belongs to, so an agent looks it up by code. The codes have status `planned`, one set per [file convention](/code/file-conventions).