diff --git a/mothership/internal/automation/engine.go b/mothership/internal/automation/engine.go index db76136..03f02d7 100644 --- a/mothership/internal/automation/engine.go +++ b/mothership/internal/automation/engine.go @@ -1339,6 +1339,14 @@ type TrackedBlob struct { X, Y, Z float64 VX, VY, VZ float64 Confidence float64 + + // Canonical identity fields (bf-5151). camelCase JSON keys match the dashboard + // Blob type in dashboard/types/spaxel.d.ts. Left at zero values (undefined) for + // existing blobs — a follow-up bead populates them from the BLE identity sidecar + // so person-aware automations ("when Alice enters…") can fire. + PersonName string `json:"personName,omitempty"` + AssignedColor string `json:"assignedColor,omitempty"` + IdentityResolved *bool `json:"identityResolved,omitempty"` // tri-state: nil=unattempted, &true=resolved, &false=failed } // Evaluate processes tracked blobs and triggers automations based on zone/volume crossings. diff --git a/mothership/internal/signal/processor.go b/mothership/internal/signal/processor.go index b83e7cb..20f4282 100644 --- a/mothership/internal/signal/processor.go +++ b/mothership/internal/signal/processor.go @@ -596,6 +596,15 @@ type TrackedBlob struct { IdentityConfidence float64 `json:"identity_confidence,omitempty"` IdentitySource string `json:"identity_source,omitempty"` Posture string `json:"posture,omitempty"` + + // Canonical identity fields (bf-5151). camelCase JSON keys match the dashboard + // Blob type in dashboard/types/spaxel.d.ts; the snake_case PersonLabel/PersonColor + // above are retained as deprecated aliases for backward compatibility. Left at + // their zero values here (undefined) — a follow-up bead populates them from the + // BLE identity sidecar. + PersonName string `json:"personName,omitempty"` + AssignedColor string `json:"assignedColor,omitempty"` + IdentityResolved *bool `json:"identityResolved,omitempty"` // tri-state: nil=unattempted, &true=resolved, &false=failed } // SetTrackedBlobs stores the latest tracked blobs from the fusion engine. diff --git a/mothership/internal/tracker/tracker.go b/mothership/internal/tracker/tracker.go index 74ed6bc..1e62ec6 100644 --- a/mothership/internal/tracker/tracker.go +++ b/mothership/internal/tracker/tracker.go @@ -51,6 +51,14 @@ type Blob struct { IdentitySource string `json:"identity_source,omitempty"` // "ble_triangulation", "ble_only", or "" IdentityLastSeen time.Time `json:"-"` // Last time identity was confirmed + // Canonical identity fields (bf-5151). camelCase JSON keys match the dashboard + // Blob type in dashboard/types/spaxel.d.ts; the snake_case fields above are + // retained as deprecated aliases. Left at zero values (undefined) for existing + // blobs — populated later from the BLE identity sidecar. + PersonName string `json:"personName,omitempty"` + AssignedColor string `json:"assignedColor,omitempty"` + IdentityResolved *bool `json:"identityResolved,omitempty"` // tri-state: nil=unattempted, &true=resolved, &false=failed + ukf *UKF // internal — nil in copies returned to callers } diff --git a/mothership/internal/tracking/tracker.go b/mothership/internal/tracking/tracker.go index 4e30fb9..1df5ab1 100644 --- a/mothership/internal/tracking/tracker.go +++ b/mothership/internal/tracking/tracker.go @@ -37,6 +37,14 @@ type Blob struct { IdentitySource string `json:"identity_source,omitempty"` // "ble_triangulation", "ble_only", or "" IdentityLastSeen time.Time `json:"-"` // Last time identity was confirmed Posture Posture `json:"posture,omitempty"` // Estimated body posture + + // Canonical identity fields (bf-5151). camelCase JSON keys match the dashboard + // Blob type in dashboard/types/spaxel.d.ts; the snake_case fields above are + // retained as deprecated aliases. Left at zero values (undefined) for existing + // blobs — populated later from the BLE identity sidecar. + PersonName string `json:"personName,omitempty"` + AssignedColor string `json:"assignedColor,omitempty"` + IdentityResolved *bool `json:"identityResolved,omitempty"` // tri-state: nil=unattempted, &true=resolved, &false=failed } // TrailMaxLen is the maximum number of trail points kept per blob.