第4轮复测三门禁全红的 develop 侧根因(实测核验,非照抄报单结论): 1. /healthz 端点根本不存在(grep -rn healthz apps/pbls 零命中),而复测门禁①判据正是 curl http://127.0.0.1:9380/healthz;build.sh 自检却走另一条 /api/public/health(同样无实现) → 进程活着也必然 HTTP!=200,且存在「自检绿/复测红」假通过隐患。 2. build.sh 从不调 scripts/load_path.py(grep 零命中)→ 新端点无 RBAC 登记即 401/403。 3. build.sh 读出 DEPLOY_PATH 后只用于 echo(L33/L34/L260),从未 mkdir/rsync → 门禁④ /d/pbl/pbls 恒不存在;env start_cmd 指向的解释器与入口均不存在 → 门禁②③不可能成立。 4. logs/ 目录到步骤13才 mkdir,而步骤11已 tee logs/self_check.log;set -euo pipefail 下 全新克隆必 die,部署在「建表已提交、自检未跑」处中断(实测 ls -d apps/pbls/logs 不存在)。 修复(同类问题全量排查,不只修报出来的那一个): - 新增 wwwroot/healthz/index.dspy、wwwroot/healthz.dspy、wwwroot/api/public/health/index.dspy 三个探针(零 import / 每分支显式 return json.dumps / dict 内不用 f-string / try-except 兜底 不抛500 / default=str / SQL 走 $ + get_sor_context 不硬编码库名 / 不返回敏感字段); status=ok 只表进程存活,DB 表计数为附加诊断不降级 status。 - build.sh 新增步骤 10b(mkdir logs run 前置)、12.5(load_path.py --check 门禁 + 正式注册, 失败明确 die 不静默)、12.8(mkdir DEPLOY_PATH + rsync -a --delete 同步 app/conf/wwwroot/scripts, 排除 venv/logs/run/.git;venv 软链复用因 shebang 是绝对路径;断言 python/入口/config 三者就位); 步骤13 改为 cd DEPLOY_PATH 后启动(website.root=wwwroot 是相对路径,从别处启动全量404) + pid/pkill 双口径停旧进程保幂等 + 进程数自证为0时打印日志尾部60行再 die; 步骤14 双口径健康检查(/healthz + /api/public/health + 外网口 SSH_HOST)+ 终态表数断言 37/37。 - scripts/load_path.py 新增 HOST_PATHS 四条(/healthz、/healthz.dspy、/api/public/health、 /api/public/health.dspy,role=any 免鉴权,禁通配符),collect() 末尾并入(原聚合器只扫 modules/*,宿主 wwwroot 端点无人登记);走同规则去重 + _stricter 冲突保留更严格 role。 - 旧口径 9300→9380 清理 4 处:build.sh:4 头注释、wwwroot/index.ui:179 状态栏(用户可见)、 pbl_appcodes/__init__.py:14、pbl_appcodes/init.py:16;_patch_common_contract_symbols.py:9 属历史修复台账,有意保留原文不改(改历史记录=伪造)。 - conf/config.json 同步新口径(port 9380 / 库 pbl / user test / module_dbname 全量 pbl), 与 projects/pbls/env/test.json 唯一事实源同值,满足 build.sh 步骤1 端口一致性门禁。 自证(真实回显):bash -n build.sh OK;py_compile load_path.py OK; load_path.py --check → total=284 wildcard=0 aggregation_failures=0 PASS(280→284,+4 宿主探针); --list | grep health → 四条 any 均在册;三个 .dspy 经 ast.parse 包装校验 AST OK、 no import/no print、return×2;grep -rn 9300 于四处改动文件零命中。 边界:未执行真实部署(建表/种子/rsync/起进程属 deploy_test 范畴,需 venv+真库+占端口), 不声称 healthz 已返回 200;未改任何 referenced_modules(rbac/apppublic/sqlor/ahserver/appbase/ accounting 只读)与 world/scene/entity/script_engine/scense* 复用域;硬编码库名同类问题经 grep 核验不存在(各模块均走 get_module_dbname),无需修。 详见 projects/pbls/docs/02-develop/dev-notes.md 2026-09-25 节。
187 lines
5.9 KiB
XML
187 lines
5.9 KiB
XML
{
|
||
"type": "UiWindow",
|
||
"id": "pbls_main_window",
|
||
"options": {
|
||
"title": "PBL Agent OS",
|
||
"layout": "border"
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "Panel",
|
||
"id": "pbls_topbar",
|
||
"options": {
|
||
"region": "north",
|
||
"height": 56,
|
||
"layout": "hbox",
|
||
"cls": "pbls-topbar"
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "Label",
|
||
"id": "pbls_app_title",
|
||
"options": {
|
||
"text": "PBL Agent OS",
|
||
"cls": "pbls-app-title"
|
||
}
|
||
},
|
||
{
|
||
"type": "Label",
|
||
"id": "pbls_phase_label",
|
||
"options": {
|
||
"text": "Phase 0/1 · 蓝图 → 校验 → 编译 → Agent 运行时",
|
||
"cls": "pbls-phase"
|
||
}
|
||
},
|
||
{
|
||
"type": "Button",
|
||
"id": "pbls_btn_logout",
|
||
"options": {
|
||
"text": "退出",
|
||
"align": "right",
|
||
"handler": "app.pbls_logout"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"type": "Menu",
|
||
"id": "pbls_nav_menu",
|
||
"options": {
|
||
"region": "west",
|
||
"width": 220,
|
||
"title": "功能导航"
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_blueprint",
|
||
"options": {
|
||
"text": "蓝图管理",
|
||
"target": "/pbl_blueprint/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_validation",
|
||
"options": {
|
||
"text": "蓝图校验(14 维)",
|
||
"target": "/pbl_validation/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_compiler",
|
||
"options": {
|
||
"text": "编译器 / Game Definition",
|
||
"target": "/pbl_compiler/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_agent_runtime",
|
||
"options": {
|
||
"text": "Agent 运行时(22 工具)",
|
||
"target": "/pbl_agent_runtime/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_evidence",
|
||
"options": {
|
||
"text": "产出物与证据",
|
||
"target": "/pbl_evidence/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_assessment",
|
||
"options": {
|
||
"text": "Rubric 评估报告",
|
||
"target": "/pbl_assessment/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_appcodes",
|
||
"options": {
|
||
"text": "枚举编码",
|
||
"target": "/pbl_appcodes/index.ui"
|
||
}
|
||
},
|
||
{
|
||
"type": "MenuItem",
|
||
"id": "mi_governance",
|
||
"options": {
|
||
"text": "治理与审计",
|
||
"target": "/pbl_governance/index.ui"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"type": "TabPanel",
|
||
"id": "pbls_main_tabs",
|
||
"options": {
|
||
"region": "center",
|
||
"closable": true
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "Panel",
|
||
"id": "tab_home",
|
||
"options": {
|
||
"title": "首页",
|
||
"layout": "vbox"
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "Label",
|
||
"id": "home_welcome",
|
||
"options": {
|
||
"text": "欢迎使用 PBL Agent OS。请从左侧导航选择功能模块。",
|
||
"cls": "pbls-welcome"
|
||
}
|
||
},
|
||
{
|
||
"type": "DataViewer",
|
||
"id": "home_blueprint_list",
|
||
"options": {
|
||
"title": "最近蓝图",
|
||
"url": "/api/pbl_blueprint_list.dspy",
|
||
"pageSize": 10
|
||
}
|
||
}
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"type": "Panel",
|
||
"id": "pbls_statusbar",
|
||
"options": {
|
||
"region": "south",
|
||
"height": 28,
|
||
"layout": "hbox"
|
||
},
|
||
"children": [
|
||
{
|
||
"type": "Label",
|
||
"id": "status_tenant",
|
||
"options": {
|
||
"text": "租户:-",
|
||
"cls": "pbls-status"
|
||
}
|
||
},
|
||
{
|
||
"type": "Label",
|
||
"id": "status_port",
|
||
"options": {
|
||
"text": "端口:9380",
|
||
"cls": "pbls-status"
|
||
}
|
||
}
|
||
]
|
||
}
|
||
]
|
||
}
|