Commit Graph
68 Commits
Author SHA1 Message Date
zhanghongyu_0626 c6a2bfd4f7 feat(milvus): Introduce Milvus vector database API for read-only access
- Added a new API endpoint to list collections in the Milvus vector database, providing metadata such as titles, descriptions, and sample data.
- Integrated the new Milvus router into the main application, ensuring it is accessible through the API.
- Updated the JSON serialization logic to handle decimal precision for financial data, maintaining accuracy in API responses.
- Enhanced the frontend with a new Knowledge Base page to display vector collections, including sample previews and collection details.
- Updated routing and menu structures to include the new Knowledge Base feature, improving navigation within the application.
2026-09-14 10:27:02 +08:00
zhanghongyu_0626 c790387717 docs: Update README and presentation materials for defense preparation
- Revised README.md to clarify the roles of various documents in the defense process, emphasizing the new structure for the presentation script and demo materials.
- Added a new print-friendly README.md for the defense script, detailing the steps for printing and PDF generation.
- Introduced a new HTML file for the presentation, enhancing the visual layout and ensuring consistency with the updated content.
- Updated the content in existing documents to reflect the latest changes in the presentation flow and materials, ensuring all resources are aligned for the upcoming defense.
2026-09-14 09:07:59 +08:00
zhanghongyu_0626 01db9af32b fix(memory): Resolve multi-turn dialogue defects and address existing test bugs
- Fixed three key defects in multi-turn dialogue handling: improved RAG to utilize merged messages, enhanced intent classification with recent memory, and ensured proper merging of chat and consultation memories.
- Closed five existing test bugs unrelated to the current round, including parameter adjustments and assertion corrections in various test files.
- Finalized adjustments in the F-β selection process to align race condition handling in test cases, ensuring all relevant tests pass successfully.

This update enhances the coherence of multi-turn dialogues and improves the reliability of the testing framework.
2026-09-14 00:59:25 +08:00
zhanghongyu_0626 7dadec279d fix(memory): Address multi-turn dialogue defects and enhance context handling
- Implemented `_merged_items` and `_merged_memory_text` functions to consolidate consult and chitchat memories, improving context awareness in intent classification and response generation.
- Updated intent prompts to include recent dialogue history, aiding in the resolution of ambiguous user queries.
- Enhanced `search_knowledge` tool to utilize context window for better query understanding, addressing issues with omitted references in user inputs.
- Fixed existing test cases to reflect changes in intent constants and ensure accurate context handling during tests.

This update significantly improves the handling of multi-turn dialogues, ensuring a more coherent and contextually aware interaction for users.
2026-09-14 00:59:14 +08:00
zhanghongyu_0626 9e1a9b2a7e docs: Update MEMORY and TODO files for clarity and accuracy in project deliverables
- Revised MEMORY.md to correct the status of kb_product_rules, clarifying that it has not been populated in the vector database as previously stated.
- Enhanced TODO.md with detailed descriptions of completed tasks and their corresponding documentation paths for better tracking of project deliverables.
- Added new files for daily meeting minutes, development plans, table design documents, API documentation, presentation materials, and requirements documentation, ensuring all necessary materials are indexed and easily accessible for the upcoming defense.
- Updated README files to reflect the latest changes and provide a comprehensive overview of submission materials for the defense, aligning with client requirements.
2026-09-14 00:18:31 +08:00
zhanghongyu_0626 f856ab4aa6 fix(tests): Resolve pytest session binding issues and update test cases
- Updated test files to import `AgentSessionLocal` from `advisor_db` instead of directly, preventing session binding to the real database during tests.
- Fixed 6 test cases to use the new login token utility, ensuring consistency across authentication methods.
- Adjusted customer risk codes in `test_convert_confirm.py` to reflect changes in customer classification (C3 to C4).
- Verified that changes resulted in zero database pollution during test runs, maintaining integrity of the testing environment.
- Documented findings and updates in the relevant test logs and memory files, ensuring clarity on the current state of tests and defects.
2026-09-13 23:21:34 +08:00
zhanghongyu_0626 188bf6a438 feat(analyst_agent): Add support for recent days queries and enhance SQL hint generation
- Introduced `_recent_days_series_hint` to handle queries related to "最近N天" for time series data aggregation.
- Added `_cn_num_to_int` function to convert Chinese numerals to integers for better query parsing.
- Updated `_nl_sql_hints` to incorporate the new hint generation logic, ensuring accurate SQL output for recent days queries.
- Enhanced documentation to reflect these changes and improve clarity on the new functionalities.
2026-09-13 22:36:19 +08:00
zhanghongyu_0626 5c18164d34 fix(trade): close CT-001 P0/P1/L1 and align customer-trade E2E
Dev login no longer honors injected roles; self-service simulate/convert
blocks R4 disclosure grades like the UI and chat already do. Reuse of a
convert idempotency key with a different body returns 409. CT6 redeem qty
is derived from T+2 lots instead of a fixed 35000; CT7-05 and CT10-07
assertions follow. Update project memory and v1.1 post-fix test artifacts.
2026-09-13 20:04:41 +08:00
zhanghongyu_0626 02a4f35c79 feat(tests): Conduct fourth round of end-to-end testing for customer trade functionality
- Completed 203 test cases with 162 passing, 6 failing, and 2 skipped, identifying 2 critical defects (P0: authentication privilege escalation, P1: suitability disclosure not enforced).
- Enhanced test coverage by verifying front-end rendering values against back-end raw responses, addressing previous gaps in validation.
- Documented findings and defects in the new test log and README files, ensuring clarity on test outcomes and areas for improvement.
- Updated the TODO list to reflect the current state of defects and testing priorities, emphasizing the need for immediate attention to identified issues.

