feat: add TKG node marking for Identity Agent suggestions

TKG Helper (scripts/utils/tkg_helper.py):
- mark_face_track_suggested(): Mark node as 'suggested' with pending identity info
- mark_face_track_confirmed(): Mark node as 'confirmed' with identity_ref
- mark_face_track_stranger(): Mark node as 'stranger' with stranger_ref
- batch_mark_suggestions(): Batch mark multiple traces
- batch_mark_strangers(): Batch mark stranger clusters
- get_face_track_nodes(): Get all face_track nodes for a file
- get_pending_face_tracks(): Get nodes with status='pending'
- get_suggested_face_tracks(): Get nodes with status='suggested'

Identity Matcher updates:
- Add --mark-tkg flag to update TKG nodes after matching
- Integrates with tkg_helper for batch operations

Node properties schema:
- status: pending | suggested | confirmed | stranger
- pending_identity_name/uuid/id: suggested identity info
- suggested_by: tmdb | propagation | manual
- confidence: matching score
- identity_ref: confirmed identity reference
This commit is contained in:
Accusys
2026-06-25 01:11:05 +08:00
parent 6851cb4734
commit 21b9f500d9
2 changed files with 432 additions and 0 deletions
+11
View File
@@ -38,6 +38,7 @@ from qdrant_faces import (
search_seeds,
get_trace_centroid,
)
from tkg_helper import batch_mark_suggestions, batch_mark_strangers
TH_ROUND_1 = 0.55
TH_ROUND_2 = 0.55
@@ -355,6 +356,7 @@ def main():
parser.add_argument("--identity-map", help="JSON file with {trace_id: {identity_id, uuid, name}} (for Round 2+)")
parser.add_argument("--output", help="Output JSON file path")
parser.add_argument("--stranger", action="store_true", help="Also run stranger clustering")
parser.add_argument("--mark-tkg", action="store_true", help="Mark TKG face_track nodes with suggestions")
args = parser.parse_args()
if args.round == 1:
@@ -396,6 +398,15 @@ def main():
stranger_clusters = cluster_strangers(args.file_uuid, matched_traces)
result["stranger_clusters"] = stranger_clusters
# Mark TKG nodes if requested
if args.mark_tkg:
tkg_updated = batch_mark_suggestions(args.file_uuid, suggestions)
result["tkg_nodes_updated"] = tkg_updated
if args.stranger and stranger_clusters:
tkg_strangers = batch_mark_strangers(args.file_uuid, stranger_clusters)
result["tkg_strangers_updated"] = tkg_strangers
output_json = json.dumps(result, indent=2, ensure_ascii=False)
if args.output: