fix(crawler): read pixelrag artifacts from app data
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-09 17:44:28 +08:00
parent 1a435b4c78
commit 157f3e8106
2 changed files with 9 additions and 4 deletions

View File

@@ -123,6 +123,7 @@ runtime_artifacts/pixelrag_visual_evidence/<platform>/<manifest_id>/capture_rece
```
API readback 只讀 receipt 和檔案存在狀態,不重新抓外站、不寫資料庫。
正式 app 容器內的 readback 預設讀 `/app/data/ai_automation/pixelrag_visual_evidence`host worker 若直接在 188 執行,預設仍可用 `runtime_artifacts/pixelrag_visual_evidence`,需要給 API 回讀時再同步到容器掛載的 `data/ai_automation`
安全邊界:

View File

@@ -29,10 +29,14 @@ RESULT_MANIFEST_REJECTED = "PIXELRAG_VISUAL_EVIDENCE_MANIFEST_REJECTED"
ALLOWED_PLATFORMS = ("momo", "pchome", "market_intel", "external_market")
DEFAULT_VIEWPORT = {"name": "desktop-1440", "width": 1440, "height": 950}
DEFAULT_TILE_SIZE = {"width": 512, "height": 512}
DEFAULT_ARTIFACT_ROOT = os.getenv(
"PIXELRAG_VISUAL_EVIDENCE_ROOT",
"runtime_artifacts/pixelrag_visual_evidence",
)
def _default_artifact_root() -> str:
container_root = Path("/app/data/ai_automation")
if container_root.exists():
return str(container_root / "pixelrag_visual_evidence")
return "runtime_artifacts/pixelrag_visual_evidence"
DEFAULT_ARTIFACT_ROOT = os.getenv("PIXELRAG_VISUAL_EVIDENCE_ROOT", _default_artifact_root())
DEFAULT_ARTIFACT_MAX_AGE_HOURS = int(os.getenv("PIXELRAG_VISUAL_EVIDENCE_MAX_AGE_HOURS", "168"))
VISUAL_FALLBACK_CONFIDENCE_TRIGGERS = {
"low",