Skip to content

feat(examples): add evaluation + optimization closed-loop pipeline#139

Open
coder-mtj wants to merge 3 commits into
trpc-group:mainfrom
coder-mtj:feat/issue-91-eval-optimize-loop
Open

feat(examples): add evaluation + optimization closed-loop pipeline#139
coder-mtj wants to merge 3 commits into
trpc-group:mainfrom
coder-mtj:feat/issue-91-eval-optimize-loop

Conversation

@coder-mtj

Copy link
Copy Markdown

Description | 描述

Reproducible Evaluation + Optimization closed-loop pipeline.

Implements: baseline evaluation → failure attribution (10 categories) → optimization → validation set comparison → multi-dimensional gate → JSON/MD report with audit trail.

Related Issue | 关联 Issue

Fix #91

Change Type | 修改类型

  • New feature | 新功能

Test Coverage | 测试覆盖

  • 35 tests covering config, baseline, attribution, gate, validation, report, integration
  • 3 train + 3 validation evalset cases with trace mode
  • Verified locally: python -m pytest examples/optimization/eval_optimize_loop/tests/ -v

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能
  • Full pipeline runs in fake mode and generates JSON+MD reports
  • Gate multi-dimensional checks all functional
  • Failure attribution correctly categorizes failures

Implements trpc-group#91 — reproducible Evaluation + Optimization pipeline:
- Config loading (optimizer.json + evalsets validated)
- Baseline evaluation (fake mode with trace evalsets + SDK path)
- Failure attribution (10 categories: tool errors, rubric, format, etc.)
- Multi-dimensional gate (improvement threshold, critical cases, cost budget)
- Validation set comparison (new passes/failures, overfitting detection)
- JSON + Markdown report with full audit trail
- 6 train+val evalset cases (3 optimizable, 1 degrading, 1 format, 1 edge)
- 35 tests covering config, baseline, attribution, gate, validation, report, integration

Signed-off-by: coder-mtj <coder-mtj@users.noreply.github.com>
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@a547d6b). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             main        #139   +/-   ##
==========================================
  Coverage        ?   87.51874%           
==========================================
  Files           ?         467           
  Lines           ?       44018           
  Branches        ?           0           
==========================================
  Hits            ?       38524           
  Misses          ?        5494           
  Partials        ?           0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

coder-mtj added 2 commits July 9, 2026 08:17
…overage

- Add pipeline/optimize.py: GEPA optimization wrapper (fake + live modes)
- Add pipeline/tracing.py: audit trail with seed/timing/cost/reproduce
- Add agent/ package: calculator agent for optimization testing
- Update run_pipeline.py: integrate new modules, AuditTracer, enhanced CLI
- Split monolithic test file into 14 focused test files
- Expand from 35 to 189 tests (5.4x increase)
- Add 6-dimensional test coverage: unit, integration, mock data,
  edge/boundary, regression, performance
- Enhance evalsets: 34 train + 16 val + 12 holdout cases
  (multi-domain: math, reasoning, tool calls, Chinese, CJK, format)
- Add DESIGN.md and README.md with architecture documentation
- All 189 tests passing, pipeline verified end-to-end in fake mode
@coder-mtj

Copy link
Copy Markdown
Author

补充了设计文档和开发过程记录:

文件 说明
DESIGN.md 架构设计文档(7 阶段流水线、模块划分、5 维度 Gate、8 类失败归因)
README.md 使用说明 + 快速复现步骤 + CLI 参数表
ai-prompts.md 开发过程记录(4 轮:架构→优化→测试→修复)

测试覆盖:189 tests,14 测试文件,6 维度(单元/集成/大规模/边界/回归/性能)
Evalset 数据:62 cases(34 train + 16 val + 12 holdout),跨中/日/韩/Emoji 多语言
Pipeline:8 模块(config/baseline/attribution/optimize/validate/gate/report/tracing)

所有 CI checks 通过。如有遗漏或需要调整的地方请告知。

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.

构建 Evaluation + Optimization 的自动回归与提示词优化闭环

1 participant