Skip to content

gooseworks-ai/goose-skills / skills/video/render-street-interview

render-street-interview

Verified

Write a street-interview ad from a complete inspected commercial interaction and current brand facts. Render product guessing, or prepare mic-only, prepared-sample or visible-task conversation script/prompt previews. Premise, actions and ad connection vary; capture rules stay fixed. Conversation media delivery is unverified.

FileKindSize
REFERENCE.mdmarkdown7.4 KB
SKILL.mdskill md16.7 KB
TAKES.mdmarkdown1.5 KB
brands/demo-tallgrass-oat.jsonconfig3.9 KB
brands/fizzroot-ep3-a.jsonconfig2.2 KB
brands/fizzroot-ep3-b.jsonconfig2.6 KB
brands/fizzroot-ep3-c.jsonconfig2.3 KB
brands/grimwater.jsonconfig4.6 KB
brands/oleara-ep1-a2.jsonconfig2.5 KB
brands/oleara-ep1-b.jsonconfig2.7 KB
brands/oleara-ep1-c.jsonconfig2.5 KB
episodes/fizzroot-ep3.jsonconfig1009 B
episodes/oleara-ep1.jsonconfig784 B
references/cast-writing.mdmarkdown9.6 KB
references/h3-generation.mdmarkdown2.2 KB
references/model-behaviors.mdmarkdown5.0 KB
references/reference-format-rules.mdmarkdown7.5 KB
references/reference-ledger-items-01-23.mdmarkdown15.6 KB
references/reference-ledger-items-17-28.mdmarkdown13.2 KB
references/reference-ledger-items-29-42.mdmarkdown14.3 KB
references/reference-pipeline.mdmarkdown7.3 KB
references/street-reference-library.jsonconfig6.6 KB
references/street-script-writing.mdmarkdown16.7 KB
scripts/bench.pyscript18.2 KB
scripts/brandkit.pyscript19.3 KB
scripts/build.pyscript8.0 KB
scripts/build_episode.pyscript77.5 KB
scripts/build_looks.pyscript32.2 KB
scripts/check-cut.pyscript66.3 KB
scripts/conversation.pyscript12.8 KB
scripts/edit_timeline.pyscript7.6 KB
scripts/falsify-all.pyscript19.8 KB
scripts/fit_grade.pyscript7.7 KB
scripts/format_spec.pyscript93.2 KB
scripts/measure-pace.pyscript2.8 KB
scripts/media_proxy.pyscript56.8 KB
scripts/paths.pyscript3.0 KB
scripts/phone_look_video.pyscript7.2 KB
scripts/prepare_script_context.pyscript12.0 KB
scripts/recut.pyscript26.5 KB
scripts/selftest.pyscript23.5 KB
scripts/single_gen.pyscript24.9 KB
scripts/variants_gen.pyscript14.0 KB
skill.meta.jsonconfig656 B
tests/READINESS.mdmarkdown13.3 KB
tests/fixtures/brands/grimwater-4816.jsonconfig4.6 KB
tests/fixtures/brands/grimwater-4817.jsonconfig2.3 KB
tests/fixtures/brands/grimwater-4818.jsonconfig2.6 KB
tests/fixtures/brands/grimwater-4819.jsonconfig2.1 KB
tests/fixtures/brands/grimwater-4820.jsonconfig2.8 KB
tests/fixtures/brands/grimwater-4821.jsonconfig2.8 KB
tests/fixtures/brands/grimwater-4822.jsonconfig2.5 KB
tests/fixtures/brands/grimwater-4823.jsonconfig2.3 KB
tests/fixtures/brands/grimwater-4824.jsonconfig4.1 KB
tests/fixtures/brands/grimwater-4827.jsonconfig4.6 KB
tests/fixtures/brands/grimwater-4828.jsonconfig4.3 KB
tests/fixtures/brands/grimwater-4829.jsonconfig3.8 KB
tests/fixtures/brands/grimwater-4830.jsonconfig3.9 KB
tests/fixtures/brands/grimwater-4831.jsonconfig4.2 KB
tests/fixtures/brands/grimwater-4832.jsonconfig3.5 KB
tests/fixtures/brands/grimwater-4833.jsonconfig3.7 KB
tests/fixtures/brands/grimwater-4834.jsonconfig3.9 KB
tests/fixtures/brands/grimwater-4835.jsonconfig3.9 KB
tests/fixtures/episodes/grimwater-ep1.jsonconfig2.2 KB
tests/fixtures/episodes/grimwater-ep2.jsonconfig2.2 KB
tests/fixtures/episodes/grimwater-ep2fix-v2.jsonconfig4.9 KB
tests/fixtures/episodes/grimwater-ep2fix-v3.jsonconfig5.7 KB
tests/fixtures/episodes/grimwater-ep2fix.jsonconfig3.7 KB
tests/fixtures/episodes/grimwater-ep3.jsonconfig2.5 KB
tests/fixtures/episodes/grimwater-ep3b.jsonconfig2.3 KB
tests/fixtures/episodes/grimwater-ep3c.jsonconfig2.3 KB
tests/fixtures/episodes/grimwater-ep4.jsonconfig3.7 KB
tests/fixtures/prompt-snapshots.jsonconfig20.3 KB
tests/smoke-test.mdmarkdown627 B
tests/test_cast_advice.pyscript3.6 KB
tests/test_conversation.pyscript20.5 KB
tests/test_edit_timeline.pyscript8.6 KB
tests/test_finishing.pyscript10.9 KB
tests/test_h3_provider_route.pyscript9.2 KB
tests/test_opt_in_hold_grammar.pyscript4.7 KB
tests/test_prompt_budget.pyscript10.5 KB
tests/test_recut_media.pyscript6.2 KB
tests/test_selector_route.pyscript8.7 KB
tests/test_single_gen_rejection.pyscript7.6 KB
tests/test_skin_and_voice_options.pyscript4.1 KB

