RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/CLAUDE.md/triggerdotdev/trigger.dev

CLAUDE.md

internal-packages/run-engine/CLAUDE.md
CLAUDE.md

Quality

70/100

Scores the file, not the repository.

Length

208 words

6 headings · 1 code blocks

Repository

16k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
triggerdotdev/trigger.dev/internal-packages/run-engine/CLAUDE.mdRawGitHub
1# Run Engine 2.0
2 
3Core run lifecycle management system (`@internal/run-engine`). This is where ALL new run lifecycle logic should go - not in `apps/webapp/app/v3/services/` directly.
4 
5## Architecture
6 
7The `RunEngine` class (`src/engine/index.ts`) orchestrates modular systems:
8 
9### Systems (`src/engine/systems/`)
10 
11Each system handles one concern:
12- **BatchSystem**: Batch trigger processing with DRR (Deficit Round Robin)
13- **CheckpointSystem**: Execution checkpoints for recovery
14- **DebounceSystem**: Configurable debouncing with delay
15- **DelayedRunSystem**: TTL-based delayed execution
16- **DequeueSystem**: Pulls runs from queue, assigns to workers
17- **EnqueueSystem**: Adds runs to queue with ordering
18- **ExecutionSnapshotSystem**: Stores/restores run state for warm restarts
19- **PendingVersionSystem**: Version management for deployments
20- **RunAttemptSystem**: Individual execution attempts (retries, heartbeats)
21- **TTLSystem**: Automatic run expiration
22- **WaitpointSystem**: Synchronization primitive for waiting between tasks
23 
24### Queue and Locking
25 
26- **RunQueue** (`src/run-queue/`): Redis-backed fair queue with concurrency management
27- **BatchQueue** (`src/batch-queue/`): Batch processing queue
28- **RunLocker** (`src/locking.ts`): Redis locks preventing concurrent run execution
29 
30## Key Design Patterns
31 
32- Event-driven via EventBus
33- OpenTelemetry tracer/meter integration
34- Redis for distributed locks and queues
35- Prisma for persistence with read-only replica support (`readOnlyPrisma`)
36 
37## Testing
38 
39Tests live in `src/engine/tests/` and use testcontainers (Redis + PostgreSQL):
40 
41```bash
42cd internal-packages/run-engine
43pnpm run test ./src/engine/tests/ttl.test.ts --run
44```
45 
46May need to build dependencies first: `pnpm run build --filter @internal/run-engine`
47 

Commands it names

  • pnpm run test ./src/engine/tests/ttl.test.ts --run
  • pnpm run build --filter @internal/run-engine

Sections

  • Run Engine 2.0
  • Architecture
  • Systems (`src/engine/systems/`)
  • Queue and Locking
  • Key Design Patterns
  • Testing

What it covers

buildtestcode-style

Stack — with the evidence

typescript

(1.00)

prisma

(1.00)

vitest

(1.00)

playwright

(1.00)

pnpm

(0.85)

react

(0.70)

remix

(0.70)

express

(0.70)

drizzle

(0.70)

postgres

(0.70)

redis

(0.70)

tailwind

(0.70)

vite

(0.70)

vercel

(0.70)

aws

(0.70)

javascript

(0.60)

node

(0.60)

turborepo

(0.60)

monorepo

(0.60)

github-actions

(0.60)

Format

CLAUDE.md

Claude Code's memory file. Shaped like AGENTS.md but with two things it lacks: @path imports, so shared rules live in one place, and a user-scope layer that follows the developer across repos rather than shipping with the code.

What the corpus says about it

Repository

Owner
triggerdotdev
Language
—
License
—
Archived
no

All configs in this repo

Also in triggerdotdev/trigger.dev

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
triggerdotdev/trigger.dev.cursor/rules/executing-commands.mdc · 16kCursor rulestypescriptprisma+18test49/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/otel-metrics.mdc · 16kCursor rulestypescriptprisma+18styledo-not61/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/webapp.mdc · 16kCursor rulestypescriptprisma+18setuptestsecurity55/1003 days ago
triggerdotdev/trigger.dev.cursor/rules/writing-tasks.mdc · 16kCursor rulestypescriptprisma+18setupbuildarchtypes+564/1003 days ago
triggerdotdev/trigger.dev.github/copilot-instructions.md · 16kCopilot instructionstypescriptprisma+18teststyletypes32/1003 days ago
triggerdotdev/trigger.devAGENTS.md · 16kAGENTS.mdtypescriptprisma+18setupbuildtestlint-format+888/1003 days ago
triggerdotdev/trigger.devapps/supervisor/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18no sections25/1003 days ago
triggerdotdev/trigger.devapps/webapp/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18setupbuildteststyle+588/1003 days ago
triggerdotdev/trigger.devinternal-packages/clickhouse/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+19styletypesdo-not61/1003 days ago
triggerdotdev/trigger.devinternal-packages/database/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18typesdatabasedo-not65/1003 days ago
triggerdotdev/trigger.devpackages/core/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18no sections31/1003 days ago
triggerdotdev/trigger.devpackages/redis-worker/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18test29/1003 days ago
triggerdotdev/trigger.devpackages/trigger-sdk/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18do-not54/1003 days ago
triggerdotdev/trigger.devpackages/cli-v3/CLAUDE.md · 16kCLAUDE.mdtypescriptprisma+18deploymentdo-notdocs51/1003 days ago
Diff against .cursor/rules/executing-commands.mdc Diff against .cursor/rules/otel-metrics.mdc Diff against .cursor/rules/webapp.mdc Diff against .cursor/rules/writing-tasks.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against apps/supervisor/CLAUDE.md Diff against apps/webapp/CLAUDE.md Diff against internal-packages/clickhouse/CLAUDE.md Diff against internal-packages/database/CLAUDE.md Diff against packages/core/CLAUDE.md Diff against packages/redis-worker/CLAUDE.md Diff against packages/trigger-sdk/CLAUDE.md Diff against packages/cli-v3/CLAUDE.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
dotCMS/corecore-web/CLAUDE.md · 950CLAUDE.mdjavanode+13teststylearchtesting-strategy+3100/1003 days ago
Adit-Jain-srm/NightmareNetCLAUDE.md · 45CLAUDE.mdtypescriptpython+18buildtestlint-formatstyle+6100/1003 days ago
microsoft/playwrightCLAUDE.md · 94kCLAUDE.mdtypescriptjavascript+10buildtestlint-formatstyle+7100/1003 days ago
nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4kCLAUDE.mdtypescriptnode+16setupbuildstylearch+2100/1003 days ago
livewire/livewireCLAUDE.md · 24kCLAUDE.mdphpvitest+4setupbuildteststyle+4100/1003 days ago
dotCMS/coreCLAUDE.md · 950CLAUDE.mdjavanode+9setupbuildteststyle+799/1003 days ago
lollipopkit/flutter_server_boxCLAUDE.md · 8.3kCLAUDE.mddartflutter+8buildteststylearch+298/1003 days ago
oven-sh/buntest/CLAUDE.md · 95kCLAUDE.mdtypescriptjavascript+14teststyletesting-strategydo-not97/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack