Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c050789
feat: add active/archive schema definitions and abstract adapter methods
tinchoz49 Apr 18, 2026
08a6b4c
feat: rename tables to active/archive schema, all tests pass
tinchoz49 Apr 18, 2026
52e8bee
feat: implement archive move logic for complete/fail/cancel, add quer…
tinchoz49 Apr 18, 2026
365acfa
feat: implement step and span query routing for active/archive tables
tinchoz49 Apr 18, 2026
e65dc27
feat: active/archive split with single spans table
tinchoz49 Apr 24, 2026
2eb1cf5
docs: update AGENTS.md - do not use git worktrees
tinchoz49 Apr 24, 2026
2bc71fa
fix: move process-order test from shared-actions to duron package
tinchoz49 Apr 27, 2026
282e70c
docs: add pre-commit verification instructions to AGENTS.md
tinchoz49 Apr 27, 2026
1df6561
fix: type error and import order in process-order test
tinchoz49 Apr 27, 2026
2400c9f
fix kimi bad code
tinchoz49 Apr 27, 2026
74ace27
fix: handle expired active jobs blocking concurrency limits
tinchoz49 May 7, 2026
16c1be2
fix: reduce processTimeout default to 500ms and improve expired job r…
tinchoz49 May 7, 2026
bf333d2
more changes, created FINDINGS.md to solve race condition issues
tinchoz49 Jul 19, 2026
e974aed
fix lint
tinchoz49 Jul 19, 2026
89ffe9a
fix: patch SQL injection vulnerabilities in groupKey and JSONB filters
tinchoz49 Jul 20, 2026
978ddb0
fix: prevent bulk DELETE from destroying active jobs
tinchoz49 Jul 20, 2026
bc27d1d
fix: add FOR UPDATE lock to _retryJob to prevent duplicate retries
tinchoz49 Jul 20, 2026
714bf44
fix: prevent waitForJob TOCTOU race on fast-completing jobs
tinchoz49 Jul 20, 2026
93389c6
fix: preserve Zod-parsed input in ActionContext constructor
tinchoz49 Jul 20, 2026
823c53c
fix: prevent step span leak on recovery of already-completed steps
tinchoz49 Jul 20, 2026
a91b1c2
fix: remove event listeners on stop() to prevent duplication on restart
tinchoz49 Jul 20, 2026
dd52470
fix: await in-flight start() before proceeding with stop()
tinchoz49 Jul 20, 2026
071e4a5
fix: clean up orphan spans after bulk DELETE /api/jobs
tinchoz49 Jul 20, 2026
bc91a9e
fix: clean up orphan spans after _truncateArchive
tinchoz49 Jul 20, 2026
d2dc1ea
fix: add AbortSignal to _recoverJobs ping loop to prevent blocking sh…
tinchoz49 Jul 20, 2026
0a9c619
fix: replace sql.raw(timeoutMs) with parameterized interval arithmetic
tinchoz49 Jul 20, 2026
ffa9e75
fix: use spread syntax for _timeTravelJob restore to prevent field drift
tinchoz49 Jul 20, 2026
af26789
chore: remove unused dependencies p-all and p-timeout
tinchoz49 Jul 20, 2026
a126312
fix: correct processTimeout JSDoc to match actual default of 500ms
tinchoz49 Jul 20, 2026
7a66005
fix: preserve custom enumerable properties in serializeError
tinchoz49 Jul 20, 2026
84444be
chore: remove base.ts.backup and add *.backup to .gitignore
tinchoz49 Jul 20, 2026
f8de3da
docs: add .env.example documenting required environment variables
tinchoz49 Jul 20, 2026
86d5de4
docs: add repository, bugs, and homepage fields to package.json
tinchoz49 Jul 20, 2026
c641e40
fix: make PostgresBaseAdapter and _initDb abstract
tinchoz49 Jul 20, 2026
aedb0fa
perf: remove 14 unused indexes to reduce write overhead
tinchoz49 Jul 20, 2026
b6d71d5
fix: handle concurrent _timeTravelJob with ON CONFLICT DO NOTHING
tinchoz49 Jul 20, 2026
2d42909
fix: remove dead step notification code that was never listened to
tinchoz49 Jul 20, 2026
013a67d
docs: document _deleteJobs limitation to only operate on active table
tinchoz49 Jul 20, 2026
16372a5
fix: reorder _cancelJob to check job existence before updating steps
tinchoz49 Jul 20, 2026
828c560
fix: use fixed advisory lock key to prevent hash collisions
tinchoz49 Jul 20, 2026
4c574ff
refactor: rename DB column from 'branch' to 'parallel' for consistency
tinchoz49 Jul 20, 2026
77a277f
chore: update findings status and regenerate migrations
tinchoz49 Jul 20, 2026
c334c92
perf: remove redundant verify_concurrency CTE from _fetch
tinchoz49 Jul 20, 2026
b0bdbd4
perf: use single UNION ALL query in _getJobSteps to avoid two round-t…
tinchoz49 Jul 20, 2026
94224f6
fix: remove abort listener in waitForAbort release() to prevent memor…
tinchoz49 Jul 20, 2026
11c1b6e
fix: handle promise rejections in waitForJob status check
tinchoz49 Jul 21, 2026
a4c97ca
perf: exclude output from _getJobSteps result transfer
tinchoz49 Jul 21, 2026
5742996
feat: replace ping/pong with instance-level heartbeat for crashed-ins…
tinchoz49 Jul 21, 2026
18dec14
refactor: remove local OpenTelemetry span storage, keep external expo…
tinchoz49 Jul 21, 2026
8bc1e53
docs: remove local telemetry references from documentation
tinchoz49 Jul 21, 2026
a0b0be1
fix: typecheck regression and dead code cleanup after otelia removal
tinchoz49 Jul 21, 2026
fb733fd
fix: restore OTel packages to dependencies
tinchoz49 Jul 21, 2026
4dbd0e3
docs: fix telemetry docs for built-in OTel dependencies
tinchoz49 Jul 21, 2026
26aa59a
remove unused files
tinchoz49 Jul 21, 2026
c33acf5
remove unused files
tinchoz49 Jul 21, 2026
ead5ee2
chore: remove dead spansCount remnants from otelia removal
tinchoz49 Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .cursor/rules/duron-project.mdc

