Files
jury-rigged/.env.example
⓪ηηωεε忧世 608e55264d refactor: clean code review fixes across full repo
- Extract shared payload-guards (asRecord, asString, asNumber, asStringArray)
  into dashboard/src/utils/payload-guards.ts (DRY)
- Extract wrapWithMetrics() helper in src/metrics.ts to eliminate repetitive
  try/catch instrumentation blocks
- Add exponential backoff to useSSE reconnect (3s→6s→12s, capped at 30s,
  max 10 retries)
- Create centralized public/renderer/theme.js with named color and layout
  constants; update all 5 layer files to import from it
- Extract parsePositiveInt/parsePositiveFloat into shared src/parse-env.ts;
  remove duplicates from server.ts and token-budget.ts
- Deduplicate selectNextPrompt/selectNextSafePrompt via optional filter
  predicate parameter
- Migrate console.warn/error to structured logger in server.ts,
  orchestrator.ts, and broadcast/adapter.ts
- Rename bestOf→mostVotedChoice, input→promptConfig/rotationInput,
  stitched→recentTurnsSummary for intent-revealing names
- Add named constants for magic numbers (JITTER_RANGE, RECENCY_PENALTY,
  RECENT_TURNS_COUNT) and rationale comments for token budget defaults
- Add TODO(phase-8) header to OBS adapter stubs
- Document Object.create design choice in logger.ts
- Guard shake() timer leak in effects.js

All 158 tests passing, 0 type errors.
2026-02-28 21:23:38 +00:00

44 lines
1.2 KiB
Plaintext

OPENROUTER_API_KEY=
LLM_MODEL=deepseek/deepseek-chat-v3-0324:free
LLM_MOCK=false
PORT=3000
# Set to 1 when behind one reverse proxy (Docker ingress, Nginx, Traefik, etc.)
TRUST_PROXY=
API_HOST_PORT=3001
POSTGRES_PASSWORD=change_this_now
DATABASE_URL=postgresql://postgres:change_this_now@localhost:5432/juryrigged
TTS_PROVIDER=noop
LOG_LEVEL=info
VERDICT_VOTE_WINDOW_MS=20000
SENTENCE_VOTE_WINDOW_MS=20000
VOTE_SPAM_MAX_VOTES_PER_WINDOW=10
VOTE_SPAM_WINDOW_MS=60000
VOTE_SPAM_DUPLICATE_WINDOW_MS=5000
WITNESS_MAX_TOKENS=150
WITNESS_MAX_SECONDS=30
WITNESS_TOKENS_PER_SECOND=3
WITNESS_TRUNCATION_MARKER=[The witness was cut off by the judge.]
JUDGE_RECAP_CADENCE=2
ROLE_MAX_TOKENS_DEFAULT=260
ROLE_MAX_TOKENS_JUDGE=220
ROLE_MAX_TOKENS_PROSECUTOR=220
ROLE_MAX_TOKENS_DEFENSE=220
ROLE_MAX_TOKENS_WITNESS=160
ROLE_MAX_TOKENS_BAILIFF=120
TOKEN_COST_PER_1K_USD=0.002
# Broadcast Automation (Phase 3)
BROADCAST_PROVIDER=noop
OBS_WEBSOCKET_URL=ws://localhost:4455
OBS_WEBSOCKET_PASSWORD=
# Replay + Recording (Phase 7)
RECORDINGS_DIR=recordings
REPLAY_FILE=
REPLAY_SPEED=1
# Twitch Integration (Phase 7)
TWITCH_CHANNEL=
TWITCH_BOT_TOKEN=
TWITCH_CLIENT_ID=
# TWITCH_EVENTSUB_SECRET= (future — not yet used)