Skip to content

Commit f06c04a

Browse files
committed
fix(validate): treat missing recordings as warnings in pre-push mode
Projects that haven't generated videos yet (e.g. right after docgen init) should still be pushable. Missing recordings are now WARN in --pre-push mode; quality failures on existing recordings (stream presence, drift) and narration lint remain hard failures. Made-with: Cursor
1 parent d034a33 commit f06c04a

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/docgen/validate.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,25 @@ def validate_segment(
6767
return report.to_dict()
6868

6969
def run_pre_push(self) -> None:
70+
"""Run all checks; exit non-zero on quality failures.
71+
72+
Missing recordings are reported as warnings, not failures — a project
73+
that hasn't generated videos yet should still be pushable. Quality
74+
checks on *existing* recordings (streams, drift) and narration lint
75+
are hard failures.
76+
"""
7077
reports = self.run_all()
71-
all_passed = True
78+
hard_fail = False
7279
for r in reports:
7380
if isinstance(r, dict):
7481
for c in r.get("checks", []):
7582
if not c.get("passed", True):
76-
all_passed = False
77-
print(f"FAIL [{r.get('segment')}] {c.get('name')}: {c.get('details')}")
78-
if not all_passed:
83+
if c.get("name") == "recording_exists":
84+
print(f"WARN [{r.get('segment')}] {c.get('name')}: {c.get('details')}")
85+
else:
86+
hard_fail = True
87+
print(f"FAIL [{r.get('segment')}] {c.get('name')}: {c.get('details')}")
88+
if hard_fail:
7989
raise SystemExit(1)
8090
print("[validate] All checks passed")
8191

0 commit comments

Comments
 (0)