approve: world 模块开发(W-01 世界管理)
This commit is contained in:
parent
de9ab91533
commit
33005dfae7
@ -7,7 +7,8 @@
|
||||
world_mode 编码字典幂等落库 + /api/* REST + 统一错误结构 + 分页结构
|
||||
|
||||
## Timeline / Commits
|
||||
(git log --oneline 输出见下方验证区)
|
||||
- de9ab91 fix(world): 删除模块根目录遗留 __init__.py
|
||||
- 22b18f5 feat(world): W-01 世界管理模块(world 表 CRUD/列表/自动编码/mode 校验/编码字典)
|
||||
|
||||
## Key Technical Decisions
|
||||
1. mode 校验集中在 world.py(MODE_WHITELIST + MODE_TRANSITIONS),所有入口(create/update/set_world_mode)统一拦截。
|
||||
@ -17,30 +18,18 @@
|
||||
5. init.py 单数/复数双注册(create_world/create_worlds),满足 CRUD 框架 dspy 包装器调用约定。
|
||||
|
||||
## Verification(QC 硬证据)
|
||||
```
|
||||
$ 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
|
||||
<提交记录见交付件>
|
||||
```
|
||||
- py_compile:world/world.py world/init.py world/__init__.py scripts/load_path.py → OK
|
||||
- dspy 审计:wwwroot/api/*.dspy grep import/print/uuid → 无输出(零违规)
|
||||
- JSON 合法性:init/data.json、models/world.json、json/world.json → JSON OK
|
||||
- models 四段式:sections=[codes,fields,indexes,summary];primary=[id];id=str 32;
|
||||
indexes=[idx_world_code unique(code), idx_world_list index(org_id,mode,created_at)]
|
||||
- CRUD 格式:tblname + params(browserfields/editable/new/update/delete_data_url)
|
||||
- 打包验证:find_packages(where='.') → ['world'](仅包目录,根目录无 __init__.py 不误打包)
|
||||
- git log:de9ab91 / 22b18f5(模块代码已本地提交)
|
||||
|
||||
## Environment-Limited Checks
|
||||
- 本环境无 MySQL/Sage 运行时,无法现场起服务 curl 验证;已用 py_compile + JSON load +
|
||||
dspy grep 审计 + 打包 find_packages 做静态闭环验证。部署时按 build.sh 生成 DDL/CRUD UI 并落库。
|
||||
|
||||
## Current State
|
||||
- 分支/提交:见 git log;模块代码已本地提交(QC 核验硬证据)。
|
||||
- 模块代码已本地提交(de9ab91),根目录无遗留 __init__.py,包目录 world/world/。
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user