Skip to content

fix: 流水线鲁棒性收尾 + 生产就绪 + preflight 强化#15

Open
yihui504 wants to merge 8 commits into
mainfrom
feat/enforcement-gates
Open

fix: 流水线鲁棒性收尾 + 生产就绪 + preflight 强化#15
yihui504 wants to merge 8 commits into
mainfrom
feat/enforcement-gates

Conversation

@yihui504

@yihui504 yihui504 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

7 个 commit 综合收尾:流水线鲁棒性(docker/reporter/gate)、preflight 强化(DB clients + Python 版本)、生产就绪(schema 双兼容 + self-check 双向信号 + novelty_gate CRITICAL 修复 + B7 编码修复)。

Changes(按主题分组)

🔴 CRITICAL regression 修复(本次审查发现)

  • novelty_gate.py corrector_layer_check 恢复 for item in items: 循环 — P0-12 重构意外删除导致 GitHub corrector 验证层完全失效(grade_candidate 永远跳过 GitHub 搜索)

Preflight 强化(commit e8c7843 / 0baa298

  • 主机端 DB 客户端预检(qdrant-client 等)
  • docker-executor Python 3.10+ 预检

流水线鲁棒性(commit 3571265 / a2b0463 / c94aedb / 51723ae

  • docker/*.yml per-target VERSION env + host 执行模型澄清
  • gate claimed_count 取最后一个数字避免 Stage 2 trap
  • reporter 要求 summary.md production + Original Execution Log ref 保 gate 一致性

生产就绪收尾(commit c8d6884

  • refactor: extract_confirmed() 统一到 _pipeline_utils(dedup_defects + novelty_gate 共用,DRY 漂移修复)
  • fix: write_location_checksetup_encoding()(Windows cp1252 UnicodeEncodeError)
  • fix: test_b_side_gates subprocess.run 加 encoding=utf-8
  • docs: ai_failure_check check_m2 docstring 文档化 offline 仅跳 M2(M3-M7 本地检查不跳)
  • 累积: P0-11/P0-12 schema 双兼容(confirmed dict + confirmed_defects list)+ P3-18a aggregate_votes 字段丰富化(defect_type/script)+ 12 gate/决策器 --self-check 双向信号 + verify-live-l2 SOP + mine.md direct-probe 兜底

Test plan

  • 13 个 --self-check 全过(pipeline_state / verify_defects / verify_live_l1 / check_cache / ai_failure_check / detect_risky_scripts / scan_script_errors / validate_api_format / aggregate_votes / dedup_defects / novelty_gate / passport_verify / postcompact_verify)
  • pytest tests/test_b_side_gates.py46/46 passed(含 B7 write_location_check 全 6 case)
  • novelty_gate corrector for 循环恢复后 23 个 novelty 相关 case 全过
  • CI(等待 push 后触发)
  • 端到端 qdrant session 验证(下一轮 ROI 跑完整 mine pipeline)

改动规模

28 files changed, +1467 / -209

备注

  • 改动未含 check_files.py(untracked,与本次无关)
  • novelty_gate corrector_layer_check 的 for 循环是 P0-12 schema 重构时意外删除 — 已加 self-check 隐式双向信号(顺序冲突 case)防止回归

yihui504 added 8 commits July 3, 2026 14:37
…verification

reporter.md template adds '## Original Execution Log' section (output_<defect_id>.log ref) before MRE. verify_defects.py extracts script_name from output_*.log refs to find VERDICT; without it, all defects marked NEEDS_IMPROVEMENT (No VERDICT line) -> retry loop -> retry>=3 downgrade.

实战 chroma 1.5.9 mine A: reporter wrote mre/defect-N-script.py refs, verify_defects 4 regexes don't match -> 11/11 NEEDS_IMPROVEMENT. After fix: Original Log ref enables verify_defects to find log -> 11/11 CONFIRMED -> advance STATE_SAVE succeeds -> DONE.
reporter's '唯一正确执行路径' only listed defect-N.md; agent skipped
summary.md, forcing main process to synthesize a minimal summary to pass
gate_summary_consistency. Add summary.md to execution path + constraints
with strict 'N == defects/*.md count' requirement; gate enforces.
docker-executor实战教训:distroless镜像无python,必须host py+客户端连
容器DB。缺客户端→agent失败跑到一半才报错。preflight提前在session start
用importlib.util.find_spec检查6个target客户端,warn缺失+pip提示。
mechanism替代docker-executor.md的policy报错。
实战bug:summary.md '| Defects Confirmed (Debate Stage 2) | 8 |' 被旧regex
captured count=2('Stage 2'的2,应8)。根因:'[^\d\n|]*\|?\s*(\d+)' 允许数字前
有非数字文本,贪婪匹配到第一个数字。修复:按行扫描关键词,取该行最后一个数字
(表格cell的count)。self-check加Stage2陷阱用例验证。
实战bug:host python默认3.8(sqlite<3.35)→ chromadb import失败 +
scripts含str|None语法3.8不支持 → cryptic SyntaxError跑到一半才报。
preflight加check_docker_executor_python检测py-3.12/python3.12等3.10+,
无则FATAL提示装3.10+。mechanism替代docker-executor.md Step2的policy检测。
CRITICAL: novelty_gate corrector_layer_check 恢复 'for item in items:'
(P0-12 重构意外删除导致 GitHub corrector 验证层完全失效)

refactor: extract_confirmed 统一到 _pipeline_utils (dedup + novelty_gate 共用)
fix: write_location_check 加 setup_encoding() (Windows cp1252 UnicodeEncodeError)
fix: test_b_side_gates subprocess.run 加 encoding=utf-8
docs: ai_failure_check check_m2 offline 范围文档化 (仅跳 M2)

累积: P0-11/P0-12 schema 双兼容 + P3-18a aggregate_votes 字段丰富化
      + 12 gate/决策器 --self-check 双向信号 + docker TCP healthcheck
      + verify-live-l2 SOP + mine.md direct-probe 兜底

回归: 13 self-check 全过 + pytest 46/46 passed
…_severity (P3-22 + P3-18a+)

P3-22: _extract_level 移除 vote key — stage2_severity entry 的 vote 是 is_defect(判断)非级别,先命中会返回 is_defect 而非 severity 真值,导致全投票被误判 trivial/missing。

P3-18a+: defect_type 数据源升级到 stage2_severity.defect_type(Type 分类优先)。
- 新增 _severity_defect_types(sev) helper(与 _severity_levels 并列,同 schema 范式)
- run() 优先级链:severity.defect_type (Type) > doc.category (attack) > unknown
- self-check 场景 10(3 子案例:severity 优先 / doc fallback / 双缺 unknown)
- deslop DRY: 提取 _SEV_META_KEYS 模块常量消除 _META_KEYS 重复定义

Type 分类(Type1_IllegalSuccess/Type2_PoorDiagnostics/Type3_RuntimeFailure/Type4_StateLogic)比 attack 分类(boundary/semantic/state)对 novelty_gate consumer_layer_check 更直接对应缺陷语义。

验证:self-check OK(场景 1-10)+ 双向信号(注入 bug exit 1)+ 11 scripts self-check 全过 + pytest test_b_side_gates 46/46 + architect APPROVE。
glm proxy 环境下 knowledge-extractor/verify-live-l2 agent 频繁 HTTP 400,当前依赖 Stop hook 重试 N 次后降级。env 标志 TESTVDB_PROXY=glm 让 pipeline 启动时即知走 fallback(preflight 检测 + mine.md 文档化触发条件)。

- preflight.py 加 check_glm_proxy(3 状态:standard/glm/未识别,英文 print 适配 Windows cp1252 console)
- main() 加调用(check_network 后,check_settings_schema 前)
- mine.md Step 4 加 env 标志触发说明

P3-20b(自动 probe + agent SOP fallback 触发)留下轮。

验证:3 env 状态 print 正确 + test_preflight_schema 全过 + architect APPROVE + deslop 无改动。
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