Files
ai-contract-platform/mobile/STATUS.md
T
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

68 KiB

Mobile scaffold status

Created on 2026-04-18.

  • Flutter scaffold added under mobile/
  • Android-first app shell uses bottom navigation for core V1 flows
  • Theme, asset folders, config placeholders, and lightweight session/network placeholders are ready for follow-up work
  • Backend integration, generated Flutter platform folders, and real assets are intentionally not included yet

Auth/session progress

  • apiBaseUrl is now pointed at local Android emulator backend routing (http://10.0.2.2:8000/api/v1)
  • http dependency added for real API calls
  • Mobile login flow now calls /auth/login
  • Current-user sync now calls /auth/me
  • Session state now hydrates from secure storage on app start and automatically migrates any legacy SharedPreferences session blob forward
  • In-memory session state continues to broadcast through ValueNotifier
  • App shell now gates the main tabs behind a login screen when no session exists
  • Dashboard and profile now reflect real login/session state instead of pure placeholder copy

Review entry progress

  • review_entry_screen.dart is now a real editable form instead of placeholder blocks
  • The mobile side now captures:
    • contract text
    • contract type
    • review side (party_a / party_b)
    • optional file attachment
  • A draft/request model is defined in features/review/domain/review_draft.dart
  • A submission controller is defined in features/review/application/review_submission_controller.dart
  • Current submit action now goes through ReviewDraft -> ReviewSubmissionController -> ApiClient.submitReview()
  • /reviews now supports text-only, file-only, or text+file submission from the mobile draft/controller structure
  • File selection UI is present, but still depends on Flutter/file_picker runtime validation in a real mobile environment

Review history progress

  • ApiClient.fetchReviewHistory() now calls GET /reviews with the current bearer token
  • A list-domain model is defined in features/review_history/domain/review_history_item.dart
  • A history controller is defined in features/review_history/application/review_history_controller.dart
  • review_history_screen.dart now loads and renders real list data for the current signed-in user
  • The mobile side can now form a basic path of login -> submit review -> view review history

Review detail/result progress

  • ApiClient.fetchReviewDetail() now calls GET /reviews/{review_id}
  • ApiClient.fetchReviewResult() now calls GET /reviews/{review_id}/result
  • features/review_history/domain/review_detail.dart and review_result_summary.dart provide the detail/result/report models
  • review_detail_controller.dart now loads task detail first and, for completed / partial, also loads result summary and report metadata
  • review_history_screen.dart can navigate from a list item into the detail/result screen
  • review_detail_screen.dart now renders task information, text preview, result summary, risk distribution, clause/risk counts, review opinion, and report metadata
  • Report flow now supports local download, direct open, system share, and copy-link action through a dedicated report controller
  • Mobile chat now has a first Review -> Chat flow: detail page can open a context-aware review assistant screen and stream answers from /chat/stream
  • The chat screen carries review_context, preserves conversation_id for continuous follow-up, and shows source cards plus a legal-use disclaimer
  • Dashboard now exposes an independent legal Q&A entry that reuses the same streaming chat surface without review_context
  • Chat now loads /conversations history and can reopen prior conversation detail, so independent法律问答和审查追问都具备基础历史恢复能力
  • Contract generation now has a mobile surface: template list, variable form, preview, generate, result display, and local file actions
  • Contract generation history is now visible on mobile with keyword search, contract-type filtering, pagination, and reopen-to-detail flow
  • Review detail can now jump into contract generation with review-derived prefill so title/type/risk/advice can land in matching template variables
  • Contract generation history can now reopen a prior result into the builder for continued editing and re-generation
  • Contract builder now lets the user switch export format (docx/pdf/html/txt) before preview and generation
  • Generated contract result screen can also continue editing from the current generated payload instead of forcing the user back to the history list
  • Legal-document drafting is now wired into mobile:
    • /legal-document-types and /legal-document-drafts are now reachable from the app
    • the AI工具 tab now exposes a legal-document workspace alongside contract generation
    • document types, element schemas, drafts, validation, and generate-from-draft are modeled on the client
    • focused tests now cover the new legal-document models and controller flows
  • Legal-document drafting now accepts review-context handoff from review detail:
    • review detail shows a dedicated 起草法律文书 entry point
    • the legal-document type list pre-fills its search query from the review result recommendation
    • the legal-document builder pre-fills title and matching schema fields from the review result
    • focused tests now cover LegalDocumentReviewContext mapping plus the type-list/builder handoff
    • validation completed with flutter analyze --no-pub, flutter test --no-pub, and flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • mobile/tools/real-device-smoke.ps1 -ConfigureDevice -SmokeDepth documents-workspace is still blocked by wireless ADB discovery on the current machine (SMOKE_BLOCKER=wireless_adb_unavailable)
    • the refreshed wireless-debug port 192.168.3.93:35593 passed documents-workspace smoke on the real device with SMOKE_OK=True
  • Chat bubbles now surface source relevance when available, and will explicitly warn when a round returns no directly citeable sources
  • Legal chat steadiness is now stronger on mobile:
    • assistant bubbles classify the answer into 已引用来源 / 通用建议 / 结论不确定 / 需补充资料
    • explicit no-answer wording now renders as a clearer refusal state instead of a generic fallback warning
    • no-source or guidance-only rounds now show a structured explanation with suggested next steps
    • the source panel is now grouped into 直接来源 and 辅助提示, with expandable evidence cards and simple relevance labels
  • The detail screen now supports pull-to-refresh and app-bar refresh for status/result/report updates after submit
  • Review submit success now auto-navigates into the newly created detail page

Current limitation

  • Server-backed mobile login is now validated against 192.168.3.90; remaining runtime uncertainty is mainly around system-level open/share handlers on the emulator image
  • File upload support is now validated on ai-contract-platform-lite-api34; the current ai-contract-platform-atd34 image still lacks a file explorer that can answer ACTION_OPEN_DOCUMENT, so attachment picking remains device-image dependent rather than app-logic dependent
  • Report flow now downloads correctly from the deployed server, but emulator-side open/share still depends on which external handlers are available on the current device image
  • 独立法律问答入口和合同生成入口已经纳入底部 AI工具 Tab,当前剩余的是移动端在真机上的系统级 handler 兼容性
  • 合同生成已经有历史、筛选、预填和继续编辑,现在也接入了模板分类 / 行业入口筛选;后续还可以继续收口独立预览恢复参数的承接细节
  • Brand/image assets are still placeholders; asset constants are intentionally nulled until real png/svg resources are added

Contract taxonomy mobile upgrade (2026-05-25)

  • Mobile contract templates now carry template_category and industry_category through the model and API layer.
  • The contract template workspace now filters by contract type, template category, and industry entry, while the cards show all three taxonomy tags.
  • Contract builder, generated result, and history tiles now surface the same taxonomy labels for easier matching and continuation.
  • Focused mobile tests now cover taxonomy parsing and the controller forwarding the new filter params.
  • Validation completed locally:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device smoke is back online on the wireless X60PRO:
    • connected serial: 192.168.3.93:43033
    • adb reports the app in signed_in_shell
    • tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SkipInstall -SmokeDepth shell-only returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-25T15-35-15-258/
  • The smoke helper now also has a contract-taxonomy depth, and it passed on the same device:
    • contract workbench was opened from AI tools
    • template filters were applied to legal_opinion + nda
    • filtered results stayed active and excluded property_service
    • tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SkipInstall -SmokeDepth contract-taxonomy returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-25T15-51-23-045/
  • Android true-device validation continued on the wireless X60PRO:
    • connected serial: 192.168.3.93:44421
    • tools/real-device-smoke.ps1 now supports -DeviceSerial for known wireless-debug ports
    • reconnect and smoke helpers now wait for the wireless serial to reach adb state device, so a transient offline session is reported as a wireless ADB blocker instead of an app-surface failure
    • documents-workspace now passes through signed-in shell -> AI tools -> legal-document workspace -> type list -> builder
    • legal-document type cards, builder primary actions, and draft actions now expose stable semantic labels for accessibility and automation
    • widget tests now lock the legal-document workspace and builder semantic labels through injectable controllers, so the Android smoke markers are guarded locally before device runs
    • tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:44421 -ConfigureDevice -SkipInstall -SmokeDepth documents-workspace -LoginAccount <member-account> -LoginPassword <member-password> returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-25T21-26-28-369/
    • current wireless-debug serial rotated again to 192.168.3.93:38491; the first rerun hit adb offline, so the reconnect/smoke helpers were hardened to wait for the serial to reach device before continuing
    • the latest documents-workspace retry on 192.168.3.93:38491 now exits cleanly with SMOKE_BLOCKER=wireless_adb_unavailable instead of an app-surface misfire, which makes the remaining issue explicit
    • the next wireless-debug serial was 192.168.3.93:45167; the app relaunched into the login form and surfaced that the Chinese IME entered the email domain separator as 。, so mobile login now normalizes full-width account punctuation before calling the API
    • after installing the rebuilt APK, tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:45167 -ConfigureDevice -SmokeDepth documents-workspace -LoginAccount <member-account> -LoginPassword <member-password> returned SMOKE_OK=True with DOCUMENTS_WORKSPACE_READY=True, DOCUMENTS_TYPE_LIST_OK=True, and DOCUMENTS_BUILDER_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-25T23-44-09-374/
    • the general mobile legal-chat entry now also exposes 4 business_auxiliary quick prompts:
      • 履约义务提取
      • 工商/备案材料清单
      • 谈判策略
      • 法律意见书强边界兜底
    • ReviewChatScreen now supports controller injection so widget tests can verify the mobile Chat product entry without hitting live APIs
    • the AI工具 header now promotes the same business-auxiliary launch strip above the embedded chat, so the mobile entry point is visible before the user scrolls into the conversation area
    • focused validation now covers both the routing keywords and the mobile UI exposure of the 4 business auxiliary entries:
      • flutter test --no-pub test/features/chat/domain/review_chat_context_test.dart test/features/chat/presentation/review_chat_screen_test.dart test/features/tools/presentation/tools_hub_screen_test.dart
    • full mobile validation passed again:
      • flutter analyze --no-pub
      • flutter test --no-pub
      • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • tools/real-device-smoke.ps1 now supports a business-auxiliary depth for the mobile Chat product entry
    • the first business-auxiliary real-device retry was blocked by wireless ADB churn again: adb mdns services returned no _adb-tls-connect endpoint and the previous 192.168.3.93:45167 port refused connection
    • latest blocker artifact: mobile/qa-artifacts/real-device-smoke/2026-05-26T00-26-51-814/

Phase 0/1 mobile structure progress

  • project-docs/移动端开发方案-2026-05-01.md now records the mobile product scope, IA, phased plan, and acceptance criteria
  • App shell now separates unauthenticated login from the signed-in bottom-navigation experience
  • Bottom navigation metadata is centralized in app/navigation/app_router.dart
  • Login screen no longer pre-fills demo credentials and now has basic local validation, loading state, password visibility toggle, and a productized hero
  • Dashboard now reads real review history and shows recent review counts, in-progress counts, high-risk counts, quick actions, and latest tasks
  • Profile now hides API diagnostics unless MOBILE_SHOW_DIAGNOSTICS=true
  • Review labels are centralized in shared/constants/review_labels.dart so mobile pages show Chinese contract types, statuses, risk levels, source types, and review sides
  • Review submission now validates file extension and 20MB maximum size before uploading
  • API exceptions now carry HTTP status codes; review list/detail/submission clear local session on 401/403

Verification note

  • flutter analyze passed
  • flutter test passed
  • flutter build apk --debug --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood produced build/app/outputs/flutter-apk/app-debug.apk
  • Android emulator tooling is installed locally and the lightweight ai-contract-platform-atd34 AVD now boots successfully

Runtime validation update (2026-05-03)

  • Runtime validation used ai-contract-platform-atd34 against http://192.168.3.90:8001/api/v1
  • Login succeeded on-device and the session persisted after reinstall
  • Text-only review submission succeeded and auto-opened detail for review-369b53d5ecf1
  • Review history and review detail both rendered the new task correctly
  • Independent legal Q&A succeeded: a quick-prompt message created a new conversation record and returned a two-message session in /conversations
  • Review-context chat succeeded: follow-up messages were sent, streaming answers returned, source cards rendered, and history conversations were recorded
  • Contract generation succeeded end-to-end: template selection, variable fill, preview, and generate all passed; a generated file named 保密协议标准模板_20260503_125037.docx was returned on-device
  • Report download URL normalization was fixed in shared/network/api_client.dart; the report link now resolves to http://192.168.3.90:8001/api/v1/reviews/review-369b53d5ecf1/report/download
  • Report download was verified on-device and saved to /data/user/0/com.example.ai_contract_mobile/app_flutter/review_reports/review-report-review-369b53d5ecf1.pdf
  • Generated-contract download was verified on-device and saved to /data/user/0/com.example.ai_contract_mobile/app_flutter/generated_contracts/保密协议标准模板_20260503_125037.docx
  • Review attachment picking no longer throws an unhandled crash in app code; on the current ATD image the plugin returns invalid_format_type because no system file explorer is installed, and the UI now stays on-page with a friendly retry message
  • Review attachment picking was fully validated on ai-contract-platform-lite-api34: mobile-upload.txt was selected through DocumentsUI, cached by file_picker, and rendered back in the mobile review form
  • A real wireless Android device is now paired and reusable for dogfooding (model=M20201419, device=X60PRO, Android 11)
  • tools/reconnect-wireless-device.ps1 can now re-discover the current _adb-tls-connect mDNS endpoint, reconnect the phone, and re-apply long screen timeout / stay-awake settings
  • On the real device, DocumentsUI opens successfully and the app-side file picker no longer crashes; the current remaining friction is OEM-specific picker interaction plus wireless ADB instability during long unattended runs
  • Real-device attachment selection now succeeds end-to-end when the OEM picker receives an explicit select-confirm interaction; mobile-upload.txt was loaded through DocumentsUI, cached by file_picker, and rendered back into the mobile review form
  • Real-device report download was validated for member data: review-report-review-59c9d1a83e63.pdf downloaded to /data/user/0/com.example.ai_contract_mobile/app_flutter/review_reports/review-report-review-59c9d1a83e63.pdf
  • Real-device report open now hands the PDF off to an external viewer app; on this device the default handler is com.feimi.browser rather than a dedicated PDF app
  • Real-device contract download was validated for member data: 保密协议标准模板_20260503_125037.docx downloaded to /data/user/0/com.example.ai_contract_mobile/app_flutter/generated_contracts/保密协议标准模板_20260503_125037.docx
  • Real-device contract share now escalates into WeChat's chat target (com.tencent.mm/.ui.chatting.ChattingUI), which confirms system-level share handoff on this OEM build
  • Mobile review history, review detail, generated-contract history, and contract template loading now keep the last successful data set on transient non-auth failures instead of clearing the screen immediately
  • tools/reconnect-wireless-device.ps1 now retries mDNS discovery before failing, which reduces the number of manual reconnect attempts needed after the device rotates its wireless debug port
  • Remaining runtime edge: on the no-window ATD emulator, external viewer/share-target behavior is still device-image dependent, so open/share can be invoked but not yet fully asserted as a stable automated oracle

Runtime validation update (2026-05-04)

  • Runtime validation continued on the paired real device (model=M20201419, device=X60PRO, Android 11) against http://192.168.3.90:8001/api/v1
  • tools/reconnect-wireless-device.ps1 -ExpectedIp 192.168.3. -ConfigureDevice successfully rediscovered and reconnected the rotated wireless-debug endpoint (192.168.3.93:42823)
  • Server reachability was rechecked before validation; both http://192.168.3.90:8001/health and http://192.168.3.90:3003/ returned 200
  • A freshly seeded member session resumed correctly on-device and rendered the workbench header for Mobile Member · member
  • Member review history revalidation passed: the real device rendered review review-eecc2296519a with completed status, service contract type, party_a, and medium risk
  • Member review detail revalidation passed: the real device opened review-eecc2296519a, rendered the result summary, and exposed the report actions for review-report-review-eecc2296519a.pdf
  • Report share system handoff is now fully evidenced on the real device:
    • the app surfaced 已调起系统分享
    • Android raised android/com.android.internal.app.ChooserActivity
    • the chooser preview attached review-report-review-eecc2296519a.pdf
    • the chooser offered share targets including 发送给朋友, 添加到微信收藏, 打印, and 电子邮件
  • Member contract-history revalidation passed on-device:
    • the generated-contract history section rendered normally
    • the seeded item 保密协议标准模板_20260504_052610.docx appeared under 已生成合同历史
    • opening the history item reached the generated-result screen with file metadata, plus 继续编辑 / 下载合同 / 打开文件 / 分享合同
  • Session persistence is no longer plain SharedPreferences only:
    • SessionStore now writes to flutter_secure_storage
    • legacy SharedPreferences sessions are migrated forward on first hydrate
    • targeted unit coverage now locks both secure-storage hydration and legacy-session migration
  • Post-migration validation passed again:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • A new unattended helper now exists for real-device dogfooding:
    • tools/real-device-smoke.ps1 reconnects wireless ADB, checks server health, relaunches the app, captures dumpsys activity top plus uiautomator XML, and writes a timestamped artifact bundle
    • this reduces the amount of manual phone babysitting needed for routine “is the device still reachable and does the app still launch?” checks
  • tools/real-device-smoke.ps1 now supports smoke-depth profiles:
    • login-only for auth-entrypoint checks
    • shell-only for unattended signed-in shell checks
    • share-proof for deeper report-share chooser evidence on the proven X60PRO real-device profile
    • documents-workspace for deeper proof of the legal-document workspace entrypoint
  • The depth profiles have now been exercised on the real device:
    • login-only returned SMOKE_OK=True
    • shell-only returned SMOKE_OK=True
    • share-proof returned SMOKE_OK=True, SHARE_CHOOSER_ACTIVITY=android/com.android.internal.app.ChooserActivity, and SHARE_PDF_PREVIEW_OK=True
  • documents-workspace currently reaches the workspace and type-list surface on a seeded signed-in session; the builder pass was later closed with a device-side SMOKE_OK=True run, and the current blocker is wireless ADB availability on the rotated wireless-debug serial
  • Lightweight notification infrastructure is now in place:
    • flutter_local_notifications drives local notifications
    • workmanager registers periodic review-status polling on signed-in Android sessions
    • review submissions are added to a persistent watchlist
    • review history loads seed additional pending reviews into that watchlist
    • contract generation now emits a completion notification immediately
    • tapping a review notification routes back to review detail
    • tapping a contract notification routes back to generated contract detail
  • Notification implementation validation passed at code/build level:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Chat steadiness validation passed at code/build level:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Information architecture is now more formal for user-side AI workflows:
    • bottom navigation now includes a first-class AI工具 tab
    • 法律问答 and 合同生成 are no longer hidden only behind dashboard shortcuts
    • the new tools tab uses an in-place segmented switch, so both capabilities are promoted without overcrowding the bottom navigation
    • dashboard shortcuts still exist, but now jump into the dedicated tools tab instead of opening them as only workbench-level shortcuts
  • Brand and UI polish moved a step closer to a product surface:
    • BrandAssets now provides a shared palette, gradient hero band, and reusable brand mark
    • login was rewritten around the branded hero surface instead of the earlier placeholder shell
    • the dashboard now uses a cleaner action grid and a more productized workbench hero
    • the new AI工具 first-class entry now has its own hero and clearer switch surface, instead of reading like a debug container
  • Real-device runtime evidence for background scheduling exists:
    • adb shell dumpsys jobscheduler now shows com.example.ai_contract_mobile/androidx.work.impl.background.systemjob.SystemJobService
  • Remaining unattended-device wrinkle:
    • after reinstall, this OEM build can still surface a lockscreen/SystemUI overlay during smoke, so real-device-smoke.ps1 may produce a false negative even when MainActivity is already top-most in dumpsys activity top
  • Current Phase 6 status: the remaining runtime risk is no longer the report-share path itself; the major residual instability is still OEM wireless-ADB churn during long unattended sessions

UI cleanup update (2026-05-04)

  • Remaining visible mojibake in the main mobile workflow has now been cleaned from:
    • review labels
    • profile
    • review history
    • review detail
    • contract template list
    • contract builder
    • generated contract result
  • Product-surface polish continues to land in the core mobile flow:
    • login uses the branded hero surface and shared palette
    • dashboard uses a more productized action grid instead of a plain action list
    • the first-class AI工具 tab now sits inside the same visual language as login and workbench
  • Post-cleanup validation passed again:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Shell-level regression coverage is now stronger:
    • app_shell_test.dart verifies the first-class AI工具 tab is visible for authenticated users
    • app_shell_test.dart also verifies the dashboard quick action for 合同生成 correctly jumps into the dedicated tools hub
  • Real-device smoke reporting is now clearer:
    • real-device-smoke.ps1 explicitly reports SMOKE_BLOCKER=device_locked when OEM keyguard/pattern unlock blocks unattended validation
    • real-device-smoke.ps1 also reports SMOKE_BLOCKER=login_required when reinstall/relaunch drops the app back to the login shell instead of the authenticated workbench
    • this avoids treating current lockscreen overlays as a generic unknown smoke failure
  • We also tried extending smoke toward unattended auto-login:
    • backend credentials for the seeded mobile member are still valid
    • the current blocker is the OEM input method on this phone, which mutates adb input text enough to make unattended credential entry unreliable
    • for now, login_required is still the honest result when the app falls back to the login shell
  • The strengthened shell and smoke tooling passed together:
    • flutter test --no-pub test/app_shell_test.dart
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • real-device-smoke.ps1 -SmokeDepth shell-only now exits with a precise environment blocker when the phone is still pattern-locked

Real-device dogfood revisit (2026-05-04)

  • After the keyboard-avoidance login fix, the updated APK was reinstalled on the real device and manual login succeeded
  • Workbench dogfood passed on-device:
    • the branded workbench hero rendered
    • the bottom navigation now shows 5 tabs, including the first-class AI工具 entry
    • the workbench quick-action grid is visible on-device instead of the older plain action list
  • AI工具 dogfood passed on-device:
    • entering the tab opened the dedicated AI tools surface
    • the hero band and segmented switch rendered correctly
    • tapping 合同生成 successfully switched the embedded tool view away from legal chat
  • Review-detail dogfood passed on-device:
    • the history tab opened a completed review detail successfully
    • task metadata and result summary rendered on the updated product surface
    • the updated review-detail layout remained readable on the real device without the earlier mojibake-heavy copy
  • Profile dogfood passed on-device:
    • the 我的 tab opened the refreshed account surface successfully
    • account identity, role, tenant, and status rendered on the updated product surface
  • The remaining weak spot in this revisit is contract-history deep reopening inside the embedded 合同生成 tool view:
    • the formal tools entry and contract-generation switch render correctly on-device
    • but the revisit session repeatedly bounced between history/detail and tools surfaces before the history-result reopen could be re-proven in the same pass

Contract workspace refinement (2026-05-04)

  • The mobile contract-generation surface was restructured away from the old “template cards endlessly stacked down the page” layout
  • 合同生成 now behaves more like a compact workspace:
    • 开始生成
    • 历史结果 are now separated into clearer work areas instead of being flattened into one long scroll
  • Template cards were tightened into more scannable compact surfaces, and the history-result cards now present 查看结果 / 继续编辑 as their own focused actions
  • Code/build validation passed after the contract-workspace restructuring:
    • flutter analyze --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood

Shared AI + admin snapshot update (2026-05-04)

  • The mobile plan's remaining P2 management-assist slice is now implemented in a lightweight form:
    • Profile shows Shared AI runtime status
    • admin sessions now get a read-only management snapshot
    • the snapshot aggregates knowledge-base status, template availability, audit activity, and governance queue summary
  • The backend now exposes:
    • /api/v1/system/shared-ai
    • /api/v1/system/admin-snapshot
  • Shared AI knowledge-base routing is now tighter:
    • backend shared-ai SDK no longer emits an empty bearer header when api_key is blank
    • remote shared-ai test deployment now uses a concrete SHARED_AI_PLATFORM_API_KEY
    • the deploy script now ensures the ai-contract-platform app registry/scopes exist on the shared-ai side
  • Remote web validation now confirms:
    • /knowledge-bases can show Hybrid retrieval mode for shared-ai-backed KBs
    • /profile continues to show Remote preferred + hybrid
  • New validation pass:
    • pytest tests/test_system_api.py tests/test_shared_ai_platform_client.py tests/test_knowledge_bases_api.py
    • flutter analyze --no-pub
    • flutter test --no-pub
  • Current plan status:
    • P0 complete
    • P1 complete
    • P2 functional scope now complete in lightweight delivery form
    • remaining risk is primarily environment/runtime stability, not missing product features from the mobile plan

Contract history real-device closure (2026-05-04)

  • Rebuilt and reinstalled the latest debug APK onto the real device:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • adb -s 192.168.3.93:39787 install -r D:\ai-contract-platform\mobile\build\app\outputs\flutter-apk\app-debug.apk
  • Real-device contract-history validation is now fully closed inside AI工具 -> 合同生成 -> 历史结果:
    • switched the embedded contract workspace into 历史结果
    • surfaced the latest generated contract card for 保密协议标准模板_20260504_053915.docx
    • confirmed the history card exposes both 查看结果 and 继续编辑
    • tapping 查看结果 opened the generated-contract result screen
    • returning to history and tapping 继续编辑 opened the contract builder with the same template context
  • The latest manual proof artifacts are in:
    • mobile/qa-artifacts/manual-contract-history/window_dump_view_result.xml
    • mobile/qa-artifacts/manual-contract-history/window_dump_continue_edit.xml
  • Practical device note:
    • forcing portrait (user_rotation=0) made the embedded contract workspace much more stable for real-device validation than the OEM landscape state

AI tools contract-page split (2026-05-04)

  • The AI工具 tab no longer embeds the full contract workspace inside the bottom portion of the tools surface
  • The tools hub now behaves as:
    • an in-place legal-chat surface
    • a dedicated 打开合同工作台 launch action for contract generation
  • Entering contract generation from:
    • the dashboard quick action
    • the AI工具 tab launch action now opens a standalone full-screen 合同生成 page instead of a cramped nested scroll region
  • Validation passed after the split:
    • flutter analyze --no-pub
    • flutter test --no-pub test/app_shell_test.dart
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device proof now exists for the new launch shape:
    • the AI工具 tab shows a dedicated 打开合同工作台 button
    • tapping it opens a standalone page with app-bar title 合同生成
    • the standalone page shows the contract workspace header and the 模板 / 历史结果 split as a full-screen flow
    • manual proof artifacts are in mobile/qa-artifacts/manual-tools-standalone/

Direct contract launch cleanup (2026-05-05)

  • Navigation was simplified so the dashboard contract shortcut no longer routes through AI工具 and then auto-pushes the contract page
  • Current launch behavior is now split more cleanly:
    • dashboard 合同生成 quick action -> direct standalone 合同生成 page
    • AI工具 tab -> in-place legal chat plus an explicit 打开合同工作台 launch button
  • The old shell workaround based on ToolsHubView.contracts auto-launch was removed, so the tools tab is no longer carrying contract-page launch state inside the shell
  • Validation after the cleanup:
    • flutter analyze --no-pub
    • flutter test --no-pub test/app_shell_test.dart
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood

Standalone contract page polish (2026-05-05)

  • The standalone 合同生成 page was tightened from a documentation-heavy tool page into a denser mobile work surface
  • Main surface changes:
    • removed the larger explanatory header card
    • replaced the old always-open filter card with a compact toolbar
    • moved type filtering into a bottom-sheet filter flow
    • kept the main canvas focused on template/history lists instead of static explanation copy
    • added a lighter top bar with 模板 / 历史结果 counts
  • The standalone contract page now reads more like:
    • compact page heading
    • switch surface
    • search/refresh/filter tools
    • primary list content instead of "big description + big filter card + list pushed below"
  • Validation passed after the page polish:
    • flutter analyze --no-pub
    • flutter test --no-pub test/app_shell_test.dart
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device confirmation exists for the polished standalone page:
    • the dashboard contract quick action still opens the standalone page directly
    • the page now shows the tighter top bar, compact toolbar, and direct template list presentation
    • proof artifacts are in mobile/qa-artifacts/manual-contract-polish/

Contract list-density polish (2026-05-05)

  • The standalone contract page was tightened again to feel more like a professional mobile workbench list:
    • top counts now react to live template/history data instead of staying static
    • template items were compressed into denser list rows with the primary action aligned inline
    • history items now use a tighter summary row, file-size/time metadata, and smaller result/edit actions
    • filter controls stay in the compact toolbar + bottom sheet instead of consuming a large permanent card
  • Validation after the list-density pass:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • latest APK reinstalled to the real device successfully

PC-aligned mobile visual refresh (2026-05-20)

  • The mobile visual system has been realigned with the current PC workbench style:
    • PC colors are reflected in Flutter: #12A884, #0A725F, dark workbench panels, lime/cyan/amber/coral accents, soft green canvas, and 8px control/card radius
    • the signed-in shell now uses a dark top bar, compact brand mark, live status chip, elevated bottom navigation, and a subtle grid canvas
    • shared cards, form controls, buttons, chips, chat bubbles, and workbench panels now use the same elevated white/dark-surface language as the PC side
  • Main refreshed surfaces:
    • login hero
    • dashboard hero, primary review action, quick-action grid, and recent-review cards
    • review submission hero, attachment card, and submission preview chips
    • review history hero and risk/status task cards
    • review detail hero
    • AI工具 header and legal-chat composer/bubbles
    • standalone 合同生成 workspace top bar, toolbar, template list, and history cards
    • profile/account/shared-ai cards inherit the refreshed shared card and hero treatment
  • Validation after the visual refresh:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Build-environment note:
    • the first build attempts stalled because D:\DevCaches\Gradle only had a partial gradle-8.14-all.zip.part
    • the complete Gradle 8.14 wrapper cache already existed under the user Gradle cache and was copied into D:\DevCaches\Gradle, after which the debug APK built successfully
    • the build also installed the missing Android SDK Platform 35 package
  • Real-device smoke status:
    • the refreshed APK was built at mobile/build/app/outputs/flutter-apk/app-debug.apk
    • real-device smoke could not run because the wireless ADB endpoint dropped after the build: adb mdns services no longer listed an _adb-tls-connect service and the previous 192.168.3.93:43249 endpoint refused connection
    • next real-device step is to re-enable or re-pair wireless debugging on the phone, then rerun tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SmokeDepth shell-only

Wireless real-device smoke closure (2026-05-20)

  • Wireless debugging was repaired with the user's help:
    • paired to 192.168.3.93:34287
    • connected to the refreshed wireless debug endpoint 192.168.3.93:34707
    • installed the refreshed debug APK successfully before the final login-state check
  • The user logged in with their own registered account; administrator credentials were not required for the mobile UI smoke.
  • Manual real-device launch evidence:
    • TOP_HAS_APP=True
    • APP_SURFACE=signed_in_shell
    • SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-05-24-013-manual-shell/
  • Standard smoke helper passed without reinstalling the APK:
    • command: tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SkipInstall -SmokeDepth shell-only
    • SERVER_API_STATUS=200
    • SERVER_WEB_STATUS=200
    • TOP_ACTIVITY=com.example.ai_contract_mobile/.MainActivity
    • APP_SURFACE=signed_in_shell
    • SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-05-48-752/

Review history mobile workbench upgrade (2026-05-20)

  • The mobile 审查记录 surface now behaves more like a working list instead of a static dump:
    • summary counters for total reviews, active reviews, high-risk reviews, and completed reviews
    • local keyword search across title, id, contract type, review side, status, risk label, and created time
    • status chips for 待处理 / 处理中 / 已完成 / 部分完成 / 失败
    • risk chips for 高风险 / 中风险 / 低风险 / 待评估
    • a 高风险优先 switch that ranks high-risk and non-terminal work ahead while preserving stable order inside the same rank
    • filtered-empty state with a clear reset action
  • First-run / no-record accounts now get a productized empty state:
    • explains that submitted reviews will create status, risk, and report records
    • exposes 发起合同审查 directly from the history tab
    • keeps 刷新列表 available for newly created or externally updated reviews
  • Validation after the review-history upgrade:
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/review_history/domain/review_history_filter_test.dart test/app_shell_test.dart
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device validation on the wireless X60PRO:
    • standard smoke after installing the new APK: SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-19-40-523/
    • the logged-in user account currently has no review records, so the empty-state CTA was verified instead of populated-list filters
    • empty-state proof artifact: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-20-19-530-review-history-empty-cta/

Review submission draft recovery (2026-05-20)

  • The mobile 发起合同审查 flow now has local draft recovery:
    • contract text is auto-saved after editing
    • selected contract type and review side are restored together with the text
    • a compact draft status bar shows the latest local save time
    • users can clear the draft from the submission page
    • successful submission clears the saved draft before opening the review detail page
  • Draft storage is intentionally privacy-conscious:
    • persisted through flutter_secure_storage
    • stores only text/type/side/update time
    • does not persist attachment bytes, file names, or MIME metadata
    • empty text drafts are removed instead of being saved
  • New focused coverage:
    • review_draft_store_test.dart verifies save/restore, empty-draft cleanup, corrupt-payload cleanup, and attachment metadata exclusion
  • Validation after the draft-recovery slice:
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/review/application/review_draft_store_test.dart
    • flutter test --no-pub passed with 33 tests
    • git diff --check -- mobile reported no whitespace errors, only Windows line-ending notices
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device validation on the wireless X60PRO:
    • standard shell smoke after installing the new APK returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-33-10-432/
    • a direct uiautomator pass entered the review tab, typed a temporary draft, switched away, returned to the review tab, and confirmed the text plus 草稿已保存 status restored
    • the temporary draft was cleared after validation, leaving the submit form empty again

Review detail next-action guidance (2026-05-20)

  • The mobile review-detail page now shows a focused next-action card near the top of the page, so users do not need to infer the next step from static fields.
  • A new domain helper, ReviewDetailNextAction, maps task state into a primary action:
    • failed reviews -> refresh task status first
    • pending / processing reviews -> refresh or come back later
    • completed reviews without result metadata -> refresh result sync
    • high-risk reviews -> open the review assistant with a high-risk revision-list prompt
    • revise recommendations -> continue into contract generation with review context
    • low-risk completed reviews with a report -> open the report directly
  • The detail page primary action now routes into the existing mobile workflows instead of duplicating logic:
    • refresh uses the existing detail reload
    • assistant follow-up reuses the review-context chat
    • contract generation reuses the review-derived prefill flow
    • report opening reuses the existing report controller
  • Focused validation:
    • review_detail_next_action_test.dart covers processing, failed, high-risk, revise, and report-ready cases
    • flutter test --no-pub test/features/review_history/domain/review_detail_next_action_test.dart
    • flutter analyze --no-pub
  • Full validation after the next-action slice:
    • flutter test --no-pub passed with 38 tests
    • git diff --check -- mobile reported no whitespace errors, only Windows line-ending notices
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device validation on the wireless X60PRO:
    • standard shell smoke after installing the new APK returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T15-50-52-933/
    • the currently logged-in self-registered account still has no review records, so detail-card runtime proof should be captured after a real review exists for this account

Real-device review-detail closure (2026-05-20)

  • A real text-only review was submitted from the currently signed-in self-registered account on the wireless X60PRO device.
    • created review: review-7cf9ade7a183
    • title: 文本输入合同
    • created at: 2026-05-20T07:55:55.633671+00:00
    • history rendered it as completed, service contract, party A, medium risk
  • Runtime follow-up found and fixed a real-device-only blank detail body:
    • before fix, tapping the populated history item opened the app bar but left the detail body blank
    • AppScaffoldPage now accepts optional scroll physics
    • review_detail_screen.dart now returns AppScaffoldPage directly from each detail-body state instead of nesting it inside an outer ListView
    • pull-to-refresh is preserved with AlwaysScrollableScrollPhysics
  • Real-device proof after the layout fix:
    • history item opens the populated detail page
    • the detail hero renders 文本输入合同, review-7cf9ade7a183, completed status, service contract, and medium risk
    • the next-action card renders 审查已完成,报告可用
    • the primary action renders as 打开报告
    • proof screenshot: mobile/qa-artifacts/manual-review-detail-next-action/detail-after-layout-fix.png
  • Validation after the real-device closure:
    • flutter analyze --no-pub
    • flutter test --no-pub test\features\review_history\domain\review_detail_next_action_test.dart test\features\review_history\application\review_detail_controller_test.dart
    • flutter test --no-pub passed with 38 tests
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SmokeDepth shell-only returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T16-12-21-981/

Review detail risk-insight upgrade (2026-05-20)

  • The mobile review-detail result summary now surfaces risk item labels and suggestion highlights that were already parsed from the backend result payload.
    • 风险重点 lists the key risk-item titles / risk descriptions
    • 修改建议 lists concrete suggestion text from risk items
    • each block keeps the first four visible items and points users to the full report when more items exist
  • New focused coverage:
    • review_result_summary_test.dart verifies extraction of risk labels and suggestion highlights from risk_items
  • Validation after the risk-insight slice:
    • flutter test --no-pub test\features\review_history\domain\review_result_summary_test.dart
    • flutter analyze --no-pub
    • flutter test --no-pub passed with 39 tests
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • tools/real-device-smoke.ps1 -ExpectedIp 192.168.3. -ConfigureDevice -SmokeDepth shell-only returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-20T16-29-14-860/
  • Real-device proof on the wireless X60PRO:
    • opened review-7cf9ade7a183
    • result summary rendered 风险重点 with 保密义务建议细化 and 付款与验收条件建议明确
    • result summary rendered 修改建议 with concrete confidentiality and payment / acceptance suggestions
    • proof screenshot: mobile/qa-artifacts/manual-review-detail-insights/review-detail-insights.png
  • The mobile review-history -> legal-document drafting handoff now works on the real wireless X60PRO flow.
  • The smoke script now scrolls to the actual review card, opens the review detail page, enters legal-document drafting, and verifies both the type list and builder are carrying the review context forward.
  • Validation:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • mobile/tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:35593 -ConfigureDevice -SmokeDepth review-legal-document -LoginAccount cyuqei@gmail.com returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-26T02-02-19-720/

Dashboard recent-review handoff closure (2026-05-26)

  • The dashboard's recent review preview now acts as a real entry point into review detail instead of a dead preview card.
  • Tapping a recent review now switches to history and opens the matching review detail page with the review title prefilled.
  • Validation:
    • flutter analyze --no-pub
    • flutter test --no-pub
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • mobile/tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:40011 -ConfigureDevice -SmokeDepth dashboard-review-preview -LoginAccount cyuqei@gmail.com returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-26T06-53-17-885/

Business auxiliary real-device closure (2026-05-26)

  • The mobile AI工具 business auxiliary strip is now validated as a real user path on the wireless X60PRO device.
  • The smoke helper now taps the shortcut by Android content-desc button bounds, which matches Flutter's accessibility tree for these quick-prompt chips.
  • Real-device proof confirms all 4 business auxiliary entries are visible and that 提取履约义务 can trigger the shared Chat flow without leaving the app surface.
  • Validation:
    • PowerShell parser check for mobile/tools/real-device-smoke.ps1 returned PARSE_OK
    • flutter test --no-pub test/features/tools/presentation/tools_hub_screen_test.dart
    • flutter analyze --no-pub
    • flutter test --no-pub
    • mobile/tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:40011 -ConfigureDevice -SmokeDepth business-auxiliary -LoginAccount cyuqei@gmail.com returned SMOKE_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-26T07-01-10-567/

Product smoke suite scaffold (2026-05-26)

  • A batch runner now exists at mobile/tools/run-real-device-product-smoke-suite.ps1.
  • The suite chains the current Android product paths into one reportable run: shell-only, share-proof, contract-taxonomy, documents-workspace, review-legal-document, dashboard-review-preview, and business-auxiliary.
  • The suite writes both suite-summary.json and suite-summary.txt, so later Android rounds can capture one artifact bundle instead of many ad hoc shell invocations.
  • Validation:
    • PowerShell parser check for mobile/tools/run-real-device-product-smoke-suite.ps1 returned PARSE_OK
    • a one-step failure-path run on 192.168.3.93:40011 still produced a suite report and per-step summary
    • current blocker is external: wireless ADB for 192.168.3.93:40011 is unavailable right now, so the suite could not complete a live device pass
    • suite artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-26T07-46-28-254/

Product smoke suite pass (2026-05-26)

  • The real-device Android product smoke suite now passes end-to-end on the wireless device 192.168.3.93:43767.
  • Two remaining failures were closed in the smoke helper rather than the app itself:
    • share-proof now scrolls to the real report section, taps the real 分享报告 button, and dismisses the low-battery system warning if it appears before the Android chooser is captured.
    • documents-workspace now only accepts real open-legal-document-* entry buttons and no longer falls back to the generic management buttons that caused false starts.
  • Latest validation:
    • mobile/tools/run-real-device-product-smoke-suite.ps1 -DeviceSerial 192.168.3.93:43767 -SkipInitialInstall returned SUITE_OK=True
    • passed steps: shell-only, share-proof, contract-taxonomy, documents-workspace, review-legal-document, dashboard-review-preview, business-auxiliary
    • suite artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-26T08-24-01-233/

Generated contract result actions upgrade (2026-05-26)

  • The mobile contract-generation result flow now has stable automation anchors for the production-facing actions:
    • contract workspace template cards and generated-contract history actions
    • contract builder preview / generate actions
    • generated-contract result download, open, share, and continue-editing actions
  • mobile/tools/real-device-smoke.ps1 now supports a dedicated contract-result-actions depth.
  • mobile/tools/run-real-device-product-smoke-suite.ps1 now includes contract-result-actions in the default suite between contract-taxonomy and documents-workspace.
  • Validation:
    • PowerShell parser checks passed for both smoke scripts.
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/contracts/presentation/contract_screens_test.dart test/features/contracts/application/contract_template_controller_test.dart test/features/contracts/application/generated_contract_history_controller_test.dart
    • flutter test --no-pub passed with 61 tests.
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
  • Real-device smoke status:
    • the current wireless-debug serial 192.168.3.93:45347 is connected and usable for real-device smoke.
    • mobile/tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:45347 -ConfigureDevice -SkipInstall -SmokeDepth contract-result-actions -LoginAccount cyuqei@gmail.com -LoginPassword <member-password> returned SMOKE_OK=True.
    • the full product smoke suite now passes on the same device:
      • mobile/tools/run-real-device-product-smoke-suite.ps1 -DeviceSerial 192.168.3.93:45347 -ConfigureDevice -SkipInitialInstall -LoginAccount cyuqei@gmail.com -LoginPassword <member-password> returned SUITE_OK=True
      • passed steps: shell-only, share-proof, contract-taxonomy, contract-result-actions, documents-workspace, review-legal-document, dashboard-review-preview, business-auxiliary
    • latest artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-26T10-30-31-688/

Generated contract version-chain mobile closure (2026-05-26)

  • The generated-contract result page now exposes the backend version-chain capability on Android:
    • version list with base/generated version and saved editor versions
    • mobile diff preview between generated-contract versions
    • version download entry
    • lightweight editor entry that saves edited contract content as a new backend version
  • Mobile API/client coverage now includes:
    • GET /contracts/{contract_id}/versions
    • GET /contracts/{contract_id}/versions/diff
    • POST /contracts/{contract_id}/versions
    • GET /contracts/{contract_id}/versions/{version_id}/download
  • mobile/tools/real-device-smoke.ps1 now supports contract-version-chain.
  • mobile/tools/run-real-device-product-smoke-suite.ps1 now includes contract-version-chain in the default suite between contract-result-actions and documents-workspace.
  • Validation:
    • PowerShell parser checks passed for both smoke scripts.
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/contracts
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood
    • mobile/tools/real-device-smoke.ps1 -DeviceSerial 192.168.3.93:45347 -ConfigureDevice -SmokeDepth contract-version-chain -LoginAccount cyuqei@gmail.com -LoginPassword <member-password> returned SMOKE_OK=True
    • mobile/tools/run-real-device-product-smoke-suite.ps1 -DeviceSerial 192.168.3.93:45347 -ConfigureDevice -SkipInitialInstall -LoginAccount cyuqei@gmail.com -LoginPassword <member-password> returned SUITE_OK=True
    • passed suite steps: shell-only, share-proof, contract-taxonomy, contract-result-actions, contract-version-chain, documents-workspace, review-legal-document, dashboard-review-preview, business-auxiliary
    • latest artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-26T11-23-24-023/

Generated contract version save-loop hardening (2026-05-26)

  • The Android version editor now exposes stable automation anchors for:
    • change-summary input
    • contract-content input
    • bottom save action
  • The contract-version-chain smoke depth is no longer display-only:
    • it enters the editor from a generated contract result
    • appends a timestamped smoke marker to the summary/content
    • saves a new backend version
    • verifies the app returned to the result page and the created version marker is visible in the version list
  • Additional result fields now exist in summary.txt for the save loop:
    • CONTRACT_VERSION_CHAIN_SAVE_OK
    • CONTRACT_VERSION_CHAIN_CREATED_VISIBLE
    • CONTRACT_VERSION_CHAIN_SAVE_MARKER
  • Local validation for this hardening slice:
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/contracts
    • PowerShell parser check for mobile/tools/real-device-smoke.ps1

Android remaining backlog (2026-05-27)

  • The Android mainline product paths are now functionally closed through real-device smoke:
    • shell-only
    • share-proof
    • contract-taxonomy
    • contract-result-actions
    • contract-version-chain
    • documents-workspace
    • review-legal-document
    • dashboard-review-preview
    • business-auxiliary
  • The latest real-device product smoke suite passed end-to-end again on the wireless X60PRO:
    • device serial: 192.168.3.93:40911
    • suite result: SUITE_OK=True
    • suite artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-27T08-36-40-365/
  • The refreshed suite now also includes system-interop and passed end-to-end on the same real device:
    • device serial: 192.168.3.93:40911
    • suite result: SUITE_OK=True
    • passed steps: shell-only, system-interop, share-proof, contract-taxonomy, contract-result-actions, contract-version-chain, documents-workspace, review-legal-document, dashboard-review-preview, business-auxiliary
    • suite artifact root: mobile/qa-artifacts/real-device-product-smoke-suite/2026-05-27T15-54-21-779/

Remaining not fully closed

  • System-level file picker / open / share compatibility is now script-probed but still OEM-dependent:
    • system-interop records whether the current device exposes usable handlers for ACTION_OPEN_DOCUMENT, PDF view, and PDF share
    • this turns external handler gaps into explicit evidence instead of app-surface failures
  • Wireless ADB unattended stability is now script-probed but still an environment risk:
    • check-wireless-adb-stability.ps1 records repeated online probes, mDNS output, and adb devices -l
    • port rotation, offline, and lockscreen overlays remain external blockers during long unattended runs
  • Brand and image assets are functionally swapped in; future work here is only final production art direction:
    • bundled raster assets now feed app mark, login banner, dashboard hero image, launcher icon, and splash image
    • final designer-supplied brand pack can still replace these generated assets later

Closed and should not be re-counted as open gaps

  • Chinese-variable contract template preview + generate validation
  • Contract-generation preview continuation and persisted draft preview restore
  • System interop handler probing for file picker / open / share
  • Wireless ADB stability preflight reporting
  • Functional bundled brand/image asset integration
  • Login/session persistence
  • Review submit/history/detail/report flow
  • Review -> Chat follow-up
  • Review -> contract generation handoff
  • Review -> legal-document handoff
  • Business auxiliary real-device entry
  • Contract result actions
  • Contract version-chain editor save loop
  • Product smoke suite batch runner and report artifacts

Review risk actions and contract lifecycle mobile closure (2026-06-01)

  • The mobile review detail page now integrates the backend risk-actions API:

    • GET /reviews/{id}/risk-actions loads all risk items with their status, suggested text, and applied version links.
    • PUT /reviews/{id}/risk-actions/{action_id} lets users adopt or ignore individual risk suggestions.
    • POST /reviews/{id}/risk-actions/{action_id}/apply applies a risk suggestion to a generated contract, creating a new version.
  • New domain models: ReviewRiskAction, AppliedContractVersion, ReviewRiskActionListResponse, ApplyActionResult.

  • New controller: ReviewRiskActionsController with load, update, and apply methods.

  • review_detail_screen.dart now shows a 风险操作 card below the 继续追问 section, listing each risk item with its level badge, status badge, and action buttons (采纳/忽略/应用到合同).

  • The mobile generated contract result page now integrates the contract lifecycle and tasks API:

    • GET /contracts/{id}/lifecycle/tasks loads tasks with status summary.
    • PUT /contracts/{id}/lifecycle/tasks/{task_id} marks tasks as completed.
    • PATCH /contracts/{id}/lifecycle endpoint is now reachable from the mobile client.
  • New domain models: ContractLifecycle, ContractLifecycleTask, ContractLifecycleTaskListResponse.

  • New controller: ContractLifecycleController with loadTasks and updateTask methods.

  • generated_contract_result_screen.dart now shows a 合同生命周期 card below the 版本链 section, listing tasks with priority/status badges and a "标记完成" action.

  • Validation after this slice:

    • flutter analyze --no-pub

    • flutter test --no-pub passed with 70 tests

    • flutter analyze --no-pub

    • flutter test --no-pub passed with 70 tests

    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood produced build/app/outputs/flutter-apk/app-debug.apk

  • The mobile client now has a unified file management layer (file_service.dart) that wraps the backend /files API:

    • GET /files — file list with pagination
    • POST /files — file upload with multipart
    • GET /files/{id} — file detail
    • DELETE /files/{id} — file deletion
    • GET /files/{id}/download-url — signed download URL
    • GET /files/{id}/download — direct binary download
  • New domain models: FileInfo, FileListResponse, FileDetailResponse, FileUploadResponse

  • New FileService class with typed methods and FileServiceException error handling

  • This service is ready to replace the ad-hoc multipart file uploads in review submission and contract generation flows

Chinese-variable template validation closure (2026-05-27)

  • property_service Chinese variable template preview and generate are now treated as closed verification paths rather than an open Android backlog item.
  • Closure evidence now exists at three layers:
    • backend automated coverage in backend/tests/test_contracts_api.py
    • explicit UTF-8-safe verifier at scripts/verify-chinese-contract-template-utf8.ps1
    • broader runtime integration through the property_service Chinese-variable generation case in scripts/run-phase15-product-smoke.ps1
  • Current verified state:
    • preview returned 200
    • generate returned 200
    • remote member account successfully created new property_service generated contracts through the UTF-8-safe path
  • Resulting boundary update:
    • this is no longer a missing contract-generation capability
    • the remaining concern is only whether future release gates should require this verification by default

Brand and image asset closure (2026-05-27)

  • The mobile workspace now has real bundled brand assets instead of .gitkeep placeholders only:
    • assets/branding/brand-mark.png
    • assets/branding/login-banner.png
    • assets/icons/app-icon-1024.png
    • assets/images/workbench-hero.png
  • Android launcher and splash assets were refreshed from the same generated brand family:
    • android/app/src/main/res/mipmap-*/ic_launcher.png
    • android/app/src/main/res/mipmap-*/launch_image.png
    • android/app/src/main/res/drawable*/launch_background.xml now renders the bundled launch image instead of the commented placeholder block
  • App-surface integration now uses those assets directly:
    • BrandMark renders the bundled bitmap brand mark
    • LoginScreen shows the bundled login banner above the hero band
    • DashboardScreen renders the bundled workbench hero image through the shared BrandHeroBand
  • Validation after the asset closure:
    • flutter analyze --no-pub
    • flutter test --no-pub test/features/contracts/presentation/contract_screens_test.dart
    • flutter build apk --debug --no-pub --dart-define=API_BASE_URL=http://192.168.3.90:8001/api/v1 --dart-define=APP_ENV=server-dogfood

Android external interop and unattended probe closure (2026-05-27)

  • System-level file picker / open / share compatibility now has a dedicated real-device probe instead of relying only on business smoke side effects.
  • mobile/tools/real-device-smoke.ps1 now supports -SmokeDepth system-interop.
  • The system interop probe records:
    • SYSTEM_INTEROP_PROOF_OK
    • SYSTEM_OPEN_DOCUMENT_HANDLER_OK
    • SYSTEM_PDF_VIEW_HANDLER_OK
    • SYSTEM_PDF_SHARE_HANDLER_OK
    • raw intent resolver output under the smoke artifact directory
  • Real-device evidence on 192.168.3.93:40911:
    • SYSTEM_INTEROP_PROOF_OK=True
    • SYSTEM_OPEN_DOCUMENT_HANDLER_OK=True
    • SYSTEM_PDF_VIEW_HANDLER_OK=True
    • SYSTEM_PDF_SHARE_HANDLER_OK=True
    • artifact bundle: mobile/qa-artifacts/real-device-smoke/2026-05-27T15-34-31-199/
  • mobile/tools/run-real-device-product-smoke-suite.ps1 now includes system-interop in the default suite before the business flows.
  • Wireless ADB unattended stability also has a dedicated preflight:
    • mobile/tools/check-wireless-adb-stability.ps1
    • repeated adb get-state probes
    • before/after adb mdns services
    • before/after adb devices -l
    • JSON and text summaries under mobile/qa-artifacts/wireless-adb-stability/
  • Real-device preflight evidence on 192.168.3.93:40911:
    • WIRELESS_ADB_STABILITY_OK=True
    • PROBE_COUNT=2
    • ONLINE_COUNT=2
    • artifact bundle: mobile/qa-artifacts/wireless-adb-stability/2026-05-27T15-30-40-369/
  • The same pass also hardened two previously flaky real-device smoke assertions:
    • share-proof now waits for the Android chooser instead of checking too early while report sharing is still processing
    • review-legal-document now accepts visible builder prefill evidence such as suggested action, handling suggestion, and review opinion text, not only the older context label
  • Resulting boundary update:
    • missing Android system handlers and wireless-debug churn are still external/OEM risks
    • they are now measured and reported as first-class readiness evidence instead of being left as vague product backlog

Contract preview continuation closure (2026-05-27)

  • The contract-generation builder now restores more than just variable values when users continue from history/result flows.
  • Current closed behavior:
    • reopening the builder from generated history or generated result carries forward initialPreview
    • the builder now persists per-template draft state locally through secure storage
    • persisted draft state includes:
      • variable values
      • export format
      • latest preview payload
    • successful generation clears the persisted draft for that template
  • Closure evidence:
    • local persistence store: mobile/lib/features/contracts/application/contract_builder_draft_store.dart
    • focused persistence test: mobile/test/features/contracts/application/contract_builder_draft_store_test.dart
    • widget coverage for preview restoration: mobile/test/features/contracts/presentation/contract_screens_test.dart
  • Remaining note:
    • any future work here is deeper product polish around richer multi-template continuation UX, not a missing preview-restore core flow