This round of testing significantly improves the robustness of the customer trade functionality, ensuring compliance and security standards are met.
2026-09-13 18:51:52 +08:00
zhanghongyu_0626 647c07062e feat(trade): Enhance trade processing and context handling in customer service
- Introduced `pending_trade` handling in the chat API to manage trade requests more effectively.
- Updated the `submit_trade_api` to allow advisors to access customer trades based on assigned roles.
- Added new methods in `GatewayRepository` for managing core holdings during trade subscriptions and redemptions.
- Implemented context-aware trade dialogue management in the customer service layer to improve user experience during multi-turn interactions.
- Enhanced the tool service to support trade actions and suitability checks, ensuring accurate processing of user requests.

This update significantly improves the trade interaction flow, providing a more robust and user-friendly experience for customers engaging in trading activities.
2026-09-13 17:45:04 +08:00
zhanghongyu_0626 b04af6e701 feat(docs): Update demo SOP and enhance documentation for advisor agent
- Added new entry for "STAFF-20003" role in `jwt_service.py` to support additional user permissions.
- Revised the demo SOP documentation to reflect updated processes and clarify the presentation flow, including changes to the demo script and internal guidelines.
- Enhanced the presentation materials with a new HTML slide deck for the advisor agent demo, ensuring a cohesive visual representation of the features and capabilities.
- Updated various documentation files to align with recent changes in the advisor agent functionalities and testing baselines.

This update improves the clarity and usability of the demo materials while ensuring that the documentation accurately reflects the current state of the project.
2026-09-13 17:44:09 +08:00
zhanghongyu_0626 2296a4a002 feat(api): Add convert_meta_api for retrieving latest NAV date and enhance created_at field handling
- Introduced `convert_meta_api` endpoint to fetch the latest NAV date for conversion processes, restricted to users with the "risk_officer" role.
- Updated `created_at` field in `AgentMessage` to use UTC timezone for consistency in timestamp handling.
- Added `get_max_product_nav_date` method in `CoreReadOnlyRepository` to support the new API functionality.
- Enhanced Milvus template loading in `MilvusTemplateVectorStore` to ensure collections are loaded when they exist.

This update improves the API's capability to handle conversion metadata and ensures accurate timestamp management across the application.
2026-09-13 12:40:44 +08:00
zhanghongyu_0626andCursor c09b987ffe feat(web): 基金转换演示页与 agent 镜像表迁移; Core seed 修复
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 17:59:10 +08:00
zhanghongyu_0626andCursor 03fce883d4 merge(risk-control-agent): fund convert T+1 on merger base (plan A)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 17:52:17 +08:00
zhanghongyu_0626 c7fa32ef62 docs(advisor): 顾问线已合入 merger,同步记忆与 E2E 日志
- MEMORY/TODO/合并说明:integrate/advisor-agent 已通过 fast-forward 并入 merger(4be27c5)
- ADV-001:补充 4be27c5 与 64c5db7 后端结论仍成立,无需重跑
2026-09-12 17:23:09 +08:00
zhanghongyu_0626 4be27c589c 合并一下 2026-09-12 17:16:15 +08:00
zhanghongyu_0626 64c5db73a9 refactor(kyc): Remove ApiResponse response model from KYC session endpoints
- Updated KYC session endpoints to remove the ApiResponse response model, simplifying the API structure.
- Enhanced clarity in the KYC session creation, retrieval, chat, and completion methods by focusing on the payload and response data directly.
- Improved code readability and maintainability by streamlining the endpoint definitions.
2026-09-12 16:48:25 +08:00
zhanghongyu_0626 d394686a3b feat(advisor-agent): Integrate advisor agent functionalities and migration scripts
- Merged the `integrate/advisor-agent` branch into the `merger`, enhancing the advisor agent's capabilities with compliance, KYC, and script templates.
- Updated the testing baseline to reflect 926 passed tests, with 65 failures concentrated in the advisor agent's `test_sprint*` cases.
- Introduced new migration scripts for advisor-related database structures, ensuring smooth integration and data management.
- Enhanced documentation to include the new API structure and integration details, providing clarity for future development.

