Repository navigation
Name the whole-poem action after what the model can do - #28
Merged
Merged
Conversation
SnapMoGen and Language of Motion cannot carry one line into the next, and SnapMoGen's worker refuses a poem outright, so B on those models failed with a 503. It now drafts every line instead, and the button says which it will do: "Bake whole poem" where the lines are carried, "Draft all lines" where they are not. A label is on screen every time, where a dialog is dismissed once by the person who already knew. No bake is recorded for a batch of drafts. poem.baked stays null and bakeIsCurrent keeps reporting false, because writing those lines into the bake would put a claim of continuity into every session file the poem is exported to, to be read by people who were not here to watch the body jump between them. The decision and its wording live in whole-poem.ts, out of the DOM and tested, for the same reason askFor does. Drafting is sequential: the service gates a local worker to one generation at a time anyway, and a failure part way then keeps every line drafted before it. The stage is laid out once at the end rather than per line, because showCurrent lays every drafted motion end to end and a rating corpus can be hundreds of lines. Two faults found while doing it, both pre-existing: - A failed draft left the line spinning forever. The catch in draftLine called setText with the unchanged text to clear it, but setText early-returns when the text has not moved, and invalidateFrom preserves "generating" on purpose. Nothing else in the state machine clears it, so the dot spun until the next retry. Poem.cancelGenerating returns the row to what it was — never to "draft", because the take that would justify that word is the one that did not arrive. - The elapsed time was never visible. All three paths wrote it just before setGenerating(false), whose default message cleared it again. They now settle through one generationSettled call, so the ordering cannot be got wrong in one place and right in another. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yJSPiRjB5WvTH2x4LB8V6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bhas always meant "the whole poem", but only Kimodo can answer that as one motion. SnapMoGen and Language of Motion cannot carry one line into the next, and SnapMoGen's worker refuses a poem outright — so pressingBon those models failed with a 503 and nothing else.It now drafts every line instead, and the button says which it will do:
Bake whole poemDraft all linesA label is on screen every time, where a dialog is dismissed once by the person who already knew. An unknown capability gets
Draft all lines, becausenullis nottrue— the same ruleaskForalready follows.No bake is recorded for a batch of drafts
The point of the change, and the reason it is not simply "let the button through".
poem.bakedstays null andbakeIsCurrentkeeps reporting false, so the banner goes on saying there is no continuous reading.These lines were never carried into one another. Writing them into the bake would put a claim of continuity into every session file the poem is exported to, where it would be read by people who were not here to watch the body jump between them — permanent and portable, unlike a warning someone clicks past.
The decision and its wording live in
whole-poem.ts, out of the DOM and tested, for the same reasonaskForandreadPaneldo: it is the kind of thing that can be wrong without looking wrong.Drafting is sequential — the service gates a local worker to one generation at a time anyway, and a failure part way through then keeps every line drafted before it (
4 of 8 lines were drafted, and are kept.). The stage is laid out once at the end rather than per line, becauseshowCurrentlays every drafted motion end to end and a rating corpus can be hundreds of lines.Two faults found while doing it, both pre-existing
A failed draft left the line spinning forever.
draftLine's catch calledsetTextwith the unchanged text to clear it, butsetTextearly-returns when the text has not moved, andinvalidateFrompreservesgeneratingon purpose. Nothing else in the state machine clears it, so the dot spun until the next retry.Poem.cancelGeneratingnow returns the row to what it was — never todraft, because the take that would justify that word is the one that did not arrive.The elapsed time was never visible. All three paths wrote it just before
setGenerating(false), whose default message cleared it again. They now settle through onegenerationSettledcall, so the ordering cannot be got wrong in one place and right in another.Tests
tscclean; 87 pass, 0 fail (node --test src/*.test.ts), 9 of them new:whole-poem.test.ts— the two actions can never share a label, the word "bake" never appears on the action that is not one, and a model that never declared is not assumed able to stitch.poem.test.ts— a failed generation never leaves a row spinning; a line that already had a draft keeps it; cancelling is a no-op on a row that is not generating; cancelling never restoresgeneratingwhatever it is handed.Not verified in a browser
Stated plainly, since it is this repo's standing gap. The decision logic and the state machine are unit-tested. The relabelling on model change, the progress messages and the rows filling in one at a time are verified by inspection only.
The check worth making: reload with all three workers up, select SnapMoGen, press
Bon a short poem. ExpectDraft all lines, each row turning into a draft in turn, visible seams, and the banner still reporting no continuous reading. Every line will also come back at ≥128 frames — SnapMoGen's floor, unchanged by this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_014yJSPiRjB5WvTH2x4LB8V6