diff --git a/src/generator/shortspec.py b/src/generator/shortspec.py index c1a96fe..62c96d8 100644 --- a/src/generator/shortspec.py +++ b/src/generator/shortspec.py @@ -183,11 +183,11 @@ competing with words already on the frame. Chosen silence is an edit; a spec \ with one narrated shot out of eight is not a Short with a voice, it is a Short \ that forgot to speak. - **Give every narrated shot enough time for its own line, and work it out \ -rather than guessing.** The voice reads about {words_per_second:.1f} words a \ +rather than guessing.** The voice reads about {words_per_second:g} words a \ second and pauses a quarter second at every full stop, so **count the words AND \ count the sentences**: - duration ≥ words ÷ {words_per_second:.1f} + {sentence_pause} × sentences + \ + duration ≥ words ÷ {words_per_second:g} + {sentence_pause} × sentences + \ {rounded_pad} The second term is the one that catches people out. "Witness identities. \ @@ -196,9 +196,9 @@ not a fast line, it is three quarters of a second of silence on top. Two lines \ of the same length do not take the same time if one of them is chopped. Worked, on the example below: shot 1 speaks twelve words in one sentence, so \ -12 ÷ {words_per_second:.1f} + {sentence_pause} + {rounded_pad} = 5.1, and it \ +12 ÷ {words_per_second:g} + {sentence_pause} + {rounded_pad} = 5.1, and it \ declares 5.5. Shot 4 speaks thirteen words in two sentences, so 13 ÷ \ -{words_per_second:.1f} + 0.5 + {rounded_pad} = 5.7, and it declares 6.0. Round \ +{words_per_second:g} + 0.5 + {rounded_pad} = 5.7, and it declares 6.0. Round \ up, never down. This is the one rule that makes your own arithmetic true: a shot runs for the LONGER of \ diff --git a/tests/test_shortspec.py b/tests/test_shortspec.py index b01e1db..6a38b52 100644 --- a/tests/test_shortspec.py +++ b/tests/test_shortspec.py @@ -166,9 +166,11 @@ def test_the_prompt_gives_a_budget_the_model_can_count(): w, _ = writer("{}") prompt = w.build_prompt("Caso X", "material", None, "X.TEST") - assert f"{NARRATION_WORDS_PER_SECOND:.1f} words a second" in prompt, \ + # La constante exacta, no redondeada: el prompt trae una cuenta trabajada, y + # con "2.8" el divisor mostrado no reproduce el resultado mostrado. + assert f"{NARRATION_WORDS_PER_SECOND:g} words a second" in prompt, \ "sin el ritmo de la voz no hay cuenta que el modelo pueda hacer" - assert f"words ÷ {NARRATION_WORDS_PER_SECOND:.1f}" in prompt + assert f"words ÷ {NARRATION_WORDS_PER_SECOND:g}" in prompt assert f"{NARRATION_WORD_BUDGET} words" in prompt