Skip to content

Modernize the runtime and agent tooling - #49

Merged
KayleeWilliams merged 7 commits into
mainfrom
KayleeWilliams/reactivation
Jul 24, 2026
Merged

Modernize the runtime and agent tooling#49
KayleeWilliams merged 7 commits into
mainfrom
KayleeWilliams/reactivation

Conversation

@KayleeWilliams

Copy link
Copy Markdown
Collaborator

Summary

  • move the project to Node 24.18.0, Bun 1.3.14, TypeScript 7.0.2, and the latest dependencies eligible under the 24-hour release-age gate
  • align Effect and the installed Effect ecosystem on 4.0.0-beta.101, then migrate affected v4 APIs
  • update Chat SDK integration and add durable tenant-scoped list and queue persistence
  • refresh project agent skills, including Effect, Leadtype, tsdown, Turborepo, and Ultracite, with Claude-compatible links
  • rewrite AGENTS.md and add CLAUDE.md as a stable pointer to the shared project guidance
  • modernize Ultracite, tsdown, and GitHub Actions configuration

Validation

  • bun install --frozen-lockfile
  • bun x ultracite doctor
  • bun x ultracite check
  • bun run check
  • bun run typecheck
  • bun run test
  • bun run build
  • CI=1 bun run --cwd packages/dsar build
  • local GitHub Actions validation for lint, documentation coverage, and the Bun and Node 24 test matrices
  • Leadtype agent skill validation

Notes

  • Effect 4 is still published on the beta channel; this uses 4.0.0-beta.101, the newest release eligible under the repository age gate when refreshed.
  • TypeScript 7 compiler API consumers are isolated to the TypeScript 6 compatibility alias until their upstream integrations support the experimental TypeScript 7 API.
  • bun run smoke requires a running DSAR server and an API token, so it was not run in the local validation environment.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 168 files, which is 18 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to Pro+ to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6a91acf2-b215-4f79-9be3-f2662f195fa0

📥 Commits

Reviewing files that changed from the base of the PR and between 717f35f and 020c50f.

