Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude/REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ The `apps/webapp/app/v3/` directory name is misleading — most code there is V2

## Confidence calibration for this repo

The most common false-positive pattern: speculating about race conditions in code paths the agent doesn't have runtime visibility into. If the only evidence is "this *could* race", drop it. If you can point to a specific interleaving with file:line for each step, surface it.
The most common false-positive pattern: speculating about race conditions in code paths the agent doesn't have runtime visibility into. If the only evidence is "this _could_ race", drop it. If you can point to a specific interleaving with file:line for each step, surface it.
1 change: 1 addition & 0 deletions .claude/rules/legacy-v3-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The `v3/` directory name is misleading - most code here is actively used by the
## V1/V2 Branching Pattern

Some services act as routers that branch on `RunEngineVersion`:

- `services/cancelTaskRun.server.ts` - calls V1 service or `engine.cancelRun()` for V2
- `services/batchTriggerV3.server.ts` - uses marqs for V1 path, run-engine for V2

Expand Down
2 changes: 2 additions & 0 deletions .claude/rules/package-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ paths:
When adding a new dependency to any package.json in the monorepo:

1. **Look up the latest version** on npm before adding:

```bash
pnpm view <package-name> version
```

If unsure which version to use (e.g. major version compatibility), confirm with the user.

2. **Edit the package.json directly** — do NOT use `pnpm add` as it can cause issues in the monorepo. Add the dependency with the correct version range (typically `^x.y.z`).
Expand Down
18 changes: 9 additions & 9 deletions .claude/skills/span-timeline-events/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ Sibling spans (same parent) are sorted by `start_time ASC` from the ClickHouse q

`getAdminOnlyForEvent()` controls visibility. Events default to **admin-only** (`true`).

| Event | Admin-only | Friendly name |
|-------|-----------|---------------|
| `dequeue` | No | Dequeued |
| `fork` | No | Launched |
| `import` | No (if no fork event) | Importing task file |
| `create_attempt` | Yes | Attempt created |
| `lazy_payload` | Yes | Lazy attempt initialized |
| `pod_scheduled` | Yes | Pod scheduled |
| (default) | Yes | (raw event name) |
| Event | Admin-only | Friendly name |
| ---------------- | --------------------- | ------------------------ |
| `dequeue` | No | Dequeued |
| `fork` | No | Launched |
| `import` | No (if no fork event) | Importing task file |
| `create_attempt` | Yes | Attempt created |
| `lazy_payload` | Yes | Lazy attempt initialized |
| `pod_scheduled` | Yes | Pod scheduled |
| (default) | Yes | (raw event name) |

## Adding New Timeline Events