This update significantly advances the advisor agent's functionality while maintaining a structured approach to integration and testing.
2026-09-12 16:37:29 +08:00
zhanghongyu_0626 70aa861983 feat(advisor-agent): Introduce advisor agent functionalities with compliance, KYC, and script templates
- Added new modules for advisor compliance, KYC sessions, and script templates, enhancing the advisor agent's capabilities.
- Implemented a comprehensive API structure under the `/api/advisor-agent` prefix, ensuring clear organization and access to new features.
- Established database models and repositories for compliance rules and KYC sessions, facilitating robust data management.
- Integrated exception handling and response models to improve error management and user feedback.
- Updated settings to include new configurations for compliance and KYC features, ensuring flexibility and adaptability.

This update significantly expands the advisor agent's functionality, providing essential tools for compliance and customer interaction while maintaining a structured API design.
2026-09-12 16:33:07 +08:00
zhanghongyu_0626 282f21932c Merge remote-tracking branch 'xinghuo/advisor-agent' into integrate/advisor-agent 2026-09-12 16:32:48 +08:00
zhanghongyu_0626 973bf1b834 feat(advisor-agent): Integrate advisor agent into merger with new API structure
- Merged `xinghuo/advisor-agent` into the `merger` branch, establishing a new API prefix `/api/advisor-agent` to avoid conflicts with existing endpoints.
- Implemented a comprehensive implementation plan detailing the integration steps, including conflict resolution, database migrations, and service adaptations.
- Introduced new files for advisor compliance, script templates, KYC, and market alerts, ensuring a cohesive addition to the existing architecture.
- Updated documentation to reflect the new structure and integration process, enhancing clarity for future development and maintenance.

This integration significantly expands the capabilities of the merger, providing a robust framework for advisor-related functionalities while maintaining compliance and operational integrity.
2026-09-12 15:14:29 +08:00
zhanghongyu_0626 601ed258f3 feat(analyst): Enhance asset management and ambiguity detection features
- Added new endpoints to the analyst API for managing assets, including `GET /assets` to list assets and `POST /assets/{kind}/{asset_id}/publish` to publish assets.
- Introduced `DictAmbiguityCheckRequest` schema for checking metric ambiguities, enhancing the analyst's ability to clarify definitions and aliases.
- Implemented `detect_dict_ambiguity` function to analyze potential ambiguities in metrics, providing structured feedback for users.
- Updated `AnalystAgent` to support the new asset management functionalities and ambiguity detection logic, improving overall user experience.
- Enhanced existing schemas and services to accommodate new features, ensuring robust data handling and validation.

This update significantly improves the analyst API's capabilities, allowing for better asset management and clarity in metric definitions.
2026-09-12 15:14:01 +08:00
zhanghongyu_0626 a0f550646e feat(analyst): Add analyze endpoint and chart specification validation
- Introduced a new `/analyze` endpoint in the analyst API to process analysis requests, allowing users to receive textual interpretations and chart specifications based on provided prompts.
- Enhanced `analyst_schemas.py` with `AnalyzeRequest` and `ChartSpec` models to structure analysis requests and validate chart specifications.
- Implemented chart validation logic in a new `analyst_chart.py` service, ensuring that chart types and fields are correctly specified and conform to allowed values.
- Updated `AnalystAgent` to handle analysis requests, integrating the new logic for generating responses based on user prompts and data availability.
- Added unit tests to verify the functionality of the new endpoint and validation mechanisms, ensuring robustness and reliability.

This update significantly enhances the analytical capabilities of the application, providing users with improved tools for data interpretation and visualization.
2026-09-12 12:33:37 +08:00
zhanghongyu_0626 d4a2461ba4 feat(nav): Enhance product API with historical NAV tracking and new charting features
- Updated `ready.py` to include a health check for the new `products_nav_history` endpoint, ensuring system readiness.
- Enhanced the `ProductNavChartPanel` component to visualize historical NAV data with various charting options, including line and column charts.
- Introduced new utility functions for filtering and aggregating NAV data, improving data handling in the frontend.
- Updated tests to verify the inclusion of the new `products_nav_history` check in the API response.
- Improved documentation to reflect recent changes and the new testing baseline of 833 passed tests, indicating enhanced stability.

This update significantly improves the product API by providing access to historical NAV data and enhancing user insights through visualizations.
2026-09-11 21:38:54 +08:00
zhanghongyu_0626 2b4eaa9725 feat(nav): Implement historical NAV tracking and enhance product API
- Added `list_nav_history` method in `CoreReadOnlyRepository` to retrieve historical NAV data for products over a specified number of days.
- Introduced `get_nav_history` endpoint in `product_service` to return historical NAV sequences, improving product data accessibility.
- Updated `products.py` to include new API endpoint for fetching NAV history, ensuring compliance with access control.
- Enhanced `ready.py` to include a health check for the new functionality, ensuring system readiness.
- Updated documentation to reflect the new testing baseline of 833 passed tests, indicating improved stability and functionality across the application.

