Skip to content

Consolidate shared deps via pnpm catalog and restrict pg to db package#680

Merged
iscekic merged 5 commits intomainfrom
chore/catalog-cleanup
Mar 1, 2026
Merged

Consolidate shared deps via pnpm catalog and restrict pg to db package#680
iscekic merged 5 commits intomainfrom
chore/catalog-cleanup

Conversation

@iscekic
Copy link
Contributor

@iscekic iscekic commented Feb 27, 2026

Summary

  • pnpm catalog expanded to 15 entries: drizzle-orm, zod, hono, typescript, wrangler, jsonwebtoken, @types/jsonwebtoken, prettier, eslint, @eslint/js, @eslint/eslintrc, typescript-eslint, @octokit/auth-app, aws4fetch, workers-tagged-logger — all at latest compatible versions. Eliminates version drift across 21 workspace packages.

  • pg/drizzle-kit restricted to db package: Removed redundant pg from cloudflare-session-ingest, kiloclaw, and cloud-agent-next. Refactored cloud-agent-next to use @kilocode/db + drizzle-orm instead of raw pg.Client, deleting ~300 lines of custom db facade code. The new implementation mirrors the existing cloud-agent service.

  • hono 4.12 compatibility: Added as unknown as MiddlewareHandler cast in cloudflare-webhook-agent-ingest and cloudflare-ai-attribution to bridge a type mismatch between workers-tagged-logger's bundled Handler type and hono 4.12+'s MiddlewareHandler. Upstream issue — runtime is unaffected.

  • prettier 3.8.1 formatting: 9 files reformatted due to prettier upgrade from 3.6.2.

Changed files

Scope Files
Catalog config pnpm-workspace.yaml
package.json updates 21 subpackage package.json files
cloud-agent-next refactor installation-lookup-service.ts rewritten, 7 db files deleted
hono 4.12 compat cloudflare-webhook-agent-ingest/src/index.ts, cloudflare-ai-attribution/src/ai-attribution.worker.ts
Formatting 9 source files (prettier 3.8.1)
Lockfile pnpm-lock.yaml

@iscekic iscekic self-assigned this Feb 27, 2026
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR performs two main tasks:

  1. pnpm catalog consolidation — Migrates ~15 shared dependencies (hono, zod, typescript, eslint, prettier, wrangler, etc.) from per-package version specifiers to catalog: references in pnpm-workspace.yaml. This ensures consistent versions across all workspace packages.

  2. cloud-agent-next Drizzle ORM migration — Replaces the custom SqlStore/database.ts/node-postgres.ts abstraction with the shared @kilocode/db package (Drizzle ORM). The PlatformIntegrationsStore class is inlined into InstallationLookupService as a Drizzle query, and the old files are deleted.

Key observations:

  • The Drizzle query in InstallationLookupService correctly preserves the security JOIN on organization_memberships to verify user membership before returning org installations.
  • The @ts-expect-error annotations on useWorkersLogger() calls are a reasonable workaround for the workers-tagged-logger type incompatibility with hono 4.12+.
  • Formatting changes across multiple files are consistent with the prettier upgrade (3.6.2 → 3.8.1).
  • No dangling imports to deleted modules were found.
  • Both cloud-agent-next and cloud-agent installation lookup services are now identical.
