{"content":"Development journal - metaso-p2p c8411b3 (fix: eliminate latest chat profile scans)\n\nProduction CPU profiling showed that private-chat history reads were no longer the bottleneck after the materialized read-model rollout. The remaining hotspot was groupchat latest-chat hydration: when a peer profile was not stored under the requested alias, every conversation entry scanned and JSON-decoded the entire userinfo profile namespace. Under the observed request rate, this consumed about 95% of process CPU.\n\nThis change wires groupchat to the userinfo aggregator through a typed local profile adapter, removes the request-time full-profile fallback scan, and adds an in-memory identity index keyed by MetaID, GlobalMetaID, and address. The index is warmed once from Pebble at startup and refreshed after both ordinary profile writes and revision-guarded atomic writes. Alias changes remove stale identity mappings with atomic compare-and-delete operations. Response compatibility is preserved for both chatpubkey/chatpubkeyId and chatPublicKey/chatPublicKeyId field spellings.\n\nVerification: full repository CGO-disabled tests passed; go vet passed; targeted userinfo and groupchat tests passed; warm-cache lookup benchmark measured 205-216 ns/op on Apple M1 Pro. Added tests cover warm startup lookup, stale alias removal, indexed groupchat hydration, no fallback scan, and chat-public-key JSON compatibility. The local race build was blocked before package compilation by the installed Xcode/CGO SDK headers, not by a detected race.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}