[FIX] Drive the insertion deadlines from an injectable clock - #115
Merged
tornikegomareli merged 1 commit intoSep 3, 2026
Merged
Conversation
jhampton
added a commit
to Swagatar-LLC/Talkify
that referenced
this pull request
Sep 3, 2026
The shaping work those notes described has now landed upstream (tornikegomareli#68, tornikegomareli#111, tornikegomareli#113, tornikegomareli#114) along with the insertion-clock fix (tornikegomareli#115), so keeping it in fork-unreleased.md would republish upstream release notes as if they were fork-only changes. The file accumulates again as fork work lands; empty is the correct resting state, and swagatar-release.sh already falls back to the build disclaimer when it is. Co-Authored-By: Vorno <agents-noreply@swagatar.co>
tornikegomareli
added a commit
that referenced
this pull request
Sep 3, 2026
#115 fixed the insertion family. The two tests that failed on its own CI run were in other files: TaskWaitingTests and PromptShapingServiceTests each raced a Task.sleep against real time and asserted the elapsed time was small, which asserts the runner was fast enough. InsertionClock is generalized to DeadlineClock and taken by awaitValue and PromptShapingService as well, because all three are the same mechanism racing a sleep and a second near-identical seam would only mean a second fake to keep in step. DrivenClock moves out of TextInsertionServiceTests for the same reason. Five tests drop from wall-clock bounds of two and five seconds, and from 150ms of real sleeping, to under 100ms each. Verified by mutation: the timeout paths were broken three ways and the tests caught all three. The first rewrite of returnsAsSoonAsTheTaskFinishes did not catch one of them, passing on a race instead, so it now reports whether the task had finished at the moment the wait returned. Closes #116 Claude-Session: https://claude.ai/code/session_012Abfbei4sXuCngAWEH8Z2k Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
jhampton
added a commit
to Swagatar-LLC/Talkify
that referenced
this pull request
Sep 3, 2026
The shaping work those notes described landed upstream in tornikegomareli#68, tornikegomareli#111 and tornikegomareli#114, and the insertion-clock fix in tornikegomareli#115, so shipping them from the fork would republish upstream's release notes as fork-only changes. The file accumulates again as fork work lands; empty is its resting state, and swagatar-release.sh falls back to the build disclaimer when it is.
jhampton
added a commit
to Swagatar-LLC/Talkify
that referenced
this pull request
Sep 4, 2026
The shaping work those notes described landed upstream in tornikegomareli#68, tornikegomareli#111 and tornikegomareli#114, and the insertion-clock fix in tornikegomareli#115, so shipping them from the fork would republish upstream's release notes as fork-only changes. The file accumulates again as fork work lands; empty is its resting state, and swagatar-release.sh falls back to the build disclaimer when it is.
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.
This is the injectable-clock fix you sketched as option 2 on #82, after the reruns on #68 pushed the flake from occasional to constant. The clipboard reader's snapshot deadline and the copy wait now run on an InsertionClock seam in Dependencies, continuous in production and driven by hand in the tests, so the whole family holds or advances time itself: the happy-path tests arm deadlines that can never elapse, and the timeout tests force the deadline instead of racing a real timer against the runner, which makes the assertion "the deadline was honoured" rather than "the machine was fast enough". That also retires the 2-second busy-skip ceiling whose own comment recorded a CI failure at 50ms, and the 1-second scheduling waits I flagged on #68 become generous event budgets that only spend themselves on a genuinely broken run. I routed waitForCopy through the same clock deliberately: it is the same real-deadline shape in the same file and one seam serves both, which is a shade past what I promised on #82, so I would rather say it here than let the diff imply it. Production behaviour is unchanged, since the live clock is the same continuous clock the deadlines used before. The full suite is green locally on Apple Silicon at 433 passed with the four expected media-fixture skips, and the insertion class now finishes with no real sleeping at all. I used Claude Code for most of the writing under my direction and can explain every line.
Closes #82