From c3f4b0dd4af6cdf1b3104af9984d50d984ecc8b5 Mon Sep 17 00:00:00 2001 From: jedarden Date: Mon, 6 Jul 2026 17:28:29 -0400 Subject: [PATCH] feat(bf-2ibc): add identity fields to explainability.BlobSnapshot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the three canonical identity fields — PersonName, AssignedColor, IdentityResolved — to explainability.BlobSnapshot (handler.go), the only tracked-blob view that still lacked them (Tier-1 #2 type gap from the bf-1q3m/bf-5cgc handoff). The camelCase JSON keys (personName, assignedColor, identityResolved) and the *bool tri-state choice mirror exactly how commit 1446ccf added them to signal.TrackedBlob / tracker.Blob / tracking.Blob / automation.TrackedBlob, and match the dashboard Blob type in dashboard/types/spaxel.d.ts. Per scope, the fields are DECLARATIONS ONLY: the production creation literal at mothership/cmd/mothership/main.go:2206 (and the handler_test.go literals) set only {ID,X,Y,Z,Confidence}, so the new fields stay at zero values — empty strings and a nil *bool all carry omitempty and serialize as omitted (undefined in JS). Populating them from the ble.IdentityMatcher sidecar and folding in the parallel identityMap (main.go:2216) is a separate downstream bead. Verified: gofmt clean, go vet ./... clean, go build ./... clean, go test ./... passes. Co-Authored-By: Claude Bead-Id: bf-2ibc --- mothership/internal/explainability/handler.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mothership/internal/explainability/handler.go b/mothership/internal/explainability/handler.go index 2481be2..a5ba62f 100644 --- a/mothership/internal/explainability/handler.go +++ b/mothership/internal/explainability/handler.go @@ -97,6 +97,18 @@ type BlobSnapshot struct { X, Y, Z float64 Confidence float64 Weight float64 // Peak height in the grid + + // Canonical identity fields (bf-5151). camelCase JSON keys match the dashboard + // Blob type in dashboard/types/spaxel.d.ts, mirroring signal.TrackedBlob / + // tracker.Blob / tracking.Blob / automation.TrackedBlob (commit 1446ccf). This is + // the explainability view of a blob, which previously lacked these fields (the + // Tier-1 #2 type gap from bf-1q3m). Left at zero values (undefined) for existing + // blobs — a follow-up bead populates them from the BLE identity sidecar, folding in + // the parallel identityMap. IdentityResolved is *bool to faithfully represent the + // tri-state semantics (nil=unattempted, &true=resolved, &false=failed). + PersonName string `json:"personName,omitempty"` + AssignedColor string `json:"assignedColor,omitempty"` + IdentityResolved *bool `json:"identityResolved,omitempty"` // tri-state: nil=unattempted, &true=resolved, &false=failed } // GridSnapshot captures the fusion grid for computing contributions.