This update significantly enhances the product API by providing access to historical NAV data, improving user insights into product performance.
2026-09-11 20:47:18 +08:00
zhanghongyu_0626 f5928cf337 feat(course): Add JinRong architecture governance course materials
- Introduced a new course section on architecture governance, including modules on ADR (Architecture Decision Record) and invariants.
- Created multiple HTML modules detailing architecture principles, decision-making processes, and compliance mechanisms.
- Implemented interactive elements such as quizzes and flow animations to enhance user engagement and learning experience.
- Added supporting files including styles, scripts, and base templates to ensure a cohesive design and functionality across the course materials.

This update significantly enriches the educational content available for architecture governance, providing a structured approach to understanding key concepts and practices.
2026-09-11 17:54:14 +08:00
zhanghongyu_0626 793c0307f8 feat(risk): Enhance risk management functionality and access control
- Updated `RiskListAccess` and `ThresholdWriteAccess` to enforce access control in the risk repository and threshold repository, ensuring only authorized roles can perform sensitive operations.
- Introduced new methods in `RiskRepository` for counting pending alerts and listing alerts with access checks, improving data security and compliance.
- Enhanced the `chat.py` and `deps.py` files to integrate compliance roles into the risk management matrix, allowing for more granular access control.
- Updated documentation to reflect the new testing baseline of 825 passed tests, indicating improved stability and functionality across the application.

This update significantly strengthens the risk management capabilities, ensuring robust access control and compliance with organizational policies.
2026-09-11 17:07:22 +08:00
zhanghongyu_0626 8556da489a feat(analyst): Add sample and escalate functionality to analyst API
- Introduced new endpoints `/api/analyst/query/{trace_id}/sample` and `/api/analyst/escalate` for sampling query results and escalating issues to human analysts, respectively.
- Enhanced `AnalystAgent` to support sampling of SQL results based on trace ID and to handle escalation requests, improving user experience in error scenarios.
- Updated `analyst_schemas.py` to include `EscalateRequest` for structured escalation requests.
- Added corresponding frontend API calls and UI components to facilitate user interactions with the new features.
- Implemented unit tests to ensure the reliability of the new functionalities.

This update significantly enhances the analytical capabilities of the application, allowing users to retrieve detailed query samples and escalate issues effectively.
2026-09-11 15:18:56 +08:00
zhanghongyu_0626 0fb7d34d7a feat(analyst): Implement audit logging for query denial and clarification
- Enhanced the `AnalystAgent` class to include an `_audit_terminal` method for logging query denials, clarifications, and errors, ensuring compliance and traceability.
- Updated error handling paths to call the new audit method, capturing relevant details such as question, user authentication, and SQL context.
- Introduced new validation checks in `sql_guard.py` to enforce ownership filters for sensitive queries, improving security measures.
- Added unit tests to verify the correct logging behavior and ownership filter enforcement, ensuring robust functionality.

This update significantly strengthens the auditing capabilities of the analyst agent, enhancing security and compliance in query handling.
2026-09-11 14:45:16 +08:00
zhanghongyu_0626 aea97a243c feat(analyst): Introduce interpret functionality and enhance chat API
- Added `interpret` flag to `AnalystChatRequest` for optional immediate interpretation of queries.
- Implemented new `POST /api/analyst/interpret` endpoint for on-demand data interpretation based on the latest query snapshot.
- Updated `AnalystAgent` to handle interpretation logic, including error handling and response formatting.
- Enhanced `AnalystQueryPage` to include a button for triggering interpretations, improving user interaction.
- Updated frontend API calls to support the new interpret functionality, ensuring seamless integration with existing workflows.

This update significantly enhances the analytical capabilities of the application, allowing users to request interpretations of their queries directly.
2026-09-11 12:15:18 +08:00
zhanghongyu_0626 0e35eb84ba feat(docs): Update iteration and TODO documentation with recent changes and optimizations
- Enhanced `ITERATION.md` to include new entries for front-end/API optimizations and Chat session management improvements.
- Expanded `TODO.md` with a daily work summary, completed tasks, and upcoming priorities, ensuring clarity on project status and next steps.
- Added a new summary document for 2026-09-10, detailing work completed across various components, including front-end fixes and API enhancements.

This update improves documentation clarity and provides a comprehensive overview of recent developments and future tasks.
2026-09-11 10:45:49 +08:00
zhanghongyu_0626 9d4d4aaa6d feat(chat): Enhance session management with new API endpoints and filtering options
- Added `status` query parameter to `list_sessions_api` for filtering sessions by their status (active/closed).
- Introduced `close_all_sessions_api` endpoint to allow users to close all active sessions for the current actor.
- Updated `SessionRepository` to support status filtering in session listing and implemented logic for closing active sessions.
- Improved Redis connection settings for better performance and reliability.

This update enhances the chat functionality by providing more control over session management, improving user experience and system efficiency.
2026-09-10 22:30:07 +08:00
zhanghongyu_0626 48355cee8e feat(analytics): Enhance AnalystQueryPage with template and cache hit indicators
- Updated `AnalystQueryPage` to display tags for template hits and cache hits, improving user feedback on query performance.
- Adjusted SQL result label to streamline information presentation.
- Enhanced documentation to reflect the latest testing baseline with 804 passed tests, indicating improved stability and functionality across the application.

