Skip to content

Development

Visto AI is written in TypeScript and runs on Node directly, with no build step for the service. This page covers working on it locally and sending a change.

You need Node 26 or later.

Terminal window
npm ci
npm test
npm run typecheck
npm run lint

Tests need no database and no network. Database tests run against an in-process Postgres (PGlite). The test setup blocks sockets and fetch and clears credential variables from the environment, so a test that tries to reach GitHub or a model fails.

The web UI lives in ui/, a package of its own: React, TypeScript, Vite and Tailwind CSS, tested with Vitest and Testing Library. It has its own exact versions, lock file, lint config and node_modules. The root lint ignores it, and nothing in src/ imports from it; the one file it shares with the service is src/ui/api-types.ts, read as types.

It needs its own install, which reaches the network once:

Terminal window
npm --prefix ui ci
npm --prefix ui run lint
npm --prefix ui run typecheck
npm --prefix ui test
npm --prefix ui run build

Its tests stub the API and block fetch, XMLHttpRequest, WebSocket and EventSource. build writes ui/dist, which git ignores and the service serves at /ui/.

With the service running locally, npm run dev:send-webhook sends a signed sample delivery to it:

Terminal window
npm run dev:send-webhook -- --url http://localhost:8080/webhooks/github --secret-env WEBHOOK_SECRET --kind pull_request

--kind is pull_request, review or comment. To measure a change to the engine on real pull requests, use the replay and the backtest.

  • Branch from dev and open the pull request against dev. dev is the default branch. main holds releases: merging dev into main cuts a release and publishes the image.
  • Use conventional commits for every commit and for the pull request title: type(scope)!: subject, where the scope and ! are optional and type is one of feat, fix, docs, test, chore, refactor, perf, build, ci, style or revert. A check on each pull request enforces it.
  • The version follows the commits. feat bumps the minor version, anything else the patch version. A breaking change (! or a BREAKING CHANGE: footer) bumps the major version, or the minor one while the version is below 1.0.

CI runs the root checks (lint, typecheck, tests) and the UI’s (lint, typecheck, tests, build) on every pull request. Run them locally before you push.

See Repository layout for where things live.