Radian Factory

Repository files

Three optional files in your repository shape how the factory works on it. None is required to start.

The factory reads REVIEW.md and .factory/setup.sh from your base branch only, never from the pull request's own changes. A pull request cannot loosen the rules it is reviewed by, or change the setup it is built with.

AGENTS.md

At the repository root: how to work in your project, for any coding agent. How to build and test, where things live, the conventions a change should follow. The builder and the reviewer both read it, and so do the coding harnesses (Claude Code, Codex, OpenCode) when a run uses one. Keep it short and concrete.

# Working in this repository

- npm ci, then npm test. Tests must pass before a pull request.
- Saves are versioned: src/migrate.ts upgrades old ones.
- Use the logger in src/log.ts, not console.log.

REVIEW.md

At the repository root, next to AGENTS.md: the rules the reviewer holds every change to. Write what matters on your project that a generic review would miss, what should only ever be a nit, and what to ignore.

# Review rules

- Saves must load across versions. A change to src/save.ts needs a test
  that loads an old save.
- Only flag style as a Nit. Never block on it.
- Ignore generated files in assets/atlas/.

How a review reads

The review body starts with Looks good or Changes requested. Each finding is marked by how much it matters, and the reviewer checks a finding against the code before it posts it:

  • 🔴 Important: a bug to fix before merging.
  • 🟡 Nit: a small thing.
  • 🟣 Pre-existing: a bug that was there before this change.

The body ends with one line your own scripts can read without a model:

<!-- factory-review: {"important":1,"nit":1,"pre_existing":0} -->

Pull requests and reviews appear as the GitHub App, builder and reviewer alike, so GitHub records the reviewer's verdict as a comment, not as an approval. Your branch protection and required reviews still apply.

.factory/setup.sh

A shell script run inside the sandbox before the builder starts: install dependencies, start a database, generate code. It runs from the base branch, in the job's fresh sandbox, with no credentials in it.

#!/bin/sh
set -e
npm ci
npx playwright install --with-deps chromium