Feature/video artifact verification (#537)

* fix(release): CI wait polls the prod rung; escape the header tooltip apostrophe

get_latest_ci_conclusion defaults to the ladder's head rung, so
wait_for_ci searched slave for a release commit that lives on master
and timed out after 40 minutes with the run already green. The wait
now passes the prod branch explicitly. Also fixes the
react/no-unescaped-entities error that turned master's Panel CI red.

* fix(panel,video): dead dialog triggers behind tooltips; dotted composition ids render

HelpTip nested inside a Dialog/AlertDialog trigger puts the trigger's
click handler on the Tooltip root, which renders no DOM — the agents
Spawn item and the KB Reindex-All / Delete-index confirms were dead.
Tooltips now wrap the triggers. The video renderer accepts interior
single dots in composition ids (release-0.25.0) with '..' still
unrepresentable, and propose_video refuses an unrenderable id at
authoring time.

* fix(dispatch): restart-safe PM review turns

A leaf task in awaiting_pm_review had no periodic pickup: the closure
dispatcher bailed on childless tasks and skipped PR-bearing review
tasks as already-promoted, assuming the submit-time PM session was
still alive — an assumption every restart breaks. Proven live on the
docs-sync leaf after the 0.25.0 redeploy, which also dependency-blocked
its sibling dev task. Childless awaiting_pm_review tasks now flow to
the PM's review turn, and the merge turn respawns its PM when none is
active.

* feat(video): verify the rendered artifact, not the source

The 14s release-0.25.0 cut shipped with only one of four scenes visibly
registering: the dev authored DOM, the smoke asserted DOM, QA read code —
nobody consumed the rendered MP4 before the CEO did. Close that loop, and
the reject loop behind it:

- sidecar frames mode: POST /render with frames=1..32 renders the cut,
  ffprobes the REAL duration, extracts midpoint-sampled keyframe PNGs
  (timestamps in filenames), streams a tar.gz back with X-Video-Duration
- request_render do-verb (developer/QA, request_sandbox's shape): renders
  the caller's ACTUAL composition — dev's own worktree (head_sha/dirty
  provenance), QA a read-only git-archive export of the assembled branch —
  extracts frames to the container-shared .previews/ path, stamps the
  render_preview marker, returns the paths as envelope evidence
- gate: i_am_done on a source=video task refuses without a stamped
  render_preview (Requirement.RENDER_VERIFIED; canonical source string
  moved to foundation as markers.VIDEO_TASK_SOURCE; mirrored in the
  possibilities-matrix fast path so it cannot bypass the check)
- QA claim_review evidence carries video_context (composition id, the
  dev's preview, a re-render instruction) so review checks output
- dev spawn prompt block + a 4th authoring AC order Read-every-frame
  verification before submitting
- reject -> re-author: a CEO reject with a reason opens a fresh authoring
  task carrying the verbatim feedback + a revise-in-place pointer at the
  existing composition (best-effort, never fails the reject) — rejection
  feedback no longer dies on the cancelled draft

E2E: rendered the committed release-0.25.0 composition through the new
frames mode locally — the returned keyframes show exactly the reported
failure (blank frame at 5.8s, only 'Env ladder' by 12.8s), the check the
fleet was missing.

---------

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-07-16 19:49:26 +02:00
committed by GitHub
co-authored by Renn F
parent 797847e379
commit aa15dc40cc
37 changed files with 2146 additions and 54 deletions
+47
View File
@@ -50,6 +50,10 @@ _COMMIT_TIMEOUT = 190
# 1035s — images are pre-pulled at startup in practice, so cold pulls here
# are the exception, but the timeout must cover the worst case anyway.
_SANDBOX_TIMEOUT = 1080
# request_render runs an inline sidecar render call; the sidecar's own render
# ceiling is video_render_timeout_seconds (default 600s) plus its request
# timeout for uploading the tarball — 660s gives that headroom.
_RENDER_TIMEOUT = 660
# Tight timeout for SDK loopback — local sidecar; gateway path must not stall.
_SDK_TIMEOUT = 2.0
# FastAPI's default missing-route status. Every /api/v1/do/* route returns
@@ -658,6 +662,10 @@ def propose_video(
composition in motion/compositions/<id>/. Then commit + open_pr to send
it through the normal PR-review gate.
After proposing, call request_render and verify the frames it returns
before i_am_done — the composition's SOURCE looking right is not the
same as the RENDERED artifact looking right.
Args:
composition_id: The HyperFrames composition id (the directory name
under motion/compositions/, e.g. 'release-announcement').
@@ -754,6 +762,44 @@ def request_sandbox(
)
def request_render(
composition_id: str | None = None,
orientation: str = "vertical",
frame_count: int = 8,
input_props: dict[str, Any] | None = None,
) -> dict[str, Any]:
"""Render your video composition to a strip of preview frames — call
this after building or altering the HyperFrames composition, on a
video-authoring task, to verify the RENDERED artifact rather than just
trusting the source looks right.
Omit ``composition_id`` to use the one already proposed via
propose_video. Returns ``evidence.frames`` — absolute paths to the
rendered frame images. Read EVERY frame with your file tools before
calling i_am_done; if a scene is missing, clipped, or wrong, fix the
composition and call this again. A developer renders from their own
working tree; QA renders from a read-only export of the assembled
branch — either way this never mutates your working tree.
Args:
composition_id: The composition id under motion/compositions/. Omit
to use the task's already-proposed composition_id.
orientation: 'vertical' or 'square'.
frame_count: How many evenly-spaced preview frames to extract (1-32).
input_props: Optional props passed into the composition at render time.
"""
return _post(
"/api/v1/do/request_render",
{
"composition_id": composition_id,
"orientation": orientation,
"frame_count": frame_count,
"input_props": input_props,
},
timeout=_RENDER_TIMEOUT,
)
def draft_playbook(
title: str,
problem: str,
@@ -962,6 +1008,7 @@ _TOOLS: dict[str, Any] = {
"notify": notify,
"evidence": evidence,
"request_sandbox": request_sandbox,
"request_render": request_render,
"progress": progress,
"notify_list": notify_list,
"notify_get": notify_get,