This update significantly enhances the user experience by providing clearer insights into query processing and results.
2026-09-10 15:31:20 +08:00
zhanghongyu_0626 ddcf53cfa8 feat(template): Implement template caching and SQL rendering for enhanced query handling
- Introduced `TemplateService` for managing SQL templates, allowing for parameterized queries based on user input.
- Added functionality to automatically reload templates upon asset creation in `analyst.py`.
- Enhanced `CacheService` to support table generation bumping, ensuring cache invalidation on data changes.
- Updated `RiskRepository` and `GatewayRepository` to trigger cache invalidation for relevant operations.
- Expanded `analyst_schemas.py` to include new fields for template tracking in response metadata.
- Created seed SQL script for populating initial templates and added unit tests for template rendering logic.

This update significantly improves the efficiency of query handling by leveraging SQL templates, reducing reliance on LLM for common queries.
2026-09-10 15:22:07 +08:00
zhanghongyu_0626 21ced4d38f feat(report): Add battery report generation and update course documentation
- Introduced `battery_report.json` for local data analysis, excluding it from the database.
- Enhanced `AGENTS.md` to reflect updated test baseline with 795 passed tests.
- Added new metrics for trade flow in `dict_service.py`, improving transaction data analysis.
- Updated regex patterns in `guardrail.py` to better handle numeric extraction and prevent misinterpretation of tokens.
- Expanded course modules with new content on FR-8/9/10 capabilities and L3 role management.
- Improved concurrency handling in transaction processing to ensure accurate alert generation.

This update enhances data analysis capabilities and improves the overall structure and clarity of course materials.
2026-09-10 14:32:25 +08:00
zhanghongyu_0626 4b8e11c9bd feat(threshold): Implement customer loss threshold configuration and notification system
- Added `ThresholdRepository` for managing customer loss threshold configurations and notifications.
- Introduced `threshold_service` to handle loss threshold alerts based on customer portfolio performance.
- Enhanced `customer_prompts` to include new intent for querying product net values.
- Updated `customer_service` to integrate new threshold alert functionality into existing workflows.
- Implemented `sanitize_postprocess` for improved compliance handling in customer interactions.
- Enhanced course documentation to reflect updates in advisor training modules and interactive elements.

This update significantly improves the customer experience by providing proactive loss threshold notifications and enhancing the overall service framework.
2026-09-10 10:57:40 +08:00
zhanghongyu_0626 6f222f1c56 feat(course): Add course assembly script and module structure for advisor training
- Introduced `build_all.py` script to automate the assembly of course modules into a single `index.html` file.
- Created `index.html` for the main course overview, featuring a structured layout and navigation for various modules.
- Developed `_base.html` and `_footer.html` templates for the advisor module, ensuring consistent styling and structure.
- Added `build.sh` script for individual module assembly, enhancing modularity and ease of updates.
- Implemented multiple module HTML files detailing specific training scenarios and functionalities for advisors, including interactive elements and quizzes.

This update significantly enhances the course delivery framework, providing a comprehensive and interactive learning experience for advisors.
2026-09-09 23:22:59 +08:00
zhanghongyu_0626 3ad244add0 feat(analyst): Enhance dashboard metrics and customer service interactions
- Updated the `dashboard` function in `analyst.py` to include additional metrics for different user roles, improving data visibility for analysts, customers, advisors, and risk officers.
- Introduced a new `prepare_customer_stream` function in `customer_service.py` to facilitate streaming responses for customer interactions, enhancing the chat experience.
- Added new API endpoints in `analyst.ts` for fetching dashboard metrics and managing analyst assets, streamlining data handling and user interactions.
- Updated frontend components to support new dashboard features and asset management, ensuring a cohesive user experience across the application.

This update significantly improves the functionality and usability of the analyst and customer service features, providing users with enhanced tools for data analysis and interaction.
2026-09-09 21:32:59 +08:00
zhanghongyu_0626 af9fb719e5 refactor(analyst): Update authentication context and add smoke test script
- Replaced `get_auth_context` with `get_platform_auth_context` in `analyst.py` to enhance authentication handling.
- Added a new smoke test script `smoke_analyst.py` for testing the data analysis agent with both fake and live LLM configurations.
- Updated TODO documentation to reflect the completion of Scope B smoke tests, ensuring clarity on testing status.

This update improves the authentication mechanism and introduces a comprehensive testing approach for the data analysis agent.
2026-09-09 21:09:03 +08:00
zhanghongyu_0626 bcd6175d4e feat(analyst): Implement data analysis agent with authentication and query handling
- Introduced `analyst_auth_adapter.py` for managing authentication context and access control for the data analysis agent.
- Added new API endpoints in `analyst.py` for chat, dashboard, asset management, and metrics, utilizing the new authentication context.
- Created Pydantic models in `analyst_schemas.py` for request and response structures, ensuring consistent data handling.
- Updated SQL guard logic in `sql_guard.py` to enforce access restrictions based on user roles and contexts.
- Implemented migration scripts for new database tables related to the data analysis agent, enhancing data management capabilities.
- Removed legacy authentication code from `auth.py`, streamlining the authentication process.

