Team contribution to sunstead hack in Levi, Finland.
README.md

Slopgotchi Railway worker #

The always-on process that does all heavy scoring (KTD1). Vercel's cron only enqueues (prUri, round) jobs onto a Redis stream; this worker consumes them and runs the per-change pipeline (fetch → graph → judge → write).

Run #

npm run worker   # tsx worker/index.ts

Railway uses railway.json (startCommand: npm run worker).

Environment #

The worker pins explicit env — it does not use lib/store.ts's <PREFIX>_KV_REST_API_* suffix auto-detection, which is a Vercel-integration convenience and a footgun on Railway (KTD12).

Var Purpose
UPSTASH_REDIS_REST_URL / UPSTASH_REDIS_REST_TOKEN Redis: queue stream + claims + caches
FEATHERLESS_API_KEY Judge model (Premium+ for the 32B judge, concurrency ≥ 2)
FEATHERLESS_MODEL Override the default judge model
SLOPGOTCHI_PDS / SLOPGOTCHI_IDENTIFIER / SLOPGOTCHI_APP_PASSWORD Service ATProto account — the worker is the sole writer (KTD9)
GITHUB_TOKEN GitHub tarball + PR API (rate limits); base-commit resolution (U2/U3)
WORKER_CONSUMER_NAME Stable consumer id within the stream group (defaults to HOSTNAME)

The same service-account credential now lives on two platforms (Vercel + Railway); rotation is a two-place runbook (U14).

Boundaries (later units) #

  • Claim/heartbeat/dead-letter lifecycle for multi-minute jobs — U12.
  • The real per-change pipeline replaces worker/index.ts's placeholder handler — U11.
  • Concurrency lease, backpressure, restart recovery, and the lib/ shared-core vs worker-only split (tree-sitter must never enter the Vercel bundle) — U14.