Skip to content

fix(ci): meta-audit gate 冒烟化——补 starlette 依赖 + CI 不 gate all_passed - #367

Open
frankiehot-tech wants to merge 1 commit into
mainfrom
fix/meta-audit-gate-smoke
Open

fix(ci): meta-audit gate 冒烟化——补 starlette 依赖 + CI 不 gate all_passed#367
frankiehot-tech wants to merge 1 commit into
mainfrom
fix/meta-audit-gate-smoke

Conversation

@frankiehot-tech

Copy link
Copy Markdown
Contributor

背景

Meta-Audit Gate 已连续失败 run #248-252(每 5 分钟 1 次),是本次远程开源仓库健康度审计(2026-08-14)的 P0 项之一。

根因

  1. 依赖缺失src/maref/observability/otel_middleware.py 顶层 from starlette.middleware.base import ...,但 otel extras 未声明 starlette。CI 安装 .[dev]ModuleNotFoundError 导致 meta_monitor 无法启动。
  2. CI 语义错位:M0 audit_log / M3 report_freshness / M4 telemetry 依赖部署环境运行时数据;干净 CI runner 无数据源,all_passed 必然为 false,即使依赖修复后 gate 仍红。

修复

  • pyproject.tomlotel extras 补 starlette>=0.37
  • meta-audit-gate.yml
    • install 补全 .[dev,otel,sidecar]
    • Run 步骤容忍运行时数据 gate 非零退出(记录到 stdout,不 gate)
    • Check 步骤改为冒烟验证:报告必须生成且 JSON 可解析,否则失败;M0-M4 状态仅作信息性输出
  • 真实健康门禁由部署环境 run_loop (--daemon) 承担(CI 冒烟只验证"meta_monitor 可运行 + 报告可生成")

验证

  • 本地 python -m maref.observability.meta_monitor --single-run 在空环境(模拟 CI)可运行并生成报告
  • 冒烟逻辑:报告存在且可解析 → exit 0;报告缺失 → exit 1 打印 stdout tail
  • pre-push hook oss-check 放行

Meta-Audit Gate 已连续失败 run #248-252(每 5 分钟 1 次):
- otel_middleware.py 顶层 import starlette,但 otel extras 未声明,CI 装 .[dev] 时
  ModuleNotFoundError 导致 meta_monitor 无法启动
- M0 audit_log / M3 report_freshness / M4 telemetry 依赖部署环境运行时数据,
  干净 CI runner 无数据源必然 all_passed=false,gate 永远红

修复:
- pyproject.toml: otel extras 补 starlette>=0.37
- meta-audit-gate.yml: install 补全 .[dev,otel,sidecar];Run 步骤容忍运行时数据
  gate 非零退出;Check 改为冒烟验证(报告存在 + 可解析),真实健康门禁由部署环境
  run_loop (--daemon) 承担
@frankiehot-tech
frankiehot-tech requested a review from a team as a code owner August 14, 2026 03:37
@cla-assistant

cla-assistant Bot commented Aug 14, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Athena seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

1 participant