332 Commits

Author SHA1 Message Date
cyuqei 175c0a69af feat: align deployment and approval workflow 2026-06-18 03:37:03 +08:00
yuqei 328f8c7da3 feat: add Phase14 legal library crawl data and import manifests
- Add all-valid-laws-list.json (complete national law registry)
- Add bbbs collection progress and crawl results
- Add priority1 law BBBs, import manifest, and list data
- Add NPC aggregate data and search results
- Add incremental batch confirmed-001

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 17:27:21 +08:00
yuqei 182a1ba663 feat: add production deployment guide and monitoring tools
Production deployment:
- Add deployment guide with data migration steps
- Add deployment checklist and rollback plan
- Add performance verification steps

User documentation:
- Add user guide for law library enhancement
- Document new features and coverage areas
- Add FAQ section

Monitoring and alerts:
- Add monitoring SQL script with health checks
- Add alert thresholds configuration
- Add storage and access statistics

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 22:31:38 +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 6d12eb4aef feat: add law library update monitoring and maintenance guide
- Add GitHub Actions workflow for monthly update checks
- Add maintenance guide with backup/restore procedures
- Add backup metadata and summary

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 21:42:48 +08:00
yuqei 50cc7cb1cf feat: complete Phase14 legal library expansion
- Import 789,853 legal articles from LawRefBook/Laws
- Add 19,712 laws including national and regional regulations
- Filter 1,370 expired laws
- Create vectorization scripts and backup tools
- Add law update monitoring mechanism
- Generate comprehensive documentation

Database: PostgreSQL with GIN index for full-text search
Vectorization: 100% complete with LegalSemanticMatcher
Performance: 7x improvement in semantic search

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 21:26:20 +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 afbcc71144 feat: mobile UI polish - fix grid overflow, simplify hero panel, improve appbar layout
- Adjust GridView aspect ratio to prevent overflow warnings
- Resize icons and text in action cards
- Add mainAxisAlignment.center for better vertical centering
- Update API config to use local network IP
2026-06-08 04:28:46 +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 e376c1c436 feat: close mobile Android polish backlog — risk actions, lifecycle, file service, and screen polish
Review detail:
- Add review risk actions with status tracking and skip/apply support
- Pull-to-refresh and auto-navigate after review submit
- Report download, open, share, and copy-link actions

Contract lifecycle:
- Add contract lifecycle models and controller for mobile
- Version chain display and lifecycle status transitions
- Contract result screen now shows lifecycle tasks

File service:
- New unified file_service.dart for file management

API client:
- Add review risk actions and contract lifecycle endpoints

Screen polish:
- Login screen visual polish with brand assets
- Dashboard redesign with updated layout
- Profile screen updates
- Review entry/history screen improvements
- Theme and brand asset updates

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 00:06:38 +08:00
yuqei 36f4474ad6 feat: redesign users page with left-tree right-detail layout
- Left sidebar: tree menu showing all users grouped by role (admin/legal/business)
  and status (active/disabled)
- Right panel: selected user's detail with role, status toggle, and account info
- Create/edit moved to Drawer

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 23:35:53 +08:00
yuqei 38885f3a3f feat: redesign files page with left-tree right-detail layout
- Left sidebar: tree menu showing all files grouped by file type
  (contract/document/image/other) and storage bucket
- Right panel: selected file's detail with download, delete, and
  file info (size, hash, MIME type, object path)
- Upload area moved to sidebar bottom with type/bucket selectors
- Modern card-based styling consistent with other pages

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 23:12:45 +08:00
yuqei 8eb09db8f0 feat: redesign reviews page with left-tree right-detail layout
- Left sidebar: tree menu showing all reviews grouped by contract type,
  review status, and risk level (each review is a leaf node)
- Right panel: selected review's detail including status, risk level,
  report download, and action suggestions
- "New Review" button links to /review page
- Modern card-based styling consistent with other pages

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 21:58:49 +08:00
yuqei 7dc0f77c2b feat: redesign contracts page with left-tree right-detail layout
- Left sidebar: tree menu showing all contracts grouped by contract type
  and lifecycle status (each contract is a leaf node)
