- Delete YOLO processor implementation (src/core/processor/yolo.rs)
- Remove YOLO from processing pipeline and worker
- Clean up YOLO-related code across multiple modules
- Add migration 033_remove_yolo.sql
YOLO functionality removed as part of architecture simplification
- Add TraceArtifacts phase to TkgPhase enum (phase 18)
- Report progress as key_frame.jpg/key_face.jpg are created
- VLM trigger now polls until ALL key_frame.jpg files exist
(was: started after TKG build, before artifacts were ready)
- Add iron rule to AGENTS.md: ask before removing data
Tested: Gamma 8 (27 traces) → 27/27 VLM summaries completed
Two pre-existing bugs broke rename/get operations:
1. schema.rs: DO UPDATE referenced 'tp' alias from LEFT JOIN which is
invisible in ON CONFLICT scope → 'missing FROM-clause entry for table tp'
Fix: use {tp_table}.column instead of tp.column
2. profile.rs: SELECT tp.properties / tn.properties can be NULL when no
trace_profile row exists but decoder expected non-optional Value
→ 'unexpected null; try decoding as an Option'
Fix: decode as Option<serde_json::Value> and handle None in merge logic
Single-trace groups with auto-generated names (Person_N) are filtered
to unassigned, but user-named groups are kept even with 1 trace.
This fixes the issue where moving traces one-by-one to a new group
caused them to disappear from the UI.
Before: trace → 'NewGroup' → filtered → unassigned (FS disappeared)
After: trace → 'NewGroup' → shown as group (FS visible)
1. Thumbnail API now checks trace/{tid}/key_face.jpg before ffmpeg
- First request: 8ms (read from disk) vs ~500ms (ffmpeg)
- All 2,451 trace thumbnails now served from pre-cached key_face.jpg
2. Face-groups API accepts ?include_trace_ids=false
- Default: includes trace_ids (32KB for Charade)
- With flag: excludes trace_ids (17KB, 48% reduction)
- Frontend can fetch full data only when user clicks into a group
get_cluster_results_handler derived each group's trace_ids from
COALESCE(tp.properties, tn.properties)->>'trace_id'. Since
trace_profiles.properties is {} this was NULL -> fell back to 0 for
every row, so ALL groups reported trace_ids:[0] and collapsed to the
same representative trace.
Studio's People view renders groups from cluster-results, so every
group showed the same face (trace 0) and "Delete all" / "Merge" operated
on phantom data: batchDeleteGroups deleted trace 0 repeatedly and never
touched the real traces, which is why delete-all appeared to work but
left 16 groups behind and merge kept failing.
Now reads the real tp.trace_id (fallback tn.properties->>'trace_id'),
matching the face-groups fix in 4a480f46. Verified on 9cbeb112:
17 distinct traces now map correctly across 15 groups, no duplicate 0.
Two bugs broke Studio "Merge groups" on files where
trace_profiles.properties is empty {}:
1. get_face_groups_handler derived each group's trace_ids from
COALESCE(tp.properties, tn.properties)->>'trace_id'. Since
trace_profiles.properties is {} the value was NULL -> fell back to 0
for every row, so all groups reported trace_ids:[0] and group_uuid:None.
This corrupted Studio's group selection and caused the merge to fail
with "Target group cannot be in source_groups list" (the target name
collided with a corrupted source entry). Now reads the real
tp.trace_id (falling back to tn.properties->>'trace_id').
2. merge_groups_handler matched/updated tkg_nodes.label by the source
group NAME, which silently no-ops when tkg_nodes.label has drifted
out of sync with trace_profiles.name (e.g. after re-cluster), yielding
traces_merged:0. Rewrote it to resolve source trace_ids from
trace_profiles.name, then update both trace_profiles.name and
tkg_nodes.label by external_id=trace_{tid}, keeping both tables in
sync. Also defensively drops the target name from source_groups so a
client echoing the target no longer hard-fails.
Verified on file 9cbeb112 (FilmRiot): 17 groups now map to distinct
trace_ids 0-16; merge Person_4+Person_5 -> Person_0 yields
traces_merged:2 and updates both tp.name and tn.label. Test mutations
were reverted so the file is back to its original 17-group state.
Studio's "delete group" was calling hard_delete which physically removed
_faces points, tkg_nodes and trace_profiles (and silently failed to back
up to a non-existent _faces_trash collection, making undo impossible).
This permanently lost face groups and broke face-groups/cluster-results
(which are based on tkg_nodes) for any trace without a node row.
Changes:
- delete_trace hard-delete now means "restore to unassigned": keep
_faces/tkg_nodes/trace_profiles, only reset name to "Face Trace {id}".
Data is never destroyed so groups can be rebuilt and undo works.
- schema::ensure_face_track_node: create the face_track tkg_nodes row on
write so a trace that lost its node (old hard-delete) reappears in
face-groups/cluster-results (self-healing). Called from
update_trace_profile_handler, update_trace_profile_group_handler and
merge_groups_handler; the group handler also syncs tkg_nodes.label.
- restore_trace / undo_hard_delete_trace: when _faces_trash is empty
(new semantics), rebuild the named group from the operation snapshot
(tkg_nodes ON CONFLICT UPDATE + trace_profiles UPSERT) instead of 404.
Verified live on port 3002 (file bfba056f...): delete -> unassigned with
_faces preserved (4 points), rebuild group -> self-healing creates node
and group shows up, restore -> name restored to original. Also fixed the
pre-existing missing tkg_nodes row for trace 4621 via the same path.
- src/api/profile.rs: new get_cluster_results_handler
- Query param file_hash (Studio passes ?file_hash=)
- Builds face_groups from tkg_nodes + trace_profiles (same grouping as
face-groups handler) with group_id/cluster_id/name/trace_ids/
trace_count/representative_trace
- Scrolls _faces for the file, groups faces by frame into frames[]
- face_id = hex point id (matches identities.rs convention)
- timestamp = frame / fps (from videos table)
- cluster_id = group of the face's trace_id; unassigned faces skipped
- Response: { success, file_uuid, face_groups, frames } matching Studio
PeopleView.vue expected format
- profile.rs: single/group/merge_groups/undo all use upsert_trace_profile
- trace_agent_api.rs: hard delete/merge snapshot + delete trace_profiles
- cluster_agent.rs, job_worker.rs: background name writes use UPSERT
- schema.rs: upsert_trace_profile helper (backfill from tkg_nodes)
- Studio 3 API gaps documented (cluster-results/identity-matches/similar)
- get_face_groups_handler: COALESCE(tp.name, tn.label) for name consistency
- sync_file_status: compare JSON vs pre_chunks (not chunk table)
- face consistency: compare frames.len() not total_faces
- cleanup 2 ghost records with NULL file_name/file_path
- replace identity_agent with face_dedup in pipeline stages
- remove identity_agent_api.rs and all references
- update required_processors to match actual processors
- update AGENTS.md with team responsibilities
- add Studio pipeline changes documentation
- Add [OCR], [ASRX], [ASRX+OCR] prefix to text_content
- Add content field to SemanticSearchResult struct
- Update SQL queries to include content field
- Helps users distinguish the source of search results