feat(bf-2ibc): add identity fields to explainability.BlobSnapshot

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 <noreply@anthropic.com>
Bead-Id: bf-2ibc
This commit is contained in:
jedarden 2026-07-06 17:28:29 -04:00
parent 01a415dd5c
commit c3f4b0dd4a

View file

@ -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.