- import-candidate: explicit any[] type for safeCandidates
- growth: date→activityDate (actual DailyLearningActivity field name)
- review: Number(rating) for SM-2 math, remove easeFactor from updateCard call
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- GrowthService: streak calculation from DailyLearningActivity
- Recommendations: focus items, due review cards, new knowledge items
- New API: GET /api/activity/streak, GET /api/activity/recommendations
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Publish AIAnalysisCompleted domain event after each AI analysis
- Auto-generate FocusItems from AI-identified weaknesses
- Review Engine subscribes to AIAnalysisCompleted to create ReviewCards
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- SystemKnowledgeBaseSeed: auto-creates built-in 新手引导知识库
- Content Safety check on candidate accept() and createCandidates()
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Same issue as KnowledgeBaseService — NestJS can't resolve
ContentSafetyService in RagChatModule without @Optional().
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Artifact base model for future FlashcardSet/Quiz/StudyGuide
- KnowledgeItem.learnable boolean (default true) for M3 LearningSession
- Admin AAPI: GET candidates (by status/kbId), GET items (by kbId)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- ImportStepLog model for tracking each import pipeline step
- Admin AAPI: import list, detail with step logs, retry failed
- Admin page: ImportMonitor with drawer detail view
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Direct app verified healthy — code works. CI script bugs fixed:
- kill/wait of background process returns 143 (SIGTERM), now ignored
- systemd start failure is non-fatal since direct run validated
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Runs node dist/main.js in background, polls localhost:3000/api for up
to 30s. If app crashes, prints startup log. This definitively
identifies whether it's a code error or systemd timeout issue.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
VectorService.onModuleInit() was blocking NestJS startup trying to
connect to Qdrant, causing systemd restart timeout. Changed to lazy
initialization: Qdrant client connects on first actual request only.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The rootDir approach caused cascading TypeScript compilation issues.
Instead, the CI now detects whether nest build outputs to dist/src/main.js
and moves it to dist/main.js automatically.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The NestJS build was outputting to dist/src/main.js instead of dist/main.js
due to TypeScript's automatic rootDir calculation. Explicit rootDir: "src"
ensures the output is always at dist/main.js.
Also remove the test-run debugging step from CI.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
NestJS couldn't resolve ContentSafetyService because ContentSafetyModule
is not imported in KnowledgeBaseModule, causing app startup crash.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- SourceReference model for artifact→chunk→source citation chain
- Admin source list + reference tracing endpoints
- Existing KnowledgeSource already covers Material status/version
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 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>
- 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>
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>
- 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>
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>
- 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>