> For the complete documentation index, see [llms.txt](https://docs.visdom.virtuslab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visdom.virtuslab.com/visdom-control-plane/the-repository.md).

# The repository

How the visdom-control-plane repository is laid out, built and released.

The Control Plane lives in `VirtusLab/visdom-control-plane` (private). Identity configuration – the Keycloak realm, its clients, roles and theme – lives next to it in `VirtusLab/visdom-auth`.

## Layout

| Path                     | What is there                                                                                                   |
| ------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `crates/cp-core`         | Shared identifiers, errors, `SecretString`, slugs, W3C trace-context helpers                                    |
| `crates/cp-db`           | Connection pool, migrations (applied on start-up), pool metrics                                                 |
| `crates/cp-auth`         | JWKS validation, identity resolution and just-in-time users, grants                                             |
| `crates/cp-rbac`         | The permission catalogue and the rule that decides                                                              |
| `crates/cp-projects`     | Projects and each user's selected project                                                                       |
| `crates/cp-repositories` | Repository configuration and the smart-HTTP connection probe                                                    |
| `crates/cp-sync`         | Transactional outbox and the webhook worker that delivers project sync                                          |
| `crates/cp-secrets`      | AES-256-GCM secret store behind a provider interface                                                            |
| `crates/cp-settings`     | Workspace timezone and user preferences                                                                         |
| `crates/cp-telemetry`    | Logging and OpenTelemetry export                                                                                |
| `crates/cp-api`          | Routes, middleware, OpenAPI, serving the UI                                                                     |
| `crates/cp-server`       | The binary; the only place environment variables are read                                                       |
| `frontend/`              | React, Vite, shadcn/ui and Tailwind, themed with the Visdom design system; embedded in the binary at build time |
| `design/`                | The design system the UI is built with                                                                          |
| `docs/`                  | Specifications, design notes and runbooks                                                                       |
| `tests/`                 | Shared test helpers; each crate carries its own tests                                                           |

## Building and testing

The toolchain is pinned in `rust-toolchain.toml` (Rust 2024 edition); the UI uses pnpm.

```bash
cargo build
cargo test
cargo clippy --all-targets
cd frontend && pnpm install && pnpm test   # pnpm only, no npm or yarn
```

`docker build .` produces the release image in three stages: the UI, the Rust binary, then the distroless runtime.

## Releases

Every merge to `main` bumps the patch version, publishes the image `visdom-control-plane:v<version>`, deploys it to the development environment through GitOps, tags the commit and creates a GitHub Release with notes. Production is a separate, manual workflow. Release notes on GitHub are the changelog.


---

# 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://docs.visdom.virtuslab.com/visdom-control-plane/the-repository.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.
