# Decisions

## Native SwiftUI interface

SwiftUI provides a small, focused macOS experience with native folder selection, Finder integration, preferences, and application-termination handling. The tradeoff is platform specificity; the recording engine is deliberately separated so it can be ported.

## External media tools

The prototype uses maintained tools—`yt-dlp`, FFmpeg/ffprobe, and Deno—instead of implementing streaming protocols and codecs. This keeps the source understandable and benefits from upstream format support, but buyers must install or package compatible tool versions.

## Direct process execution

Commands are launched with `Process.executableURL` and an argument array. No command string is passed through a shell. This makes spaces and user-provided URLs safer and keeps command construction unit-testable.

## Browser cookies are selected, not copied

The owner chooses a supported browser and `yt-dlp` reads its local YouTube session when needed. The prototype never stores cookie values. macOS may still request browser-data permission, and a cross-platform port needs an equivalent explicit credential model.

## One process for catch-up recording

From-beginning mode keeps one `yt-dlp` process while downloaded media catches up to the live edge. Avoiding a second process reduces timeline gaps and manual fragment stitching.

## Conservative interrupted-tail cleanup

Manual interruption can leave mismatched tracks or a long unusable silent tail. Cleanup runs only for stopped from-beginning recordings and requires evidence before trimming. The tradeoff favors retaining extra media over deleting legitimate silence.

## Tool-assisted integration tests

Pure unit tests cover validation, parsing, state, and command generation. FFmpeg/ffprobe tests create and inspect real media when the tools exist and skip otherwise, keeping the project testable on a clean Xcode machine while still verifying the important media path.
