pbls/requirements.txt
agent.develop 149dd5c811 fix(pbls): 修复 Bug BWY68rZR_Uh2A41JlGT7D + elS7VxwO7ufbPiPl-ucGA —— build.sh WS_DIR 部署路径推导失效(第7轮 /d/pbl/pbls 未落地代码侧根因)+ requirements 幻影依赖 hashlib-additional + 新增硬门禁 6.6 依赖声明可满足性静态校验(含 40 个模块 pyproject 同类缺陷扫描)+ rsync 缺失 tar 兜底
缺陷1(新发现): WS_DIR=/../.. 只在机构工作空间成立;部署到 env.deploy.path=/d/pbl/pbls 后 WS_DIR=/d,ENV_FILE/WHEELHOUSE/modules 全不存在 → 第0步即 die,build.sh 在部署目录从未跑通 → venv未建/DDL未落库(表数0-37)/进程未起/9380无LISTEN/healthz=000/42条用例blocked。改为 _ws_probe() 三段式(环境变量覆盖 PBL_WS_DIR/WS_DIR_OVERRIDE/WS_DIR → 逐级向上探测含 projects/pbls/env/test.json 的目录 → 兜底绝对路径),WHEELHOUSE 支持 PBL_WHEELHOUSE 覆盖。三场景实测全绿(含 /d/pbl/pbls)。

缺陷2: requirements.txt 幻影依赖 hashlib-additional>=1.0.1 ; python_version<3.0(hashlib 是标准库,marker 恒假;公共源真实名 hashlib_additional 对不上) → 删除。业主口径4项缺陷复扫确认已闭环: 基座7包==版本与 wheelhouse 实物逐字一致、pybricks/mysqlclient/10.20.30.41/相对find-links 生效行残留全0;pip download --no-deps 真实可满足性验证全部 Saved 零 No matching distribution。

