- C端测试账号与Token.md: permanent test user c-test-001 + 24h JWT
- Fix Active Recall 404 test assertion
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- NEW test/m-ai-01-09-api-e2e.worker-int-spec.ts: real HTTP endpoints
with JWT auth → Controller → BullMQ → Worker → MySQL
- Feynman: POST /api/ai-analysis/feynman (200/401/400)
- Active Recall: POST /api/active-recalls/:id/submit (200/401/404)
- Document Import: POST /api/imports (200/401)
- generateJWT() in integration-harness.ts (TokenService format)
- httpPost() supports optional Bearer token
- Save test credentials to devops-projects/凭据配置/测试API凭据.md
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- SIGKILL: enqueue job BEFORE kill, wait for pickup, verify recovery
- Document Import: track before/after KnowledgeItem IDs to prove
Worker created them (not direct DB INSERT)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Worker consumes from BullMQ Redis, not MySQL polling.
Replace all dbExec(INSERT INTO AiAnalysisJob) with enqueueJob()
which uses real BullMQ Queue.add() to the test Redis.
Add setRedisConfig() + enqueueJob() to integration harness.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- User INSERT: add updatedAt=NOW() (NOT NULL, no default)
- AiAnalysisJob: retryCount→progress (column doesn't exist)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- NEW test/helpers/mock-ai-provider.ts: Mock AI HTTP server with
normal/timeout/429/500/invalid-json behavior controls
- NEW test/helpers/integration-harness.ts: spawn real API/Worker
processes, HTTP helpers, PrismaClient-based DB helpers
- NEW test/m-ai-01-09.worker-int-spec.ts: real integration test
using actual MySQL/Redis/BullMQ/HTTP (Active Recall, Feynman,
Document Import, SIGKILL recovery, provider faults, idempotency)
- NEW test/jest-worker-integration.json: Jest config with NO mocks
- DELETE test/m-ai-01-09.e2e-spec.ts: removed mock-based pseudo-e2e
- UPDATE test/run-integration-ci.sh: uses real integration config
- UPDATE package.json: test:integration:worker uses real config
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- TestingModule.compile() returns an application context directly
- Use $executeRaw tagged template instead of $executeRawUnsafe
- Add jest.setTimeout(30000) for integration tests
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- test/m-ai-01-09-integration.spec.ts: Active Recall/Feynman/Document Import
E2E tests with real MySQL/Redis/BullMQ
- test/run-integration-ci.sh: CI script (MySQL→Prisma→Build→API→Worker→Test)
- npm run test:integration:worker: one-command integration test
- Includes Active Recall chain audit (actual code paths with file:line)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Notification jobs are triggered implicitly by notifyJobComplete() during
Active Recall analysis, not by a dedicated test endpoint. Script now
checks Worker logs and DB records instead.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
H0-01: Reject Apple login mock fallback in production
H0-02: Protect /internal/* with InternalAuthGuard (X-Internal-API-Key)
H0-03: JwtAuthGuard check user status (deletedAt, status)
H0-04: Refresh token check user status + revoke all on deleted
H0-05: User/admin JWT isolation (type=user/admin, enforce ADMIN_JWT_ACCESS_SECRET)
H0-06: Add DTOs for import/source/learning-session controllers
H0-07: 22 E2E tests (h0.e2e-spec.ts), 5 iOS integration docs
Tests: 47/47 (H0 22 + M0 25), no regression.
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>
- 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>
- 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>