This file was deleted.

15 changes: 0 additions & 15 deletions .cursor/rules/shadcn.md

This file was deleted.

1 change: 0 additions & 1 deletion .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy packages/docs/dist/client --project-name=duron-docs
command: pages deploy packages/docs/dist/client --project-name=duron-docs
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ jobs:
run: bun run typecheck
- name: Run lint
run: bun run lint
- name: Run format check
run: bun run fmt:check
- name: Run tests
run: bun test
run: bun test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
.env.production.local
.env.local

# backup files
*.backup

# caches
.eslintcache
.cache
Expand All @@ -33,3 +36,9 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# Finder (MacOS) folder config
.DS_Store
.claude/settings.local.json

# git worktrees
.worktrees

.pi-subagents
.scratch
25 changes: 25 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"ignorePatterns": ["dist", "build", "node_modules", ".wrangler", "**/drizzle", "**/*.gen.ts"],
"experimentalSortImports": {
"order": "asc",
"groups": [
["side_effect"],
["builtin"],
["external", "type-external"],
["internal", "type-internal"],
["parent", "type-parent"],
["sibling", "type-sibling"],
["index", "type-index"]
]
}
}
26 changes: 26 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
"env": {
"browser": true,
"node": true,
"es2024": true
},
"categories": {
"correctness": "error",
"suspicious": "warn"
},
"rules": {
"import/no-unassigned-import": ["error", { "allow": ["./app.css", "**/*.css"] }],
"no-underscore-dangle": "off"
},
"overrides": [
{
"files": ["packages/duron-dashboard/src/components/ui/**/*.tsx"],
"rules": {
"no-shadow": "off"
}
}
],
"ignorePatterns": ["dist", "build", "node_modules", ".wrangler", "**/*.gen.ts", "**/env.d.ts"]
}
9 changes: 0 additions & 9 deletions .vscode/settings.json

This file was deleted.

131 changes: 131 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# AGENTS.md

## Runtime

- **Bun only.** Never use npm, pnpm, yarn, Node.js, or Vite (except `packages/docs` which uses Vite for SSR).
- Prefer Bun-native APIs: `Bun.serve`, `bun:sqlite`, `Bun.sql`, `Bun.file`, `Bun.$`, `bun:test`.
- Bun auto-loads `.env` files. Do not use `dotenv`.

