Prepare single-video Context evidence from retained fixtures

Merged
SI
3d ago
+842-0

A single YouTube link currently has no retained-evidence projection in Context. The separate API #1019 saves a locator only. This adds an unwired preparation function for app #2131 that validates one saved request and injected retained video evidence, then returns the existing enrichment module/result shapes and compatible saved artist-research documents.

Uploader/channel, performers and credited recording/artists remain separate. Alternate versions, multilingual captions, missing media and partial analyzed ranges stay explicit; video evidence never becomes original song lyrics or artist brand. Source/version references and request ownership are validated, and access is checked before reads and before return. Reuse preserves saved document/result/version/source references without a generation fallback.

Scope: eight new files under lib/context/video. No public action, provider/media call, persistence, billing change, database migration, brief recipe or snapshot-schema change. Current YouTube execution remains disabled. CE14, full authorized ingestion and hosted/native acceptance remain separate gates. Related to recoupable/app#2131; does not close it.

Validation: 81 tests passed (32 new video fixtures, 27 foundation, 22 brief compiler), strict scoped TypeScript, scoped ESLint and formatting/diff checks. Test config disables dotenv loading. Independent source review identified source-kind compatibility and retained-text normalization findings; both were corrected with regression tests. Follow-up reviews corrected UUID identity, reuse, withdrawal and reader bindings, malformed retained text, and authorization-order/brand-output assertions. Request/evidence loading, artist-research selection and pure output projection are separate responsibilities; named limits and source/range/identity validators preserve the existing contract. Retained strings remain unchanged.