f20bdc0d7a
feat: add conversation management — sessionId + X-Hermes-Session-Id + CRUD
Deploy API Server / build-and-deploy (push) Successful in 37s
2026-05-22 10:43:18 +08:00
3b42a8618a
refactor: remove hardcoded system prompt — let Hermes handle natively
Deploy API Server / build-and-deploy (push) Successful in 40s
2026-05-22 10:28:41 +08:00
c2e8f92abe
refactor: remove DeepSeek fallback — Hermes only; fail fast on error
Deploy API Server / build-and-deploy (push) Successful in 39s
2026-05-22 10:10:11 +08:00
6413936472
ci: fix missing DATABASE_URL env for prisma migrate
Deploy API Server / build-and-deploy (push) Successful in 35s
2026-05-22 10:08:24 +08:00
ea7f6736df
ci: add NestJS build + deploy — npm ci + prisma + nest build + rsync + restart
Deploy API Server / build-and-deploy (push) Failing after 23s
2026-05-22 10:04:47 +08:00
WangDL
34774e5325
fix: type cast messages for DeepSeekProvider compatibility
Deploy API Server / build-and-deploy (push) Successful in 12s
2026-05-22 00:28:12 +08:00
WangDL
a550ce2e67
feat: route admin chat through Hermes Agent API (DeepSeek fallback)
Deploy API Server / build-and-deploy (push) Successful in 11s
2026-05-22 00:20:34 +08:00
WangDL
2b0bc92ebb
feat: add hermes dashboard config endpoint to admin-ai-chat
Deploy API Server / build-and-deploy (push) Successful in 12s
2026-05-22 00:02:14 +08:00
WangDL
f2d1c16299
fix: correct AdminRole import path in admin-ai-chat controller
Deploy API Server / build-and-deploy (push) Successful in 9s
2026-05-21 23:58:56 +08:00
WangDL
017d78a8d6
fix: add admin-ai-chat module + fix AdminUsersModule PasswordService dependency
Deploy API Server / build-and-deploy (push) Successful in 11s
2026-05-21 23:57:59 +08:00
b8a1fb0921
feat: add admin backend modules — dashboard, audit-log, admin-users
...
Deploy API Server / build-and-deploy (push) Successful in 10s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:22:48 +08:00
5a7c21dd60
feat: implement complete admin authentication system
...
Deploy API Server / build-and-deploy (push) Successful in 9s
- Add AdminRole enum (SUPER_ADMIN/ADMIN/OPERATIONS/DEVELOPER/READONLY) with hierarchy
- Add PasswordService (bcryptjs, 12 rounds), AdminTokenService (type=admin JWT)
- Add AdminAuthService: login/lockout/refresh/logout with audit logging
- Add AdminAuthController: /admin-api/auth/{login,refresh,logout,me}
- Add AdminAuthGuard: validates type=admin, user status, session, lockout
- Add AdminRolesGuard + @AdminRoles() decorator for RBAC
- Add AdminAuditService for audit log persistence
- Add AdminLoginRateLimit (10 req/15min per IP)
- Add prisma/seed.ts for SUPER_ADMIN initialization via env vars
- Update JwtAuthGuard to skip /admin-api/* and /internal/* paths
- Update main.ts to exclude admin-api/internal from global 'api' prefix
- Update jwt.config.ts with admin JWT secrets and expiry config
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:05:31 +08:00
e5c6113b25
feat: add admin_users, admin_sessions, admin_audit_logs tables
...
Deploy API Server / build-and-deploy (push) Successful in 13s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:39:38 +08:00
69dbf24237
simplify CI: remove Docker deploy, keep only RAG Worker + health
...
Deploy API Server / build-and-deploy (push) Successful in 10s
API runs via systemd on port 3000, Docker deployment not needed yet.
Health check now targets the actual running API.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:30:59 +08:00
1fb6dd4929
fix: Dockerfile build arg for prisma generate + cleanup deploy
...
Deploy API Server / build-and-deploy (push) Failing after 1m42s
- Add ARG DATABASE_URL to Dockerfile so prisma generate works at build time
- Fix env file path (/opt/zhixi/env/ not /etc/zhixi/)
- Fix MySQL container name (mysql, not mysql-zhixi)
- Use correct DB name (zhixi_prod)
- Prevent duplicate mysql/redis containers from docker compose
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:25:35 +08:00
c64dc9c95a
fix: correct .env.production path for Docker container
...
Deploy API Server / build-and-deploy (push) Failing after 59s
/opt/zhixi/env/.env.production, not /etc/zhixi/.env.production
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:20:54 +08:00
b00c320496
fix: target prod runner (runs-on: prod) instead of ubuntu-latest
...
Deploy API Server / build-and-deploy (push) Failing after 3m44s
Root cause: deploy.yml used runs-on: ubuntu-latest, which matched
the 4C4G web runner instead of the 8C32G prod runner. The web runner
doesn't have access to /opt/zhixi/, systemd, or Docker.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:11:02 +08:00
2d6c02609e
fix CI: correct Gitea URL (10.2.0.7:3000) + sudo for systemctl
...
Deploy API Server / build-and-deploy (push) Failing after 7s
Root cause: git clone http://localhost:3000 failed because port 3000
is NestJS, not Gitea. Use internal network URL instead.
Also add sudo to privileged commands and set -e to fail fast.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:57:16 +08:00
744f2118a8
fix: User=ubuntu in service file, simplify CI deploy step
...
Deploy API Server / build-and-deploy (push) Failing after 7s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:51:43 +08:00
7f70d0c78f
fix: remove ExecStartPre, use systemd-run for optional self-test
...
Deploy API Server / build-and-deploy (push) Failing after 8s
Service file is now minimal (no startup script dependency).
CI step verifies reranker importability via systemd-run on host.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:38:23 +08:00
88a2162b62
fix systemd: use startup.sh instead of inline ExecStartPre
...
Deploy API Server / build-and-deploy (push) Failing after 7s
Multi-line Python in ExecStartPre is invalid systemd syntax.
Extract pip install + reranker self-test into startup.sh.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:32:22 +08:00
e0110fd8f8
fix CI: move Python deps + reranker test to systemd ExecStartPre
...
Deploy API Server / build-and-deploy (push) Failing after 8s
Runner container lacks Python 3.11, so pip install and self-test
now run as ExecStartPre in zhixi-worker.service on the host.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:25:52 +08:00
9c8bd59620
add RAG Worker deploy + reranker test to CI/CD
...
Deploy API Server / build-and-deploy (push) Failing after 7s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:07:15 +08:00
c9882c8d04
add rerank module + bug fixes from e2e test
...
Deploy API Server / build-and-deploy (push) Successful in 15s
- New reranker.py: SiliconFlow bge-reranker-v2-m3 integration
- config.py: add RERANK_MODEL
- api_client.py: fix get_next_job/claim_job/get_job_detail unwrapping
- candidate_generator.py: fix .format() conflict with JSON braces
- import_pipeline.py: fix file existence check + UUID point IDs
- Add .gitignore for __pycache__
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 16:05:09 +08:00
1947a0c0d5
revert: remove Agent View config from README and delete AI_BACKEND_WORKSPACE
...
Deploy API Server / build-and-deploy (push) Successful in 15s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 13:37:59 +08:00
536f406b73
docs: add AI Backend workspace template and For AI Agents section to README
...
Deploy API Server / build-and-deploy (push) Successful in 14s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 10:59:04 +08:00
WangDL
7e1f5c0e9b
fix: 内部 RAG API 标记 @Public 绕过 JWT 认证
Deploy API Server / build-and-deploy (push) Successful in 56s
2026-05-19 22:39:05 +08:00
WangDL
a0fafd0452
fix: TypeScript null check for RAG internal controller
Deploy API Server / build-and-deploy (push) Successful in 55s
2026-05-19 22:36:18 +08:00
WangDL
fbdae9078f
feat: Python RAG Worker + NestJS 内部 API(文档解析/切片/embedding/Qdrant/候选生成)
Deploy API Server / build-and-deploy (push) Failing after 22s
2026-05-19 22:35:12 +08:00
WangDL
c149b96b04
fix: 完善 DocumentImport 仓库,支持新字段
Deploy API Server / build-and-deploy (push) Successful in 55s
2026-05-19 22:21:47 +08:00
WangDL
9c161db26b
feat: KnowledgeSource 和 ImportCandidate 模块
Deploy API Server / build-and-deploy (push) Failing after 22s
2026-05-19 22:20:29 +08:00
WangDL
1e7e4268ab
feat: 知识库新表 migration SQL
Deploy API Server / build-and-deploy (push) Successful in 57s
2026-05-19 22:14:55 +08:00
WangDL
df56a76079
feat: 知识库新模型 — KnowledgeSource/KnowledgeChunk/ImportCandidate/BackupJob/MembershipPlan
Deploy API Server / build-and-deploy (push) Successful in 1m16s
2026-05-19 22:09:44 +08:00
6db19c8ac8
fix: COS region changed from ap-guangzhou to ap-beijing
...
Deploy API Server / build-and-deploy (push) Successful in 59s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 16:35:04 +08:00
01df2453d7
fix: add global /api prefix to match nginx proxy; exclude health endpoint
...
Deploy API Server / build-and-deploy (push) Successful in 54s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:29:36 +08:00
4b11010c65
fix: use double quotes for MYSQL_PASS variable expansion in mysql exec
...
Deploy API Server / build-and-deploy (push) Successful in 15s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:26:03 +08:00
90b07179a3
fix: remove Dockerfile auto-resolve to prevent restart loop; deploy script handles cleanup
...
Deploy API Server / build-and-deploy (push) Failing after 15s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:22:53 +08:00
ebcace0baf
fix: auto-resolve failed Prisma migration on container startup
...
Deploy API Server / build-and-deploy (push) Failing after 16s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:14:27 +08:00
6488049923
fix: resolve failed Prisma migration — cleanup partial state before re-deploy
...
Deploy API Server / build-and-deploy (push) Failing after 15s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:00:59 +08:00
9e5fb7cb40
fix: add backend health check + HTTPS nginx config with SSL support
Deploy API Server / build-and-deploy (push) Failing after 12s
2026-05-18 14:44:39 +08:00
33f1cc1859
feat: P2 infrastructure — Docker Compose, shutdown hooks, Prisma migration
...
Deploy API Server / build-and-deploy (push) Failing after 1m1s
- B20: docker-compose.yml with MySQL 8.0, Redis 7, API, BullMQ Worker, Nginx
- B20: Dockerfile.worker + worker.module.ts + worker.main.ts for standalone worker
- B20: nginx/nginx.conf reverse proxy with gzip, /api/* routes, health check
- B21: app.enableShutdownHooks() in main.ts for graceful SIGTERM handling
- B22: migration adding objectKey/bucket to UploadedFile, AiUsageLog, WaitlistEntry
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:50:59 +08:00
82fcaa1f2f
fix: replace RateLimitService with global RateLimitGuard
...
Deploy API Server / build-and-deploy (push) Successful in 59s
RateLimitService could not be injected into feature modules due to
NestJS DI module isolation. Replaced with a global Guard that uses
@RateLimit() decorator metadata to apply per-endpoint limits.
- RateLimitGuard: checks Redis counters, throws 429 on exceed
- Decorators: LoginRateLimit, FeedbackRateLimit, AiAnalysisRateLimit,
FileUploadRateLimit
- Applied to: auth (login), feedback, ai-analysis, files endpoints
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:23:19 +08:00
b1a6160d29
feat: implement P1 async — AI analysis + document import via BullMQ workers
...
Deploy API Server / build-and-deploy (push) Successful in 59s
B12: AI analysis now async — POST /ai-analysis queues job, returns immediately.
Worker supports both active-recall and feynman-evaluation types.
B13: DocumentImportWorker fully implemented — all processing moved from
service to worker. Service only queues and returns.
B14: NotificationWorker already complete (no changes needed).
B15: All 3 workers now fully functional.
New endpoint: GET /ai-analysis/jobs/:id for job status polling.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:17:06 +08:00
597c7b2310
feat: implement P1 AI workflows (B7-B10)
...
Deploy API Server / build-and-deploy (push) Successful in 59s
B7 Feynman evaluation: POST /ai-analysis/feynman
B8 Knowledge import: replaces DocumentImport setTimeout mock with AI
B9 Review card generation: POST /reviews/generate-cards
B10 Learning trend analysis: GET /activity/trend
4 workflows, 4 prompts, 4 schemas, all registered in AiModule.
AiAnalysisRepository made generic to handle varied result shapes.
DocumentImportService now calls KnowledgeImportWorkflow + saves to DB.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:07:57 +08:00
bced62c8f6
fix: add missing redis client connect call in onModuleInit
...
Deploy API Server / build-and-deploy (push) Successful in 58s
ioredis with lazyConnect: true requires explicit .connect() — without it
the client never connects and isHealthy() always returns false.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 23:00:11 +08:00
3137d58a5d
fix: 移除 FilesService 中的 RateLimitService 注入
...
Deploy API Server / build-and-deploy (push) Successful in 56s
RateLimitService 未在 @Global Module 中,feature module 无法注入。
限流后续通过 Guard/Interceptor 统一处理。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:52:27 +08:00
ca90d34b22
fix: 将 RateLimitService 注入从 StorageService 移到 FilesService
...
Deploy API Server / build-and-deploy (push) Failing after 56s
StorageService 在 @Global StorageModule 中,无法注入 AppModule 的 RateLimitService。
将限流调用上移到 FilesService.requestUploadUrl 中。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:50:31 +08:00
c30f7cdb63
fix: Docker CMD 添加 prisma migrate deploy,启动时自动应用迁移
...
Deploy API Server / build-and-deploy (push) Failing after 2s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:43:19 +08:00
6d7cbffc3b
feat: COS 对象存储接入 — CosStorageProvider + FilesModule
...
Deploy API Server / build-and-deploy (push) Failing after 3m0s
- 安装 cos-nodejs-sdk-v5,封装 CosStorageProvider(upload/download/delete/healthCheck)
- 重写 StorageService,新增 createUploadUrl/verifyUpload/getDownloadUrl/deleteObject
- 创建 FilesModule:POST /files/upload-url, POST /files/complete, GET /files/:id, DELETE /files/:id
- UploadedFile 新增 objectKey/bucket 字段
- 对象键格式 {userId}/{YYYYMM}/{sanitizedName}.{ext}
- 接入文件类型校验(ALLOWED_FILE_TYPES)+ 上传限流(10次/小时/用户)
- 配置文件 cos.longde.cloud → zhixi-1259685406 / ap-guangzhou
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:30:14 +08:00
08f31dd5b6
feat: P0 后端补全 — BullMQ Workers 注册 + 用户 Profile API + 角色权限
...
- AppModule 注册 3 个 BullMQ Workers (AiAnalysis/DocumentImport/Notification)
- Users 模块新增 GET/PATCH /users/me/profile 端点:
- GET 读取 UserProfile (learningIdentity, learningDirection, bio, currentGoal)
- PATCH upsert UserProfile
- GET /users/me 返回 profile + preferences (include join)
- 新增 RolesGuard + @Roles() 装饰器 (UserRole enum)
- QueueModule/QueueService 改进
- 各模块 controller/repository/service 完善
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 19:08:07 +08:00