This update significantly enhances the data analysis capabilities, providing a robust framework for querying and managing data securely.
2026-09-09 21:02:11 +08:00
zhanghongyu_0626 aa23e1ae1d Merge branch 'data-analysis-agent-work' into merger 2026-09-09 20:53:59 +08:00
zhanghongyu_0626 bf8f271840 feat(redis): Update Redis configuration and enhance compatibility with Docker
- Changed Redis port mapping in `docker-compose.yml` from `6379:6379` to `6380:6379` to avoid conflicts with Windows Redis.
- Updated `.env.example` to reflect the new Redis URL (`redis://127.0.0.1:6380/0`), ensuring proper configuration for Docker users.
- Enhanced Redis client initialization in `database.py` and `redis_gateway.py` to utilize a new `_redis_kwargs` function for improved compatibility with Windows Redis 3.x and Docker Redis 7.
- Added a new PowerShell script `start-redis.ps1` to facilitate starting Redis in Docker, providing a seamless setup experience for developers.

This update significantly improves the Redis integration, ensuring a smoother development process and better compatibility across environments.
2026-09-09 20:19:55 +08:00
zhanghongyu_0626 95969678e2 feat(chat): Implement comprehensive chat functionality for customer and advisor interactions
- Introduced new chat components including `ChatPanel` and `VisitorChatWidget` to facilitate real-time conversations for customers and visitors.
- Developed a robust chat API with endpoints for synchronous and streaming interactions, enhancing user engagement.
- Added new pages for customer interactions, including `CustomerChatPage`, `CustomerProfilePage`, `CustomerHoldingsPage`, and `CustomerTradesPage`, integrating chat capabilities seamlessly.
- Enhanced the advisor experience with the `AdvisorCustomersPage` and `RiskAlertsPage`, allowing for efficient management of customer interactions and risk alerts.
- Updated routing and state management to support new chat functionalities, ensuring a cohesive user experience across the application.

This update significantly improves the chat capabilities within the application, providing users with enhanced tools for communication and support.
2026-09-09 20:17:50 +08:00
zhanghongyu_0626 2945108f66 feat(kb): Enhance knowledge base with new collections and search functionality
- Added new configuration for knowledge base root directory in `.env.example` and `settings.py`.
- Implemented `find_products` method in `CoreReadOnlyRepository` for fuzzy product search based on user queries.
- Introduced `search_cs_knowledge` function in `rag_service.py` to facilitate semantic search across new `fin_*` collections.
- Updated document parsing to support Markdown and YAML front-matter for knowledge base entries.
- Created multiple new FAQ and policy documents in the `data/kb_collections` directory to enrich the knowledge base.

This update significantly improves the knowledge retrieval capabilities for customer service interactions, ensuring more relevant and accurate responses.
2026-09-09 20:00:06 +08:00
zhanghongyu_0626 b841f68295 feat(visitor): Implement visitor chat functionality and enhance customer service interactions
- Added a new visitor chat API endpoint (`/api/chat/visitor`) to allow unauthenticated users to engage in conversations without requiring customer data.
- Introduced a visitor context dependency to manage visitor interactions seamlessly.
- Enhanced the chat API to support explicit session termination and improved response handling for customer service interactions.
- Updated the database configuration to include Redis client support for caching visitor data.
- Added a new customer note repository to persist user notes independently of the L1 profile slots.

This update significantly improves the customer service experience by enabling visitor interactions and ensuring efficient data handling for both registered and unregistered users.
2026-09-09 18:32:00 +08:00
zhanghongyu_0626 ad930c26b1 feat(frontend): Implement initial P0 scaffolding and enhance dashboard features
- Established the P0 scaffolding for the frontend, including login, layout, and routing for four roles.
- Integrated the Customer Wealth Dashboard, Advisor Clients Dashboard, Analyst Market Dashboard, and Risk Alerts Dashboard.
- Updated the API client to support fetching customer and product data, enhancing the overall functionality of the dashboard.
- Added error handling components to improve user experience during data fetching.
- Enhanced charting capabilities using Ant Design Charts for better data visualization.

This update lays the groundwork for further development of the frontend application, ensuring a robust structure for future features and integrations.
2026-09-09 15:50:33 +08:00
zhanghongyu_0626 93cd3a165c Revert "chore(agent): sync updated Cursor User Rules to project agent config"
This reverts commit 8ec7ca5e75.
2026-09-09 11:56:01 +08:00
zhanghongyu_0626andCursor 8ec7ca5e75 chore(agent): sync updated Cursor User Rules to project agent config
Add .cursor/rules/user-rules.mdc so team members get the same User Rules from the repo clone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 11:53:43 +08:00
zhanghongyu_0626andCursor e9978a4066 chore(agent): add codebase-to-course skill to project agent config
Sync the interactive codebase-to-course skill into .cursor/skills so teammates get it from the repo clone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-09 11:44:48 +08:00
zhanghongyu_0626 b881893575 feat(chat): Enhance assistant content handling with disclaimer management
- Introduced a new function `_assistant_content_for_persist` to append disclaimers to assistant responses, ensuring consistency in stored content.
- Updated `chat_api` and `chat_stream_api` to utilize the new function for managing assistant replies, improving data integrity.
- Added tests to verify the correct handling of disclaimers in various scenarios, ensuring compliance with expected output.

