mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 23:25:18 +00:00
- /fotos/encontre + POST /api/fotos/selfie: só o vetor 128-d, sem imagem, sem score e sem nomes de terceiros; fail-closed pela flag photoAlbum.selfieSearchEnabled (default false) e pelos Consents por chave estável (busca-selfie-fotos/busca-selfie-indice, não seedados — a superfície nasce fechada até o aval jurídico/DPIA). - Índice A/C do gate (PR #1370): só quem aderiu é indexado; descriptors do acervo são transitórios. Collection faceSubject (admin-only, sem vínculo com Contact), vínculos matchedPhotos e marker faces.checkedKey no archivePhoto (modelo + enrolledAt). - Engine @vladmandic/face-api nos dois lados: browser lazy com modelos same-origin (copy-face-vision-assets no prebuild/predev/Docker) e CLI node-wasm sem tfjs-node. CLIs ops-only faces:enroll / faces:index --apply|--verify com guardas C231/C232. - Opt-out self-service por reconhecimento (leave-index) + canal de remoção do C233; rate limit próprio (namespace selfie:<hash>) e bounded body extraído do beacon. - UI portada classe-a-classe do design estendido (paridade certificada, tier primário); e2e frontendFotosSelfie (manifest+curado+projeto, engine stubada) e canário do engine real; runbook §C234, contrato em AGENTS-public.md e changelog. - Migration aditiva add_face_subject (SQL revisado); hard-stops aprovados na sessão.
15 lines
684 B
TypeScript
15 lines
684 B
TypeScript
import { z } from 'zod'
|
|
|
|
import { FACE_SEARCH_DESCRIPTOR_LENGTH, FACE_SEARCH_INTENTS } from '@/lib/faceSearch'
|
|
|
|
/**
|
|
* C234 — wire contract of the public `POST /api/fotos/selfie`. Strict object:
|
|
* an extra key is a malformed body, never a silently ignored one. The vector
|
|
* must be exactly the on-device descriptor (finite numbers — Zod rejects NaN
|
|
* and Infinity natively); the intent names the only two actions the endpoint
|
|
* performs. There is no image field and no identity field — by construction.
|
|
*/
|
|
export const faceSearchRequestSchema = z.strictObject({
|
|
vector: z.array(z.number()).length(FACE_SEARCH_DESCRIPTOR_LENGTH),
|
|
intent: z.enum(FACE_SEARCH_INTENTS),
|
|
})
|