docs(changelog): summarize refactor/domain-io-extraction work block
This commit is contained in:
@@ -112,6 +112,37 @@ callers).
|
|||||||
|
|
||||||
### Internal
|
### Internal
|
||||||
|
|
||||||
|
- **Domain I/O extraction** (`refactor/domain-io-extraction`): the domain
|
||||||
|
layer no longer performs subprocess calls, filesystem scans, or YAML
|
||||||
|
loading. Achieved in a series of focused commits:
|
||||||
|
- **Knowledge YAML loaders moved to infrastructure**:
|
||||||
|
`alfred/domain/release/knowledge.py`,
|
||||||
|
`alfred/domain/shared/knowledge/language_registry.py`, and
|
||||||
|
`alfred/domain/subtitles/knowledge/{base,loader}.py` relocated to
|
||||||
|
`alfred/infrastructure/knowledge/`. Re-exports were dropped — callers
|
||||||
|
import directly from the new location.
|
||||||
|
- **`MediaProber` and `FilesystemScanner` Protocol ports** introduced at
|
||||||
|
`alfred/domain/shared/ports/` with frozen-dataclass DTOs
|
||||||
|
(`SubtitleStreamInfo`, `FileEntry`). `SubtitleIdentifier` and
|
||||||
|
`PatternDetector` are now constructor-injected with concrete adapters
|
||||||
|
(`FfprobeMediaProber` wrapping `subprocess.run(ffprobe)` and
|
||||||
|
`PathlibFilesystemScanner` wrapping `pathlib`). No more direct
|
||||||
|
`subprocess`/`pathlib` usage from the subtitle domain services.
|
||||||
|
- **Live filesystem methods removed from VOs and entities**:
|
||||||
|
`FilePath.exists()` / `.is_file()` / `.is_dir()` deleted —
|
||||||
|
`FilePath` is now a pure address VO. `Movie.has_file()` and
|
||||||
|
`Episode.is_downloaded()` dropped. Callers either rely on a prior
|
||||||
|
detection step or use try/except over pre-checks (eliminates
|
||||||
|
TOCTOU races).
|
||||||
|
- **`SubtitlePlacer` moved to the application layer** at
|
||||||
|
`alfred/application/subtitles/placer.py` — it performs `os.link`
|
||||||
|
I/O, which doesn't belong in the domain. Pre-checks replaced with
|
||||||
|
try/except for `FileNotFoundError`/`FileExistsError`.
|
||||||
|
- **`SubtitleRuleSet.resolve()` no longer reaches into the knowledge
|
||||||
|
base**: the implicit `DEFAULT_RULES()` helper is gone, replaced by
|
||||||
|
an explicit `default_rules: SubtitleMatchingRules` parameter. The
|
||||||
|
`ManageSubtitles` use case loads defaults from the KB once and
|
||||||
|
passes them in.
|
||||||
- **`to_dot_folder_name(title)` helper** in
|
- **`to_dot_folder_name(title)` helper** in
|
||||||
`alfred/domain/shared/value_objects.py` — extracts the
|
`alfred/domain/shared/value_objects.py` — extracts the
|
||||||
`re.sub(r"[^\w\s\.\-]", "", title).replace(" ", ".")` pattern that was
|
`re.sub(r"[^\w\s\.\-]", "", title).replace(" ", ".")` pattern that was
|
||||||
|
|||||||
Reference in New Issue
Block a user