This update enhances the chat system's reliability by ensuring that disclaimers are consistently applied to assistant responses, improving user experience and data accuracy.
2026-09-09 10:42:24 +08:00
zhanghongyu_0626 cbcac98cdd feat(docs): Update API documentation and add new specifications for market data
- Enhanced AGENTS.md to include new draft specifications for market data in Phase B.
- Updated MEMORY.md with details on the C-05 market data source selection and the new API contract for v0.2.
- Introduced a new document for frontend P0 design specifications, outlining the architecture and features for the initial web application.
- Added a new document for C-05 market data source comparison, detailing the requirements and options for future data integration.
- Updated existing API contracts to reflect the latest changes and ensure consistency across documentation.

This update improves the clarity and comprehensiveness of the API documentation, supporting ongoing development efforts and future integrations.
2026-09-09 10:29:08 +08:00
zhanghongyu_0626 d0da627a5c feat(chat): Update trace ID handling in chat stream API
- Modified `chat_stream_api` to use `new_trace()` instead of an empty string for `trace_id`, enhancing traceability.
- Added tests to verify the correct generation and propagation of `trace_id` in responses, ensuring no empty trace IDs are sent to clients.

This update improves the tracking of chat sessions and ensures compliance with traceability standards.
2026-09-08 21:46:08 +08:00
zhanghongyu_0626 c9cac1cdf9 feat(api): 更新代销平台 API v0.1,增强适当性检查功能
- 在 `risk_suitability_log` 表中新增 `check_source` 枚举值 `platform`,支持代销平台的适当性检查。
- 更新相关 SQL 脚本以适应新的数据结构,确保数据一致性。
- 修改文档以反映 API 的最新状态和测试基线,确保文档与实现保持一致。
- 测试基线更新至 530 passed, 0 skipped,确保系统稳定性。

此更新为代销平台提供了更全面的适当性检查能力,提升了系统的功能性与可维护性。
2026-09-08 21:44:16 +08:00
zhanghongyu_0626 ef56c56435 feat(api): 实现代销平台 API v0.1,包括客户、产品、理财师、合规及员工接口
- 新增多个 API 路由:`/api/customers`, `/api/products`, `/api/advisors`, `/api/compliance`, `/api/staff`,支持客户信息、产品详情、理财师客户列表、合规判定及员工上下文查询。
- 引入平台服务层,封装核心只读操作,支持数据脱敏功能。
- 更新依赖注入,确保各 API 路由的权限控制与数据访问一致性。
- 添加相应的单元测试,确保新接口的功能完整性与稳定性。

此更新为代销平台提供了基础的 REST API 支持,增强了系统的可扩展性与可维护性。
2026-09-08 21:01:07 +08:00
zhanghongyu_0626 f0bce1270b feat(api): 添加代销平台 API 契约文档及相关更新
- 新增《接口契约-代销平台API-v0.1.md》,定义代销平台 REST API 的路由风格、命名规范及端点清单。
- 更新 AGENTS.md,包含代销平台 API 契约的路径信息。
- 修改 ITERATION.md 和 MEMORY.md,反映代销平台 API 的实施进度及相关文档的状态。
- 更新 TODO.md,明确代销平台 API 的实现优先级。

此更新为代销平台 API 的开发提供了清晰的指导,确保各模块间的接口一致性与可维护性。
2026-09-08 20:18:00 +08:00
zhanghongyu_0626 f87e11f104 feat(merge): 完成 AL-09 合并接线,整合风控模块与宿主 Wave 0
- 合并 `risk-control-agent` 分支至 `merger`,实现 JWT 统一与模块 API 恢复。
- 更新 `auth_service` 和 `auth_adapter`,确保对外登录/token 统一。
- 增强 chat 模块,支持会话管理与流式对话(SSE)。
- 测试基线更新至 502 passed, 1 skipped,确保系统稳定性。

此更新标志着风控模块的成功集成,提升了系统的整体功能与可维护性。
2026-09-08 20:00:39 +08:00
zhanghongyu_0626 6d780d45c3 feat(auth): Enhance JWT handling and error management in authentication flow
- Updated the login endpoint to utilize shared JWT issuer/audience settings, improving consistency across modules.
- Introduced error handling for unknown accounts during token issuance, raising an UnauthorizedError when necessary.
- Enhanced traceability by adding trace and request IDs to responses, ensuring better tracking of requests.
- Refactored exception handling in middleware to properly bubble up application-specific errors, preventing them from being swallowed.
- Added new utility functions for generating trace headers to improve debugging capabilities.

