Skip to content

Refactor near-500-line files along natural seams#152

Merged
alexkroman merged 2 commits into
mainfrom
claude/refactor-500-line-files-x9lk0l
Jun 13, 2026
Merged

Refactor near-500-line files along natural seams#152
alexkroman merged 2 commits into
mainfrom
claude/refactor-500-line-files-x9lk0l

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Three core files were approaching the 500-line gate. Each is split along an
existing concern boundary, leaving the originals well under the cap and the
public behavior unchanged:

  • transcribe_batch.py (464): batch-mode source selection (directory/glob/stdin
    expansion, bucket-URL discovery, the single-source-flag rejection) moves to a
    new transcribe_sources.py. transcribe_exec calls it directly; transcribe_batch
    keeps only the sidecar/resume/run machinery and imports the shared constants.
    _remote_sources splits into _remote_glob_sources/_remote_folder_sources to
    mirror the local _glob_sources/_directory_sources pair (and keep the focused
    module at complexity rank A).

  • transcribe_exec.py (474): the pure argument validators and the
    unrecognized-extension warning move to transcribe_validate.py.

  • commands/dub/_exec.py (460): the audio pipeline (translate, synthesize,
    timeline assembly, voice assignment, ffmpeg mux, utterance extraction) moves
    to commands/dub/_pipeline.py, exposing public names per the clip/_select
    convention; _exec keeps the orchestration.

config.py (480) is left intact: it's a single cohesive config/keyring layer
with no clean seam, so splitting it would fight the convention rather than
follow one.

Three core files were approaching the 500-line gate. Each is split along an
existing concern boundary, leaving the originals well under the cap and the
public behavior unchanged:

- transcribe_batch.py (464): batch-mode source selection (directory/glob/stdin
  expansion, bucket-URL discovery, the single-source-flag rejection) moves to a
  new transcribe_sources.py. transcribe_exec calls it directly; transcribe_batch
  keeps only the sidecar/resume/run machinery and imports the shared constants.
  _remote_sources splits into _remote_glob_sources/_remote_folder_sources to
  mirror the local _glob_sources/_directory_sources pair (and keep the focused
  module at complexity rank A).

- transcribe_exec.py (474): the pure argument validators and the
  unrecognized-extension warning move to transcribe_validate.py.

- commands/dub/_exec.py (460): the audio pipeline (translate, synthesize,
  timeline assembly, voice assignment, ffmpeg mux, utterance extraction) moves
  to commands/dub/_pipeline.py, exposing public names per the clip/_select
  convention; _exec keeps the orchestration.

config.py (480) is left intact: it's a single cohesive config/keyring layer
with no clean seam, so splitting it would fight the convention rather than
follow one.
@alexkroman alexkroman enabled auto-merge June 13, 2026 15:34
…ine-files-x9lk0l

# Conflicts:
#	aai_cli/transcribe_exec.py
@alexkroman alexkroman added this pull request to the merge queue Jun 13, 2026
Merged via the queue into main with commit d4d2f94 Jun 13, 2026
16 checks passed
@alexkroman alexkroman deleted the claude/refactor-500-line-files-x9lk0l branch June 13, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants