Visual regression testing for documents first (PDFs and their pages), plus browser and mobile screenshots. The
design is in docs/design.md; read it before changing the architecture, and update it in the same change when you do.
-
Never push to
main; every change goes through a pull request. A ruleset onmainrequires the CI jobs and the VisualCI check, which stays pending until the PR's VisualCI build is reviewed. Before you merge:- Wait for CI. Then review the PR's build over VisualCI's MCP server (
list_buildsfor the branch,get_build,get_snapshot;contact_sheetfor many screenshots), the way our customers' agents do. - Approve changes the PR meant to make (
review). Fix the code and push again for anything it didn't mean: a page that looks broken is a regression even when CI is green. - Merge with
gh pr merge --squash --delete-branchonce every check is green. If GitHub refuses because VisualCI is pending, that's the review you skipped. Never bypass the ruleset. (1 Dec 2026, unreviewed builds let a CSS break from three merges reach production.)
- Wait for CI. Then review the PR's build over VisualCI's MCP server (
-
Hold the merge lock from the final rebase to the merge. A PR must be up to date with
mainbefore it merges, so a merge by one agent sends every other agent's PR back through CI. Take Fleetlayer's lock, one per repository, around the last rebase, the CI run and the merge, in one script, and only for one PR at a time:id=$(fleetlayer lease acquire main-merge --payload '{"repo":"DocSpring/visualci"}' --reason "merge PR #N" \ --pid $$ --wait --json | jq -r .id | tail -1) trap 'fleetlayer lease release "$id"' EXIT # rebase onto origin/main, push, wait for the checks (with a timeout), then until # `gh pr view N --json mergeStateStatus -q .mergeStateStatus` is CLEAN, then gh pr merge N --squash --delete-branch
--pid $$ties the lock to the script, so it outlives an idle session and is freed when the script ends. (3 Dec 2026: two agents' merges kept making each other's green PRs out of date.) Wait for CLEAN, not for the CI jobs: the VisualCI check posts a few seconds after thevisualjob ends, and a merge in that gap is refused (4 Dec 2026). -
Wait on CI without polling GitHub hard. Every agent's
ghshares Nathan's one GitHub account and its 5,000 API calls an hour; on 4 Dec 2026 polling used them up and blocked a merge. Fleetlayer receives this repository's CI results, so wait on those, at no API cost: after a push,fleetlayer subscribe ci --commitin the checkout (each workflow's result arrives as a message; it ends by itself and says so if nothing came in 45 minutes), or to be told once,fleetlayer watch ci --subject DocSpring/visualci@<branch> --kind github.workflow_run --for 1h. If you must poll,gh run view <id> --json status,conclusionevery few minutes with a timeout, nevergh run watchwith its default 3-second interval (it also fetches the jobs each time).gh pr checks --watch --interval 60is fine. -
No backwards compatibility before launch. There are no old setups to keep working: rename, change formats and drop old behaviour outright, with no redirects, aliases, fallbacks or shims for the old way (Nathan, 1 Dec 2026).
-
skills/is generated from the docs pages withskill:front matter. After editing such a page, runnode scripts/skills.mjsinfrontendand commitskills/; CI fails when they differ. Bump the version in.claude-plugin/plugin.jsonandmarketplace.jsonwhen a skill changes. -
A change to the CLI (crates/visualci-cli or crates/visualci-core) bumps the workspace version in Cargo.toml and Cargo.lock's visualci-* entries, and the version defaults in clients/github-action/action.yml and clients/circleci-orb/orb.yml. CI's
cli-versionjob fails without them; once CI passes on main, the release workflow publishes it. The docs never name a CLI version: they write{{cli_version}}(VISUALCI_VERSION={{cli_version}},github-action@v{{cli_version}}), which the site build fills in with the newest published release (frontend/scripts/cli-version.mjs), so they never pin an old CLI or one nobody can download yet. -
Fixtures are test data only: synthetic values, or blank template PDFs someone has checked. Never commit a real customer's document or data.
-
Build Rust in CI or on a build machine (docspring-dev), not on small agent VMs. The server is app/ (Laravel Rust,
visualci-appin the root workspace, with the CLI and its crates in crates/, whose tests need no database).scripts/on-dev testruns the crates' tests. app/'s (cargo test -p visualci-app) need Postgres and a blob store: run them withscripts/on-dev runnamingVISUALCI_APP_TEST_DATABASE_URL=postgres://...@127.0.0.1:55433/visualci_app_test_<story>. On docspring-dev that's its own Postgres (a database of your own per story). On a pool box the run starts its own Postgres and RustFS in Docker, points the command at them, and removes them when it ends. -
VisualCI dev ports on docspring-dev: the app 5250 (
SERVER_PORT=5250, which the Vite proxy defaults to), Vite 5173, previews 5180–5199. 5150 is Talira's dev server: never use it (on 1 Dec 2026 a VisualCI dev server took it, and Talira's localhost and MCP reached VisualCI instead). Production listens on 5150 inside its cluster, which is separate. -
Any UI design (the landing page, the review UI, emails): load the
hallmarkskill and the frontend design skills before writing markup or CSS. -
A test never skips quietly. When a service it needs (the blob store, Postgres, a forge stub) is missing, it fails with a message naming the service: a test that returns early passes in CI. (3 Dec 2026: the server tests that need blobs returned early in CI's
testjob, which runs no S3, and passed without checking anything.) -
Migrations run before the rollout, so for a few seconds the previous release serves against the new schema. A migration must work with the code before it: add the new column and copy the data in one change, stop reading the old one in the same change, and drop or rename it in a later change. A required column gets a default. CI's
cli-versionjob runs scripts/ci/migration_safety.py, which fails a new migration that drops, renames or retypes anything main's code still names. This is deploy safety, not backwards compatibility: the old column still goes, one release later. (4 Dec 2026, a dropped organizations column failed every request for ~20 s, a new user's first build among them.) -
The server connects with sqlx's prepared-statement cache off (
config::without_statement_cache): a migration that adds a column makes Postgres refuse an old pod's cachedSELECT table.*("cached plan must not change result type"). Keep it off.tests/rollouts.rsfails if it comes back on. (4 Dec 2026, #178's rollout.) -
Every background process (workers, renderers, scheduled jobs) ships with a health check or heartbeat that checks the work is done, not just that the process is up, in the same change.
-
Production reads its secrets from 1Password through the cluster's ExternalSecrets (talira-ai/infra, k3s/resources/visualci/secrets.yaml). Before moving, renaming or deleting one of those items, or changing a field name, tell the
talira infra@agents-talirasession so the ExternalSecret changes first: a missing item fails every deploy until it does (1 Dec 2026, a vault move held back three releases). -
Deploys: CI pushes the image digest to talira-ai/infra, and ArgoCD polls it every 60 s. A release normally reaches production (
https://api.visualci.com/statuscommit) within about 3 minutes of CI's deploy job. Only call a rollout stuck after that, and then asktalira infra@agents-talira. The API is on api.visualci.com: the app host returns 404 for/api/v1/*on purpose. -
Renderers handle untrusted input: they run only on the render node, under gVisor, with no network and no service-account token.
-
serde_json's
arbitrary_precisionfeature is on in app/'s build, so a number inside#[serde(untagged)]or#[serde(flatten)]fails to deserialize (it arrives as a map, not a number). Read such bodies throughserde_json::Value(domain::lenient). Tests that build the struct directly won't catch it (4 Dec 2026, visualci.yml thresholds and update_project floats). -
Code in a bare
tokio::spawntask has no app context:laravel::now(), the database and the cache panic there. Uselaravel::task::spawnorcontext.scope, andspawn_blockingonly for pure CPU work on plain data (decoding images). Integration tests run inside an app context and won't catch it. -
Before building something other Laravel Rust apps also need (R2 presigned uploads, API key hashing or metering, sitemaps, OG images, cookie consent, PostHog, Resend, Polar billing), search Talira and check kitze's packages (github.com/kitze/laravel-rust-*) first. Keep VisualCI's own OAuth and MCP code (Nathan, 4 Dec 2026).