This update strengthens the authentication process and enhances error visibility, contributing to a more robust and maintainable codebase.
2026-09-08 19:55:08 +08:00
zhanghongyu_0626 04c12152f6 feat(chat): 重构对话接口与服务,增强会话管理与工具节点支持
- 更新 chat.py,整合四个 Agent 的统一入口,增加输入防护与会话校验逻辑。
- 扩展 agent_service.py,加入工具节点与 LLM 交互,支持意图匹配与合规护栏。
- 改进 memory_service.py,优化会话窗口管理,支持 Redis 与 MySQL 的数据同步。

此更新提升了对话系统的安全性与可扩展性,确保了会话数据的可靠性与合规性。
2026-09-08 19:54:46 +08:00
zhanghongyu_0626andCursor 452b427365 merge: 合并远程 risk-control-agent 到 merger
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-08 17:56:12 +08:00
zhanghongyu_0626 4685dce518 Update README.md to refine project deliverables and clarify document relationships
- Changed section title from "三份交付物" to "交付物" for clarity.
- Added a new document entry for "04-从需求到公共API开发方法.md" detailing the development methodology from requirements to API.
- Enhanced the explanation of the relationships between documents to better illustrate their interconnections and usage contexts.
2026-09-08 17:47:53 +08:00
zhanghongyu_0626 7d854e03ff Add project management documentation for JinRong financial project
- Introduced three key documents:
  - **01-每日会议纪要模板与流程.md**: A template for daily meeting minutes and processes.
  - **02-项目开发计划.md**: A project-level development plan outlining the project timeline, team roles, and dependencies.
  - **03-表设计文档.md**: A readable table design document serving as a dictionary for understanding database structures and relationships.
- Created a README.md to index project management documents and their purposes.
- Enhanced documentation to support a 5-person full-stack novice team in project execution and collaboration.
2026-09-07 20:04:53 +08:00
zhanghongyu_0626andCursor ecdf8b5395 Add Docker compose and bootstrap script; ignore override yml only
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 17:42:43 +08:00
zhanghongyu_0626 3995cb44d8 Implement authentication and chat functionality with JWT support
- Added `auth.py` for mock login and JWT issuance.
- Introduced `chat.py` for handling chat requests with role-based access control.
- Enhanced `main.py` to include new routers and middleware for tracing.
- Implemented input validation in `input_guard.py` to prevent SQL injection.
- Created repositories for managing agent sessions and audit logs.
- Added exception handling for authorization errors.
- Updated settings to include JWT configuration.
- Introduced tests for authentication and input validation.
2026-09-07 17:20:42 +08:00
zhanghongyu_0626 2c5440b8b0 Update ENVIRONMENT and ITERATION documentation; add industry background and role research
- Enhanced `ENVIRONMENT.md` with a new section on platform positioning and industry context, detailing the project's role as a comprehensive wealth management institution.
- Updated the service roles table to include insights from the four-role industry research.
- Added new files for "平台与行业背景" and "四角色行业调研" to provide detailed context and operational insights for the project's agents.
- Revised `ITERATION.md` to reflect the addition of these new documents and their relevance to user requirements.
2026-09-07 11:53:38 +08:00
zhanghongyu_0626 3fb0ceb334 Enhance suitability assessment and documentation
- Implemented `check_suitability` method in `CoreReadOnlyRepository` for suitability determination based on customer and product risk levels.
- Added `build_suitability_log_row` function in `suitability.py` for mapping suitability check results to `risk_suitability_log`.
- Updated `AGENTS.md`, `ENVIRONMENT.md`, and `FLOW.md` to reflect changes in suitability assessment processes and documentation.
- Revised `FRAMEWORK.md` and `MEMORY.md` to clarify project structure and data flow related to suitability checks.
- Expanded `TODO.md` with tasks related to logging and auditing suitability assessments.
2026-09-07 11:15:30 +08:00
zhanghongyu_0626 1ddd44a6cb Add core database support and enhance documentation
- Introduced `MYSQL_CORE_DATABASE` in `.env.example` and `settings.py` for core database configuration.
- Added `CoreReadOnlyRepository` for read-only access to the `jinrong_core` database.
- Updated `AGENTS.md`, `README.md`, and various documentation files to reflect new agent onboarding processes and project structure.
- Revised requirements in `requirements.txt` to include `langgraph` and `langchain-core`.
- Enhanced `FLOW.md` with local bootstrap instructions for setting up the core simulation environment.
- Added new scripts for database creation and seeding for the core simulation library.
- Improved overall documentation for clarity on project architecture and memory management.
- Updated `TODO.md` to reflect current development priorities and tasks.
2026-09-05 17:39:16 +08:00
zhanghongyu_0626 0374010b37 Implement initial project structure and setup 2026-09-05 17:09:21 +08:00
zhanghongyu_0626andCursor 53701dbb48 Initial commit
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 17:23:15 +08:00