OUTPUT #737
PARÇA 1 / 4
TOPLAM: 132172 karakter | 2996 satır
BU PARÇA: 40000 karakter
898- "claim_fixed_before_verified": False,
899- }
900- brief_path.write_text(json.dumps(brief, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
901- return obj, question
902-
903-def parse_cli_args(argv=None):
--
1381- "creative_intent": m.get("creative_intent", {}),
1382- "performance_plan": m.get("performance_plan", {}),
1383- "directing_plan": m.get("directing_plan", {}),
1384- "audio_intent": m.get("audio_intent", {}),
1385- }, sort_keys=True, ensure_ascii=False))
1386- qa_meta = work / ".qa.json"
1387- cached_qa = False
1388-
1389: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
1390- try:
1391- cached_qa = json.loads(
1392- qa_meta.read_text(encoding="utf-8")
1393- ).get("sig") == qa_sig
1394- except Exception:
1395- pass
1396-
1397- if not cached_qa:
--
1422- "creative_status": "PENDING_FINAL_SEMANTIC_VISION_QA",
1423- "version": VERSION,
1424- "cached_tts": cached_tts,
1425- "cached_visual": cached_visual,
1426- "cached_final": cached_final,
1427- "cached_qa": cached_qa,
1428- "duration": probe_duration(final),
1429- "final": str(final),
1430: "contact_sheet": str(work / "final_contact_sheet.jpg"),
1431- "vision_qa_brief": str(work / "vision_qa_brief.json"),
1432- "vision_question": repair_vision_question or final_vision_question,
1433- "vision_question_mode": "repair_inline" if repair_vision_question else "canonical_sibling_file",
1434- "caption_plan": str(work / "caption_plan.json"),
1435- "caption_grouping_mode": caption_plan["grouping_mode"],
1436- "timing_plan": str(work / "timing_plan.json"),
1437- "video_md5": final_md5,
1438- "repair_state": repair_state.get("state"),
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-audio-duck-20260906-182817
454- FFMPEG, "-y", "-v", "error",
455- "-i", str(final),
456- "-vf",
457- f"select='{select}',"
458- "scale=360:640:flags=lanczos,"
459- f"tile={cols}x{rows}:margin=0:padding=0",
460- "-fps_mode", "vfr",
461- "-frames:v", "1",
462: str(work / "final_contact_sheet.jpg")
463- ])
464: (work / "semantic_contact_sheet.json").write_text(
465- json.dumps({
466- "times": times,
467- "frames": frame_nums,
468- "shot_count": len(shots),
469- "grid": [cols, rows]
470- }, ensure_ascii=False, indent=2),
471- encoding="utf-8"
472- )
--
772- qa_sig = stamp([final], "deterministic-final-qa-v4|" + json.dumps({
773- "shots": shots,
774- "creative_intent": m.get("creative_intent", {}),
775- "performance_plan": m.get("performance_plan", {}),
776- }, sort_keys=True, ensure_ascii=False))
777- qa_meta = work / ".qa.json"
778- cached_qa = False
779-
780: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
781- try:
782- cached_qa = json.loads(
783- qa_meta.read_text(encoding="utf-8")
784- ).get("sig") == qa_sig
785- except Exception:
786- pass
787-
788- if not cached_qa:
--
796- "pass": True,
797- "version": VERSION,
798- "cached_tts": cached_tts,
799- "cached_visual": cached_visual,
800- "cached_final": cached_final,
801- "cached_qa": cached_qa,
802- "duration": probe_duration(final),
803- "final": str(final),
804: "contact_sheet": str(work / "final_contact_sheet.jpg"),
805- "vision_qa_brief": str(work / "vision_qa_brief.json"),
806- "video_md5": final_md5,
807- }
808- (work / "pipeline_result.json").write_text(
809- json.dumps(result, ensure_ascii=False, indent=2),
810- encoding="utf-8"
811- )
812- print(json.dumps(result, ensure_ascii=False))
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.pre-tts-timing-lock-20260909-160938
1075-
1076- if r.get("pass") is not True:
1077- errors.append("PROOF_GATE_INVALID: receipt does not contain pass=true")
1078- if r.get("verifier") != "vision_analyze":
1079- errors.append("PROOF_GATE_INVALID: verifier must be vision_analyze")
1080- if r.get("receipt_source") != "shorts-production-guard/post_tool_call":
1081- errors.append("PROOF_GATE_INVALID: receipt was not issued by the vision post-tool hook")
1082-
1083: sheet = r.get("contact_sheet")
1084: sheet_hash = r.get("contact_sheet_sha256")
1085- if not isinstance(sheet, str) or not Path(sheet).exists():
1086- errors.append("PROOF_GATE_INVALID: accepted proof contact sheet is missing")
1087- elif not isinstance(sheet_hash, str) or sha_file(sheet) != sheet_hash:
1088- errors.append("PROOF_GATE_STALE: accepted proof contact sheet changed after Vision verification")
1089-
1090- if r.get("fingerprint") != proof_fingerprint(data):
1091- errors.append(
1092- "PROOF_GATE_STALE: creative intent, proof candidates, or proof source changed after acceptance"
--
1191- # A runtime-issued receipt already binds the proof fingerprint, evidence
1192- # sheet hash, casting contract, and source identities. If all of that is
1193- # still valid, regenerating frames/question/pending state cannot add proof;
1194- # it only invites another Vision and main-agent loop.
1195- receipt_errors = validate_proof_receipt(data, mp)
1196- if not hard and not receipt_errors:
1197- receipt_path = proof_receipt_path(data, mp)
1198- receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
1199: sheet = Path(receipt["contact_sheet"]).resolve()
1200- return {
1201- "pass": True,
1202- "version": VERSION,
1203- "fingerprint": proof_fingerprint(data),
1204- "proof_status": "already_accepted",
1205- "vision_required": False,
1206: "proof_contact_sheet": str(sheet),
1207- "proof_qa_brief": None,
1208- "proof_pending": None,
1209- "vision_question": None,
1210- "valid_candidates": len(gate.get("candidates") or []),
1211- "valid_casting_roles": len(casting_review_entries(data)),
1212- "hard_failures": [],
1213- "warnings": [],
1214- "next": "Proof receipt is current; proceed without another proof Vision call.",
--
1408- casting_valid.append(reviewed)
1409-
1410- missing_cover = sorted(required_cover - covered)
1411- if missing_cover:
1412- hard.append(
1413- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
1414- )
1415-
1416: sheet = wd / "proof_contact_sheet.jpg"
1417- if proof_frames:
1418- cols = 5
1419- rows = max(1, (len(proof_frames) + cols - 1) // cols)
1420- run([
1421- FFMPEG, "-y", "-v", "error",
1422- "-framerate", "1",
1423- "-i", str(wd / "proof_frame_%03d.jpg"),
1424- "-vf", f"tile={cols}x{rows}:margin=0:padding=0",
--
1467- passed = not hard and bool(valid) and sheet.exists()
1468-
1469- pending_path = wd / "proof_pending.json"
1470- if passed:
1471- pending = {
1472- "fingerprint": fingerprint,
1473- "proof_token": proof_token,
1474- "manifest": str(mp),
1475: "contact_sheet": str(sheet.resolve()),
1476: "contact_sheet_sha256": sha_file(sheet),
1477- "receipt": str(receipt),
1478- "created_at": time.time(),
1479- }
1480- pending_path.write_text(
1481- json.dumps(pending, ensure_ascii=False, indent=2) + "\n",
1482- encoding="utf-8"
1483- )
1484- else:
--
1502- )
1503-
1504- return {
1505- "pass": passed,
1506- "version": VERSION,
1507- "fingerprint": fingerprint,
1508- "proof_status": "vision_required" if passed else "invalid",
1509- "vision_required": bool(passed),
1510: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
1511- "proof_qa_brief": str(brief_path),
1512- "proof_pending": str(pending_path) if passed else None,
1513- "vision_question": vision_question if passed else None,
1514- "valid_candidates": len(valid),
1515- "valid_casting_roles": len(casting_valid),
1516- "hard_failures": hard,
1517- "warnings": warnings,
1518- "next": (
1519: "Call vision_analyze on proof_contact_sheet using vision_question. "
1520- "A PASS receipt is issued automatically by the shorts-production-guard post_tool_call hook. "
1521- "Never create a verdict or proof receipt manually."
1522- if passed else "Repair proof candidates before any TTS/render work."
1523- )
1524- }
1525-
1526-
1527-def proof_accept(*args, **kwargs):
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-prosody
429- FFMPEG, "-y", "-v", "error",
430- "-i", str(final),
431- "-vf",
432- f"select='{select}',"
433- "scale=360:640:flags=lanczos,"
434- f"tile={cols}x{rows}:margin=0:padding=0",
435- "-fps_mode", "vfr",
436- "-frames:v", "1",
437: str(work / "final_contact_sheet.jpg")
438- ])
439: (work / "semantic_contact_sheet.json").write_text(
440- json.dumps({
441- "times": times,
442- "frames": frame_nums,
443- "shot_count": len(shots),
444- "grid": [cols, rows]
445- }, ensure_ascii=False, indent=2),
446- encoding="utf-8"
447- )
--
599- )
600- else:
601- final_md5 = final_info["video_md5"]
602-
603- qa_sig = stamp([final], "deterministic-final-qa-v2|" + json.dumps(shots, sort_keys=True, ensure_ascii=False))
604- qa_meta = work / ".qa.json"
605- cached_qa = False
606-
607: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
608- try:
609- cached_qa = json.loads(
610- qa_meta.read_text(encoding="utf-8")
611- ).get("sig") == qa_sig
612- except Exception:
613- pass
614-
615- if not cached_qa:
--
623- "pass": True,
624- "version": VERSION,
625- "cached_tts": cached_tts,
626- "cached_visual": cached_visual,
627- "cached_final": cached_final,
628- "cached_qa": cached_qa,
629- "duration": probe_duration(final),
630- "final": str(final),
631: "contact_sheet": str(work / "final_contact_sheet.jpg"),
632- "video_md5": final_md5,
633- }
634- (work / "pipeline_result.json").write_text(
635- json.dumps(result, ensure_ascii=False, indent=2),
636- encoding="utf-8"
637- )
638- print(json.dumps(result, ensure_ascii=False))
639-
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-rate-20260907-005551
454- FFMPEG, "-y", "-v", "error",
455- "-i", str(final),
456- "-vf",
457- f"select='{select}',"
458- "scale=360:640:flags=lanczos,"
459- f"tile={cols}x{rows}:margin=0:padding=0",
460- "-fps_mode", "vfr",
461- "-frames:v", "1",
462: str(work / "final_contact_sheet.jpg")
463- ])
464: (work / "semantic_contact_sheet.json").write_text(
465- json.dumps({
466- "times": times,
467- "frames": frame_nums,
468- "shot_count": len(shots),
469- "grid": [cols, rows]
470- }, ensure_ascii=False, indent=2),
471- encoding="utf-8"
472- )
--
790- qa_sig = stamp([final], "deterministic-final-qa-v4|" + json.dumps({
791- "shots": shots,
792- "creative_intent": m.get("creative_intent", {}),
793- "performance_plan": m.get("performance_plan", {}),
794- }, sort_keys=True, ensure_ascii=False))
795- qa_meta = work / ".qa.json"
796- cached_qa = False
797-
798: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
799- try:
800- cached_qa = json.loads(
801- qa_meta.read_text(encoding="utf-8")
802- ).get("sig") == qa_sig
803- except Exception:
804- pass
805-
806- if not cached_qa:
--
814- "pass": True,
815- "version": VERSION,
816- "cached_tts": cached_tts,
817- "cached_visual": cached_visual,
818- "cached_final": cached_final,
819- "cached_qa": cached_qa,
820- "duration": probe_duration(final),
821- "final": str(final),
822: "contact_sheet": str(work / "final_contact_sheet.jpg"),
823- "vision_qa_brief": str(work / "vision_qa_brief.json"),
824- "video_md5": final_md5,
825- }
826- (work / "pipeline_result.json").write_text(
827- json.dumps(result, ensure_ascii=False, indent=2),
828- encoding="utf-8"
829- )
830- print(json.dumps(result, ensure_ascii=False))
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.bak-proof-secure-20260906-234130
696- })
697-
698- missing_cover = sorted(required_cover - covered)
699- if missing_cover:
700- hard.append(
701- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
702- )
703-
704: sheet = wd / "proof_contact_sheet.jpg"
705- if valid:
706- rows = max(1, (len(valid) + 2) // 3)
707- run([
708- FFMPEG, "-y", "-v", "error",
709- "-framerate", "1",
710- "-i", str(wd / "proof_frame_%03d.jpg"),
711- "-vf", f"tile=3x{rows}:margin=0:padding=0",
712- "-frames:v", "1",
--
738- encoding="utf-8"
739- )
740-
741- passed = not hard and bool(valid) and sheet.exists()
742- return {
743- "pass": passed,
744- "version": VERSION,
745- "fingerprint": proof_fingerprint(data),
746: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
747- "proof_qa_brief": str(brief_path),
748- "valid_candidates": len(valid),
749- "hard_failures": hard,
750- "next": (
751: "Send proof_contact_sheet + proof_qa_brief to vision_analyze. "
752- "Only on PASS create the verdict JSON and run proof-accept."
753- if passed else "Repair proof candidates before any TTS/render work."
754- )
755- }
756-
757-
758-def proof_accept(manifest_path, verdict_path, receipt_path=None):
759- mp = Path(manifest_path).resolve()
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-v1
318- run([
319- FFMPEG, "-y", "-v", "error",
320- "-i", str(final),
321- "-vf",
322- f"fps={fps:.6f}:start_time=0.5:round=near,"
323- "scale=360:640:flags=lanczos,"
324- "tile=3x2:margin=0:padding=0",
325- "-frames:v", "1",
326: str(work / "final_contact_sheet.jpg")
327- ])
328-
329-def main():
330- ap = argparse.ArgumentParser()
331- ap.add_argument("manifest")
332- args = ap.parse_args()
333-
334- manifest_path = Path(args.manifest).resolve()
--
479- )
480- else:
481- final_md5 = final_info["video_md5"]
482-
483- qa_sig = stamp([final], "deterministic-final-qa-v1")
484- qa_meta = work / ".qa.json"
485- cached_qa = False
486-
487: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
488- try:
489- cached_qa = json.loads(
490- qa_meta.read_text(encoding="utf-8")
491- ).get("sig") == qa_sig
492- except Exception:
493- pass
494-
495- if not cached_qa:
--
503- "pass": True,
504- "version": VERSION,
505- "cached_tts": cached_tts,
506- "cached_visual": cached_visual,
507- "cached_final": cached_final,
508- "cached_qa": cached_qa,
509- "duration": probe_duration(final),
510- "final": str(final),
511: "contact_sheet": str(work / "final_contact_sheet.jpg"),
512- "video_md5": final_md5,
513- }
514- (work / "pipeline_result.json").write_text(
515- json.dumps(result, ensure_ascii=False, indent=2),
516- encoding="utf-8"
517- )
518- print(json.dumps(result, ensure_ascii=False))
519-
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.pre-proof-freeze-20260909
1030-
1031- if r.get("pass") is not True:
1032- errors.append("PROOF_GATE_INVALID: receipt does not contain pass=true")
1033- if r.get("verifier") != "vision_analyze":
1034- errors.append("PROOF_GATE_INVALID: verifier must be vision_analyze")
1035- if r.get("receipt_source") != "shorts-production-guard/post_tool_call":
1036- errors.append("PROOF_GATE_INVALID: receipt was not issued by the vision post-tool hook")
1037-
1038: sheet = r.get("contact_sheet")
1039: sheet_hash = r.get("contact_sheet_sha256")
1040- if not isinstance(sheet, str) or not Path(sheet).exists():
1041- errors.append("PROOF_GATE_INVALID: accepted proof contact sheet is missing")
1042- elif not isinstance(sheet_hash, str) or sha_file(sheet) != sheet_hash:
1043- errors.append("PROOF_GATE_STALE: accepted proof contact sheet changed after Vision verification")
1044-
1045- if r.get("fingerprint") != proof_fingerprint(data):
1046- errors.append(
1047- "PROOF_GATE_STALE: creative intent, proof candidates, or proof source changed after acceptance"
--
1085- # A runtime-issued receipt already binds the proof fingerprint, evidence
1086- # sheet hash, casting contract, and source identities. If all of that is
1087- # still valid, regenerating frames/question/pending state cannot add proof;
1088- # it only invites another Vision and main-agent loop.
1089- receipt_errors = validate_proof_receipt(data, mp)
1090- if not hard and not receipt_errors:
1091- receipt_path = proof_receipt_path(data, mp)
1092- receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
1093: sheet = Path(receipt["contact_sheet"]).resolve()
1094- return {
1095- "pass": True,
1096- "version": VERSION,
1097- "fingerprint": proof_fingerprint(data),
1098- "proof_status": "already_accepted",
1099- "vision_required": False,
1100: "proof_contact_sheet": str(sheet),
1101- "proof_qa_brief": None,
1102- "proof_pending": None,
1103- "vision_question": None,
1104- "valid_candidates": len(gate.get("candidates") or []),
1105- "valid_casting_roles": len(casting_review_entries(data)),
1106- "hard_failures": [],
1107- "warnings": [],
1108- "next": "Proof receipt is current; proceed without another proof Vision call.",
--
1293- casting_valid.append(reviewed)
1294-
1295- missing_cover = sorted(required_cover - covered)
1296- if missing_cover:
1297- hard.append(
1298- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
1299- )
1300-
1301: sheet = wd / "proof_contact_sheet.jpg"
1302- if proof_frames:
1303- cols = 5
1304- rows = max(1, (len(proof_frames) + cols - 1) // cols)
1305- run([
1306- FFMPEG, "-y", "-v", "error",
1307- "-framerate", "1",
1308- "-i", str(wd / "proof_frame_%03d.jpg"),
1309- "-vf", f"tile={cols}x{rows}:margin=0:padding=0",
--
1352- passed = not hard and bool(valid) and sheet.exists()
1353-
1354- pending_path = wd / "proof_pending.json"
1355- if passed:
1356- pending = {
1357- "fingerprint": fingerprint,
1358- "proof_token": proof_token,
1359- "manifest": str(mp),
1360: "contact_sheet": str(sheet.resolve()),
1361: "contact_sheet_sha256": sha_file(sheet),
1362- "receipt": str(receipt),
1363- "created_at": time.time(),
1364- }
1365- pending_path.write_text(
1366- json.dumps(pending, ensure_ascii=False, indent=2) + "\n",
1367- encoding="utf-8"
1368- )
1369- else:
--
1387- )
1388-
1389- return {
1390- "pass": passed,
1391- "version": VERSION,
1392- "fingerprint": fingerprint,
1393- "proof_status": "vision_required" if passed else "invalid",
1394- "vision_required": bool(passed),
1395: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
1396- "proof_qa_brief": str(brief_path),
1397- "proof_pending": str(pending_path) if passed else None,
1398- "vision_question": vision_question if passed else None,
1399- "valid_candidates": len(valid),
1400- "valid_casting_roles": len(casting_valid),
1401- "hard_failures": hard,
1402- "warnings": warnings,
1403- "next": (
1404: "Call vision_analyze on proof_contact_sheet using vision_question. "
1405- "A PASS receipt is issued automatically by the shorts-production-guard post_tool_call hook. "
1406- "Never create a verdict or proof receipt manually."
1407- if passed else "Repair proof candidates before any TTS/render work."
1408- )
1409- }
1410-
1411-
1412-def proof_accept(*args, **kwargs):
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.bak-pre-tts-markup-20260907
610-
611- if r.get("pass") is not True:
612- errors.append("PROOF_GATE_INVALID: receipt does not contain pass=true")
613- if r.get("verifier") != "vision_analyze":
614- errors.append("PROOF_GATE_INVALID: verifier must be vision_analyze")
615- if r.get("receipt_source") != "shorts-production-guard/post_tool_call":
616- errors.append("PROOF_GATE_INVALID: receipt was not issued by the vision post-tool hook")
617-
618: sheet = r.get("contact_sheet")
619: sheet_hash = r.get("contact_sheet_sha256")
620- if not isinstance(sheet, str) or not Path(sheet).exists():
621- errors.append("PROOF_GATE_INVALID: accepted proof contact sheet is missing")
622- elif not isinstance(sheet_hash, str) or sha_file(sheet) != sheet_hash:
623- errors.append("PROOF_GATE_STALE: accepted proof contact sheet changed after Vision verification")
624-
625- if r.get("fingerprint") != proof_fingerprint(data):
626- errors.append(
627- "PROOF_GATE_STALE: creative intent, proof candidates, or proof source changed after acceptance"
--
786- })
787-
788- missing_cover = sorted(required_cover - covered)
789- if missing_cover:
790- hard.append(
791- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
792- )
793-
794: sheet = wd / "proof_contact_sheet.jpg"
795- if proof_frames:
796- cols = 5
797- rows = max(1, (len(proof_frames) + cols - 1) // cols)
798- run([
799- FFMPEG, "-y", "-v", "error",
800- "-framerate", "1",
801- "-i", str(wd / "proof_frame_%03d.jpg"),
802- "-vf", f"tile={cols}x{rows}:margin=0:padding=0",
--
838- passed = not hard and bool(valid) and sheet.exists()
839-
840- pending_path = wd / "proof_pending.json"
841- if passed:
842- pending = {
843- "fingerprint": fingerprint,
844- "proof_token": proof_token,
845- "manifest": str(mp),
846: "contact_sheet": str(sheet.resolve()),
847: "contact_sheet_sha256": sha_file(sheet),
848- "receipt": str(receipt),
849- "created_at": time.time(),
850- }
851- pending_path.write_text(
852- json.dumps(pending, ensure_ascii=False, indent=2) + "\n",
853- encoding="utf-8"
854- )
855- else:
--
867- "notes must be a short string. "
868- "proof_token must be copied exactly."
869- )
870-
871- return {
872- "pass": passed,
873- "version": VERSION,
874- "fingerprint": fingerprint,
875: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
876- "proof_qa_brief": str(brief_path),
877- "proof_pending": str(pending_path) if passed else None,
878- "vision_question": vision_question if passed else None,
879- "valid_candidates": len(valid),
880- "hard_failures": hard,
881- "next": (
882: "Call vision_analyze on proof_contact_sheet using vision_question. "
883- "A PASS receipt is issued automatically by the shorts-production-guard post_tool_call hook. "
884- "Never create a verdict or proof receipt manually."
885- if passed else "Repair proof candidates before any TTS/render work."
886- )
887- }
888-
889-
890-def proof_accept(*args, **kwargs):
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.pre-real-footage-annotation-proof-20260909-153354
1052-
1053- if r.get("pass") is not True:
1054- errors.append("PROOF_GATE_INVALID: receipt does not contain pass=true")
1055- if r.get("verifier") != "vision_analyze":
1056- errors.append("PROOF_GATE_INVALID: verifier must be vision_analyze")
1057- if r.get("receipt_source") != "shorts-production-guard/post_tool_call":
1058- errors.append("PROOF_GATE_INVALID: receipt was not issued by the vision post-tool hook")
1059-
1060: sheet = r.get("contact_sheet")
1061: sheet_hash = r.get("contact_sheet_sha256")
1062- if not isinstance(sheet, str) or not Path(sheet).exists():
1063- errors.append("PROOF_GATE_INVALID: accepted proof contact sheet is missing")
1064- elif not isinstance(sheet_hash, str) or sha_file(sheet) != sheet_hash:
1065- errors.append("PROOF_GATE_STALE: accepted proof contact sheet changed after Vision verification")
1066-
1067- if r.get("fingerprint") != proof_fingerprint(data):
1068- errors.append(
1069- "PROOF_GATE_STALE: creative intent, proof candidates, or proof source changed after acceptance"
--
1151- # A runtime-issued receipt already binds the proof fingerprint, evidence
1152- # sheet hash, casting contract, and source identities. If all of that is
1153- # still valid, regenerating frames/question/pending state cannot add proof;
1154- # it only invites another Vision and main-agent loop.
1155- receipt_errors = validate_proof_receipt(data, mp)
1156- if not hard and not receipt_errors:
1157- receipt_path = proof_receipt_path(data, mp)
1158- receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
1159: sheet = Path(receipt["contact_sheet"]).resolve()
1160- return {
1161- "pass": True,
1162- "version": VERSION,
1163- "fingerprint": proof_fingerprint(data),
1164- "proof_status": "already_accepted",
1165- "vision_required": False,
1166: "proof_contact_sheet": str(sheet),
1167- "proof_qa_brief": None,
1168- "proof_pending": None,
1169- "vision_question": None,
1170- "valid_candidates": len(gate.get("candidates") or []),
1171- "valid_casting_roles": len(casting_review_entries(data)),
1172- "hard_failures": [],
1173- "warnings": [],
1174- "next": "Proof receipt is current; proceed without another proof Vision call.",
--
1368- casting_valid.append(reviewed)
1369-
1370- missing_cover = sorted(required_cover - covered)
1371- if missing_cover:
1372- hard.append(
1373- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
1374- )
1375-
1376: sheet = wd / "proof_contact_sheet.jpg"
1377- if proof_frames:
1378- cols = 5
1379- rows = max(1, (len(proof_frames) + cols - 1) // cols)
1380- run([
1381- FFMPEG, "-y", "-v", "error",
1382- "-framerate", "1",
1383- "-i", str(wd / "proof_frame_%03d.jpg"),
1384- "-vf", f"tile={cols}x{rows}:margin=0:padding=0",
--
1427- passed = not hard and bool(valid) and sheet.exists()
1428-
1429- pending_path = wd / "proof_pending.json"
1430- if passed:
1431- pending = {
1432- "fingerprint": fingerprint,
1433- "proof_token": proof_token,
1434- "manifest": str(mp),
1435: "contact_sheet": str(sheet.resolve()),
1436: "contact_sheet_sha256": sha_file(sheet),
1437- "receipt": str(receipt),
1438- "created_at": time.time(),
1439- }
1440- pending_path.write_text(
1441- json.dumps(pending, ensure_ascii=False, indent=2) + "\n",
1442- encoding="utf-8"
1443- )
1444- else:
--
1462- )
1463-
1464- return {
1465- "pass": passed,
1466- "version": VERSION,
1467- "fingerprint": fingerprint,
1468- "proof_status": "vision_required" if passed else "invalid",
1469- "vision_required": bool(passed),
1470: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
1471- "proof_qa_brief": str(brief_path),
1472- "proof_pending": str(pending_path) if passed else None,
1473- "vision_question": vision_question if passed else None,
1474- "valid_candidates": len(valid),
1475- "valid_casting_roles": len(casting_valid),
1476- "hard_failures": hard,
1477- "warnings": warnings,
1478- "next": (
1479: "Call vision_analyze on proof_contact_sheet using vision_question. "
1480- "A PASS receipt is issued automatically by the shorts-production-guard post_tool_call hook. "
1481- "Never create a verdict or proof receipt manually."
1482- if passed else "Repair proof candidates before any TTS/render work."
1483- )
1484- }
1485-
1486-
1487-def proof_accept(*args, **kwargs):
/home/hermes/.hermes/skills/media/shorts-core/scripts/production_guardrails.py.pre-preflight-timing-lock-20260909-162034
1075-
1076- if r.get("pass") is not True:
1077- errors.append("PROOF_GATE_INVALID: receipt does not contain pass=true")
1078- if r.get("verifier") != "vision_analyze":
1079- errors.append("PROOF_GATE_INVALID: verifier must be vision_analyze")
1080- if r.get("receipt_source") != "shorts-production-guard/post_tool_call":
1081- errors.append("PROOF_GATE_INVALID: receipt was not issued by the vision post-tool hook")
1082-
1083: sheet = r.get("contact_sheet")
1084: sheet_hash = r.get("contact_sheet_sha256")
1085- if not isinstance(sheet, str) or not Path(sheet).exists():
1086- errors.append("PROOF_GATE_INVALID: accepted proof contact sheet is missing")
1087- elif not isinstance(sheet_hash, str) or sha_file(sheet) != sheet_hash:
1088- errors.append("PROOF_GATE_STALE: accepted proof contact sheet changed after Vision verification")
1089-
1090- if r.get("fingerprint") != proof_fingerprint(data):
1091- errors.append(
1092- "PROOF_GATE_STALE: creative intent, proof candidates, or proof source changed after acceptance"
--
1283- # A runtime-issued receipt already binds the proof fingerprint, evidence
1284- # sheet hash, casting contract, and source identities. If all of that is
1285- # still valid, regenerating frames/question/pending state cannot add proof;
1286- # it only invites another Vision and main-agent loop.
1287- receipt_errors = validate_proof_receipt(data, mp)
1288- if not hard and not receipt_errors:
1289- receipt_path = proof_receipt_path(data, mp)
1290- receipt = json.loads(receipt_path.read_text(encoding="utf-8"))
1291: sheet = Path(receipt["contact_sheet"]).resolve()
1292- return {
1293- "pass": True,
1294- "version": VERSION,
1295- "fingerprint": proof_fingerprint(data),
1296- "proof_status": "already_accepted",
1297- "vision_required": False,
1298: "proof_contact_sheet": str(sheet),
1299- "proof_qa_brief": None,
1300- "proof_pending": None,
1301- "vision_question": None,
1302- "valid_candidates": len(gate.get("candidates") or []),
1303- "valid_casting_roles": len(casting_review_entries(data)),
1304- "hard_failures": [],
1305- "warnings": [],
1306- "next": "Proof receipt is current; proceed without another proof Vision call.",
--
1500- casting_valid.append(reviewed)
1501-
1502- missing_cover = sorted(required_cover - covered)
1503- if missing_cover:
1504- hard.append(
1505- "proof_gate candidates do not cover required targets: " + ", ".join(missing_cover)
1506- )
1507-
1508: sheet = wd / "proof_contact_sheet.jpg"
1509- if proof_frames:
1510- cols = 5
1511- rows = max(1, (len(proof_frames) + cols - 1) // cols)
1512- run([
1513- FFMPEG, "-y", "-v", "error",
1514- "-framerate", "1",
1515- "-i", str(wd / "proof_frame_%03d.jpg"),
1516- "-vf", f"tile={cols}x{rows}:margin=0:padding=0",
--
1559- passed = not hard and bool(valid) and sheet.exists()
1560-
1561- pending_path = wd / "proof_pending.json"
1562- if passed:
1563- pending = {
1564- "fingerprint": fingerprint,
1565- "proof_token": proof_token,
1566- "manifest": str(mp),
1567: "contact_sheet": str(sheet.resolve()),
1568: "contact_sheet_sha256": sha_file(sheet),
1569- "receipt": str(receipt),
1570- "created_at": time.time(),
1571- }
1572- pending_path.write_text(
1573- json.dumps(pending, ensure_ascii=False, indent=2) + "\n",
1574- encoding="utf-8"
1575- )
1576- else:
--
1594- )
1595-
1596- return {
1597- "pass": passed,
1598- "version": VERSION,
1599- "fingerprint": fingerprint,
1600- "proof_status": "vision_required" if passed else "invalid",
1601- "vision_required": bool(passed),
1602: "proof_contact_sheet": str(sheet) if sheet.exists() else None,
1603- "proof_qa_brief": str(brief_path),
1604- "proof_pending": str(pending_path) if passed else None,
1605- "vision_question": vision_question if passed else None,
1606- "valid_candidates": len(valid),
1607- "valid_casting_roles": len(casting_valid),
1608- "hard_failures": hard,
1609- "warnings": warnings,
1610- "next": (
1611: "Call vision_analyze on proof_contact_sheet using vision_question. "
1612- "A PASS receipt is issued automatically by the shorts-production-guard post_tool_call hook. "
1613- "Never create a verdict or proof receipt manually."
1614- if passed else "Repair proof candidates before any TTS/render work."
1615- )
1616- }
1617-
1618-
1619-def proof_accept(*args, **kwargs):
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-pre-google-tts
434- FFMPEG, "-y", "-v", "error",
435- "-i", str(final),
436- "-vf",
437- f"select='{select}',"
438- "scale=360:640:flags=lanczos,"
439- f"tile={cols}x{rows}:margin=0:padding=0",
440- "-fps_mode", "vfr",
441- "-frames:v", "1",
442: str(work / "final_contact_sheet.jpg")
443- ])
444: (work / "semantic_contact_sheet.json").write_text(
445- json.dumps({
446- "times": times,
447- "frames": frame_nums,
448- "shot_count": len(shots),
449- "grid": [cols, rows]
450- }, ensure_ascii=False, indent=2),
451- encoding="utf-8"
452- )
--
679- qa_sig = stamp([final], "deterministic-final-qa-v4|" + json.dumps({
680- "shots": shots,
681- "creative_intent": m.get("creative_intent", {}),
682- "performance_plan": m.get("performance_plan", {}),
683- }, sort_keys=True, ensure_ascii=False))
684- qa_meta = work / ".qa.json"
685- cached_qa = False
686-
687: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
688- try:
689- cached_qa = json.loads(
690- qa_meta.read_text(encoding="utf-8")
691- ).get("sig") == qa_sig
692- except Exception:
693- pass
694-
695- if not cached_qa:
--
703- "pass": True,
704- "version": VERSION,
705- "cached_tts": cached_tts,
706- "cached_visual": cached_visual,
707- "cached_final": cached_final,
708- "cached_qa": cached_qa,
709- "duration": probe_duration(final),
710- "final": str(final),
711: "contact_sheet": str(work / "final_contact_sheet.jpg"),
712- "vision_qa_brief": str(work / "vision_qa_brief.json"),
713- "video_md5": final_md5,
714- }
715- (work / "pipeline_result.json").write_text(
716- json.dumps(result, ensure_ascii=False, indent=2),
717- encoding="utf-8"
718- )
719- print(json.dumps(result, ensure_ascii=False))
/home/hermes/.hermes/skills/media/shorts-core/scripts/shorts_fast_pipeline.py.bak-fast-repair-20260905
454- FFMPEG, "-y", "-v", "error",
455- "-i", str(final),
456- "-vf",
457- f"select='{select}',"
458- "scale=360:640:flags=lanczos,"
459- f"tile={cols}x{rows}:margin=0:padding=0",
460- "-fps_mode", "vfr",
461- "-frames:v", "1",
462: str(work / "final_contact_sheet.jpg")
463- ])
464: (work / "semantic_contact_sheet.json").write_text(
465- json.dumps({
466- "times": times,
467- "frames": frame_nums,
468- "shot_count": len(shots),
469- "grid": [cols, rows]
470- }, ensure_ascii=False, indent=2),
471- encoding="utf-8"
472- )
--
720- qa_sig = stamp([final], "deterministic-final-qa-v4|" + json.dumps({
721- "shots": shots,
722- "creative_intent": m.get("creative_intent", {}),
723- "performance_plan": m.get("performance_plan", {}),
724- }, sort_keys=True, ensure_ascii=False))
725- qa_meta = work / ".qa.json"
726- cached_qa = False
727-
728: if qa_meta.exists() and (work / "final_contact_sheet.jpg").exists():
729- try:
730- cached_qa = json.loads(
731- qa_meta.read_text(encoding="utf-8")
732- ).get("sig") == qa_sig
733- except Exception:
734- pass
735-
736- if not cached_qa:
--
744- "pass": True,
745- "version": VERSION,
746- "cached_tts": cached_tts,
747- "cached_visual": cached_visual,
748- "cached_final": cached_final,
749- "cached_qa": cached_qa,
750- "duration": probe_duration(final),
751- "final": str(final),
752: "contact_sheet": str(work / "fina