From 30cbaeb8f66d523f8f861df9ca769a79ad0ec48a Mon Sep 17 00:00:00 2001 From: Z User Date: Fri, 30 Oct 2026 19:28:36 +0000 Subject: [PATCH] Switch plan.json output to the native H3 ref2va prompt format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each scene prompt is now the six native reference sections — subject_definitions / summary [reference generation] / retention_analysis / detailed_description (1-2 style sentences then [Shot 1]) / overall_soundscape / non_diegetic_music — one line per element, headers on their own line. The full head-to-toe look (nude-not-bare) lives in subject_definitions and is restated compressed in the [Shot 1] body; both cast members are defined per scene against the wired subject references. verify_plan_rules.py auto-detects the format per shot and validates the ref2va contract (canonical order, directive, definitions, retention, style prefix, thin floor), so legacy t2va plans keep passing. Both system prompts, the assembler prompt and SKILL.md carry the new skeleton, worked examples and self-checks; example_output/README.md marks the old run as the t2va craft reference. --- example_output/README.md | 8 + h3-plan-gate/SKILL.md | 41 +- .../h3_plan_assembler_system_prompt.md | 20 +- h3-plan-gate/h3_plan_json_system_prompt.md | 288 +++++++----- h3-plan-gate/h3_scene_agent_system_prompt.md | 179 ++++--- h3-plan-gate/verify_plan_rules.py | 443 +++++++++++++++--- 6 files changed, 714 insertions(+), 265 deletions(-) mode change 100644 => 100755 example_output/README.md diff --git a/example_output/README.md b/example_output/README.md old mode 100644 new mode 100755 index e99549f..6a79782 --- a/example_output/README.md +++ b/example_output/README.md @@ -4,6 +4,14 @@ A complete reference run of the `h3-plan-gate` agent workflow (Step 1 through St on a 12-shot story — also a worked demonstration that the workflow scales past the 3-scene example in `h3_agent_workflow_examples/` to 10+ scenes with no code changes. +> **Format note:** this run was written in the legacy **t2va** three-line prompt format +> (`integrated_multimodal_description` / `overall_soundscape` / `non_diegetic_music`). +> The skill has since switched to the native H3 **ref2va** full-reference format +> (`subject_definitions` / `summary` / `retention_analysis` / `detailed_description` / +> `overall_soundscape` / `non_diegetic_music`, `summary: [reference generation]`). The +> validator auto-detects the format per shot, so this run still passes unchanged; use +> it as a craft reference, not a format reference. + ## Input > story: in a functional universe there is a new way of handling criminals when found diff --git a/h3-plan-gate/SKILL.md b/h3-plan-gate/SKILL.md index e35d889..fc065e2 100755 --- a/h3-plan-gate/SKILL.md +++ b/h3-plan-gate/SKILL.md @@ -107,9 +107,19 @@ Each fragment is exactly this shape: "id": "from the outline row", "duration_seconds": 15, "prompt": [ - "integrated_multimodal_description: [Shot 1] ...", - "overall_soundscape: ...", - "non_diegetic_music: N/A" + "subject_definitions:", + " is ...full head-to-toe look, nude for uncovered skin...", + "summary:", + "[reference generation]", + "retention_analysis:", + ": fully_preserved", + "detailed_description:", + "...1-2 style sentences from the guide's style...", + "[Shot 1] ...the full scene composition...", + "overall_soundscape:", + "...the sound the scene itself makes...", + "non_diegetic_music:", + "N/A" ], "_handoff": { "end_state": "...", "soundscape": "...", "dialogue_used": [] } } @@ -150,15 +160,18 @@ and sampler latent or the video can come out square. - Raw JSON only: first char `{`, last char `}`, no markdown fences, no prose, double quotes, no trailing commas, no raw line break inside a string. -- The `prompt` array has EXACTLY three lines in this order; every scene is its own single - H3 generation, so the bracket number is always `[Shot 1]`: - `integrated_multimodal_description:` / `overall_soundscape:` / `non_diegetic_music:`. -- The description line is self-sufficient: re-state `` and the full look in - EVERY scene — identity, hair, build, every garment head to toe, footwear, and the - visual style — nothing is shared between scenes or from a prefix. Name every body - part the clothing leaves uncovered and call uncovered skin "nude", never "bare" +- The `prompt` array carries the six native H3 ref2va sections in canonical order — + `subject_definitions:` / `summary:` / `retention_analysis:` / `detailed_description:` / + `overall_soundscape:` / `non_diegetic_music:` — one line per element, headers on their + own line; `summary` is exactly `[reference generation]`; every scene is its own single + H3 generation, so the bracket number is always `[Shot 1]`. +- The full look is re-stated in EVERY scene — subject_definitions carries it complete + (identity, hair, build, every garment head to toe, footwear), and the [Shot 1] body + opens by re-stating `` with a wardrobe+skin restatement — nothing is + shared between scenes or from a prefix. Name every body part the clothing leaves + uncovered and call uncovered skin "nude", never "bare" ("a man wearing a white tank-top with nude arms"). -- Scene composition, not word count: the description line must carry every element — +- Scene composition, not word count: the [Shot 1] body must carry every element — subject anchor (`` and wardrobe restated), style anchor, continuity anchor (opens inside the previous end_state), blocking, one camera idea, performance beats, physical texture (wardrobe behavior, weather on skin and fabric, lighting), and a @@ -202,12 +215,12 @@ and sampler latent or the video can come out square. are dialogue and never live in the soundscape line. - Dialogue: silence is the default. Spoken words come only from the outline row or the story, reproduced word for word inside case-sensitive `[English] words` (one space - after the marker; other real languages allowed), inside the description line only, with + after the marker; other real languages allowed), inside the [Shot 1] body only, with a "silently with mouth {position}" cue before and after every span. Mirror each span in `_handoff.dialogue_used` (words only, no marker); empty array when silent. - `_handoff` must be truthful: `end_state` describes the real final frame (2–3 sentences: - pose, motion in progress, camera state); `soundscape` copies the overall_soundscape line - character for character. + pose, motion in progress, camera state); `soundscape` copies the soundscape content + line (the element after the `overall_soundscape:` header) character for character. - Keys are exactly `id`, `duration_seconds`, `prompt`, `_handoff`; add `steps` or `seed` only when the user explicitly asked. Every duration 2–15 s. diff --git a/h3-plan-gate/h3_plan_assembler_system_prompt.md b/h3-plan-gate/h3_plan_assembler_system_prompt.md index aef15e4..3209184 100755 --- a/h3-plan-gate/h3_plan_assembler_system_prompt.md +++ b/h3-plan-gate/h3_plan_assembler_system_prompt.md @@ -43,10 +43,10 @@ Emit exactly this shape and no other keys: "defaults": { "duration_seconds": 10, "steps": 20 }, "shots": [ { "id": "scene_one_name", - "prompt": ["...the fragment's three prompt lines..."], + "prompt": ["...the fragment's prompt lines, copied exactly..."], "duration_seconds": 10 }, { "id": "scene_two_name", - "prompt": ["...the fragment's three prompt lines..."], + "prompt": ["...the fragment's prompt lines, copied exactly..."], "duration_seconds": 10 } ] } @@ -64,22 +64,23 @@ Emit exactly this shape and no other keys: - Copy any extra "steps" or "seed" keys a fragment carries, unchanged. - If any fragment is broken JSON, stop and reply exactly: BROKEN FRAGMENT -# WORKED EXAMPLE (shape only — real fragments carry full 200-word description lines) +# WORKED EXAMPLE (shape only — real fragments carry full ref2va sections and +# 200-word description bodies) Input: DEFAULTS: {"duration_seconds": 8, "steps": 20} SCENE 1 - {"id": "corridor_walk", "duration_seconds": 8, "prompt": ["integrated_multimodal_description: [Shot 1] , the night nurse in pale green scrubs, pushes the trolley down the corridor.", "overall_soundscape: low fluorescent hum, a distant trolley wheel squeak.", "non_diegetic_music: N/A"], "_handoff": {"end_state": "She is mid-stride at the far end.", "soundscape": "overall_soundscape: low fluorescent hum, a distant trolley wheel squeak.", "dialogue_used": []}} + {"id": "corridor_walk", "duration_seconds": 8, "prompt": ["subject_definitions:", " is a night nurse in pale green scrubs and white sneakers, with nude hands below the scrub cuffs.", "summary:", "[reference generation]", "retention_analysis:", ": fully_preserved", "detailed_description:", "Photorealistic cool fluorescent lighting, soft clinical palette.", "[Shot 1] , the night nurse in pale green scrubs, pushes the trolley down the corridor.", "overall_soundscape:", "low fluorescent hum, a distant trolley wheel squeak.", "non_diegetic_music:", "N/A"], "_handoff": {"end_state": "She is mid-stride at the far end.", "soundscape": "low fluorescent hum, a distant trolley wheel squeak.", "dialogue_used": []}} SCENE 2 - {"id": "door_stop", "duration_seconds": 8, "prompt": ["integrated_multimodal_description: [Shot 1] Continue the same walk as , the same night nurse in pale green scrubs, stops the trolley at the blue door.", "overall_soundscape: the same fluorescent hum continues, the trolley wheel falls silent.", "non_diegetic_music: N/A"], "_handoff": {"end_state": "Her hand rests on the push bar.", "soundscape": "overall_soundscape: the same fluorescent hum continues, the trolley wheel falls silent.", "dialogue_used": []}} + {"id": "door_stop", "duration_seconds": 8, "prompt": ["subject_definitions:", " is a night nurse in pale green scrubs and white sneakers, with nude hands below the scrub cuffs.", "summary:", "[reference generation]", "retention_analysis:", ": fully_preserved", "detailed_description:", "Photorealistic cool fluorescent lighting, soft clinical palette.", "[Shot 1] Continue the same walk as , the same night nurse in pale green scrubs, stops the trolley at the blue door.", "overall_soundscape:", "the same fluorescent hum continues, the trolley wheel falls silent.", "non_diegetic_music:", "N/A"], "_handoff": {"end_state": "Her hand rests on the push bar.", "soundscape": "the same fluorescent hum continues, the trolley wheel falls silent.", "dialogue_used": []}} Correct reply: {"prompt_prefix": [""], "defaults": {"duration_seconds": 8, "steps": 20}, "shots": [ - {"id": "corridor_walk", "prompt": ["integrated_multimodal_description: [Shot 1] , the night nurse in pale green scrubs, pushes the trolley down the corridor.", "overall_soundscape: low fluorescent hum, a distant trolley wheel squeak.", "non_diegetic_music: N/A"], "duration_seconds": 8}, - {"id": "door_stop", "prompt": ["integrated_multimodal_description: [Shot 1] Continue the same walk as , the same night nurse in pale green scrubs, stops the trolley at the blue door.", "overall_soundscape: the same fluorescent hum continues, the trolley wheel falls silent.", "non_diegetic_music: N/A"], "duration_seconds": 8} + {"id": "corridor_walk", "prompt": ["subject_definitions:", " is a night nurse in pale green scrubs and white sneakers, with nude hands below the scrub cuffs.", "summary:", "[reference generation]", "retention_analysis:", ": fully_preserved", "detailed_description:", "Photorealistic cool fluorescent lighting, soft clinical palette.", "[Shot 1] , the night nurse in pale green scrubs, pushes the trolley down the corridor.", "overall_soundscape:", "low fluorescent hum, a distant trolley wheel squeak.", "non_diegetic_music:", "N/A"], "duration_seconds": 8}, + {"id": "door_stop", "prompt": ["subject_definitions:", " is a night nurse in pale green scrubs and white sneakers, with nude hands below the scrub cuffs.", "summary:", "[reference generation]", "retention_analysis:", ": fully_preserved", "detailed_description:", "Photorealistic cool fluorescent lighting, soft clinical palette.", "[Shot 1] Continue the same walk as , the same night nurse in pale green scrubs, stops the trolley at the blue door.", "overall_soundscape:", "the same fluorescent hum continues, the trolley wheel falls silent.", "non_diegetic_music:", "N/A"], "duration_seconds": 8} ]} Note what the example shows: the "_handoff" objects vanished, every prompt string is @@ -105,8 +106,9 @@ DEFAULTS block. `plan_json_input` (a non-empty connected value overrides the visual editor's plan for that execution and receives the identical validation). - **QA after assembly:** `python scripts/verify_plan_rules.py plan plan.json` re-runs the - node-rule replica plus the H3 three-line / word-budget / handoff-free checks on the - final file. The deterministic merger runs all of this automatically. + node-rule replica plus the H3 ref2va six-section (or legacy t2va three-line, detected + per shot) / word-budget / handoff-free checks on the final file. The deterministic + merger runs all of this automatically. - **Token footprint (measured, o200k proxy):** the prompt is ~1.2k tokens; input is roughly the sum of all fragments (~0.5k per scene); output is nearly the same size again. A 12-scene assembly turn is ~12k tokens — fine at 128k ctx; if you ever run diff --git a/h3-plan-gate/h3_plan_json_system_prompt.md b/h3-plan-gate/h3_plan_json_system_prompt.md index 710fdc4..7a8bd8b 100755 --- a/h3-plan-gate/h3_plan_json_system_prompt.md +++ b/h3-plan-gate/h3_plan_json_system_prompt.md @@ -50,13 +50,23 @@ Emit exactly this shape and no other keys: "shots": [ { "id": "scene_one", "prompt": [ - "integrated_multimodal_description: [Shot 1] ...", - "overall_soundscape: ...", - "non_diegetic_music: N/A" + "subject_definitions:", + " is ...full head-to-toe look, nude for uncovered skin...", + "summary:", + "[reference generation]", + "retention_analysis:", + ": fully_preserved", + "detailed_description:", + "<1-2 style sentences from the story's look>", + "[Shot 1] ...the full scene composition...", + "overall_soundscape:", + "...the sound the scene itself makes...", + "non_diegetic_music:", + "N/A" ], "duration_seconds": 10 }, { "id": "scene_two", - "prompt": [ "...the same three AUDIO lines with this scene's content..." ], + "prompt": [ "...the same ref2va sections with this scene's content..." ], "duration_seconds": 10 } ] } @@ -64,7 +74,8 @@ Emit exactly this shape and no other keys: # TOP-LEVEL FIELDS - "prompt_prefix": always exactly [""] — one empty string, nothing else. Subject identity, wardrobe, art style, camera style, and continuity rules belong inside every scene's - integrated_multimodal_description line instead, so each scene is self-sufficient. + subject_definitions and detailed_description sections instead, so each scene is + self-sufficient. - "defaults": object with exactly two keys: "duration_seconds" (positive number) and "steps" (integer). Use 10 and 20 unless the user says otherwise. - "shots": array of shot objects in story order. Usually 3 to 12 shots. If the user names a @@ -74,7 +85,8 @@ Emit exactly this shape and no other keys: Each shot object has exactly these keys: - "id": unique short snake_case name. Lowercase letters, digits, underscores only. Every id must be different. Example: "kitchen_argument". -- "prompt": array of exactly three strings in the AUDIO order given below. Never empty. +- "prompt": array of strings in the REF2VA PROMPT order given below — one line per + element, section headers on their own line. Never empty. - "duration_seconds": positive number between 2 and 15. Omit it to inherit the default. Only when the user explicitly asks, a shot may also include: - "steps": integer from 1 to 10000. @@ -112,21 +124,24 @@ Shots are flat. A shot never contains a nested object. # PROMPT CRAFT - "prompt_prefix" stays empty, exactly [""]. Never put identity, wardrobe, style, or - continuity text in it. Every scene's integrated_multimodal_description line must be - self-sufficient: introduce or re-state the tag, wardrobe, look, and visual - style in every scene, because nothing is shared from a prefix. -- The integrated_multimodal_description line of every scene must: + continuity text in it. Every scene's prompt must be self-sufficient: + subject_definitions carries the full look and the [Shot 1] body re-states the + tag, wardrobe, and look in every scene, because nothing is shared from + a prefix or between scenes. +- The [Shot 1] body of every scene's detailed_description must: 1. Continue the exact action, pose, camera direction, and lighting from the previous - scene's description line. Scene 1 instead sets the opening. + scene's [Shot 1] body. Scene 1 instead sets the opening. 2. Describe this scene's new action concretely: blocking, camera move, emotion, physics. 3. End mid-action or on a movement still in progress so the next scene can continue it. Only the final scene may resolve and come to rest. - Compose every scene from the same eight elements, and never chase a word count — chase the elements. A description that genuinely carries them comes out long enough on its own; padding to a number is as much a failure as a thin one-liner: - 1. SUBJECT ANCHOR — restated: identity, every aspect of how they look, - wardrobe head to toe, hair, build — naming every body part the clothing leaves - uncovered, using "nude" for uncovered skin (PROMPT CRAFT). + 1. SUBJECT ANCHOR — the full look lives in subject_definitions (REF2VA PROMPT + below): identity, every aspect of how they look, wardrobe head to toe, hair, + build — naming every body part the clothing leaves uncovered with "nude" + (PROMPT CRAFT). The [Shot 1] body then opens by re-stating with a + compressed wardrobe+skin restatement. 2. STYLE ANCHOR — the one consistent look: medium, lighting quality, palette. 3. CONTINUITY ANCHOR — open inside the previous scene's end state (scene 1 sets the opening) and name what carries over: the stride, the camera direction, the light, @@ -190,40 +205,60 @@ Shots are flat. A shot never contains a nested object. fades until only the doorway lamp lights the room". A summarized change or movement is a gap H3 fills by guessing, and guessed motion drifts off intent. - Describe the complete look in every scene: every aspect of how the person looks — - face, hair, build, each garment head to toe, footwear — because nothing carries - over between scenes. Any body part the clothing leaves uncovered must be named and - called "nude", never "bare": not "a man wearing a white tank-top" but "a man - wearing a white tank-top with nude arms"; likewise nude legs under shorts, nude - shoulders under a sleeveless top, nude feet in sandals. "Nude" is the reliable + face, hair, build, each garment head to toe, footwear — goes in the + subject_definitions section, because nothing carries over between scenes. Any body + part the clothing leaves uncovered must be named and called "nude", never "bare": + not "a man wearing a white tank-top" but "a man wearing a white tank-top with nude + arms"; likewise nude legs under shorts, nude shoulders under a sleeveless top, nude + feet in sandals. The [Shot 1] body opens by re-stating with the same + wardrobe+skin wording compressed into its first sentence. "Nude" is the reliable skin-state word for uncovered body parts; "bare" is not. -- One string per line in the prompt array. A shot's array holds exactly the three AUDIO - lines below; never add blank entries, extra prose lines, or a second section label. +- One line per element in the prompt array. A shot's array holds exactly the six ref2va + sections below; never add blank entries, extra prose lines, or a second section header. - Useful continuity phrases: "Continue the same stride", "without resetting the motion", "keep the incoming camera direction", "same lighting", "no cut". -- Only mention reference tags like ,