Expand Down
63 changes: 35 additions & 28 deletions .claude/skills/trigger-dev-tasks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ export const paymentTask = task({

```ts
await myTask.trigger(payload, {
delay: "1h", // Delay execution
ttl: "10m", // Cancel if not started within TTL
delay: "1h", // Delay execution
ttl: "10m", // Cancel if not started within TTL
idempotencyKey: key,
queue: "my-queue",
machine: "large-1x", // micro, small-1x, small-2x, medium-1x, medium-2x, large-1x, large-2x
machine: "large-1x", // micro, small-1x, small-2x, medium-1x, medium-2x, large-1x, large-2x
maxAttempts: 3,
tags: ["user_123"], // Max 10 tags
debounce: { // Consolidate rapid triggers
tags: ["user_123"], // Max 10 tags
debounce: {
// Consolidate rapid triggers
key: "unique-key",
delay: "5s",
mode: "trailing", // "leading" (default) or "trailing"
mode: "trailing", // "leading" (default) or "trailing"
},
});
```
Expand All @@ -134,21 +135,27 @@ Consolidate multiple triggers into a single execution:

```ts
// Rapid triggers with same key = single execution
await myTask.trigger({ userId: "123" }, {
debounce: {
key: "user-123-update",
delay: "5s",
},
});
await myTask.trigger(
{ userId: "123" },
{
debounce: {
key: "user-123-update",
delay: "5s",
},
}
);

// Trailing mode: use payload from LAST trigger
await myTask.trigger({ data: "latest" }, {
debounce: {
key: "my-key",
delay: "10s",
mode: "trailing",
},
});
await myTask.trigger(
{ data: "latest" },
{
debounce: {
key: "my-key",
delay: "10s",
mode: "trailing",
},
}
);
```

Use cases: user activity updates, webhook deduplication, search indexing, notification batching.
Expand All @@ -170,15 +177,15 @@ for (const result of results) {

## Machine Presets

| Preset | vCPU | Memory |
|-------------|------|--------|
| micro | 0.25 | 0.25GB |
| small-1x | 0.5 | 0.5GB |
| small-2x | 1 | 1GB |
| medium-1x | 1 | 2GB |
| medium-2x | 2 | 4GB |
| large-1x | 4 | 8GB |
| large-2x | 8 | 16GB |
| Preset | vCPU | Memory |
| --------- | ---- | ------ |
| micro | 0.25 | 0.25GB |
| small-1x | 0.5 | 0.5GB |
| small-2x | 1 | 1GB |
| medium-1x | 1 | 2GB |
| medium-2x | 2 | 4GB |
| large-1x | 4 | 8GB |
| large-2x | 8 | 16GB |

## Design Principles

Expand Down
43 changes: 25 additions & 18 deletions .claude/skills/trigger-dev-tasks/advanced-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ Enhanced batch triggering with larger payloads and streaming ingestion.

### Rate Limiting (per environment)

| Tier | Bucket Size | Refill Rate |
|------|-------------|-------------|
| Free | 1,200 runs | 100 runs/10 sec |
| Hobby | 5,000 runs | 500 runs/5 sec |
| Pro | 5,000 runs | 500 runs/5 sec |
| Tier | Bucket Size | Refill Rate |
| ----- | ----------- | --------------- |
| Free | 1,200 runs | 100 runs/10 sec |
| Hobby | 5,000 runs | 500 runs/5 sec |
| Pro | 5,000 runs | 500 runs/5 sec |

### Concurrent Batch Processing

| Tier | Concurrent Batches |
|------|-------------------|
| Free | 1 |
| Hobby | 10 |
| Pro | 10 |
| Tier | Concurrent Batches |
| ----- | ------------------ |
| Free | 1 |
| Hobby | 10 |
| Pro | 10 |

### Usage

Expand Down Expand Up @@ -122,8 +122,8 @@ await myTask.trigger(
{ userId: "123" },
{
debounce: {
key: "user-123-update", // Unique identifier for debounce group
delay: "5s", // Wait duration ("5s", "1m", or milliseconds)
key: "user-123-update", // Unique identifier for debounce group
delay: "5s", // Wait duration ("5s", "1m", or milliseconds)
},
}
);
Expand All @@ -135,14 +135,20 @@ await myTask.trigger(

```ts
// First trigger sets the payload
await myTask.trigger({ action: "first" }, {
debounce: { key: "my-key", delay: "10s" }
});
await myTask.trigger(
{ action: "first" },
{
debounce: { key: "my-key", delay: "10s" },
}
);

// Second trigger only reschedules - payload remains "first"
await myTask.trigger({ action: "second" }, {
debounce: { key: "my-key", delay: "10s" }
});
await myTask.trigger(
{ action: "second" },
{
debounce: { key: "my-key", delay: "10s" },
}
);
// Task executes with { action: "first" }
```

Expand All @@ -162,6 +168,7 @@ await myTask.trigger(
```

In trailing mode, these options update with each trigger:

- `payload` — task input data
- `metadata` — run metadata
- `tags` — run tags (replaces existing)
Expand Down
7 changes: 4 additions & 3 deletions .claude/skills/trigger-dev-tasks/basic-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ await myTask.trigger(
{ userId: "123" },
{
debounce: {
key: "user-123-update", // Unique key for debounce group
delay: "5s", // Wait before executing
key: "user-123-update", // Unique key for debounce group
delay: "5s", // Wait before executing
},
}
);
Expand All @@ -88,13 +88,14 @@ await myTask.trigger(
debounce: {
key: "trailing-example",
delay: "10s",
mode: "trailing", // Default is "leading" (first payload)
mode: "trailing", // Default is "leading" (first payload)
},
}
);
```

**Debounce modes:**

- `leading` (default): Uses payload from first trigger, subsequent triggers only reschedule
- `trailing`: Uses payload from most recent trigger

Expand Down
3 changes: 2 additions & 1 deletion .cursor/commands/deslop.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
Check the diff against main, and remove all AI generated slop introduced in this branch.

This includes:

- Extra comments that a human wouldn't add or is inconsistent with the rest of the file
- Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths)
- Casts to any to get around type issues
- Any other style that is inconsistent with the file

Report at the end with only a 1-3 sentence summary of what you changed
Report at the end with only a 1-3 sentence summary of what you changed
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
- any: ["**/*.md"]

"📌 area: ci":
- any: [".github/**/*"]
- any: [".github/**/*"]
38 changes: 38 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "🎨 Format & Lint"

on:
workflow_call:

permissions:
contents: read

jobs:
code-quality:
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: ⎔ Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: 10.33.2

- name: ⎔ Setup node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20.20.2
cache: "pnpm"

- name: 📥 Download deps
run: pnpm install --frozen-lockfile

- name: 💅 Check formatting
run: pnpm exec oxfmt --check .

- name: 🔎 Lint
run: pnpm exec oxlint .
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-critical-alerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dependabot Critical Alerts

on:
schedule:
- cron: "0 8 * * *" # Daily 08:00 UTC
- cron: "0 8 * * *" # Daily 08:00 UTC
workflow_dispatch:
inputs:
severity:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dependabot-weekly-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dependabot Weekly Summary

on:
schedule:
- cron: "0 8 * * 1" # Mon 08:00 UTC
- cron: "0 8 * * 1" # Mon 08:00 UTC
workflow_dispatch:

# Single-purpose monitoring workflow; serialise on workflow name only - we never
Expand All @@ -12,9 +12,9 @@ concurrency:
cancel-in-progress: false

permissions:
contents: read # gh CLI baseline
pull-requests: read # gh pr list (open dependabot PRs)
actions: read # gh run list / view (parse latest dependabot run logs)
contents: read # gh CLI baseline
pull-requests: read # gh pr list (open dependabot PRs)
actions: read # gh run list / view (parse latest dependabot run logs)

jobs:
summary:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ jobs:
- 'pnpm-workspace.yaml'
- 'turbo.json'

code-quality:
needs: changes
if: needs.changes.outputs.code == 'true'
uses: ./.github/workflows/code-quality.yml

typecheck:
needs: changes
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.typecheck_self == 'true'
Expand Down Expand Up @@ -155,6 +160,7 @@ jobs:
name: All PR Checks
needs:
- changes
- code-quality
- typecheck
- webapp
- e2e-webapp
Expand Down
Loading
Loading