Repository navigation
TakeSession.finish: run the body without self, on a snapshot (#652, part A, 2 of 3) - #775
Merged
Merged
Conversation
finish() copies what it needs into FinishInput and calls the new nonisolated static finish(_:), then writes the updated metadata back. Same signature, same order of operations, same results for every caller. coverage, gaps, writeMetadata, collectDropouts and persistGaps became nonisolated statics taking the copies, standby and metadata; the instance methods the mid-Take code uses are now one-line wrappers over them, so tick, join, rejoin and stand-in are unchanged and nothing is duplicated. Assisted-by: Claude Code:claude-sonnet-5-5 Claude-Session: https://claude.ai/code/session_01YSHtEHRvQvHpyXAjjbcmVq
Assisted-by: Claude Code:claude-sonnet-5-5 Claude-Session: https://claude.ai/code/session_01YSHtEHRvQvHpyXAjjbcmVq
Skeyelab
enabled auto-merge (squash)
October 16, 2026 06:17
Assisted-by: Claude Code:claude-sonnet-5-5 Claude-Session: https://claude.ai/code/session_01YSHtEHRvQvHpyXAjjbcmVq
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Part A of #652, step 2 of 3 (A1 #765 merged). A pure refactor:
finish()stays synchronous with the same signature, but its body is now anonisolated static func finish(_:)on aFinishInputsnapshot (capture, copies, standby, metadata, levels, stop timeout), andfinish()writes the updated metadata back.coverage,gaps,writeMetadata,collectDropoutsandpersistGapsbecame nonisolated statics; the instance methods the mid-Take code uses are one-line wrappers over them, so nothing mid-Take changed and nothing is duplicated.Recorderis untouched.What did not change: the order of operations (stop capturing, request stop on every writer, one deadline, wait, stand-in bookkeeping, dropouts, levels, Take.json writes skipping Copies Stop gave up on, Gaps) and every file written. A3 (async
stopTake, behind an availability rule) will call the static function on a detached task.Tests: a refactor, so the existing suites are the net.
swift test --filter Recording: 1037 tests in 145 suites passed (4 known issues);VERIFY_QUICK=1 ./scripts/verify.shpassed. No new test (the behavior is the same); no red run, since nothing changes.Code Reviewer: a faithful refactor, no blockers. It listed A3 hazards, which are in my A3 plan, not here: the snapshot must be taken after the last
accumulate, afterRecorderdrops the session and cancels the destination checks (a lateattachDriveor stand-in would be missing from it), with nothing changing on the session until the metadata is written back (now written in theFinishInputdoc comment).TakeWriterandStandInSinkare@unchecked Sendable, as before.Device only (Eric, internal build): this is the end of the real-time path (ADR 0002). Record and Stop a Take on a real iPhone, with and without a Drive, and check the Stems finalize and Take.json (Gaps, Dropouts, levels) is complete. Checked by tests only.
https://claude.ai/code/session_01YSHtEHRvQvHpyXAjjbcmVq