Skip to content

refactor: finish the v2→v1 collapse — remove the dead "API v2" parallel stack#228

Merged
duyet merged 11 commits into
mainfrom
claude/system-architecture-refactor-326foo
Jun 20, 2026
Merged

refactor: finish the v2→v1 collapse — remove the dead "API v2" parallel stack#228
duyet merged 11 commits into
mainfrom
claude/system-architecture-refactor-326foo

Conversation

@duyet

@duyet duyet commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Goal

Refactor toward clear boundaries, low coupling, and high cohesion — no behavior change. Each commit makes one bounded structural improvement and names the smell it removes.

The codebase carried a whole parallel "API v2" universe left behind by an abandoned versioning effort (already documented in core-memory: "v1 is the latest and only version"). This PR finishes that collapse and cleans up every orphan it exposed.

What changed (one smell per commit)

  1. Dead routes + semantic search — deleted the unmounted routes/v2/{conversations,keys,analytics} trees, the orphaned services/embeddings.ts, and the SemanticSearch*/ContextRetrieval* types in packages/shared (unreachable, unimported, untested).
  2. Duplicate project serviceservices/v2-projects.ts was a near-complete duplicate of services/projects.ts; inlined its one live function (updateProject) and deleted the rest + its dead-only test.
  3. Stale skipped tests — removed test/v2-*.skip.ts suites (excluded from the run; written against the old v2 contract).
  4. Misleading directory — flattened routes/v2/routes/ (states/leases/claims/capability-tokens/organizations are all mounted at /api/v1/*) and deleted its fiction README; renamed *V2Router aliases.
  5. Version-implying name — renamed services/v2-conversations.tsservices/mcp-conversations.ts (its only consumer is the MCP server).
  6. Orphaned helpers — removed mapConversationToResponse, lib/deprecation.ts, getCachedCount, parseIncludeParam, getConversationCount, and the AI provider's unused generateEmbedding — all left callerless by the deletions above.
  7. Orphaned service — removed services/analytics.ts (zero consumers; the live dashboard analytics route computes inline).

Net: 17 files removed, 5 moved, ~3.7k LOC deleted.

Before / after shape

  • Before: two route worlds (routes/ + routes/v2/), two project services, two conversation services with confusing v2 names, a half-built unreachable semantic-search feature, a fiction "API v2" README, and a trail of orphaned helpers/services.
  • After: one route surface mounted at /api/v1/* with cohesive top-level dirs; one canonical services/projects.ts; services/conversations.ts (REST) and a clearly-named services/mcp-conversations.ts (MCP) — kept separate by design (the REST service fires the conversation.created webhook and uses composite-cursor pagination; merging would change MCP behavior); an AI provider trimmed to what's used.

Verification

Every commit was gated: tsc --noEmit clean, biome check clean, and 327 tests pass (the only delta from 330 is the 3 removed v2-cursor tests that exercised unreachable code). Behavior is proven unchanged by the SELF.fetch e2e/coordination suites that drive the real Worker over HTTP against local D1.

Left intentionally untouched

  • Merging the two conversation services — would change MCP behavior (webhooks would start firing; pagination tie-breaking would shift). Out of scope for a no-behavior-change refactor.
  • The now-dead VECTORIZE_INDEX binding (types.ts/wrangler.jsonc/deploy script) — removing it is a deploy-infra change that can't be live-tested in this environment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TJsgSoJGYgabmcZEYhCxpQ


Generated by Claude Code

Summary by Sourcery

Remove the unused API v2 stack and consolidate remaining functionality under the v1 API and core services, without changing behavior.

Enhancements:

  • Inline the remaining v2 project update logic into the canonical projects service and wire routes to use it.
  • Rename the MCP-only conversations service to clarify its role and decouple it from versioned REST naming.
  • Flatten v2-specific route directories into the primary routes tree for states, leases, capability tokens, claims, and organizations, keeping all mounted at /api/v1.
  • Prune unused helpers and AI provider embedding support that were only referenced by the removed v2 stack.

Documentation:

  • Update core-maintenance documentation to record completion of the API v2 deprecation and collapse.

Tests:

  • Remove obsolete v2-specific and skipped test suites that targeted unreachable API v2 endpoints.

Summary by CodeRabbit

  • Refactor

    • Consolidated v2 API routes into unified v1 routing structure for state management, leases, capability tokens, claims, and organizations endpoints.
    • Removed analytics endpoints and semantic search/embedding features.
    • Removed deprecation header support; streamlined API surface.
  • Chores

    • Removed deprecated v2 test suites and documentation.
    • Cleaned up orphaned services and unused helpers.

duyetbot and others added 10 commits June 20, 2026 05:10
…emantic-search plumbing

The v2→v1 collapse left three route trees under routes/v2/ that were never
mounted in index.ts and are referenced by nothing:

- routes/v2/conversations/ (crud, search, messages, semantic) — duplicates the
  live routes/conversations/ tree
- routes/v2/keys/ — duplicates routes/v1-keys.ts
- routes/v2/analytics/ — superseded by routes/analytics.ts

Deleting the semantic/messages routes orphaned services/embeddings.ts (its only
importers), and the SemanticSearch*/ContextRetrieval* types in packages/shared
described those non-existent endpoints and were imported by nothing. The whole
semantic-search feature was unreachable, untested dead code.

No behavior change: removed code was unmounted/unimported. tsc + biome clean,
all 330 API tests pass (incl. SELF.fetch e2e through the live Worker).

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
services/v2-projects.ts was a near-complete parallel duplicate of
services/projects.ts (its own getOrCreateOrg, createProject, listProjects,
getProjectById, deleteProject, org helpers). The only live consumer was
routes/projects.ts importing a single function — updateProject — while the
duplicated list/create/get/delete and cursor pagination were wired to no route
(left dead by the documented v2→v1 collapse).

- Inlined a lean updateProject into services/projects.ts (void return; the
  route already re-reads via getProjectById, so the old V2ProjectDetail payload
  assembly + extra apiKeys query was dead).
- Repointed routes/projects.ts to import updateProject from services/projects.
- Deleted services/v2-projects.ts and test/v2-projects-cursor.test.ts (the
  latter only exercised the unreachable v2 cursor pagination).

Removes the "two project services / misleading v2- prefix" smell. No behavior
change: live routes already used services/projects for everything else, and
updateProject's observable effect (the DB write) is unchanged. tsc + biome
clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
test/v2-{analytics,conversations,keys,projects}.skip.ts were excluded from the
run (vitest only matches *.test.ts) and were written against the old v2 API
contract — project_id payloads, data/pagination envelopes, and API-key auth on
routes that are now Clerk-authed or no longer exist after the v2→v1 collapse.

The routes they targeted were removed in the prior two commits; their live
equivalents are covered by conversations.test.ts, projects.test.ts,
analytics.test.ts, keys.test.ts, and clerk-dashboard-auth.test.ts, so no
coverage is lost. Removes dormant, misleading dead test artifacts.

No behavior change. tsc + biome clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
The routes/v2/ directory was a relic of an abandoned versioning plan. Its
README described "the next version of the API" with conversations/ and
projects/ placeholders (both since deleted) and instructed future devs to
deprecate v1 in favor of v2 — directly contradicting the established model
(CLAUDE.md and index.ts: "one API version — v1 is the latest and only one").
The five routers it held (states, leases, claims, capability-tokens,
organizations) are all mounted at /api/v1/*, so "v2" was pure misdirection.

- Moved the five route dirs up to routes/ alongside conversations/, webhooks/,
  oauth/, mcp/ (the existing flat convention) and fixed their import depth.
- Renamed the *V2Router import aliases to plain *Router in index.ts.
- Deleted routes/v2/README.md (documented a versioning strategy that does not
  exist).

No behavior change: mount paths are unchanged, proven by the state-platform /
coordination test suites hitting /api/v1/states, /leases, /claims, etc.
tsc + biome clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
services/v2-conversations.ts was named after an API version that no longer
exists; after the v2→v1 collapse its only consumer is the MCP server. The
name sat misleadingly next to services/conversations.ts (the canonical REST
service), obscuring which is current.

Renamed to services/mcp-conversations.ts and documented why it stays separate
from the REST service (different response contract; the REST service also fires
the conversation.created webhook and uses composite-cursor pagination — merging
would change MCP behavior). Dropped the stale "V2:" comment prefixes.

No behavior change — pure rename + comments, one importer updated. tsc + biome
clean, 327 tests pass (incl. MCP conversation-tool coverage).

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
…eprecation)

Two orphans surfaced by the earlier v2 cleanup:

- lib/helpers.ts:mapConversationToResponse — its only caller was the deleted
  routes/v2/conversations/crud.ts; conversation responses elsewhere go through
  serialization.ts:deserializeConversationFull.
- lib/deprecation.ts — setDeprecationHeaders/deprecationMiddleware were never
  wired into any route; the only reference was the (now-deleted) routes/v2
  README example. The v1-only API has nothing to deprecate.

Neither is re-exported from packages/shared, so both were internal dead code.
No behavior change. tsc + biome clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
services/analytics.ts (cache-key helpers, getSummary/getTimeseries/
getTagAnalytics) had zero consumers repo-wide — its only importer was the
deleted routes/v2/analytics router. The live dashboard analytics route
(routes/analytics.ts, GET /api/v1/projects/:id/analytics) computes its results
with its own inline Drizzle queries and never touched this service.

No behavior change. tsc + biome clean, 327 tests pass (analytics.test.ts
exercises the live route via SELF.fetch, unaffected).

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
The AIProvider interface and WorkersAIProvider advertised generateEmbedding
(and an EMBEDDING_MODEL constant), but its only caller was services/embeddings.ts,
removed with the dead semantic-search feature. Trimming the contract to what the
app actually uses (title + follow-up generation) tightens the provider's
boundary.

No behavior change. tsc + biome clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
getCachedCount and parseIncludeParam (lib/helpers.ts) and getConversationCount
(services/mcp-conversations.ts) had no remaining call sites — their only callers
were the deleted routes/v2 conversation handlers. mcp-conversations.listConversations
already returns its own total count, so MCP never needed getConversationCount.
Also dropped the now-unused CACHE_COUNT_TTL_S import from helpers.ts.

No behavior change. tsc + biome clean, 327 tests pass.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
Closes the standing "services/v2-projects.ts other exports are dead — inline in
a follow-up" note and documents why two conversation services remain by design
and why the VECTORIZE binding was left as-is.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

Collapses the abandoned API v2 stack into the v1 surface by deleting dead v2 routes/services/tests, flattening v2 route directories into the primary routes tree, consolidating the duplicate projects service, and cleaning up all orphaned helpers, semantic-search plumbing, and unused AI-provider APIs while preserving behavior.

File-Level Changes

Change Details Files
Removed the unused API v2 surface (routes, services, and tests) and associated semantic search plumbing.
  • Deleted unmounted routes under routes/v2 for conversations, keys, analytics, and their README
  • Removed services/embeddings.ts and semantic-search/context-retrieval types from packages/shared
  • Dropped stale v2-specific skipped tests and a v2 projects cursor test
  • Deleted the unused services/analytics.ts service
packages/api/src/routes/v2/README.md
packages/api/src/routes/v2/analytics/index.ts
packages/api/src/routes/v2/conversations/crud.ts
packages/api/src/routes/v2/conversations/index.ts
packages/api/src/routes/v2/conversations/messages.ts
packages/api/src/routes/v2/conversations/search.ts
packages/api/src/routes/v2/conversations/semantic.ts
packages/api/src/routes/v2/keys/index.ts
packages/api/src/services/embeddings.ts
packages/api/src/services/analytics.ts
packages/api/test/v2-analytics.skip.ts
packages/api/test/v2-conversations.skip.ts
packages/api/test/v2-keys.skip.ts
packages/api/test/v2-projects-cursor.test.ts
packages/api/test/v2-projects.skip.ts
packages/shared/src/index.ts
Flattened v2 route directories into the main routes tree and rewired mounts to the v1 namespace.
  • Moved v2 states, leases, claims, capability-tokens, and organizations routers into top-level routes/
  • Updated all relative imports in moved routers from ../../../ to ../../ paths
  • Switched /api/v1/* mounts in api index.ts to use the new non-v2 router symbols
packages/api/src/routes/v2/states/index.ts
packages/api/src/routes/v2/leases/index.ts
packages/api/src/routes/v2/capability-tokens/index.ts
packages/api/src/routes/v2/claims/index.ts
packages/api/src/routes/v2/organizations/index.ts
packages/api/src/routes/states/index.ts
packages/api/src/routes/leases/index.ts
packages/api/src/routes/capability-tokens/index.ts
packages/api/src/routes/claims/index.ts
packages/api/src/routes/organizations/index.ts
packages/api/src/index.ts
Consolidated the duplicate v2-projects service into the canonical projects service and updated the projects router.
  • Inlined updateProject implementation from services/v2-projects.ts into services/projects.ts
  • Switched routes/projects.ts to import updateProject from services/projects.ts
  • Deleted services/v2-projects.ts now that its only live function is inlined
packages/api/src/services/projects.ts
packages/api/src/services/v2-projects.ts
packages/api/src/routes/projects.ts
Renamed and clarified the MCP-specific conversations service without changing behavior.
  • Renamed services/v2-conversations.ts to services/mcp-conversations.ts and removed v2-specific wording in comments
  • Updated MCP tools router to import from services/mcp-conversations instead of v2-conversations
  • Removed unused getConversationCount helper from the MCP conversations service
packages/api/src/services/v2-conversations.ts
packages/api/src/services/mcp-conversations.ts
packages/api/src/routes/mcp/tools.ts
Removed orphaned helper utilities and unused AI provider embedding support.
  • Deleted getCachedCount, parseIncludeParam, and mapConversationToResponse from lib/helpers and the deprecation helper module
  • Removed generateEmbedding from the AIProvider interface and WorkersAIProvider implementation, along with its model constant
  • Updated core-memory documentation with a new note about the completed v2→v1 collapse
packages/api/src/lib/helpers.ts
packages/api/src/services/ai-provider.ts
packages/api/src/lib/deprecation.ts
docs/knowledge/core-memory.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@duyet, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 58 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45d36dc4-8e1e-4deb-8d11-e5419751c138

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2815f and 30f7a5f.

📒 Files selected for processing (1)
  • packages/api/src/services/projects.ts
📝 Walkthrough

Walkthrough

This PR executes a v2→v1 dead-code collapse: it deletes the v2 router trees for conversations, keys, and analytics; removes the embedding, analytics, and deprecation services; inlines updateProject from the deleted services/v2-projects.ts into services/projects.ts; renames services/v2-conversations.ts to services/mcp-conversations.ts; rewires five route modules from ../../../ to ../../ paths; and removes stale test suites and shared semantic-search types.

Changes

v2→v1 Dead-Code Collapse

Layer / File(s) Summary
Deleted v2 services, embedding plumbing, and orphaned helpers
packages/api/src/services/ai-provider.ts, packages/api/src/lib/helpers.ts, packages/api/src/routes/v2/conversations/semantic.ts, packages/shared/src/index.ts
Removes generateEmbedding from AIProvider interface and WorkersAIProvider; deletes getCachedCount, parseIncludeParam, and mapConversationToResponse from lib/helpers; deletes the semantic-search/context Hono router; removes SemanticSearch* and ContextRetrieval* type exports from packages/shared. The fully-deleted files services/embeddings.ts, services/analytics.ts, services/v2-projects.ts, lib/deprecation.ts, routes/v2/analytics/index.ts, routes/v2/keys/index.ts, routes/v2/conversations/{crud,messages,search,index}.ts, and stale test files test/v2-*.skip.ts, test/v2-projects-cursor.test.ts, routes/v2/README.md are removed as part of this layer.
updateProject inlined; v2-conversations renamed to mcp-conversations
packages/api/src/services/projects.ts, packages/api/src/services/mcp-conversations.ts, packages/api/src/routes/mcp/tools.ts, packages/api/src/routes/projects.ts
Adds updateProject to services/projects.ts (existence check + conditional Drizzle update); updates mcp-conversations.ts file-level docs for lean response contracts; rewires routes/mcp/tools.ts and routes/projects.ts imports to the new service locations.
Main entry-point and flattened route import paths rewired
packages/api/src/index.ts, packages/api/src/routes/capability-tokens/index.ts, packages/api/src/routes/claims/index.ts, packages/api/src/routes/leases/index.ts, packages/api/src/routes/organizations/index.ts, packages/api/src/routes/states/index.ts
index.ts swaps five *V2Router imports for non-v2 equivalents and remounts /api/v1/states, /leases, /capability-tokens, /claims, and /organizations. Import depth corrected from ../../../ to ../../ across the five now-flattened route modules.
Completion note
docs/knowledge/core-memory.md
Adds a DONE 2026-06-20 entry summarising the collapse, removed artifacts, route flattening, and preserved config notes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • duyet/agentstate#53: Introduced deprecation.ts with setDeprecationHeaders/deprecationMiddleware — directly conflicts with this PR's deletion of that same module.
  • duyet/agentstate#113: Also removes deprecationMiddleware registrations and rewires /api/v1/* router mounts, overlapping with this PR's route-flattening work.
  • duyet/agentstate#221: Modified packages/api/src/services/v2-projects.ts to extend API key response with scopes — the same file this PR deletes entirely.

Poem

🐇 Hop, hop — the v2 forest falls,
Dead routes and routers cleared from halls,
Analytics, embeddings, all swept away,
MCP conversations renamed today.
One clean /api/v1 path remains,
The rabbit tidies what the code retains! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: completing the v2→v1 collapse by removing abandoned API v2 infrastructure, which aligns with the comprehensive refactoring described in the PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/system-architecture-refactor-326foo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request completes the v2 to v1 dead-code collapse, removing unused API v2 routes, orphaned services (such as analytics and embeddings), stale tests, and deprecated helpers. The state-platform and coordination features have been consolidated under /api/v1/*, and the updateProject logic has been inlined into services/projects.ts. Feedback on the changes points out a potential issue in updateProject where an empty updates object could cause a runtime error or invalid SQL query in Drizzle ORM, which can be resolved by adding an early return guard.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/api/src/services/projects.ts

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • In services/projects.updateProject, consider using a domain-specific error type or result enum instead of a generic Error("Project not found") so the route layer can distinguish not-found from other failures without relying on string matching.
  • Now that ai-provider’s interface no longer exposes generateEmbedding, double-check any non-default AIProvider implementations (e.g., in other packages or environments) to ensure they’ve dropped the method as well and still conform to the updated interface.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `services/projects.updateProject`, consider using a domain-specific error type or result enum instead of a generic `Error("Project not found")` so the route layer can distinguish not-found from other failures without relying on string matching.
- Now that `ai-provider`’s interface no longer exposes `generateEmbedding`, double-check any non-default `AIProvider` implementations (e.g., in other packages or environments) to ensure they’ve dropped the method as well and still conform to the updated interface.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

updateProject accepts { name?, retention_days? }; if a direct caller passes
neither, the updates object would be empty and Drizzle's .set({}) emits invalid
SQL. The route's UpdateProjectSchema already requires at least one field, so
this only hardens non-route callers — early-return on an empty patch.

Per review feedback on PR #228.

Co-Authored-By: Duyet Le <[email protected]>
Co-Authored-By: duyetbot <[email protected]>
@duyet duyet merged commit 61af5f4 into main Jun 20, 2026
6 checks passed
@duyet duyet deleted the claude/system-architecture-refactor-326foo branch June 20, 2026 06:15
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