Skip to content

Cross-repository identity contracts

This reference identifies the producer, wire field, consumer, owner, and compatibility rule for identity data that crosses Continuous Tracking System (CTS), Cognitive Companion, and the person identification service.

Implementation status

The current payload and the accepted direction are shown separately. Fields in the accepted direction are not available until their producer and every consumer ship the corresponding change. Calibration fields (raw_similarity, calibrated_confidence, calibration status, and version fields) are now deployed on the person identification service HTTP responses and consumed by the CTS face identity client.

Compatibility rules

  • CTS Redis stream entries use one named field containing raw protobuf bytes.
  • Protobuf changes are additive. Existing tag numbers are not reused; removed fields are reserved.
  • A compatibility field stays for one complete coordinated deployment after every consumer reads the canonical field, unless the contract row states otherwise.
  • A zero-period cutover deploys producer and consumer together. Two codecs are not supported on one stream.
  • CTS owns identity revisions. Cognitive Companion acknowledges the same revision_id.

Redis and object references

Channel or objectProducer and ownerCurrent payloadConsumerAccepted directionCompatibility
frames.readyRTSP ingress, CTSframe: raw FrameReady protobufTracking orchestratorKeep camera, object key, frame index, timestamps, dimensions, and sample FPS additiveAdditive
tracking.eventsTracking orchestrator, CTSevent: raw TrackingEvent protobuf with explicit decision_id, inferred_identity_id, effective_identity_id, authority (bounded vocabulary: operator, direct_face, posterior, temporal_prior, none, plus reid_gallery reserved and unknown/height_proxy legacy members never emitted by the current producer; wire type unchanged, still a string), decision_source, conflict, calibrated_confidence, and evidence referenceCC tracking and world-observation subscribersMaintain exact protobuf fields and semanticsOne coordinated deployment after canonical fields are consumed
tracking.revisionsTracking orchestrator, CTSrevision: raw IdentityRevision protobuf with typed fields 18 to 25 for revision kind, range start and end, range authority, range and correction IDs, required projections, and revision schema versionCC identity revision subscriberTyped range and projection fields deployed; older readers ignore themOld readers supported for one coordinated deployment
scene.samplesTracking orchestrator, CTSsample: raw SceneSample protobufCC scene sample subscriberKeep the physical frame key; aggregate trigger rows and bbox effective identities in the read modelCurrent fields stay for one coordinated deployment after grouped reads ship
tracking.signalsTracking orchestrator, CTSsignal: raw DementiaSignal protobufCC dementia signal subscriberReference revision lineage instead of relabeling inference in placeAdditive
tracking.presenceTracking orchestrator, CTSpresence: raw PresenceEvent protobufCC presence projectionProject effective identity by revision ID; keep person_id inside CCOne coordinated deployment after revision-aware projection ships
tracking.dwellTracking orchestrator, CTSdwell: raw DwellEvent protobufCC dwell projectionUse the same effective identity and revision rule as presenceOne coordinated deployment after revision-aware projection ships
cc.identity_assertionsCognitive CompanionOne raw CCIdentityAssertion protobuf field (assertion) with source, raw_similarity, nullable calibrated_confidence, model versions, and calibration statusCTS assertion subscriber and face identity stageMaintain explicit protobuf schema over Redis streamsZero-period producer and consumer cutover
MinIO frames/...RTSP ingress, CTSRaw JPEG referenced by minio_keyCTS fetch and keyframe stages, CC frame proxyKeep the physical source-frame key stableThrough object retention
Governed ReID cropCTS gallery serviceImmutable crop object with content hash and state (pending_review, operator_verified, rejected)Authorized CC review surfaceImmutable crop object with content hash; rejection deletes the crop and vector but keeps audit metadataNo legacy contract

WARNING

cc.identity_assertions is the known baseline exception to the protobuf-only stream rule. New text fields must not be added. Conversion requires a coordinated publisher and subscriber deployment.

HTTP and persisted projections

