|
3 | 3 | - "apps/webapp/app/v3/**" |
4 | 4 | --- |
5 | 5 |
|
6 | | -# Legacy V1 Engine Code in `app/v3/` |
| 6 | +# v3 (engine V1) has been removed |
7 | 7 |
|
8 | | -The `v3/` directory name is misleading - most code here is actively used by the current V2 engine. Only the specific files below are legacy V1-only code. |
| 8 | +The v3 engine (RunEngineVersion `V1`: MarQS queue + Graphile worker) is end-of-life and its execution code has been removed from the webapp. The `app/v3/` directory name is historical: everything under it now serves the current V2 engine (`@internal/run-engine` + `@trigger.dev/redis-worker`). |
9 | 9 |
|
10 | | -## V1-Only Files - Never Modify |
| 10 | +There is no `V1` execution path anymore. If you find a `RunEngineVersion` branch, the `V1` arm should only reject or finalize gracefully (for example, mark a historical run cancelled in the DB), never run V1 work. Do not reintroduce MarQS, the graphile worker, or the v3 socket.io namespaces. |
11 | 11 |
|
12 | | -- `marqs/` directory (entire MarQS queue system: sharedQueueConsumer, devQueueConsumer, fairDequeuingStrategy, devPubSub) |
13 | | -- `legacyRunEngineWorker.server.ts` (V1 background job worker) |
14 | | -- `services/triggerTaskV1.server.ts` (deprecated V1 task triggering) |
15 | | -- `services/cancelTaskRunV1.server.ts` (deprecated V1 cancellation) |
16 | | -- `authenticatedSocketConnection.server.ts` (V1 dev WebSocket using DevQueueConsumer) |
17 | | -- `sharedSocketConnection.ts` (V1 shared queue socket using SharedQueueConsumer) |
| 12 | +## The deprecation boundary (keep this) |
18 | 13 |
|
19 | | -## V1/V2 Branching Pattern |
| 14 | +Requests from clients still on v3 (old SDK/CLI) or historical V1 runs must return a clean 4xx, never a 5xx. The boundary lives in: |
20 | 15 |
|
21 | | -Some services act as routers that branch on `RunEngineVersion`: |
22 | | -- `services/cancelTaskRun.server.ts` - calls V1 service or `engine.cancelRun()` for V2 |
23 | | -- `services/batchTriggerV3.server.ts` - uses marqs for V1 path, run-engine for V2 |
| 16 | +- `engineDeprecation.server.ts` - the `V3_TRIGGER_DEPRECATION_MESSAGE` / `V3_DEV_DEPRECATION_MESSAGE` / `V3_MIGRATION_URL` upgrade messages. |
| 17 | +- `engineVersion.server.ts` - `determineEngineVersion()` still detects a V1 project/run so callers can reject it. |
| 18 | +- `services/triggerTask.server.ts`, `services/cancelTaskRun.server.ts`, `services/rescheduleTaskRun.server.ts` - the `V1` arm rejects or finalizes gracefully instead of executing. |
| 19 | +- `services/initializeDeployment.server.ts` - the `DEPRECATE_V3_CLI_DEPLOYS_ENABLED`-gated v3 CLI deploy rejection. |
| 20 | +- `handleWebsockets.server.ts` - the legacy `trigger dev` websocket closes with the upgrade message. |
24 | 21 |
|
25 | | -When editing these shared services, only modify V2 code paths. |
| 22 | +## V2 modern stack |
26 | 23 |
|
27 | | -## V2 Modern Stack |
28 | | - |
29 | | -- **Run lifecycle**: `@internal/run-engine` (internal-packages/run-engine) |
30 | | -- **Background jobs**: `@trigger.dev/redis-worker` (not graphile-worker/zodworker) |
31 | | -- **Queue operations**: RunQueue inside run-engine (not MarQS) |
32 | | -- **V2 engine singleton**: `runEngine.server.ts`, `runEngineHandlers.server.ts` |
33 | | -- **V2 workers**: `commonWorker.server.ts`, `alertsWorker.server.ts`, `batchTriggerWorker.server.ts` |
| 24 | +- **Run lifecycle**: `@internal/run-engine` (`runEngine.server.ts`, `runEngineHandlers.server.ts`) |
| 25 | +- **Background jobs**: `@trigger.dev/redis-worker` (`commonWorker.server.ts`, `alertsWorker.server.ts`, `batchTriggerWorker.server.ts`; `legacyRunEngineWorker.server.ts` still hosts the live batch-completion jobs) |
| 26 | +- **Queue operations**: RunQueue inside run-engine (`runQueue.server.ts`), not MarQS |
0 commit comments