From d198fb88cb9e387e88397e99d72245b05a8878b7 Mon Sep 17 00:00:00 2001 From: "agent.develop" Date: Mon, 21 Sep 2026 13:26:47 +0800 Subject: [PATCH] =?UTF-8?q?docs(m5a):=20README=20=E8=A1=A8=E5=88=97?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=8E=20models/*.json=20=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=20+=20=E8=A1=A5=20init/data.json=20=E7=A7=8D=E5=AD=90?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0da7144..87f5285 100644 --- a/README.md +++ b/README.md @@ -60,14 +60,14 @@ PBL(项目式学习)的**产出物与学习证据**模块。它做两件事 |----|------|------| | `id` | str(32) PK | 主键 | | `tenant_id` | str(32) NOT NULL | 租户(强制打头,缺失 fail-closed) | -| `artifact_uid` | str(64) | 业务唯一码,与 tenant 组成唯一键 | +| `artifact_uid` | str(32) | 业务唯一码,与 tenant 组成唯一键 | | `session_id` / `blueprint_id` / `team_id` | str(32) | 会话 / 蓝图 / 团队归属 | | `creator_id` | str(32) | 作者(学习者) | -| `title` | str(255) | 标题 | -| `artifact_type` | str(64) | 类型(编码 `pbl_artifact_type`) | +| `title` | str(128) | 标题 | +| `artifact_type` | str(64) | 类型(编码 `pbl_artifact_type`,默认 `other`) | | `content_json` | text | 产出物内容(序列化 JSON) | -| `version_no` | str(32) | 版本号(内联,版本快照由蓝图侧维护) | -| `status` | str(32) | 状态(编码 `pbl_artifact_status`) | +| `version_no` | int | 版本号(内联,默认 1;版本快照由蓝图侧维护) | +| `status` | str(64) | 状态(编码 `pbl_artifact_status`,默认 `draft`) | | `submitted_at` / `created_at` / `updated_at` | datetime | 时间与审计列(**应用层写入**,sqlor 不自动填) | 索引:`uk_art_uid(tenant_id, artifact_uid)` 唯一;`idx_art_session` / `idx_art_blueprint` / @@ -80,7 +80,7 @@ PBL(项目式学习)的**产出物与学习证据**模块。它做两件事 | `id` | str(32) PK | 主键 | | `tenant_id` | str(32) NOT NULL | 租户 | | `artifact_id` | str(32) | 归属产出物(`'0'` = 无强归属的观测类证据) | -| `evidence_type` | str(64) | 证据类型(编码 `pbl_evidence_type`,8 类) | +| `evidence_type` | str(64) | 证据类型(编码 `pbl_evidence_type`,8 类,源自 `evidence_map.EVIDENCE_TYPES`) | | `source_event_id` | str(32) NOT NULL | 来源 runtime_event 事件 ID(幂等锚点) | | `session_id` / `learner_id` / `blueprint_id` | str(32) | 查询维度 | | `payload_json` | text | 证据体(事件摘要序列化 JSON) | @@ -115,7 +115,11 @@ mysql -h -u -p < mysql.ddl.sql # 3) 生成 CRUD 前端(可选;已有手写 api/ dspy 时按 build.sh 流程执行) cd json && xls2ui -m ../models -o ../wwwroot pbl_evidence *.json -# 4) 登记 RBAC 权限(双层:模块层 + 中央宿主层,见下) +# 4) 导入编码种子(3 组 appcodes:pbl_artifact_type / pbl_artifact_status / pbl_evidence_type) +# Format B,由宿主 scripts/init_data.py(或 dbloader)读入 init/data.json 落 appcodes + appcodes_kv +python3 -c "import json;d=json.load(open('init/data.json'));print('groups:',[g['parentid'] for g in d['appcodes']])" + +# 5) 登记 RBAC 权限(双层:模块层 + 中央宿主层,见下) python3 scripts/load_path.py --check # 清单与 wwwroot 磁盘一致性核对(不连库) RBAC_SET_PERM=/path/to/set_role_perm.py python3 scripts/load_path.py # 实际写权限 ```