feat(ack): refine intake and validation workflow

This commit is contained in:
2026-08-04 10:52:37 +08:00
parent b9c82b5520
commit 5018a1801d
32 changed files with 1602 additions and 302 deletions
+16 -2
View File
@@ -8,7 +8,7 @@ import re
from typing import Any
PAYLOAD_FIELDS = (
LEGACY_PAYLOAD_FIELDS = (
"title",
"description",
"priority",
@@ -18,6 +18,13 @@ PAYLOAD_FIELDS = (
"fixLogic",
"acceptanceCriteria",
)
CLARIFIED_PAYLOAD_FIELDS = (
"title",
"description",
"actual",
"expected",
"acceptanceCriteria",
)
NUMBERED_ITEM = re.compile(r"(?:^|\s)([1-9][0-9]*)\.\s+")
@@ -43,7 +50,14 @@ def review_items(value: str) -> list[str]:
def approval_payload_hash(task: dict[str, Any]) -> str:
"""Hash the exact reviewed fields that Developer and Test consume."""
payload = {field: task.get(field) for field in PAYLOAD_FIELDS}
source = task.get("source")
workflow = source.get("workflow") if isinstance(source, dict) else None
fields = (
CLARIFIED_PAYLOAD_FIELDS
if workflow == "clarified-writeback-v1"
else LEGACY_PAYLOAD_FIELDS
)
payload = {field: task.get(field) for field in fields}
encoded = json.dumps(
payload, ensure_ascii=False, sort_keys=True, separators=(",", ":"),
).encode("utf-8")