## Monorepo

Bun workspaces: `docs/*` and `packages/*`.

| Package | Role | Key Entrypoints |
| -------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `packages/duron` | Core library | `duron`, `duron/client`, `duron/action`, `duron/server`, `duron/adapters/postgres`, `duron/adapters/pglite` |
| `packages/duron-dashboard` | React dashboard | `duron-dashboard`, `duron-dashboard/get-html` |
| `packages/docs` | Fumadocs docs site | Uses Vite for SSR |
| `packages/examples` | Example apps | `basic/start.ts`, `multi-worker/parent.ts` |
| `packages/shared-actions` | Shared actions for examples | — |

## Developer Commands

```bash
# Install
bun install

# One package
cd packages/duron && bun run dev # watch mode (tsc --watch)
cd packages/duron-dashboard && bun run dev # dashboard dev server on :3001

# Root shortcuts
bun run dev:duron # watch core
bun run dev:dashboard # dashboard dev server
bun run dev:examples:basic # basic example

# Verification (CI runs in this order)
bun run typecheck # tsc --noEmit across packages
bun run lint # oxlint check
bun run lint:fix # oxlint fix
bun run fmt:check # oxfmt check
bun run fmt # oxfmt fix
bun test # runs packages/duron tests with --concurrent

# Build
bun run build # all packages
bun run build:docs # docs only
```

## Database

- PostgreSQL for dev: `docker-compose up -d` → `postgres://duron:duron@localhost:5435/duron`
- PGLite for tests/development.
- Generate migrations:
```bash
cd packages/duron
bun run generate:postgres # drizzle-kit generate
```

## Testing

- Framework: `bun:test`
- Tests live in `packages/duron/test/*.test.ts`
- Run single file: `bun test specific.test.ts`
- Core tests run with `--concurrent` via `bun test` in `packages/duron/package.json`
- Test setup (`test/setup.ts`) auto-creates a Docker container `duron-postgres-test` on port 5440 for PostgreSQL tests. Docker must be running.

## Lint / Format (Oxlint/Oxfmt)

- Config: `.oxlintrc.json` (oxlint), `.oxfmtrc.json` (oxfmt)
- Rules worth knowing:
- `noConsole` → warn (use logger instead)
- `noNonNullAssertion` → off
- Line width: 100
- Single quotes, no semicolons
- Organize imports automatically

## Build Details

- `packages/duron`: `tsc --project tsconfig.node.json`
- `packages/duron-dashboard`: `NODE_ENV=production bun run build.ts && bun run build:get-html`
- Docs: `vite build`

## Dashboard

- Do **not** modify files in `src/components/ui/` (managed by Shadcn UI).
- Use existing UI components from `src/components/ui/`.
- Dashboard dev server starts on `http://localhost:3001`.

## Env Variables

| Variable | Purpose |
| ---------------- | ---------------------------- |
| `DATABASE_URL` | PostgreSQL connection string |
| `JWT_SECRET` | Dashboard auth |
| `OPENAI_API_KEY` | AI examples |

## CI

Workflow `.github/workflows/test.yml` runs: `bun install` → `typecheck` → `lint` → `test`.

## Branch Workflow

- Create feature branches from `main` for all changes
- Do **not** use git worktrees
- Commit directly to the feature branch
- **Before every commit, run verification locally:**
```bash
bun run typecheck # TypeScript check across all packages
bun run lint # Lint check
bun test # Full test suite (not just packages/duron)
```

## Telemetry

Configured on the Duron client:

- `telemetry: { local: true }` → store spans in DB
- `telemetry: { traceExporter }` → export to OTel backends
- No config → disabled

## Key Files

| Path | Description |
| ------------------------------------------------- | ----------------------------- |
| `packages/duron/src/client.ts` | Job queue client |
| `packages/duron/src/action.ts` | Action definitions |
| `packages/duron/src/server.ts` | REST API server |
| `packages/duron/src/step-manager.ts` | Step execution & nested steps |
| `packages/duron/src/adapters/adapter.ts` | Base adapter |
| `packages/duron/src/telemetry/` | Telemetry adapters |
| `packages/duron-dashboard/src/DuronDashboard.tsx` | Dashboard root |
Loading
Loading