Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
fix: report vertical centering with intent-aware overlaps
rpone43391d1dad77
diff --git a/.agents/skills/hypit/references/element-review.md b/.agents/skills/hypit/references/element-review.mdindex 1e4d4321..dac9bf86 100644--- a/.agents/skills/hypit/references/element-review.md+++ b/.agents/skills/hypit/references/element-review.md@@ -101,9 +101,10 @@ Every look starts with a geometry pass before style or polish. Identify the threCanvas, the outer Frame/background that owns the region, and the inner text or element that must fitinside it. For each level, check the following explicitly:-- **Centre:** when the design calls for centring, compare the content centre with the outer-frame- centre on both axes. Report the direction and approximate offset (for example, `12% too far- right` or `8% too high`), not just “misaligned”.+- **Vertical centre:** when the design calls for vertical centring, compare the content centre with+ the outer-frame centre on the Y axis. Report whether it is too high or too low and the approximate+ offset. Do not treat a deliberate left/right bias as a defect; horizontal placement is decided by+ the visual reference or the author's intent.- **Containment:** report whether every visible glyph/mark stays inside its intended outer Frame andwhether the Frame itself stays inside the Canvas. Name the offending edge and the estimated amountoutside. Distinguish intentional bleed, crop, or enter/exit motion from an accidental overflow.@@ -114,9 +115,9 @@ inside it. For each level, check the following explicitly:clipped unless the reference/intent clearly calls for it.`authoring_check` and `reconstruction_check` return a deterministic `layout_geometry` report with-Canvas/Frame bounds, sizes, centres, parent/Canvas centre offsets, containment overflow, and bound-element ids. Use those numbers as the mechanical findings and let the observer decide whether the-alignment or overflow matches the reference/intent. The report cannot measure renderer-shaped glyph+Canvas/Frame bounds, sizes, centres, parent/Canvas vertical centre offsets, containment overflow, and+bound element ids. Use those numbers as mechanical facts and let the observer decide whether the+alignment, offset or overflow matches the reference/intent. The report cannot measure renderer-shaped glyphbounds or infer intent, so the visual pass must still confirm text and marks in the rendered image.The same report includes `layout_geometry.overlaps`. It is an advisory list of independent component@@ -125,7 +126,10 @@ positive-area rectangle intersection without either rectangle fully containing tplacements owned by the same component are excluded; their internal layout is judged against thatcomponent's own parent/Frame. Full containment is omitted because a background or parent Frame commonlycovers its child intentionally. Treat each entry as a candidate finding: confirm it in the rendered-frame and against the author intent before changing Source.+frame and against the author intent before changing Source. For reconstruction, reference observation+is authoritative; for original authoring, the user's brief and settled creative intent are authoritative.+Never move an element merely to satisfy this report, and never remove an intentional overlap merely+because it was listed.The check compares only declared Canvas/Frame placement bounds; it cannot see glyph-level or otherpackage-internal bounds that a Producer does not expose.diff --git a/.agents/skills/hypit/references/original-authoring/conformance-round.md b/.agents/skills/hypit/references/original-authoring/conformance-round.mdindex d13d9814..e3ac90bc 100644--- a/.agents/skills/hypit/references/original-authoring/conformance-round.md+++ b/.agents/skills/hypit/references/original-authoring/conformance-round.md@@ -64,8 +64,9 @@ for generations that have not run and to read only what is drawn over them. Do ndo not add anything that says what you built or what you expect to be found.The visual pass is geometry-first. Read the hierarchy Canvas → outer Frame/background → inner text or-element. When the intent calls for centring, compare the inner and outer centres on both axes and report-the direction and approximate offset. Check containment at both boundaries (content inside its Frame,+element. When the intent calls for vertical centring, compare the inner and outer centres on the Y axis+and report whether it is too high or too low. Deliberate left/right bias is not a mechanical defect.+Check containment at both boundaries (content inside its Frame,Frame inside Canvas), naming any overflowing edge. Confirm the outer Frame is wide and tall enough forthe longest line/mark plus padding, stroke, shadow, and corner treatment; correct centring does not makean undersized box acceptable. Separate intentional bleed/crop or enter/exit motion from accidental@@ -77,8 +78,9 @@ the conformance decision from the rendered picture and intent. It also reports`layout_geometry.overlaps` for independent same-Canvas component placements that are simultaneous andpartially intersecting; nested placements owned by one component are excluded and remain subject tocomponent-local parent/Frame centring. Full containment is omitted and the entries are advisory-candidates, not automatic failures. It cannot measure actual glyph or package-internal bounds or infer-intent, so those still require the reader.+candidates, not automatic failures. Judge them against the user's brief and settled creative intent; do+not force centring or remove an intentional overlap. It cannot measure actual glyph or package-internal+bounds or infer intent, so those still require the reader.Clearly platform/player/export-tool watermarks are not authored content and should be ignored. If a markcould be intentional design, preserve the uncertainty and do not silently remove it.diff --git a/.agents/skills/hypit/references/original-authoring/route.md b/.agents/skills/hypit/references/original-authoring/route.mdindex 2752f3b8..1dbff70d 100644--- a/.agents/skills/hypit/references/original-authoring/route.md+++ b/.agents/skills/hypit/references/original-authoring/route.md@@ -180,8 +180,9 @@ Its `plan` is the list: each entry an element and a word range, with the reason.`render_element --batch` — the program is drawn once and every entry is cut out of those frames.Keep the check JSON's `layout_geometry` with the renders. It is the deterministic Canvas/Frame report-for centre offsets, frame capacity, and containment; the reader still decides whether the visible text-or marks fit the intent and whether any bleed is deliberate.+for vertical centre offsets, frame capacity, and containment; horizontal left/right placement is not+judged mechanically. The reader still decides whether visible text or marks fit the intent and whether+any offset, overlap or bleed is deliberate.**Read now:** `../element-review.md` — what the three rules are and why the list is what it is.`../preview.md` holds `render_element` itself.diff --git a/.agents/skills/hypit/references/preview.md b/.agents/skills/hypit/references/preview.mdindex f36e7b86..b2f11a50 100644--- a/.agents/skills/hypit/references/preview.md+++ b/.agents/skills/hypit/references/preview.md@@ -109,14 +109,16 @@ Each Segment's length comes from the Source's own `estimate:Speech`; `--referencevidence and comparison windows only. The sidecar records `"timing_basis": "estimate"`.Before reading the picture, run the route's `reconstruction_check` or `authoring_check` and keep its-`layout_geometry` object with the render. It is the mechanical Canvas/Frame report used to check centre-offsets, frame capacity, and Canvas containment; the observer still confirms rendered text bounds and+`layout_geometry` object with the render. It is the mechanical Canvas/Frame report used to check vertical+centre offsets, frame capacity, and Canvas containment; horizontal left/right placement is not judged;+the observer still confirms rendered text bounds andwhether any bleed is intentional. Also inspect `layout_geometry.overlaps`: it lists only partialrectangle intersections between independent same-Canvas component placements whose timing scopesoverlap. Nested placements owned by one component are excluded so its internal centring is checkedagainst its own parent/Frame. Full containment is omitted as a likely intentional parent/background-relationship. These are candidates, not automatic failures; verify them in the frame and remember that-package-internal glyph bounds are not available to the mechanical check.+relationship. These are candidates, not automatic failures; verify them in the frame and against the+reference or settled brief/intent. Do not fix a deliberate offset or overlap merely because it was+reported. Package-internal glyph bounds are not available to the mechanical check.## Open the whole Run for a persondiff --git a/.agents/skills/hypit/references/reconstruction/comparison-round.md b/.agents/skills/hypit/references/reconstruction/comparison-round.mdindex bab67b91..3a8b378a 100644--- a/.agents/skills/hypit/references/reconstruction/comparison-round.md+++ b/.agents/skills/hypit/references/reconstruction/comparison-round.md@@ -147,8 +147,9 @@ reference and one "in two" is something to repair.## Geometry is a first-class comparisonBefore comparing colour, typography, or motion, compare the layout hierarchy: Canvas → outer-Frame/background → inner text or element. For every centred region, report the content-to-frame centre-offset on both axes and its direction. Then report containment separately at each boundary: content+Frame/background → inner text or element. For every region intended to be vertically centred, report+the content-to-frame Y centre offset and whether it is too high or too low. Do not treat deliberate+left/right bias as a defect. Then report containment separately at each boundary: contentinside outer Frame, outer Frame inside Canvas, naming the edge and approximate overflow when one fails.Check that the outer Frame has enough width/height for the longest line or mark plus padding, stroke,shadow, and corner treatment. A box can be centred and still be too small. Treat intentional bleed,@@ -161,14 +162,15 @@ provenance is uncertain or it may be an authored design element, keep it as an ufor confirmation rather than silently discarding it.The `reconstruction_check` JSON includes `layout_geometry`, a mechanical report of Canvas/Frame bounds,-centres, parent/Canvas offsets, containment overflow, and bound element ids. The agent should use those-facts alongside the comparison text. They are deterministic Source facts, not a decision: rendered+centres, parent/Canvas vertical centre offsets, containment overflow, and bound element ids. The agent+should use those facts alongside the comparison text. They are deterministic Source facts, not a decision:+horizontal left/right placement is not judged mechanically, and renderedglyph bounds and whether an overhang is intentional still require the observer. Its`layout_geometry.overlaps` list is an advisory set of independent same-Canvas component placements thatare temporally simultaneous and partially intersecting. Nested placements owned by one component areexcluded; their internal centring remains a component-local parent/Frame comparison. Full containmentis intentionally omitted; confirm each candidate against the rendered frame and intent, and do not treat-it as an automatic gate failure. The list cannot detect overlap between package-internal glyphs or other+it as an automatic gate failure or a command to remove an intentional overlap. The list cannot detect overlap between package-internal glyphs or otherbounds not exposed by Source placement.## Measuring, on this routediff --git a/.agents/skills/hypit/references/reconstruction/route.md b/.agents/skills/hypit/references/reconstruction/route.mdindex 723c401a..f1de45a2 100644--- a/.agents/skills/hypit/references/reconstruction/route.md+++ b/.agents/skills/hypit/references/reconstruction/route.md@@ -342,8 +342,9 @@ The program is drawn once and every entry is cut out of those frames, so renderthe whole list in one `--batch` call.Keep the check JSON's `layout_geometry` beside the round. It gives the observer/agent deterministic-Canvas and Frame centres, parent/Canvas offsets, overflow edges, and bound element ids to use when-judging centring, frame capacity, and Canvas safety.+Canvas and Frame centres, parent/Canvas vertical centre offsets, overflow edges, and bound element ids+to use when judging vertical centring, frame capacity, and Canvas safety. Horizontal placement and+overlap candidates remain subject to the reference and observer intent judgement.### 20. Send every comparison at oncediff --git a/packages/reference-video-tools/src/checks.ts b/packages/reference-video-tools/src/checks.tsindex 05425656..3baa3362 100644--- a/packages/reference-video-tools/src/checks.ts+++ b/packages/reference-video-tools/src/checks.ts@@ -357,7 +357,7 @@ type OutOfBoundsFrame = {* Deterministic geometry facts handed to the observer alongside the human-readable round.** This deliberately reports only what the Source can prove: Canvas/Frame rectangles, parent and- * Canvas containment, and centre offsets. Whether a particular box *ought* to be centred, or whether+ * Canvas containment, and vertical centre offsets. Whether a particular box *ought* to be centred, or whether* a child is intentionally clipped (for example during an enter animation), remains a visual and* intent judgement. Text glyph bounds are renderer-dependent and therefore are not invented here.*/@@ -369,8 +369,9 @@ type LayoutGeometryEntry = {readonly bounds?: Box;readonly size?: { readonly width: number; readonly height: number };readonly center?: { readonly x: number; readonly y: number };- readonly center_offset_from_within?: { readonly x: number; readonly y: number };- readonly center_offset_from_canvas?: { readonly x: number; readonly y: number };+ /** Signed vertical centre offset: positive means below the parent/Canvas centre. */+ readonly vertical_center_offset_from_within?: number;+ readonly vertical_center_offset_from_canvas?: number;readonly outside_within?: { readonly left: number; readonly top: number; readonly right: number; readonly bottom: number };readonly outside_canvas?: { readonly left: number; readonly top: number; readonly right: number; readonly bottom: number };readonly bound_elements?: readonly string[];@@ -784,7 +785,9 @@ function layoutGeometry(svml: string): LayoutGeometryReport {bottom: round(Math.max(child.bottom - parent.bottom, 0)),});const centre = (box: Box) => ({ x: round((box.left + box.right) / 2), y: round((box.top + box.bottom) / 2) });- const delta = (a: Box, b: Box) => ({ x: round((a.left + a.right - b.left - b.right) / 2), y: round((a.top + a.bottom - b.top - b.bottom) / 2) });+ // Horizontal placement is often intentionally left- or right-biased (labels, rails, icons). Only+ // report vertical centring mechanically; the visual/author intent remains the authority.+ const verticalDelta = (a: Box, b: Box) => round((a.top + a.bottom - b.top - b.bottom) / 2);const entries: LayoutGeometryEntry[] = [];for (const [id, canvas] of geometry.canvases) {@@ -809,14 +812,14 @@ function layoutGeometry(svml: string): LayoutGeometryReport {...(canvasId === undefined ? {} : { canvas: canvasId }), bounds: box,size: { width: round(box.right - box.left), height: round(box.bottom - box.top) },center: centre(box),- ...(parent === undefined ? {} : { center_offset_from_within: delta(box, parent), outside_within: outside(box, parent) }),- ...(canvas === undefined ? {} : { center_offset_from_canvas: delta(box, canvas), outside_canvas: outside(box, canvas) }),+ ...(parent === undefined ? {} : { vertical_center_offset_from_within: verticalDelta(box, parent), outside_within: outside(box, parent) }),+ ...(canvas === undefined ? {} : { vertical_center_offset_from_canvas: verticalDelta(box, canvas), outside_canvas: outside(box, canvas) }),bound_elements: bound.get(id) ?? [],});}return {coordinate_system: "Canvas pixels, origin top-left, y increases downward",- note: "Use these facts to decide whether centering and containment match the reference/intent. They do not measure rendered glyph bounds or decide whether an overhang is intentional.",+ note: "Use vertical centre offsets and containment as mechanical facts; horizontal left/right placement is not judged. Visual observation and author intent decide whether any offset or overlap is correct. The report does not measure rendered glyph bounds or decide whether an overhang is intentional.",entries,overlaps: layoutOverlaps(svml, geometry),};diff --git a/packages/reference-video-tools/src/cli.ts b/packages/reference-video-tools/src/cli.tsindex fb88332a..2e4784a3 100644--- a/packages/reference-video-tools/src/cli.ts+++ b/packages/reference-video-tools/src/cli.ts@@ -75,8 +75,9 @@ function usage(): string {"looks the same. A comparison cannot answer it either way, because the render and reference are","drawn at the same Canvas and put the element in the same place off the edge.","Both checks also return layout_geometry: deterministic Canvas/Frame bounds, centres, parent and",- "Canvas offsets, containment overflow and bound element ids. Use it as a mechanical geometry report",- "for the observer to judge centring, frame capacity and Canvas safety; layout_geometry.overlaps adds",+ "Canvas vertical centre offsets, containment overflow and bound element ids. Use it as a mechanical",+ "geometry report for vertical centring, frame capacity and Canvas safety; horizontal left/right placement",+ "is not judged. layout_geometry.overlaps adds","advisory independent same-Canvas, simultaneous partial-intersection candidates; nested placements","owned by one component are excluded (full containment is omitted).","It does not measure rendered glyph bounds or decide whether an overhang or overlap is intentional.",diff --git a/packages/reference-video-tools/src/tools.ts b/packages/reference-video-tools/src/tools.tsindex 56d6a7e2..7ab41b5f 100644--- a/packages/reference-video-tools/src/tools.ts+++ b/packages/reference-video-tools/src/tools.ts@@ -2066,7 +2066,7 @@ export function createReferenceVideoTools(options: ToolOptions = {}): ReferenceVconst differences = await ask(`comparison:${comparisonId}`, {media: [referenceMedia, renderedMedia],instruction: `You compare two supplied ${unit} and describe their visible differences in natural language only. You are not told how either was made. Do not write code, markup, SVML, component names, or production advice.`,- prompt: `Two ${unit} are supplied in order: one, then two. Call them one and two throughout your answer, and say which of the two each difference is in.${reading}${asClip ? cut?.incomplete ?? "" : ""}${scope.length === 0 ? "" : `\n\nLimit the comparison to this: ${scope}`}\n\nStart with a geometry pass before style: identify the Canvas, the outer frame or background box, and the inner text/element. For every region that should be centred, compare inner and outer centres on both axes and report the direction and approximate offset. Check containment separately (inner content inside its outer frame; outer frame inside the Canvas), naming the overflowing edge and approximate amount. Check that the outer frame is wide and tall enough for the longest line or mark including padding, stroke, shadow and corner treatment. Distinguish intentional bleed, crop, or enter/exit motion from accidental overflow. Then describe every other visible difference between them: layout and arrangement, the position and size of each element, cropping and margins, colour, typeface, weight, letter and line spacing, alignment, outline or stroke, shadow, glow, borders and corner treatment, and anything present in one and absent from the other.${asClip ? " Also describe differences in what changes over the stretch: what appears, what leaves, in what order, and how anything moves." : ""} State plainly which differences are large enough to read as a different design and which are minor. If they are visually equivalent, say exactly that.\n\nDo not speculate about how either was produced, which one is a source, or which one is a copy. Return natural language only.`,+ prompt: `Two ${unit} are supplied in order: one, then two. Call them one and two throughout your answer, and say which of the two each difference is in.${reading}${asClip ? cut?.incomplete ?? "" : ""}${scope.length === 0 ? "" : `\n\nLimit the comparison to this: ${scope}`}\n\nStart with a geometry pass before style: identify the Canvas, the outer frame or background box, and the inner text/element. For every region intended to be vertically centred, compare inner and outer centres on the Y axis and report whether it is too high or too low. Do not treat deliberate left/right bias as a defect. Check containment separately (inner content inside its outer frame; outer frame inside the Canvas), naming the overflowing edge and approximate amount. Check that the outer frame is wide and tall enough for the longest line or mark including padding, stroke, shadow and corner treatment. Treat overlap candidates as prompts for inspection only: the supplied reference or settled brief and intent decide whether an overlap or offset is correct; never recommend removing an intentional overlap merely because it exists. Distinguish intentional bleed, crop, or enter/exit motion from accidental overflow. Then describe every other visible difference between them: layout and arrangement, the position and size of each element, cropping and margins, colour, typeface, weight, letter and line spacing, alignment, outline or stroke, shadow, glow, borders and corner treatment, and anything present in one and absent from the other.${asClip ? " Also describe differences in what changes over the stretch: what appears, what leaves, in what order, and how anything moves." : ""} State plainly which differences are large enough to read as a different design and which are minor. If they are visually equivalent, say exactly that.\n\nDo not speculate about how either was produced, which one is a source, or which one is a copy. Return natural language only.`,});// What was compared, and what was seen. The record is what a gate reads to tell an element that// was looked at from one that never was, and what an identical pair is answered from without