feat(people): per-face crops via generic discovery thumbnail job (ADR 0095) #709
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/face-crop-revival"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Revives per-face thumbnail (crop) generation by extending the generic
generate_discovery_thumbnailpipeline — no domain-specific job type reinstated (ADR 0094 generality kept). Recorded in ADR 0095 (docs/adr/0095, accepted). Also fulfills the thumbnail slice of spec 014 S014T003 by removing the deprecated legacy per-face path instead of reanimating it.Worker (apps/worker-media)
generateDiscoveryThumbnailface mode: crops 256+512, variantsface-{id}-{size}, genface-thumbnail-v1, result carries faceAnnotationId + complete flag; job finalizes on the 512 upload only. Instance mode byte-identical to before.CoreApiWorkerClient: per-variant idempotency-key discriminator extended to discovery_thumbnail (two submissions per face job must not collide).generateFaceThumbnail+generate_face_thumbnaildispatch case; capability removed from WorkerProperties.API (apps/api)
acceptDiscoveryThumbnailbranches on faceAnnotationId → owner-checked resolve, upsert derived_assets(face_thumbnail),UPDATE discovery_results SET thumbnail_derived_asset_id(people domain). Instance path unchanged.shouldCompleteJob: complete-flag honored for discovery_thumbnail (256 partial does not finalize).enqueueMissingFaceCropJobs(+ForMedia): photo-only, state accepted/owner_recognized, pointer IS NULL, idempotent (existing 512 asset / active job skip).FaceCropBackfillSchedulertrickles 100 faces per 5 min. Acceptance triggers per-media enqueue adjacent to the existing thumbnail-enqueue call sites.Ops notes
Tests
Revive per-face thumbnail generation by extending the generic generate_discovery_thumbnail pipeline instead of reinstating the domain-specific generate_face_thumbnail job (ADR 0094 generality kept). - Worker: face mode renders 256+512 crops, variants face-{id}-{size}, gen face-thumbnail-v1, result carries faceAnnotationId+complete flag; job finalizes on the 512 upload only. Instance mode unchanged. - API: acceptDiscoveryThumbnail branches on faceAnnotationId -> derived_assets(face_thumbnail) + discovery_results pointer update (owner-checked); instance path unchanged. CoreApiWorkerClient uses per-variant idempotency keys for the dual submissions. - Enqueue: enqueueMissingFaceCropJobs(+ForMedia), photo-only, state accepted/owner_recognized, idempotent (existing 512 asset or active job skips); FaceCropBackfillScheduler trickles 100/5min; acceptance triggers enqueue per affected media. - Removed deprecated legacy path end-to-end: generateFaceThumbnail, acceptFaceThumbnail, canonicalFaceThumbnailVariant, faceThumbnailPayload, enqueueMissingFaceThumbnailJobs, generate_face_thumbnail capability registrations (bootstrap, compose, resource policy, maintenance lists). ADR: docs/adr/0095 (accepted). Spec 014 S014T003 thumbnail slice fulfilled; broader legacy removal stays pending.