Refactor near-limit files on their natural seams#254
Merged
Conversation
Two source files sat within ~30 lines of the 500-line max-file-length gate. Split each along its existing concern boundary, preserving behavior: - core/config.py (470->297): extract the config.toml document schema (Profile/Config/StoredSession) plus the parse/cache/atomic-write store into core/config_store.py, mirroring the keyring_store factoring. config stays the auth/profile facade and reads as plain accessors over config_store.load/dump/update. - commands/clip/_exec.py (466->381): extract the ffmpeg cutting stage (silence detection, per-segment re-encode, WrittenClip) into commands/clip/_cut.py, beside the existing _select selection module; _exec is now the orchestration that ties selection and cutting together. Tests repoint to the new modules. Added coverage for two lines that the move pulled into the diff scope: the Windows PermissionError retry path and the real config_dir resolver (both previously uncovered-but-tolerated). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aEjd8hrNh1NoWLuZ2fyLT
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.
Two source files sat within ~30 lines of the 500-line max-file-length gate.
Split each along its existing concern boundary, preserving behavior:
(Profile/Config/StoredSession) plus the parse/cache/atomic-write store
into core/config_store.py, mirroring the keyring_store factoring. config
stays the auth/profile facade and reads as plain accessors over
config_store.load/dump/update.
(silence detection, per-segment re-encode, WrittenClip) into
commands/clip/_cut.py, beside the existing _select selection module;
_exec is now the orchestration that ties selection and cutting together.
Tests repoint to the new modules. Added coverage for two lines that the
move pulled into the diff scope: the Windows PermissionError retry path and
the real config_dir resolver (both previously uncovered-but-tolerated).
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_016aEjd8hrNh1NoWLuZ2fyLT