211 Commits

Author SHA1 Message Date
052cd5cba8 feat: M2-02 — Workspace + KnowledgeBase + Folder management
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 11s
- Workspace + KnowledgeFolder Prisma models
- Folder CRUD: create/list/update/delete (soft-delete with children)
- Content Safety integration for KB title on create/update
- E2E: KB create, folder CRUD, admin KB list

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:23:58 +08:00
292e7e5638 feat: M2-01 — User & Account deepening, membership + deletion + devices
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 33s
- UserDevice + AccountDeletionRequest Prisma models
- CAPI: membership query, deletion request/cancel, device list/remove
- AAPI: membership assign, deletion approve/reject, device view

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:18:56 +08:00
14eaad53c3 fix: auto-aggregate AI costs hourly instead of manual-only
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 33s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:13:02 +08:00
eb62868e8f feat: M1-06 — Quota/Cost closing, AI cost aggregation + reports + CSV export
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 39s
- CostAggregationService: AiUsageLog → CostDailySummary daily aggregation
- AAPI: cost report by provider/model/daily trend, CSV export, top consumers
- Manual aggregation trigger endpoint

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 11:03:52 +08:00
809f125107 feat: M1-05 — Observability deepening, AI + Worker performance metrics
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 39s
- GET /admin-api/metrics/ai — AI调用耗时按provider/模型分组
- GET /admin-api/metrics/worker — Worker任务按队列统计成功率
- Admin page: AI performance + Worker performance tabs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:56:36 +08:00
a08fd4970a feat: M1-04 — Content Safety deepening, reports CAPI, violation records
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 39s
- Add ViolationRecord table (Prisma + migration)
- CAPI POST /api/reports for user report submission
- AAPI reports list + handle, violations list + penalty apply
- Admin page: reports management + violation records tabs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:53:19 +08:00
90c27ee979 fix: don't crash on startup when SECRET_MASTER_KEY is not set in production
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 40s
Changed getMasterKey() from throwing Error at module load time to logging
a critical console.error, so the app can still start without the env var.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:46:20 +08:00
a5a592988a fix: idempotent migration SQL + cleanup failed M1 tables in CI
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 33s
- Use CREATE TABLE IF NOT EXISTS + INSERT IGNORE for M1 tables
- Add ModelRoute/ProviderConfig/FallbackEvent to CI cleanup step
- Fixes P3018 migration error from partially-applied first run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:44:06 +08:00
14824a3609 fix: regenerate package-lock.json with prisma dependency restored
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 28s
npm ci was failing because prisma was missing from the lockfile after
adding @qdrant/js-client-rest. Reinstalled to rebuild from package.json.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:34:48 +08:00
af800b2eb5 fix: TypeScript build errors — RedisService.keys(), eventBus void, Qdrant API
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 22s
- Add keys() method to RedisService for WorkerHeartbeat
- Wrap eventBus.publish() calls in try/catch (returns void)
- Fix Qdrant createPayloadIndex API signature (2 args, not 3)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:22:56 +08:00
5fd737967f feat: M1-01~03 — AI Gateway deepening, Vector module, Task Queue deepening
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 23s
M1-01 AI Gateway:
- DB-driven ModelRoute/ProviderConfig/FallbackEvent tables
- ModelRouter rewrite with loadFromDb() hot-reload
- Fallback event recording + AIUsageRecorded event publishing
- Admin AAPI: routes CRUD, provider enable/disable, fallback events log

M1-02 Vector & Retrieval:
- VectorService with Qdrant client (upsert/delete/search/rerank)
- Admin AAPI: collection status, vector count, reindex trigger

M1-03 Task Queue:
- 16 task types with default retry/timeout configs
- Task stats dashboard, worker status panel, batch retry endpoint

M0 audit fixes:
- ApiMetric retention policy (30-day cleanup)
- Content Safety integration in Files module
- Queue registration centralized (domain-events)
- SECRET_MASTER_KEY production validation

