feat(api): V6 representative fingerprint column, envelope validation + embeddings cache feed (ADR 0113) #1268
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/rep-cache-api"
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
API side of ADR 0113 V6 (fingerprint-keyed representative cache): persist the worker-computed per-person fingerprint and serve the persisted set back so the next run can skip the per-person linkage recompute.
fingerprint TEXTonperson_instance_representatives(no index; column rides the existing V156 FULL-REPLACE rows — absent = recompute next run).WorkerResultService.personRepresentativesValidation): additive optionalfingerprintper entry — absent/JSON-null legal (older worker), present-but-malformed (non-string, not 64 lowercase hex) rejected fail-closed with the existing envelope-rejection shape, before any write.ClassInstanceDiscoveryService.persistPersonRepresentatives): fingerprint stored on every row of that person's set inside the existing candidate-ingestion transaction; a fingerprint-less run NULLs it via the same full replace.OwnerFaceEmbeddingsController):GET /api/worker/jobs/{id}/owner-face-embeddingsgains top-levelpersonRepresentatives(envelope/ADR 0109 entry shape +fingerprint, deterministic person-ASC/rep_index order, empty list on all no-data paths). Explicit"fingerprint": nullfor fingerprint-less runs — the worker treats null as a miss.Test plan
rtk ./gradlew :apps:api:compileJava :apps:api:compileTestJavagreen.dev.memories.api.discovery.*+dev.memories.api.worker.*: 956 tests, 0 failures;dev.memories.api.people.*: 346 tests, 0 failures. New coverage: envelope accept/reject matrix (+6), ingestion persist/replace/malformed (+2 + helper), embeddings response order/null/isolation/empty (+3), V168 migration pin (+1).feat/rep-cache-worker: key names (modelName/modelVersion/personId/fingerprint/reps[{repIndex,clusterSize,embedding}]), 64-hex definition, null-as-miss.