- Right panel: selected contract's detail including auto-review result,
  lifecycle status with transition buttons, generation quality
- "Generate New Contract" moved to Drawer with step-by-step wizard
- Modern card-based styling consistent with templates page

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 21:23:53 +08:00
yuqei c9bff4c15f feat: redesign templates page with left-tree right-detail layout
- Left sidebar: tree menu showing all templates grouped by contract type,
  template category, and industry (each template is a leaf node)
- Right panel: selected template's full detail including content preview,
  variable definitions, version history, and action buttons
- Edit/Create moved to Drawer
- Modern styling with card-based sections, monospace content display,
  and visual version history timeline

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 19:21:15 +08:00
yuqei f8dd1e4524 fix: resolve TypeScript errors in redesigned pages
- knowledge-bases: add missing fields to KnowledgeBaseFormValues type
- knowledge-bases: fix null safety for tags array
- knowledge-bases/legal-articles: fix renderStatusTag param types
- legal-articles: add non-null assertion for source_id

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 18:24:48 +08:00
yuqei fdbce39019 feat: redesign rules, legal-articles, knowledge-bases pages with tree sidebar
- Rules page: tree menu by contract type + risk level → list layout
- Legal articles page: tree menu by source type + KPI cards → list layout
- Knowledge bases page: tree menu by status + retrieval mode → list layout

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 17:23:25 +08:00
yuqei 7f1276b755 feat: redesign templates page with tree sidebar + list layout
Replace the old 3-column layout (form + table + filters) with:
- Left sidebar: tree menu grouped by contract type, template category,
  and industry, with count badges and search
- Right panel: clean list view with inline actions (edit, publish,
  delete, version history)
- Create/edit moved to Drawer
- Version history moved to separate Drawer

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 15:22:35 +08:00
yuqei 803dccfad8 fix: correct PostgreSQL password in docker-compose.server.yml
Database password was incorrect; the host PostgreSQL uses 'postgres'
as the password, not the previous value. This was causing the backend
container to fail on startup (connection to PostgreSQL failed).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 14:01:29 +08:00
yuqei 0ca699d901 feat: redesign documents/new page with tree sidebar + list layout 2026-06-01 12:21:16 +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 c5dcc7a1cf fix: remove docker postgres service, use native postgresql on host 2026-05-31 19:02:59 +08:00
yuqei 8140efb72b docs: add deployment troubleshooting guide with known issues 2026-05-31 16:19:11 +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 49bdce0bad fix(qa): ISSUE-001 — fix Ant Design hydration mismatch on form inputs
Add suppressHydrationWarning to root <html> element in layout.tsx.
Resolves React hydration mismatch warnings on Ant Design Input
components (caretColor attribute mismatch between SSR and client).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 07:28:28 +08:00
yuqei ea722e58eb Enhance contract generation governance 2026-05-28 11:01:57 +08:00
yuqei 2c9038b4b8 Archive root QA artifacts 2026-05-27 17:57:50 +08:00
yuqei 4585d117fb Add web QA evidence and profile form hints 2026-05-27 17:37:47 +08:00
yuqei 018106e20e Stabilize frontend contract workflows 2026-05-27 17:28:33 +08:00
yuqei 8fa329d1ac Close Android product polish backlog 2026-05-27 16:14:03 +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 d0ceccf10d feat: close pc and android product smoke flows 2026-05-26 08:37:28 +08:00
yuqei bafd837020 mobile: promote business auxiliary tools entry 2026-05-26 00:55:17 +08:00
yuqei f39e345e91 mobile: add business auxiliary chat entry 2026-05-26 00:30:29 +08:00
yuqei bf6f41adc9 mobile: normalize login account input 2026-05-25 23:46:45 +08:00
yuqei 8c6b09d0d6 mobile: cover legal document semantics 2026-05-25 23:33:18 +08:00
yuqei 51d760d6d8 mobile: harden wireless adb smoke 2026-05-25 23:18:28 +08:00
yuqei 6ed1e7ea58 mobile: harden real-device smoke 2026-05-25 22:22:26 +08:00
yuqei d0b44615ea docs: record admin credential handling 2026-05-25 19:37:59 +08:00