Developer guide Contributing
Testing
What to check before you send a change.
On this page
Archipelego has no automated test suite yet. Every change relies on the type checker, the build and a short set of manual checks. This page lists them.
Type check and build
Run both before every pull request:
npm run typecheck
npm run buildnpm run typecheck runs tsc --noEmit for the app and the server. npm run build compiles the tokens, type-checks and bundles the app with Vite, and compiles the server.
If you changed the docs site, build it too:
cd docs-site
npm run buildManual checks
Start the app with npm run dev, then check what your change touches:
- Open the same canvas link in two browsers. Edits, cursors, selections and chat messages appear in both.
- Open the canvas on a phone or a tablet on the same network. The layout fits and the controls are large enough to tap.
- Stop the server for a moment. The status chip shows "Offline, changes kept", and your edits sync when the server is back.
- Switch to the dark theme. Every text stays readable and
signalis still the only accent. - Turn on reduced motion in your operating system. Animations collapse, flows stop and story steps cut instead of panning.
- Turn sound on. Each cue plays once and never on hover.
- Use the keyboard only. Every control shows the focus ring and works with keys.
Testing AI without the chat
POST /api/ai/test sends one short request to a provider and reports how long it took:
curl -s -X POST http://localhost:1234/api/ai/test \
-H 'content-type: application/json' \
-d '{"provider":"anthropic"}'With no key in the body, the server uses the key stored for canvasId, or its own credentials for Anthropic. The answer is { "ok": true, "model": "...", "ms": 812 } or { "ok": false, "error": "..." }. This is the same request the Test button sends in AI models and keys.
To check the no-key path, start the server with ARCHIPELEGO_PLATFORM_AI=off and no browser keys. The Architect then answers that no AI provider is connected.
The offline simulator
ARCHIPELEGO_AI_MOCK replaces the model with a deterministic simulator, so you can test the Architect and feature drafts without a key and without cost. The code is server/src/llm/simulator.ts.
| Value | Behaviour |
|---|---|
on |
The simulator answers only when no provider has a key. With a key, the real model answers. |
always |
The simulator answers every @architect question and every feature draft. |
On macOS and Linux:
ARCHIPELEGO_AI_MOCK=always npm run devOn Windows, in PowerShell:
$env:ARCHIPELEGO_AI_MOCK = "always"
npm run devThe same canvas and the same words always give the same answer, so you can compare runs. The answers carry the model archipelego-simulator, and their text says "Offline simulator". The simulator does not cover Explain.
Check a feature draft without the app:
curl -s -X POST http://localhost:1234/api/feature \
-H 'content-type: application/json' \
-d '{"prompt":"Customer files a claim with the claims agent","canvas":{"blocks":[{"id":"b_c","kind":"persona","title":"Customer"},{"id":"b_a","kind":"agent","title":"Claims agent"}],"links":[{"from":"b_c","to":"b_a"}]}}'The answer holds draft, model and the a2ui review card. See Feature drafts.
Feature Architecture checks
The UX research for Feature Architecture and docking lists six success criteria, in docs/ux/feature-architecture-and-docking.md. Check them by hand, with ARCHIPELEGO_AI_MOCK=always when you have no key:
- Draft a feature with Draft feature. Untick a block in the review card and select Save feature. The feature leaves out that block and the steps that use it.
- Build a feature with New feature, Choose blocks and Record steps, including a step on one block.
- Play a scenario with the keyboard only: arrows, PageDown, PageUp, Space and Esc.
- Select Present to the room in one browser. A second browser follows the steps and shows Following. Leave stops following.
- Dock and undock both panels with the button and by dragging. Reload: the layout comes back.
- Check that a step between two unconnected blocks shows the gap warning on the story card.
Rich chat checks
- Ask
@architectfor a table or a list. The answer renders it as Markdown. - Open Canvas overview from the Apps menu in the chat. The counts match the canvas, and Refresh counts again.
- Ask
@architectfor an overview of the canvas. With a real model, the answer can open the overview app by itself. - With
ARCHIPELEGO_AI_MOCK=always, ask about a block by name and press a button in the simulator's card. The Architect continues from the action.
Health check
curl -s http://localhost:1234/healthThe server answers {"ok":true}. The container image uses the same endpoint for its HEALTHCHECK.