# Verification

**Verification runs your project's build or test command against the cycle's code.** Hlix records the result, gives the harness one repair turn on failure and includes the result in review.

## Prerequisites

- A project in your Workspace.
- `manage` access on the project to set the command. Portal clients cannot change it.
- A command that exits `0` on success and non-zero on failure. hlix reads only the exit code.

## Where the command comes from

The more specific setting wins.

| # | Setting | Set with | Use it for |
| --- | --- | --- | --- |
| 1 | The repository's own command | `PATCH /v1/api/projects/{id}/repos/{repoId}` · field `verifyCommand` | Repositories that need different checks |
| 2 | The project default | `PATCH /v1/api/projects/{id}` · field `verifyCommand` | One command that suits every repository |

A blank value counts as unset at both levels. If neither names a command, the run records a **skip**.

You rarely have to type the command. When none is set, hlix reads your `package.json` the first time the project starts — the `test` script, otherwise `typecheck`, `check` or `lint`, run with the package manager your lockfile names — and saves it on the repository, where you can change it. The preview's command and port are detected the same way, from the `dev` or `start` script.

### Set the project default

```bash
curl -sS -X PATCH "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID" \
  -H "x-api-key: $HLIX_API_KEY" \
  -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
  -H 'content-type: application/json' \
  -d '{"verifyCommand":"npm test"}'
```

Expected result: `200` and the updated project, with `"verifyCommand": "npm test"`. Send `{"verifyCommand": null}` to clear it.

### Override it for one repository

```bash
curl -sS -X PATCH "$HLIX_BASE_URL/v1/api/projects/$PROJECT_ID/repos/$REPO_ID" \
  -H "x-api-key: $HLIX_API_KEY" \
  -H "X-Organization-Id: $HLIX_WORKSPACE_ID" \
  -H 'content-type: application/json' \
  -d '{"verifyCommand":"pytest -q"}'
```

Expected result: `200` and the updated repository. The command is limited to 4,000 characters at both levels.

Both fields are also editable in the project's settings window under **Environment**: the project default on the verification panel, and the per-repository override on each repository's row. See [Repositories](/configure/repositories/).

## What runs, in order

1. **Setup.** If the repository has a setup command, it runs in the run's checkout before the harness starts. A failure stops the run so you can correct setup before coding starts.
2. **The harness's turn.** The cycle's [harness](/guides/connect-agents/) edits the checkout.
3. **Verification.** Your command runs in that checkout, with the same environment the setup command had.
4. **One repair turn, only on a failure.** The harness receives the brief again, plus the command, its exit code and the end of its output.
5. **Re-verification.** The command runs again. That result is final.

After the repair turn, the final result is recorded for review.

## The three results

| Result | What it means | What happens next |
| --- | --- | --- |
| **Passed** | The command exited `0`, on the first run or after the repair turn | The cycle branch is pushed and goes to review |
| **Failed** | Still non-zero after the repair turn | The work is **still pushed** and goes to review with the failure on record. Review re-runs the command on the combined work; a rejection puts the findings back on the cycle's checklist, and the next run continues from the pushed branch |
| **Skipped** | No command is set | Recorded in the run's log as skipped; configure a command to enable the check |

Failing work is pushed for inspection and continuation on the same branch. Configured verification must pass in review before delivery.

## Reading the result

Open the cycle's run log to see the command, result and any repair attempt. Failed checks include the end of the command's output. Review uses these results alongside its own checks.

## Limits

| Limit | Value | Why |
| --- | --- | --- |
| One verification run | 10 minutes | A hung test suite becomes a failed result instead of using up the run's time |
| Output returned | Last 120 lines, capped at 8,000 characters | The failure summary is at the end of a long log |

The log marks truncated output. Keep credentials out of test output and artifacts, including screenshots and recordings.

A run stopped at the 10-minute limit counts as **failed**: the work goes to review with the evidence recorded, as for any other failing command.

## Run end-to-end tests locally

For a web project using the `e2e` runner, its configuration is in `e2e.config.ts` and its tests are in `tests/*.e2e.ts`. Start the app with its normal development command, then run the suite from the repository root, replacing the URL with your app's address:

```bash
E2E_BASE_URL=http://localhost:3000 npx e2e run
```

Tests tagged `task:<id>` link results to the task they cover. These application checks are separate from the verification command above. Inspect results in [Reviewing output](/running/review/).

## Every harness verifies the same way

[Hlix Code](/harnesses/native-hlix/) and [outside harnesses](/harnesses/external-acp/) follow the same verification process. The check runs on the committed changes and repeats after a repair.

If a coding turn is canceled or stopped, verification does not run. Its partial work is committed for inspection and continuation.

## If verification does not do what you expect

- **The wrong command runs.** Check the repository override first; it takes precedence over the project default. Set it to `null` to inherit the default.
- **Verification is skipped.** Configure a command at the repository or project level, then run the cycle again.
- **The check still fails after repair.** Read the final output in the run log. Review returns unresolved failures to the cycle's checklist.
- **The command times out (`exit 124`).** It exceeded ten minutes. Use a narrower command, such as a smoke suite.
- **Setup fails before coding.** Correct the repository's setup command and rerun the cycle.
- **A configuration change returns `403`.** Changing verification requires `manage` access on the project.
- **A command passes locally but fails in the run.** Confirm that setup installs its dependencies and that required values are configured as [project secrets](/configure/secrets/).

<span id="where-to-go-next" />

## Next steps

[Review & QA gates](/concepts/review-gates/)
  [Repositories](/configure/repositories/)
  [Hlix Code](/harnesses/native-hlix/)
  [Outside harnesses](/harnesses/external-acp/)