beb7f7f559
feat(asl): Implement full-text screening core LLM service and validation system (Day 1-3)
...
Core Components:
- PDFStorageService with Dify/OSS adapters
- LLM12FieldsService with Nougat-first + dual-model + 3-layer JSON parsing
- PromptBuilder for dynamic prompt assembly
- MedicalLogicValidator with 5 rules + fault tolerance
- EvidenceChainValidator for citation integrity
- ConflictDetectionService for dual-model comparison
Prompt Engineering:
- System Prompt (6601 chars, Section-Aware strategy)
- User Prompt template (PICOS context injection)
- JSON Schema (12 fields constraints)
- Cochrane standards (not loaded in MVP)
Key Innovations:
- 3-layer JSON parsing (JSON.parse + json-repair + code block extraction)
- Promise.allSettled for dual-model fault tolerance
- safeGetFieldValue for robust field extraction
- Mixed CN/EN token calculation
Integration Tests:
- integration-test.ts (full test)
- quick-test.ts (quick test)
- cached-result-test.ts (fault tolerance test)
Documentation Updates:
- Development record (Day 2-3 summary)
- Quality assurance strategy (full-text screening)
- Development plan (progress update)
- Module status (v1.1 update)
- Technical debt (10 new items)
Test Results:
- JSON parsing success rate: 100%
- Medical logic validation: 5/5 passed
- Dual-model parallel processing: OK
- Cost per PDF: CNY 0.10
Files: 238 changed, 14383 insertions(+), 32 deletions(-)
Docs: docs/03-涓氬姟妯″潡/ASL-AI鏅鸿兘鏂囩尞/05-寮€鍙戣褰?2025-11-22_Day2-Day3_LLM鏈嶅姟涓庨獙璇佺郴缁熷紑鍙?md
2025-11-22 22:21:12 +08:00
8eef9e0544
feat(asl): Complete Week 4 - Results display and Excel export with hybrid solution
...
Features:
- Backend statistics API (cloud-native Prisma aggregation)
- Results page with hybrid solution (AI consensus + human final decision)
- Excel export (frontend generation, zero disk write, cloud-native)
- PRISMA-style exclusion reason analysis with bar chart
- Batch selection and export (3 export methods)
- Fixed logic contradiction (inclusion does not show exclusion reason)
- Optimized table width (870px, no horizontal scroll)
Components:
- Backend: screeningController.ts - add getProjectStatistics API
- Frontend: ScreeningResults.tsx - complete results page (hybrid solution)
- Frontend: excelExport.ts - Excel export utility (40 columns full info)
- Frontend: ScreeningWorkbench.tsx - add navigation button
- Utils: get-test-projects.mjs - quick test tool
Architecture:
- Cloud-native: backend aggregation reduces network transfer
- Cloud-native: frontend Excel generation (zero file persistence)
- Reuse platform: global prisma instance, logger
- Performance: statistics API < 500ms, Excel export < 3s (1000 records)
Documentation:
- Update module status guide (add Week 4 features)
- Update task breakdown (mark Week 4 completed)
- Update API design spec (add statistics API)
- Update database design (add field usage notes)
- Create Week 4 development plan
- Create Week 4 completion report
- Create technical debt list
Test:
- End-to-end flow test passed
- All features verified
- Performance test passed
- Cloud-native compliance verified
Ref: Week 4 Development Plan
Scope: ASL Module MVP - Title Abstract Screening Results
Cloud-Native: Backend aggregation + Frontend Excel generation
2025-11-21 20:12:38 +08:00
2e8699c217
feat(asl): Week 2 Day 2 - Excel import with template download and intelligent dedup
...
Features:
- feat: Excel template generation and download (with examples)
- feat: Excel file parsing in memory (cloud-native, no disk write)
- feat: Field validation (title + abstract required)
- feat: Smart deduplication (DOI priority + Title fallback)
- feat: Literature preview table with statistics
- feat: Complete submission flow (create project + import literatures)
Components:
- feat: Create excelUtils.ts with full Excel processing toolkit
- feat: Enhance TitleScreeningSettings page with upload/preview/submit
- feat: Update API interface signatures and export unified aslApi object
Dependencies:
- chore: Add xlsx library for Excel file processing
Ref: Week 2 Frontend Development - Day 2
Scope: ASL Module MVP - Title Abstract Screening
Cloud-Native: Memory parsing, no file persistence
2025-11-19 10:24:47 +08:00
3634933ece
refactor(asl): ASL frontend architecture refactoring with left navigation
...
- feat: Create ASLLayout component with 7-module left navigation
- feat: Implement Title Screening Settings page with optimized PICOS layout
- feat: Add placeholder pages for Workbench and Results
- fix: Fix nested routing structure for React Router v6
- fix: Resolve Spin component warning in MainLayout
- fix: Add QueryClientProvider to App.tsx
- style: Optimize PICOS form layout (P+I left, C+O+S right)
- style: Align Inclusion/Exclusion criteria side-by-side
- docs: Add architecture refactoring and routing fix reports
Ref: Week 2 Frontend Development
Scope: ASL module MVP - Title Abstract Screening
2025-11-18 21:51:51 +08:00
e3e7e028e8
feat(platform): Complete platform infrastructure implementation and verification
...
Platform Infrastructure - 8 Core Modules Completed:
- Storage Service (LocalAdapter + OSSAdapter stub)
- Logging System (Winston + JSON format)
- Cache Service (MemoryCache + Redis stub)
- Async Job Queue (MemoryQueue + DatabaseQueue stub)
- Health Check Endpoints (liveness/readiness/detailed)
- Database Connection Pool (with Serverless optimization)
- Environment Configuration Management
- Monitoring Metrics (DB connections/memory/API)
Key Features:
- Adapter Pattern for zero-code environment switching
- Full backward compatibility with legacy modules
- 100% test coverage (all 8 modules verified)
- Complete documentation (11 docs updated)
Technical Improvements:
- Fixed duplicate /health route registration issue
- Fixed TypeScript interface export (export type)
- Installed winston dependency
- Added structured logging with context support
- Implemented graceful shutdown for Serverless
- Added connection pool optimization for SAE
Documentation Updates:
- Platform infrastructure planning (04-骞冲彴鍩虹璁炬柦瑙勫垝.md)
- Implementation report (2025-11-17-骞冲彴鍩虹璁炬柦瀹炴柦瀹屾垚鎶ュ憡.md)
- Verification report (2025-11-17-骞冲彴鍩虹璁炬柦楠岃瘉鎶ュ憡.md)
- Git commit guidelines (06-Git鎻愪氦瑙勮寖.md) - Added commit frequency rules
- Updated 3 core architecture documents
Code Statistics:
- New code: 2,532 lines
- New files: 22
- Updated files: 130+
- Test pass rate: 100% (8/8 modules)
Deployment Readiness:
- Local environment: 鉁?Ready
- Cloud environment: 馃攧 Needs OSS/Redis dependencies
Next Steps:
- Ready to start ASL module development
- Can directly use storage/logger/cache/jobQueue
Tested: Local verification 100% passed
Related: #Platform-Infrastructure
2025-11-18 08:00:41 +08:00
855d142fec
chore: add remaining test docs, scripts and temp files
...
- Add Git commit preparation checklist
- Add Phase testing guides and issue tracking
- Add utility scripts (env setup, test data initialization)
- Add temp migration SQL files (for reference)
- Update startup scripts and README
- Remove obsolete scripts
2025-11-16 15:44:55 +08:00
0fe6821a89
feat(frontend): add batch processing and review features
...
- Add batch processing API and mode
- Add deep read mode for full-text analysis
- Add document selector and switcher components
- Add review page with editorial and methodology assessment
- Add capacity indicator and usage info modal
- Add custom hooks for batch tasks and chat modes
- Update layouts and routing
- Add TypeScript types for chat features
2025-11-16 15:43:39 +08:00
AI Clinical Dev Team
348af7fee9
feat: add general chat feature (without project/agent concept)
2025-10-12 09:48:49 +08:00
AI Clinical Dev Team
be56c3d35d
fix: dropdown click issue
2025-10-11 18:05:28 +08:00
AI Clinical Dev Team
5e06a68189
fix: AgentChatPage conversation data extraction issue
2025-10-11 17:56:19 +08:00
AI Clinical Dev Team
35b0c396c3
fix: AgentChatPage dependencies and Spin component warning
2025-10-11 17:30:57 +08:00
AI Clinical Dev Team
60014b57b5
feat: complete Day 21-24 knowledge base features
...
- Day 21-22: fix CORS and file upload issues
- Day 23-24: implement @knowledge base search and conversation integration
- Backend: integrate Dify RAG into conversation system
- Frontend: load knowledge base list and @ reference feature
2025-10-11 17:08:12 +08:00
AI Clinical Dev Team
239c7ea85e
feat: Day 21-22 - knowledge base frontend completed, fix CORS and file upload issues
...
- Complete knowledge base list and detail pages
- Complete document upload component
- Fix CORS config (add PUT/DELETE method support)
- Fix file upload issues (disabled state and beforeUpload return value)
- Add detailed debug logs (cleaned up)
- Create Day 21-22 completion summary document
2025-10-11 15:40:12 +08:00
AI Clinical Dev Team
186ae55302
feat(frontend): Day 21 knowledge base management frontend completed
2025-10-11 12:48:26 +08:00
AI Clinical Dev Team
9acbb0ae2b
feat: complete Dify platform deployment (Day 18)
...
## Dify 閮ㄧ讲瀹屾垚 鉁?
### 瀹屾垚鐨勫伐浣?1. Docker 闀滃儚鍔犻€熷櫒閰嶇疆
- 閰嶇疆 5 涓浗鍐呴暅鍍忔簮
- 澶у箙鎻愬崌涓嬭浇閫熷害鍜屾垚鍔熺巼
2. Dify 闀滃儚鎷夊彇 (鍏?11 涓湇鍔?
- langgenius/dify-api:1.9.1
- langgenius/dify-web:1.9.1
- postgres, redis, weaviate, nginx 绛? - 鎬诲ぇ灏忕害 2GB锛岃€楁椂绾?15 鍒嗛挓
3. Dify 鏈嶅姟鍚姩
- 鉁?nginx (80/443)
- 鉁?api, worker, worker_beat
- 鉁?web (3000)
- 鉁?db (PostgreSQL), redis
- 鉁?weaviate (鍚戦噺鏁版嵁搴?
- 鉁?sandbox, plugin_daemon, ssrf_proxy
4. Dify 鍒濆鍖栭厤缃? - 鍒涘缓绠$悊鍛樿处鍙? - 鍒涘缓搴旂敤: AI Clinical Research
- 鑾峰彇 API Key: app-VZRn0vMXdmltEJkvatHVGv5j
5. 鍚庣鐜閰嶇疆
- DIFY_API_URL=http://localhost/v1
- DIFY_API_KEY 宸查厤缃?
### 鏂囨。鏇存柊
- 鏂板: docs/05-姣忔棩杩涘害/Day18-Dify閮ㄧ讲瀹屾垚.md
- 鏇存柊: docs/04-寮€鍙戣鍒?寮€鍙戦噷绋嬬.md (Day 18 鏍囪涓哄畬鎴?
### 涓嬩竴姝?Day 19-24: 鐭ヨ瘑搴撶郴缁熷紑鍙?- Dify 瀹㈡埛绔皝瑁?- 鐭ヨ瘑搴撶鐞?CRUD
- 鏂囨。涓婁紶涓庡鐞?- @鐭ヨ瘑搴撻泦鎴?- RAG 闂瓟楠岃瘉
---
Progress: 閲岀▼纰?1 (MVP) 85% -> 鐭ヨ瘑搴撶郴缁熷紑鍙戜腑
2025-10-11 08:58:41 +08:00
AI Clinical Dev Team
0f0940534f
fix: resolve black code block background and Ant Design warnings
...
Issue 1: Black background appearing in chat (CRITICAL)
- Cause: Using vscDarkPlus (dark theme) for code syntax highlighting
- Solution: Changed to oneLight (light theme) + custom styling
- Result: Code blocks now have light gray background matching UI
Issue 2: Ant Design deprecation warnings
- Removed deprecated 'popupClassName' from Select
- Removed deprecated 'overlayStyle' from Tooltip
- These warnings don't affect functionality but cleaned up console
Changes:
- MessageList.tsx: vscDarkPlus 鈫?oneLight + custom styles
- ModelSelector.tsx: Removed deprecated props
Test: Ask AI to write code, should see light-themed code blocks
2025-10-10 22:24:09 +08:00
AI Clinical Dev Team
2d51933aee
feat: maximize chat window size
...
Major layout optimizations to increase chat area:
1. MainLayout improvements:
- Remove Content padding/margin (was 24px + 24px = 48px wasted)
- Reduce Sider width from 280px to 240px
- Set Content overflow:hidden and flex layout
2. AgentChatPage improvements:
- Replace large Card header with compact toolbar (saved ~40px)
- Remove Card wrapper (saved border/padding)
- Direct div layout for chat area
3. Other pages:
- Added padding:24px to HomePage/KnowledgePage/HistoryPage
- Maintain consistent spacing for non-chat pages
Result: Chat window now occupies ~85% of screen height instead of ~33%
Verified working: AI responses, scrolling, and UI display
2025-10-10 22:01:09 +08:00
AI Clinical Dev Team
fdebb44859
fix: resolve conversation API issues
...
1. Fixed double data unwrapping in AgentChatPage
2. Fixed API URL in sendMessageStream (use relative path /api/v1)
Verified working: AI can now respond to messages
2025-10-10 21:52:10 +08:00
AI Clinical Dev Team
b9cb173eb6
fix: resolve double data unwrapping issue in API calls
...
Issue: projectApi and agentApi were unwrapping response.data twice:
1. request interceptor returns response.data
2. API functions returned response.data again (undefined)
This caused all API calls to fail silently with 'response.success' being undefined.
Fixed:
- projectApi: Removed redundant .data access
- agentApi: Removed redundant .data access
All API functions now correctly return the backend response:
{ success: true, data: [...] }
This fixes:
- '鑾峰彇椤圭洰鍒楄〃澶辫触' error on page load
- '鍒涘缓椤圭洰澶辫触' error when creating projects
- Any other API call failures
2025-10-10 21:33:38 +08:00
AI Clinical Dev Team
84bf1c86ab
feat: Day 14-17 - Frontend Chat Interface completed
...
Frontend:
- Create MessageList component with streaming animation
- Create MessageInput component with @knowledge base support
- Create ModelSelector component (DeepSeek/Qwen/Gemini)
- Implement conversationApi with SSE streaming
- Update AgentChatPage integrate all components
- Add Markdown rendering (react-markdown + remark-gfm)
- Add code highlighting (react-syntax-highlighter)
- Add vite-env.d.ts for environment variables
Features:
- Real-time streaming output with cursor animation
- Markdown and code block rendering
- Model switching (DeepSeek-V3, Qwen3-72B, Gemini Pro)
- @Knowledge base selector (UI ready)
- Auto-scroll to bottom
- Shift+Enter for new line, Enter to send
- Beautiful message bubble design
Build: Frontend build successfully (7.94s, 1.9MB)
New Files:
- components/chat/MessageList.tsx (170 lines)
- components/chat/MessageList.css (150 lines)
- components/chat/MessageInput.tsx (145 lines)
- components/chat/MessageInput.css (60 lines)
- components/chat/ModelSelector.tsx (110 lines)
- components/chat/ModelSelector.css (35 lines)
- api/conversationApi.ts (170 lines)
- src/vite-env.d.ts (9 lines)
Total: ~850 lines of new code
2025-10-10 20:52:30 +08:00
AI Clinical Dev Team
8afff23995
docs: Day 12-13 completion summary and milestone update
2025-10-10 20:33:18 +08:00
AI Clinical Dev Team
864a0b1906
feat: Day 10-11 - Agent Configuration System completed
...
Backend:
- Create agents.yaml config file with 12 agents definition
- Create Prompt templates for topic-evaluation agent
- Implement agentService.ts for loading and managing agent configs
- Create agentController.ts with CRUD operations
- Create agent routes (GET /agents, /agents/:id, etc.)
- Register agent routes in main server
Frontend:
- Create agentApi.ts service module
- Update AgentChatPage to dynamically load agent config from API
- Add loading state and error handling
- Display agent details (description, category, model)
Build: Both frontend and backend build successfully
2025-10-10 20:13:08 +08:00
AI Clinical Dev Team
b72167f73e
feat: Day 8-9 - Project Management API completed
...
Backend:
- Create project routes (GET, POST, PUT, DELETE)
- Implement projectController with CRUD operations
- Create projectService for database operations
- Add validation middleware for request validation
- Update Prisma schema (add background, researchType, deletedAt fields)
- Implement soft delete for projects
Frontend:
- Create projectApi service module
- Update useProjectStore with fetchProjects and loading state
- Connect ProjectSelector to real API with loading indicator
- Connect CreateProjectDialog to real API with error handling
- Connect EditProjectDialog to real API with loading state
- Add comprehensive error handling and user feedback
Build: Both frontend and backend build successfully
2025-10-10 19:38:49 +08:00
AI Clinical Dev Team
fef8feb9db
feat(frontend): Day 7 - frontend complete layout finished
2025-10-10 17:52:47 +08:00
AI Clinical Dev Team
6f451757f2
docs: optimize README navigation links
2025-10-10 17:44:15 +08:00
AI Clinical Dev Team
6fd15a14e0
docs(frontend): improve README documentation with detailed description of 12 agents
2025-10-10 17:37:55 +08:00
AI Clinical Dev Team
0805042e11
fix(frontend): update names of 12 agents
...
Update agent names according to PRD document:
1. Topic Evaluation Agent
2. Scientific Question Organizing Agent
3. PICOS Construction Agent
4. Observation Indicator Design Agent
5. CRF Development Agent
6. Sample Size Calculation Agent
7. Clinical Research Protocol Writing Agent
8. Paper Polishing Agent
9. Paper Translation Agent
10. Methodology Review Agent
11. Journal Methodology Review Agent
12. Journal Manuscript Review Agent
Updated files:
- MainLayout.tsx
- HomePage.tsx
- AgentPage.tsx
- frontend/README.md
2025-10-10 17:31:21 +08:00
AI Clinical Dev Team
f7a500bc79
feat(frontend): Day 6 - frontend basic architecture completed
2025-10-10 17:22:37 +08:00
AI Clinical Dev Team
fa5b8b48ec
feat(day4): complete environment setup - Docker services started successfully
2025-10-10 15:16:50 +08:00