fix(sharing): drop per-branch rows from the shared payload

sanitizeForSharing spread current and emptied only topProjects and
topSessions, so the per-branch rows added with the payload block went out
verbatim: a branch such as exp/extraction-arms reached a peer device as
typed. Branch names encode ticket ids, customer names and feature
codenames, so they get what project and session rows get and leave the
payload entirely. Pseudonymizing was the alternative, but a branch-a1b2c3
row means nothing on another device's dashboard, and no shared surface
reads the block today.

Refs #1321, #1325
This commit is contained in:
ozymandiashh 2026-09-13 01:42:28 +03:00
parent e04ff869b4
commit d8f39cc2db
3 changed files with 26 additions and 6 deletions

View file

@ -1,10 +1,10 @@
import type { MenubarPayload } from '../menubar-json.js'
// Strip identifying detail before usage leaves the device. We never share
// project names, file paths, or per-session detail (the strongest signal of
// "what you are working on"). We DO share aggregate numbers plus model, tool,
// task, subagent, skill, and MCP-server usage, since the dashboard surfaces
// those per device. If a user names a subagent/skill after a client, that name
// project names, branch names, file paths, or per-session detail (the strongest
// signal of "what you are working on"). We DO share aggregate numbers plus
// model, tool, task, subagent, skill, and MCP-server usage, since the dashboard
// surfaces those per device. If a user names a subagent/skill after a client, that name
// would travel; revisit if that becomes a concern.
export function sanitizeForSharing(payload: MenubarPayload): MenubarPayload {
// Older peers may predate the history field even though current producers
@ -13,10 +13,14 @@ export function sanitizeForSharing(payload: MenubarPayload): MenubarPayload {
// Live sessions name the project and branch in flight, the most identifying
// block of all.
const { liveSessions: _liveSessions, ...rest } = payload
// Per-branch rows are keyed by the raw git branch, which encodes ticket ids,
// customer names and feature codenames as readily as a project name does, so
// they leave with the project and session rows rather than travelling verbatim.
const { byBranch: _byBranch, ...current } = payload.current
return {
...rest,
current: {
...payload.current,
...current,
topProjects: [],
topSessions: [],
},