refactor: isolate lossless cut planning - #3
Merged
Conversation
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.
Problem
shorts_generator/local/clipper.pymixed pure lossless-cut command/key/pathplanning with environment state, filesystem cache orchestration and FFmpeg
execution. The planning contract was difficult to review independently without
risking output behavior or existing test patch points.
Scope
shorts_generator/local/lossless_cut_planning.pylogging and subprocess execution in
clipper.pyclipper.pyfacade name, signature, default, returnshape, log and exception behavior
Base:
92988d82ae93845be42cc98cf0f0fd3600ef65a6Head:
49b7f21ca35a21bb37a9e565d2b56c453fa98fffNon-goals
No caption, highlight, Node, migration, API, infrastructure, provider, product
default, retry/fallback or video-output changes. No caller migration and no new
runtime dependency.
Dependency boundary
Before:
After:
The leaf does not import
clipper.py, OpenCV, provider code or environmentconfiguration and performs no I/O, logging or process execution.
Measured production change
clipper.py: 7,609 -> 7,599 LOC, net -10The small positive delta is the explicit module interface plus compatibility
facade overhead. The planning implementation is not duplicated.
Exact regression evidence
12/12 dedicated characterization tests pass
npm run lint: passnpm run build: passnpm test: 1,690 total; 1,683 pass; 7 explicit skips; 0 fail37ef626b9901ad2eeb1056d47954d88cdf2ede6430cc80e449bd5f9c7a91f9c9, unchangedd62ce934e038d9026263ce2be7efa5f0c6e3ffac8a583d7b23b609540a5f4fe9, unchangedgit diff --check: passCharacterization freezes exact FFmpeg argv, timestamp/fps rounding, FFV1/PCM
mapping, stable cache key/path, source identity, spaces in paths, hit/miss,
disabled/zero-byte cache behavior, one execution attempt, logs, return values,
failure propagation and partial cleanup.
No deterministic video was rendered for a pixel/byte comparison, so this PR
does not claim pixel-identical output. It claims unchanged exact planning
contracts and full regression parity.
Next slice
Recommended separately: characterize and isolate import-time cache/environment
configuration. Do not start caption planning, Real-ESRGAN process planning or
highlights.pycandidate discovery inside this PR.