tests/test_edit_timeline.py

View on GitHub
import json
from pathlib import Path
import sys
import tempfile
import unittest
import subprocess
from unittest.mock import patch

sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
import edit_timeline
import build_looks


class EditTimelineTests(unittest.TestCase):
    def setUp(self):
        self.tmp = tempfile.TemporaryDirectory(prefix="recut path spaces ")
        self.root = Path(self.tmp.name).resolve()
        self.map = {
            "source": str(self.root / "original take.mp4"),
            "output": str(self.root / "recut take.mp4"),
            "source_duration": 4.0,
            "output_duration": 3.0,
            "segments": [
                {"src_start": 2, "src_end": 3, "out_start": 0, "out_end": 1},
                {"src_start": 0, "src_end": 1, "out_start": 1, "out_end": 2},
                {"src_start": 2, "src_end": 3, "out_start": 2, "out_end": 3},
            ],
        }
        self.rows = [(0.1, 0.7, "ALPHA", "answer", "", "Alpha."),
                     (2.1, 2.7, "BETA", "payoff", "", "Beta."),
                     (3.1, 3.7, "GAMMA", "answer", "", "Gamma.")]
        self.words = [(0.2, 0.4, "Alpha."), (2.2, 2.4, "Beta."), (3.2, 3.4, "Gamma.")]

    def tearDown(self):
        self.tmp.cleanup()

    def test_moved_repeated_dropped_words_follow_output_order(self):
        rows = edit_timeline.captions_after_edit(self.rows, self.map, self.words)
        self.assertEqual([row[2] for row in rows], ["BETA", "ALPHA", "BETA"])
        for row, start in zip(rows, [0.2, 1.2, 2.2]):
            self.assertAlmostEqual(row[0], start)
        self.assertTrue(all(row[1] <= self.map["output_duration"] for row in rows))

    def test_partial_line_keeps_only_whole_audible_words(self):
        plan = {**self.map, "source_duration": 2, "output_duration": 1,
                "segments": [{"src_start": 1, "src_end": 2, "out_start": 0, "out_end": 1}]}
        words = [(0.2, 0.4, "Alpha"), (1.2, 1.5, "ending.")]
        rows = edit_timeline.captions_after_edit([(0, 2, "ALPHA ENDING", "answer", "", "Alpha ending.")], plan, words)
        self.assertEqual(rows[0][2], "ENDING.")
        self.assertEqual(rows[0][5], "ending.")
        self.assertAlmostEqual(rows[0][0], 0.2)
        self.assertGreaterEqual(rows[0][1], 0.5)

    def test_spoken_boundary_word_stops_even_when_title_is_not_literal(self):
        plan = {**self.map, "source_duration": 2, "output_duration": 1,
                "segments": [{"src_start": 0, "src_end": 1, "out_start": 0, "out_end": 1}]}
        with self.assertRaisesRegex(ValueError, "cuts spoken word"):
            edit_timeline.captions_after_edit([(0, 2, "TITLE", "title", "", "Title")], plan,
                                              [(0.8, 1.2, "ending")])

    def test_partial_spoken_span_without_word_times_cannot_copy_full_sentence(self):
        with self.assertRaisesRegex(ValueError, "measured original word timings"):
            edit_timeline.captions_after_edit([(0, 2, "ALPHA ENDING", "answer", "", "Alpha ending.")], self.map)

    def test_missing_source_measurement_cannot_silently_drop_a_kept_caption(self):
        with self.assertRaisesRegex(ValueError, "no measured words"):
            edit_timeline.captions_after_edit(self.rows, self.map, [(3.2, 3.4, "Gamma.")])

    def test_missing_local_transcription_has_no_original_time_fallback(self):
        import brandkit
        with patch.dict(sys.modules, {"whisper": None}):
            with self.assertRaisesRegex(SystemExit, "whisper is not installed"):
                edit_timeline.measure_words(self.root / "source.mp4", brandkit.load("demo-tallgrass-oat"))

    def test_real_entry_flags_reject_conflicting_or_unbound_finishing_modes(self):
        scripts = Path(__file__).resolve().parents[1] / "scripts"
        for filename, args in [("build_looks.py", ["--pregraded"]),
                               ("build_looks.py", ["--word-times", "words.json"]),
                               ("check-cut.py", ["--word-times", "words.json"]),
                               ("check-cut.py", ["--episode", "episode.json", "--edit-map", "map.json"])]:
            result = subprocess.run([sys.executable, str(scripts / filename), *args],
                                    capture_output=True, text=True, cwd=self.root)
            self.assertEqual(result.returncode, 2, result.stderr)
            self.assertTrue("requires --edit-map" in result.stderr or "different finishing paths" in result.stderr)

    def test_measured_cuts_and_noncontiguous_edit_joins_share_the_map(self):
        self.assertEqual(edit_timeline.cuts_after_edit([0.5, 2.5, 3.5], self.map), [0.5, 1.0, 1.5, 2.0, 2.5])

    def test_contiguous_source_spans_do_not_invent_a_shot(self):
        plan = {**self.map, "output_duration": 2,
                "segments": [{"src_start": 0, "src_end": 1, "out_start": 0, "out_end": 1},
                             {"src_start": 1, "src_end": 2, "out_start": 1, "out_end": 2}]}
        self.assertEqual(edit_timeline.cuts_after_edit([], plan), [])

    def test_parser_preserves_space_paths_and_rejects_stale_or_invalid_maps(self):
        path = self.root / "recut take.plan.json"
        path.write_text(json.dumps(self.map))
        self.assertEqual(edit_timeline.load_map(path)["source"], self.map["source"])
        for field, value in [("output_duration", 5), ("source_duration", float("nan"))]:
            invalid = {**self.map, field: value}
            path.write_text(json.dumps(invalid))
            with self.assertRaises(ValueError):
                edit_timeline.load_map(path)
        invalid = json.loads(json.dumps(self.map))
        invalid["segments"][1]["out_start"] = 1.1
        path.write_text(json.dumps(invalid))
        with self.assertRaisesRegex(ValueError, "contiguous"):
            edit_timeline.load_map(path)

    def test_changed_source_or_output_cannot_reuse_fingerprinted_map(self):
        source, output = Path(self.map["source"]), Path(self.map["output"])
        source.write_bytes(b"original"); output.write_bytes(b"edited")
        plan = {**self.map, "source_sha256": edit_timeline.file_hash(source),
                "output_sha256": edit_timeline.file_hash(output)}
        path = self.root / "edit.plan.json"
        path.write_text(json.dumps(plan))
        self.assertEqual(edit_timeline.load_map(path)["source"], str(source))
        output.write_bytes(b"other edited take")
        with self.assertRaisesRegex(ValueError, "output changed"):
            edit_timeline.load_map(path)
        output.write_bytes(b"edited"); source.write_bytes(b"replaced original")
        with self.assertRaisesRegex(ValueError, "source changed"):
            edit_timeline.load_map(path)

    def test_word_file_is_bound_to_this_original_source(self):
        path = self.root / "words.json"
        path.write_text(json.dumps({"source": self.map["source"], "words": self.words}))
        self.assertEqual(edit_timeline.load_words(path, self.map["source"]), [list(w) for w in self.words])
        source = Path(self.map["source"]); source.write_bytes(b"source")
        path.write_text(json.dumps({"source": str(source), "source_sha256": edit_timeline.file_hash(source), "words": self.words}))
        source.write_bytes(b"new source")
        with self.assertRaisesRegex(ValueError, "source changed"):
            edit_timeline.load_words(path, source)
        with self.assertRaisesRegex(ValueError, "original source"):
            edit_timeline.load_words(path, self.map["output"])

    def test_resolve_keeps_original_ambience_and_separate_recut_outputs(self):
        import brandkit
        cfg = brandkit.load("grimwater")
        cfg["brand_layer"].update({"logo": None, "cuts": [0.5, 2.5, 3.5], "captions": self.rows})
        brand = self.root / "brand.json"
        brand.write_text(json.dumps(cfg))
        plan = self.root / "recut take.plan.json"
        plan.write_text(json.dumps(self.map))
        words = self.root / "words.json"
        words.write_text(json.dumps({"source": self.map["source"], "words": self.words}))
        build_looks.resolve(self.root, str(brand), plan, words)
        self.assertEqual(str(build_looks.SRC), self.map["output"])
        self.assertEqual(str(build_looks.SOURCE), self.map["source"])
        self.assertNotEqual(build_looks.BASE_TAKE, build_looks.SRC)
        self.assertIn("-recut-", build_looks.output_path("clean").name)
        self.assertIn("-recut-", build_looks.control_path("clean").name)
        self.assertEqual([r[2] for r in build_looks.LINES], ["BETA", "ALPHA", "BETA"])
        build_looks.resolve(self.root, str(brand))
        self.assertIsNone(build_looks.EDIT_MAP)
        self.assertEqual(build_looks.SOURCE, build_looks.SRC)
        self.assertNotIn("-recut-", build_looks.output_path("clean").name)


if __name__ == "__main__":
    unittest.main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall