OUTPUT #639 | 3414 karakter | 76 satır
========== YENİ KOMUT | 16.09.2026 15:56:27 ==========
========== YENİ KOMUT | 16.09.2026 15:56:27 ==========
636- if tool_name == "vision_analyze":
637- image_url = str(args.get("image_url") or "")
638- question = str(args.get("question") or "").strip()
639- raw = image_url[7:] if image_url.startswith("file://") else image_url
640- image_path = Path(raw).expanduser()
641-
642- # Normal production gets exactly the two canonical visual judgment surfaces:
643- # proof/casting before render and final semantic QA after render. Source-sheet,
644- # range-sheet and ad-hoc asset-sheet inspections duplicate evidence and create
645- # expensive main-agent loops. This block does not abort the job; the agent
646- # continues with deterministic discovery and the canonical proof sheet.
647- if (
648- not alternate_method
649- and not explicit_system_change
650: and image_path.name not in {"proof_contact_sheet.jpg", "final_contact_sheet.jpg"}
651- ):
652- return _block(
653: "Shorts production guard: AD_HOC_VISION_SKIPPED_FOR_TURN_ECONOMY — "
654: "do not open a separate source/range/asset Vision review. Select candidates "
655: "from metadata and the creative contract, build the manifest, then use the "
656: "single canonical proof_contact_sheet which already reviews hook, proof, "
657- "setup, insert and payoff casting. Continue the production; do not stop."
658- )
659-
660: if image_path.name == "proof_contact_sheet.jpg":
661- pending_path = image_path.parent / "proof_pending.json"
662- current_fingerprint = None
663- pending = {}
664- try:
665- if pending_path.exists():
666- pending = json.loads(pending_path.read_text(encoding="utf-8"))
667- current_fingerprint = pending.get("fingerprint")
668- except Exception:
669- pending = {}
670- proof_state = _read_proof_attempt_state(image_path, pending)
671-
672- if (
673- int(proof_state.get("failed_attempts") or 0) >= 2
674- and current_fingerprint
--
897- with _LOCK:
898- _VISION_SEEN.add(signature)
899-
900- raw_path = image_url[7:] if image_url.startswith("file://") else image_url
901- try:
902- image_path = Path(raw_path).expanduser().resolve()
903- except Exception:
904- return
905-
906- contract_question = _expanded_vision_question_for_receipt(image_path, question)
907- _update_repair_state_from_vision(
908- image_path, contract_question, result, session_id, turn_id, tool_call_id
909- )
910-
911: if image_path.name != "proof_contact_sheet.jpg":
912- return
913-
914- pending_path = image_path.parent / "proof_pending.json"
915- if not pending_path.exists():
916- return
917-
918- try:
919- pending = json.loads(pending_path.read_text(encoding="utf-8"))
920- except Exception:
921- return
922-
923- token = str(pending.get("proof_token") or "")
924- if not token or f"HERMES_PROOF_GATE::{token}" not in contract_question:
925- return
root@213-238-170-219:~#