TAB_AIPORTRAIT Class
AI portrait ("portrait robot") of an entity: pending enrichment suggestions extracted from its sources (actions), plus the durable AI understanding of the person. One row per parent, born at the first analysis. Written only by Services\AIPortraits, never through the entity update service (no update date bump, no hook, no reindex).
PORTRAIT_DATA
JSONPending suggestions document: { fields: { <apiFieldName>: { items: [ ... ] } } }.
Every field is a list of items (a scalar field holds at most one item, with an empty key). Each item carries
key (sha256 of the normalized element), value (API format), label, code (dictionary), excerpt,
source {type, id, ownerId}, eventDate (action date, freshness), portraitDate (entry date, expiry),
confidence, version (extraction recipe). An item leaves the document once decided (applied or rejected).
Rejections are remembered in TAB_AIPORTRAIT_FEEDBACK, not here.
PORTRAIT_FORMAT_VERSION
Tinyint(3) unsignedFormat version of PORTRAIT_DATA (lazy upgrader). Independent from the extraction recipe.
Default: 1
PORTRAIT_PENDING
Smallint(5) unsignedNumber of pending items, recomputed from the document in the same UPDATE (never incremented). Only used to short-circuit reads when nothing is pending: the displayed count is filtered further (rights, expiry, filled).
Default: 0
PORTRAIT_SUMMARY
JSONDurable understanding of the person: { updatedAt, version, entries: [ { topic, statement, excerpt, sources: [ {type, id, ownerId, date} ], since, supersededBy } ] }. Typed, sourced statements only, never free
text; an entry whose sources all disappeared is removed; contradicted entries are kept (supersededBy).
NULL until the summary feature ships.