Skip to content

Add critic_features: per-step critic bundle + rule-based scorer#391

Merged
JE-Chen merged 1 commit into
devfrom
feat/critic-features-batch
Jun 23, 2026
Merged

Add critic_features: per-step critic bundle + rule-based scorer#391
JE-Chen merged 1 commit into
devfrom
feat/critic-features-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

摘要

新增 build_critic_record / score_step_rule_based / to_judge_prompt — 把為代理步驟評分所需的證據打包成單一逐步記錄,並附規則式評分器trajectory_eval 對整條軌跡評分而無逐步證據;agent_trace 發出 span(權杖/延遲)而非決策品質;agent_replay 保存 {obs, action, result} 卻不評分。

本功能把 action_effect(有無效果、落點)+ observation_delta(變了多少)+ postcondition(預期是否成立)組合成精簡記錄,並附確定性規則式評分器使其可完整無頭運作——可選的 LLM-as-judge 留給整合者(to_judge_prompt)。純標準函式庫聚合器;組合既有純模組。Qt-free。

五層

  • 核心:utils/critic_features/build_critic_recordscore_step_rule_basedto_judge_prompt
  • Facade / Executor AC_build_critic_record + AC_score_step / MCP ac_build_critic_record + ac_score_step / Script Builder(Native UI)。
  • 文件:v177 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test_critic_features_batch.py — 記錄捕捉 effect+delta、好步驟評分、no_op 失敗、postcondition 失敗降 outcome、to_judge_prompt 含 effect、wiring + facade。7 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。

trajectory_eval scores a whole trajectory with no per-step evidence;
agent_trace emits spans not quality; agent_replay stores steps but doesn't
score. Compose action_effect + observation_delta + postcondition into one
per-step record, then a deterministic rule-based scorer gives
{outcome, process_score, reasons} (no model), and to_judge_prompt renders it for
an optional LLM-as-judge.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 22 complexity · 0 duplication

Metric Results
Complexity 22
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 3c8c8bb into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/critic-features-batch branch June 23, 2026 22:50
@sonarqubecloud

Copy link
Copy Markdown

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