OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
comments: stop opening files with where the code used to live
Carl-Gerhard Lindesvärd6a5003ab9e5a
diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 21d330034..3df45eb33 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -24,10 +24,9 @@ export type {UserAgentInfo,UserAgentResult,} from '@openpanel/shared/server';-// Dissolved from packages/common/server — a still-live V1 package (db, queue,-// apps/worker) reaches these the same way apps/api and core itself do, until-// its own module lands. mcp reaches it as an internal relative import now that-// it lives inside core.+// A still-live V1 package (db, queue, apps/worker) reaches these the same way+// apps/api and core itself do, until its own module lands. mcp reaches it as an+// internal relative import now that it lives inside core.export {assertPublicHostname,assertPublicUrl,@@ -129,21 +128,19 @@ export {// exported: a caller that can reach it can start a second collector graph// somewhere other than a module, which is the thing §18 forbids.export { registerDefaultMetrics } from './metrics';-// Moved from apps/api/src/agents/* +-// packages/trpc/src/agents/filter-command.ts. M15-003: the chat app, the run-// context and the filter command all take the API's `deps` now, so the barrel-// carries the factory and the types only — `assistant.routes.ts` and-// `overview.rpc.ts` reach them through `ctx.services.assistant`. `ChatApp` is-// the one type past `AppRouter` that crosses into apps/start-// (`src/agents/client.ts`); it stays a TYPE, so no value of this module reaches-// a browser bundle.+// M15-003: the chat app, the run context and the filter command all take the+// API's `deps` now, so the barrel carries the factory and the types only —+// `assistant.routes.ts` and `overview.rpc.ts` reach them through+// `ctx.services.assistant`. `ChatApp` is the one type past `AppRouter` that+// crosses into apps/start (`src/agents/client.ts`); it stays a TYPE, so no+// value of this module reaches a browser bundle.export type { ChatApp } from './modules/assistant/assistant.service';export { createAssistantService } from './modules/assistant/assistant.service';-// Dissolved from @openpanel/auth — apps/api's OAuth callbacks call these-// directly; V1's now-deleted @openpanel/trpc auth/share/user/gsc routers did-// too, the same way they reached the other dissolved leaf packages here.-// `hashPassword` is renamed on the way out: `@openpanel/shared/server` already-// owns that name for the (unrelated) scrypt hash client secrets use.+// apps/api's OAuth callbacks call these directly; V1's now-deleted+// @openpanel/trpc auth/share/user/gsc routers did too, the same way they+// reached the other dissolved leaf packages here. `hashPassword` is renamed on+// the way out: `@openpanel/shared/server` already owns that name for the+// (unrelated) scrypt hash client secrets use.//// The sign-up/sign-in/TOTP/reset-password/share/OAuth-callback half joined it// here — V1's now-deleted packages/trpc auth router and@@ -161,12 +158,10 @@ export {} from './modules/auth/auth.service';export type { AccessLookups } from './modules/auth/src/access';export { createAccessChecks } from './modules/auth/src/access';-// Moved from packages/db/src/services/auth-session.service.ts — the-// Postgres-backed login session CRUD. packages/db keeps a re-export shim+// The Postgres-backed login session CRUD. packages/db keeps a re-export shim// (existing `@openpanel/db` importers, apps/api's app.ts).export { validateSessionToken } from './modules/auth/src/login-session';export { getIsRegistrationAllowed } from './modules/auth/src/registration';-// Dissolved from @openpanel/db's services/chart.service.ts and engine/ —// packages/trpc's chart router, apps/api's export controller, V1's// funnel/conversion/sankey/retention/overview services and the mcp/assistant// tools reach the engine and the field/filter compilers here.@@ -188,51 +183,44 @@ export {normalizeEventField,profilePropertiesCteSelect,} from './modules/chart/chart.service';-// Dissolved from @openpanel/db's services/funnel.service.ts — packages/db's-// reports.service, apps/api's insights controller and the mcp/assistant tools-// call these. packages/db/src/services/funnel.service.ts stays a re-export-// shim.+// packages/db's reports.service, apps/api's insights controller and the+// mcp/assistant tools call these. packages/db/src/services/funnel.service.ts+// stays a re-export shim.export { toSeries } from './modules/chart/funnel.service';-// Dissolved from @openpanel/db's services/retention.service.ts — apps/api's-// insights controller and the mcp/assistant tools call these.+// apps/api's insights controller and the mcp/assistant tools call these.// packages/db/src/services/retention.service.ts stays a re-export shim.export type { IRetentionCohortRow } from './modules/chart/retention.service';export { processCohortData } from './modules/chart/retention.service';-// Dissolved from @openpanel/db's services/sankey.service.ts — apps/api's-// insights controller and the mcp/assistant tools call these.+// apps/api's insights controller and the mcp/assistant tools call these.// packages/db/src/services/sankey.service.ts stays a re-export shim.export { getRawWhereClause } from './modules/chart/sankey.service';-// Moved from packages/db/src/services/filter-where.service.ts — the-// sessions/profiles/events-table filter compiler, distinct from+// The sessions/profiles/events-table filter compiler, distinct from// `getEventFiltersWhereClause` above. packages/db/src/services/// filter-where.service.ts stays a re-export shim.export type { FilterTableContext } from './modules/chart/src/table-filter-where';export { buildFilterWhere } from './modules/chart/src/table-filter-where';-// Dissolved from @openpanel/db's services/clients.service.ts — packages/trpc's-// client router, apps/api's manage controller and mcp/utils auth call these-// directly, the same way V1 reaches every other dissolved service here.-// packages/db/src/services/clients.service.ts stays a re-export shim.+// packages/trpc's client router, apps/api's manage controller and mcp/utils+// auth call these directly, the same way V1 reaches every other dissolved+// service here. packages/db/src/services/clients.service.ts stays a re-export+// shim.export type { IPublicClient } from './modules/client/client.service';export {createClientService,// apps/api's session e2e clears one client's cache between runs.getClientByIdCached,} from './modules/client/client.service';-// Dissolved from @openpanel/db's services/cohort.service.ts — packages/trpc's-// cohort router and apps/worker's cohort job files call these directly, the-// same way V1 reaches every other dissolved service here. Nothing else in the-// tree reached cohort.service.ts through @openpanel/db's barrel, so packages/db-// loses the file entirely rather than keeping a re-export shim (unlike-// gsc.ts/gsc.service.ts). Moved from @openpanel/db's-// services/conversation.service.ts — packages/trpc's conversation router,+// packages/trpc's cohort router and apps/worker's cohort job files call these+// directly, the same way V1 reaches every other dissolved service here. Nothing+// else in the tree reached cohort.service.ts through @openpanel/db's barrel, so+// packages/db loses the file entirely rather than keeping a re-export shim+// (unlike gsc.ts/gsc.service.ts). packages/trpc's conversation router,// apps/api's live chat route and this package's own assistant.routes.ts stub// call these directly. packages/db keeps a re-export shim (unlike cohort): both// non-trpc call sites still reach it through `@openpanel/db`'s barrel.export { createConversationService } from './modules/conversation/conversation.service';-// Dissolved from @openpanel/db's services/dashboard.service.ts, plus V1's-// dashboard router mutation bodies — packages/trpc's dashboard router,-// apps/api's insights controller and the mcp/assistant tools call these.-// packages/db/src/services/dashboard.service.ts stays a re-export shim.+// packages/trpc's dashboard router, apps/api's insights controller and the+// mcp/assistant tools call these. packages/db/src/services/dashboard.service.ts+// stays a re-export shim.export type {IServiceDashboard,IServiceDashboards,@@ -243,22 +231,14 @@ export type {// packages/constants (ADR-008's module map: email owns "C"); packages/constants// keeps a re-export shim.export { emailCategories } from './modules/email/email.constants';-// Moved from apps/worker/src/jobs/lib/email-sequence.ts — shared by the-// onboarding module and, since M9-003, the organization module's wind-down-// track.+// Shared by the onboarding module and, since M9-003, the organization module's+// wind-down track.export type {SequenceStep,SequenceSubject,} from './modules/email/src/sequence';export { runSequence, step } from './modules/email/src/sequence';-// Dissolved from @openpanel/db's services/event.service.ts, profile.service.ts-// and group.service.ts, plus the query/mutation bodies packages/trpc's-// event/profile/group routers held inline and apps/api's profile controller-// (ADR-008's module map: event "R,S", profile "R,H,S", group "R,S,C") —-// packages/trpc's routers, apps/api's export controller, is-bot hook and-// profile controller, apps/worker's incoming-event job and the assistant/mcp-// tools call these directly, the same way V1 reaches every other dissolved-// service here. `packages/db`'s re-export shims for these three files are gone+// `packages/db`'s re-export shims for these three files are gone// (M9-CLEANUP-001) — every caller now imports this barrel directly.// `profileSearchSql` (cohort.service's one addition atop the shim) died with// M12-003: its only caller now composes a `sql` fragment and uses@@ -275,7 +255,6 @@ export {transformSessionToEvent,} from './modules/event/event.service';export type { IServiceGroup } from './modules/group/group.service';-// Dissolved from @openpanel/db's src/gsc.ts + services/gsc.service.ts —// apps/worker's gsc job file, apps/api's gsc OAuth callback controller and// packages/trpc's gsc router call these directly, the same way V1 reaches every// other dissolved service here. packages/db/src/gsc.ts and@@ -283,15 +262,13 @@ export type { IServiceGroup } from './modules/group/group.service';// and the assistant's SEO tools still reach via `@openpanel/db`.export { getGscCannibalization } from './modules/gsc/gsc.service';export { setShuttingDown } from './modules/health/src/shutdown';-// Dissolved from @openpanel/db's services/import.service.ts + apps/worker's job-// file + apps/api's /import controller — apps/worker's import job file and-// apps/api's import controller call these directly, the same way V1 reaches-// every other dissolved service here.+// apps/worker's import job file and apps/api's import controller call these+// directly, the same way V1 reaches every other dissolved service here.// packages/db/src/services/import.service.ts is deleted outright: nothing else-// reached it through @openpanel/db's barrel (same as cohort).-// The ingestion pipeline. apps/api's /track controller, its three route hooks-// and the legacy /event controller are thin delegates over these — the same-// functions core's own `ingestRoutes` calls.+// reached it through @openpanel/db's barrel (same as cohort). The ingestion+// pipeline. apps/api's /track controller, its three route hooks and the legacy+// /event controller are thin delegates over these — the same functions core's+// own `ingestRoutes` calls.export type {BotMatch,IncomingEventPayload,@@ -358,11 +335,6 @@ export {sampleConsumerGroupLag,} from './modules/ingest/src/kafka';export { explainInsight } from './modules/insight/insight.service';-// Moved from packages/trpc/src/routers/integration.ts, plus the Slack OAuth-// callback business logic out of apps/api/src/controllers/webhook.controller.ts-// (ADR-008's module map: integration owns "S"+"C") — packages/trpc's-// integration router and apps/api's webhook controller call these directly, the-// same way V1 reaches every other dissolved service here.// Slack's OAuth token-exchange wire contract — not integration config (stays// out of the `*.constants` subpath, see// modules/integration/src/slack-contract.ts's header), but apps/api's webhook@@ -375,7 +347,6 @@ export { zSlackAuthResponse } from './modules/integration/src/slack-contract';// shell reaches MCP the one way it ever did — `rest.routes.ts`'s// `.use(mcpRoutes(deps))` and `ctx.services.mcp`.export type { McpAuthContext } from './modules/mcp/mcp.service';-// Ported from apps/api's misc controller + apps/worker's cron.ping.ts —// apps/api's misc controller and the worker's ping cron job call these// directly, the same way V1 reaches every other dissolved service here. `GET// /misc/og/clear` and `/misc/favicon/clear` are NOT ported (ADR-015 entry #6:@@ -391,8 +362,7 @@ export {notificationTemplateEvent,notificationTemplateFunnel,} from './modules/notification/notification.service';-// Dissolved from @openpanel/db's services/notification.service.ts ("rules +-// dispatch stay together"). `createNotification` / `triggerNotification` /+// `createNotification` / `triggerNotification` /// `checkNotificationRulesForEvent` / `checkNotificationRulesForSessionEnd` —// the BullMQ-producer orchestration around a rule match — came home from// @openpanel/queue at M11-003 and now live in this module's own@@ -405,14 +375,6 @@ export { checkNotificationRulesForEvent } from './modules/notification/src/notif// job called these directly, the same way V1 reached every other dissolved// service here.export { createOnboardingService } from './modules/onboarding/onboarding.service';-// Dissolved from @openpanel/db's services/organization.service.ts +-// services/delete.service.ts (folded together per the module map) —-// packages/trpc's organization router, apps/worker's delete cron job and-// packages/db's own engine/analytics services (`getSettingsForProject`) call-// these directly, the same way V1 reaches every other dissolved service here.-// packages/db/src/services/organization.service.ts stays a re-export shim-// (unlike delete.service.ts, which packages/db loses entirely — nothing but the-// worker's cron job reached it through @openpanel/db's barrel).export type {IServiceMember,IServiceOrganization,@@ -421,11 +383,10 @@ export {createOrganizationService,getOrganizationByProjectIdCached,} from './modules/organization/organization.service';-// Dissolved from @openpanel/db's services/overview.service.ts +-// pages.service.ts — packages/trpc's overview/event routers, apps/api's-// insights controller, apps/worker's win-back job and the mcp/assistant tools-// call these directly. packages/db/src/services/ overview.service.ts and-// pages.service.ts stay re-export shims.+// packages/trpc's overview/event routers, apps/api's insights controller,+// apps/worker's win-back job and the mcp/assistant tools call these directly.+// packages/db/src/services/ overview.service.ts and pages.service.ts stay+// re-export shims.export type { IGetTopGenericInput } from './modules/overview/overview.service';export type {AdjustProfilePropertyResult,@@ -435,11 +396,10 @@ export type {IServiceProfile,ProfileRequestContext,} from './modules/profile/profile.service';-// Dissolved from @openpanel/db's services/project.service.ts — packages/trpc's-// project router, apps/api's manage controller and several core modules'-// `src/access.ts` call these directly, the same way V1 reaches every other-// dissolved service here. packages/db/src/services/ project.service.ts stays a-// re-export shim.+// packages/trpc's project router, apps/api's manage controller and several core+// modules' `src/access.ts` call these directly, the same way V1 reaches every+// other dissolved service here. packages/db/src/services/ project.service.ts+// stays a re-export shim.export type {IServiceProject,IServiceProjectWithClients,@@ -450,20 +410,12 @@ export { createProjectService } from './modules/project/project.service';// every other dissolved service here. The `/live` websocket glue in the same// file stays internal to core/realtime.routes.ts; V1's own Fastify `/live`// controller is untouched (see realtime.service.ts's header) so nothing else-// needs it from this barrel.-// Moved from packages/db/src/services/reference.service.ts, plus the-// query/mutation bodies packages/trpc/src/routers/reference.ts held inline —-// packages/trpc's reference router calls these directly, the same way V1-// reaches every other dissolved service here. packages/db keeps a re-export-// shim.+// needs it from this barrel. packages/trpc's reference router calls these+// directly, the same way V1 reaches every other dissolved service here.+// packages/db keeps a re-export shim.export type { IServiceReference } from './modules/reference/reference.service';export { createReferenceService } from './modules/reference/reference.service';-// Moved from packages/constants/index.ts and packages/validation/src/index.ts-// (ADR-008's module map: report owns "C" for the chart/report/widget-// vocabulary) — apps/start's report builder and the assistant/mcp tools reach-// the vocabulary directly through @openpanel/core here, same shape as-// `emailCategories`/`ProjectTypeNames` below. Both origin packages stay-// re-export shims.+// Both origin packages stay re-export shims.export {alphabetIds,chartColors,@@ -489,10 +441,9 @@ export {zCriteria,zReportInput,} from './modules/report/report.constants';-// Dissolved from @openpanel/db's services/reports.service.ts, plus V1's report-// router mutation bodies — packages/trpc's report router, apps/api's insights-// controller and the mcp/assistant tools call these.-// packages/db/src/services/reports.service.ts stays a re-export shim.+// packages/trpc's report router, apps/api's insights controller and the+// mcp/assistant tools call these. packages/db/src/services/reports.service.ts+// stays a re-export shim.export type { IServiceReport } from './modules/report/report.service';export { transformReport } from './modules/report/report.service';export {@@ -503,30 +454,21 @@ export {mergeGlobalFilters,onlyReportEvents,} from './modules/report/src/series';-// Moved from packages/db/src/services/salt.service.ts +-// apps/worker/src/jobs/cron.salt.ts — `main.ts` calls-// `createInitialSalts(deps)` directly at boot; `salt.jobs.ts`'s cron handler-// and everything else reach `rotateSalt`/`getSalts` through+// `main.ts` calls `createInitialSalts(deps)` directly at boot; `salt.jobs.ts`'s+// cron handler and everything else reach `rotateSalt`/`getSalts` through// `ctx.services.salt`.export {createInitialSalts,createSaltService,} from './modules/salt/salt.service';-// Dissolved from @openpanel/db's services/session.service.ts and-// session-context.ts (now shared/als-session.ts), plus apps/worker's-// session-end job, reaper and vacuum (ADR-008's module map: session owns-// "R,S,J") — packages/trpc's session router, the assistant/mcp tools and-// apps/worker's thin delegates call these directly, the same way V1 reaches-// every other dissolved service here. `packages/db`'s re-export shims for both-// files are gone (M9-CLEANUP-001). The `sessions` queue's own job and the-// reaper/vacuum cron fragments are registered in jobs.registry.ts, not-// exported.+// `packages/db`'s re-export shims for both files are gone (M9-CLEANUP-001). The+// `sessions` queue's own job and the reaper/vacuum cron fragments are+// registered in jobs.registry.ts, not exported.export type {IClickhouseSession,IServiceSession,} from './modules/session/session.service';export { SESSION_DISTINCT_FIELDS } from './modules/session/session.service';-// Dissolved from @openpanel/db's services/insights* + referrer-spikes.service —// apps/worker's insight job files and packages/trpc's insight router call these// directly, the same way V1 reaches every other dissolved service here.export type { SessionMetricsRedis } from './modules/session/src/session.metrics';@@ -539,34 +481,21 @@ export {} from './modules/session/src/session-end';export { reapIdleSessions } from './modules/session/src/session-reaper';export { vacuumStaleSessions } from './modules/session/src/session-vacuum';-// Moved from packages/db/src/services/share.service.ts, plus the query/mutation-// bodies packages/trpc/src/routers/share.ts held inline (ADR-008's module map:-// share owns "C") — packages/trpc's share router calls these directly, the same-// way V1 reaches every other dissolved service here. packages/db keeps a-// re-export shim: auth.service.ts's signInToShare and packages/trpc's-// chart/overview routers still reach-// validateShareAccess/validateOverviewShareAccess through it.export {zShareDashboard,zShareOverview,zShareReport,} from './modules/share/share.constants';export { createShareService } from './modules/share/share.service';-// Moved from packages/trpc/src/routers/subscription.ts, plus the Polar webhook-// business logic out of apps/api/src/controllers/webhook.controller.ts-// (ADR-008's module map: subscription owns "S"+"C") — packages/trpc's-// subscription router and apps/api's webhook controller call these directly,-// the same way V1 reaches every other dissolved service here.export { toSubscriptionDiscount } from './modules/subscription/subscription.service';// New module — apps/api's tools controller calls these directly, the same way// V1 reaches every other dissolved service here.export { runIpLookup } from './modules/tools/src/ip-lookup';export type { SiteCheckResult } from './modules/tools/src/site-checker';export { runSiteCheck } from './modules/tools/src/site-checker';-// Dissolved from @openpanel/db's services/user.service.ts — packages/trpc's-// auth/onboarding routers call `getUserById`/ `getUserAccount` directly through-// @openpanel/db's re-export shim, the same way they reach every other dissolved-// service here.+// packages/trpc's auth/onboarding routers call `getUserById`/ `getUserAccount`+// directly through @openpanel/db's re-export shim, the same way they reach+// every other dissolved service here.export { createUserService } from './modules/user/user.service';export type { ILogger } from './pino-logger';export {diff --git a/packages/core/src/modules/assistant/assistant.constants.ts b/packages/core/src/modules/assistant/assistant.constants.tsindex 45cd1096c..3f3805278 100644--- a/packages/core/src/modules/assistant/assistant.constants.ts+++ b/packages/core/src/modules/assistant/assistant.constants.ts@@ -1,11 +1,6 @@import { z } from 'zod';/**- * Moved from the V1 validation package (ADR-008's module map: assistant owns- * "C"). apps/start reaches these symbols through the- * `@openpanel/core/modules/assistant/assistant.constants` subpath —- * `src/agents/models.ts`, `src/contexts/page-context.tsx` and- * `src/components/chat/tool-handlers.ts`.** Isomorphic by the AGENTS.md rule: zod and nothing else.*diff --git a/packages/core/src/modules/assistant/assistant.rpc.ts b/packages/core/src/modules/assistant/assistant.rpc.tsindex 78e423193..bd5eb78b7 100644--- a/packages/core/src/modules/assistant/assistant.rpc.ts+++ b/packages/core/src/modules/assistant/assistant.rpc.ts@@ -1,4 +1,3 @@-// Ported from the V1 tRPC chat router.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/assistant/assistant.service.ts b/packages/core/src/modules/assistant/assistant.service.tsindex e93ec73aa..c3c0f0a9c 100644--- a/packages/core/src/modules/assistant/assistant.service.ts+++ b/packages/core/src/modules/assistant/assistant.service.ts@@ -1,8 +1,5 @@-// Moved from V1's agents directory (the Better Agent chat app + its tools,-// prompt and Prisma persistence) and V1's tRPC filter-command agent (ADR-007's-// module map: assistant owns "S"). The bulk of the logic lives under./src —-// this file is the module's public entry point, the same shape as-// insight.service.ts drawing from insight/src/*.+// The bulk of the logic lives under./src — this file is the module's public+// entry point, the same shape as insight.service.ts drawing from insight/src/*.//// Every export takes `deps`. `./src/app.ts` and `./src/filter-command.ts`// construct nothing at import time any more, so the three lazy loaders thatdiff --git a/packages/core/src/modules/assistant/src/app.ts b/packages/core/src/modules/assistant/src/app.tsindex aa02fe273..e623d660d 100644--- a/packages/core/src/modules/assistant/src/app.ts+++ b/packages/core/src/modules/assistant/src/app.ts@@ -1,4 +1,3 @@-// Moved from V1's agents/app.ts (ADR-007's module map: assistant owns "S").//// The app is BUILT from the `deps` `assistant.routes.ts` already holds, not// constructed at module scope (R15). Importing this file now opens nothing — nodiff --git a/packages/core/src/modules/assistant/src/filter-command.ts b/packages/core/src/modules/assistant/src/filter-command.tsindex 3ab89e2c9..1082dedb1 100644--- a/packages/core/src/modules/assistant/src/filter-command.ts+++ b/packages/core/src/modules/assistant/src/filter-command.ts@@ -1,6 +1,5 @@-// Moved from V1's tRPC filter-command agent. The one caller is-// `overview.rpc.ts`'s `runFilterCommand` procedure, which reaches it through-// `ctx.services.assistant`.+// The one caller is `overview.rpc.ts`'s `runFilterCommand` procedure, which+// reaches it through `ctx.services.assistant`.//// The agent app and its five tools are BUILT from the `deps` that procedure// already holds (R15) — importing this file constructs nothing, and the tooldiff --git a/packages/core/src/modules/assistant/src/report-runner.ts b/packages/core/src/modules/assistant/src/report-runner.tsindex 33097a962..88f835583 100644--- a/packages/core/src/modules/assistant/src/report-runner.ts+++ b/packages/core/src/modules/assistant/src/report-runner.ts@@ -1,5 +1,3 @@-// Ported from V1's MCP `runReport` / `runReportFromConfig`, now-// `modules/mcp/src/tools/analytics/reports.ts`.//// Explicitly defers unifying MCP's tool definitions with assistant's, so// `modules/mcp/src/tools/analytics/reports.ts` keeps its own copy of thisdiff --git a/packages/core/src/modules/auth/auth.constants.ts b/packages/core/src/modules/auth/auth.constants.tsindex a10e24338..52600b713 100644--- a/packages/core/src/modules/auth/auth.constants.ts+++ b/packages/core/src/modules/auth/auth.constants.ts@@ -1,11 +1,6 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map: auth owns-// "C"). packages/validation/src/index.ts becomes a re-export shim for these-// symbols (same shape as packages/validation/src/cohort.validation.ts since-// M5-003), so apps/start and packages/trpc keep resolving them through-// packages/validation's existing barrel unchanged. `zProvider` is new here — it-// validated `signInOAuth`'s input inline in packages/trpc/src/routers/auth.ts-// and was never exported, but it is vocabulary the same way the rest of this-// file is.+// `zProvider` is new here — it validated `signInOAuth`'s input inline in+// packages/trpc/src/routers/auth.ts and was never exported, but it is+// vocabulary the same way the rest of this file is.//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/auth/auth.rpc.ts b/packages/core/src/modules/auth/auth.rpc.tsindex 2b2f1c8e3..601bcc7b3 100644--- a/packages/core/src/modules/auth/auth.rpc.ts+++ b/packages/core/src/modules/auth/auth.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/auth.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/auth/auth.service.ts b/packages/core/src/modules/auth/auth.service.tsindex 620c7979c..e63ad2195 100644--- a/packages/core/src/modules/auth/auth.service.ts+++ b/packages/core/src/modules/auth/auth.service.ts@@ -1,7 +1,6 @@-// Moved from @openpanel/auth: token issuance/hashing, argon2 password hashing,-// TOTP, the OAuth clients and cookie helpers. The Prisma-touching half —-// creating, validating and invalidating a `sessions` row — moved here too-// (`./src/login-session.ts`).+// Token issuance/hashing, argon2 password hashing, TOTP, the OAuth clients and+// cookie helpers. The Prisma-touching half — creating, validating and+// invalidating a `sessions` row — moved here too (`./src/login-session.ts`).//// The permission ladder (`modules/auth/src/access.ts`) is bound to its real// lookups exactly here, once, instead of once per module in adiff --git a/packages/core/src/modules/auth/src/login-session.ts b/packages/core/src/modules/auth/src/login-session.tsindex 75ad30113..16fdfc48d 100644--- a/packages/core/src/modules/auth/src/login-session.ts+++ b/packages/core/src/modules/auth/src/login-session.ts@@ -1,6 +1,6 @@-// Moved from packages/db/src/services/auth-session.service.ts. Postgres-backed-// login sessions (a `sessions` row keyed by the hash of a browser's cookie).-// Not to be confused with session.service.ts's ClickHouse visitor sessions.+// Postgres-backed login sessions (a `sessions` row keyed by the hash of a+// browser's cookie). Not to be confused with session.service.ts's ClickHouse+// visitor sessions.//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`; the// `loadDb` lazy loader is gone. `http/session.ts`'s `resolveSession` alreadydiff --git a/packages/core/src/modules/chart/chart.rpc.ts b/packages/core/src/modules/chart/chart.rpc.tsindex 93e05d295..5b3215be5 100644--- a/packages/core/src/modules/chart/chart.rpc.ts+++ b/packages/core/src/modules/chart/chart.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/chart.ts.//// The seven member-only procedures are back on `protectedProcedure`, so// `enforceAccess` reads the top-level `projectId` before the input is parsed,diff --git a/packages/core/src/modules/chart/funnel.service.test.ts b/packages/core/src/modules/chart/funnel.service.test.tsindex 1b9a5621e..8e1709449 100644--- a/packages/core/src/modules/chart/funnel.service.test.ts+++ b/packages/core/src/modules/chart/funnel.service.test.ts@@ -1,5 +1,3 @@-// Ported from packages/db/src/services/funnel.service.test.ts (main #497).-// toSeries is pure — it only reshapes rows — so nothing here touches a client.import { describe, expect, it } from 'bun:test';import { toSeries } from './funnel.service';diff --git a/packages/core/src/modules/chart/src/field-resolution.test.ts b/packages/core/src/modules/chart/src/field-resolution.test.tsindex c607a7f38..e2430c8c3 100644--- a/packages/core/src/modules/chart/src/field-resolution.test.ts+++ b/packages/core/src/modules/chart/src/field-resolution.test.ts@@ -13,8 +13,6 @@* top-level column.** All five errors logged in HyperDX 2026-05-14 → 2026-05-17 are covered here.- *- * Ported from packages/db/src/services/chart-field-resolution.test.ts.*/import { describe, expect, it } from 'bun:test';import { isKnownEventField, normalizeEventField } from './field-resolution';diff --git a/packages/core/src/modules/chart/src/filter-cast.ts b/packages/core/src/modules/chart/src/filter-cast.tsindex 49e259e94..a46ae57f3 100644--- a/packages/core/src/modules/chart/src/filter-cast.ts+++ b/packages/core/src/modules/chart/src/filter-cast.ts@@ -1,7 +1,6 @@/** biome-ignore-all lint/style/useDefaultSwitchClause: switch cases are exhaustive by design */-// Moved from packages/db/src/services/filter-cast.ts — the typed-cast half of-// `buildFilterWhere` (./table-filter-where.ts) and of `./filter-where.ts` (the-// event-property compiler).+// The typed-cast half of `buildFilterWhere` (./table-filter-where.ts) and of+// `./filter-where.ts` (the event-property compiler).//// Both filter compilers call the same pair now: `castFragment` and// `buildTypedClauseFragment` bind every value as a `{name:Type}` param. Thediff --git a/packages/core/src/modules/chart/src/funnel.sql.test.ts b/packages/core/src/modules/chart/src/funnel.sql.test.tsindex 8b101f337..4a4a331c4 100644--- a/packages/core/src/modules/chart/src/funnel.sql.test.ts+++ b/packages/core/src/modules/chart/src/funnel.sql.test.ts@@ -1,6 +1,5 @@/**- * SQL-shape tests for the funnel statements. Ported from- * packages/db/src/services/funnel-sql.test.ts.+ * SQL-shape tests for the funnel statements.** Strategy, same as sql.test.ts: render the statement, then run `EXPLAIN <sql>`* with its bound params against the isolated `openpanel_test` ClickHousediff --git a/packages/core/src/modules/chart/src/profile-columns.test.ts b/packages/core/src/modules/chart/src/profile-columns.test.tsindex b668f787f..303e22aaa 100644--- a/packages/core/src/modules/chart/src/profile-columns.test.ts+++ b/packages/core/src/modules/chart/src/profile-columns.test.ts@@ -1,9 +1,8 @@-// Ported from packages/db/src/services/profile-columns.test.ts (main #512).// The JOIN column list used to be built by splitting raw `profile.*` filter-// names, so a crafted name could close the subquery (GHSA-pc3q-gw7f-p2x2).-// The rewrite binds every identifier through `sql.id`, so injection is-// impossible; what these assert is that the list is also an allowlist, so a-// filter cannot name a column it has no business reading.+// names, so a crafted name could close the subquery (GHSA-pc3q-gw7f-p2x2). The+// rewrite binds every identifier through `sql.id`, so injection is impossible;+// what these assert is that the list is also an allowlist, so a filter cannot+// name a column it has no business reading.import { describe, expect, it } from 'bun:test';import { JOINABLE_PROFILE_COLUMNS } from '../chart.constants';import { profileJoinFields } from './funnel.sql';diff --git a/packages/core/src/modules/chart/src/sql.test.ts b/packages/core/src/modules/chart/src/sql.test.tsindex 8bf4aba7a..a34cd292f 100644--- a/packages/core/src/modules/chart/src/sql.test.ts+++ b/packages/core/src/modules/chart/src/sql.test.ts@@ -1,7 +1,5 @@/**- * SQL-shape tests for the chart statements. Ported from- * packages/db/src/services/chart-sql.test.ts; the overview `getRawWhereClause`- * cases stayed there with their subject.+ * SQL-shape tests for the chart statements.** Strategy: render the statement, then run `EXPLAIN <sql>` with its bound* params against the isolated `openpanel_test` ClickHouse (pinned bydiff --git a/packages/core/src/modules/client/client.rpc.ts b/packages/core/src/modules/client/client.rpc.tsindex 117d6d928..fc0df364a 100644--- a/packages/core/src/modules/client/client.rpc.ts+++ b/packages/core/src/modules/client/client.rpc.ts@@ -1,4 +1,3 @@-// Ported from V1's client router.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/client/client.service.ts b/packages/core/src/modules/client/client.service.tsindex cca15de7f..20d66ceeb 100644--- a/packages/core/src/modules/client/client.service.ts+++ b/packages/core/src/modules/client/client.service.ts@@ -1,6 +1,5 @@-// Moved from V1's clients service (module map: client owns "R,H,S" — no-// constants file, per the module map). Client CRUD lives only here now; no-// packages/db re-export shim exists in this tree.+// Client CRUD lives only here now; no packages/db re-export shim exists in this+// tree.//// The /manage REST CRUD bodies (client.routes.ts's listClients/getClient/// createClient/updateClient/deleteClient) call the samediff --git a/packages/core/src/modules/cohort/cohort.constants.test.ts b/packages/core/src/modules/cohort/cohort.constants.test.tsindex 7d7d0d147..346b27846 100644--- a/packages/core/src/modules/cohort/cohort.constants.test.ts+++ b/packages/core/src/modules/cohort/cohort.constants.test.ts@@ -1,6 +1,3 @@-// Ported from packages/validation/src/cohort.validation.test.ts (main #470,-// #472).-import { describe, expect, test } from 'bun:test';import { zAbsoluteTimeframe, zFrequency } from './cohort.constants';diff --git a/packages/core/src/modules/cohort/cohort.constants.ts b/packages/core/src/modules/cohort/cohort.constants.tsindex f4fc8db35..cfec145a4 100644--- a/packages/core/src/modules/cohort/cohort.constants.ts+++ b/packages/core/src/modules/cohort/cohort.constants.ts@@ -1,9 +1,3 @@-// Moved from packages/validation/src/cohort.validation.ts (ADR-008's module-// map: cohort owns "C"). packages/validation/src/cohort.validation.ts becomes a-// re-export shim of this file's `./modules/cohort/cohort.constants` subpath-// (same shape as packages/db/src/gsc.ts since M5-002), so apps/start and-// packages/db/src/types.ts keep resolving these symbols through-// packages/validation's existing barrel unchanged.//// Isomorphic by the AGENTS.md rule: zod, another `*.constants.ts`, or nothing.// `zChartEventFilter` used to be a diverged local copy here (TODO(P7) indiff --git a/packages/core/src/modules/cohort/cohort.jobs.ts b/packages/core/src/modules/cohort/cohort.jobs.tsindex a420ce41e..c1d4947ac 100644--- a/packages/core/src/modules/cohort/cohort.jobs.ts+++ b/packages/core/src/modules/cohort/cohort.jobs.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/cohort.compute.ts + cron.cohort-refresh.ts;-// the schedule moved onto the job at ADR-021.//// `cohortCompute` is this module's own queue — registry key `cohortCompute`// EXACTLY (ADR-005's acceptance note: no env rename, sodiff --git a/packages/core/src/modules/cohort/cohort.rpc.ts b/packages/core/src/modules/cohort/cohort.rpc.tsindex 09d501eef..84dff12aa 100644--- a/packages/core/src/modules/cohort/cohort.rpc.ts+++ b/packages/core/src/modules/cohort/cohort.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/cohort.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/cohort/src/cohort-event-sql.test.ts b/packages/core/src/modules/cohort/src/cohort-event-sql.test.tsindex 430ea67bc..8c5dfa607 100644--- a/packages/core/src/modules/cohort/src/cohort-event-sql.test.ts+++ b/packages/core/src/modules/cohort/src/cohort-event-sql.test.ts@@ -1,10 +1,5 @@-// SQL-shape tests for event-based cohort criteria. Ported from-// packages/db/src/services/cohort.service.test.ts (main #470, #472): the-// timeframe and project id are bound as `{pN:String}` params here rather than-// escaped into the text, so the hostile-value assertions check the binding —-// the value is absent from the rendered SQL and present, verbatim, in the-// params. The "never did this event" assertions are unchanged in what they-// claim.+// SQL-shape tests for event-based cohort criteria. The "never did this event"+// assertions are unchanged in what they claim.import { describe, expect, test } from 'bun:test';import type {diff --git a/packages/core/src/modules/cohort/src/cohort-sql.test.ts b/packages/core/src/modules/cohort/src/cohort-sql.test.tsindex 182586cc8..98f10b4b8 100644--- a/packages/core/src/modules/cohort/src/cohort-sql.test.ts+++ b/packages/core/src/modules/cohort/src/cohort-sql.test.ts@@ -1,5 +1,4 @@-// SQL-shape tests for property-based cohort queries. Ported from-// packages/db/src/services/cohort-property-sql.test.ts — minus its itCH+// SQL-shape tests for property-based cohort queries. Minus its itCH// ClickHouse-reachability EXPLAIN check: `mock.module` substitutions apply// process-wide, not per file, so a sibling file's// `@openpanel/db/src/clickhouse/client` mock (cohort.service.test.ts) candiff --git a/packages/core/src/modules/conversation/conversation.rpc.ts b/packages/core/src/modules/conversation/conversation.rpc.tsindex 22ded6b45..e3fd64b32 100644--- a/packages/core/src/modules/conversation/conversation.rpc.ts+++ b/packages/core/src/modules/conversation/conversation.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/conversation.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/dashboard/dashboard.rpc.ts b/packages/core/src/modules/dashboard/dashboard.rpc.tsindex a37a1ac39..776c1c313 100644--- a/packages/core/src/modules/dashboard/dashboard.rpc.ts+++ b/packages/core/src/modules/dashboard/dashboard.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/dashboard.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/dashboard/dashboard.service.ts b/packages/core/src/modules/dashboard/dashboard.service.tsindex a10fce82f..61ad85130 100644--- a/packages/core/src/modules/dashboard/dashboard.service.ts+++ b/packages/core/src/modules/dashboard/dashboard.service.ts@@ -1,6 +1,3 @@-// Moved from packages/db/src/services/dashboard.service.ts, plus the-// create/update/delete mutation bodies packages/trpc/src/routers/dashboard.ts-// held inline (ADR-008's module map: dashboard owns "R,S").//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`; the// `loadDb` / `loadIdService` lazy loaders are gone, so this modulediff --git a/packages/core/src/modules/email/email.constants.ts b/packages/core/src/modules/email/email.constants.tsindex bb757c0b3..86d65047b 100644--- a/packages/core/src/modules/email/email.constants.ts+++ b/packages/core/src/modules/email/email.constants.ts@@ -1,5 +1,3 @@-// Moved from packages/constants/index.ts (ADR-008's module map: email owns-// "C"). packages/constants was deleted whole at M11-009.//// Keys must match the template `category` in @openpanel/email. Each entry's// label + description drive the account email-preferences toggles.diff --git a/packages/core/src/modules/email/email.rpc.ts b/packages/core/src/modules/email/email.rpc.tsindex 986aad23b..83a62bd8f 100644--- a/packages/core/src/modules/email/email.rpc.ts+++ b/packages/core/src/modules/email/email.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/email.ts.//// Deliberately R + C only (no `email.service.ts`): the three procedures' bodies// are three small `db.emailUnsubscribe` calls, inlined here the same waydiff --git a/packages/core/src/modules/email/src/sequence.test.ts b/packages/core/src/modules/email/src/sequence.test.tsindex 0dea73020..bed36ad94 100644--- a/packages/core/src/modules/email/src/sequence.test.ts+++ b/packages/core/src/modules/email/src/sequence.test.ts@@ -1,8 +1,7 @@-// Unit tests for the sequence runner. Moved from-// apps/worker/src/jobs/lib/email-sequence.test.ts. `sendEmail` is mocked, so-// these assert decisions — which step fires, whether the pointer moves, whether-// side effects run — rather than delivery. `mock.module` is not hoisted, so the-// subject is imported inside `beforeAll` — see AGENTS.md.+// Unit tests for the sequence runner. `sendEmail` is mocked, so these assert+// decisions — which step fires, whether the pointer moves, whether side effects+// run — rather than delivery. `mock.module` is not hoisted, so the subject is+// imported inside `beforeAll` — see AGENTS.md.import { beforeAll, beforeEach, expect, mock, test } from 'bun:test';import { subDays } from 'date-fns';diff --git a/packages/core/src/modules/email/src/sequence.ts b/packages/core/src/modules/email/src/sequence.tsindex 119bb95a1..de1f5e4ba 100644--- a/packages/core/src/modules/email/src/sequence.ts+++ b/packages/core/src/modules/email/src/sequence.ts@@ -1,6 +1,5 @@-// Moved from apps/worker/src/jobs/lib/email-sequence.ts, and out of `shared/`-// at M15-009: it sends email, so it sits in the module that owns email, not in-// the layer below every transport. Its two callers — the onboarding drip+// It sends email, so it sits in the module that owns email, not in the layer+// below every transport. Its two callers — the onboarding drip// (modules/onboarding) and the wind-down track// (modules/organization/src/wind-down.ts) — reach it sideways, module to// module.diff --git a/packages/core/src/modules/event/event.jobs.ts b/packages/core/src/modules/event/event.jobs.tsindex 4ab45a453..c9810bb23 100644--- a/packages/core/src/modules/event/event.jobs.ts+++ b/packages/core/src/modules/event/event.jobs.ts@@ -1,8 +1,6 @@-// Ported from apps/worker/src/jobs/cron.ts's `flushEvents` case +-// boot-cron.ts's `flush`/`flushEvents` schedule; the schedule moved onto the-// job at ADR-021. The event buffer (Redis → ClickHouse `events`) is this-// module's domain, so its flush cron fragment lives here rather than on the-// ingest module that merely writes to it.+// The event buffer (Redis → ClickHouse `events`) is this module's domain, so+// its flush cron fragment lives here rather than on the ingest module that+// merely writes to it.import { z } from 'zod';import { defineJob } from '../../jobs/define';diff --git a/packages/core/src/modules/event/event.rpc.ts b/packages/core/src/modules/event/event.rpc.tsindex 2bca0e82a..1afa06617 100644--- a/packages/core/src/modules/event/event.rpc.ts+++ b/packages/core/src/modules/event/event.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/event.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/event/src/create-event-id.test.ts b/packages/core/src/modules/event/src/create-event-id.test.tsindex 70774ba73..b57b6f051 100644--- a/packages/core/src/modules/event/src/create-event-id.test.ts+++ b/packages/core/src/modules/event/src/create-event-id.test.ts@@ -1,7 +1,6 @@-// Ported from packages/db/src/services/create-event-id.test.ts. M10-005:-// `createEvent` takes `ServiceDeps` and writes through `deps.buffers.event`, so-// the buffer is handed in rather than mocked onto a module specifier — no-// `mock.module` and no restore to get wrong.+// M10-005: `createEvent` takes `ServiceDeps` and writes through+// `deps.buffers.event`, so the buffer is handed in rather than mocked onto a+// module specifier — no `mock.module` and no restore to get wrong.import { beforeAll, describe, expect, mock, test } from 'bun:test';import type { ServiceDeps } from '../../../services';diff --git a/packages/core/src/modules/group/group.constants.ts b/packages/core/src/modules/group/group.constants.tsindex 79ef9a20b..1d17dbfa9 100644--- a/packages/core/src/modules/group/group.constants.ts+++ b/packages/core/src/modules/group/group.constants.ts@@ -1,8 +1,3 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map: group owns-// "C"). validation's index re-exports this file's-// `./modules/group/group.constants` subpath, so packages/trpc's group router-// and apps/start's add-group / edit-group modals keep resolving these symbols-// through packages/validation unchanged.//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/group/group.jobs.ts b/packages/core/src/modules/group/group.jobs.tsindex 1e573b364..6a30719c4 100644--- a/packages/core/src/modules/group/group.jobs.ts+++ b/packages/core/src/modules/group/group.jobs.ts@@ -1,7 +1,4 @@-// Ported from apps/worker/src/jobs/cron.ts's `flushGroups` case +-// boot-cron.ts's `flush`/`flushGroups` schedule; the schedule moved onto the-// job at ADR-021. The group buffer (Redis → ClickHouse `groups`) is this-// module's domain.+// The group buffer (Redis → ClickHouse `groups`) is this module's domain.import { z } from 'zod';import { defineJob } from '../../jobs/define';diff --git a/packages/core/src/modules/group/group.rpc.ts b/packages/core/src/modules/group/group.rpc.tsindex 17af9268e..fc7e67e78 100644--- a/packages/core/src/modules/group/group.rpc.ts+++ b/packages/core/src/modules/group/group.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/group.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/gsc/gsc.jobs.ts b/packages/core/src/modules/gsc/gsc.jobs.tsindex c989fffdb..0664405fc 100644--- a/packages/core/src/modules/gsc/gsc.jobs.ts+++ b/packages/core/src/modules/gsc/gsc.jobs.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/gsc.ts + boot-cron.ts's gscSync schedule;-// the schedule moved onto the job at ADR-021.//// `gscProjectSync` / `gscProjectBackfill` are this module's own queue (`gsc` in// the registry — ADR-005's registry key). `gscSync` is a cron fragment, spreaddiff --git a/packages/core/src/modules/gsc/gsc.rpc.ts b/packages/core/src/modules/gsc/gsc.rpc.tsindex 69edc2f57..59510a880 100644--- a/packages/core/src/modules/gsc/gsc.rpc.ts+++ b/packages/core/src/modules/gsc/gsc.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/gsc.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/gsc/gsc.service.ts b/packages/core/src/modules/gsc/gsc.service.tsindex 602d10554..63cf4e83d 100644--- a/packages/core/src/modules/gsc/gsc.service.ts+++ b/packages/core/src/modules/gsc/gsc.service.ts@@ -1,5 +1,4 @@-// Moved from packages/db/src/gsc.ts + packages/db/src/services/gsc.service.ts —-// the GSC OAuth token lifecycle, the Search Console API client, ClickHouse+// The GSC OAuth token lifecycle, the Search Console API client, ClickHouse// read/write, the AI-tool wrapper functions and the// gscProjectSync/gscProjectBackfill job bodies. packages/db/src/gsc.ts and// packages/db/src/services/gsc.service.ts become re-export shims of this filediff --git a/packages/core/src/modules/health/health.routes.ts b/packages/core/src/modules/health/health.routes.tsindex b8f279d37..0d6a24b88 100644--- a/packages/core/src/modules/health/health.routes.ts+++ b/packages/core/src/modules/health/health.routes.ts@@ -1,6 +1,4 @@-// Kubernetes liveness and readiness. Ported from V1's-// controllers/healthcheck.controller.ts `liveness`/`readiness` and-// apps/worker/src/index.ts's two probes, which agreed on both bodies.+// Kubernetes liveness and readiness.//// `/healthcheck` — the deep db/ch/redis probe — landed at M9-004, when// `AppDeps` started carrying the real clients; before that, porting it woulddiff --git a/packages/core/src/modules/health/src/shutdown.ts b/packages/core/src/modules/health/src/shutdown.tsindex 8ca9850bd..ee5e235a6 100644--- a/packages/core/src/modules/health/src/shutdown.ts+++ b/packages/core/src/modules/health/src/shutdown.ts@@ -1,7 +1,6 @@-// Ported from apps/worker/src/utils/graceful-shutdown.ts (P9). One flag, set-// by main.ts's signal handler, read by the readiness probe — so a draining-// process is taken out of the load balancer before its in-flight jobs finish-// rather than after.+// One flag, set by main.ts's signal handler, read by the readiness probe — so a+// draining process is taken out of the load balancer before its in-flight jobs+// finish rather than after.let shuttingDown = false;diff --git a/packages/core/src/modules/import/import.constants.ts b/packages/core/src/modules/import/import.constants.tsindex 9d4a5a1bf..765f33ae5 100644--- a/packages/core/src/modules/import/import.constants.ts+++ b/packages/core/src/modules/import/import.constants.ts@@ -1,9 +1,3 @@-// Moved from packages/validation/src/index.ts + packages/importer/src/-// providers/metadata.ts (ADR-008's module map: import owns "C").-// packages/validation/src/import.validation.ts becomes a re-export shim of this-// file (same shape as packages/validation/src/cohort.validation.ts since-// M5-003), so apps/start and packages/db/src/types.ts keep resolving these-// symbols through packages/validation's existing barrel unchanged.//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/import/import.jobs.ts b/packages/core/src/modules/import/import.jobs.tsindex 99ce92a5a..6ca2926e1 100644--- a/packages/core/src/modules/import/import.jobs.ts+++ b/packages/core/src/modules/import/import.jobs.ts@@ -1,4 +1,3 @@-// Ported from apps/worker/src/jobs/import.ts.//// `import` is this module's own queue AND its only job — the registry key, the// Redis name and the BullMQ job name are all `import` (legacyCompat.importdiff --git a/packages/core/src/modules/import/import.rpc.ts b/packages/core/src/modules/import/import.rpc.tsindex 33e0c7907..d04aecd9b 100644--- a/packages/core/src/modules/import/import.rpc.ts+++ b/packages/core/src/modules/import/import.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/import.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/import/import.service.ts b/packages/core/src/modules/import/import.service.tsindex 0357d3459..1cf66ce72 100644--- a/packages/core/src/modules/import/import.service.ts+++ b/packages/core/src/modules/import/import.service.ts@@ -1,10 +1,3 @@-// Moved from packages/db/src/services/import.service.ts (the ClickHouse-// staging/session pipeline) + apps/worker/src/jobs/import.ts (the job body and-// provider dispatch) + apps/api/src/controllers/import.controller.ts (the-// /import/events bulk-insert path) — M5-004, ADR-008's module map: import owns-// "S". packages/db/src/services/import.service.ts is deleted outright: nothing-// outside the worker job file it moves with reached it through @openpanel/db's-// barrel (same as cohort.service.ts).//// Db/ch access is LAZY (`load*` below), not a static top-level import — see// gsc.service.ts's header for the full reasoning (jobs.registry.ts anddiff --git a/packages/core/src/modules/ingest/ingest.constants.ts b/packages/core/src/modules/ingest/ingest.constants.tsindex 0fda3a53c..1a6da68cb 100644--- a/packages/core/src/modules/ingest/ingest.constants.ts+++ b/packages/core/src/modules/ingest/ingest.constants.ts@@ -1,10 +1,7 @@-// The ingestion wire contract (ADR-008's module map: ingest owns "C"). Moved-// from packages/validation/src/track.validation.ts,-// packages/validation/src/event-blocklist.ts and packages/constants'-// RESERVED_EVENT_NAMES — all three enforce the same thing (what a caller may-// name an event and what a track body may contain), so they are one file here.-// packages/validation and packages/constants re-export this; the SDK-// deep-import retarget is P11.+// The ingestion wire contract (ADR-008's module map: ingest owns "C"). All+// three enforce the same thing (what a caller may name an event and what a+// track body may contain), so they are one file here. packages/validation and+// packages/constants re-export this; the SDK deep-import retarget is P11.//// Isomorphic by rule: zod, another *.constants.ts, or nothing.diff --git a/packages/core/src/modules/ingest/src/consumer.test.ts b/packages/core/src/modules/ingest/src/consumer.test.tsindex 5d02f97e1..b28fe8886 100644--- a/packages/core/src/modules/ingest/src/consumer.test.ts+++ b/packages/core/src/modules/ingest/src/consumer.test.ts@@ -3,10 +3,9 @@* resolved once its message has been handled, dead-lettered, or deliberately* skipped — never merely because it failed.*- * Ported from apps/worker/src/jobs/events.kafka-consumer.test.ts with the- * assertions unchanged. The batch handler is exercised directly with injected- * dependencies; the broker, the metrics registry and `incomingEvent` are all- * out of the picture — which is why no `mock.module` appears here.+ * The batch handler is exercised directly with injected dependencies; the+ * broker, the metrics registry and `incomingEvent` are all out of the picture —+ * which is why no `mock.module` appears here.*/import { describe, expect, mock, test } from 'bun:test';diff --git a/packages/core/src/modules/ingest/src/consumer.ts b/packages/core/src/modules/ingest/src/consumer.tsindex 340859ae3..770feb050 100644--- a/packages/core/src/modules/ingest/src/consumer.ts+++ b/packages/core/src/modules/ingest/src/consumer.ts@@ -1,9 +1,9 @@-// Ported from apps/worker/src/jobs/events.kafka-consumer.ts. The delivery-// contract is ADR-004's and is unchanged line for line: per-key serial groups,-// the ascending contiguous-prefix offset walk, at-least-once, bounded-// in-consumer retry, and a dead-letter on exhaustion. Only the dead-letter-// DESTINATION and its failure behaviour changed: the record goes to a capped-// Redis list, and the event is dropped whether or not that write lands.+// The delivery contract is ADR-004's and is unchanged line for line: per-key+// serial groups, the ascending contiguous-prefix offset walk, at-least-once,+// bounded in-consumer retry, and a dead-letter on exhaustion. Only the+// dead-letter DESTINATION and its failure behaviour changed: the record goes to+// a capped Redis list, and the event is dropped whether or not that write+// lands.//// The kafkajs client, the topic/consumer-group names, the DLQ producer and the// retry bounds are all INJECTED, and stay so now that they live one directorydiff --git a/packages/core/src/modules/ingest/src/incoming-event-handler.test.ts b/packages/core/src/modules/ingest/src/incoming-event-handler.test.tsindex c985eacb8..c4bc9aa49 100644--- a/packages/core/src/modules/ingest/src/incoming-event-handler.test.ts+++ b/packages/core/src/modules/ingest/src/incoming-event-handler.test.ts@@ -1,6 +1,5 @@-// Ported from apps/worker/src/jobs/events.incoming-events.test.ts with every-// assertion unchanged. What changed is the seam: V1 reached the session buffer,-// `createEvent` and the sessions queue through `vi.mock('@openpanel/db')` /+// What changed is the seam: V1 reached the session buffer, `createEvent` and+// the sessions queue through `vi.mock('@openpanel/db')` /// `vi.mock('@openpanel/queue')`; here they are recording doubles handed in as// `IncomingEventDeps`, so the assertions are on calls the code under test// actually made and no `mock.module` is needed.diff --git a/packages/core/src/modules/ingest/src/incoming-event-handler.ts b/packages/core/src/modules/ingest/src/incoming-event-handler.tsindex d01d92d2e..153af1b37 100644--- a/packages/core/src/modules/ingest/src/incoming-event-handler.ts+++ b/packages/core/src/modules/ingest/src/incoming-event-handler.ts@@ -1,6 +1,5 @@-// Ported from apps/worker/src/jobs/events.incoming-event.ts: the Kafka-// consumer's per-message handler — the step that turns one topic payload into-// session lifecycle decisions and ClickHouse rows.+// The Kafka consumer's per-message handler — the step that turns one topic+// payload into session lifecycle decisions and ClickHouse rows.//// Everything that touches Redis, Postgres, ClickHouse or a queue is INJECTED// (`IncomingEventDeps`), the way session-end.ts does it, so the tests drive thediff --git a/packages/core/src/modules/ingest/src/kafka.ts b/packages/core/src/modules/ingest/src/kafka.tsindex a68f06502..e70088415 100644--- a/packages/core/src/modules/ingest/src/kafka.ts+++ b/packages/core/src/modules/ingest/src/kafka.ts@@ -1,6 +1,4 @@-// Moved from packages/queue/src/kafka.ts, byte-for-byte apart from the three-// repointed imports and the de-duplicated `DeadLetterMessage` below. What kept-// it out of core was the import direction, not the code: it lived in+// What kept it out of core was the import direction, not the code: it lived in// @openpanel/queue, a package that imports @openpanel/core for its logger, so// core could not import it back. Moving the file takes it out of that cycle —// `createLogger` is a sibling now, and both the producer and the consumer sitdiff --git a/packages/core/src/modules/ingest/wind-down.test.ts b/packages/core/src/modules/ingest/wind-down.test.tsindex 75d55b99c..ef58a40c1 100644--- a/packages/core/src/modules/ingest/wind-down.test.ts+++ b/packages/core/src/modules/ingest/wind-down.test.ts@@ -2,13 +2,12 @@* Tests for `isIngestionWoundDown` — the gate that stops ingestion for* organizations blocked by the wind-down sequence.*- * Ported from apps/api/src/hooks/subscription.hook.test.ts with M9-004, when- * V1's `subscriptionHook` moved into the ingest module. Same three behaviours- * matter: it gates on the wind-down STEP rather than the subscription state (so- * an expired trial keeps ingesting until it has actually been warned), the- * caller answers 202 rather than a 4xx (the SDKs retry everything except 401- * and 2xx), and it fails open. `SELF_HOSTED` is a `selfHosted` argument now —- * core reads no environment — so V1's `vi.stubEnv` becomes a parameter.+ * Same three behaviours matter: it gates on the wind-down STEP rather than the+ * subscription state (so an expired trial keeps ingesting until it has actually+ * been warned), the caller answers 202 rather than a 4xx (the SDKs retry+ * everything except 401 and 2xx), and it fails open. `SELF_HOSTED` is a+ * `selfHosted` argument now — core reads no environment — so V1's `vi.stubEnv`+ * becomes a parameter.*/import {diff --git a/packages/core/src/modules/insight/insight.constants.ts b/packages/core/src/modules/insight/insight.constants.tsindex a89cc7082..4f9a4619b 100644--- a/packages/core/src/modules/insight/insight.constants.ts+++ b/packages/core/src/modules/insight/insight.constants.ts@@ -1,6 +1,5 @@-// Moved from packages/validation/src/types.insights.ts (ADR-008's module map:-// insight owns "C"). Plain TypeScript, no zod — isomorphic by the AGENTS.md-// rule, which constrains a constants file's imports, and this file has none.+// Plain TypeScript, no zod — isomorphic by the AGENTS.md rule, which constrains+// a constants file's imports, and this file has none.// The two list procedures' page bounds. Vocabulary, not implementation: the// dashboard pages that call `insight.list` / `insight.listAll` size their owndiff --git a/packages/core/src/modules/insight/insight.jobs.ts b/packages/core/src/modules/insight/insight.jobs.tsindex d190af1bf..1b05cab7b 100644--- a/packages/core/src/modules/insight/insight.jobs.ts+++ b/packages/core/src/modules/insight/insight.jobs.ts@@ -1,6 +1,3 @@-// Ported from apps/worker/src/jobs/insights.ts, insights-enrich.ts,-// cron.insight-cleanup.ts and cron.weekly-digest.ts; the schedules moved onto-// the jobs at ADR-021.//// `insightsProject` is this module's own queue (`insights` in the registry —// ADR-005's registry key). `insightsDaily` / `insightCleanup` / `weeklyDigest`diff --git a/packages/core/src/modules/insight/insight.rpc.ts b/packages/core/src/modules/insight/insight.rpc.tsindex 69c87f272..1e55d652e 100644--- a/packages/core/src/modules/insight/insight.rpc.ts+++ b/packages/core/src/modules/insight/insight.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/insight.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/insight/insight.service.ts b/packages/core/src/modules/insight/insight.service.tsindex 70b9e5b7e..4a726d91a 100644--- a/packages/core/src/modules/insight/insight.service.ts+++ b/packages/core/src/modules/insight/insight.service.ts@@ -1,6 +1,4 @@-// Moved from packages/db/src/services/insights* + referrer-spikes.service.ts-// (the AI engine module). ADR-007: "Moves to core: src/services/** (33 services-// + insights/)".+// ADR-007: "Moves to core: src/services/** (33 services + insights/)".//// Plain exported functions, not only methods on `createInsightService`'s// container — the same shape as modules/auth/auth.service.ts, because V1'sdiff --git a/packages/core/src/modules/integration/integration.constants.test.ts b/packages/core/src/modules/integration/integration.constants.test.tsindex 2790a48c4..c7f8db0f9 100644--- a/packages/core/src/modules/integration/integration.constants.test.ts+++ b/packages/core/src/modules/integration/integration.constants.test.ts@@ -1,6 +1,3 @@-// Ported from packages/validation/src/integrations.test.ts (vitest -> bun:test-// per the module map).-import { describe, expect, it } from 'bun:test';import {isKind,diff --git a/packages/core/src/modules/integration/integration.constants.ts b/packages/core/src/modules/integration/integration.constants.tsindex 2dc244fdd..8d35cb6f0 100644--- a/packages/core/src/modules/integration/integration.constants.ts+++ b/packages/core/src/modules/integration/integration.constants.ts@@ -1,9 +1,3 @@-// Moved from packages/validation/src/integrations.ts (ADR-008's module map:-// integration owns "C"). packages/validation/src/index.ts becomes a re-export-// shim of this file (same shape as./notification.constants.ts since M6-005), so-// packages/trpc's integration router and apps/start's integration forms keep-// resolving these symbols through packages/validation's existing barrel-// unchanged.//// `zSlackAuthResponse` does NOT move here even though it is zod-only and would// pass `constants-stay-isomorphic`: it is Slack's OAuth token-exchange wirediff --git a/packages/core/src/modules/integration/integration.jobs.ts b/packages/core/src/modules/integration/integration.jobs.tsindex 71d34825f..729b29d12 100644--- a/packages/core/src/modules/integration/integration.jobs.ts+++ b/packages/core/src/modules/integration/integration.jobs.ts@@ -1,7 +1,5 @@-// Ported from apps/worker/src/jobs/cron.flush-exports.ts + boot-cron.ts's-// `flushExports` schedule (the wave that deletes apps/worker). ADR-005's-// acceptance note gives `flushExports` to this module; the schedule moved onto-// the job at ADR-021.+// ADR-005's acceptance note gives `flushExports` to this module; the schedule+// moved onto the job at ADR-021.//// `flushExports` is this module's fragment of the ONE `cron` queue's jobs,// spread into jobs.registry.ts. Scheduler id and cadence are V1's, unchanged.diff --git a/packages/core/src/modules/integration/integration.rpc.ts b/packages/core/src/modules/integration/integration.rpc.tsindex 9688f8706..fac16664e 100644--- a/packages/core/src/modules/integration/integration.rpc.ts+++ b/packages/core/src/modules/integration/integration.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/integration.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/integration/integration.service.ts b/packages/core/src/modules/integration/integration.service.tsindex 0cd1edd14..ff34aabbc 100644--- a/packages/core/src/modules/integration/integration.service.ts+++ b/packages/core/src/modules/integration/integration.service.ts@@ -1,7 +1,5 @@-// Moved from packages/trpc/src/routers/integration.ts (ADR-008's module map:-// integration owns "S"+"C"). V1's router stays the LIVE route (DELEGATE-// PATTERN) and delegates every handler body to these functions, same as-// notification's router does.+// V1's router stays the LIVE route (DELEGATE PATTERN) and delegates every+// handler body to these functions, same as notification's router does.//// Authorization here is data-dependent — an update must authorize against the// EXISTING row's scope, not the attacker-controlled input — so, unlike thediff --git a/packages/core/src/modules/integration/src/export/index.ts b/packages/core/src/modules/integration/src/export/index.tsindex cee4f6020..a624e3ca2 100644--- a/packages/core/src/modules/integration/src/export/index.ts+++ b/packages/core/src/modules/integration/src/export/index.ts@@ -1,5 +1,4 @@-// Moved from @openpanel/db's src/exports/ — object-store export batch creation,-// used by the flushExports cron job.+// Object-store export batch creation, used by the flushExports cron job.export {createBatch,diff --git a/packages/core/src/modules/integration/src/flush-exports.test.ts b/packages/core/src/modules/integration/src/flush-exports.test.tsindex 8ec560c39..518916590 100644--- a/packages/core/src/modules/integration/src/flush-exports.test.ts+++ b/packages/core/src/modules/integration/src/flush-exports.test.ts@@ -1,7 +1,6 @@-// Moved from apps/worker/src/jobs/cron.flush-exports.test.ts, plus the-// orchestration half V1 never covered: `runFlushExportsCron` now takes injected-// deps, so the fan-out, the watermark advance and the manifest-last upload-// order can be asserted with no infrastructure at all.+// `runFlushExportsCron` now takes injected deps, so the fan-out, the watermark+// advance and the manifest-last upload order can be asserted with no+// infrastructure at all.import { describe, expect, it, mock } from 'bun:test';import { gunzipSync } from 'node:zlib';diff --git a/packages/core/src/modules/integration/src/flush-exports.ts b/packages/core/src/modules/integration/src/flush-exports.tsindex c592ac71a..e724b4340 100644--- a/packages/core/src/modules/integration/src/flush-exports.ts+++ b/packages/core/src/modules/integration/src/flush-exports.ts@@ -1,8 +1,7 @@-// Ported from apps/worker/src/jobs/cron.flush-exports.ts (the wave that deletes-// apps/worker). ADR-005's acceptance note gives `flushExports` to the-// integration module. Behaviour is V1's, verbatim; Prisma, the ClickHouse-// client and the object-store adapter factory arrive as injected deps so the-// orchestration is testable without `mock.module` (same idiom as+// ADR-005's acceptance note gives `flushExports` to the integration module.+// Behaviour is V1's, verbatim; Prisma, the ClickHouse client and the+// object-store adapter factory arrive as injected deps so the orchestration is+// testable without `mock.module` (same idiom as// modules/session/src/runtime.ts).//// The window query is a MOVE, not an ADR-013 conversion: it already binds everydiff --git a/packages/core/src/modules/misc/misc.jobs.ts b/packages/core/src/modules/misc/misc.jobs.tsindex d24e563fd..f6f7e3490 100644--- a/packages/core/src/modules/misc/misc.jobs.ts+++ b/packages/core/src/modules/misc/misc.jobs.ts@@ -1,6 +1,3 @@-// Ported from apps/worker/src/jobs/cron.ping.ts + boot-cron.ts's `ping`-// schedule; `dataHealth` joined it at M9-003, the wave that deletes apps/worker-// (ADR-005's acceptance note gives it to this module).//// `ping` is this module's fragment of the ONE `cron` queue's jobs: declared// here and spread into jobs.registry.ts, same shape as organization.jobs.ts'sdiff --git a/packages/core/src/modules/misc/misc.service.ts b/packages/core/src/modules/misc/misc.service.tsindex 2ccc7f66a..34494dd64 100644--- a/packages/core/src/modules/misc/misc.service.ts+++ b/packages/core/src/modules/misc/misc.service.ts@@ -1,7 +1,6 @@-// Ported from apps/api/src/controllers/misc.controller.ts +-// apps/worker/src/jobs/cron.ping.ts. V1's Fastify controller and the worker's-// `cron.ping.ts` stay the LIVE code paths (DELEGATE PATTERN) and call the-// functions below verbatim — no new behaviour.+// V1's Fastify controller and the worker's `cron.ping.ts` stay the LIVE code+// paths (DELEGATE PATTERN) and call the functions below verbatim — no new+// behaviour.//// `GET/POST /misc/og/clear` and `/misc/favicon/clear` are NOT ported: ADR-015// entry #6 grades them RULED + DEAD (`docs/ANSWERS.md` §1.4 confirms no proxydiff --git a/packages/core/src/modules/misc/src/data-health.ts b/packages/core/src/modules/misc/src/data-health.tsindex 33454a851..7bb8f8b82 100644--- a/packages/core/src/modules/misc/src/data-health.ts+++ b/packages/core/src/modules/misc/src/data-health.ts@@ -1,8 +1,7 @@-// Ported from apps/worker/src/jobs/cron.data-health.ts (the wave that deletes-// apps/worker). ADR-005's acceptance note gives `dataHealth` to the misc-// module. Behaviour is V1's, verbatim; Prisma, the last-event lookup and-// `sendEmail` arrive as injected deps so the job is testable without-// `mock.module`. `misc.jobs.ts` binds them off the job's ctx.+// ADR-005's acceptance note gives `dataHealth` to the misc module. Behaviour is+// V1's, verbatim; Prisma, the last-event lookup and `sendEmail` arrive as+// injected deps so the job is testable without `mock.module`. `misc.jobs.ts`+// binds them off the job's ctx.import type { CoreConfig } from '../../../config';import type { Logger } from '../../../logger';diff --git a/packages/core/src/modules/notification/notification.constants.ts b/packages/core/src/modules/notification/notification.constants.tsindex f2b04b0f2..669eda3f2 100644--- a/packages/core/src/modules/notification/notification.constants.ts+++ b/packages/core/src/modules/notification/notification.constants.ts@@ -1,9 +1,3 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map:-// notification owns "C"). packages/validation/src/index.ts becomes a re-export-// shim of this file (same shape as./onboarding.constants.ts since M6-003), so-// packages/trpc's notification router and apps/start's notification rule form-// keep resolving these symbols through packages/validation's existing barrel-// unchanged.//// `zChartEvent`/`zChartEventFilter` are chart/report vocabulary that has not// moved to core yet (ADR-008's "report" module is a later wave), so perdiff --git a/packages/core/src/modules/notification/notification.jobs.ts b/packages/core/src/modules/notification/notification.jobs.tsindex b3bffa06a..a2fff0e04 100644--- a/packages/core/src/modules/notification/notification.jobs.ts+++ b/packages/core/src/modules/notification/notification.jobs.ts@@ -1,4 +1,3 @@-// Ported from apps/worker/src/jobs/notification.ts.//// `sendNotification` is this module's own queue (`notification` in the registry// — ADR-005's registry key). legacyCompat.notification already discriminates ondiff --git a/packages/core/src/modules/notification/notification.rpc.ts b/packages/core/src/modules/notification/notification.rpc.tsindex fd47d2abf..b1c16ec72 100644--- a/packages/core/src/modules/notification/notification.rpc.ts+++ b/packages/core/src/modules/notification/notification.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/notification.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/notification/notification.service.ts b/packages/core/src/modules/notification/notification.service.tsindex f8499a51a..1a428c9d5 100644--- a/packages/core/src/modules/notification/notification.service.ts+++ b/packages/core/src/modules/notification/notification.service.ts@@ -1,7 +1,6 @@-// Moved from packages/db/src/services/notification.service.ts (ADR-008's module-// map: "rules + dispatch stay together"). The delivery body moves here too,-// from apps/worker/src/jobs/notification.ts (DELEGATE PATTERN: that file-// becomes a thin wrapper calling `deliverNotification`).+// The delivery body moves here too, from apps/worker/src/jobs/notification.ts+// (DELEGATE PATTERN: that file becomes a thin wrapper calling+// `deliverNotification`).//// `createNotification` / `triggerNotification` /// `checkNotificationRulesForEvent` / `checkNotificationRulesForSessionEnd` —diff --git a/packages/core/src/modules/notification/src/notification-dispatch.ts b/packages/core/src/modules/notification/src/notification-dispatch.tsindex ba20d60a9..715a24666 100644Binary files a/packages/core/src/modules/notification/src/notification-dispatch.ts and b/packages/core/src/modules/notification/src/notification-dispatch.ts differdiff --git a/packages/core/src/modules/onboarding/onboarding.constants.ts b/packages/core/src/modules/onboarding/onboarding.constants.tsindex 353d4ba64..12e8af9d5 100644--- a/packages/core/src/modules/onboarding/onboarding.constants.ts+++ b/packages/core/src/modules/onboarding/onboarding.constants.ts@@ -1,6 +1,3 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map: onboarding-// owns "C"). packages/validation/src/index.ts becomes a re-export shim for this-// symbol (same shape as./cohort.validation.ts since M5-003).//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/onboarding/onboarding.jobs.ts b/packages/core/src/modules/onboarding/onboarding.jobs.tsindex 3f2bfce1d..db72d986b 100644--- a/packages/core/src/modules/onboarding/onboarding.jobs.ts+++ b/packages/core/src/modules/onboarding/onboarding.jobs.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/cron.onboarding.ts + boot-cron.ts's-// `onboarding` schedule; the schedule moved onto the job at ADR-021.//// `onboarding` is this module's fragment of the ONE `cron` queue's jobs, spread// into jobs.registry.ts. Scheduler id and cadence are V1's, unchangeddiff --git a/packages/core/src/modules/onboarding/onboarding.rpc.ts b/packages/core/src/modules/onboarding/onboarding.rpc.tsindex 56f60886a..39117b259 100644--- a/packages/core/src/modules/onboarding/onboarding.rpc.ts+++ b/packages/core/src/modules/onboarding/onboarding.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/onboarding.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/onboarding/onboarding.service.test.ts b/packages/core/src/modules/onboarding/onboarding.service.test.tsindex eca45e8ce..713580dc3 100644--- a/packages/core/src/modules/onboarding/onboarding.service.test.ts+++ b/packages/core/src/modules/onboarding/onboarding.service.test.ts@@ -1,10 +1,8 @@// Onboarding email cron: the sequential drip driven by the-// `organization.onboarding` pointer. Moved from-// apps/worker/src/jobs/cron.onboarding.test.ts — db, the organization module's-// event-count lookup, and email are mocked; asserts template selection, day-// gating, early completion on active subs, and usage personalization.-// `mock.module` is not hoisted, so the subject is imported inside `beforeAll` —-// see AGENTS.md.+// `organization.onboarding` pointer. Db, the organization module's event-count+// lookup, and email are mocked; asserts template selection, day gating, early+// completion on active subs, and usage personalization. `mock.module` is not+// hoisted, so the subject is imported inside `beforeAll` — see AGENTS.md.import { afterAll, beforeAll, beforeEach, expect, mock, test } from 'bun:test';import { subDays } from 'date-fns';diff --git a/packages/core/src/modules/organization/organization.constants.ts b/packages/core/src/modules/organization/organization.constants.tsindex e693ab8d0..97db23e86 100644--- a/packages/core/src/modules/organization/organization.constants.ts+++ b/packages/core/src/modules/organization/organization.constants.ts@@ -1,5 +1,3 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map:-// organization owns "C" for the member/invite/organization vocabulary).// `zProjectAccessGrant` is a per-project grant but every consumer is// organization-shaped (organization.rpc.ts's invite/access mutations), so it// lives here and `zInviteUser` embeds it without a cross-file constants import.diff --git a/packages/core/src/modules/organization/organization.jobs.ts b/packages/core/src/modules/organization/organization.jobs.tsindex 0c26baa62..ced52f20f 100644--- a/packages/core/src/modules/organization/organization.jobs.ts+++ b/packages/core/src/modules/organization/organization.jobs.ts@@ -1,7 +1,4 @@-// Ported from apps/worker/src/jobs/cron.delete.ts + boot-cron.ts's `delete`-// schedule; `windDown` joined it at M9-003, the wave that deletes apps/worker-// (ADR-005's acceptance note gives it to this module). The schedules moved onto-// the jobs at ADR-021.+// The schedules moved onto the jobs at ADR-021.//// `delete` is this module's fragment of the ONE `cron` queue's jobs, spread// into jobs.registry.ts. Scheduler id and cadence are V1's, unchangeddiff --git a/packages/core/src/modules/organization/organization.rpc.ts b/packages/core/src/modules/organization/organization.rpc.tsindex 8f2550bb3..614086f21 100644--- a/packages/core/src/modules/organization/organization.rpc.ts+++ b/packages/core/src/modules/organization/organization.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/organization.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/organization/organization.service.ts b/packages/core/src/modules/organization/organization.service.tsindex 851871ca5..d9e722491 100644--- a/packages/core/src/modules/organization/organization.service.ts+++ b/packages/core/src/modules/organization/organization.service.ts@@ -475,7 +475,7 @@ export async function getSettingsForProject(};}-// --- Moved from packages/db/src/services/delete.service.ts ---+// -- Moved from packages/db/src/services/delete.service.ts ---export async function deleteOrganization(deps: ServiceDeps,@@ -619,7 +619,7 @@ export async function runDeleteCron(};}-// --- Moved from packages/trpc/src/routers/organization.ts's inline bodies ---+// -- Moved from packages/trpc/src/routers/organization.ts's inline bodies ---export async function updateOrganization(deps: ServiceDeps,diff --git a/packages/core/src/modules/organization/src/win-back-highlight.test.ts b/packages/core/src/modules/organization/src/win-back-highlight.test.tsindex 6583a52d4..71710211b 100644--- a/packages/core/src/modules/organization/src/win-back-highlight.test.ts+++ b/packages/core/src/modules/organization/src/win-back-highlight.test.ts@@ -1,7 +1,6 @@-// Moved from apps/worker/src/jobs/lib/win-back-highlight.test.ts. Asserts the-// gating and fallback decisions, which are the point of the module: a highlight-// is a bonus, never a reason an email fails or embarrasses us with tiny-// numbers. The stats lookups and the AI call are injected stubs — no+// Asserts the gating and fallback decisions, which are the point of the module:+// a highlight is a bonus, never a reason an email fails or embarrasses us with+// tiny numbers. The stats lookups and the AI call are injected stubs — no// `mock.module`, so every assertion is on a call the code under test made.import { beforeEach, describe, expect, it, mock } from 'bun:test';diff --git a/packages/core/src/modules/organization/src/win-back-highlight.ts b/packages/core/src/modules/organization/src/win-back-highlight.tsindex 5b6497000..96b2edacc 100644--- a/packages/core/src/modules/organization/src/win-back-highlight.ts+++ b/packages/core/src/modules/organization/src/win-back-highlight.ts@@ -1,10 +1,8 @@-// Ported from apps/worker/src/jobs/lib/win-back-highlight.ts (the wave that-// deletes apps/worker). Behaviour is V1's, verbatim; only the wiring changed —-// the two stats lookups and the AI call arrive as injected deps-// (`WinBackHighlightDeps`) instead of static imports, the same idiom the-// session lifecycle uses (modules/session/src/runtime.ts):-// `organization.jobs.ts` binds them off the job's ctx, and tests hand in stubs,-// so no `mock.module` is needed anywhere.+// Behaviour is V1's, verbatim; only the wiring changed — the two stats lookups+// and the AI call arrive as injected deps (`WinBackHighlightDeps`) instead of+// static imports, the same idiom the session lifecycle uses+// (modules/session/src/runtime.ts): `organization.jobs.ts` binds them off the+// job's ctx, and tests hand in stubs, so no `mock.module` is needed anywhere.import { format, subDays } from 'date-fns';import type { Logger } from '../../../logger';diff --git a/packages/core/src/modules/organization/src/wind-down.test.ts b/packages/core/src/modules/organization/src/wind-down.test.tsindex 883d60682..50a256ac7 100644--- a/packages/core/src/modules/organization/src/wind-down.test.ts+++ b/packages/core/src/modules/organization/src/wind-down.test.ts@@ -1,4 +1,3 @@-// Moved from apps/worker/src/jobs/cron.wind-down.test.ts.//// Prisma, the event counts, the last-event lookup, the highlight builder and// the email transport are injected stubs — these assert the job's decisionsdiff --git a/packages/core/src/modules/organization/src/wind-down.ts b/packages/core/src/modules/organization/src/wind-down.tsindex ccb662594..b1b5d02c8 100644--- a/packages/core/src/modules/organization/src/wind-down.ts+++ b/packages/core/src/modules/organization/src/wind-down.ts@@ -1,7 +1,6 @@-// Ported from apps/worker/src/jobs/cron.wind-down.ts (the wave that deletes-// apps/worker). ADR-005's acceptance note gives `windDown` to the organization-// module. Behaviour is V1's, verbatim; only the wiring changed — Prisma, the-// two ClickHouse counts, the last-event lookup, the plan pricer, the highlight+// ADR-005's acceptance note gives `windDown` to the organization module.+// Behaviour is V1's, verbatim; only the wiring changed — Prisma, the two+// ClickHouse counts, the last-event lookup, the plan pricer, the highlight// builder and `sendEmail` all arrive as injected deps (`WindDownDeps`), the// same idiom the session lifecycle uses (modules/session/src/runtime.ts).// `organization.jobs.ts` binds them off the job's ctx; tests hand in stubs, sodiff --git a/packages/core/src/modules/overview/overview.rpc.ts b/packages/core/src/modules/overview/overview.rpc.tsindex dfa753934..e358e487f 100644--- a/packages/core/src/modules/overview/overview.rpc.ts+++ b/packages/core/src/modules/overview/overview.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/overview.ts.//// `overviewProcedure` is V1's own builder — `publicProcedure` plus one// middleware that resolves share-or-membership off the rawdiff --git a/packages/core/src/modules/overview/overview.service.ts b/packages/core/src/modules/overview/overview.service.tsindex 90abcacc2..3e04438c6 100644--- a/packages/core/src/modules/overview/overview.service.ts+++ b/packages/core/src/modules/overview/overview.service.ts@@ -1,5 +1,4 @@-// Ported from packages/db/src/services/overview.service.ts. The ClickHouse-// queries moved to src/overview.sql.ts.+// The ClickHouse queries moved to src/overview.sql.ts.//// `OverviewService` is no longer a class and there is no `overviewService`// module singleton. Every method is a module-scope function takingdiff --git a/packages/core/src/modules/overview/pages.service.ts b/packages/core/src/modules/overview/pages.service.tsindex 16c6f6736..b13923d3a 100644--- a/packages/core/src/modules/overview/pages.service.ts+++ b/packages/core/src/modules/overview/pages.service.ts@@ -1,5 +1,4 @@-// Ported from packages/db/src/services/pages.service.ts. The ClickHouse queries-// moved to src/pages.sql.ts.+// The ClickHouse queries moved to src/pages.sql.ts.//// `PagesService` is no longer a class and there is no `pagesService` module// singleton. It is registered as its OWN service (`services.pages`) rather thandiff --git a/packages/core/src/modules/overview/src/overview-raw-where.sql.test.ts b/packages/core/src/modules/overview/src/overview-raw-where.sql.test.tsindex e6933e27a..e2efdcf99 100644--- a/packages/core/src/modules/overview/src/overview-raw-where.sql.test.ts+++ b/packages/core/src/modules/overview/src/overview-raw-where.sql.test.ts@@ -1,13 +1,12 @@/*** SQL-syntax tests for the overview module's `getRawWhereClause` (the UTM- * remapping). Moved from packages/db/src/services/overview-sql.test.ts- * alongside its subject, which moved to core in M7-005 — same pattern as the- * chart cases moving to chart.sql.test.ts with theirs. M12-002 put- * `getRawWhereClause` on the `sql` tag, so these assertions read the rendered- * statement AND its bound params instead of one escaped string; the rest of the- * overview module's queries already run through overview.sql.ts, covered by- * overview.sql.test.ts. M10-005 turned it from a class method into a module- * function — it never needed a client, being pure fragment building.+ * remapping). Same pattern as the chart cases moving to chart.sql.test.ts with+ * theirs. M12-002 put `getRawWhereClause` on the `sql` tag, so these assertions+ * read the rendered statement AND its bound params instead of one escaped+ * string; the rest of the overview module's queries already run through+ * overview.sql.ts, covered by overview.sql.test.ts. M10-005 turned it from a+ * class method into a module function — it never needed a client, being pure+ * fragment building.** Strategy: build the SQL string, then run `EXPLAIN <sql>` against the local* ClickHouse instance. EXPLAIN parses the query, resolves columns, and buildsdiff --git a/packages/core/src/modules/profile/profile.jobs.ts b/packages/core/src/modules/profile/profile.jobs.tsindex 83ff5e8da..40b999f57 100644--- a/packages/core/src/modules/profile/profile.jobs.ts+++ b/packages/core/src/modules/profile/profile.jobs.ts@@ -1,9 +1,7 @@-// Ported from apps/worker/src/jobs/cron.ts's `flushProfiles` /-// `flushProfileBackfill` cases + boot-cron.ts's `flush` schedules; the-// schedules moved onto the jobs at ADR-021. Both buffers are this module's-// domain: the profile buffer (Redis → ClickHouse `profiles`) and the-// profile-backfill buffer, which patches a session's `profile_id` once a device-// is identified after the session row was already written.+// Both buffers are this module's domain: the profile buffer (Redis → ClickHouse+// `profiles`) and the profile-backfill buffer, which patches a session's+// `profile_id` once a device is identified after the session row was already+// written.import { z } from 'zod';import { defineJob } from '../../jobs/define';diff --git a/packages/core/src/modules/profile/profile.rpc.ts b/packages/core/src/modules/profile/profile.rpc.tsindex 92963152b..7107918df 100644--- a/packages/core/src/modules/profile/profile.rpc.ts+++ b/packages/core/src/modules/profile/profile.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/profile.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/project/project.constants.ts b/packages/core/src/modules/project/project.constants.tsindex 69bf671f5..5fb2bee01 100644--- a/packages/core/src/modules/project/project.constants.ts+++ b/packages/core/src/modules/project/project.constants.ts@@ -1,8 +1,3 @@-// Moved from packages/constants/index.ts (ADR-008's module map: project owns-// "C"). packages/constants/index.ts becomes a re-export shim of-// `ProjectTypeNames` (same shape as-// packages/validation/src/import.validation.ts since M5-004), so existing-// packages/constants importers keep resolving it unchanged.// `zCreateProject`/`zUpdateProject` are the /manage REST body schemas// (apps/api/src/controllers/manage.controller.ts), moved here with the CRUD// bodies they validate (project.service.ts'sdiff --git a/packages/core/src/modules/project/project.rpc.ts b/packages/core/src/modules/project/project.rpc.tsindex d92dbf9ca..0b56feb05 100644--- a/packages/core/src/modules/project/project.rpc.ts+++ b/packages/core/src/modules/project/project.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/project.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/realtime/realtime.rpc.ts b/packages/core/src/modules/realtime/realtime.rpc.tsindex 5f0661242..340c3976d 100644--- a/packages/core/src/modules/realtime/realtime.rpc.ts+++ b/packages/core/src/modules/realtime/realtime.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/realtime.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/reference/reference.constants.ts b/packages/core/src/modules/reference/reference.constants.tsindex f9c2ece9e..0f70d8c8e 100644--- a/packages/core/src/modules/reference/reference.constants.ts+++ b/packages/core/src/modules/reference/reference.constants.ts@@ -1,7 +1,5 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map: reference-// owns "C"). ADR-008 records two diverged `zCreateReference` copies in V1 as-// one of the two drift bugs the dissolution exists to prevent; this is now the-// only one.+// ADR-008 records two diverged `zCreateReference` copies in V1 as one of the+// two drift bugs the dissolution exists to prevent; this is now the only one.//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/reference/reference.rpc.test.ts b/packages/core/src/modules/reference/reference.rpc.test.tsindex 9d2d4a647..f75285d42 100644--- a/packages/core/src/modules/reference/reference.rpc.test.ts+++ b/packages/core/src/modules/reference/reference.rpc.test.ts@@ -30,10 +30,6 @@ async function anonCaller() {return referenceRouter.createCaller(trpcCtx);}-// Ported from packages/trpc/src/routers/reference.test.ts (main #511).-// getChartReferences is public so a share page can annotate its charts, so-// the guard inside the handler is the only thing standing between an-// anonymous caller and another tenant's annotations (GHSA-vrrm-p9p4-2gfg).const CHART_INPUT = { projectId: 'proj_1', range: '30d' as const };const ANNOTATIONS = [{ title: 'Deploy v2' }];diff --git a/packages/core/src/modules/reference/reference.rpc.ts b/packages/core/src/modules/reference/reference.rpc.tsindex 03ee4d4e9..928c9f197 100644--- a/packages/core/src/modules/reference/reference.rpc.ts+++ b/packages/core/src/modules/reference/reference.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/reference.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/reference/reference.service.ts b/packages/core/src/modules/reference/reference.service.tsindex 92cbcce80..e4e9940e6 100644--- a/packages/core/src/modules/reference/reference.service.ts+++ b/packages/core/src/modules/reference/reference.service.ts@@ -1,8 +1,3 @@-// Moved from packages/db/src/services/reference.service.ts, plus the-// query/mutation bodies packages/trpc/src/routers/reference.ts held inline-// (DELEGATE PATTERN: V1's router and this package's own reference.rpc.ts shared-// one implementation, same as conversation.service.ts since M5-006, until-// packages/trpc was retired at M11-004).//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`. The// `loadDb` / `loadDateService` / `loadOrganizationService` lazy loaders arediff --git a/packages/core/src/modules/report/report.constants.ts b/packages/core/src/modules/report/report.constants.tsindex 959eebde7..10a41c0a1 100644--- a/packages/core/src/modules/report/report.constants.ts+++ b/packages/core/src/modules/report/report.constants.ts@@ -1,8 +1,3 @@-// Ported from V1's packages/constants + packages/validation (ADR-008's module-// map: report owns "C" for the chart/report/widget vocabulary) — neither-// package exists in this tree; every importer here (the chart engine,-// apps/start's report builder) reaches these symbols through this file-// directly.//// `getDefaultIntervalByDates` is REWRITTEN from date-fns// (differenceInDays/isSameDay) to plain Date math per the module map. Everydiff --git a/packages/core/src/modules/report/report.rpc.ts b/packages/core/src/modules/report/report.rpc.tsindex 61b0f13db..484c85a51 100644--- a/packages/core/src/modules/report/report.rpc.ts+++ b/packages/core/src/modules/report/report.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/report.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/report/report.service.test.ts b/packages/core/src/modules/report/report.service.test.tsindex 4bc6be516..7ecd2c7c3 100644--- a/packages/core/src/modules/report/report.service.test.ts+++ b/packages/core/src/modules/report/report.service.test.ts@@ -1,9 +1,8 @@/*** Unit tests for mergeGlobalFilters — the helper that combines report-level* global filters with each event series' own filters (AND semantics). Pure- * function, no ClickHouse/Postgres needed. Ported from- * packages/db/src/services/reports.service.test.ts, vitest -> bun:test. M10-003- * moved the helper to./src/series.ts — see that file for why.+ * function, no ClickHouse/Postgres needed. Test. M10-003 moved the helper+ * to./src/series.ts — see that file for why.*/import { describe, expect, it } from 'bun:test';import type { IChartEventFilter, IChartEventItem } from './report.constants';diff --git a/packages/core/src/modules/report/report.service.ts b/packages/core/src/modules/report/report.service.tsindex dfb03c690..1dfd89601 100644--- a/packages/core/src/modules/report/report.service.ts+++ b/packages/core/src/modules/report/report.service.ts@@ -1,7 +1,3 @@-// Ported from V1's packages/db/src/services/reports.service.ts, plus the-// create/update/move/delete/duplicate/layout mutation bodies V1's-// packages/trpc/src/routers/report.ts held inline (ADR-008's module map: report-// owns "R,S,C") — neither package exists in this tree.//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`;// `loadDb` and the `@openpanel/core` self-barrel import are gone — the Prismadiff --git a/packages/core/src/modules/salt/salt.jobs.ts b/packages/core/src/modules/salt/salt.jobs.tsindex e915d104f..7a95e665c 100644--- a/packages/core/src/modules/salt/salt.jobs.ts+++ b/packages/core/src/modules/salt/salt.jobs.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/cron.salt.ts + boot-cron.ts's `salt`-// schedule; the schedule moved onto the job at ADR-021.//// `salt` is this module's fragment of the ONE `cron` queue's jobs, spread into// jobs.registry.ts. Its schedule is now derived straight from `cron` below — iddiff --git a/packages/core/src/modules/salt/salt.service.ts b/packages/core/src/modules/salt/salt.service.tsindex 2ba6cd308..559103d08 100644--- a/packages/core/src/modules/salt/salt.service.ts+++ b/packages/core/src/modules/salt/salt.service.ts@@ -1,5 +1,3 @@-// Moved from packages/db/src/services/salt.service.ts +-// apps/worker/src/jobs/cron.salt.ts.//// Reaches Postgres as `deps.db`, no `@openpanel/db` import left. `main.ts`// passes its own `deps` to `createInitialSalts` at boot; `salt.jobs.ts`'sdiff --git a/packages/core/src/modules/session/session.jobs.ts b/packages/core/src/modules/session/session.jobs.tsindex 4aca1bf2d..d4c75d4a6 100644--- a/packages/core/src/modules/session/session.jobs.ts+++ b/packages/core/src/modules/session/session.jobs.ts@@ -1,8 +1,4 @@-// Ported from apps/worker/src/jobs/sessions.ts (+-// events.create-session-end.ts), cron.session-reaper.ts and-// cron.session-vacuum.ts; `flushSessions` and `flushReplay`-// (apps/worker/src/jobs/cron.ts) join them here at M8-004. Schedules moved onto-// the jobs at ADR-021.+// Schedules moved onto the jobs at ADR-021.//// `sessions` is this module's own queue — registry key and Redis name// `sessions`, job name `session`, `removeOnComplete: true`, concurrency 1, alldiff --git a/packages/core/src/modules/session/session.rpc.ts b/packages/core/src/modules/session/session.rpc.tsindex 982382d2f..2b78ff92e 100644--- a/packages/core/src/modules/session/session.rpc.ts+++ b/packages/core/src/modules/session/session.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/session.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/session/src/session-end.test.ts b/packages/core/src/modules/session/src/session-end.test.tsindex 167c4e3ba..39ad0dbb0 100644--- a/packages/core/src/modules/session/src/session-end.test.ts+++ b/packages/core/src/modules/session/src/session-end.test.ts@@ -1,5 +1,4 @@-// Ported from apps/worker/src/jobs/events.create-session-end.test.ts. Covers-// the three-case logic (extended-after-enqueue skip, live vs snapshot,+// Covers the three-case logic (extended-after-enqueue skip, live vs snapshot,// boundary), the first-writer idempotency claim, and that cleanup is id-gated// to the closed session.diff --git a/packages/core/src/modules/session/src/session-end.ts b/packages/core/src/modules/session/src/session-end.tsindex e9f0e72b4..6640a8ac8 100644--- a/packages/core/src/modules/session/src/session-end.ts+++ b/packages/core/src/modules/session/src/session-end.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/events.create-session-end.ts and-// utils/session-handler.ts.//// Everything that touches Redis, ClickHouse, a buffer or a queue is INJECTED// (`SessionEndDeps`): M10-006 moved the binding into `session.jobs.ts`, wherediff --git a/packages/core/src/modules/session/src/session-reaper.test.ts b/packages/core/src/modules/session/src/session-reaper.test.tsindex c238403ac..b2ea1f73d 100644--- a/packages/core/src/modules/session/src/session-reaper.test.ts+++ b/packages/core/src/modules/session/src/session-reaper.test.ts@@ -1,6 +1,5 @@-// Ported from apps/worker/src/jobs/cron.session-reaper.test.ts. The wall-clock-// deadman that closes idle sessions: stub Redis drives the wallclock ZSET +-// lock, so the assertions are on decisions, not side effects.+// The wall-clock deadman that closes idle sessions: stub Redis drives the+// wallclock ZSET + lock, so the assertions are on decisions, not side effects.import { describe, expect, mock, test } from 'bun:test';import { testCoreConfig } from '../../../../test/config-fixture';diff --git a/packages/core/src/modules/session/src/session-reaper.ts b/packages/core/src/modules/session/src/session-reaper.tsindex 88b7304f9..86bb84bfa 100644--- a/packages/core/src/modules/session/src/session-reaper.ts+++ b/packages/core/src/modules/session/src/session-reaper.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/cron.session-reaper.ts.-import type { Logger } from '../../../logger';import type { IServiceCreateEventPayload } from '../../event/event.service';import type { IClickhouseSession } from '../session.service';diff --git a/packages/core/src/modules/session/src/session-vacuum.test.ts b/packages/core/src/modules/session/src/session-vacuum.test.tsindex 8e6aab13f..a34a5b6aa 100644--- a/packages/core/src/modules/session/src/session-vacuum.test.ts+++ b/packages/core/src/modules/session/src/session-vacuum.test.ts@@ -1,6 +1,5 @@-// Ported from apps/worker/src/jobs/cron.session-vacuum.test.ts. The daily-// backstop for sessions whose cleanup leaked: a lingering blob → id-gated-// cleanup; a missing blob → ZREM the orphan.+// The daily backstop for sessions whose cleanup leaked: a lingering blob →+// id-gated cleanup; a missing blob → ZREM the orphan.import { describe, expect, test } from 'bun:test';import { testCoreConfig } from '../../../../test/config-fixture';diff --git a/packages/core/src/modules/session/src/session-vacuum.ts b/packages/core/src/modules/session/src/session-vacuum.tsindex 33f216252..3d6aa03f0 100644--- a/packages/core/src/modules/session/src/session-vacuum.ts+++ b/packages/core/src/modules/session/src/session-vacuum.ts@@ -1,5 +1,3 @@-// Ported from apps/worker/src/jobs/cron.session-vacuum.ts.-import type { Logger } from '../../../logger';import { PROJECTS_SET_KEY, wallclockSetKey } from './keys';import type { SessionRuntime } from './runtime';diff --git a/packages/core/src/modules/session/src/sql.ts b/packages/core/src/modules/session/src/sql.tsindex b45a060bd..abc835f40 100644--- a/packages/core/src/modules/session/src/sql.ts+++ b/packages/core/src/modules/session/src/sql.ts@@ -1,9 +1,7 @@-// Every ClickHouse query the session module runs, as pure `sql` fragments.-// Converted 1:1 from packages/db/src/services/session.service.ts and-// apps/worker/src/jobs/events.create-session-end.ts: the SQL text is V1's, with-// every value bound as a `{pN:Type}` parameter instead of an escaped literal,-// and each conversion was proven byte-equivalent against the local prod-copy-// (see the task report).+// Every ClickHouse query the session module runs, as pure `sql` fragments. The+// SQL text is V1's, with every value bound as a `{pN:Type}` parameter instead+// of an escaped literal, and each conversion was proven byte-equivalent against+// the local prod-copy (see the task report).//// Dates bind as V1's own `YYYY-MM-DD HH:mm:ss` strings on purpose: a String// param in a DateTime64 position is parsed exactly like the literal itdiff --git a/packages/core/src/modules/session/src/usage.ts b/packages/core/src/modules/session/src/usage.tsindex f18127ade..47a04dc52 100644--- a/packages/core/src/modules/session/src/usage.ts+++ b/packages/core/src/modules/session/src/usage.ts@@ -1,7 +1,6 @@-// Ported from apps/worker/src/jobs/sessions.ts: after each session_end the-// owning project's and organization's event counters are refreshed, at most-// once an hour per project, and usage alert emails go out at 80% / 100% of the-// billing limit.+// After each session_end the owning project's and organization's event counters+// are refreshed, at most once an hour per project, and usage alert emails go+// out at 80% / 100% of the billing limit.import type { Organization } from '@openpanel/db/src/prisma-client';import { cacheablePerDeps } from '../../../cacheable-per-deps';diff --git a/packages/core/src/modules/share/share.constants.ts b/packages/core/src/modules/share/share.constants.tsindex bac1d954a..6a1797627 100644--- a/packages/core/src/modules/share/share.constants.ts+++ b/packages/core/src/modules/share/share.constants.ts@@ -1,8 +1,3 @@-// Moved from packages/validation/src/index.ts (ADR-008's module map: share owns-// "C"). packages/validation re-exports these for existing packages/validation-// importers — same shape as packages/validation/src/index.ts's onboarding/auth-// re-exports since M6-003.-import { z } from 'zod';export const zShareOverview = z.object({diff --git a/packages/core/src/modules/share/share.rpc.ts b/packages/core/src/modules/share/share.rpc.tsindex dcea4d4de..6cf90d62f 100644--- a/packages/core/src/modules/share/share.rpc.ts+++ b/packages/core/src/modules/share/share.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/share.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/share/share.service.ts b/packages/core/src/modules/share/share.service.tsindex 44453d460..1c00b0899 100644--- a/packages/core/src/modules/share/share.service.ts+++ b/packages/core/src/modules/share/share.service.ts@@ -1,9 +1,3 @@-// Moved from packages/db/src/services/share.service.ts, plus the query/mutation-// bodies packages/trpc/src/routers/share.ts held inline (DELEGATE PATTERN: V1's-// router and this package's own share.rpc.ts share one implementation, same as-// organization.service.ts since M6-001). packages/db keeps a re-export shim:-// auth.service.ts's signInToShare and packages/trpc's chart/overview routers-// still reach validateShareAccess/validateOverviewShareAccess through it.//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`; the// `loadDb` / `loadAccessService` / `loadDashboardService` /diff --git a/packages/core/src/modules/subscription/subscription.constants.ts b/packages/core/src/modules/subscription/subscription.constants.tsindex 1449c1f94..d76a8323e 100644--- a/packages/core/src/modules/subscription/subscription.constants.ts+++ b/packages/core/src/modules/subscription/subscription.constants.ts@@ -1,7 +1,3 @@-// Ported from V1's packages/validation/src/index.ts (ADR-008's module map:-// subscription owns "C") — that package doesn't exist in this tree;-// apps/start's billing forms and this module's own subscription.rpc.ts resolve-// these symbols through this file directly.//// Isomorphic by the AGENTS.md rule: zod and nothing else.diff --git a/packages/core/src/modules/subscription/subscription.routes.ts b/packages/core/src/modules/subscription/subscription.routes.tsindex 5c8b6c527..5a884c086 100644--- a/packages/core/src/modules/subscription/subscription.routes.ts+++ b/packages/core/src/modules/subscription/subscription.routes.ts@@ -1,6 +1,4 @@-// The Polar webhook, `POST /webhook/polar`. Ported from V1's-// apps/api/src/controllers/webhook.controller.ts's `polarWebhook`, which-// doesn't exist in this tree — this route is the only caller of+// The Polar webhook, `POST /webhook/polar`. This route is the only caller of// subscription.service.ts's `handlePolarWebhookEvent`.//// RAW BYTES, deliberately: `validatePolarEvent` verifies Polar's signature overdiff --git a/packages/core/src/modules/subscription/subscription.rpc.ts b/packages/core/src/modules/subscription/subscription.rpc.tsindex d8de1fd1e..afbae9308 100644--- a/packages/core/src/modules/subscription/subscription.rpc.ts+++ b/packages/core/src/modules/subscription/subscription.rpc.ts@@ -1,4 +1,3 @@-// Ported from packages/trpc/src/routers/subscription.ts.//// Every procedure is on its V1 twin's builder. `protectedProcedure` runs// `enforceUserIsAuthed` + `enforceAccess` BEFORE the input parser, exactly asdiff --git a/packages/core/src/modules/subscription/subscription.service.ts b/packages/core/src/modules/subscription/subscription.service.tsindex 1d111dfee..9cf3ea91e 100644--- a/packages/core/src/modules/subscription/subscription.service.ts+++ b/packages/core/src/modules/subscription/subscription.service.ts@@ -1,8 +1,3 @@-// Ported from V1's packages/trpc/src/routers/subscription.ts (checkout,-// products, usage, cancel/pause/resume, save-discount, portal) and from-// apps/api/src/controllers/webhook.controller.ts's `polarWebhook` — neither-// exists in this tree; every caller reaches these functions through this file-// directly (subscription.rpc.ts, subscription.routes.ts).//// `requireOrganizationAdmin` travels with the business logic here rather than// living in subscription.rpc.ts the way project.rpc.ts's simple ladder checksdiff --git a/packages/core/src/modules/user/user.service.ts b/packages/core/src/modules/user/user.service.tsindex d92bb5e79..0f149aaf5 100644--- a/packages/core/src/modules/user/user.service.ts+++ b/packages/core/src/modules/user/user.service.ts@@ -1,4 +1,3 @@-// Moved from packages/db/src/services/user.service.ts.//// Every function takes `ServiceDeps` and reaches Postgres as `deps.db`; the// `loadDb` lazy loader is gone. Every caller — includingdiff --git a/packages/core/src/rpc/rate-limit.test.ts b/packages/core/src/rpc/rate-limit.test.tsindex d5fb9d092..ef653a1a7 100644--- a/packages/core/src/rpc/rate-limit.test.ts+++ b/packages/core/src/rpc/rate-limit.test.ts@@ -1,7 +1,3 @@-// Ported from packages/trpc/src/rate-limit.test.ts (V1), plus a check that-// every auth procedure V1 throttled is still throttled here — the wrappers-// were dropped once already (ISSUES.md H4).-import { describe, expect, test } from 'bun:test';import { readFileSync } from 'node:fs';import { __testing } from './rate-limit';diff --git a/packages/core/src/shared/als-session.ts b/packages/core/src/shared/als-session.tsindex 66492f219..9d08c12fe 100644--- a/packages/core/src/shared/als-session.ts+++ b/packages/core/src/shared/als-session.ts@@ -1,8 +1,7 @@-// Moved from packages/db/src/session-context.ts, and out of-// `modules/session/src/` at M15-009: both transports open the scope and nothing-// in the session module reads it, so it is request scoping, not session domain-// logic. Dependency-free — `node:async_hooks` and nothing else — so it sits at-// the bottom, where a transport may reach it.+// Both transports open the scope and nothing in the session module reads it, so+// it is request scoping, not session domain logic. Dependency-free —+// `node:async_hooks` and nothing else — so it sits at the bottom, where a+// transport may reach it.//// The ALS scopes a request's dashboard session id so anything downstream —// today only the Prisma read-replica consistency extension ADR-012 retires —diff --git a/packages/core/src/shared/basic-auth.test.ts b/packages/core/src/shared/basic-auth.test.tsindex da5b00ad4..2622cec5f 100644--- a/packages/core/src/shared/basic-auth.test.ts+++ b/packages/core/src/shared/basic-auth.test.ts@@ -1,4 +1,3 @@-// Ported from apps/worker/src/utils/basic-auth.test.ts (main #511).import { describe, expect, it } from 'bun:test';import { basicAuthChallenge, matchesBasicAuth } from './basic-auth';diff --git a/packages/core/src/shared/basic-auth.ts b/packages/core/src/shared/basic-auth.tsindex c4aea88b6..22557ad12 100644--- a/packages/core/src/shared/basic-auth.ts+++ b/packages/core/src/shared/basic-auth.ts@@ -1,9 +1,5 @@// HTTP Basic auth for operator-only surfaces. Browsers prompt for the// credentials, so such a surface needs no UI of its own.-//-// Ported from apps/worker/src/utils/basic-auth.ts (main #511) as a plain-// predicate: express middleware has no home here, and the caller decides what-// a refusal looks like on its transport.import { timingSafeEqual } from 'node:crypto';diff --git a/packages/core/src/shared/cookie.ts b/packages/core/src/shared/cookie.tsindex 877eb4b91..ada7efc6e 100644--- a/packages/core/src/shared/cookie.ts+++ b/packages/core/src/shared/cookie.ts@@ -1,6 +1,5 @@-// Ported from packages/validation's ISetCookie, unchanged shape. This is-// the transport-agnostic type HttpCtx.setCookie exposes to every module, so-// a module depends on this instead of Elysia's cookie type directly.+// This is the transport-agnostic type HttpCtx.setCookie exposes to every+// module, so a module depends on this instead of Elysia's cookie type directly.export interface CookieOptions {maxAge?: number;diff --git a/packages/core/src/shared/errors.ts b/packages/core/src/shared/errors.tsindex d2b0e755a..12bf4459c 100644--- a/packages/core/src/shared/errors.ts+++ b/packages/core/src/shared/errors.ts@@ -1,6 +1,6 @@-// Ported from apps/api/src/utils/errors.ts. Transport-agnostic: HTTP, jobs-// and the Kafka consumer all throw and normalize through this, not through-// an rpc/-specific error type (see rpc/errors.ts for the TRPCError family).+// Ported from apps/api/src/utils/errors.ts. Transport-agnostic: HTTP, jobs and+// the Kafka consumer all throw and normalize through this, not through an+// rpc/-specific error type (see rpc/errors.ts for the TRPCError family).import { classifyDriverError } from './driver-errors';diff --git a/packages/core/src/shared/group-by-labels.ts b/packages/core/src/shared/group-by-labels.tsindex 660b7662d..67a79ae14 100644--- a/packages/core/src/shared/group-by-labels.ts+++ b/packages/core/src/shared/group-by-labels.ts@@ -1,4 +1,3 @@-// Moved from packages/common/src/group-by-labels.ts (ADR-007 shared/ layout).// Sole consumer: modules/chart/src/engine/fetch.ts.export interface ISerieDataItem {label_0: string | null | undefined;diff --git a/packages/core/src/shared/share-access.ts b/packages/core/src/shared/share-access.tsindex 6eef20e9c..1408bdabc 100644--- a/packages/core/src/shared/share-access.ts+++ b/packages/core/src/shared/share-access.ts@@ -1,8 +1,4 @@// Proof that a viewer entered the password of a password-protected share.-//-// Ported from packages/common/server/share-access.ts (main #510), with one-// change the layering forces: nothing in core reads `process.env` (R7), so the-// secret arrives as an argument instead of being read from COOKIE_SECRET here.import { createHmac, timingSafeEqual } from 'node:crypto';diff --git a/packages/core/src/slug-id.ts b/packages/core/src/slug-id.tsindex 750418425..1eb115b99 100644--- a/packages/core/src/slug-id.ts+++ b/packages/core/src/slug-id.ts@@ -1,6 +1,5 @@-// Slug-based primary-id generation for project/dashboard/organization rows.-// Moved from packages/db/src/services/id.service.ts — a sibling of-// shared/access-lookups.ts: needs @openpanel/db, so it stays out of+// Slug-based primary-id generation for project/dashboard/organization rows. A+// sibling of shared/access-lookups.ts: needs @openpanel/db, so it stays out of// shared/id.ts (the database-free id helpers).//// Postgres comes from the caller's scope (`deps.db`), not a lazydiff --git a/packages/seed/src/traffic.ts b/packages/seed/src/traffic.tsindex 9d2ed1ebe..81e0eea3b 100644--- a/packages/seed/src/traffic.ts+++ b/packages/seed/src/traffic.ts@@ -1,14 +1,11 @@// Turns an archetype's shape (hourly curve, weekday curve) into visitor counts// per day and per hour. Ported from openpanel-mock's opmock/internal/traffic.//-// The daily multiplier is a product of:-// trend slow growth/decline, anchored so "today" == 1.0-// walk a mean-reverting random walk across days (weeks drift)-// weekday the archetype's day-of-week curve-// noise small independent per-day jitter-// anomaly rare spike or dip days-// Everything is a pure function of (seed, key, day), so seeding twice gives-// the same curve.+// The daily multiplier is a product of: trend slow growth/decline, anchored so+// "today" == 1.0 walk a mean-reverting random walk across days (weeks drift)+// weekday the archetype's day-of-week curve noise small independent per-day+// jitter anomaly rare spike or dip days Everything is a pure function of (seed,+// key, day), so seeding twice gives the same curve.import { Rng } from './rng';diff --git a/packages/shared/src/date.ts b/packages/shared/src/date.tsindex 2e958fb1d..2caf38bb3 100644--- a/packages/shared/src/date.ts+++ b/packages/shared/src/date.ts@@ -1,6 +1,5 @@-// Generic date helpers (ADR-007 shared/ layout: "date"). Moved from-// packages/db/src/services/date.service.ts — pure Date/Luxon math, no-// ClickHouse or Postgres access.+// Generic date helpers (ADR-007 shared/ layout: "date"). Pure Date/Luxon math,+// no ClickHouse or Postgres access.//// `DateTime` and `getTime` moved here from packages/common/src/date.ts, which// was the workspace's only luxon declaration. This file is now the one placediff --git a/packages/shared/src/id.ts b/packages/shared/src/id.tsindex ffd3a6392..45254e2a1 100644--- a/packages/shared/src/id.ts+++ b/packages/shared/src/id.ts@@ -1,10 +1,9 @@-// Ported from packages/common's id.ts, then to @openpanel/shared — apps/start-// had copied `shortId` into its own utils/math.ts. nanoid/non-secure is-// deliberate: these are correlation/display ids, not secrets.+// apps/start had copied `shortId` into its own utils/math.ts. nanoid/non-secure+// is deliberate: these are correlation/display ids, not secrets.-// Ported from packages/common/server's id.ts. Regular `nanoid`, not the-// non-secure variant above: these ids back password-reset tokens and invite-// links, so they must stay cryptographically random.+// Regular `nanoid`, not the non-secure variant above: these ids back+// password-reset tokens and invite links, so they must stay cryptographically+// random.import { nanoid as secureNanoid } from 'nanoid';import { nanoid } from 'nanoid/non-secure';diff --git a/packages/shared/src/json.ts b/packages/shared/src/json.tsindex b18c17923..c2d94a5de 100644--- a/packages/shared/src/json.ts+++ b/packages/shared/src/json.ts@@ -1,10 +1,9 @@-// Ported from packages/json, then to @openpanel/shared: packages/redis and-// apps/start each carried a copy, and redis' copy carried the "keep in sync-// with packages/core" comment that is the whole argument for a package below-// both. Same semantics: getSafeJson never throws, and getSuperJson only hands-// off to superjson's parser when the payload looks like superjson's own `{-// json, meta }` envelope — a plain JSON payload round-trips through JSON.parse-// instead.+// packages/redis and apps/start each carried a copy, and redis' copy carried+// the "keep in sync with packages/core" comment that is the whole argument for+// a package below both. Same semantics: getSafeJson never throws, and+// getSuperJson only hands off to superjson's parser when the payload looks like+// superjson's own `{ json, meta }` envelope — a plain JSON payload round-trips+// through JSON.parse instead.import superjson from 'superjson';export function getSafeJson<T>(str: string): T | null {diff --git a/packages/shared/src/math.ts b/packages/shared/src/math.tsindex b29f0ef7a..371a21ace 100644--- a/packages/shared/src/math.ts+++ b/packages/shared/src/math.ts@@ -1,5 +1,3 @@-// Moved from packages/common/src/math.ts and-// packages/common/src/get-previous-metric.ts (ADR-007 shared/ layout).// `isFloat` does NOT come along: no importer, anywhere.//// `getPreviousMetric` left with the report vocabulary it returns — it isdiff --git a/packages/shared/src/object.ts b/packages/shared/src/object.tsindex 80e3e167c..7fc5ddade 100644--- a/packages/shared/src/object.ts+++ b/packages/shared/src/object.ts@@ -1,6 +1,5 @@-// Moved from packages/common/src/object.ts (ADR-007 shared/ layout). `toDots`-// is the ClickHouse property flattener — its invalid-surrogate strip is-// load-bearing on the insert path.+// `toDots` is the ClickHouse property flattener — its invalid-surrogate strip+// is load-bearing on the insert path.import { anyPass, assocPath, isEmpty, isNil, reject } from 'ramda';function isValidJsonString(value: string): boolean {diff --git a/packages/shared/src/slug.ts b/packages/shared/src/slug.tsindex 1964f3020..63a4aa50b 100644--- a/packages/shared/src/slug.ts+++ b/packages/shared/src/slug.ts@@ -1,4 +1,3 @@-// Moved from packages/common/src/slug.ts, then to @openpanel/shared —// apps/start carried a verbatim copy of it, which is deleted. Not to be// confused with core's slug-id.ts, which calls this.import _slugify from 'slugify';diff --git a/packages/shared/src/string.ts b/packages/shared/src/string.tsindex c0207d959..aee2527d7 100644--- a/packages/shared/src/string.ts+++ b/packages/shared/src/string.ts@@ -1,5 +1,3 @@-// Moved from packages/common/src/string.ts (ADR-007 shared/ layout).-export function stripTrailingSlash(url: string) {return url.replace(/\/+$/, '');}diff --git a/packages/shared/src/try-catch.ts b/packages/shared/src/try-catch.tsindex d12063dc8..f6fe0cefc 100644--- a/packages/shared/src/try-catch.ts+++ b/packages/shared/src/try-catch.ts@@ -1,5 +1,3 @@-// Ported from packages/common's try-catch.ts, unchanged.-export type TryCatchResult<T, E = Error> =| { ok: true; data: T; error: null }| { ok: false; data: null; error: E };diff --git a/packages/shared/src/url.ts b/packages/shared/src/url.tsindex 77b8077f0..3562834b4 100644--- a/packages/shared/src/url.ts+++ b/packages/shared/src/url.ts@@ -1,4 +1,3 @@-// Moved from packages/common/src/url.ts (ADR-007 shared/ layout).export function parseSearchParams(params: URLSearchParams): Record<string, string> | undefined {