ContractProducer and ownerCurrent fieldsConsumerAccepted directionCompatibility
POST /identify and POST /identify-batchPerson identificationperson_id, name, confidence (raw similarity alias, deprecated), similarity, raw_similarity, nullable calibrated_confidence, calibration_status, calibration_artifact_version, arcface_model_version, model_profile, preprocessing_version, recognition state, bbox, and poseCTS face identity clientMaintain all calibration fields; calibrated_confidence is null in any degraded state and for non-recognized facesDeprecated confidence mirrors raw similarity for one coordinated deployment and is never authoritative
CTS keyframe listCTS GET /internal/keyframes/groupedOne card per physical frame keyed by (camera_id, minio_key, captured_at): physical_frame_id, trigger audit rows, every deduplicated bbox with inferred_identity_id, effective_identity_id, authority, decision_source, calibrated_confidence, conflict, revision_id, and pending_review, plus explicit unknown and conflict counts and server paginationCC keyframe BFF and list_keyframe_frames MCP toolServer-side filters by effective identity, authority, source, conflict, pending review, camera, trigger reason, and time, applied before grouped-frame paginationOld per-trigger GET /internal/keyframes stays for one coordinated deployment, then ends after usage review
CTS correction endpointsCTSPOST /internal/corrections/propose, /apply, and /{correction_id}/compensate return segment proposals, correction and revision IDs, range ID, and job status; GET /internal/corrections/jobs/{revision_id} returns job status, required projections, row counts, attempts, and last errorCC correction BFFFrame or observation-bounded segment, expected version, reason code, note, job ID, revision ID, and projection statusWhole-PH POST /internal/corrections adapter stays for one coordinated deployment, then ends after usage review
CC correction proxyCC POST /api/v1/cts/identity/corrections/propose, /apply, /{correction_id}/compensate, and GET /api/v1/cts/identity/corrections/jobs/{revision_id}Browser-facing segment proposal, correction result, and projection-job status; effective identity mapped to person_id at the boundaryCorrection UI and propose_identity_correction / get_identity_correction_job MCP toolsAudited actor injected from the auth context, never the browser; upstream 409 correction.stale_version and 422 preserved, upstream 5xx mapped to 502Stable while the correction workflow exists
CTS ReID review endpointsCTS GET/POST /internal/reid-review/*Candidate list with filters and total, candidate detail with eligibility and review history, counts by state, and approve/relabel/reject/batch-reject/compensate; approve and relabel re-check live eligibility and the optimistic audit_versionCC ReID review BFFIndividual approve and relabel only; batch exposes reject; stale or ineligible returns 409No legacy contract
CC ReID review proxyCC GET/POST /api/v1/cts/identity/reid-review/*Browser-facing candidate list, detail, counts, and review actions; effective identity mapped to person_id; crop and frame media presigned only for a live objectReID review UI (/admin/cts/reid-review)Gated by the strict cts.identity.gallery_review token, not by broad role globs; audited actor injected from the auth context; intentionally no MCP parityStable while the review queue exists
POST /internal/projection-acksCC identity revision subscriberrevision_id, consumer, schema_version, status, and countsCTS correction serviceAcknowledge a projection by revision ID; a failed ack marks the job failed for idempotent retryStable while the projection-job model exists
Correction targetsCC household rosterGET /api/v1/cts/identity/correction-targets returns active household members with optional gallery decorationCorrection UIAuthoritative active-member list independent of gallery population; gallery counts are decoration and gallery_available flags upstream errorsStable
ph_revisions to cts_identity_revision_logCTS revision publisherStable revision ID, PH, old and new identity, actor, reason, and evidence with revision-range lineageCC identity rewriterRange and lineage carried in the audit log while keeping idempotency by revision IDAudit IDs are permanent
person_location_history projectionCC identity rewriterperson_id, PH, and superseding revisionCC location readsSupersede the affected observation range, retain originals, and acknowledge the revision IDHistorical audit is permanent
cts_dementia_signals projectionCC identity rewriterperson_id, window, and superseded_by_revision_idCC signal readsSupersede signals under the prior identity within the corrected range, retain originals, and insert replacements under the corrected identity with a re-derived signal_idHistorical audit is permanent
Revision horizon configCTS resolver, resolver.revision_horizon_s (default 600 s)Bounds how far back an automatic (range-less) revision may supersede prior rowsCC IdentityRewriter, mirrored as cts.revision_horizon_sBoth constants must express the same boundChange both together; a drift lets CC rewrite more or less history than the resolver's own revision contract promises
inferred_backfill revision projectionCTS RevisionsStage / UnknownBackfillServicerevision_kind=inferred_backfill with empty previous_identity_id and explicit rangeCC BackfillProjectorIdempotent insert of presence segments over the rangeAcknowledgment loop required to mark CTS job complete
Visitor clustering APIPerson identification serviceGET /clusters, GET /clusters/{id}, POST /clusters/{id}/name, POST /clusters/{id}/dismissCC BFF (Visitor review surface)Naming moves biometric data from the visitor dataset into the enrollment dataset and creates a HouseholdMemberStable API shape for one coordinated deployment

Change checklist

When a change affects a row in this reference:

  1. Update the producer and all consumers in the same change set.
  2. Add producer and consumer contract tests.
  3. State the compatibility end condition.
  4. Update this page and the related architecture decision.
  5. Verify that Redis stream values remain raw protobuf bytes.

Released under the AGPL-3.0 License.