Skip to content

armgit / hypit

Public Imported from GitHub
0

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.

refactor(estimate): durations are author literals, measured with hypit measure

kashorine451341f2e3c
diff --git a/docs/guide/packages.md b/docs/guide/packages.md
index 5eadbe14..a66b58d3 100644
--- a/docs/guide/packages.md
+++ b/docs/guide/packages.md
@@ -91,7 +91,7 @@ specific Provider deployment.
@hypit/nano-banana Nano Banana model family
@hypit/seedream Seedream model family
@hypit/mimo-tts Xiaomi MiMo VoiceDesign model + author Surface
-@hypit/estimate duration estimation
+@hypit/estimate creation-time speech measurement (hypit measure) and the estimate policy type
@hypit/speech shared speech products
@hypit/speech-evidence acoustic evidence products
@hypit/speech-alignment speech alignment
diff --git a/docs/quickstart/generation.md b/docs/quickstart/generation.md
index 661a11fe..90c58025 100644
--- a/docs/quickstart/generation.md
+++ b/docs/quickstart/generation.md
@@ -13,7 +13,6 @@ Every component shown here must be imported by its package specifier before use:
```svml
<import as="media" from="@hypit/media@1"/>
<import as="mediaop" from="@hypit/media-pipeline@1"/>
-<import as="estimate" from="@hypit/estimate@1"/>
<import as="text" from="@hypit/text@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="speaker-kit" source="./kits/speaker-v1.svs"/>
@@ -50,53 +49,28 @@ Declares an audio Resource from a local file.
Typically used as a voice-timbre reference for `seedance:ReferenceVideo`.
-## estimate:Speech
+## Durations are literals
-Deterministic speech duration planning from Script pronunciation text. No external service call — the
-duration is computed locally from pronunciation units and a delivery-density policy.
+A generated take's length is the author's decision, written as a literal on the element that needs
+it. Measure the line first, then write the number:
-```svml
-<estimate:Speech id="hook-duration"
- source={story.segment.hook.speech}
- policy={recipes.speech.normal}/>
-```
-
-| Attribute | Required | Description |
-|---|---|---|
-| `id` | yes | Unique identifier |
-| `source` | yes | Script text to estimate — typically `{script.segment.NAME.speech}` |
-| `policy` | no | SVS speech Recipe controlling pace and bounds; omit it to use inline parameters |
-
-The `policy` references an SVS Recipe (see [SVS Stylesheets](./styles.md#speech-estimation)):
-
-```svs
-speech.normal {
- language: en;
- pace: normal;
- min: 4;
- max: 15;
- rounding: round;
-}
+```bash
+hypit measure main.svml --segment hook --language en --pace normal --min 4 --max 15 --rounding round
+# 7s
```
-You can also specify estimation parameters inline instead of using an SVS policy:
-
```svml
-<estimate:Speech id="opening-duration"
- source={story.segment.opening.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
+<seedance:ReferenceVideo id="hook-take" model="mini" prompt={hook-prompt} duration="7">
+ …
+</seedance:ReferenceVideo>
```
-For English, the official pace presets are `slow = 4.2`, `normal = 4.6`, and
-`fast = 5.0` syllables per second. `rate="4.75"` may be used instead of `pace`
-when a project needs a value between the named presets. `pace` and `rate` are
-mutually exclusive.
-
-There are no implicit policy values: `language`, `min`, `max`, `rounding`, and
-exactly one of `pace` or `rate` must be present either inline or in the referenced Recipe.
-
-**Output:** `{hook-duration.duration}` — the estimated duration in seconds, passed to generation
-components.
+`hypit measure` counts pronunciation units of the Segment's speech at a delivery policy — `language`,
+`pace` (`slow = 4.2`, `normal = 4.6`, `fast = 5.0` syllables per second for English) or a numeric
+`rate`, `min`, `max` and `rounding` — with no external call. Nothing in the graph computes a duration,
+so `hypit plan` is complete before a Build starts. The same policy, written on
+`estimated:SemanticTake` or as an SVS Recipe it names (see
+[SVS Stylesheets](./styles.md#speech-estimation)), weights a Segment's words across preview media.
## text:Value
@@ -179,7 +153,8 @@ video and audio references within the model's declared limits.
The component does not know that this is a talking head. That meaning lives in the supplied Text.
Common attributes are `id`, `model`, `prompt`, `duration`, `resolution`, `aspect-ratio` and
-`generate-audio`. `duration` may be literal or an explicit `{estimate.duration}` edge.
+`generate-audio`. `duration` is a literal in whole seconds inside the model's range, measured
+beforehand with `hypit measure`.
The audio generated in an earlier take can be reused as a later reference through an ordinary graph
edge. Extraction does not turn it into speech evidence or attach speaker meaning:
@@ -335,11 +310,11 @@ reference media or generation endpoint.
## Combination example
-A two-take setup with estimated durations feeding explicit Text assembly and Seedance generation:
+A two-take setup with measured durations written as literals, explicit Text assembly and Seedance
+generation:
```svml
<import as="media" from="@hypit/media@1"/>
-<import as="estimate" from="@hypit/estimate@1"/>
<import as="text" from="@hypit/text@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="recipes" source="./recipes.svs"/>
@@ -349,10 +324,6 @@ A two-take setup with estimated durations feeding explicit Text assembly and See
<media:Image id="presenter-alt" src="./assets/presenter-alt.png"/>
<media:Audio id="presenter-voice" src="./assets/presenter-voice.mp3"/>
-<estimate:Speech id="hook-duration"
- source={story.segment.hook.speech} policy={recipes.speech.normal}/>
-<estimate:Speech id="meeting-duration"
- source={story.segment.meeting.speech} policy={recipes.speech.normal}/>
<text:Value id="hook-action">Start urgently, then become quieter.</text:Value>
<text:Value id="meeting-action">Indicate the product, then return to the lens.</text:Value>
diff --git a/docs/quickstart/styles.md b/docs/quickstart/styles.md
index 0bbe0268..0a38d87f 100644
--- a/docs/quickstart/styles.md
+++ b/docs/quickstart/styles.md
@@ -267,10 +267,12 @@ continuous author-controlled value.
Every property is explicit: `language`, `min`, `max`, `rounding`, and exactly
one of `pace` or `rate` are required. The Estimate package supplies no hidden policy defaults.
-Referenced by `estimate:Speech` via the `policy` attribute:
+Referenced by `estimated:SemanticTake` via the `policy` attribute, and used by `hypit measure`
+when the author measures a line before writing its literal duration:
```svml
-<estimate:Speech id="hook-duration" source={story.segment.hook.speech}
+<estimated:SemanticTake id="hook-estimated" narrative={story}
+ segment={story.segment.hook} media={hook-media.media}
policy={recipes.speech.normal}/>
```
@@ -440,7 +442,8 @@ This file is imported once in the `.svml` source and its values are referenced t
```svml
<import as="recipes" source="./recipes.svs"/>
-<estimate:Speech id="hook-duration" source={story.segment.hook.speech}
+<estimated:SemanticTake id="hook-estimated" narrative={story}
+ segment={story.segment.hook} media={hook-media.media}
policy={recipes.speech.normal}/>
<text:Render id="hook-prompt" template={speaker-kit.speaker-v1}
diff --git a/docs/zh/guide/packages.md b/docs/zh/guide/packages.md
index 8141056b..6b562e34 100644
--- a/docs/zh/guide/packages.md
+++ b/docs/zh/guide/packages.md
@@ -84,7 +84,7 @@ Frontend;不存在一个认识全部语法的中央解析器。
@hypit/nano-banana Nano Banana model family
@hypit/seedream Seedream model family
@hypit/mimo-tts Xiaomi MiMo VoiceDesign 模型及作者 Surface
-@hypit/estimate duration estimation
+@hypit/estimate 创作期量稿(hypit measure)与估算策略类型
@hypit/speech shared speech products
@hypit/speech-evidence acoustic evidence products
@hypit/speech-alignment speech alignment
diff --git a/docs/zh/quickstart/generation.md b/docs/zh/quickstart/generation.md
index 63eb4581..1d608196 100644
--- a/docs/zh/quickstart/generation.md
+++ b/docs/zh/quickstart/generation.md
@@ -48,46 +48,22 @@ description: 声明媒体资源并使用 Seedance 生成视频。
通常用作 `seedance:ReferenceVideo` 的语音音色参考。
-## estimate:Speech
+## 时长是字面量
-基于 Script 实际读音文本的确定性语音时长规划。无需外部服务调用——时长根据读音单位和口播密度策略在本地计算。
+生成片段的长度由作者决定,直接写在需要它的元素上。先量稿子,再写数字:
-```svml
-<estimate:Speech id="hook-duration"
- source={story.segment.hook.speech}
- policy={recipes.speech.normal}/>
-```
-
-| 属性 | 必填 | 说明 |
-|---|---|---|
-| `id` | 是 | 唯一标识符 |
-| `source` | 是 | 要估算的 Script 文本——通常为 `{script.segment.NAME.speech}` |
-| `policy` | 否 | 控制语速和边界的 SVS 语音 Recipe;省略时使用内联参数 |
-
-`policy` 引用一个 SVS Recipe(参见 [SVS 样式表](./styles.md#speech-estimation)):
-
-```svs
-speech.normal {
- language: en;
- pace: normal;
- min: 4;
- max: 15;
- rounding: round;
-}
+```bash
+hypit measure main.svml --segment hook --language en --pace normal --min 4 --max 15 --rounding round
+# 7s
```
-你也可以直接内联指定估算参数,而不使用 SVS policy:
-
```svml
-<estimate:Speech id="opening-duration"
- source={story.segment.opening.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
+<seedance:ReferenceVideo id="hook-take" model="mini" prompt={hook-prompt} duration="7">
+ …
+</seedance:ReferenceVideo>
```
-英语官方档位为 `slow = 4.2`、`normal = 4.6`、`fast = 5.0` 音节/秒。项目需要档位之间的连续值时,可以用 `rate="4.75"` 代替 `pace`;二者不能同时出现。策略没有隐式值:无论内联还是引用 Recipe,都必须写明 `language`、`min`、`max`、
-`rounding`,并且在 `pace` 和 `rate` 中恰好选择一个。
-
-**输出:** `{hook-duration.duration}`——估算的时长(秒),传递给生成组件。
+`hypit measure` 按口播策略——`language`、`pace`(英语 `slow = 4.2`、`normal = 4.6`、`fast = 5.0` 音节/秒)或数值 `rate`、`min`、`max`、`rounding`——统计 Segment 台词的读音单位,不调用任何外部服务。图里没有任何东西在计算时长,所以 `hypit plan` 在 Build 开始前就是完整的。同一套策略写在 `estimated:SemanticTake` 上或它引用的 SVS Recipe 里(参见 [SVS 样式表](./styles.md#speech-estimation)),用于把 Segment 的词按音节权重铺到预览媒体上。
## text:Value
@@ -162,7 +138,7 @@ Seedance 2.5 复用同样的 Surface,而不是由 Runtime 把别的模型偷
这个低层组件并不知道它被用来做口播;用途只存在于传入的 Text 中。公共属性包括
`id`、`model`、`prompt`、`duration`、`resolution`、
-`aspect-ratio`、`generate-audio`;`duration` 可以是字面量或显式 `{estimate.duration}` 边。
+`aspect-ratio`、`generate-audio`;`duration` 是模型范围内的整秒字面量,事先用 `hypit measure` 量好。
可以直接抽取前一段生成视频里的音频,并通过普通图边给后续片段当作参考。这个操作不会把音频提升成语音证据,也不会凭空附加说话人语义:
@@ -295,11 +271,10 @@ dialogue/action 由普通 Text 模块组装,结果再像其他生成任务一
## 组合示例
-一个两段拍摄的设置,估算时长进入显式 Text 组装与 Seedance 生成:
+一个两段拍摄的设置,量好的时长写成字面量,显式 Text 组装与 Seedance 生成:
```svml
<import as="media" from="@hypit/media@1"/>
-<import as="estimate" from="@hypit/estimate@1"/>
<import as="text" from="@hypit/text@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="recipes" source="./recipes.svs"/>
@@ -309,10 +284,6 @@ dialogue/action 由普通 Text 模块组装,结果再像其他生成任务一
<media:Image id="presenter-alt" src="./assets/presenter-alt.png"/>
<media:Audio id="presenter-voice" src="./assets/presenter-voice.mp3"/>
-<estimate:Speech id="hook-duration"
- source={story.segment.hook.speech} policy={recipes.speech.normal}/>
-<estimate:Speech id="meeting-duration"
- source={story.segment.meeting.speech} policy={recipes.speech.normal}/>
<text:Value id="hook-action">Start urgently, then become quieter.</text:Value>
<text:Value id="meeting-action">Indicate the product, then return to the lens.</text:Value>
diff --git a/docs/zh/quickstart/styles.md b/docs/zh/quickstart/styles.md
index fef2066c..fcd4b99c 100644
--- a/docs/zh/quickstart/styles.md
+++ b/docs/zh/quickstart/styles.md
@@ -259,10 +259,11 @@ speech.normal {
英语三个具名档位分别解析为每秒 `4.2`、`4.6`、`5.0` 个音节。项目需要连续可调值时,用数值 `rate` 代替 `pace`。所有属性都必须显式提供:`language`、`min`、`max`、`rounding`,并且在 `pace` 与
`rate` 中恰好选择一个。Estimate 包不会补充隐藏策略默认值。
-通过 `estimate:Speech` 的 `policy` 属性引用:
+通过 `estimated:SemanticTake` 的 `policy` 属性引用;作者写字面量时长之前用 `hypit measure` 量稿,用的也是同一套策略:
```svml
-<estimate:Speech id="hook-duration" source={story.segment.hook.speech}
+<estimated:SemanticTake id="hook-estimated" narrative={story}
+ segment={story.segment.hook} media={hook-media.media}
policy={recipes.speech.normal}/>
```
@@ -416,7 +417,8 @@ Caption Recipe 不再重复家族、字重或字形。CJK 与 Emoji 即使由多
```svml
<import as="recipes" source="./recipes.svs"/>
-<estimate:Speech id="hook-duration" source={story.segment.hook.speech}
+<estimated:SemanticTake id="hook-estimated" narrative={story}
+ segment={story.segment.hook} media={hook-media.media}
policy={recipes.speech.normal}/>
<text:Render id="hook-prompt" template={speaker-kit.speaker-v1}
diff --git a/examples/interview/reference.svml b/examples/interview/reference.svml
index 94538d4c..0f5648f1 100644
--- a/examples/interview/reference.svml
+++ b/examples/interview/reference.svml
@@ -11,7 +11,6 @@
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
<import as="speech" from="@hypit/speech-track@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="audio-track" from="@hypit/audio-track@1"/>
<import as="caption" from="@hypit/caption@1"/>
<import as="caption-fine" from="@hypit/caption-fine@1"/>
@@ -169,8 +168,6 @@
<!-- Preview-only timing policy used by the local mock Run. The paid path
continues to use the WhisperX SemanticTake declarations above. -->
- <estimate:Speech id="preview-estimate" source={story.segment.manifest-rule.speech}
- language="en" pace="normal" min="1" max="30" rounding="none"/>
<pipeline:Normalize id="soundtrack-media" source={soundtrack}
video="none" audio="default" span-authority="audio" clock={clock}/>
diff --git a/examples/minimal-author-package/packages/example-component/preview/preview.svml b/examples/minimal-author-package/packages/example-component/preview/preview.svml
index 5a67ae29..5e4a87f6 100644
--- a/examples/minimal-author-package/packages/example-component/preview/preview.svml
+++ b/examples/minimal-author-package/packages/example-component/preview/preview.svml
@@ -9,7 +9,6 @@
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="speech" from="@hypit/speech-track@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="space" from="@hypit/spatial@1"/>
<import as="program" from="@hypit/program-space@1"/>
<import as="film" from="@hypit/film@1"/>
@@ -26,8 +25,7 @@
<space:Frame id="speech-frame" within={vertical} left="0%" top="0%" right="100%" bottom="100%"/>
<wording:Value id="direction">A neutral catalogue card in a quiet studio.</wording:Value>
- <estimate:Speech id="showcase-duration" source={story.segment.showcase.speech} policy={recipes.speech.normal}/>
- <seedance:TextVideo id="take" model="mini" prompt={direction} duration={showcase-duration.duration} generate-audio="true"/>
+ <seedance:TextVideo id="take" model="mini" prompt={direction} duration="4" generate-audio="true"/>
<pipeline:Normalize id="take-media" source={take.video} recipe={recipes.media.aroll} clock={clock}/>
<whisperx:SemanticTake id="showcase-semantic" narrative={story} segment={story.segment.showcase} media={take-media.media} language="en"/>
<speech:Track id="speech" visual-frame={speech-frame} visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/podcast/reference.svml b/examples/podcast/reference.svml
index 0212488f..aba0d86f 100644
--- a/examples/podcast/reference.svml
+++ b/examples/podcast/reference.svml
@@ -10,7 +10,6 @@
<import as="program" from="@hypit/program-space@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
<import as="speech" from="@hypit/speech-track@1"/>
<import as="audio-track" from="@hypit/audio-track@1"/>
@@ -209,17 +208,15 @@
<whisperx:SemanticTake id="arms-are-asking-semantic" narrative={story}
segment={story.segment.arms-are-asking} media={arms-are-asking-media.media} language="en"/>
- <estimate:Speech id="preview-estimate" source={story.segment.opening-question.speech}
- policy={recipes.speech.preview}/>
<estimated:SemanticTake id="opening-estimated" narrative={story}
segment={story.segment.opening-question} media={opening-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<estimated:SemanticTake id="daily-creatine-estimated" narrative={story}
segment={story.segment.daily-creatine} media={daily-creatine-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<estimated:SemanticTake id="arms-are-asking-estimated" narrative={story}
segment={story.segment.arms-are-asking} media={arms-are-asking-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<speech:Track id="speech" visual-frame={full-frame}
visual-appearance={recipes.speech.visual} visual-z="10">
diff --git a/examples/podcast/swap-host.svml b/examples/podcast/swap-host.svml
index dd7391df..daf914a2 100644
--- a/examples/podcast/swap-host.svml
+++ b/examples/podcast/swap-host.svml
@@ -9,7 +9,6 @@
<import as="program" from="@hypit/program-space@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
<import as="speech" from="@hypit/speech-track@1"/>
<import as="audio-track" from="@hypit/audio-track@1"/>
@@ -197,17 +196,15 @@
<whisperx:SemanticTake id="arms-are-asking-semantic" narrative={story}
segment={story.segment.arms-are-asking} media={arms-are-asking-media.media} language="en"/>
- <estimate:Speech id="preview-estimate" source={story.segment.opening-question.speech}
- policy={recipes.speech.preview}/>
<estimated:SemanticTake id="opening-estimated" narrative={story}
segment={story.segment.opening-question} media={opening-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<estimated:SemanticTake id="daily-creatine-estimated" narrative={story}
segment={story.segment.daily-creatine} media={daily-creatine-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<estimated:SemanticTake id="arms-are-asking-estimated" narrative={story}
segment={story.segment.arms-are-asking} media={arms-are-asking-media.media}
- policy={preview-estimate.policy}/>
+ policy={recipes.speech.preview}/>
<speech:Track id="speech" visual-frame={full-frame}
visual-appearance={recipes.speech.visual} visual-z="10">
diff --git a/examples/ranking-football/reference-banana-from-swap/reference-banana-from-swap.svml b/examples/ranking-football/reference-banana-from-swap/reference-banana-from-swap.svml
index c4d7fa83..6147a7fa 100644
--- a/examples/ranking-football/reference-banana-from-swap/reference-banana-from-swap.svml
+++ b/examples/ranking-football/reference-banana-from-swap/reference-banana-from-swap.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -67,10 +66,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -205,19 +200,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/reference-banana/reference-banana.svml b/examples/ranking-football/reference-banana/reference-banana.svml
index c4d7fa83..6147a7fa 100644
--- a/examples/ranking-football/reference-banana/reference-banana.svml
+++ b/examples/ranking-football/reference-banana/reference-banana.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -67,10 +66,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -205,19 +200,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/reference-gpt.svml b/examples/ranking-football/reference-gpt.svml
index 74ac6362..eff17186 100644
--- a/examples/ranking-football/reference-gpt.svml
+++ b/examples/ranking-football/reference-gpt.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -69,10 +68,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -207,19 +202,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter-mock.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter-mock.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/reference.svml b/examples/ranking-football/reference.svml
index bd60232c..d4743a48 100644
--- a/examples/ranking-football/reference.svml
+++ b/examples/ranking-football/reference.svml
@@ -6,7 +6,6 @@
<import as="asset" from="@hypit/media@1"/>
<import as="mimo" from="@hypit/mimo-tts@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -71,10 +70,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -209,19 +204,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/swap-effect-banana-reference-sync/swap-effect-banana-reference-sync.svml b/examples/ranking-football/swap-effect-banana-reference-sync/swap-effect-banana-reference-sync.svml
index 4d3201a4..257eace9 100644
--- a/examples/ranking-football/swap-effect-banana-reference-sync/swap-effect-banana-reference-sync.svml
+++ b/examples/ranking-football/swap-effect-banana-reference-sync/swap-effect-banana-reference-sync.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -67,10 +66,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -205,19 +200,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/swap-effect-banana/swap-effect-banana.svml b/examples/ranking-football/swap-effect-banana/swap-effect-banana.svml
index d6025cd0..31bfec03 100644
--- a/examples/ranking-football/swap-effect-banana/swap-effect-banana.svml
+++ b/examples/ranking-football/swap-effect-banana/swap-effect-banana.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -62,10 +61,6 @@
<text:Value id="neymar-icon-prompt">A photograph with the texture of real iPhone footage. Generate a close portrait, as one frame cut out of video actually shot on an iPhone: genuinely real rather than glossy, carrying the texture of video and not of a posed photograph. The background stays clearly visible, with no depth-of-field blur. Skin texture is fine and real, the light is natural, and no part of the picture is broken. tan Brazilian footballer in his early thirties with an oval face, expressive brown eyes, thick brows, a straight nose, defined cheekbones, and a neatly trimmed beard and mustache. His short dark hair has faded sides and a textured top swept slightly back; he has an athletic neck and shoulders and a lively expression. He wears a plain yellow shirt.. Keep the portrait centered, shoulders visible, and use a simple neutral background with no readable text or logos.</text:Value>
<gpt:Image id="neymar-icon" prompt={neymar-icon-prompt} aspect-ratio="1:1" resolution="1K"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="messi-action">
Keep the handheld microphone in the same hand throughout and use only the free hand for gestures. On "Messi is the bottom", lower the free palm toward the floor and give one deadpan downward nod. On "Five foot seven", hold the free hand low as if marking a short height. Give three small counting beats through "no muscles, no speed, just vibes", ending with a loose shoulder shrug and an amused half-smile on "just vibes". On "Man walks around", slowly draw a lazy circle in the air. On "lost in IKEA", glance left and right with a puzzled squint, then point uncertainly off frame. On "retirement home", briefly hunch the shoulders and mime one slow old-man step with the free hand before finishing with a knowing smirk.
@@ -184,19 +179,19 @@
segment={story.segment.ronaldo} media={ronaldo-media.media} language="en"/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/swap-effect.svml b/examples/ranking-football/swap-effect.svml
index c661dcd0..360d1605 100644
--- a/examples/ranking-football/swap-effect.svml
+++ b/examples/ranking-football/swap-effect.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -62,10 +61,6 @@
<text:Value id="neymar-icon-prompt">A photograph with the texture of real iPhone footage. Generate a close portrait, as one frame cut out of video actually shot on an iPhone: genuinely real rather than glossy, carrying the texture of video and not of a posed photograph. The background stays clearly visible, with no depth-of-field blur. Skin texture is fine and real, the light is natural, and no part of the picture is broken. tan Brazilian footballer in his early thirties with an oval face, expressive brown eyes, thick brows, a straight nose, defined cheekbones, and a neatly trimmed beard and mustache. His short dark hair has faded sides and a textured top swept slightly back; he has an athletic neck and shoulders and a lively expression. He wears a plain yellow shirt.. Keep the portrait centered, shoulders visible, and use a simple neutral background with no readable text or logos.</text:Value>
<gpt:Image id="neymar-icon" prompt={neymar-icon-prompt} aspect-ratio="1:1" resolution="1K"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="messi-action">
Keep the handheld microphone in the same hand throughout and use only the free hand for gestures. On "Messi is the bottom", lower the free palm toward the floor and give one deadpan downward nod. On "Five foot seven", hold the free hand low as if marking a short height. Give three small counting beats through "no muscles, no speed, just vibes", ending with a loose shoulder shrug and an amused half-smile on "just vibes". On "Man walks around", slowly draw a lazy circle in the air. On "lost in IKEA", glance left and right with a puzzled squint, then point uncertainly off frame. On "retirement home", briefly hunch the shoulders and mime one slow old-man step with the free hand before finishing with a knowing smirk.
@@ -184,19 +179,19 @@
segment={story.segment.ronaldo} media={ronaldo-media.media} language="en"/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/swap-host.svml b/examples/ranking-football/swap-host.svml
index 57446ca2..8f8b7013 100644
--- a/examples/ranking-football/swap-host.svml
+++ b/examples/ranking-football/swap-host.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -67,10 +66,6 @@
<!-- Real Seedance Takes use explicit fixed ten-second requests. These
estimates belong only to the optional static preview candidates. -->
- <estimate:Speech id="ronaldo-preview-duration" source={story.segment.ronaldo.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="messi-preview-duration" source={story.segment.messi.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="ronaldo-action">
Keep the handheld microphone in the same hand throughout, and use only the free hand for gestures. At the opening, widen his eyes and nod emphatically as he begins speaking. On "hair gel", deliberately run the free hand over his hair. On "Greek god", react with exaggerated surprise. On "Greek tragedy", shake his head with a mocking laugh. On "But hey", lean his body forward and raise the free index finger as if he has just thought of something. On the final sentence, give a sarcastic shrug.
@@ -205,19 +200,19 @@
as a silent MP4, normalized through the same waist, then given an honest
syllable-weighted estimated alignment over its complete frame count. -->
<pipeline:StillVideo id="ronaldo-still" source={presenter.image}
- duration={ronaldo-preview-duration.duration} clock={clock}/>
+ duration="10" clock={clock}/>
<pipeline:StillVideo id="messi-still" source={presenter.image}
- duration={messi-preview-duration.duration} clock={clock}/>
+ duration="9" clock={clock}/>
<pipeline:Normalize id="ronaldo-preview-media" source={ronaldo-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="messi-preview-media" source={messi-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="ronaldo-preview" narrative={story}
segment={story.segment.ronaldo} media={ronaldo-preview-media.media}
- policy={ronaldo-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="messi-preview" narrative={story}
segment={story.segment.messi} media={messi-preview-media.media}
- policy={messi-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/examples/ranking-football/swap-topic.svml b/examples/ranking-football/swap-topic.svml
index 49e8ce3b..e446a650 100644
--- a/examples/ranking-football/swap-topic.svml
+++ b/examples/ranking-football/swap-topic.svml
@@ -5,7 +5,6 @@
<import as="text" from="@hypit/text@1"/>
<import as="asset" from="@hypit/media@1"/>
<import as="gpt" from="@hypit/gpt-image@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="seedance" from="@hypit/seedance@1"/>
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="estimated" from="@hypit/semantic-take-estimate@1"/>
@@ -60,10 +59,6 @@
<text:Value id="jack-icon-prompt">A photograph with the texture of real iPhone footage. Generate a close portrait, as one frame cut out of video actually shot on an iPhone: genuinely real rather than glossy, carrying the texture of video and not of a posed photograph. The background stays clearly visible, with no depth-of-field blur. Skin texture is fine and real, the light is natural, and no part of the picture is broken. fair-skinned young technology executive with short brown hair, narrow face, and slim athletic shoulder line, wearing a plain dark shirt. Keep the portrait centered, shoulders visible, and use a simple neutral background with no readable text or logos.</text:Value>
<gpt:Image id="jack-icon" prompt={jack-icon-prompt} aspect-ratio="1:1" resolution="1K"/>
- <estimate:Speech id="elon-preview-duration" source={story.segment.elon.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
- <estimate:Speech id="sam-preview-duration" source={story.segment.sam.speech}
- language="en" pace="normal" min="4" max="15" rounding="round"/>
<text:Value id="elon-action">
Keep the handheld microphone in the same hand throughout and use only the free hand for gestures. Open "Elon is D tier" with a skeptical look, lower the free palm decisively, and finish the verdict with one dry downward nod. On "44 billion dollars", rub the free thumb against two fingers in a clear money gesture while widening the eyes at the number. On "change the name", turn the free palm over once as if replacing one label with another, then give a disbelieving side glance. On "Sends rockets to Mars", sweep the free hand upward in a smooth launch arc and follow it briefly with the eyes. Across "can't send a tweet without crashing the stock market", tap the air once like posting, then snap the gaze downward and grimace as the free hand drops sharply. On "Richest guy on Earth", open the free arm with exaggerated confidence and a smug half-smile. On "good haircut", lightly touch the top of the hair once, pull the hand away, and finish with a mocking wince.
@@ -227,19 +222,19 @@
segment={story.segment.sam} media={sam-media.media} language="en"/>
<pipeline:StillVideo id="elon-still" source={presenter.image}
- duration={elon-preview-duration.duration} clock={clock}/>
+ duration="11" clock={clock}/>
<pipeline:StillVideo id="sam-still" source={presenter.image}
- duration={sam-preview-duration.duration} clock={clock}/>
+ duration="12" clock={clock}/>
<pipeline:Normalize id="elon-preview-media" source={elon-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<pipeline:Normalize id="sam-preview-media" source={sam-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
<estimated:SemanticTake id="elon-preview" narrative={story}
segment={story.segment.elon} media={elon-preview-media.media}
- policy={elon-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<estimated:SemanticTake id="sam-preview" narrative={story}
segment={story.segment.sam} media={sam-preview-media.media}
- policy={sam-preview-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
<speech:Track id="speech" visual-frame={speech-frame}
visual-appearance={recipes.speech.visual} visual-z="0">
diff --git a/packages/compiler-node/package.json b/packages/compiler-node/package.json
index e21a43e4..de2a259a 100644
--- a/packages/compiler-node/package.json
+++ b/packages/compiler-node/package.json
@@ -10,7 +10,6 @@
"dependencies": {
"@hypit/core": "workspace:*",
"@hypit/elaborator": "workspace:*",
- "@hypit/estimate": "workspace:*",
"@hypit/workspace": "workspace:*",
"@hypit/protocol": "workspace:*",
"@hypit/run": "workspace:*",
diff --git a/packages/compiler-node/src/index.ts b/packages/compiler-node/src/index.ts
index aef77733..f6014179 100644
--- a/packages/compiler-node/src/index.ts
+++ b/packages/compiler-node/src/index.ts
@@ -7,7 +7,7 @@ export type {
RegisteredModulePackage,
} from "./modules.js";
export { NodeCompiler } from "./compiler.js";
-export { NodeRunCompiler, deterministicSpeechDurations, deterministicSpeechDurationsFromGraph } from "./run.js";
+export { NodeRunCompiler } from "./run.js";
export type {
NodeCompilerOptions,
NodeCompiledSourceClosure,
diff --git a/packages/compiler-node/src/run.ts b/packages/compiler-node/src/run.ts
index 0edef86b..f6430a3c 100644
--- a/packages/compiler-node/src/run.ts
+++ b/packages/compiler-node/src/run.ts
@@ -29,9 +29,6 @@ import type {
RunSourceUnit,
} from "@hypit/run";
import type { LinkedProgram } from "@hypit/protocol";
-import { estimateSpeechDuration } from "@hypit/estimate";
-import type { SpeechEstimatePolicy } from "@hypit/estimate";
-import type { Text } from "@hypit/text";
import type { NodeCompiledSourceClosure } from "./compiler.js";
import { mergeAttachments, NodeCompiler } from "./compiler.js";
@@ -96,40 +93,6 @@ export type PlannedBuild = {
readonly state: BuildState;
};
-/** Provider-free values produced by estimate:Speech and therefore useful before a paid Build. */
-export function deterministicSpeechDurationsFromGraph(
- graph: NodeCompiledRun["author"]["graph"],
- records: NodeCompiledRun["author"]["program"]["records"],
-): readonly {
- readonly operation: string;
- readonly speech_record: string;
- readonly policy_record: string;
- readonly seconds: number;
-}[] {
- const recordMap = new Map(records.map((record) => [record.id, record]));
- const result: { operation: string; speech_record: string; policy_record: string; seconds: number }[] = [];
- for (const operation of graph.operations) {
- if (operation.producer.module.name !== "@hypit/estimate" || operation.producer.name !== "estimate-speech-duration") continue;
- const speech = operation.inputs.speech;
- const policy = operation.inputs.policy;
- if (speech?.kind !== "record" || policy?.kind !== "record") continue;
- const speechValue = recordMap.get(speech.id)?.value;
- const policyValue = recordMap.get(policy.id)?.value;
- if (speechValue?.kind !== "inline" || policyValue?.kind !== "inline") continue;
- try {
- const duration = estimateSpeechDuration(speechValue.value as unknown as Text, policyValue.value as unknown as SpeechEstimatePolicy);
- result.push({ operation: operation.id, speech_record: speech.id, policy_record: policy.id, seconds: duration });
- } catch {
- // Invalid inputs are reported by the ordinary graph check; this read-only aid must not mask it.
- }
- }
- return result;
-}
-
-export function deterministicSpeechDurations(compilation: NodeCompiledRun): ReturnType<typeof deterministicSpeechDurationsFromGraph> {
- return deterministicSpeechDurationsFromGraph(compilation.author.graph, compilation.author.program.records);
-}
-
function decodeStoredValue(bytes: Uint8Array, from: string): StoredValue {
let parsed: unknown;
try {
diff --git a/packages/estimate/README.md b/packages/estimate/README.md
index 76645f9c..20ed2697 100644
--- a/packages/estimate/README.md
+++ b/packages/estimate/README.md
@@ -1,34 +1,28 @@
# `@hypit/estimate`
-Provider-free deterministic speech-duration planning.
+Provider-free speech-duration measurement, used at creation time.
-`<estimate:Speech>` consumes an ordinary `Text` value and produces the public `SpeechDuration`
-contract. It uses a language-aware pronunciation-unit delivery density, then applies explicit
-bounds and rounding. English dictionary words use CMUdict;
-unknown words use a deterministic spelling fallback. The consumed Text remains authoritative:
-the estimator never invents how numbers, names or acronyms should be pronounced.
+A duration is the author's decision, written as a literal on the element that needs it:
+`<seedance:TextVideo … duration="8"/>`, `<media:StillVideo … duration="6"/>`. This package is how the
+author arrives at that number before writing it. It counts pronunciation units of a Text with a
+language-aware delivery density (English dictionary words use CMUdict; unknown words use a
+deterministic spelling fallback), then applies explicit bounds and rounding. The Text remains
+authoritative: the estimator never invents how numbers, names or acronyms are pronounced.
-```xml
-<estimate:Speech
- id="opening-duration"
- source={story.segment.opening.speech}
- language="en"
- pace="normal"
- min="4"
- max="15"
- rounding="round"
-/>
+```bash
+hypit measure main.svml --segment opening --language en --pace normal --min 4 --max 15 --rounding round
+hypit measure --text "Video editing begins with meaning." --language en --pace normal
```
-The English pace presets are `slow = 4.2`, `normal = 4.6` and `fast = 5.0`
-syllables per second. A policy may use a positive numeric `rate` instead of `pace`:
+The English pace presets are `slow = 4.2`, `normal = 4.6` and `fast = 5.0` syllables per second; a
+positive numeric `rate` replaces `pace`. `round` selects the nearest whole second, `ceil` a
+never-shorter one, `none` keeps the fraction.
-```xml
-<estimate:Speech id="opening-duration" source={story.segment.opening.speech} rate="4.75"/>
-```
-
-Every policy field is explicit. `round` selects the nearest provider-compatible integer second. `ceil` remains available
-when a project explicitly prefers a conservative, never-shorter duration.
+The one graph value this package declares is `SpeechEstimatePolicy`: the same language, pace or rate,
+bounds and rounding, written as attributes or an SVS Recipe on `<estimated:SemanticTake>`, which
+weights a Segment's Tokens across preview media by pronunciation units. Nothing here runs inside a
+Build; a Build plan is complete before it starts because every duration is already a literal.
-The output is `opening-duration.duration`. Estimate is only one possible producer of this shared
-value; model packages consume the contract rather than depending on this package.
+```ts
+import { estimateSpeechDuration, sealSpeechEstimatePolicy, speechEstimatePolicyFromRecipe } from "@hypit/estimate";
+```
diff --git a/packages/estimate/package.json b/packages/estimate/package.json
index afcac1ef..b8aa80bf 100644
--- a/packages/estimate/package.json
+++ b/packages/estimate/package.json
@@ -11,9 +11,6 @@
"activation": "./src/activation.ts"
},
"dependencies": {
- "@hypit/component-kit": "workspace:*",
- "@hypit/elaborator": "workspace:*",
- "@hypit/markup": "workspace:*",
"@hypit/protocol": "workspace:*",
"@hypit/speech": "workspace:*",
"@hypit/svs": "workspace:*",
diff --git a/packages/estimate/src/activation.ts b/packages/estimate/src/activation.ts
index 78a4bc9c..0bd8b4c2 100644
--- a/packages/estimate/src/activation.ts
+++ b/packages/estimate/src/activation.ts
@@ -1,22 +1,11 @@
-import { createMarkupSurfaceHostFacet } from "@hypit/markup";
-
-import {
- decodeSpeechEstimateSurface,
- estimateComponent,
- estimateManifest,
- estimateModuleRef,
- estimateMarkupSurfaces,
-} from "./index.js";
+import { estimateManifest } from "./index.js";
+/** The package declares one graph type and no Surface, Producer or Need: measuring is creation-time work. */
export const hypitPackage = {
format: "hypit.node-package@1" as const,
modules: [{ manifest: estimateManifest }],
- components: [estimateComponent],
- hostFacets: [createMarkupSurfaceHostFacet({
- module: estimateModuleRef,
- declaration: estimateMarkupSurfaces.find((item) => item.name === "speech")!,
- handler: decodeSpeechEstimateSurface,
- })],
+ components: [],
+ hostFacets: [],
};
export default hypitPackage;
diff --git a/packages/estimate/src/component.ts b/packages/estimate/src/component.ts
deleted file mode 100644
index 2e1268b2..00000000
--- a/packages/estimate/src/component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import type { ComponentPackage } from "@hypit/component-kit";
-import type { StoredValue } from "@hypit/protocol";
-import { canonicalize } from "@hypit/protocol";
-import type { Text } from "@hypit/text";
-
-import { estimateProducers } from "./manifest.js";
-import { estimateSpeechDuration } from "./program.js";
-import type { SpeechEstimatePolicy } from "./types.js";
-
-function inline<T>(value: StoredValue | undefined, subject: string): T {
- if (value?.kind !== "inline") throw new Error(`${subject} must be inline`);
- return value.value as unknown as T;
-}
-
-export const estimateComponent = {
- producers: [{
- producer: estimateProducers.speech,
- handler: ({ inputs }) => ({
- outputs: {
- duration: {
- kind: "inline",
- value: canonicalize(estimateSpeechDuration(
- inline<Text>(inputs.speech?.value, "Speech Text"),
- inline<SpeechEstimatePolicy>(inputs.policy?.value, "SpeechEstimatePolicy"),
- )),
- },
- },
- needs: {},
- }),
- }],
-} satisfies ComponentPackage;
diff --git a/packages/estimate/src/fragment.ts b/packages/estimate/src/fragment.ts
deleted file mode 100644
index c550fae8..00000000
--- a/packages/estimate/src/fragment.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import { speechTypes } from "@hypit/speech";
-import { sealGraphFragment } from "@hypit/elaborator";
-import { textTypes } from "@hypit/text";
-
-import { estimateProducers, estimateTypes } from "./manifest.js";
-
-const input = (name: string) => ({ kind: "fragment-input" as const, name });
-const operation = (id: string) => ({ kind: "fragment-operation" as const, operation: id });
-
-export const speechEstimateFragment = sealGraphFragment({
- inputs: [
- { name: "speech", type: textTypes.text },
- { name: "policy", type: estimateTypes.speechPolicy },
- ],
- operations: [{
- id: "estimate",
- producer: estimateProducers.speech,
- inputs: { speech: input("speech"), policy: input("policy") },
- result: { kind: "output", name: "duration" },
- }],
- exports: [{
- name: "duration",
- type: speechTypes.duration,
- root: operation("estimate"),
- }],
-});
diff --git a/packages/estimate/src/index.ts b/packages/estimate/src/index.ts
index 78dcf209..28bb7394 100644
--- a/packages/estimate/src/index.ts
+++ b/packages/estimate/src/index.ts
@@ -1,9 +1,16 @@
-export { estimateComponent } from "./component.js";
-export { speechEstimateFragment } from "./fragment.js";
-export { estimateManifest, estimateMarkupSurfaces, estimateModuleRef, estimateProducers, estimateTypes, speechEstimatePolicySchema } from "./manifest.js";
-export { assertSpeechEstimatePolicy, countSpeechEstimateUnits, detectSpeechEstimateLanguage, estimateSpeechDuration, resolveSpeechEstimateRate, resolveSpeechEstimateLanguage, sealSpeechEstimatePolicy } from "./program.js";
+export { estimateManifest, estimateModuleRef, estimateTypes, speechEstimatePolicySchema } from "./manifest.js";
export {
- decodeSpeechEstimateSurface,
+ speechEstimatePolicyFromAttributes,
speechEstimatePolicyFromRecipe,
-} from "./surface.js";
+ speechEstimatePolicyProperties,
+} from "./policy.js";
+export {
+ assertSpeechEstimatePolicy,
+ countSpeechEstimateUnits,
+ detectSpeechEstimateLanguage,
+ estimateSpeechDuration,
+ resolveSpeechEstimateLanguage,
+ resolveSpeechEstimateRate,
+ sealSpeechEstimatePolicy,
+} from "./program.js";
export type * from "./types.js";
diff --git a/packages/estimate/src/manifest.ts b/packages/estimate/src/manifest.ts
index 37ee69df..530b25e2 100644
--- a/packages/estimate/src/manifest.ts
+++ b/packages/estimate/src/manifest.ts
@@ -1,177 +1,36 @@
-import { speechDependency, speechTypes } from "@hypit/speech";
-import { textDependency, textTypes } from "@hypit/text";
-import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";
-import { svsManifest, svsRecipeType } from "@hypit/svs";
+import type { ModuleManifest, TypeRef, ValueSchema } from "@hypit/protocol";
export const estimateModuleRef = { name: "@hypit/estimate", version: "1" } as const;
+
+/**
+ * The one graph value this package still declares: the delivery policy an estimated SemanticTake
+ * weights its Tokens with. Durations themselves are author literals; measuring a script happens at
+ * creation time with `hypit measure`, never inside a Build.
+ */
export const estimateTypes = {
speechPolicy: { module: estimateModuleRef, name: "SpeechEstimatePolicy" },
} satisfies Record<string, TypeRef>;
-export const estimateProducers = {
- speech: { module: estimateModuleRef, name: "estimate-speech-duration" },
-} satisfies Record<string, ProducerRef>;
const number = { kind: "number" } as const satisfies ValueSchema;
-const speechEstimatePolicySchema: ValueSchema = {
+export const speechEstimatePolicySchema: ValueSchema = {
kind: "object",
fields: {
-
language: { schema: { kind: "string", enum: ["auto", "en", "zh", "ja", "es"] } },
pace: { schema: { kind: "string", enum: ["slow", "normal", "fast"] }, optional: true },
rate: { schema: { kind: "number", minimum: 0.000001 }, optional: true },
minimumSec: { schema: number },
maximumSec: { schema: number },
rounding: { schema: { kind: "string", enum: ["none", "round", "ceil"] } },
+ paddingSec: { schema: number, optional: true },
},
};
-export const estimateMarkupSurfaces = [{
- name: "speech",
- tag: "Speech",
- mode: "structured",
- outputs: [estimateTypes.speechPolicy, speechTypes.duration],
- vocabulary: {
- summary: "Estimates the SpeechDuration of a Text from language-aware pronunciation units and an explicit delivery policy, without calling a Provider.",
- attributes: [
- {
- name: "id",
- kind: "identifier",
- required: true,
- summary: "Names the estimate that the published duration and policy bindings are addressed under.",
- },
- {
- name: "source",
- kind: "reference",
- required: true,
- summary: "Selects the Text whose pronunciation units are counted.",
- accepts: [textTypes.text],
- },
- {
- name: "policy",
- kind: "reference",
- required: false,
- summary: "Selects an SVS Recipe carrying the whole policy, in place of the inline parameters.",
- accepts: [svsRecipeType],
- recipe: [
- {
- name: "language",
- required: true,
- summary: "Selects the counting rules the Text is read with, or detects them from the Text.",
- values: ["auto", "en", "zh", "ja", "es"],
- },
- {
- name: "pace",
- required: false,
- summary: "Selects a named delivery density for the chosen language.",
- values: ["slow", "normal", "fast"],
- },
- {
- name: "rate",
- required: false,
- summary: "Sets the delivery density in pronunciation units per second, in place of pace.",
- },
- {
- name: "min",
- required: true,
- summary: "Sets the shortest duration in seconds the estimate may report.",
- },
- {
- name: "max",
- required: true,
- summary: "Sets the longest duration in seconds the estimate may report.",
- },
- {
- name: "rounding",
- required: true,
- summary: "Selects how the bounded duration is rounded to a whole second.",
- values: ["none", "round", "ceil"],
- },
- ],
- },
- {
- name: "language",
- kind: "literal",
- required: false,
- summary: "Selects the counting rules the Text is read with, or detects them from the Text.",
- values: ["auto", "en", "zh", "ja", "es"],
- },
- {
- name: "pace",
- kind: "literal",
- required: false,
- summary: "Selects a named delivery density for the chosen language.",
- values: ["slow", "normal", "fast"],
- },
- {
- name: "rate",
- kind: "literal",
- required: false,
- summary: "Sets the delivery density in pronunciation units per second, in place of pace.",
- },
- {
- name: "min",
- kind: "literal",
- required: false,
- summary: "Sets the shortest duration in seconds the estimate may report.",
- },
- {
- name: "max",
- kind: "literal",
- required: false,
- summary: "Sets the longest duration in seconds the estimate may report.",
- },
- {
- name: "rounding",
- kind: "literal",
- required: false,
- summary: "Selects how the bounded duration is rounded to a whole second.",
- values: ["none", "round", "ceil"],
- },
- ],
- ports: [{
- name: "duration",
- type: speechTypes.duration,
- summary: "The estimated duration in seconds of speaking the source Text.",
- }],
- example: `<estimate:Speech
- id="opening-duration"
- source={story.segment.opening.speech}
- language="en"
- pace="normal"
- min="4"
- max="15"
- rounding="round"
-/>`,
- notes: [
- "Either policy or the inline parameters, never both. The inline form requires language, min, max, rounding and exactly one of pace or rate; the Recipe behind policy carries those same properties.",
- "The Recipe behind policy rejects any property outside language, pace, rate, min, max and rounding, and requires exactly one of pace or rate. Nothing is optional beyond that choice: the Recipe supplies every value itself.",
- "The resolved policy is sealed into a SpeechEstimatePolicy Record published as `<id>.policy`.",
- "The element must be empty.",
- ],
- },
- }] as const;
-
-
export const estimateManifest: ModuleManifest = {
format: "hypit.module@1",
name: estimateModuleRef.name,
version: estimateModuleRef.version,
- dependencies: [
- speechDependency,
- textDependency,
- { module: svsRecipeType.module },
- ],
+ dependencies: [],
types: [{ name: estimateTypes.speechPolicy.name }],
capabilities: [],
- producers: [{
- name: estimateProducers.speech.name,
- inputs: [
- { name: "speech", type: textTypes.text },
- { name: "policy", type: estimateTypes.speechPolicy },
- ],
- outputs: [{ name: "duration", type: speechTypes.duration }],
- needs: [],
- }],
+ producers: [],
};
-
-export { speechEstimatePolicySchema };
diff --git a/packages/estimate/src/policy.ts b/packages/estimate/src/policy.ts
new file mode 100644
index 00000000..f9e887f1
--- /dev/null
+++ b/packages/estimate/src/policy.ts
@@ -0,0 +1,72 @@
+import type { SvsRecipe } from "@hypit/svs";
+
+import { sealSpeechEstimatePolicy } from "./program.js";
+import type {
+ SpeechEstimateLanguage,
+ SpeechEstimatePace,
+ SpeechEstimatePolicy,
+ SpeechEstimateRounding,
+} from "./types.js";
+
+const POLICY_PROPERTIES = ["language", "pace", "rate", "min", "max", "rounding", "padding"] as const;
+
+/** The property names an estimate policy is written with, in an SVS Recipe or as element attributes. */
+export const speechEstimatePolicyProperties: readonly string[] = POLICY_PROPERTIES;
+
+function policyFrom(
+ properties: Readonly<Record<string, unknown>>,
+ subject: string,
+): SpeechEstimatePolicy {
+ const allowed = new Set<string>(POLICY_PROPERTIES);
+ const unknown = Object.keys(properties).filter((name) => !allowed.has(name));
+ if (unknown.length > 0) throw new Error(`${subject} contains unknown property ${unknown[0]}`);
+ const missing = ["language", "min", "max", "rounding"].filter((name) => properties[name] === undefined);
+ if (missing.length > 0) throw new Error(`${subject} requires ${missing.join(", ")}`);
+ const string = (name: string): string => {
+ const value = properties[name];
+ if (typeof value !== "string" || value.trim().length === 0) {
+ throw new Error(`${subject}.${name} must be a non-empty string`);
+ }
+ return value.trim();
+ };
+ const finite = (name: string): number => {
+ const raw = properties[name];
+ const value = typeof raw === "string" ? Number(raw) : raw;
+ if (typeof value !== "number" || !Number.isFinite(value)) {
+ throw new Error(`${subject}.${name} must be a finite number`);
+ }
+ return value;
+ };
+ const pace = properties.pace;
+ const rate = properties.rate;
+ if ((pace !== undefined) === (rate !== undefined)) {
+ throw new Error(`${subject} requires exactly one of pace or rate`);
+ }
+ const common = {
+ language: string("language") as SpeechEstimateLanguage,
+ minimumSec: finite("min"),
+ maximumSec: finite("max"),
+ rounding: string("rounding") as SpeechEstimateRounding,
+ ...(properties.padding !== undefined ? { paddingSec: finite("padding") } : {}),
+ } as const;
+ return rate === undefined
+ ? sealSpeechEstimatePolicy({ ...common, pace: string("pace") as SpeechEstimatePace })
+ : sealSpeechEstimatePolicy({ ...common, rate: finite("rate") });
+}
+
+/** One reusable estimate policy written as an SVS Recipe; it configures a measurement, nothing executable. */
+export function speechEstimatePolicyFromRecipe(
+ recipe: SvsRecipe,
+ subject = `SVS Recipe ${recipe.path}`,
+): SpeechEstimatePolicy {
+ return policyFrom(recipe.properties, subject);
+}
+
+/** The same policy written inline as attributes or options: strings are read as the values they name. */
+export function speechEstimatePolicyFromAttributes(
+ attributes: Readonly<Record<string, unknown>>,
+ subject: string,
+): SpeechEstimatePolicy {
+ const present = Object.fromEntries(Object.entries(attributes).filter(([, value]) => value !== undefined));
+ return policyFrom(present, subject);
+}
diff --git a/packages/estimate/src/surface.ts b/packages/estimate/src/surface.ts
deleted file mode 100644
index 5b8772fe..00000000
--- a/packages/estimate/src/surface.ts
+++ /dev/null
@@ -1,190 +0,0 @@
-import type { CanonicalValue } from "@hypit/protocol";
-import { svsRecipeType } from "@hypit/svs";
-import type { SvsRecipe } from "@hypit/svs";
-import { textTypes } from "@hypit/text";
-import type {
- StructuredElement,
- StructuredSurfaceHandler,
- SurfaceResolvedReference,
- MarkupAttributeValue,
-} from "@hypit/markup";
-
-import { speechEstimateFragment } from "./fragment.js";
-import { estimateTypes } from "./manifest.js";
-import { sealSpeechEstimatePolicy } from "./program.js";
-import type {
- SpeechEstimateLanguage,
- SpeechEstimatePace,
- SpeechEstimateRounding,
-} from "./types.js";
-
-function sameType(left: SurfaceResolvedReference["type"], right: SurfaceResolvedReference["type"]): boolean {
- return left.module.name === right.module.name && left.module.version === right.module.version && left.name === right.name;
-}
-
-function attributes(element: StructuredElement): void {
- const required = ["id", "source"];
- const direct = ["language", "pace", "rate", "min", "max", "rounding", "padding"];
- const optional = ["policy", ...direct];
- const allowed = new Set([...required, ...optional]);
- if (
- required.some((name) => element.attributes[name] === undefined)
- || Object.keys(element.attributes).some((name) => !allowed.has(name))
- ) {
- throw new Error(`${element.name} requires id and source; optional: ${optional.join(", ")}`);
- }
- if (element.attributes.policy !== undefined && direct.some((name) => element.attributes[name] !== undefined)) {
- throw new Error(`${element.name}.policy cannot be combined with inline estimate parameters`);
- }
- if (element.attributes.policy === undefined) {
- const missing = ["language", "min", "max", "rounding"]
- .filter((name) => element.attributes[name] === undefined);
- if (missing.length > 0) {
- throw new Error(`${element.name} inline policy requires ${missing.join(", ")}`);
- }
- const hasPace = element.attributes.pace !== undefined;
- const hasRate = element.attributes.rate !== undefined;
- if (hasPace === hasRate) {
- throw new Error(`${element.name} inline policy requires exactly one of pace or rate`);
- }
- }
- if (element.children.some((child) => child.kind === "element" || child.value.trim().length > 0)) {
- throw new Error(`${element.name} must be empty`);
- }
-}
-
-function wholeReference(element: StructuredElement, name: string): string {
- const raw: MarkupAttributeValue | undefined = element.attributes[name];
- if (typeof raw !== "object" || raw.kind !== "reference" || raw.path.length === 0) {
- throw new Error(`${element.name}.${name} must be a whole-value reference`);
- }
- return raw.path;
-}
-
-function inline<T>(reference: SurfaceResolvedReference, subject: string): T {
- const value = reference.record?.value;
- if (value?.kind !== "inline") throw new Error(`${subject} must reference an authored inline value`);
- return value.value as unknown as T;
-}
-
-function recipePolicy(
- element: StructuredElement,
- resolveReference: (path: string) => SurfaceResolvedReference | undefined,
-) {
- const path = wholeReference(element, "policy");
- const reference = resolveReference(path);
- if (reference === undefined || !sameType(reference.type, svsRecipeType)) {
- throw new Error(`${element.name}.policy must reference an SVS Recipe`);
- }
- const recipe = inline<SvsRecipe>(reference, `${element.name}.policy`);
- return speechEstimatePolicyFromRecipe(recipe, `${element.name}.policy`);
-}
-
-export function speechEstimatePolicyFromRecipe(
- recipe: SvsRecipe,
- subject = `SVS Recipe ${recipe.path}`,
-) {
- const allowed = new Set(["language", "pace", "rate", "min", "max", "rounding", "padding"]);
- const unknown = Object.keys(recipe.properties).filter((name) => !allowed.has(name));
- if (unknown.length > 0) throw new Error(`${subject} contains unknown property ${unknown[0]}`);
- const string = (name: string): string => {
- const value = recipe.properties[name];
- if (typeof value !== "string" || value.trim().length === 0) {
- throw new Error(`${subject}.${name} must be a non-empty string`);
- }
- return value.trim();
- };
- const finite = (name: string): number => {
- const value = recipe.properties[name];
- if (typeof value !== "number" || !Number.isFinite(value)) {
- throw new Error(`${subject}.${name} must be a finite number`);
- }
- return value;
- };
- const pace = recipe.properties.pace;
- const rate = recipe.properties.rate;
- if ((pace !== undefined) === (rate !== undefined)) {
- throw new Error(`${subject} requires exactly one of pace or rate`);
- }
- if (rate !== undefined && (typeof rate !== "number" || !Number.isFinite(rate))) {
- throw new Error(`${subject}.rate must be a finite number`);
- }
- const common = {
- language: string("language") as SpeechEstimateLanguage,
- minimumSec: finite("min"),
- maximumSec: finite("max"),
- rounding: string("rounding") as SpeechEstimateRounding,
- ...(recipe.properties.padding !== undefined ? { paddingSec: finite("padding") } : {}),
- } as const;
- return rate === undefined
- ? sealSpeechEstimatePolicy({ ...common, pace: string("pace") as SpeechEstimatePace })
- : sealSpeechEstimatePolicy({ ...common, rate });
-}
-
-function text(element: StructuredElement, name: string, fallback?: string): string {
- const value = element.attributes[name] ?? fallback;
- if (typeof value !== "string" || value.trim().length === 0) {
- throw new Error(`${element.name}.${name} must be a non-empty string`);
- }
- return value.trim();
-}
-
-function number(element: StructuredElement, name: string): number {
- const value = Number(text(element, name));
- if (!Number.isFinite(value)) throw new Error(`${element.name}.${name} must be a finite number`);
- return value;
-}
-
-function reference(
- element: StructuredElement,
- resolveReference: (path: string) => SurfaceResolvedReference | undefined,
-): SurfaceResolvedReference {
- const raw: MarkupAttributeValue | undefined = element.attributes.source;
- if (typeof raw !== "object" || raw.kind !== "reference") {
- throw new Error(`${element.name}.source must be a whole-value reference`);
- }
- const result = resolveReference(raw.path);
- if (result === undefined || !sameType(result.type, textTypes.text)) {
- throw new Error(`${element.name}.source must reference Text`);
- }
- return result;
-}
-
-export const decodeSpeechEstimateSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {
- attributes(element);
- const id = text(element, "id");
- const source = reference(element, resolveReference);
- const policy = element.attributes.policy === undefined
- ? sealSpeechEstimatePolicy({
-
- language: text(element, "language") as SpeechEstimateLanguage,
- ...(element.attributes.rate === undefined
- ? { pace: text(element, "pace") as SpeechEstimatePace }
- : { rate: number(element, "rate") }),
- minimumSec: number(element, "min"),
- maximumSec: number(element, "max"),
- rounding: text(element, "rounding") as SpeechEstimateRounding,
- ...(element.attributes.padding !== undefined ? { paddingSec: number(element, "padding") } : {}),
- })
- : recipePolicy(element, resolveReference);
- const policyId = `${id}.policy`;
- return {
- records: [{
- id: policyId,
- type: estimateTypes.speechPolicy,
- value: { kind: "inline", value: policy as unknown as CanonicalValue },
- range: element.range,
- }],
- components: [{
- id,
- fragment: speechEstimateFragment.id,
- inputs: {
- speech: source.ref,
- policy: { kind: "record", id: policyId },
- },
- outputs: { duration: `${id}.duration` },
- range: element.range,
- }],
- fragments: [speechEstimateFragment],
- };
-};
diff --git a/packages/estimate/test/estimate.test.ts b/packages/estimate/test/estimate.test.ts
index 0b9b9de7..a40083cb 100644
--- a/packages/estimate/test/estimate.test.ts
+++ b/packages/estimate/test/estimate.test.ts
@@ -1,29 +1,16 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { parseStructuredElement } from "@hypit/markup";
-import { sealText, textTypes } from "@hypit/text";
+import { sealText } from "@hypit/text";
import {
countSpeechEstimateUnits,
- decodeSpeechEstimateSurface,
estimateSpeechDuration,
sealSpeechEstimatePolicy,
+ speechEstimatePolicyFromAttributes,
speechEstimatePolicyFromRecipe,
} from "@hypit/estimate";
-function estimateSurface(source: string) {
- return decodeSpeechEstimateSurface({
- sourceName: "estimate.svml",
- element: parseStructuredElement({ name: "estimate.svml", text: source }, 0).element,
- resolveReference: (path) => path === "speech"
- ? { path, ref: { kind: "record", id: path }, type: textTypes.text }
- : undefined,
- resolveAsset: () => { throw new Error("Estimate has no assets"); },
- });
-}
-
const normal = sealSpeechEstimatePolicy({
-
language: "en",
pace: "normal",
minimumSec: 4,
@@ -74,7 +61,7 @@ test("a numeric rate gives SVS a continuous author-controlled pace", () => {
assert.equal(result, 10);
});
-test("optional padding extends speech before bounds and rounding", async () => {
+test("optional padding extends speech before bounds and rounding", () => {
const source = sealText(Array.from({ length: 23 }, () => "day").join(" "));
const policy = sealSpeechEstimatePolicy({
language: "en",
@@ -86,10 +73,6 @@ test("optional padding extends speech before bounds and rounding", async () => {
});
assert.equal(estimateSpeechDuration(source, policy), 6);
- const output = await estimateSurface('<estimate:Speech id="duration" source={speech} language="en" pace="normal" min="1" max="30" rounding="none" padding="1"/>');
- const value = output.records[0]!.value;
- assert.equal(value.kind === "inline" && (value.value as { readonly paddingSec?: number }).paddingSec, 1);
-
const recipe = speechEstimatePolicyFromRecipe({
path: "speech.padded",
properties: {
@@ -105,16 +88,18 @@ test("optional padding extends speech before bounds and rounding", async () => {
assert.throws(() => sealSpeechEstimatePolicy({ ...policy, paddingSec: -1 }), /invalid/u);
});
-test("the author Surface requires one complete explicit inline policy", async () => {
- const output = await estimateSurface('<estimate:Speech id="duration" source={speech} language="en" rate="4.75" min="4" max="15" rounding="round"/>');
- const value = output.records[0]!.value;
- assert.equal(value.kind, "inline");
- assert.equal(value.kind === "inline" && (value.value as { readonly rate?: number }).rate, 4.75);
+test("a policy written as attributes reads the same values a Recipe would", () => {
+ const policy = speechEstimatePolicyFromAttributes(
+ { language: "en", rate: "4.75", min: "4", max: "15", rounding: "round" },
+ "estimated:SemanticTake",
+ );
+ assert.equal(policy.rate, 4.75);
+ assert.equal(policy.maximumSec, 15);
assert.throws(
- () => estimateSurface('<estimate:Speech id="duration" source={speech} language="en" pace="normal" rate="4.75" min="4" max="15" rounding="round"/>'),
+ () => speechEstimatePolicyFromAttributes({ language: "en", pace: "normal", rate: "4.75", min: "4", max: "15", rounding: "round" }, "x"),
/exactly one/u,
);
- assert.throws(() => estimateSurface('<estimate:Speech id="duration" source={speech} rate="4.75"/>'), /requires/u);
+ assert.throws(() => speechEstimatePolicyFromAttributes({ rate: "4.75" }, "x"), /requires language, min, max, rounding/u);
});
test("the minimum applies before rounding and the maximum applies after rounding", () => {
@@ -125,7 +110,6 @@ test("the minimum applies before rounding and the maximum applies after rounding
test("an SVS Recipe configures one reusable estimate policy without becoming executable", () => {
const policy = speechEstimatePolicyFromRecipe({
-
path: "speech.normal",
properties: {
language: "en",
@@ -139,13 +123,11 @@ test("an SVS Recipe configures one reusable estimate policy without becoming exe
assert.equal(policy.rate, 4.75);
assert.equal(policy.maximumSec, 15);
assert.throws(() => speechEstimatePolicyFromRecipe({
-
path: "speech.ambiguous",
properties: { pace: "normal", rate: 4.6 },
- }), /exactly one/u);
+ }), /exactly one|requires/u);
assert.throws(() => speechEstimatePolicyFromRecipe({
-
path: "speech.invalid",
properties: { provider: "unknown-provider" },
- }), /unknown property provider/u);
+ }), /unknown property/u);
});
diff --git a/packages/media-pipeline/README.md b/packages/media-pipeline/README.md
index a51ce7b3..fba8f51a 100644
--- a/packages/media-pipeline/README.md
+++ b/packages/media-pipeline/README.md
@@ -46,8 +46,8 @@ hide the Normalize graph node or turn multiple sources into one opaque batch ope
A still image becomes ordinary video before it enters that waist:
```svml
-<media:StillVideo id="opening-still" source={opening-head}
- duration={opening-duration.duration} clock={clock}/>
+<media:StillVideo id="opening-still" source={opening-head.image}
+ duration="6" clock={clock}/>
<pipeline:Normalize id="opening-media" source={opening-still.video}
video="primary-moving" audio="none" span-authority="video" clock={clock}/>
```
diff --git a/packages/media-pipeline/src/manifest.ts b/packages/media-pipeline/src/manifest.ts
index d2fe1df6..1037d07c 100644
--- a/packages/media-pipeline/src/manifest.ts
+++ b/packages/media-pipeline/src/manifest.ts
@@ -265,7 +265,7 @@ export const mediaPipelineMarkupSurfaces = [
},
{
name: "still-video", tag: "StillVideo", mode: "structured",
- outputs: [mediaPipelineTypes.stillVideoRequest, artifactTypes.blob],
+ outputs: [speechTypes.duration, mediaPipelineTypes.stillVideoRequest, artifactTypes.blob],
vocabulary: {
summary: "Encodes one authored image as an ordinary silent MP4 Blob on an explicit duration and frame clock.",
attributes: [
@@ -273,8 +273,8 @@ export const mediaPipelineMarkupSurfaces = [
summary: "Names the still-video operation and the MP4 Artifact it publishes." },
{ name: "source", kind: "reference", required: true, accepts: [artifactTypes.blob],
summary: "Selects the authored image whose first decoded frame is held for the full video." },
- { name: "duration", kind: "reference", required: true, accepts: [speechTypes.duration],
- summary: "Selects the positive duration used to establish the video's finite frame count." },
+ { name: "duration", kind: "literal", required: true,
+ summary: "Sets the video's length in seconds, such as 6 or 2.5s; the author's decision, measured beforehand with hypit measure." },
{ name: "clock", kind: "reference", required: true, accepts: [programSpaceTypes.clock],
summary: "Selects the frame clock used by the generated MP4." },
],
diff --git a/packages/media-pipeline/src/surface.ts b/packages/media-pipeline/src/surface.ts
index 7a6de16a..e3b0859b 100644
--- a/packages/media-pipeline/src/surface.ts
+++ b/packages/media-pipeline/src/surface.ts
@@ -233,12 +233,10 @@ export const decodeStillVideoSurface: StructuredSurfaceHandler = ({ element, res
empty(element);
const id = text(element, "id");
const source = ref(element.attributes.source, `${element.name}.source`, resolveReference);
- const duration = typedReference(
- element.attributes.duration,
- `${element.name}.duration`,
- speechTypes.duration,
- resolveReference,
- );
+ // The duration is the author's decision, written here; it is published as an ordinary
+ // SpeechDuration Record so the fragment's plan step reads the same value a graph edge would carry.
+ const durationSec = seconds(text(element, "duration"), `${element.name}.duration`, false);
+ const durationId = `${id}.duration`;
const clock = typedReference(
element.attributes.clock,
`${element.name}.clock`,
@@ -246,11 +244,16 @@ export const decodeStillVideoSurface: StructuredSurfaceHandler = ({ element, res
resolveReference,
);
return {
- records: [],
+ records: [{
+ id: durationId,
+ type: speechTypes.duration,
+ value: { kind: "inline", value: durationSec },
+ range: element.range,
+ }],
components: [{
id,
fragment: stillVideoFragment.id,
- inputs: { source: source.ref, duration: duration.ref, clock: clock.ref },
+ inputs: { source: source.ref, duration: { kind: "record", id: durationId }, clock: clock.ref },
outputs: { video: `${id}.video` },
range: element.range,
}],
diff --git a/packages/media-pipeline/test/manifest.test.ts b/packages/media-pipeline/test/manifest.test.ts
index 92861a83..102b7a0b 100644
--- a/packages/media-pipeline/test/manifest.test.ts
+++ b/packages/media-pipeline/test/manifest.test.ts
@@ -126,7 +126,7 @@ test("StillVideo stops at an ordinary MP4 branch before Normalize", async () =>
attributes: {
id: "opening-still",
source: { kind: "reference", path: "opening-head" },
- duration: { kind: "reference", path: "opening-duration.duration" },
+ duration: "6",
clock: { kind: "reference", path: "clock" },
},
children: [],
@@ -134,14 +134,16 @@ test("StillVideo stops at an ordinary MP4 branch before Normalize", async () =>
},
resolveReference: (path) => path === "opening-head"
? { path, ref: { kind: "record", id: path }, type: artifactTypes.blob }
- : path === "opening-duration.duration"
- ? { path, ref: { kind: "record", id: path }, type: speechTypes.duration }
- : path === "clock"
- ? { path, ref: { kind: "record", id: path }, type: programSpaceTypes.clock }
- : undefined,
+ : path === "clock"
+ ? { path, ref: { kind: "record", id: path }, type: programSpaceTypes.clock }
+ : undefined,
resolveAsset: async () => { throw new Error("no asset resolution expected"); },
});
assert.equal(output.fragments[0]?.id, stillVideoFragment.id);
assert.deepEqual(output.components[0]?.outputs, { video: "opening-still.video" });
+ assert.deepEqual(output.records[0], {
+ id: "opening-still.duration", type: speechTypes.duration, value: { kind: "inline", value: 6 }, range,
+ }, "the literal duration is the author's, published as an ordinary SpeechDuration Record");
+ assert.deepEqual(output.components[0]?.inputs.duration, { kind: "record", id: "opening-still.duration" });
assert.equal(stillVideoFragment.exports[0]?.type.name, artifactTypes.blob.name);
});
diff --git a/packages/media-track/preview/preview.svml b/packages/media-track/preview/preview.svml
index 8e745afc..56622195 100644
--- a/packages/media-track/preview/preview.svml
+++ b/packages/media-track/preview/preview.svml
@@ -23,7 +23,6 @@
<import as="pipeline" from="@hypit/media-pipeline@1"/>
<import as="speech" from="@hypit/speech-track@1"/>
<import as="whisperx" from="@hypit/whisperx@1"/>
- <import as="estimate" from="@hypit/estimate@1"/>
<import as="media-track" from="@hypit/media-track@1"/>
<import as="space" from="@hypit/spatial@1"/>
<import as="program" from="@hypit/program-space@1"/>
@@ -48,8 +47,7 @@
left="12%" top="52%" right="88%" bottom="78%"/>
<wording:Value id="direction">Locked medium close-up in a quiet daylight studio. Spoken dialogue.</wording:Value>
- <estimate:Speech id="showcase-duration" source={story.segment.showcase.speech} policy={recipes.speech.normal}/>
- <seedance:TextVideo id="take" model="mini" prompt={direction} duration={showcase-duration.duration} generate-audio="true"/>
+ <seedance:TextVideo id="take" model="mini" prompt={direction} duration="8" generate-audio="true"/>
<seedance:TextVideo id="motion-a" model="mini" prompt={direction} duration="5"/>
<seedance:TextVideo id="motion-b" model="mini" prompt={direction} duration="5"/>
diff --git a/packages/preview-mock/package.json b/packages/preview-mock/package.json
index 61abc037..e026eb48 100644
--- a/packages/preview-mock/package.json
+++ b/packages/preview-mock/package.json
@@ -4,13 +4,16 @@
"license": "SEE LICENSE IN LICENSE",
"private": true,
"type": "module",
- "exports": { ".": "./src/index.ts" },
- "hypit": { "activation": "./src/activation.ts" },
+ "exports": {
+ ".": "./src/index.ts"
+ },
+ "hypit": {
+ "activation": "./src/activation.ts"
+ },
"dependencies": {
"@hypit/artifact": "workspace:*",
"@hypit/resource-store-fs": "workspace:*",
"@hypit/compiler-node": "workspace:*",
- "@hypit/estimate": "workspace:*",
"@hypit/driver-node": "workspace:*",
"@hypit/mock-media": "workspace:*",
"@hypit/provider-media-local": "workspace:*",
diff --git a/packages/preview-mock/src/graph.ts b/packages/preview-mock/src/graph.ts
index 325e7d5e..57512467 100644
--- a/packages/preview-mock/src/graph.ts
+++ b/packages/preview-mock/src/graph.ts
@@ -1,13 +1,15 @@
import type { CompiledGraph, Candidate, TypedRecord } from "@hypit/protocol";
import { findLogicalOutput, findCandidate, findOperation } from "@hypit/compiler-node";
import type { GraphValueRef, TypeRef } from "@hypit/protocol";
-import { estimateSpeechDuration } from "@hypit/estimate";
-import type { SpeechEstimatePolicy } from "@hypit/estimate";
-import type { Text } from "@hypit/text";
export type MockKind = "image" | "video" | "audio" | "semantic-take";
export type MockTarget = { readonly output: string; readonly candidate: Candidate; readonly kind: MockKind; readonly inputs: Readonly<Record<string, string>>; readonly durationSeconds?: number };
+/**
+ * The longest duration the author wrote anywhere in the graph: a SpeechDuration literal (a still's
+ * length) or the `duration` port of a generation request (a Seedance take). Durations are author
+ * literals, so the preview clock is known before anything runs.
+ */
export function estimatedProgramDurationSeconds(graph: CompiledGraph, records: readonly TypedRecord[] = []): number | undefined {
const values: unknown[] = [
...records.filter((item) => sameType(item.type, "@hypit/speech", "SpeechDuration")).map((item) => item.value),
@@ -15,14 +17,21 @@ export function estimatedProgramDurationSeconds(graph: CompiledGraph, records: r
.map((item) => item.root.kind === "value" ? item.root.value.value : undefined),
];
const durations = values.map(inlineNumber).filter((value): value is number => value !== undefined);
- for (const operation of graph.operations) {
- if (operation.producer.module.name !== "@hypit/estimate" || operation.producer.name !== "estimate-speech-duration") continue;
- const duration = estimateOperationDuration(graph, operation, records);
+ for (const record of records) {
+ const duration = requestDuration(record.value.kind === "inline" ? record.value.value : undefined);
if (duration !== undefined) durations.push(duration);
}
return durations.length === 0 ? undefined : Math.max(...durations);
}
+/** The `duration` port of a sealed generation request or draft; nothing else is read as a duration. */
+function requestDuration(value: unknown): number | undefined {
+ if (value === null || typeof value !== "object") return undefined;
+ const ports = (value as { readonly ports?: unknown }).ports;
+ if (ports === null || typeof ports !== "object") return undefined;
+ return inlineDuration((ports as Record<string, unknown>).duration);
+}
+
function sameType(left: TypeRef | undefined, module: string, name: string): boolean {
return left?.module.name === module && left.name === name;
}
@@ -125,24 +134,8 @@ function refOfTypeInOperation(
return undefined;
}
-function estimateOperationDuration(graph: CompiledGraph, operation: ReturnType<typeof findOperation>, records: readonly TypedRecord[]): number | undefined {
- if (operation === undefined) return undefined;
- const speechRef = operation.inputs.speech;
- const policyRef = operation.inputs.policy;
- if (speechRef?.kind !== "record" || policyRef?.kind !== "record") return undefined;
- const speech = recordValue(records, speechRef.id);
- const policy = recordValue(records, policyRef.id);
- if (speech === undefined || policy === undefined || typeof speech !== "object" || typeof policy !== "object") return undefined;
- try {
- return estimateSpeechDuration(speech as Text, policy as SpeechEstimatePolicy);
- } catch {
- return undefined;
- }
-}
-
-/** Resolve the SpeechDuration belonging to one generation operation, without falling back to the
- * first duration in the graph. Seedance's duration arrives through its internal DurationProgram, so
- * the useful edge may be an operation result rather than a logical output. */
+/** Resolve the duration belonging to one generation operation, without falling back to the first
+ * duration in the graph: a SpeechDuration record, or the literal `duration` port of the request. */
function durationFromRef(
graph: CompiledGraph,
ref: GraphValueRef | undefined,
@@ -163,9 +156,7 @@ function durationFromRef(
seen.add(ref.operation);
const operation = findOperation(graph, ref.operation);
if (operation === undefined) return undefined;
- const estimated = estimateOperationDuration(graph, operation, records);
- if (estimated !== undefined) return estimated;
- for (const name of ["duration", "program", "request", "draft", "speech"]) {
+ for (const name of ["duration", "request", "draft"]) {
const value = durationFromRef(graph, operation.inputs[name], records, seen);
if (value !== undefined) return value;
}
diff --git a/packages/reference-video-tools/package.json b/packages/reference-video-tools/package.json
index d1f739b5..c488ca12 100644
--- a/packages/reference-video-tools/package.json
+++ b/packages/reference-video-tools/package.json
@@ -15,7 +15,6 @@
"@hypit/composition": "workspace:*",
"@hypit/core": "workspace:*",
"@hypit/driver-node": "workspace:*",
- "@hypit/estimate": "workspace:*",
"@hypit/gemini": "workspace:*",
"@hypit/hyperframes": "workspace:*",
"@hypit/markup": "workspace:*",
diff --git a/packages/reference-video-tools/src/authoring.ts b/packages/reference-video-tools/src/authoring.ts
index 740a3be0..84e4f4e4 100644
--- a/packages/reference-video-tools/src/authoring.ts
+++ b/packages/reference-video-tools/src/authoring.ts
@@ -496,7 +496,7 @@ export type RenderElementInput = {
readonly tokens?: readonly [number, number];
/**
* A reference used only for comparison evidence and reference window selection. It never changes
- * preview timing, which is always the Source's own `estimate:Speech` policy.
+ * preview timing, which is always the Source's own literal durations.
*/
readonly reference_id?: string;
/** Optional workspace root used by package-owned preview Sources. */
diff --git a/packages/reference-video-tools/src/checks.ts b/packages/reference-video-tools/src/checks.ts
index 14c39845..5a2d4ce2 100644
--- a/packages/reference-video-tools/src/checks.ts
+++ b/packages/reference-video-tools/src/checks.ts
@@ -1097,12 +1097,12 @@ export async function authoringCheck(
? `every compared element was looked at over the deterministic estimate-timed preview (${compared}).`
: `${untimed.length} of ${compared} compared elements have no recorded preview timing basis.`);
}
- // On the description route every stand-in is estimate-timed, because `estimate:Speech` is the only
- // clock there is until the Build synthesizes the speech. Reporting that as a shortfall would name
- // every element every time and ask for a re-render against a reference that does not exist, so it
- // is stated once as what it is.
+ // On the description route every stand-in is estimate-timed, because the author's literal durations
+ // are the only clock there is until the Build synthesizes the speech. Reporting that as a shortfall
+ // would name every element every time and ask for a re-render against a reference that does not
+ // exist, so it is stated once as what it is.
if (compared > 0 && mode === "description") {
- summary.push(`every ${looking} was made over a stand-in timed by estimate:Speech (${compared}); how each element `
+ summary.push(`every ${looking} was made over a stand-in timed by the Source's literal durations (${compared}); how each element `
+ "sits against the speech the Build synthesizes is settled once that speech exists.");
}
if (unresolved.length > 0) {
diff --git a/packages/reference-video-tools/src/cli.ts b/packages/reference-video-tools/src/cli.ts
index 190b4a72..703aeaac 100644
--- a/packages/reference-video-tools/src/cli.ts
+++ b/packages/reference-video-tools/src/cli.ts
@@ -78,7 +78,7 @@ function usage(): string {
"across; without either, the whole program is drawn. An --out ending .mp4, .mov or .webm writes the",
"stretch as a clip, and any other extension writes one still from the middle of it.",
"",
- "Preview timing is always the Source-owned estimate:Speech policy. `--reference-id` only selects",
+ "Preview timing is always the Source's own literal durations. `--reference-id` only selects",
"reference evidence and comparison windows; it never drives a synthetic SemanticTake clock. The",
"result's `timing_basis` is `estimate`, and the same object is written to <out>.stand-in.json for",
"compare_reconstruction to carry into the comparison log.",
@@ -124,7 +124,7 @@ function usage(): string {
"fill and is therefore still whatever the reference does.",
"",
"Mock media is materialized by the local mock Provider and cached by @hypit/preview-mock; it never",
- "enters Author Source and is ignored by coverage reports. Timing uses estimate:Speech, while reference",
+ "enters Author Source and is ignored by coverage reports. Timing uses the Source's literal durations, while reference",
"WhisperX is reserved for comparison evidence and window selection.",
"",
"record_observation takes the keys the agent observer is handed: the four whole-reference keys, a",
diff --git a/packages/seedance/README.md b/packages/seedance/README.md
index 888d715e..4de8c996 100644
--- a/packages/seedance/README.md
+++ b/packages/seedance/README.md
@@ -14,5 +14,6 @@ member as an ordinary `BlobArtifact`. Their prompt ports consume ordinary `Text`
generic Text Template or third-party author module can feed them without becoming part of Seedance.
`standard`, `fast`, `mini` and `2.5` select model variants independently of the invocation shape. Duration is
-either literal or supplied by an explicit `SpeechDuration` edge; the generic internal `DurationProgram`
-only delays that scalar binding and does not introduce a Speaker/Speech usage into the model interface.
+the author's literal, in whole seconds inside the model's declared range; measure the spoken line first
+with `hypit measure` and write the number here. Nothing in the graph computes it, so a Build plan is
+complete before it starts.
diff --git a/packages/seedance/package.json b/packages/seedance/package.json
index 879a6831..8c149436 100644
--- a/packages/seedance/package.json
+++ b/packages/seedance/package.json
@@ -16,7 +16,6 @@
"@hypit/generation": "workspace:*",
"@hypit/model-kit": "workspace:*",
"@hypit/protocol": "workspace:*",
- "@hypit/speech": "workspace:*",
"@hypit/text": "workspace:*",
"@hypit/markup": "workspace:*"
}
diff --git a/packages/seedance/src/fragment.ts b/packages/seedance/src/fragment.ts
index a83abd57..d63f0161 100644
--- a/packages/seedance/src/fragment.ts
+++ b/packages/seedance/src/fragment.ts
@@ -1,15 +1,8 @@
-import { speechTypes } from "@hypit/speech";
import { artifactTypes } from "@hypit/artifact";
import { sealGraphFragment } from "@hypit/elaborator";
import { generationProducers } from "@hypit/generation";
-import {
- createExactModelPrimaryGenerationFragment,
- exactModelMediaInputNames,
- exactModelTextInputName,
-} from "@hypit/model-kit";
+import { createExactModelPrimaryGenerationFragment } from "@hypit/model-kit";
import type { ExactModelEndpoint, ExactModelMediaInput, ExactModelTextInput } from "@hypit/model-kit";
-import { textTypes } from "@hypit/text";
-import type { ProducerRef } from "@hypit/protocol";
const input = (name: string) => ({ kind: "fragment-input" as const, name });
const operation = (id: string) => ({ kind: "fragment-operation" as const, operation: id });
@@ -52,82 +45,3 @@ export function createSeedanceAssembledGenerationFragment(
return createExactModelPrimaryGenerationFragment(endpoint, mediaInputs, textInputs);
}
-export function createSeedanceDurationGenerationFragment(
- endpoint: ExactModelEndpoint,
- compileProducer: ProducerRef,
- mediaInputs: readonly ExactModelMediaInput[] = [],
- textInputs: readonly ExactModelTextInput[] = [],
-) {
- const inputs = [
- { name: "program", type: { module: endpoint.producer.module, name: "DurationProgram" } },
- { name: "duration", type: speechTypes.duration },
- ];
- const operations: Array<import("@hypit/elaborator").FragmentOperation> = [{
- id: "compile-draft",
- producer: compileProducer,
- inputs: { program: input("program"), duration: input("duration") },
- result: { kind: "output", name: "draft" },
- }];
- let draft = operation("compile-draft") as ReturnType<typeof input> | ReturnType<typeof operation>;
- for (const [index, item] of textInputs.entries()) {
- const binding = endpoint.textBindings[item.port];
- if (binding === undefined) throw new Error(`${endpoint.ports.model} has no text port ${item.port}`);
- const name = exactModelTextInputName(item.name);
- inputs.push({ name, type: textTypes.text });
- const id = `bind-text:${String(index + 1).padStart(4, "0")}:${item.port}`;
- operations.push({
- id,
- producer: binding.producer,
- inputs: { draft, text: input(name) },
- result: { kind: "output", name: "draft" },
- });
- draft = operation(id);
- }
- for (const [index, item] of mediaInputs.entries()) {
- const binding = endpoint.mediaBindings[item.port];
- if (binding === undefined) throw new Error(`${endpoint.ports.model} has no media port ${item.port}`);
- const names = exactModelMediaInputNames(item.name);
- inputs.push({ name: names.binding, type: binding.type }, { name: names.artifact, type: artifactTypes.blob });
- const id = `bind:${String(index + 1).padStart(4, "0")}:${item.port}`;
- operations.push({
- id,
- producer: binding.producer,
- inputs: { draft, binding: input(names.binding), artifact: input(names.artifact) },
- result: { kind: "output", name: "draft" },
- });
- draft = operation(id);
- }
- operations.push(
- {
- id: "finalize-request",
- producer: endpoint.finalizeProducer,
- inputs: { draft },
- result: { kind: "output", name: "request" },
- },
- {
- id: "generate",
- producer: endpoint.producer,
- inputs: { request: operation("finalize-request") },
- result: { kind: "need", name: "generation" },
- },
- {
- id: "select-primary-video",
- producer: generationProducers.primaryVideo,
- inputs: { set: operation("generate") },
- result: { kind: "output", name: "video" },
- },
- );
- const shape = [
- ...textInputs.map((item) => `${item.name}=${item.port}:text`),
- ...mediaInputs.map((item) => `${item.name}=${item.port}:media`),
- ].join(",") || "no-dynamic-inputs";
- return sealGraphFragment({
- inputs,
- operations,
- exports: [{
- name: "video",
- type: artifactTypes.blob,
- root: operation("select-primary-video"),
- }],
- });
-}
diff --git a/packages/seedance/src/index.ts b/packages/seedance/src/index.ts
index d31b77a3..bb6e1ba4 100644
--- a/packages/seedance/src/index.ts
+++ b/packages/seedance/src/index.ts
@@ -1,25 +1,17 @@
import {
- generationObjectSchema,
- portsObjectSchema,
sealGenerationPortRequest,
- sealGenerationRequestDraft,
sealGenerationPortTable,
- verifyPortsAgainstTable,
} from "@hypit/generation";
import type {
GenerationPortTable,
GenerationPortValue,
GenerationRequest,
- GenerationRequestDraft,
} from "@hypit/generation";
import { artifactTypes } from "@hypit/artifact";
import type { SurfaceAttributeVocabulary, SurfacePortVocabulary } from "@hypit/markup";
import { defineExactModelModule } from "@hypit/model-kit";
-import { assertSpeechDurationIdentity, speechDependency, speechTypes } from "@hypit/speech";
-import type { SpeechDuration } from "@hypit/speech";
import { textTypes } from "@hypit/text";
-import { canonicalize } from "@hypit/protocol";
-import type { ResourceId, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";
+import type { ResourceId } from "@hypit/protocol";
export const seedanceModuleRef = { name: "@hypit/seedance", version: "1" } as const;
export const seedanceModels = ["seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2.5"] as const;
@@ -100,88 +92,6 @@ export function sealSeedanceRequest(model: SeedanceModel, ports: SeedancePortMap
return sealGenerationPortRequest(seedancePorts[model], ports);
}
-/** One authored generation minus a duration supplied by an explicit graph edge. */
-export type SeedanceDurationProgram = {
- readonly model: SeedanceModel;
- readonly ports: SeedancePortMap;
-};
-
-export const seedanceTypes = {
- durationProgram: { module: seedanceModuleRef, name: "DurationProgram" },
-} satisfies Record<string, TypeRef>;
-
-export const seedanceDurationCompileProducers = Object.fromEntries(
- seedanceModels.map((model) => [model, {
- module: seedanceModuleRef,
- name: `compile-${model}-duration-request`,
- }]),
-) as Record<SeedanceModel, ProducerRef>;
-
-function assertObject(value: unknown): asserts value is Record<string, unknown> {
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
- throw new Error("Seedance value must be an object");
- }
-}
-
-export function verifySeedanceDurationProgram(value: unknown): asserts value is SeedanceDurationProgram {
- assertObject(value);
- if (!seedanceModels.includes(value.model as SeedanceModel)) {
- throw new Error("Seedance DurationProgram identity is invalid");
- }
- const table = seedancePorts[value.model as SeedanceModel];
- const later = table.ports
- .filter((port) => port.value.kind === "media" || port.value.kind === "text")
- .map((port) => port.name);
- verifyPortsAgainstTable(table, value.ports, { omit: ["duration", ...later] });
- const generateAudio = (value.ports as SeedancePortMap).generateAudio;
-}
-
-export function sealSeedanceDurationProgram(value: SeedanceDurationProgram): SeedanceDurationProgram {
- const result = canonicalize(value) as unknown as SeedanceDurationProgram;
- verifySeedanceDurationProgram(result);
- return result;
-}
-
-export function compileSeedanceDurationRequestDraft(
- program: SeedanceDurationProgram,
- duration: SpeechDuration,
-): GenerationRequestDraft {
- verifySeedanceDurationProgram(program);
- assertSpeechDurationIdentity(duration);
- // Speech estimation and paid video generation have different clocks. A short spoken Segment
- // (including fractional seconds) must remain short for SemanticTake alignment, while the remote
- // model still requires an integer duration inside its declared range. Clamp only the generation
- // request to that legal range; never rewrite the speech estimate itself.
- const durationPort = seedancePorts[program.model].ports.find((port) => port.name === "duration");
- const legalDuration = durationPort?.value.kind === "number"
- ? Math.min(durationPort.value.maximum ?? Number.MAX_SAFE_INTEGER, Math.max(durationPort.value.minimum ?? 0, Math.ceil(duration)))
- : durationPort?.value.kind === "enum"
- ? (() => {
- const allowed = durationPort.value.values.filter((value): value is number => typeof value === "number" && value >= 0);
- return allowed.find((value) => value >= duration) ?? Math.max(...allowed);
- })()
- : Math.ceil(duration);
- return sealGenerationRequestDraft(seedancePorts[program.model], {
- ...program.ports,
- duration: [Number.isFinite(legalDuration) ? legalDuration : Math.ceil(duration)],
- });
-}
-
-const durationProgramSchema = (model: SeedanceModel): ValueSchema => generationObjectSchema({
-
- model: { schema: { kind: "literal", value: model } },
- ports: {
- schema: portsObjectSchema(seedancePorts[model], {
- omit: [
- "duration",
- ...seedancePorts[model].ports
- .filter((port) => port.value.kind === "media" || port.value.kind === "text")
- .map((port) => port.name),
- ],
- }),
- },
-});
-
const seedanceBaseDefinition = defineExactModelModule({
module: seedanceModuleRef,
endpoints: ([
@@ -235,10 +145,9 @@ const seedanceCommonAttributes: readonly SurfaceAttributeVocabulary[] = [
},
{
name: "duration",
- kind: "expression",
+ kind: "literal",
required: true,
- summary: "Sets the length of the video in seconds, either written literally or taken from a SpeechDuration edge.",
- accepts: [speechTypes.duration],
+ summary: "Sets the length of the video in whole seconds within the model's range; the author's decision, measured beforehand with hypit measure.",
},
{
name: "resolution",
@@ -281,7 +190,6 @@ export const seedanceMarkupSurfaces = [
tag: "TextVideo",
mode: "structured",
outputs: [
- seedanceTypes.durationProgram,
...Object.values(seedanceEndpoints).flatMap((endpoint) => [
endpoint.draftType,
...Object.values(endpoint.mediaBindings).map((binding) => binding.type),
@@ -312,7 +220,7 @@ export const seedanceMarkupSurfaces = [
name: "frame-video",
tag: "FrameVideo",
mode: "structured",
- outputs: [seedanceTypes.durationProgram, ...Object.values(seedanceEndpoints).flatMap((endpoint) => [
+ outputs: [...Object.values(seedanceEndpoints).flatMap((endpoint) => [
endpoint.draftType, ...Object.values(endpoint.mediaBindings).map((binding) => binding.type),
])],
vocabulary: {
@@ -347,7 +255,7 @@ export const seedanceMarkupSurfaces = [
name: "reference-video",
tag: "ReferenceVideo",
mode: "structured",
- outputs: [seedanceTypes.durationProgram, ...Object.values(seedanceEndpoints).flatMap((endpoint) => [
+ outputs: [...Object.values(seedanceEndpoints).flatMap((endpoint) => [
endpoint.draftType, ...Object.values(endpoint.mediaBindings).map((binding) => binding.type),
])],
vocabulary: {
@@ -403,65 +311,14 @@ export const seedanceMarkupSurfaces = [
},
] as const;
-export const seedanceManifest = {
- ...seedanceBaseDefinition.manifest,
- dependencies: [
- ...seedanceBaseDefinition.manifest.dependencies,
- speechDependency,
- ],
- types: [
- ...seedanceBaseDefinition.manifest.types,
- {
- name: seedanceTypes.durationProgram.name,
- },
- ],
- producers: [
- ...seedanceBaseDefinition.manifest.producers,
- ...seedanceModels.map((model) => ({
- name: seedanceDurationCompileProducers[model].name,
- inputs: [
- { name: "program", type: seedanceTypes.durationProgram },
- { name: "duration", type: speechTypes.duration },
- ],
- outputs: [{ name: "draft", type: seedanceEndpointsByModel[model].draftType }],
- needs: [],
- })),
- ],
-} as const;
-export const seedanceComponent = {
- ...seedanceBaseDefinition.component,
- producers: [
- ...seedanceBaseDefinition.component.producers,
- ...seedanceModels.map((model) => ({
- producer: seedanceDurationCompileProducers[model],
- handler: ({ inputs }: { readonly inputs: Readonly<Record<string, { readonly value: import("@hypit/protocol").StoredValue }>> }) => ({
- outputs: {
- draft: {
- kind: "inline" as const,
- value: canonicalize(compileSeedanceDurationRequestDraft(
- inputs.program?.value.kind === "inline"
- ? inputs.program.value.value as unknown as SeedanceDurationProgram
- : (() => { throw new Error("Seedance DurationProgram must be inline"); })(),
- inputs.duration?.value.kind === "inline"
- ? inputs.duration.value.value as unknown as SpeechDuration
- : (() => { throw new Error("SpeechDuration must be inline"); })(),
- )),
- },
- },
- needs: {},
- }),
- })),
- ],
-};
-export const seedanceDefinition = {
- ...seedanceBaseDefinition,
- manifest: seedanceManifest,
-};
+/** The duration is an author literal on every Seedance Surface, so the manifest is the exact-model module's own. */
+export const seedanceManifest = seedanceBaseDefinition.manifest;
+export const seedanceComponent = seedanceBaseDefinition.component;
+export const seedanceDefinition = seedanceBaseDefinition;
export {
createSeedanceAssembledGenerationFragment,
createSeedanceGenerationFragment,
- createSeedanceDurationGenerationFragment,
} from "./fragment.js";
export {
decodeSeedanceFrameVideoSurface,
diff --git a/packages/seedance/src/surface.ts b/packages/seedance/src/surface.ts
index 86828d64..280d6e06 100644
--- a/packages/seedance/src/surface.ts
+++ b/packages/seedance/src/surface.ts
@@ -12,7 +12,6 @@ import type {
import { exactModelMediaInputNames, exactModelTextInputName } from "@hypit/model-kit";
import type { ExactModelEndpoint, ExactModelMediaInput } from "@hypit/model-kit";
import type { CanonicalValue } from "@hypit/protocol";
-import { speechTypes } from "@hypit/speech";
import { textTypes, verifyText } from "@hypit/text";
import type {
MarkupAttributeValue,
@@ -21,17 +20,8 @@ import type {
SurfaceResolvedReference,
} from "@hypit/markup";
-import {
- createSeedanceAssembledGenerationFragment,
- createSeedanceDurationGenerationFragment,
-} from "./fragment.js";
-import {
- sealSeedanceDurationProgram,
- seedanceDurationCompileProducers,
- seedanceEndpoints,
- seedancePorts,
- seedanceTypes,
-} from "./index.js";
+import { createSeedanceAssembledGenerationFragment } from "./fragment.js";
+import { seedanceEndpoints, seedancePorts } from "./index.js";
import type { SeedanceModel, SeedancePortMap } from "./index.js";
type MediaInput = {
@@ -161,11 +151,11 @@ function enumeratedPort(table: GenerationPortTable, name: string): readonly (str
function generationSettings(
element: StructuredElement,
model: SeedanceModel,
- suppliedDurationSec?: number,
): SeedancePortMap {
const table = seedancePorts[model];
const duration = generationPort(table, "duration");
- const durationSec = suppliedDurationSec ?? integerAttribute(element, "duration");
+ // The author's literal, measured beforehand; the model's declared range is the only check.
+ const durationSec = integerAttribute(element, "duration");
if (duration.value.kind === "number") {
const { minimum = 0, maximum = Number.MAX_SAFE_INTEGER } = duration.value;
if (durationSec < minimum || durationSec > maximum) {
@@ -288,18 +278,6 @@ function assembleMedia(
return { mediaInputs, records, inputs };
}
-function durationReference(
- element: StructuredElement,
- resolveReference: (path: string) => SurfaceResolvedReference | undefined,
-): SurfaceResolvedReference | undefined {
- if (typeof element.attributes.duration === "string") return undefined;
- const result = resolved(element, "duration", resolveReference);
- if (!sameType(result.type, speechTypes.duration)) {
- throw new Error(`${element.name}.duration must reference a SpeechDuration`);
- }
- return result;
-}
-
function generationOutput(args: {
readonly element: StructuredElement;
readonly endpoint: ExactModelEndpoint;
@@ -311,43 +289,6 @@ function generationOutput(args: {
const { element, endpoint, model, promptSource } = args;
const id = stringAttribute(element, "id");
const assembled = assembleMedia(id, endpoint, args.media, element.range);
- const duration = durationReference(element, args.resolveReference);
- if (duration !== undefined) {
- const { duration: _later, ...ports } = generationSettings(element, model, 4);
- const program = sealSeedanceDurationProgram({
-
- model,
- ports,
- });
- const programId = `${id}.duration-program`;
- const fragment = createSeedanceDurationGenerationFragment(
- endpoint,
- seedanceDurationCompileProducers[model],
- assembled.mediaInputs,
- [{ name: "prompt", port: "prompt" }],
- );
- return {
- records: [{
- id: programId,
- type: seedanceTypes.durationProgram,
- value: { kind: "inline" as const, value: program as unknown as CanonicalValue },
- range: element.range,
- }, ...assembled.records],
- components: [{
- id,
- fragment: fragment.id,
- inputs: {
- program: { kind: "record" as const, id: programId },
- duration: duration.ref,
- [exactModelTextInputName("prompt")]: promptSource.ref,
- ...assembled.inputs,
- },
- outputs: { video: `${id}.video` },
- range: element.range,
- }],
- fragments: [fragment],
- };
- }
const draft = sealGenerationRequestDraft(seedancePorts[model], generationSettings(element, model));
const fragment = createSeedanceAssembledGenerationFragment(
endpoint,
diff --git a/packages/semantic-take-estimate/README.md b/packages/semantic-take-estimate/README.md
index 1a2d2763..af8f7a8c 100644
--- a/packages/semantic-take-estimate/README.md
+++ b/packages/semantic-take-estimate/README.md
@@ -19,9 +19,13 @@ leaving a fixed-length estimate at the beginning.
```svml
<estimated:SemanticTake id="opening-estimated" narrative={story}
segment={story.segment.opening} media={opening-media.media}
- policy={opening-duration.policy}/>
+ language="en" pace="normal" min="4" max="15" rounding="round"/>
```
+The delivery policy is the element's own: write it inline as above, or name an SVS Recipe with
+`policy={recipes.speech.normal}` carrying the same properties. Nothing else in the graph computes
+it; durations themselves are author literals, measured beforehand with `hypit measure`.
+
The result has the ordinary `@hypit/speech@1#SemanticTake` type. A Run can therefore choose this
Build output while real A-roll is unavailable, then later choose the corresponding WhisperX output
without changing Speech Track, Caption, Selection or Studio protocols.
diff --git a/packages/semantic-take-estimate/package.json b/packages/semantic-take-estimate/package.json
index 3792b408..d7d6b3ae 100644
--- a/packages/semantic-take-estimate/package.json
+++ b/packages/semantic-take-estimate/package.json
@@ -19,7 +19,8 @@
"@hypit/narrative": "workspace:*",
"@hypit/protocol": "workspace:*",
"@hypit/run": "workspace:*",
- "@hypit/speech": "workspace:*"
+ "@hypit/speech": "workspace:*",
+ "@hypit/svs": "workspace:*"
},
"devDependencies": {
"@hypit/script": "workspace:*"
diff --git a/packages/semantic-take-estimate/src/manifest.ts b/packages/semantic-take-estimate/src/manifest.ts
index 6b077fa8..c0bc1d20 100644
--- a/packages/semantic-take-estimate/src/manifest.ts
+++ b/packages/semantic-take-estimate/src/manifest.ts
@@ -3,6 +3,7 @@ import { mediaDependency, mediaTypes } from "@hypit/media";
import { narrativeDependency, narrativeTypes } from "@hypit/narrative";
import type { ModuleManifest, ProducerRef } from "@hypit/protocol";
import { speechDependency, speechTypes } from "@hypit/speech";
+import { svsRecipeType } from "@hypit/svs";
export const semanticTakeEstimateModuleRef = { name: "@hypit/semantic-take-estimate", version: "1" } as const;
@@ -14,7 +15,7 @@ export const semanticTakeEstimateMarkupSurfaces = [{
name: "semantic-take",
tag: "SemanticTake",
mode: "structured",
- outputs: [speechTypes.semanticTake],
+ outputs: [estimateTypes.speechPolicy, speechTypes.semanticTake],
vocabulary: {
summary:
"Projects syllable-weighted estimated word windows onto one already normalized video and publishes a SemanticTake.",
@@ -27,15 +28,40 @@ export const semanticTakeEstimateMarkupSurfaces = [{
summary: "Selects the single authored Segment represented by the normalized video." },
{ name: "media", kind: "reference", required: true, accepts: [mediaTypes.synchronized],
summary: "Selects the already normalized SynchronizedMedia whose exact frame domain receives the estimate." },
- { name: "policy", kind: "reference", required: true, accepts: [estimateTypes.speechPolicy],
- summary: "Selects the speech-estimate policy whose explicit language rules weight each authored Token." },
+ { name: "policy", kind: "reference", required: false, accepts: [svsRecipeType],
+ summary: "Selects an SVS Recipe carrying the delivery policy (language, pace or rate, min, max, rounding), in place of the inline attributes.",
+ recipe: [
+ { name: "language", required: true, summary: "Selects the counting rules the Segment is read with, or detects them.", values: ["auto", "en", "zh", "ja", "es"] },
+ { name: "pace", required: false, summary: "Selects a named delivery density.", values: ["slow", "normal", "fast"] },
+ { name: "rate", required: false, summary: "Sets the delivery density in pronunciation units per second, in place of pace." },
+ { name: "min", required: true, summary: "Sets the shortest duration in seconds the estimate may assume." },
+ { name: "max", required: true, summary: "Sets the longest duration in seconds the estimate may assume." },
+ { name: "rounding", required: true, summary: "Selects how a bounded duration is rounded.", values: ["none", "round", "ceil"] },
+ ] },
+ { name: "language", kind: "literal", required: false, values: ["auto", "en", "zh", "ja", "es"],
+ summary: "Selects the counting rules the Segment is read with, or detects them from its Text." },
+ { name: "pace", kind: "literal", required: false, values: ["slow", "normal", "fast"],
+ summary: "Selects a named delivery density for the chosen language." },
+ { name: "rate", kind: "literal", required: false,
+ summary: "Sets the delivery density in pronunciation units per second, in place of pace." },
+ { name: "min", kind: "literal", required: false,
+ summary: "Sets the shortest duration in seconds the estimate may assume." },
+ { name: "max", kind: "literal", required: false,
+ summary: "Sets the longest duration in seconds the estimate may assume." },
+ { name: "rounding", kind: "literal", required: false, values: ["none", "round", "ceil"],
+ summary: "Selects how a bounded duration is rounded." },
+ ],
+ ports: [
+ { name: "take", type: speechTypes.semanticTake,
+ summary: "The estimated SemanticTake, addressed as `<id>.take`." },
+ { name: "policy", type: estimateTypes.speechPolicy,
+ summary: "The sealed delivery policy this element weights Tokens with, addressed as `<id>.policy`." },
],
- ports: [{ name: "take", type: speechTypes.semanticTake,
- summary: "The estimated SemanticTake, addressed as `<id>.take`." }],
example: `<estimated:SemanticTake id="opening-estimated" narrative={story}
segment={story.segment.opening} media={opening-media.media}
- policy={opening-duration.policy}/>`,
+ language="en" pace="normal" min="4" max="15" rounding="round"/>`,
notes: [
+ "The policy is the element's own: write it inline or name an SVS Recipe with policy; never both.",
"This package does not measure audio and never claims WhisperX or other acoustic evidence.",
"Every Token uses its original Script identity. Only its local frame window is estimated.",
"Pronunciation-unit weights determine relative word lengths; adjacent words and both media edges retain non-zero frame gaps.",
@@ -53,6 +79,7 @@ export const semanticTakeEstimateManifest: ModuleManifest = {
narrativeDependency,
speechDependency,
{ module: estimateModuleRef },
+ { module: svsRecipeType.module },
],
types: [],
capabilities: [],
diff --git a/packages/semantic-take-estimate/src/surface.ts b/packages/semantic-take-estimate/src/surface.ts
index 6ac0d470..7e764e28 100644
--- a/packages/semantic-take-estimate/src/surface.ts
+++ b/packages/semantic-take-estimate/src/surface.ts
@@ -1,8 +1,6 @@
-import { estimateTypes } from "@hypit/estimate";
-import {
- assertExactAttributes,
- textAttribute,
-} from "@hypit/markup";
+import { estimateTypes, speechEstimatePolicyFromAttributes, speechEstimatePolicyFromRecipe, speechEstimatePolicyProperties } from "@hypit/estimate";
+import type { SpeechEstimatePolicy } from "@hypit/estimate";
+import { textAttribute } from "@hypit/markup";
import type {
MarkupAttributeValue,
StructuredElement,
@@ -11,7 +9,10 @@ import type {
} from "@hypit/markup";
import { mediaTypes } from "@hypit/media";
import { narrativeTypes } from "@hypit/narrative";
+import type { CanonicalValue } from "@hypit/protocol";
import { sameType } from "@hypit/protocol";
+import { svsRecipeType } from "@hypit/svs";
+import type { SvsRecipe } from "@hypit/svs";
import { semanticTakeEstimateFragment } from "./fragment.js";
@@ -31,14 +32,47 @@ function reference(
return resolved;
}
+/**
+ * The delivery policy the estimate weights Tokens with: an SVS Recipe named by `policy`, or the same
+ * properties written inline. The element owns its policy; nothing elsewhere in the graph computes it.
+ */
+function policyOf(
+ element: StructuredElement,
+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,
+): SpeechEstimatePolicy {
+ const inline = speechEstimatePolicyProperties.filter((name) => element.attributes[name] !== undefined);
+ if (element.attributes.policy !== undefined) {
+ if (inline.length > 0) throw new Error(`${element.name}.policy cannot be combined with ${inline.join(", ")}`);
+ const resolved = reference(element, "policy", svsRecipeType, resolveReference);
+ const value = resolved.record?.value;
+ if (value?.kind !== "inline") throw new Error(`${element.name}.policy must reference an authored SVS Recipe`);
+ return speechEstimatePolicyFromRecipe(value.value as unknown as SvsRecipe, `${element.name}.policy`);
+ }
+ const attributes = Object.fromEntries(inline.map((name) => [name, element.attributes[name]]));
+ return speechEstimatePolicyFromAttributes(attributes, element.name);
+}
+
export const decodeSemanticTakeEstimateSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {
- assertExactAttributes(element, ["id", "narrative", "segment", "media", "policy"]);
+ const required = ["id", "narrative", "segment", "media"];
+ const allowed = new Set([...required, "policy", ...speechEstimatePolicyProperties]);
+ const missing = required.filter((name) => element.attributes[name] === undefined);
+ const unknown = Object.keys(element.attributes).filter((name) => !allowed.has(name));
+ if (missing.length > 0 || unknown.length > 0) {
+ throw new Error(`${element.name} requires ${required.join(", ")} and a policy (policy={recipe} or ${speechEstimatePolicyProperties.join(", ")})${
+ unknown.length === 0 ? "" : `; unknown ${unknown.join(", ")}`}`);
+ }
if (element.children.some((child) => child.kind === "element" || child.value.trim().length > 0)) {
throw new Error(`${element.name} must be empty`);
}
const id = textAttribute(element, "id");
+ const policyId = `${id}.policy`;
return {
- records: [],
+ records: [{
+ id: policyId,
+ type: estimateTypes.speechPolicy,
+ value: { kind: "inline", value: policyOf(element, resolveReference) as unknown as CanonicalValue },
+ range: element.range,
+ }],
components: [{
id,
fragment: semanticTakeEstimateFragment.id,
@@ -46,7 +80,7 @@ export const decodeSemanticTakeEstimateSurface: StructuredSurfaceHandler = ({ el
narrative: reference(element, "narrative", narrativeTypes.narrative, resolveReference).ref,
segment: reference(element, "segment", narrativeTypes.excerpt, resolveReference).ref,
media: reference(element, "media", mediaTypes.synchronized, resolveReference).ref,
- policy: reference(element, "policy", estimateTypes.speechPolicy, resolveReference).ref,
+ policy: { kind: "record", id: policyId },
},
outputs: { take: `${id}.take` },
range: element.range,
diff --git a/packages/video-cli/README.md b/packages/video-cli/README.md
index 63d6e395..4b878374 100644
--- a/packages/video-cli/README.md
+++ b/packages/video-cli/README.md
@@ -37,11 +37,14 @@ file the caller chose:
hypit observe <media…> --instruction <text|file> --prompt <text|file> --to notes/frame.md
hypit transcribe reference.mp4 --to notes/reference.transcript.json [--language en|zh|es]
hypit speak --text line.txt --voice "warm, unhurried" --to voice/intro.mp3
+hypit measure main.svml --segment hook --language en --pace normal --min 4 --max 15 --rounding round
```
`observe` uses the Profile's Gemini Endpoint, `transcribe` its `whisperx-alignment` Endpoint (after
extracting 16 kHz mono speech audio with ffmpeg), `speak` its MiMo VoiceDesign Endpoint and reports
-the audio's duration so the author can write it as a literal. `--runtime <profile>` names the Profile;
+the audio's duration so the author can write it as a literal. `measure` counts a Segment's pronunciation
+units at a delivery policy and prints the seconds to write as the literal `duration`; it opens no
+Profile and spends nothing. `--runtime <profile>` names the Profile;
otherwise the project's `hypit runtime use` selection is read. Slow paid generation — pictures and
clips — is not a creation-time tool: declare it in the Source and go through `plan` and `build`.
diff --git a/packages/video-cli/package.json b/packages/video-cli/package.json
index a92b540e..3aff72fe 100644
--- a/packages/video-cli/package.json
+++ b/packages/video-cli/package.json
@@ -13,6 +13,7 @@
"@hypit/compiler-markup-node": "workspace:*",
"@hypit/credential-store-os": "workspace:*",
"@hypit/driver-node": "workspace:*",
+ "@hypit/estimate": "workspace:*",
"@hypit/gemini": "workspace:*",
"@hypit/generation": "workspace:*",
"@hypit/markup": "workspace:*",
@@ -21,12 +22,12 @@
"@hypit/protocol": "workspace:*",
"@hypit/provider-hypihub": "workspace:*",
"@hypit/runtime": "workspace:*",
+ "@hypit/runtime-host-node": "workspace:*",
+ "@hypit/runtime-local": "workspace:*",
"@hypit/speech": "workspace:*",
"@hypit/speech-evidence": "workspace:*",
"@hypit/text": "workspace:*",
"@hypit/whisperx": "workspace:*",
- "@hypit/runtime-host-node": "workspace:*",
- "@hypit/runtime-local": "workspace:*",
"@hypit/workspace-fs-node": "workspace:*"
}
}
diff --git a/packages/video-cli/src/creation.ts b/packages/video-cli/src/creation.ts
index 5ea45ac0..2fbd620c 100644
--- a/packages/video-cli/src/creation.ts
+++ b/packages/video-cli/src/creation.ts
@@ -3,9 +3,15 @@ import { mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises"
import { tmpdir } from "node:os";
import { dirname, extname, join, resolve } from "node:path";
-import { findRuntimeProfile } from "@hypit/cli";
+import { findRuntimeProfile, loadDiscoveredSourcePackages } from "@hypit/cli";
import type { CliIo } from "@hypit/cli";
import { MemoryResourceStore } from "@hypit/driver-node";
+import {
+ countSpeechEstimateUnits,
+ estimateSpeechDuration,
+ resolveSpeechEstimateLanguage,
+ speechEstimatePolicyFromAttributes,
+} from "@hypit/estimate";
import { geminiCapabilities, geminiModels, sealGeminiRequest } from "@hypit/gemini";
import type { GeminiMediaPart, GeminiModel } from "@hypit/gemini";
import { verifyGeneratedAudioSet } from "@hypit/generation";
@@ -17,7 +23,7 @@ import type { RuntimeHostCapabilityProvider } from "@hypit/runtime-host-node";
import { sealSpeechEvidenceAudio } from "@hypit/speech";
import { speechEvidenceTypes } from "@hypit/speech-evidence";
import type { AlignedTranscriptEvidence } from "@hypit/speech-evidence";
-import { textTypes } from "@hypit/text";
+import { sealText, textTypes } from "@hypit/text";
import { whisperXCapabilities, whisperXRequestForEvidenceAudio } from "@hypit/whisperx";
import type { WhisperXLanguage } from "@hypit/whisperx";
@@ -32,7 +38,7 @@ import { videoCliDistribution } from "./distribution.js";
* chose, and nothing else. Slow paid generation (pictures, clips) is not here: it is a Build.
*/
-export const creationCommands = ["observe", "transcribe", "speak"] as const;
+export const creationCommands = ["observe", "transcribe", "speak", "measure"] as const;
export type CreationCommand = typeof creationCommands[number];
/** The slice of the Runtime host these commands use; tests hand in a fake. */
@@ -468,6 +474,86 @@ async function speak(argv: readonly string[], io: CliIo, environment: CreationEn
}
}
+// ---------------------------------------------------------------------------------------------------
+// measure
+
+/** The spoken Text of one Script Segment, read from the compiled author source without a Build. */
+async function segmentSpeech(source: string, segment: string): Promise<string> {
+ const projectRoot = await nearestPackageRoot(dirname(source));
+ const loaded = await loadDiscoveredSourcePackages({ ...videoCliDistribution, bootstrapPackages: [] }, {
+ source,
+ workspaceRoot: projectRoot,
+ packageRoot: projectRoot,
+ ...(videoCliDistribution.packageRoot === undefined ? {} : { distributionPackageRoot: videoCliDistribution.packageRoot }),
+ });
+ const compiler = videoCliDistribution.createCompiler({
+ workspaceRoot: projectRoot,
+ packageContributions: loaded.map((item) => item.contribution),
+ });
+ const workspace = await compiler.openFile(source);
+ const compiled = await compiler.compileSource(workspace.entry, workspace);
+ const suffix = `.segment.${segment}.speech`;
+ const record = compiled.program.records.find((item) =>
+ item.type.module.name === "@hypit/text" && item.type.name === "Text" && item.id.endsWith(suffix));
+ assert(record !== undefined, `${source} declares no Segment ${segment} with speech; Segments are named by the Script's <segment id>`);
+ assert(record.value.kind === "inline", `Segment ${segment} speech is not an inline Text`);
+ const text = (record.value.value as { readonly value?: unknown } | null)?.value;
+ assert(typeof text === "string", `Segment ${segment} speech is not Text`);
+ return text;
+}
+
+/**
+ * Measure a script before writing a duration: pronunciation units of the words, at the delivery
+ * policy the author chooses, bounded and rounded the way the author chooses. Pure local work.
+ */
+async function measure(argv: readonly string[], io: CliIo, environment: CreationEnvironment): Promise<void> {
+ const parsed = parseArguments(argv, ["--text", "--segment", "--language", "--pace", "--rate", "--min", "--max", "--rounding", "--padding"]);
+ const inlineText = parsed.options.get("--text");
+ const segment = parsed.options.get("--segment");
+ assert((inlineText === undefined) !== (parsed.positionals.length === 0 && segment === undefined) || (inlineText !== undefined && parsed.positionals.length === 0),
+ "measure takes either --text <text|file>, or a source .svml with --segment <id>");
+ let text: string;
+ let where: { readonly source: string; readonly segment: string } | { readonly text: true };
+ if (inlineText !== undefined) {
+ assert(segment === undefined && parsed.positionals.length === 0, "--text cannot be combined with a source or --segment");
+ text = await textOrFile(inlineText, "--text", environment.cwd);
+ where = { text: true };
+ } else {
+ assert(parsed.positionals.length === 1 && segment !== undefined, "measure a Segment with: hypit measure <source.svml> --segment <id>");
+ const source = resolve(environment.cwd, parsed.positionals[0]!);
+ text = await segmentSpeech(source, segment);
+ where = { source, segment };
+ }
+ const pace = parsed.options.get("--pace");
+ const rate = parsed.options.get("--rate");
+ const policy = speechEstimatePolicyFromAttributes({
+ language: parsed.options.get("--language") ?? "auto",
+ ...(rate === undefined ? { pace: pace ?? "normal" } : { rate }),
+ min: parsed.options.get("--min") ?? "1",
+ max: parsed.options.get("--max") ?? "60",
+ rounding: parsed.options.get("--rounding") ?? "none",
+ ...(parsed.options.get("--padding") === undefined ? {} : { padding: parsed.options.get("--padding") }),
+ }, "hypit measure");
+ const language = resolveSpeechEstimateLanguage(text, policy.language);
+ const units = countSpeechEstimateUnits(text, language);
+ const seconds = estimateSpeechDuration(sealText(text), policy);
+ const view = {
+ format: "hypit.video-cli-measure@1",
+ ...where,
+ characters: text.length,
+ units,
+ language,
+ policy,
+ seconds,
+ };
+ if (parsed.json) { io.write(`${JSON.stringify(view, null, 2)}\n`); return; }
+ const delivery = policy.rate === undefined ? `${policy.pace} pace` : `${policy.rate} units/s`;
+ const bounds = `min ${policy.minimumSec}, max ${policy.maximumSec}, ${policy.rounding}`;
+ io.write(`${seconds}s\n\n ${units} pronunciation units · ${language} · ${delivery} · ${bounds}\n`
+ + ` ${"segment" in where ? `${where.segment} in ${where.source}` : `${text.length} characters`}\n`
+ + ` Write it as the literal, e.g. duration="${Number.isInteger(seconds) ? seconds : Math.ceil(seconds)}"; a model wants whole seconds inside its range.\n`);
+}
+
// ---------------------------------------------------------------------------------------------------
// Entry
@@ -501,11 +587,22 @@ export function writeCreationHelp(io: CliIo, topic?: CreationCommand): void {
"For a voice-over video this is the A-roll: speak first, measure, then author B-roll that covers",
"every passage. Where a real presenter is the A-roll, do not replace them with this.",
],
+ measure: [
+ "hypit measure",
+ "Measure a script before writing a duration. Pure local work; no Runtime Profile, no request.",
+ "",
+ " hypit measure <source.svml> --segment <id> [--language auto|en|zh|ja|es] [--pace slow|normal|fast | --rate <units/s>]",
+ " [--min <s>] [--max <s>] [--rounding none|round|ceil] [--padding <s>]",
+ " hypit measure --text <text|file> [same options]",
+ "",
+ "Prints the seconds the words take at that delivery, so the author writes them as the literal",
+ "duration on the Seedance take or StillVideo that carries the line.",
+ ],
};
const chosen = topic === undefined ? creationCommands : [topic];
io.write(`${chosen.map((item) => sections[item].join("\n")).join("\n\n")}\n\n`
- + "Each command names the Endpoint and its price page before it runs; the Profile comes from --runtime\n"
- + "or the project's `hypit runtime use` selection.\n");
+ + "observe, transcribe and speak name the Endpoint and its price page before they run; the Profile\n"
+ + "comes from --runtime or the project's `hypit runtime use` selection. measure spends nothing.\n");
}
export async function runCreationCli(argv: readonly string[], io: CliIo, environment: CreationEnvironment = creationEnvironment()): Promise<void> {
@@ -514,5 +611,6 @@ export async function runCreationCli(argv: readonly string[], io: CliIo, environ
if (argv.includes("--help")) { writeCreationHelp(io, command); return; }
if (command === "observe") await observe(argv, io, environment);
else if (command === "transcribe") await transcribe(argv, io, environment);
- else await speak(argv, io, environment);
+ else if (command === "speak") await speak(argv, io, environment);
+ else await measure(argv, io, environment);
}
diff --git a/packages/video-cli/test/creation.test.ts b/packages/video-cli/test/creation.test.ts
index bb376427..84c6b2e0 100644
--- a/packages/video-cli/test/creation.test.ts
+++ b/packages/video-cli/test/creation.test.ts
@@ -138,6 +138,31 @@ test("speak writes the audio and its duration so the author can write a literal"
}
});
+test("measure prints the seconds a line takes so the author can write the literal, without any Profile", async () => {
+ const root = await mkdtemp(join(tmpdir(), "hypit-measure-"));
+ try {
+ const noHost: CreationEnvironment = { cwd: root, openHost: async () => { throw new Error("measure must not open a host"); } };
+ const out = capture();
+ await runCreationCli([
+ "measure", "--text", "Video editing begins with meaning, not a pile of clips on a timeline.",
+ "--language", "en", "--pace", "normal", "--min", "4", "--max", "15", "--rounding", "round", "--json",
+ ], out.io, noHost);
+ const view = JSON.parse(out.text()) as { readonly seconds: number; readonly units: number; readonly language: string };
+ assert.equal(view.units, 20);
+ assert.equal(view.language, "en");
+ assert.equal(view.seconds, 4);
+
+ const human = capture();
+ await runCreationCli(["measure", "--text", "hello world"], human.io, noHost);
+ assert.match(human.text(), /^\d+(\.\d+)?s\n/u);
+ assert.match(human.text(), /duration="/u);
+
+ await assert.rejects(runCreationCli(["measure"], capture().io, noHost), /--text|--segment/u);
+ } finally {
+ await rm(root, { recursive: true, force: true });
+ }
+});
+
test("a Profile that does not serve the capability stops before anything is spent", async () => {
const root = await mkdtemp(join(tmpdir(), "hypit-creation-unserved-"));
try {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 33794a13..7a3095c8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -705,9 +705,6 @@ importers:
'@hypit/elaborator':
specifier: workspace:*
version: link:../elaborator
- '@hypit/estimate':
- specifier: workspace:*
- version: link:../estimate
'@hypit/protocol':
specifier: workspace:*
version: link:../protocol
@@ -924,15 +921,6 @@ importers:
packages/estimate:
dependencies:
- '@hypit/component-kit':
- specifier: workspace:*
- version: link:../component-kit
- '@hypit/elaborator':
- specifier: workspace:*
- version: link:../elaborator
- '@hypit/markup':
- specifier: workspace:*
- version: link:../markup
'@hypit/protocol':
specifier: workspace:*
version: link:../protocol
@@ -1915,9 +1903,6 @@ importers:
'@hypit/driver-node':
specifier: workspace:*
version: link:../driver-node
- '@hypit/estimate':
- specifier: workspace:*
- version: link:../estimate
'@hypit/media':
specifier: workspace:*
version: link:../media
@@ -2425,9 +2410,6 @@ importers:
'@hypit/driver-node':
specifier: workspace:*
version: link:../driver-node
- '@hypit/estimate':
- specifier: workspace:*
- version: link:../estimate
'@hypit/gemini':
specifier: workspace:*
version: link:../gemini
@@ -2827,9 +2809,6 @@ importers:
'@hypit/protocol':
specifier: workspace:*
version: link:../protocol
- '@hypit/speech':
- specifier: workspace:*
- version: link:../speech
'@hypit/text':
specifier: workspace:*
version: link:../text
@@ -2914,6 +2893,9 @@ importers:
'@hypit/speech':
specifier: workspace:*
version: link:../speech
+ '@hypit/svs':
+ specifier: workspace:*
+ version: link:../svs
devDependencies:
'@hypit/script':
specifier: workspace:*
@@ -3397,6 +3379,9 @@ importers:
'@hypit/driver-node':
specifier: workspace:*
version: link:../driver-node
+ '@hypit/estimate':
+ specifier: workspace:*
+ version: link:../estimate
'@hypit/gemini':
specifier: workspace:*
version: link:../gemini
diff --git a/skills/hypit/references/playbooks/craft/generated-dependencies.md b/skills/hypit/references/playbooks/craft/generated-dependencies.md
index 87635b8b..9bf3f524 100644
--- a/skills/hypit/references/playbooks/craft/generated-dependencies.md
+++ b/skills/hypit/references/playbooks/craft/generated-dependencies.md
@@ -270,10 +270,9 @@ Selection and Moment share one name namespace, so the same id cannot be both.
## A short stretch is not a short take
An authored take stays inside the selected model's declared duration range — read the range from the
-model, since it differs between them and a literal in a document goes stale. `estimate:Speech` is a
-separate speech clock and may be shorter than a paid model's minimum: the generation request must use
-the model-valid floor (or a shared longer take), while the SemanticTake remains aligned to the speech
-estimate. Trim or hold the visual material as needed; never pad the SemanticTake or substitute reference
+model, since it differs between them and a literal in a document goes stale. The measured speech
+length (`hypit measure`) may be shorter than a paid model's minimum: write the model-valid floor (or a
+shared longer take) as the literal duration, while the SemanticTake remains aligned to the words. Trim or hold the visual material as needed; never pad the SemanticTake or substitute reference
timings for it.
This too is about a generation that carries no speech. A Segment always has its own speaking take,
diff --git a/skills/hypit/references/playbooks/craft/persona-and-audio.md b/skills/hypit/references/playbooks/craft/persona-and-audio.md
index c2eff968..098c03b8 100644
--- a/skills/hypit/references/playbooks/craft/persona-and-audio.md
+++ b/skills/hypit/references/playbooks/craft/persona-and-audio.md
@@ -35,8 +35,9 @@ Connect only the references a component actually needs.
- The speaking take generates the speech, so a Segment is exactly as long as the take that speaks it.
There is no second duration to reconcile.
-- Use `estimate:Speech` only to size a generation before it is ordered. Final caption and semantic
- timing comes from each accepted normalized Take through `whisperx:SemanticTake`.
+- Use `hypit measure` only to size a generation before it is ordered, and write the result as the
+ literal duration. Final caption and semantic timing comes from each accepted normalized Take
+ through `whisperx:SemanticTake`.
- One continuous voiceover may cover several independently selected visual inserts. Do not cut the
Script merely because the picture cuts — the inserts are Selections inside the Segment.
- Preserve Script Segment order when assembling `speech:Take` children.
diff --git a/skills/hypit/references/playbooks/craft/seedance-directing.md b/skills/hypit/references/playbooks/craft/seedance-directing.md
index 13f0a393..0543afa5 100644
--- a/skills/hypit/references/playbooks/craft/seedance-directing.md
+++ b/skills/hypit/references/playbooks/craft/seedance-directing.md
@@ -65,8 +65,8 @@ than relying on an unstated assumption.
`mini`, `fast` and `standard` take at most 9 images, 3 videos, 3 audio clips and 12 files in total,
and their reference audio requires at least one visual reference; `2.5` takes more of each and
imposes neither of those two constraints.
-- Use `estimate:Speech` for speech-driven duration planning; it estimates pronunciation length but
- does not create measured timing.
+- Use `hypit measure` for speech-driven duration planning and write the seconds as the literal
+ `duration`; it estimates pronunciation length but does not create measured timing.
## Direct the shot
diff --git a/skills/hypit/references/playbooks/formats/talking-head.md b/skills/hypit/references/playbooks/formats/talking-head.md
index fbac77d5..0a99237e 100644
--- a/skills/hypit/references/playbooks/formats/talking-head.md
+++ b/skills/hypit/references/playbooks/formats/talking-head.md
@@ -8,7 +8,7 @@ captions, B-roll, and editorial typography as peer Tracks.
1. Write one Script with a strong opening Segment and 2–3 following Segments for context, evidence,
mechanism, payoff, or CTA. Keep each generated speaking take inside the selected model's declared range; 8–12 seconds is
a useful target when the delivery remains natural.
-2. Run `estimate:Speech` for each Segment before generation.
+2. Run `hypit measure` for each Segment before generation and write the literal durations.
3. Vendor `speaker-v1.svs`. Put stable `composition-stability`, `camera-motion`, `edit-rhythm`,
`performance`, and `gesture` choices in an SVS Recipe.
4. Render each take prompt with `copy:Render`; connect the Segment dialogue and one short English
diff --git a/skills/hypit/references/quickstart.md b/skills/hypit/references/quickstart.md
index 93289eb2..16f426b6 100644
--- a/skills/hypit/references/quickstart.md
+++ b/skills/hypit/references/quickstart.md
@@ -16,7 +16,7 @@ directory and it is not the author project:
Canonical path:
-`Script → estimate:Speech/text → generated or supplied media → normalization → SemanticTake → speech:Track → peer visual/audio Tracks → Film → render:Video`.
+`Script → hypit measure → literal durations on generated or supplied media → normalization → SemanticTake → speech:Track → peer visual/audio Tracks → Film → render:Video`.
Preview uses the same Graph with local mock media and estimate timing. It never edits Author Source and
never submits paid generation.
diff --git a/skills/hypit/references/reconstruction/comparison-round.md b/skills/hypit/references/reconstruction/comparison-round.md
index a73c83ce..06c7d5c5 100644
--- a/skills/hypit/references/reconstruction/comparison-round.md
+++ b/skills/hypit/references/reconstruction/comparison-round.md
@@ -30,7 +30,7 @@ source edge is edited.
## The render uses estimate timing
-`render_element` uses `@hypit/preview-mock` with the Source's `estimate:Speech` timing. `--reference-id`
+`render_element` uses `@hypit/preview-mock` with the Source's literal durations. `--reference-id`
is reserved for selecting reference evidence and comparison windows, not for constructing mock tracks.
The comparison still cuts both sides to the same words and refuses a pair whose two halves are different
lengths. Animated elements are assessed against the deterministic estimate clock used by preview. The
diff --git a/skills/hypit/references/reconstruction/evidence.md b/skills/hypit/references/reconstruction/evidence.md
index 42015fb1..1799bc0c 100644
--- a/skills/hypit/references/reconstruction/evidence.md
+++ b/skills/hypit/references/reconstruction/evidence.md
@@ -48,8 +48,8 @@ reaches an observer, and it does not go in the observation cache. It is identica
and on the `agent` observer it is the only exact record of the sound. Read it whenever a decision
depends on when a word is said — placing an on-screen text reveal against the line that triggers it,
timing a caption, checking that a voice observation matches what was spoken, or judging a Segment's
-natural boundary. It does not set a take's duration: the take is generated and its length comes from
-`estimate:Speech`, as `../script-time.md` requires. Do not run WhisperX by hand and do not ask a model
+natural boundary. It does not set a take's duration: the take is generated and its length is the
+literal the author measured with `hypit measure`, as `../script-time.md` requires. Do not run WhisperX by hand and do not ask a model
to transcribe.
`transcript` reports `status`, `transcript_ref` and `word_count`. Read the words from
diff --git a/skills/hypit/references/reconstruction/final-sources.md b/skills/hypit/references/reconstruction/final-sources.md
index a0ef083d..0d0cc5c3 100644
--- a/skills/hypit/references/reconstruction/final-sources.md
+++ b/skills/hypit/references/reconstruction/final-sources.md
@@ -23,8 +23,8 @@ semantic evidence; return to a narrow `observe_reference` question when necessar
## Where the Segments fall, and how long each take runs
`../script-time.md` decides both, and it decides them the same way for any program: a Segment is a
-stretch that is spoken as one, the seam goes at a sentence end, and each take's duration comes from
-`estimate:Speech` rather than from any clock.
+stretch that is spoken as one, the seam goes at a sentence end, and each take's duration is the
+literal the author measured with `hypit measure`, not a value read from any clock.
The reference adds one thing to that, and it is a warning rather than a rule. The generated speech
plays at its own pace, not the reference's: its measured word timings describe how the original
diff --git a/skills/hypit/references/reconstruction/observers.md b/skills/hypit/references/reconstruction/observers.md
index 4e40f37b..753fb27d 100644
--- a/skills/hypit/references/reconstruction/observers.md
+++ b/skills/hypit/references/reconstruction/observers.md
@@ -115,7 +115,7 @@ and do not put the gap to the author.
- **The transcript says when.** WhisperX measures every word locally on both paths, so the words and
their timings are exact whichever observer reads the pictures. That settles whether anyone is
speaking at a given moment, and where a word sits. It does not set a take's duration: the take is
- generated and its length comes from `estimate:Speech`, as `../script-time.md` requires.
+ generated and its length is the literal the author measured, as `../script-time.md` requires.
- **The pictures say who.** Attribute speech to the person the frames show speaking during the words
the transcript places there. A task that needs sound says so in its own prompt and asks for exactly
this reading.
diff --git a/skills/hypit/references/runtime.md b/skills/hypit/references/runtime.md
index e2d1b929..23c80bf4 100644
--- a/skills/hypit/references/runtime.md
+++ b/skills/hypit/references/runtime.md
@@ -102,10 +102,9 @@ Studio viewing.
Use `check` during authoring. `plan` works without a Runtime as a graph-only operation; with the
project's selected Runtime it performs a cheap, read-only preflight over only unsatisfied Needs and
returns non-zero when that slice is not ready. It never installs, starts or contacts a remote Store.
-`hypit check <run> --json` and `hypit plan <run> --json` expose Provider-free `estimate:Speech`
-values under `deterministic_durations`; after execution, `hypit inspect <build> --json` reports the
-accepted `SpeechDuration` Records. Read those seconds directly when reviewing generated take length
-or cost instead of probing a mock media file.
+Every take's duration is a literal in the Source, measured beforehand with `hypit measure`; read it
+there when reviewing generated take length or cost. After execution, `hypit inspect <build> --json`
+reports the accepted Records. Never probe a mock media file for a duration.
After Runtime package selection changes, run `runtime up`: this is the explicit provisioning
boundary for machine npm dependencies, Managed Programs and the detached Worker. Use `doctor` for
diff --git a/skills/hypit/references/script-time.md b/skills/hypit/references/script-time.md
index 9eb98a6e..0dac5392 100644
--- a/skills/hypit/references/script-time.md
+++ b/skills/hypit/references/script-time.md
@@ -38,16 +38,16 @@ Put it where the speaker would draw breath: at a sentence end, never mid-clause.
## A take's duration is estimated
-Every take is generated, and the generated speech plays at its own pace. So each take's duration comes
-from `estimate:Speech` — the prediction of how long the generated line will be. Write that estimate on
-the take.
+Every take is generated, and the generated speech plays at its own pace. So each take's duration is
+the author's prediction of how long the generated line will be: measure the Segment with
+`hypit measure <source> --segment NAME` before writing the Source, and write the seconds as the
+literal `duration` on the take.
Nothing depends on the estimate being exact. Script Selections bind every placed element to the
words, and the SemanticTrack places the words where the generated audio actually has them, so a
-take that comes back a little long or short moves the words, not the bindings. This is also what
-lets a program survive the author changing the lines: the estimate recomputes from the new
-words. `estimate:Speech` takes `story.segment.NAME.speech`, so the duration follows the script it is
-asked to predict.
+take that comes back a little long or short moves the words, not the bindings. When the author
+changes the lines, measure again and write the new number; the duration is a decision in the Source,
+not a value the graph recomputes.
## Bind covering content to the words, not to a frame