Add review action contract fields

This commit is contained in:
yaojingang
2026-06-17 05:25:52 +08:00
parent 10dd886ae7
commit 4c30a659ef
50 changed files with 537 additions and 376 deletions
+12
View File
@@ -77,6 +77,9 @@ def build_review_studio_gate_action_mirror_check(review_studio: dict[str, Any])
str(gate.get("key", "")): {
"review_action_id": f"review-action-{gate.get('key', '')}",
"review_action_status": gate.get("status", ""),
"title_present": True,
"next_step_present": True,
"reason_present": True,
"source_ref_present": True,
"verification_command_present": True,
}
@@ -95,15 +98,24 @@ def build_review_studio_gate_action_mirror_check(review_studio: dict[str, Any])
actual["gate_action_mirrors"][key] = {
"review_action_id": gate.get("review_action_id", ""),
"review_action_status": gate.get("review_action_status", ""),
"title_present": bool(gate.get("review_action_title")),
"next_step_present": bool(gate.get("review_action_next_step")),
"reason_present": bool(gate.get("review_action_reason")),
"source_ref_present": bool(gate.get("review_action_source_ref_count")),
"verification_command_present": bool(gate.get("review_action_verification_command")),
"top_level_action_id": action.get("action_id", ""),
"top_level_action_status": action.get("status", ""),
"top_level_title_present": bool(action.get("title")),
"top_level_next_step_present": bool(action.get("next_step")),
"top_level_reason_present": bool(action.get("reason")),
"top_level_source_ref_present": bool(action.get("source_refs")),
"top_level_verification_command_present": bool(action.get("verification_command")),
}
expected["gate_action_mirrors"][key]["top_level_action_id"] = f"review-action-{key}"
expected["gate_action_mirrors"][key]["top_level_action_status"] = gate.get("status", "")
expected["gate_action_mirrors"][key]["top_level_title_present"] = True
expected["gate_action_mirrors"][key]["top_level_next_step_present"] = True
expected["gate_action_mirrors"][key]["top_level_reason_present"] = True
expected["gate_action_mirrors"][key]["top_level_source_ref_present"] = True
expected["gate_action_mirrors"][key]["top_level_verification_command_present"] = True
return {
+3
View File
@@ -519,6 +519,9 @@ def render_review_studio(skill_dir: Path, output_html: Path | None = None, outpu
action = action_by_gate.get(str(gate.get("key", "")))
gate["review_action_id"] = str(action.get("action_id", "")) if action else ""
gate["review_action_status"] = str(action.get("status", "")) if action else ""
gate["review_action_title"] = str(action.get("title", "")) if action else ""
gate["review_action_next_step"] = str(action.get("next_step", "")) if action else ""
gate["review_action_reason"] = str(action.get("reason", "")) if action else ""
gate["review_action_source_ref_count"] = len(action.get("source_refs", [])) if action else 0
gate["review_action_verification_command"] = str(action.get("verification_command", "")) if action else ""
score = weighted_score(gates)
+3
View File
@@ -299,10 +299,13 @@ def build_review_actions(
{
"action_id": f"review-action-{gate_item['key']}",
"gate_key": gate_item["key"],
"title": gate_item["label"],
"label": gate_item["label"],
"status": gate_item["status"],
"priority": "blocker" if gate_item["status"] == "block" else "warning",
"next_step": guidance["summary"],
"summary": guidance["summary"],
"reason": guidance["why"],
"why": guidance["why"],
"source_fix": guidance["source_fix"],
"source_refs": refs,