⛔ Files ignored due to path filters (3)
  • bun.lock is excluded by !**/*.lock
  • packages/backend/test/__snapshots__/openapi.test.ts.snap is excluded by !**/*.snap
  • packages/storage-s3/src/generated/s3.ts is excluded by !**/generated/**
📒 Files selected for processing (181)
  • .agents/skills/effect-ts/SKILL.md
  • .agents/skills/effect-ts/references/features.md
  • .agents/skills/effect-ts/references/guide-effect.md
  • .agents/skills/effect-ts/references/guide-error-handling.md
  • .agents/skills/effect-ts/references/guide-layers.md
  • .agents/skills/effect-ts/references/guide-observability.md
  • .agents/skills/effect-ts/references/guide-retries.md
  • .agents/skills/effect-ts/references/guide-schedule.md
  • .agents/skills/effect-ts/references/guide-schema.md
  • .agents/skills/effect-ts/references/guide-sql.md
  • .agents/skills/effect-ts/references/guide-testing.md
  • .agents/skills/effect-ts/references/setup.md
  • .agents/skills/find-skills/SKILL.md
  • .agents/skills/leadtype/SKILL.md
  • .agents/skills/tsdown/README.md
  • .agents/skills/tsdown/SKILL.md
  • .agents/skills/tsdown/references/README.md
  • .agents/skills/tsdown/references/advanced-benchmark.md
  • .agents/skills/tsdown/references/advanced-ci.md
  • .agents/skills/tsdown/references/advanced-hooks.md
  • .agents/skills/tsdown/references/advanced-plugins.md
  • .agents/skills/tsdown/references/advanced-programmatic.md
  • .agents/skills/tsdown/references/advanced-rolldown-options.md
  • .agents/skills/tsdown/references/guide-getting-started.md
  • .agents/skills/tsdown/references/guide-introduction.md
  • .agents/skills/tsdown/references/guide-migrate-from-tsup.md
  • .agents/skills/tsdown/references/option-cjs-default.md
  • .agents/skills/tsdown/references/option-cleaning.md
  • .agents/skills/tsdown/references/option-config-file.md
  • .agents/skills/tsdown/references/option-css.md
  • .agents/skills/tsdown/references/option-dependencies.md
  • .agents/skills/tsdown/references/option-dts.md
  • .agents/skills/tsdown/references/option-entry.md
  • .agents/skills/tsdown/references/option-exe.md
  • .agents/skills/tsdown/references/option-lint.md
  • .agents/skills/tsdown/references/option-log-level.md
  • .agents/skills/tsdown/references/option-minification.md
  • .agents/skills/tsdown/references/option-output-directory.md
  • .agents/skills/tsdown/references/option-output-format.md
  • .agents/skills/tsdown/references/option-package-exports.md
  • .agents/skills/tsdown/references/option-platform.md
  • .agents/skills/tsdown/references/option-root.md
  • .agents/skills/tsdown/references/option-shims.md
  • .agents/skills/tsdown/references/option-sourcemap.md
  • .agents/skills/tsdown/references/option-target.md
  • .agents/skills/tsdown/references/option-tree-shaking.md
  • .agents/skills/tsdown/references/option-unbundle.md
  • .agents/skills/tsdown/references/option-watch-mode.md
  • .agents/skills/tsdown/references/recipe-react.md
  • .agents/skills/tsdown/references/recipe-solid.md
  • .agents/skills/tsdown/references/recipe-svelte.md
  • .agents/skills/tsdown/references/recipe-vue.md
  • .agents/skills/tsdown/references/recipe-wasm.md
  • .agents/skills/tsdown/references/reference-cli.md
  • .agents/skills/turborepo/SKILL.md
  • .agents/skills/turborepo/command/turborepo.md
  • .agents/skills/turborepo/references/best-practices/RULE.md
  • .agents/skills/turborepo/references/best-practices/dependencies.md
  • .agents/skills/turborepo/references/best-practices/packages.md
  • .agents/skills/turborepo/references/best-practices/structure.md
  • .agents/skills/turborepo/references/boundaries/RULE.md
  • .agents/skills/turborepo/references/caching/RULE.md
  • .agents/skills/turborepo/references/caching/gotchas.md
  • .agents/skills/turborepo/references/caching/remote-cache.md
  • .agents/skills/turborepo/references/ci/RULE.md
  • .agents/skills/turborepo/references/ci/github-actions.md
  • .agents/skills/turborepo/references/ci/patterns.md
  • .agents/skills/turborepo/references/ci/vercel.md
  • .agents/skills/turborepo/references/cli/RULE.md
  • .agents/skills/turborepo/references/cli/commands.md
  • .agents/skills/turborepo/references/configuration/RULE.md
  • .agents/skills/turborepo/references/configuration/global-options.md
  • .agents/skills/turborepo/references/configuration/gotchas.md
  • .agents/skills/turborepo/references/configuration/tasks.md
  • .agents/skills/turborepo/references/environment/RULE.md
  • .agents/skills/turborepo/references/environment/gotchas.md
  • .agents/skills/turborepo/references/environment/modes.md
  • .agents/skills/turborepo/references/filtering/RULE.md
  • .agents/skills/turborepo/references/filtering/patterns.md
  • .agents/skills/turborepo/references/watch/RULE.md
  • .agents/skills/ultracite/SKILL.md
  • .agents/skills/ultracite/references/code-standards.md
  • .changeset/modern-runtime-foundation.md
  • .claude/skills/effect-ts
  • .claude/skills/find-skills
  • .claude/skills/leadtype
  • .claude/skills/tsdown
  • .claude/skills/turborepo
  • .claude/skills/ultracite
  • .github/workflows/ci.yml
  • .github/workflows/deploy-docs.yml
  • .github/workflows/release.yml
  • .gitignore
  • .node-version
  • .oxfmtrc.jsonc
  • .oxlintrc.json
  • AGENTS.md
  • CLAUDE.md
  • docs/guides/examples-and-deployment.mdx
  • docs/guides/getting-started.mdx
  • docs/index.mdx
  • docs/integrations/auth/unkey.mdx
  • docs/integrations/index.mdx
  • docs/integrations/rate-limit/redis.mdx
  • docs/integrations/rate-limit/upstash.mdx
  • docs/reference/api/webhooks.mdx
  • docs/reference/developer/sdk-and-runtime.mdx
  • docs/reference/errors/dsar-sdk-1101.mdx
  • docs/reference/errors/dsar-sdk-1201.mdx
  • docs/reference/errors/dsar-sdk-1301.mdx
  • docs/reference/index.mdx
  • examples/kitchen-sink/package.json
  • oxfmt.config.ts
  • oxlint.config.ts
  • package.json
  • packages/auth-unkey/package.json
  • packages/backend/.oxlintrc.json
  • packages/backend/package.json
  • packages/backend/src/adapters/registry.ts
  • packages/backend/src/http-api/common.ts
  • packages/backend/src/middleware/errors/mappers.ts
  • packages/backend/src/routes/requests/shared.ts
  • packages/backend/src/routes/schemas.ts
  • packages/backend/src/services/legal-clock/service.ts
  • packages/backend/src/types/runtime.ts
  • packages/cli/.oxlintrc.json
  • packages/cli/package.json
  • packages/core/package.json
  • packages/core/src/chat.ts
  • packages/core/src/service.ts
  • packages/core/src/test-fixtures/chat-memory-state.ts
  • packages/core/test/chat-state.test.ts
  • packages/core/test/modes.test.ts
  • packages/dsar/.oxlintrc.json
  • packages/dsar/package.json
  • packages/dsar/tsdown.config.ts
  • packages/inbound-resend/package.json
  • packages/inbound-slack/package.json
  • packages/internals/error-codes/package.json
  • packages/internals/guards/package.json
  • packages/internals/persistence/.oxlintrc.json
  • packages/internals/persistence/package.json
  • packages/internals/persistence/src/migrations/0003-chat-runtime-lists-and-queues.ts
  • packages/internals/persistence/src/services/persistence.ts
  • packages/internals/persistence/src/services/persistence/migrations.ts
  • packages/internals/persistence/src/tenant/context.ts
  • packages/internals/persistence/src/types/domain.ts
  • packages/internals/persistence/test/migration-conformance.ts
  • packages/internals/persistence/test/persistence.test.ts
  • packages/internals/policy-engine/.oxlintrc.json
  • packages/internals/policy-engine/package.json
  • packages/internals/policy-engine/src/evaluator/service.ts
  • packages/internals/policy-packs/.oxlintrc.json
  • packages/internals/policy-packs/package.json
  • packages/internals/policy-packs/src/diff/service.ts
  • packages/internals/policy-packs/src/pinning/service.ts
  • packages/internals/policy-packs/src/registry/service.ts
  • packages/internals/policy-packs/src/service.ts
  • packages/internals/policy-packs/src/upgrade/audit.ts
  • packages/internals/policy-packs/src/upgrade/service.ts
  • packages/internals/schema/.oxlintrc.json
  • packages/internals/schema/package.json
  • packages/node-sdk/.oxlintrc.json
  • packages/node-sdk/package.json
  • packages/node-sdk/src/webhooks/receiver.ts
  • packages/outbound-resend/package.json
  • packages/outbound-resend/src/types.ts
  • packages/persistence-pg/package.json
  • packages/persistence-sqlite/package.json
  • packages/redis/package.json
  • packages/storage-filesystem/.oxlintrc.json
  • packages/storage-filesystem/package.json
  • packages/storage-s3/.oxlintrc.json
  • packages/storage-s3/package.json
  • packages/storage-vercel-blob/.oxlintrc.json
  • packages/storage-vercel-blob/package.json
  • packages/upstash/package.json
  • patches/leadtype@0.4.2.patch
  • scripts/check-tsdoc-coverage.ts
  • scripts/prepare-effect.sh
  • skills-lock.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KayleeWilliams/reactivation

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one behavior worth confirming before merge, noted inline.

Reviewed changes — a broad runtime/tooling modernization plus one genuinely new persistence feature; the large majority of the 184 files are vendored agent-skill markdown, so review focused on the code and config diffs.

  • Runtime + dependency bump — Node >=24 <25, Bun 1.3.14, TypeScript 7.0.2, vitest/tsdown/oxlint/oxfmt/ultracite/turbo upgrades, and a deliberate @types/node downgrade (25.x24.13.3) to match the Node 24 line.
  • Effect ecosystem aligned to 4.0.0-beta.101 — with the v4 API migration: effect/ServiceMapeffect/Context for every *.Service tag, and Schema.withDecodingDefaultKey(() => x)Schema.withDecodingDefaultKey(Effect.succeed(x)) across packages/backend/src/routes/schemas.ts.
  • New durable chat list/queue persistence — migration 0003-chat-runtime-lists-and-queues (per-dialect DDL + indexes), new appendToList/getList/enqueue/dequeue/queueDepth/forceReleaseLock repository methods in persistence.ts, the ChatRuntimeStateRepository contract in types/domain.ts, adapter wiring in core/src/chat.ts, in-memory fixtures, and tests.
  • TypeScript 7 isolationcheck-tsdoc-coverage.ts now imports @typescript/typescript6, packages/dsar typecheck moved tsgotsc while the tsdown dts generator stays tsgo, and a suppressWarnings entry hides the TS7-experimental-API notice.
  • Tooling — new scripts/prepare-effect.sh + prepare:effect script, chat SDK bump (^4.18^4.34) with adapter/resend bumps, refreshed AGENTS.md/CLAUDE.md and GitHub Actions config.

ℹ️ New list/queue TTL path is untested

The added persistence test and the in-memory fixtures never exercise list or queue expiry — expiresAt is always set 60s in the future and appendToList is never called with a TTL. The two in-memory fixtures also disagree with the SQL path on expiry semantics (chat-memory-state.ts has no list-expiry concept at all; the chat-state.test.ts fixture skips queue-expiry filtering that the SQL implementation performs), so a regression in the SQL TTL logic would not be caught by the current tests.

Technical details
# New list/queue TTL path is untested

## Affected sites
- `packages/internals/persistence/test/persistence.test.ts:939` — new "persists bounded chat lists and queues" test never appends with a TTL and never lets an entry expire.
- `packages/core/src/test-fixtures/chat-memory-state.ts``appendToList`/`getList` ignore `ttlMs` entirely (no list expiry).
- `packages/core/test/chat-state.test.ts` — fixture `enqueue`/`dequeue`/`queueDepth` do not filter by `expiresAt`, unlike the SQL implementation and unlike the queue logic in `chat-memory-state.ts`.

## Required outcome
- A test that appends/enqueues with a short TTL, advances the clock past it, and asserts `getList`/`dequeue`/`queueDepth` drop the expired entries against the real SQL implementation.

## Suggested approach (optional)
The existing `runForTenant` harness with a controllable clock (as used by the lock-extension tests) is the natural place to add this — no new scaffolding needed.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

Comment thread packages/internals/persistence/src/services/persistence.ts Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the single new commit b1aa4f3 reworks how chat list expiry is stored, directly addressing the prior review's concern about append-order-dependent per-row TTLs.

  • Per-list expiry moved to a dedicated table — new chat_state_list_keys (tenant_id, list_key, expires_at) owns each list's expiry; chat_state_lists drops its expires_at column and gains a composite FOREIGN KEY ... ON DELETE CASCADE back to it.
  • appendToList expiry is now well-defined — a supplied expiresAt refreshes the whole-list expiry, while a ttl-less append preserves the current expiry via ON CONFLICT DO UPDATE SET expires_at = COALESCE(excluded.expires_at, existing), eliminating the divergent per-row NULL write.
  • Lazy expiry cleanup made transactionalappendToList, getList, and delete run inside sql.withTransaction and consistently purge both chat_state_lists and chat_state_list_keys; correctness does not depend on FK cascade enforcement since explicit deletes cover every path.
  • Migration + conformance updated — migration 0003 creates the new table and idx_chat_list_keys_tenant_expiry, drops them on revert, and the conformance test asserts both the added table and index.
  • New TTL testkeeps list TTL scoped to the whole list across ttl-less appends verifies preservation across a ttl-less append, whole-list expiry, and a fresh no-ttl append after expiry.

The prior review's inline TTL thread is resolved by this commit. The in-memory fixture divergence noted in the initial review remains open but is unchanged by this commit, so it is not re-raised here.

Pullfrog  | View workflow run | Using Claude Opus𝕏

@KayleeWilliams
KayleeWilliams merged commit 364dfa2 into main Jul 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant