fix: rotate the worked-line verb per turn (CLFY-24) #53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "clfy-24-worked-verb-seed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The inline end-of-turn worked line always rendered the first pool entry —
✻ Cooked for Ns, every turn. Adding custom worked verbs changed nothing.Root cause:
appendWorkedDurationLine(index.ts) calledinlineWorkedDurationText(durationMs)with no seed. InformatWorkedLine,Number.isFinite(undefined)is false, soseedfell to0and the verb waspool[0]. In append mode (the default) the pool is[...DEFAULT_WORKED_VERBS, ...custom], so index 0 is always the built-in "Cooked" and custom verbs (index 16+) were unreachable. The other worked-line path (index.ts:1333) already passedcomponentStartas the seed and rotated correctly; only this inlinemessage_endpath was affected.Fix
appendWorkedDurationLine → inlineWorkedDurationText → workedDurationText.started— the turn's start timestamp. It is stable across repaints (baked intomessage.contentonce atmessage_end) and varies per turn. Deliberately not duration-derived: theWorkedLineOptions.seedcontract notes a duration seed clusters short turns on the same few verbs.verbsparam so the whole stack is testable without touching settings; exportappendWorkedDurationLine.test-worked-verbs.ts: asserts the seed is actually used (0→pool[0], 1→pool[1], 5→pool[5 % n]), that a custom verb is reachable in append mode, and that the same start seed is stable across repaints. The existing suites all passed an explicit seed, which is exactly why the seedless production path survived untested.Test plan
bun run test— 15/15 suites greentsc --strictcleanmessage.contentalready happened pre-change, so risk is low)Closes CLFY-24
The inline end-of-turn worked line ("✻ Cooked for Ns") always rendered the first pool entry. appendWorkedDurationLine called inlineWorkedDurationText with no seed, so formatWorkedLine fell back to seed 0 and picked pool[0] every turn; custom verbs in append mode (index 16+) were unreachable. Thread the seed through appendWorkedDurationLine -> inlineWorkedDurationText -> workedDurationText, seeded at the call site with the turn's start timestamp (stable across repaints since it is baked into message.content once at message_end, varies per turn; deliberately not duration-derived, which clusters short turns). Add an optional verbs param so the path is testable, export appendWorkedDurationLine, and add a regression test asserting the seed is used and a custom verb is reachable in append mode. Closes CLFY-24