> For the complete documentation index, see [llms.txt](https://robodex.gitbook.io/robodex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://robodex.gitbook.io/robodex-docs/operations/testing.md).

# Testing

## Research tests

Use these when changing agent loops, strategies, prompts, benchmarks, or generated body structures:

```bash
pytest tests/test_research_core.py -v
pytest tests/test_agent_loop_registry.py -v
pytest tests/test_robot_program_v2.py -v
```

These protect:

* strategy contracts,
* loop registration,
* deterministic grammar compilation,
* research metrics,
* prompt-driven generation surfaces.

## Product API tests

Use these when changing workspace, routes, persistence, or candidate conversion:

```bash
pytest tests/test_designs_route.py -v
pytest tests/test_workspace_routes.py -v
pytest tests/test_workspace_sdk.py -v
pytest tests/test_workspace_store.py -v
```

These protect:

* route behavior,
* workspace orchestration,
* local SQLite persistence,
* thread artifacts,
* generated candidate payloads.

## Frontend contract tests

Use:

```bash
pytest tests/test_frontend_workspace_contract.py -v
```

Also run the frontend build when changing TypeScript or UI code:

```bash
cd apps/web
npm run build
```

## Full suite

Before merging broad changes:

```bash
pytest tests/ -v
```

## Documentation checks

Docs validation should check:

* every `SUMMARY.md` link resolves,
* root `.gitbook.yaml` points to `docs/`,
* no page exists outside navigation unless intentionally hidden,
* GitBook-specific blocks are syntactically balanced enough for preview.

The current GitBook CLI does not expose legacy `gitbook build`, so local validation is link and navigation focused unless GitBook preview is running.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://robodex.gitbook.io/robodex-docs/operations/testing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
