Skip to content

chore: complete engineering hygiene remediation#251

Merged
liujuanjuan1984 merged 2 commits into
mainfrom
chore/engineering-hygiene-assessment
Mar 20, 2026
Merged

chore: complete engineering hygiene remediation#251
liujuanjuan1984 merged 2 commits into
mainfrom
chore/engineering-hygiene-assessment

Conversation

@liujuanjuan1984
Copy link
Copy Markdown
Collaborator

关联事项

Closes #248
Closes #249
Relates to #250

变更说明

1. 发布与 CI

  • 调整 CI workflow:拆分为单版本 quality-gate 与多版本 runtime-matrix,避免在 Python 版本矩阵中重复执行 lint、pip-audit、build 与 smoke test。
  • 强化 publish workflow:发布前同时校验 wheel 与 sdist 的唯一性和版本一致性,并分别执行 wheel / sdist 安装 smoke test。

2. 依赖与版本治理

  • 收紧运行时与开发依赖版本范围,并更新 uv.lock
  • 修复包版本 fallback,避免在缺失 package metadata 时返回过时硬编码版本。

3. 应用与运行时健壮性

  • 提升 app.py 中若干 request / payload / logging helper 的可测试性,并补齐对应行为测试。
  • 修复 opencode_client.py 中 upstream session id 返回值的类型边界校验。
  • 收紧 mypy 配置,启用 check_untyped_defs / warn_return_any,并修复新增暴露出的类型问题。

4. 测试与覆盖率门禁

  • 新增 scripts/check_coverage.py,在总覆盖率之外,对关键模块增加单文件最低覆盖率要求。
  • 将项目总覆盖率门槛提高到 90%。
  • 新增并扩充 agentappjsonrpc_extopencode_clientversion、script contract 等测试。

5. 脚本与文档

  • 泛化 smoke_test_built_cli.sh,支持显式 artifact 路径,兼容 wheel / sdist,避免歧义选择旧产物。
  • 更新 scripts/README.md,同步说明新的脚本职责与 coverage policy。

验证

  • uv run pre-commit run --all-files
  • uv run pytest
  • uv run pip-audit
  • uv run python ./scripts/check_coverage.py
  • bash -n scripts/*.sh
  • uv build --no-sources --out-dir <tmp>
  • bash ./scripts/smoke_test_built_cli.sh <wheel>
  • bash ./scripts/smoke_test_built_cli.sh <sdist>

@liujuanjuan1984 liujuanjuan1984 marked this pull request as ready for review March 20, 2026 05:48
@liujuanjuan1984 liujuanjuan1984 merged commit f7a4998 into main Mar 20, 2026
3 checks passed
@liujuanjuan1984 liujuanjuan1984 deleted the chore/engineering-hygiene-assessment branch March 20, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] 工程卫生治理汇总与进展跟踪 [chore] 评估并分级当前工程卫生问题

1 participant