fix(ai): surface combined PixelRAG replay actions
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-10 10:29:54 +08:00
parent 6edae04e62
commit 22cffbeef8
5 changed files with 54 additions and 24 deletions

View File

@@ -210,6 +210,40 @@ def test_pixelrag_rag_candidate_replay_prefers_worker_source_contract_handoff(tm
)
def test_pixelrag_rag_candidate_replay_combines_ready_and_source_contract_actions(tmp_path):
from services.pixelrag_rag_candidate_replay_service import (
build_pixelrag_rag_candidate_replay_readback,
)
visual_root = tmp_path / "visual"
worker_root = tmp_path / "worker"
_write_receipt(
visual_root,
platform="shopee_tw",
manifest_id="shopee-ok",
title="Shopee 防曬乳",
url="https://shopee.tw/search?keyword=sunscreen",
)
_write_platform_probe_worker_receipt(
worker_root,
platform="coupang_tw",
manifest_id="coupang-403",
barrier_type="access_denied",
)
payload = build_pixelrag_rag_candidate_replay_readback(
artifact_root=visual_root,
platform_probe_worker_receipt_root=worker_root,
platform=("shopee_tw", "coupang_tw"),
)
assert payload["summary"]["eligible_count"] == 1
assert payload["summary"]["source_contract_fallback_count"] == 1
assert payload["next_machine_action"] == (
"run_ocr_vlm_replay_and_source_contract_replay"
)
def test_pixelrag_rag_candidate_replay_cli_outputs_machine_readable_json(tmp_path):
_write_receipt(
tmp_path,