E2E tests:
- M0: 28 smoke tests covering all 14 M0 issues
- M1: 16 tests covering M1-01/02/03
- Mock infrastructure: prisma, ioredis, jose, bullmq, qdrant

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 10:18:07 +08:00
d32411760f feat: M0-12 Secret & Vendor Asset — AES-256-GCM encrypted key storage + Admin AAPI
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 38s
2026-05-23 20:36:39 +08:00
628bb31c98 fix: clean migrations — single working file for UserMembership+QuotaUsage+CostDailySummary
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 39s
2026-05-23 20:30:02 +08:00
2a3f55c58e fix: simplify dashboard — skip missing tables
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 22s
2026-05-23 20:28:10 +08:00
28ff67c69e fix: BigInt for sizeBytes
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 1s
2026-05-23 20:26:44 +08:00
6aa24cc5bb fix: dashboard safe queries for missing tables + workflow prisma generate
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 20:26:34 +08:00
fd1897d385 feat: M0-11 — QuotaService + Redis deduction + Admin AAPI + CostDailySummary + UserMembership
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 21s
2026-05-23 20:13:49 +08:00
d88233fd5b feat: M0-10 — audit log for manual task retry
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 39s
2026-05-23 20:08:54 +08:00
7a31bd3702 fix: revert AdminAuditService to PrismaService — queue not available in auth module
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 41s
2026-05-23 19:57:43 +08:00
b5d5fb357f ci: add prisma generate step after deploy
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 41s
2026-05-23 19:54:11 +08:00
903474b7c2 fix: eventBus at end of params
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 35s
2026-05-23 19:48:18 +08:00
7c1e439c3b fix: reorder optional params
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 19:48:06 +08:00
466acc7e83 fix: return empty string when queue unavailable
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 19:47:55 +08:00
ad0e4f397a fix: break circular dependency between EventBusService and QueueService
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 19:47:40 +08:00
99d03bb26c feat: M0-10 — TaskLog table + task events + retry audit
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 32s
2026-05-23 19:29:08 +08:00
2c6d56bcfc feat: M0-10 — Task types enum + worker heartbeat + Domain Events for tasks
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 40s
2026-05-23 19:27:46 +08:00
9244db05b4 feat: M0-09 — BullMQ cleanup queue + Domain Events + async COS delete
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 35s
2026-05-23 09:47:30 +08:00
7eb7427817 fix: use hard delete
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 40s
2026-05-23 09:44:39 +08:00
8d08b0ed9c fix: remove deletedAt filter
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:44:32 +08:00
32be0d8831 feat: M0-09 admin files AAPI
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:44:19 +08:00
d3ec1d52d6 fix: move event publish inside retry loop
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 38s
2026-05-23 09:43:01 +08:00
e7cbe6da26 feat: M0-08 — Domain Event publish on AI usage + EventBus injection
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 17s
2026-05-23 09:42:29 +08:00
908ffc7041 fix: add model field to SiliconFlow usage
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 38s
2026-05-23 09:39:27 +08:00
f8a9ae224e fix: await grouping
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:39:18 +08:00
22f6668077 fix: remove duplicate fields
Some checks are pending
Deploy API Server / build-and-deploy (push) Has started running
2026-05-23 09:39:10 +08:00
9501231148 fix: optional chaining on safetyCheck
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 1s
2026-05-23 09:38:47 +08:00
d4913a58a9 fix: remove duplicate contentSafety param
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:38:38 +08:00
22132410a2 feat: M0-08 — SiliconFlow provider + Content Safety integration + dynamic config
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 17s
2026-05-23 09:38:09 +08:00
577b2c7abe fix: rename controller in module
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 38s
2026-05-23 09:35:18 +08:00
8b3f463d34 fix: simplify AI Gateway controller
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:35:10 +08:00
5cd4e1ec5a feat: M0-08 admin AI Gateway status AAPI
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-23 09:34:55 +08:00
2bd416c807 feat: M0-07 Observability — MetricsInterceptor + admin metrics AAPI
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 36s
2026-05-22 23:19:31 +08:00
c7052ee48e fix: ThrottlerStorage v6 interface again
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 37s
2026-05-22 23:16:06 +08:00
178225f212 fix: last duplicate
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 17s
2026-05-22 23:15:48 +08:00
52ae413c19 fix: remove duplicate TimeoutInterceptor import
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 17s
2026-05-22 23:15:24 +08:00
966bda8b26 fix: restore AppModule class declaration
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-22 23:15:12 +08:00
2f979a7048 fix: duplicate TimeoutInterceptor
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 18s
2026-05-22 23:13:50 +08:00
ec78330773 fix: remove duplicate AdminThrottleModule
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 19s
2026-05-22 23:13:17 +08:00
e8eeae55df fix: remove duplicate ContentSafetyModule import
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-22 23:13:02 +08:00
504861c5a1 fix: app.module dedup
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled
2026-05-22 23:12:49 +08:00