chore: record journal
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
<!-- @@@auto:current-status -->
|
<!-- @@@auto:current-status -->
|
||||||
- **Active File**: `journal-1.md`
|
- **Active File**: `journal-1.md`
|
||||||
- **Total Sessions**: 6
|
- **Total Sessions**: 7
|
||||||
- **Last Active**: 2026-04-13
|
- **Last Active**: 2026-04-15
|
||||||
<!-- @@@/auto:current-status -->
|
<!-- @@@/auto:current-status -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<!-- @@@auto:active-documents -->
|
<!-- @@@auto:active-documents -->
|
||||||
| File | Lines | Status |
|
| File | Lines | Status |
|
||||||
|------|-------|--------|
|
|------|-------|--------|
|
||||||
| `journal-1.md` | ~318 | Active |
|
| `journal-1.md` | ~413 | Active |
|
||||||
<!-- @@@/auto:active-documents -->
|
<!-- @@@/auto:active-documents -->
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<!-- @@@auto:session-history -->
|
<!-- @@@auto:session-history -->
|
||||||
| # | Date | Title | Commits |
|
| # | Date | Title | Commits |
|
||||||
|---|------|-------|---------|
|
|---|------|-------|---------|
|
||||||
|
| 7 | 2026-04-15 | 六爻算法修复 + Prompt架构重构 + i18n输出规则 | `9598d16`, `be68681` |
|
||||||
| 6 | 2026-04-13 | 修复追问链路与上限判定 | - |
|
| 6 | 2026-04-13 | 修复追问链路与上限判定 | - |
|
||||||
| 5 | 2026-04-13 | feat: 邀请码显示功能 - 后端API + 前端对接 | - |
|
| 5 | 2026-04-13 | feat: 邀请码显示功能 - 后端API + 前端对接 | - |
|
||||||
| 4 | 2026-04-13 | 绑定积分重注册余额恢复提交 | `c55be6d` |
|
| 4 | 2026-04-13 | 绑定积分重注册余额恢复提交 | `c55be6d` |
|
||||||
|
|||||||
@@ -316,3 +316,98 @@
|
|||||||
### Next Steps
|
### Next Steps
|
||||||
|
|
||||||
- None - task complete
|
- None - task complete
|
||||||
|
|
||||||
|
|
||||||
|
## Session 7: 六爻算法修复 + Prompt架构重构 + i18n输出规则
|
||||||
|
|
||||||
|
**Date**: 2026-04-15
|
||||||
|
**Task**: 六爻算法修复 + Prompt架构重构 + i18n输出规则
|
||||||
|
|
||||||
|
### Summary
|
||||||
|
|
||||||
|
(Add summary)
|
||||||
|
|
||||||
|
### Main Changes
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
本次会话完成了六爻核心算法的全面审计修复、prompt架构重构清理、以及多语言输出规则适配。
|
||||||
|
|
||||||
|
### 算法修复 (P0/P1)
|
||||||
|
|
||||||
|
| 问题 | 修复内容 |
|
||||||
|
|------|----------|
|
||||||
|
| P0-1 空亡判断 | 改为仅从日柱计算,年月空亡仅标注不断事 |
|
||||||
|
| P0-2 暗动逻辑 | 重写为静爻+旺相+日冲三条件 |
|
||||||
|
| P1-1 月破 | 独立标注 |
|
||||||
|
| P1-2 动不为空/旺不为空 | 补充判断 |
|
||||||
|
| P1-3 三合局 | 新增判断逻辑 |
|
||||||
|
| P1-4 反吟伏吟 | 新增判断逻辑 |
|
||||||
|
| P1-5 日辰十二长生 | 新增字段 `riChenZhangSheng` |
|
||||||
|
| P1-6 回头生克 | 新增判断逻辑 |
|
||||||
|
|
||||||
|
### Prompt架构重构
|
||||||
|
|
||||||
|
- **删除 `_build_env_section`**:不再向prompt泄露用户上下文(user_context、timezone、client_time等)
|
||||||
|
- **简化语言判断**:删除 `if is_chinese` 分支,`_LANGUAGE_LABELS` 已覆盖全部语言映射
|
||||||
|
- **安全规则改为六爻专属**:只回答六爻占卜相关问题,拒绝无关提问
|
||||||
|
- **`_WORKER_OUTPUT_RULES` 多语言适配**:zh-CN/zh-Hant/en 三版本,按 `ai_language` 分发
|
||||||
|
- **`_WORKER_ROLE_PLAYING` 始终中文**:保证六爻专业性不受语言切换影响
|
||||||
|
- **`sign_level` 枚举统一**:所有语言版本强制使用简体中文枚举值(上上签/中上签/中下签/下下签),前端负责显示映射
|
||||||
|
- **`worker_rules.py` 独立文件**管理多语言规则
|
||||||
|
|
||||||
|
### 清理死代码
|
||||||
|
|
||||||
|
- 删除 `UserPreferences`/`RuntimePromptContext` 及全部辅助函数
|
||||||
|
- 删除 runner 中 `runtime_client_time` 参数链路
|
||||||
|
- 删除 `SystemAgentRuntimeConfig.extra_context`
|
||||||
|
- 删除 `sections.py` 中 `env` section marker
|
||||||
|
- 删除 `AgentPromptRegistry` 死代码
|
||||||
|
- runner 中 `ai_language` 从 `user_context.settings.preferences` 提取传入prompt
|
||||||
|
|
||||||
|
### 安全规则
|
||||||
|
|
||||||
|
- `AGENTS.md` 添加 Git Safety 规则(禁止未经批准的破坏性git操作)
|
||||||
|
- `.opencode/opencode.json` 添加高危git命令审批配置
|
||||||
|
|
||||||
|
### 测试
|
||||||
|
|
||||||
|
- 新增 22 个六爻算法单元测试
|
||||||
|
- 重写 7 个 prompt 测试适配新签名
|
||||||
|
- 全部 85 个单元测试通过
|
||||||
|
|
||||||
|
**修改文件 (14)**:
|
||||||
|
- `backend/src/core/divination/derivation.py`
|
||||||
|
- `backend/src/schemas/domain/divination.py`
|
||||||
|
- `apps/lib/features/divination/data/models/divination_backend_models.dart`
|
||||||
|
- `backend/src/core/agentscope/prompts/system_prompt.py`
|
||||||
|
- `backend/src/core/agentscope/prompts/agent_prompt.py`
|
||||||
|
- `backend/src/core/agentscope/prompts/worker_rules.py` (新)
|
||||||
|
- `backend/src/core/agentscope/prompts/sections.py`
|
||||||
|
- `backend/src/core/agentscope/prompts/user_prompt.py`
|
||||||
|
- `backend/src/core/agentscope/runtime/runner.py`
|
||||||
|
- `backend/tests/unit/test_agentscope_prompts.py`
|
||||||
|
- `backend/tests/unit/test_divination_derivation.py` (新)
|
||||||
|
- `docs/plans/liuyao-algorithm-audit.md`
|
||||||
|
- `AGENTS.md`
|
||||||
|
- `.opencode/opencode.json`
|
||||||
|
|
||||||
|
|
||||||
|
### Git Commits
|
||||||
|
|
||||||
|
| Hash | Message |
|
||||||
|
|------|---------|
|
||||||
|
| `9598d16` | (see git log) |
|
||||||
|
| `be68681` | (see git log) |
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
- [OK] (Add test results)
|
||||||
|
|
||||||
|
### Status
|
||||||
|
|
||||||
|
[OK] **Completed**
|
||||||
|
|
||||||
|
### Next Steps
|
||||||
|
|
||||||
|
- None - task complete
|
||||||
|
|||||||
Reference in New Issue
Block a user