# Request paths

> A proposal, a render and a check, step by step.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/architecture/request-paths/

For agents: Proposal: POST /proposals → validate against guide version (409 out_of_date if base moved) → apply on a temporary branch → generator + tokens build in a worker → render jobs (SQS) for every affected screen/piece, before and after, light/dark, 3 widths → contrast + check on after → ready; approve (person session) → guide version +1 → Git writer opens one PR (tokens.json, tokens.css, guide.md, regenerated components with three-way merge, screen files) → status merged when the PR merges (webhook). Render: job → headless Chromium loads the gallery build of the branch at the state → PNG to S3 → signed link. Check in CI: design check on runner; renders-based checks local Chromium or POST /checks.

## A proposal

1. `POST /proposals` arrives with the guide version it starts from. If the guide moved on since, the answer is `409 out_of_date`.
2. The engine applies the change on a temporary branch of your repository, builds the tokens and regenerates the affected pieces.
3. It queues render jobs for every screen and piece the change touches: before and after, light and dark, phone, laptop and large screen.
4. It runs the contrast rules and `design check` on the result, and marks the proposal ready.
5. A person approves. The guide version goes up by one, and the Git writer opens **one** pull request with everything the change moves, merging regenerated pieces with your edits.
6. When the pull request merges, Sypnia Git (or GitHub) tells the engine, and the proposal is `merged`.

## A render

1. A render job names a target (a screen state, a piece, a whole gallery page), the themes and the widths.
2. A worker builds the gallery of that branch once and opens it in headless Chromium at the requested state.
3. The picture goes to storage; the API returns a signed link valid for one hour.

## A check in your pipeline

1. `design check` runs on the pipeline's machine, reading your files.
2. Checks that need pictures (`contrast` in context, `touch-target`, `first-screen`) use Chromium on that machine, or call `POST /checks` to use the engine's renderer.
3. Findings print as text or JSON; errors make the step fail.
