Commit Graph

117 Commits

Author SHA1 Message Date
yuqei 69ce717ec6 feat: support runtime shared AI settings 2026-06-22 10:13:04 +08:00
yuqei 278bc28416 fix: fallback chat history when ai config missing 2026-06-21 19:15:21 +08:00
yuqei 17f5ada9f2 fix: normalize markdown contract content 2026-06-21 18:57:53 +08:00
yuqei 76b9198b64 fix: stabilize file downloads and file workspace 2026-06-21 17:56:16 +08:00
yuqei a89f4c7050 Refactor contract platform workflows and UI 2026-06-21 17:51:34 +08:00
cyuqei 93089e2a89 feat: add backend approval sla tracking 2026-06-19 18:07:16 +08:00
cyuqei ae76b9a296 feat: add lifecycle reminder workbench 2026-06-19 11:23:32 +08:00
cyuqei 5bb330b610 feat: enhance contract workflow and approval assignees 2026-06-19 01:57:26 +08:00
cyuqei 431ad08b8d fix: support shared AI SDK api prefix 2026-06-19 00:29:11 +08:00
cyuqei 175c0a69af feat: align deployment and approval workflow 2026-06-18 03:37:03 +08:00
yuqei 4f22e2965c feat: enhance contract review with semantic search and legal citations
Phase15 optimization:
- Add semantic search fallback in _attach_legal_article_refs()
- Expand LEGAL_ARTICLE_REFERENCE_RULES from 12 to 30+ scenarios
- Add LEGAL_SOURCE_ALIAS_MAP for 35+ legal sources

Contract review enhancement:
- Cover labor, corporate, investment, procurement, construction
- Add IP, data privacy, franchise, real estate scenarios
- Enable vector semantic search as final fallback

Legal citation visualization:
- Create LegalArticlePreview component with hover tooltip
- Support compact/full display modes
- Add copy and detail link features

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 22:09:27 +08:00
yuqei 6d2edc6753 feat: migrate PDF/OCR extraction to shared-ai-platform
Remove all local PDF/OCR extraction and quality gate logic from
review_service.py, replacing it with calls to the shared-ai-platform
document extraction service via the SDK.

Removed from review_service.py:
- 17 local PDF/OCR methods (_extract_text_from_pdf, _classify_pdf_source,
  _extract_text_from_pdf_with_ocr, _extract_text_from_image_with_ocr,
  _evaluate_ocr_quality, _looks_like_platform_review_report, etc.)
- All PDF/OCR constants (PDF_TEXT_PATTERN, PDF_NOISE_LINE_PATTERN,
  REPORT_PDF_MARKERS, OCR_GATE_*, PDF_SOURCE_KIND_*, etc.)
- Imports: pdfplumber, pypdfium2, pytesseract, PIL.Image

Added:
- extract_review_upload_text() now calls shared platform's
  client.extract_document_text() directly
- _detect_upload_type() retained locally for upload validation only
- Protocol methods extract_document_text, classify_pdf_source in client

Removed from requirements.txt: pdfplumber, pytesseract
Added to config: shared_ai_platform_document_extraction_enabled

Also includes prior changes:
- Model settings and chat history stabilization
- Mobile UI polish
- Governance launch-closure enhancements

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 11:09:13 +08:00
yuqei 19ed42c880 feat: add model settings and stabilize chat history 2026-06-10 18:57:22 +08:00
yuqei 6c37d72179 feat: complete governance launch-closure enhancements
- Governance release summaries with launch readiness indicators
- Workbench reviewer completion condition constraints
- Asset detail blocker status display
- Imports page post-import action guidance
- Backend test coverage for governance services
- Production deployment handoff documentation

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 10:00:55 +08:00
yuqei 739d2f51f9 feat: support image uploads in direct review flow
- accept png/jpg/jpeg in the uploaded-contract review path
- add local image OCR extraction and quality gating
- keep existing PDF/DOCX/TXT review behavior intact

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 19:42:15 +08:00
yuqei 1eae603c0f feat: refine core pc review and generation flows
- improve workspace and review entry UX for uploaded contracts
- stabilize shared AI Docker/frontend delivery path
- adapt shared AI generation to structured JSON responses

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:26:31 +08:00
yuqei 0cc597466c feat: enrich contract content assets and review UX
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 20:59:41 +08:00
yuqei f7c6d10928 fix: add missing get_review_report and get_review_result methods; redesign prompt-assets page UI
- Fix 500 error on /reviews/{id}/report endpoint caused by missing get_review_report
  and get_review_result methods in ReviewService
