Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:
# route modules, a thirteenth is a regression.
- run: bun run lint

# The root tsconfig EXCLUDES src/solver, so `bun run build`'s tsc never
# reads the cron's entrypoint (generate-daily.ts). Its own project does.
# Railway's cron build runs the same check — this one fails the PR
# instead of the deploy.
- run: bun run typecheck:solver

# `test` and `build` each compile paraglide first; src/paraglide is
# gitignored, so no separate generation step is needed.
- run: bun run test
Expand Down
11 changes: 10 additions & 1 deletion .railway/railway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,21 @@ export default defineRailway(() => {
// schedule, then exits (restart NEVER — it's a one-shot per run).
const cron = service("cron", {
source: github(REPO),
build: "bun install",
// Skips the vite build (this service serves nothing), but still typechecks
// what it actually runs: the root tsconfig EXCLUDES src/solver, so the web
// build's `tsc --noEmit` never sees generate-daily.ts. Without this line the
// cron ships code no compiler has read.
build: "bun install && bun run typecheck:solver",
start: "bun run gen:daily",
deploy: {
cronSchedule: "0 5 * * *",
restartPolicyType: "NEVER",
},
// NOTE: this service has a generated public domain
// (cron-production-ad37.up.railway.app) that serves nothing — a process
// which exits has no port to expose. It is NOT removable from here: both
// `serviceDomains: { "<host>": null }` and `serviceDomains: null` plan as
// no-ops in railway 3.5.7. Delete it from the dashboard.
env: {
DATABASE_URL: Postgres.env.DATABASE_URL,
},
Expand Down
24 changes: 16 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ routing, and build were migrated.
overwrites `src/db/schema.ts` — re-append our tables from git after:
`dailyPuzzle`, `dailyScore`, `dailyView`, `levelScore`)
- `bun run lint` — oxlint, capped at `--max-warnings=12` (see "Key decisions")
- `bun run typecheck:solver` — `tsc` over `src/solver`, which the root tsconfig
excludes. `bun run build` does NOT cover it, and it is what the cron runs.
- `bun run generate-routes` — regenerate the route tree (`tsr generate`)

CI (`.github/workflows/ci.yml`) runs `lint` → `test` → `verify` → `build` on
every push to `main` and every pull request, on the bun version pinned by
`packageManager`. No Postgres service: no test imports `src/db/index.ts` or
reads `DATABASE_URL`, and the suite stays stateless on purpose.
CI (`.github/workflows/ci.yml`) runs `lint` → `typecheck:solver` → `test` →
`verify` → `build` on every push to `main` and every pull request, on the bun
version pinned by `packageManager`. No Postgres service: no test imports
`src/db/index.ts` or reads `DATABASE_URL`, and the suite stays stateless on
purpose.

### Environment variables

Expand Down Expand Up @@ -233,10 +236,15 @@ Topology in `.railway/railway.ts`:
(secrets, `preserve()`d in IaC).
- **Postgres** — `postgres("Postgres")`; other services reference its
`DATABASE_URL`.
- **cron** — `source: github(...)`, build `bun install` (skips the vite build),
start `bun run gen:daily`, `deploy.cronSchedule = "0 5 * * *"` (UTC),
`restartPolicyType: "NEVER"`. The generator closes the pool and `exit(0)` or
the next run is skipped.
- **cron** — `source: github(...)`, build `bun install && bun run
typecheck:solver` (skips the vite build, but still typechecks what it runs —
the root tsconfig excludes `src/solver`, so the web build never reads
`generate-daily.ts`), start `bun run gen:daily`,
`deploy.cronSchedule = "0 5 * * *"` (UTC), `restartPolicyType: "NEVER"`. The
generator closes the pool and `exit(0)` or the next run is skipped.
Two known gaps: a run that fails at 05:00 on code that _compiles_ is still
silent (Railway IaC has no notification primitive — `webhook`/`notification`
appear nowhere in the SDK types), and tier 3 has no bank fallback.

`/api/health` (`src/routes/api/health.ts` → `src/server/health.ts`) runs
`select 1` against the pool and answers 200 `{"status":"ok"}` or 503
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"paraglide": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide",
"generate-routes": "tsr generate",
"build": "bun run paraglide && tsc --noEmit && vite build",
"typecheck:solver": "tsc --noEmit -p src/solver/tsconfig.json",
"gen:icons": "bun scripts/gen-icons.ts",
"start": "bun .output/server/index.mjs",
"preview": "vite preview",
Expand Down
Loading