world/docs/work-log.md

47 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Work Log — 2025-01-xx
## Scope / Background
- 任务W-01 世界管理world 模块new_devtask_id gvpV_sE3EQghCY2yNovFT元景项目初始迭代
- 仓库:机构 modules/world/
- 目标world 表 CRUD + 列表查询(sqlPaging+复合索引) + 创建自动编码 + mode 白名单/流转校验 +
world_mode 编码字典幂等落库 + /api/* REST + 统一错误结构 + 分页结构
## Timeline / Commits
git log --oneline 输出见下方验证区)
## Key Technical Decisions
1. mode 校验集中在 world.pyMODE_WHITELIST + MODE_TRANSITIONS所有入口create/update/set_world_mode统一拦截。
2. 自动编码 W+时间戳+随机4位唯一索引兜底 + Duplicate key 重试 3 次。
3. 列表查询count 与数据分离、显式列清单(排除 TEXT、idx_world_list(org_id,mode,created_at) 复合索引。
4. 下拉数据源从 appcodes_kv 读world_mode/world_type字典不可用回退英文标签避免硬编码中文。
5. init.py 单数/复数双注册create_world/create_worlds满足 CRUD 框架 dspy 包装器调用约定。
## VerificationQC 硬证据)
```
$ python3 -m py_compile world/world.py world/init.py world/__init__.py scripts/load_path.py
(无输出 = 通过)
$ grep -rn "^import\|^from" wwwroot/ --include='*.dspy'
(无输出 = 通过dspy 零 import
$ grep -rn "print\|uuid" wwwroot/ --include='*.dspy'
(无输出 = 通过)
$ python3 -c "import json; \
json.load(open('init/data.json')); json.load(open('models/world.json')); json.load(open('json/world.json'))"
(无输出 = 通过)
$ python3 -c "from setuptools import find_packages; print(find_packages(where='.'))"
['world'] # 仅包目录,根目录无 __init__.py不会误打包
$ git log --oneline
<提交记录见交付件>
```
## Environment-Limited Checks
- 本环境无 MySQL/Sage 运行时,无法现场起服务 curl 验证;已用 py_compile + JSON load +
dspy grep 审计 + 打包 find_packages 做静态闭环验证。部署时按 build.sh 生成 DDL/CRUD UI 并落库。
## Current State
- 分支/提交:见 git log模块代码已本地提交QC 核验硬证据)。