缺陷3(机制根因): 门禁6.5 只 grep 声明存在不校验可满足 → 新增硬门禁6.6 scripts/check_requirements_satisfiable.py(349行) 7类校验(幻影包黑名单/标准库误当第三方/基座==版本与wheelhouse一致/wheelhouse覆盖完整/门禁6.5六项/失效内网源/相对find-links),按任务要求同步扫描 40 个 modules/*/pyproject.toml 同类缺陷并输出本地模块依赖图(pbl_common <- pbl_analytics/pbl_appcodes/pbl_blueprint)与 build.sh R8 拓扑序交叉验证。负向测试构造8类缺陷抓出17项FAIL rc=1(证明非空壳);正向 PASS 20项声明/基座7包一致/40模块零幻影。

附带加固: rsync 缺失(pbl 无 sudo 可能未装)时退化 tar 管道复制,避免部署目录建不出来。

自检: bash -n OK / py_compile OK / 门禁6.6 PASS / DDL 37表 / 门禁6.5六项全在 / 幻影包残留0 / 旧口径9300+/opt/pbls 0 / WS_DIR硬编码残留0
2026-09-25 18:43:04 +08:00

63 lines
4.4 KiB
Plaintext
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.

# PBL Agent OS 验证原型(Phase 0/1)—— 应用依赖声明
# 平台基础依赖(ahserver / sqlor / apppublic / appbase / rbac)由机构私有源提供,
# 通过 --index-url 指向内网 pypi;缺失时 build.sh 会 fail-fast 报错而非静默跳过。
# [deploy_test R5 修复] 原 --extra-index-url http://10.20.30.41:8081/... 在目标机 192.168.16.3
# 实测 connect timeout(5 次重试全失败 → build.sh BUILD_RC=1,部署卡在依赖安装)。
# 平台基础包改由机构 wheelhouse 离线供给(--find-links 相对本文件定位 WS/wheelhouse),
# 第三方包走公网 pypi.org(目标机实测 HTTP=200 可达)。
# [deploy_test R7 修复] 删除 `--find-links ../../wheelhouse`:相对路径 pip 不解析
# (r6 实测 65 次 "WARNING: Location '../../wheelhouse' is ignored")。
# 基座 wheel 由 pbl 用户 ~/.config/pip/pip.conf 的 find-links=/d/pipeline/workspaces/0/sdlc_general/wheelhouse
# 供给(实测 pbl 可 ls 该目录 7 个 wheel),build.sh 第 7 步另以绝对路径 --find-links ${WHEELHOUSE} 兜底。
# [develop 本轮修复 Bug BWY68rZR_Uh2A41JlGT7D / elS7VxwO7ufbPiPl-ucGA] 依赖声明「可满足性」
# 已由 build.sh 硬门禁 6.6(scripts/check_requirements_satisfiable.py)静态把关:
# 幻影包黑名单(pybricks / mysqlclient / hashlib-additional / 本地 pbl_* 模块)、
# 标准库名误当第三方声明、基座包 == 版本与 wheelhouse 实物逐字一致、
# wheelhouse 覆盖完整性、门禁 6.5 六项声明在位、失效内网源 10.20.30.41 残留、
# 相对路径 --find-links(pip 不解析)——并同步扫描全部 modules/*/pyproject.toml 同类缺陷。
# 基座版本口径 = env/test.json deps.corrected_requirements_hint(业主 2026-09-25 修正)。
# ---- 平台基础框架(必需,硬门禁 6.5)----
ahserver==1.2.0 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=1.2.0 无对应发行物)
sqlor==2.1.2 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=2.1.2 无对应发行物)
apppublic==5.3.2 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=5.3.2 无对应发行物)
appbase==1.0.0 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=1.0.0 无对应发行物)
rbac==1.0.0 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=1.0.0 无对应发行物)
bricks_for_python==0.0.5 # 前端积木(.ui/.bui 渲染 + load_pybricks) # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=0.0.5 无对应发行物)
# [deploy_test R5 修复] 移除 pybricks>=1.1.0:load_pybricks 实际由 bricks_for_python.init 提供,
# wheelhouse 无此包,公网同名包为 LEGO 机器人库(误装风险)——幻影依赖。
accounting==0.1.0 # [R7] 按 deps.corrected_requirements_hint 固定=宿主实装版本(原 >=0.1.0 无对应发行物)
# ---- DB 驱动(mariadb 方言,显式 TCP,禁 socket)----
PyMySQL>=1.1.0
# [deploy_test R5 修复] 移除 mysqlclient>=2.2.0:需 mysql_config(目标机实测 which mysql_config 无输出,
# pbl 无 sudo 装不了 mariadb-devel)。DB 驱动由 PyMySQL + aiomysql 承担(sqlor/ahserver 传递依赖)。
SQLAlchemy>=2.0.0
# ---- 业务模块(本项目新建 15 个 pbl_*,本地路径安装)----
# 由 build.sh 以 pip install -e modules/{模块} 方式安装,不发布到公共源
# pbl_common / pbl_appcodes / pbl_governance / pbl_blueprint / pbl_template
# pbl_validation / pbl_compiler / pbl_agent_runtime / pbl_evidence / pbl_assessment
# pbl_domain_ext / pbl_scense_ext / pbl_runtime_ext / pbl_kdb_ext / pbl_analytics
# ---- 通用运行时依赖 ----
requests>=2.31.0
python-dateutil>=2.8.2
pytz>=2024.1
jsonschema>=4.21.0
PyYAML>=6.0.1
# [Bug BWY68rZR_Uh2A41JlGT7D 修复] 删除 `hashlib-additional>=1.0.1 ; python_version < "3.0"`:
# hashlib 是 Python 3 标准库(sys.stdlib_module_names 实测在列),marker 恒假 → 永不安装,
# 属无意义幻影声明;且公共源真实发行名为 hashlib_additional(下划线),声明名对不上,
# 一旦 marker 被误改成立即 "No matching distribution found" → pip install 整体 BUILD_RC=1。
# 代码侧 hashlib 用法全部走标准库 import,无需任何第三方补充包。
# ---- 前端/模板处理(website.processors: .tmpl/.ui/.dspy)----
Mako>=1.3.0
Jinja2>=3.1.0
# ---- 部署与自检 ----
psutil>=5.9.0
setuptools>=68.0.0
wheel>=0.42.0