Files Reviewed (43 files)
  • cloud-agent-next/package.json - catalog migration, pg→drizzle-orm
  • cloud-agent-next/src/db/SqlStore.ts - deleted
  • cloud-agent-next/src/db/database.ts - deleted
  • cloud-agent-next/src/db/node-postgres.ts - deleted
  • cloud-agent-next/src/db/table.ts - deleted
  • cloud-agent-next/src/db/tables/organization-memberships.table.ts - deleted
  • cloud-agent-next/src/db/tables/platform-integrations.table.ts - deleted
  • cloud-agent-next/src/db/stores/PlatformIntegrationsStore.ts - deleted
  • cloud-agent-next/src/services/installation-lookup-service.ts - rewritten to Drizzle
  • cloud-agent-next/wrapper/package.json - catalog migration
  • cloud-agent/package.json - catalog migration
  • cloud-agent/src/services/installation-lookup-service.ts - added isNotNull guard
  • cloud-agent/wrapper/package.json - catalog migration
  • cloudflare-ai-attribution/package.json - catalog migration
  • cloudflare-ai-attribution/src/ai-attribution.worker.ts - @ts-expect-error for hono compat
  • cloudflare-app-builder/package.json - catalog migration
  • cloudflare-auto-fix-infra/package.json - catalog migration
  • cloudflare-auto-triage-infra/package.json - catalog migration
  • cloudflare-code-review-infra/package.json - catalog migration
  • cloudflare-db-proxy/package.json - catalog migration
  • cloudflare-deploy-infra/builder/package.json - catalog migration
  • cloudflare-deploy-infra/dispatcher/package.json - catalog migration
  • cloudflare-gastown/container/package.json - catalog migration
  • cloudflare-gastown/package.json - catalog migration
  • cloudflare-git-token-service/package.json - catalog migration
  • cloudflare-images-mcp/package.json - catalog migration
  • cloudflare-o11y/package.json - catalog migration
  • cloudflare-session-ingest/package.json - catalog migration, removed pg
  • cloudflare-webhook-agent-ingest/package.json - catalog migration
  • cloudflare-webhook-agent-ingest/src/index.ts - @ts-expect-error for hono compat
  • kiloclaw/package.json - catalog migration, pg→drizzle-orm
  • package.json - catalog migration
  • packages/db/package.json - catalog migration
  • pnpm-workspace.yaml - expanded catalog
  • pnpm-lock.yaml - lockfile update (skipped)
  • storybook/package.json - catalog migration
  • src/components/cloud-agent-next/CloudChatContainer.tsx - formatting
  • src/components/cloud-agent/CloudChatContainer.tsx - formatting
  • src/components/ui/button.tsx - formatting
  • src/instrumentation.ts - formatting
  • src/lib/auto-triage/application/webhook/issue-webhook-processor.ts - formatting
  • src/lib/cloud-agent/gitlab-integration-helpers.test.ts - formatting
  • src/lib/kilo-pass/stripe-handlers-invoice-paid.test.ts - formatting
  • src/lib/kilo-pass/stripe-handlers-subscription-events.test.ts - formatting
  • src/lib/security-agent/services/auto-dismiss-service.test.ts - formatting

@iscekic iscekic force-pushed the chore/catalog-cleanup branch from e42a842 to 00d80b7 Compare February 27, 2026 22:18
@iscekic iscekic force-pushed the chore/catalog-cleanup branch 2 times, most recently from 5873eab to 31af7ba Compare February 27, 2026 22:40
@iscekic iscekic force-pushed the chore/catalog-cleanup branch from 31af7ba to a3c04ee Compare February 27, 2026 22:50
@iscekic
Copy link
Contributor Author

iscekic commented Feb 27, 2026

Note to self: merge Monday morning

Merging now and monitoring - ready to revert if errors appear.

- Add hono, typescript, wrangler to pnpm catalog; update drizzle-orm and zod versions
- Switch all subpackages to catalog: protocol for drizzle-orm, zod, hono, typescript, wrangler
- Remove redundant pg dep from cloudflare-session-ingest and kiloclaw
- Refactor cloud-agent-next to use @kilocode/db instead of raw pg (matching cloud-agent)
- Delete cloud-agent-next custom db facade (database.ts, node-postgres.ts, SqlStore.ts, table.ts, PlatformIntegrationsStore.ts, table interpolators)
@iscekic iscekic force-pushed the chore/catalog-cleanup branch from d2f8329 to 8db51f6 Compare February 27, 2026 23:05
@iscekic iscekic enabled auto-merge March 1, 2026 14:51
@iscekic iscekic merged commit ab31370 into main Mar 1, 2026
12 checks passed
@iscekic iscekic deleted the chore/catalog-cleanup branch March 1, 2026 14:53
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.

2 participants