feat(rag): add temporary chat attachments #18

Merged
TanWenyan merged 3 commits from wren-dev into main 2026-05-25 15:42:39 +08:00
Owner

Summary

  • Add temporary chat attachment APIs, parsing/indexing service, 7-day TTL metadata, and conversation/user/tenant isolation.
  • Merge uploaded attachment facts with formal RAG knowledge retrieval so answers can cite both uploaded files and the configured knowledge base.
  • Enforce document type and govdoc route grants, and update the frontend submodule pointer.

Test Plan

  • pytest tests/test_rag_chat_streaming_sources.py tests/test_rag_chat_attachment_service.py tests/test_govdoc_permissions.py tests/test_document_type_permissions.py tests/test_rule_write_scope.py
  • node --test tests/govdoc-audit/chat-input-composer-ui.test.mts tests/govdoc-audit/chat-attachment-isolation.test.mts tests/govdoc-audit/tenants-ui.test.mts tests/govdoc-audit/session-user.test.mts tests/govdoc-audit/settings-menu-permission.test.mts
  • npm run lint -- components/dify-chat/chat-input.tsx components/dify-chat/chat-message.tsx components/dify-chat/index.tsx app/api/chat-messages/route.ts app/api/chat-attachments/route.ts app/api/chat-attachments/[attachmentId]/route.ts tests/govdoc-audit/chat-input-composer-ui.test.mts app/(audit)/tenants/TenantsClient.tsx tests/govdoc-audit/tenants-ui.test.mts
  • git diff --check
  • git -C legal-platform-frontend diff --check
## Summary - Add temporary chat attachment APIs, parsing/indexing service, 7-day TTL metadata, and conversation/user/tenant isolation. - Merge uploaded attachment facts with formal RAG knowledge retrieval so answers can cite both uploaded files and the configured knowledge base. - Enforce document type and govdoc route grants, and update the frontend submodule pointer. ## Test Plan - pytest tests/test_rag_chat_streaming_sources.py tests/test_rag_chat_attachment_service.py tests/test_govdoc_permissions.py tests/test_document_type_permissions.py tests/test_rule_write_scope.py - node --test tests/govdoc-audit/chat-input-composer-ui.test.mts tests/govdoc-audit/chat-attachment-isolation.test.mts tests/govdoc-audit/tenants-ui.test.mts tests/govdoc-audit/session-user.test.mts tests/govdoc-audit/settings-menu-permission.test.mts - npm run lint -- components/dify-chat/chat-input.tsx components/dify-chat/chat-message.tsx components/dify-chat/index.tsx app/api/chat-messages/route.ts app/api/chat-attachments/route.ts app/api/chat-attachments/[attachmentId]/route.ts tests/govdoc-audit/chat-input-composer-ui.test.mts app/(audit)/tenants/TenantsClient.tsx tests/govdoc-audit/tenants-ui.test.mts - git diff --check - git -C legal-platform-frontend diff --check
TanWenyan added 3 commits 2026-05-25 15:39:13 +08:00
TanWenyan merged commit 719a4075e5 into main 2026-05-25 15:42:39 +08:00
Sign in to join this conversation.