========== YENİ KOMUT | 16.09.2026 15:53:56 ==========
========== YENİ KOMUT | 16.09.2026 15:53:56 ==========
return _block(
"Shorts production guard: shorts-core is the sole production authority "
"for this footage-based Shorts/Reels turn. Do not load another production, "
"debug, installation, or QA skill. Continue with shorts-core and the canonical pipeline."
)
# Vision policy: do not impose arbitrary call counts.
# The agent may re-evaluate when the evidence or question genuinely changes.
# Only exact no-progress repetition of the same visual evidence + question is blocked.
if tool_name in {"browser_vision", "computer_use"} and not alternate_method:
return _block(
"Shorts production guard: this QA fallback is disabled during normal production. "
"Use vision_analyze as the primary visual QA path; if Vision is unavailable after "
"the permitted retry, continue with controlled QA_UNAVAILABLE rather than inventing a fallback."
)
if tool_name == "vision_analyze":
image_url = str(args.get("image_url") or "")
question = str(args.get("question") or "").strip()
raw = image_url[7:] if image_url.startswith("file://") else image_url
image_path = Path(raw).expanduser()
# Normal production gets exactly the two canonical visual judgment surfaces:
# proof/casting before render and final semantic QA after render. Source-sheet,
# range-sheet and ad-hoc asset-sheet inspections duplicate evidence and create
# expensive main-agent loops. This block does not abort the job; the agent
# continues with deterministic discovery and the canonical proof sheet.
if (
not alternate_method
and not explicit_system_change
and image_path.name not in {"proof_contact_sheet.jpg", "final_contact_sheet.jpg"}
):
return _block(
"Shorts production guard: AD_HOC_VISION_SKIPPED_FOR_TURN_ECONOMY — "
"do not open a separate source/range/asset Vision review. Select candidates "
"from metadata and the creative contract, build the manifest, then use the "
"single canonical proof_contact_sheet which already reviews hook, proof, "
"setup, insert and payoff casting. Continue the production; do not stop."
)
if image_path.name == "proof_contact_sheet.jpg":
pending_path = image_path.parent / "proof_pending.json"
current_fingerprint = None
pending = {}
try:
if pending_path.exists():
pending = json.loads(pending_path.read_text(encoding="utf-8"))
current_fingerprint = pending.get("fingerprint")
except Exception:
pending = {}
proof_state = _read_proof_attempt_state(image_path, pending)
if (
int(proof_state.get("failed_attempts") or 0) >= 2
and current_fingerprint
and proof_state.get("last_fingerprint") == current_fingerprint
):
return _block(
"Shorts production guard: PROOF_STRATEGY_EXHAUSTED — this proof strategy "
"already failed initial review plus one repair. Do not retry Vision on the "
"same accepted candidates/casting. Materially change the proof footage or "
"casting, rerun proof-check, and continue the production autonomously."
)
# Content identity matters more than filename: a repaired final_contact_sheet
# at the same path is new evidence and must be allowed to be judged again.
try:
image_identity = _sha_file(image_path.resolve())
except Exception:
image_identity = str(image_path)
normalized_question = re.sub(r"\s+", " ", question).strip()
sig_raw = json.dumps(
{
"session": session_id,
"image": image_identity,
"question": normalized_question,
},
ensure_ascii=False,
sort_keys=True,
)
signature = hashlib.sha256(sig_raw.encode("utf-8")).hexdigest()
with _LOCK:
if signature in _VISION_SEEN:
return _block(
"Shorts production guard: this exact visual evidence has already been "
"asked the same question. Reuse the existing result. If evidence was repaired "
"or the verification question genuinely needs correction, change the evidence "
"or question rather than repeating the same call."
)
return None
# During a production turn the agent may USE the installed toolchain, but may not redesign it.
if not explicit_system_change:
if tool_name == "skill_manage":
return _block(
"Shorts production guard: do not modify skills during a production job. "
"Use the current canonical pipeline and finish the artifact."
)
if tool_name in {"write_file", "patch"}:
path = str(
args.get("path")
or args.get("file_path")
or ""
)
if path.endswith("proof_receipt.json") or path.endswith("proof_pending.json"):
return _block(
"Shorts production guard: proof state is runtime-owned. "
"Do not write or patch proof receipts/pending attestations manually; "
"only a real vision_analyze PASS may issue the receipt."
)
if any(path.startswith(prefix) for prefix in _PROTECTED_PREFIXES):
return _block(
"Shorts production guard: production-time mutation of Hermes core/tools/skills "
root@213-238-170-219:~#