- Fix indentation bug in build_report_pdf and _build_report_pdf_fallback methods
- Redesign prompt-assets page: replace 3-column layout with KPI cards + full-width
  table + detail drawer + create/edit modal

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 02:22:45 +08:00
yuqei 8bb70c6faa fix: add missing _to_list_item and _to_detail methods to ReviewService 2026-06-01 00:09:38 +08:00
yuqei b229699c39 更新合同API、提示词资产服务及前端页面 2026-05-31 22:23:15 +08:00
yuqei 3ff384cbeb fix: add missing _context method to RemoteSharedAIPlatformClient 2026-05-31 15:48:24 +08:00
yuqei 323e7cf572 fix: handle missing template files gracefully at startup 2026-05-31 12:59:12 +08:00
yuqei b76a2baad2 feat: comprehensive platform improvements (P0-P2 + landing split)
- Split landing page into public landing page and authenticated workspace
- Extract contract generation logic into use-contract-generation hook
- Extract contract generation service into sub-services
- Add AI quality scoring for contract generation
- Expand risk rules library with employment-specific rules
- Add custom exception classes (NotFoundError, ValidationError, etc.)
- Add prompt asset seeding script from LexForge documentation
- Add format utility library
- Fix SSR hydration mismatch on Ant Design inputs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 17:39:27 +08:00
yuqei ea722e58eb Enhance contract generation governance 2026-05-28 11:01:57 +08:00
yuqei b5f4034328 Refine web governance and chat surfaces 2026-05-27 11:24:20 +08:00
yuqei 029fbfb5f6 Add UTF-8 safe Chinese template validation 2026-05-27 10:44:17 +08:00
yuqei 8d1615e1ed Harden mobile smoke and contract ownership rules 2026-05-27 09:48:35 +08:00
yuqei fcd9e9dbc2 Add contract version chain mobile workflow 2026-05-26 16:41:31 +08:00
yuqei 8a126a3808 backend: harden legal article references 2026-05-25 18:25:12 +08:00
yuqei e423063940 Fix chat stream product e2e blockers 2026-05-24 23:14:23 +08:00
yuqei 53e5eb3bba feat: add business auxiliary prompts 2026-05-24 16:13:38 +08:00
yuqei 8c21e3aaa4 feat: add specialized generation prompts 2026-05-24 15:57:28 +08:00
yuqei ca60ddf620 feat: add specialized review prompts 2026-05-24 15:31:19 +08:00
yuqei dfcc9ac28d feat: align remaining template defaults 2026-05-24 14:43:20 +08:00
yuqei 8b81011eb6 feat: seed remaining contract templates 2026-05-24 12:58:13 +08:00
yuqei ee9ba1d1c6 feat: add investment agreement defaults 2026-05-24 12:15:13 +08:00
yuqei 2276a7388b feat: add shareholder resolution document defaults 2026-05-24 10:45:16 +08:00
yuqei a530d55fa9 feat: add valuation adjustment document defaults 2026-05-24 10:25:22 +08:00
yuqei 1bc416da9d feat: add intercompany loan document type 2026-05-24 09:02:15 +08:00
yuqei 0d46a53e86 feat: support filtered legal article vectorization 2026-05-24 08:04:54 +08:00
yuqei 8a8be8d15d feat: expose legal article vectorization in kpis 2026-05-24 07:45:00 +08:00
yuqei 26fdac2c4d feat: add legal article semantic search 2026-05-24 01:39:49 +08:00
yuqei 95680516bb feat: add legal article semantic vectorization 2026-05-24 00:51:27 +08:00
yuqei f9c9389ca7 feat: add quality eval metrics to operation kpis 2026-05-24 00:05:20 +08:00
yuqei b037a08169 feat: add unified quality eval domain and ui 2026-05-23 23:50:36 +08:00
yuqei 4931de0abd feat: expand phase13 templates and phase14 batches 2026-05-23 20:48:53 +08:00
yuqei 546a51256f feat: complete legal source inventory gap report 2026-05-22 18:08:01 +08:00
yuqei ea1ba2c35b feat: add legal source diff review 2026-05-22 17:39:30 +08:00
yuqei ed2ce8a40d feat: absorb phase13 templates rules clauses 2026-05-22 11:30:37 +08:00
yuqei 462d12648f feat: seed default prompt assets 2026-05-22 09:44:05 +08:00