Skip to content

Identity integrity architecture

Identity integrity keeps a physical track, a model inference, and a caregiver correction from silently becoming the same thing. This architecture gives Continuous Tracking System (CTS) developers and operators one set of boundaries for identity authority, ReID learning data, and downstream corrections.

Implementation status

The architecture decisions on these pages are accepted. The documentation and synthetic failure baseline were established on June 19, 2026. Resolver, schema, gallery, correction, UI, calibration, and rollout work is delivered in separate changes. The current gaps are listed below so accepted behavior is not mistaken for deployed behavior.

When to use this section

Use these pages when changing PH association, identity evidence, ArcFace response fields, the ReID gallery, keyframe identity displays, or correction projections into Cognitive Companion.

The three architecture decisions define separate concerns:

DecisionQuestion it answers
Identity authority and UnknownWhich evidence may assign a household identity, and when must the result be Unknown?
ReID gallery governanceWhich body embeddings may vote, how are they reviewed, and what is deleted after rejection?
Identity revision projectionsHow does an immutable inference become a corrected effective label across services?

System at a glance

A PersonHypothesis (PH) remains the one persistent world-coordinate track. Identity is a governed property of that PH. The system does not create a parallel identity tracker.

Five concepts stay separate throughout this flow.

ConceptOwnerMeaning
Observation associationCTS world trackerChooses which physical observation updates which PH
Inferred identityCTS resolverStores what the models and prior reported at observation time
Effective identityCTS revision projectionApplies authority and corrections to the label consumers use
Operator correctionCTS correction serviceRecords immutable truth over an explicit observation range
Learning dataCTS gallery service or ArcFace enrollmentUses its own review and provenance rules

Current implementation baseline

The following gaps are present in the initial baseline. They are characterization targets, not accepted exceptions.

AreaCurrent behaviorAccepted direction
Temporal priorresolver.prior_maintenance_max_age_s is 120.0; ordinary held decisions can rewrite current_identity_committed_atA 30-second window measured from independent qualifying evidence
Duplicate active identityenable_duplicate_active_identity_guard is false; the resolver records a shadow mismatchAt most one open global PH may hold a household identity
ReID galleryreid_gallery has face_confirmed but no lifecycle state or crop provenancePending review, operator verified, or rejected; only verified rows vote
Gallery seedingA recognized face is required, but the face identity is not compared with the seed labelThe direct face identity must equal the candidate identity
KeyframesBbox rows contain each visible identity, while the list card exposes the trigger PH identityOne physical-frame card aggregates every effective bbox identity
Face confidencePerson identification reports raw ArcFace cosine similarity as confidenceDistinct raw_similarity and nullable calibrated_confidence fields
CC assertionscc.identity_assertions uses separate text fieldsOne raw protobuf payload in a coordinated producer and consumer cutover

Data ownership

CTS tables live in the continuous_tracking PostgreSQL schema. Cognitive Companion uses its own Alembic-managed database. The gallery table is reid_gallery; there is no identity_gallery table.

ObjectCurrent purposeIdentity owner
person_hypothesesPersistent PH and current identityCTS association state
world_observationsObservation history linked to PHsCTS correction boundary source
reid_gallery768-dimensional body embeddingsCTS governed gallery
tagged_keyframesSampling-trigger rows that reference raw framesCTS physical-frame read model
keyframe_bbox_annotationsEvery persisted bbox for a sampled frameCTS bbox identity projection
ph_revisionsExisting PH identity revision auditCTS revision lineage
cts_identity_revision_logApplied CTS revision IDs in Cognitive CompanionCognitive Companion projection audit
person_location_historyLocation history with revision supersessionCognitive Companion location projection

These values describe the initial baseline in tracking-orchestrator/config/settings.yaml and person-identification-service/config/settings.yaml.

NameCurrent valueCurrent mode
face_id.enabledtrueFace identification calls are live
face_id.min_confidence0.6Raw service response gate for face anchors
resolver.face_commit_min_confidence0.70Current uncalibrated face-lock gate
resolver.commit_prob0.65Posterior commit threshold
resolver.commit_margin0.15Posterior margin threshold
resolver.prior_maintenance_max_age_s120.0Current value; accepted value is 30 seconds
resolver.enable_quality_gatetrueEnforced
resolver.enable_flip_debouncetrueEnforced
resolver.enable_sticky_maintenancetrueEnforced
resolver.enable_duplicate_active_identity_guardfalseShadow comparison only
resolver.enable_multiview_gallerytrueLive gallery query and seeding path
pipeline.adaptive_reid.enabledfalseLive inference skipping is disabled
pipeline.adaptive_reid.shadowtrueShadow evaluation only
recognition.threshold0.4Raw ArcFace recognized threshold
recognition.unknown_threshold0.25Raw ArcFace unrecognized threshold

Service and storage ownership

All local compose services join the external nanai Docker network. MinIO is external to these compose files.

ServiceDefault host portDatabase or stateIdentity responsibility
Shared PostgreSQLdeployment configuredcontinuous_tracking, cognitive_companion, person_identificationSeparate data ownership per service
Redis6379Redis Streams and consumer stateCross-service event transport
Triton8700, 8701, 8702Model repositoryDetector, ReID, pose, and ArcFace inference
Tracking orchestrator8500continuous_trackingPH, resolver, gallery, keyframes, and corrections
RTSP ingress8090Redis and MinIOFrame publication
go2rtc1984Camera proxy configurationCamera session proxy
Cognitive Companion backend8000cognitive_companionBFF and downstream projections
Cognitive Companion frontend8081NoneCaregiver administration
Person identification8200person_identificationArcFace enrollment and identification

RTSP ingress stores source JPEGs under frames/{camera_id}/{YYYY/MM/DD/HH}/{frame_index}-{capture_time}.jpg. A keyframe references this raw object. It is not a separately rendered image. Governed ReID review crops use separate immutable object keys once that lifecycle is implemented.

Synthetic characterization

The baseline includes synthetic fixtures for seven failure modes: exchanged labels, one person handed between two PHs, duplicate active identity, prior timestamp renewal, mismatched gallery seeding, keyframe identity collapse, and a missing calibration artifact. Private household frames and populated manifests stay outside Git.

The characterization tests use strict xfails tied to the milestone that removes each defect. An unexpected pass fails the test run, which forces the xfail to be removed when the behavior changes.

Released under the AGPL-3.0 License.