Default Flash final review to off and persist the setting across the UI, MCP, SDK and queued tasks. Keep execution separate from test verdicts. Bundle UI fonts and licenses to remove Google Fonts from startup builds. Align backend/frontend versions and document installation and upgrades.
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
"""Human review overlays the AI verdict without changing execution evidence."""
|
|
|
|
from pathlib import Path
|
|
|
|
from apps.admin_console.services.automation_store import AutomationStore
|
|
from artemis.runtime.case_result import read_case_result
|
|
|
|
|
|
def reviewed_result(
|
|
session_id: str, ai_result: dict | None, storage: AutomationStore
|
|
) -> dict | None:
|
|
original = (
|
|
{**ai_result, "source": "system" if ai_result.get("verification_skipped") else "ai"}
|
|
if ai_result
|
|
else None
|
|
)
|
|
record = storage.get("case_review", session_id)
|
|
reviews = (record or {}).get("reviews") or []
|
|
if not reviews:
|
|
return original
|
|
latest = reviews[-1]
|
|
return {
|
|
"status": latest["status"],
|
|
"reason": latest["reason"],
|
|
"evidence": [],
|
|
"source": "human",
|
|
"reviewed_at": latest["reviewed_at"],
|
|
"ai_result": original,
|
|
}
|
|
|
|
|
|
def read_reviewed_result(
|
|
session_id: str,
|
|
execution_status: str,
|
|
error: str = "",
|
|
*,
|
|
storage: AutomationStore,
|
|
root: Path | None = None,
|
|
) -> dict | None:
|
|
return reviewed_result(
|
|
session_id,
|
|
read_case_result(session_id, execution_status, error, root=root),
|
|
storage,
|
|
)
|