From bac59e53a9013f26d3ca6a1723600542e737f034 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 17 Nov 2026 23:12:09 -0500 Subject: [PATCH 1/4] Customers list: GitHub avatars, tag pills and one-line rows (#18885) Avatars come from github.com for a confirmed GitHub login only, lazy, no referrer, fixed size, initial as fallback; never keyed by email. Tags, identities and origin are pills; rows are one line. customers.avatars.enabled (env HIVE_CUSTOMERS_AVATARS_ENABLED, Settings Features) switches avatars off. Fixes #18885 Signed-off-by: Andrew Anderson --- .../added-18885-customers-avatars-pills.md | 1 + src/docs/design/customers.md | 23 ++- src/docs/env-vars.md | 1 + src/docs/operator-reference/README.md | 1 + src/docs/security-model.md | 12 ++ src/hive.yaml.example | 2 + src/pkg/config/customers.go | 37 ++++ src/pkg/config/customers_test.go | 27 +++ src/pkg/dashboard/api_customers.go | 23 ++- src/pkg/dashboard/api_customers_test.go | 33 ++++ src/pkg/dashboard/api_governor_features.go | 9 + src/pkg/dashboard/customers_ui_test.go | 111 +++++++++++- .../dashboard/static-src/css/customers.css | 34 +++- .../static-src/js/config-features.js | 5 + .../dashboard/static-src/js/config-state.js | 1 + src/pkg/dashboard/static-src/js/customers.js | 120 +++++++++++-- src/pkg/dashboard/static/index.html | 160 +++++++++++++++--- 17 files changed, 548 insertions(+), 52 deletions(-) create mode 100644 changelog.d/added-18885-customers-avatars-pills.md diff --git a/changelog.d/added-18885-customers-avatars-pills.md b/changelog.d/added-18885-customers-avatars-pills.md new file mode 100644 index 0000000000..d37c5bbe79 --- /dev/null +++ b/changelog.d/added-18885-customers-avatars-pills.md @@ -0,0 +1 @@ +- The Customers list is one line per person: a GitHub picture where the person has a confirmed GitHub login (initial otherwise; never looked up by email), identities, origin and tags as pills with a tone per default tag and a mark for tags set by hand, "+N" when there are more, and the date muted on the right. Suggested rows and the profile header use the same density. The picture is requested by the viewer's browser from github.com with no referrer; `customers.avatars.enabled` (env `HIVE_CUSTOMERS_AVATARS_ENABLED`, Settings, Features) turns it off, default on (#18885). diff --git a/src/docs/design/customers.md b/src/docs/design/customers.md index d00f54a7cd..0f800e29de 100644 --- a/src/docs/design/customers.md +++ b/src/docs/design/customers.md @@ -468,12 +468,31 @@ position: 3. The owner can forget anyone; the tombstone stops a rebuild. 4. Retention follows the source: an edge cannot outlive its artefact. 5. Nothing leaves the hive. No hub sync, nothing written to GitHub, nothing in - a heartbeat. + a heartbeat. The one thing a browser fetches for this section is a public GitHub + picture, described next. + +**Avatars.** The one exception to "nothing leaves the hive" is not data the hive +sends. The Customers list shows a GitHub picture next to a person who has a +confirmed GitHub login, so the viewer's browser requests +`https://github.com/.png` (GitHub redirects to its own image host) for +each such person on screen, lazily, with `referrerpolicy="no-referrer"`. GitHub +sees the viewer's IP address and which logins were requested, so it can tell +that someone looking at this dashboard has those GitHub users in their customer +list. It is not sent the hive's address, the page, a token, a name, a tag or +anything else about the person. The hive's server does not fetch, proxy or +store the pictures. A person known only by +email, Slack, Discord, Teams or Meet gets an initial or a source icon, and no +service keyed by an email address or its hash (Gravatar and the like) is ever +asked, because that would hand the address to a third party. To turn pictures +off set `customers.avatars.enabled: false`, set `HIVE_CUSTOMERS_AVATARS_ENABLED=false`, +or switch **Customer avatars** off in Settings, Features; the list then shows +initials and makes no request to github.com. The default is on, because the +dashboard already loads GitHub avatars for contributors and sign-ins. [telemetry.md](../telemetry.md) records the review of Hive's outbound paths against the Linux Foundation telemetry policy, which says project software should not collect telemetry by default without review and prior consent. This -feature adds no outbound path, which is what allows it to be on by default. +feature adds no outbound path from the hive, which is what allows it to be on by default. The avatar request above is made by the viewer's browser to a site they already use, and has its own switch. Any later proposal to send customer data to a hub is its own RFC and falls under that review. diff --git a/src/docs/env-vars.md b/src/docs/env-vars.md index bee5cfa131..c2145424ea 100644 --- a/src/docs/env-vars.md +++ b/src/docs/env-vars.md @@ -272,6 +272,7 @@ new value at the same time. | `HIVE_TMUX_HISTORY_LIMIT` | No | `50000` | tmux scrollback depth applied when an agent session is created (positive integer; the authoritative knob for terminal scrollback and full-log capture). | | `HIVE_CUSTOMERS_ENABLED` | No | config `customers.enabled` (default on) | Turns the Customers section and its people store on or off; `false` opens no store, runs no sweep and hides the section, overriding config. Nothing the store holds leaves the hive. | | `HIVE_CUSTOMERS_INFERENCE_ENABLED` | No | config `customers.inference.enabled` (default off) | Turns goal and satisfaction suggestions on or off, overriding config. Needs Customers on. When on, a customer's own issues, pull requests and approved mail are sent to the meetings model; every suggestion waits for a person to confirm, edit or reject it. | +| `HIVE_CUSTOMERS_AVATARS_ENABLED` | No | config `customers.avatars.enabled` (default on) | Turns GitHub pictures on the Customers list on or off, overriding config. On, the viewer's browser requests `https://github.com/.png` with no referrer for each person with a confirmed GitHub login; off, the list shows initials and makes no request to github.com. | | `HIVE_SESSIONS_ENABLED` | No | config `dashboard.sessions.enabled` (default on) | Turns the dashboard Inception (spek) sessions feature (interactive CLI terminals, `/api/sessions`) on or off; `false` hides it, overriding config. Limits: `HIVE_SESSIONS_MAX`, `HIVE_SESSIONS_MAX_PER_USER`, `HIVE_SESSIONS_IDLE_TTL_HOURS`. Workspace: `HIVE_SESSIONS_WORKSPACE_REPO` (the `org/repo` sessions open in, default `project.org/primary_repo`), `HIVE_SESSIONS_WORKSPACE_DIR` (root of the one shared clone per repo, `//`, and of each session's own git worktree of it, `/.sessions///` on branch `hive-session/`; sessions share commits and branches but not uncommitted edits or `.spektacular/` state; default `/data/session-sandbox/workspace`), `HIVE_SESSIONS_GID` (the sessions-only group that shares the clone, default 20000). Inbox seeds: `HIVE_SESSIONS_SEED_MAX_BYTES` (cap on one item's enveloped text in `.hive/inbox/`, default 524288); see [Sessions API](api-reference/sessions.md). | | `HIVE_SESSIONS_AUTOSTART` | No | config `dashboard.sessions.autostart` (default on) | Turns the session startup auto-answer on or off, overriding config: when a session starts the hive answers the vendor CLI's startup screens (first-run notice, trust for the session's folder, onboarding) so its first request runs unattended. It never answers a permission prompt or a login screen. `HIVE_SESSIONS_AUTOSTART_WINDOW_SEC` (default `90`) bounds how long it answers for after a start. See [Startup auto-answer](api-reference/sessions.md#startup-auto-answer). | | `HIVE_TTYD_HISTORY_LIMIT` | No | `50000` | Defense-in-depth history-limit raise applied at browser attach time; only affects panes created after attach. | diff --git a/src/docs/operator-reference/README.md b/src/docs/operator-reference/README.md index b56b139b55..5c8e409265 100644 --- a/src/docs/operator-reference/README.md +++ b/src/docs/operator-reference/README.md @@ -224,6 +224,7 @@ Top-level YAML keys accepted by `config.Config`: | `chat.grounded_answers` | Hive Chat grounded answers: a chat message that is not a bare command (`/agents stuck`, `/prs waiting on review`, "which agent completed last?") is answered by one read-only model turn over a capped snapshot of the hive state the dashboard already holds (agents, open PRs, actionable issues, decisions, governor, alerts, version), citing the items used or saying it does not have the data. Chat never takes actions on this path; every attempt is audited as `chat_grounded_answer`. | Default ON (`enabled: true`); `enabled: false` makes scoped questions answer with the command's usage instead. `model` overrides the governor reviewer model for the turn. See [Hive Chat](../dashboard.md#hive-chat). | | `customers` | Customers: one profile per person built from what the hive already holds, kept in `/data/customers/people.json` (0600) with a rebuildable edge index in `/data/graph/customers.db`. Dashboard users and people added by hand are customers; anyone else is only a suggestion until accepted. Nothing it stores leaves the hive. Design: [customers](../design/customers.md). | Default ON (`enabled: true`); `enabled: false` (or `HIVE_CUSTOMERS_ENABLED=false`) opens no store, runs no sweep and hides the section. | | `customers.inference` | Goal and satisfaction suggestions (see `customers`): the hive reads a customer's own issues, pull requests and approved mail, asks the model configured for meetings for candidate goals and a satisfaction level with the evidence behind each, and files them as suggestions for a person to confirm, edit or reject. A confirmed or manual value is never overwritten. | Default OFF (`enabled: false`) because it sends that text to the model; `enabled: true` (or `HIVE_CUSTOMERS_INFERENCE_ENABLED=true`) turns it on. Needs `customers.enabled` and a meetings model (OpenAI-compatible or Anthropic); budget about 40,000 tokens a day. | +| `customers.avatars` | GitHub pictures on the Customers list. The viewer's browser requests `https://github.com/.png` (no referrer) for each person with a confirmed GitHub login on screen; nobody known only by email is looked up anywhere, and the hive neither proxies nor stores pictures. See [customers](../design/customers.md). | Default ON (`enabled: true`); `enabled: false` (or `HIVE_CUSTOMERS_AVATARS_ENABLED=false`, or Settings, Features) shows initials and makes no request to github.com. | | `governor.first_timer_welcome` | First-time contributor welcome: when a human whose GitHub `author_association` is `FIRST_TIME_CONTRIBUTOR`/`FIRST_TIMER` opens a PR, post one comment (per author per repo, marker ``) that thanks them and invites them to run their own hive — profile, leaderboard, trust-tier progression, offline review-fix/rebase handling. Bots, `author/clanker`/`author/hive` PRs, drafts and known relay contributors are skipped. | Default ON; `enabled: false` opts out; `template_path` overrides the text. Silent without a public dashboard URL. See [Welcoming first-time contributors](../good-first-issue.md#welcoming-first-time-contributors). | | `sla` | Delivery SLA targets (`sla.targets.start_to_pr_h`, `pr_to_merge_h`, `open_to_merge_h`, hours; defaults 4 / 24 / 72) the dashboard's Throughput section colours its Delivery SLA spans against. | Metrics are derived from the lifecycle timeline; no extra GitHub calls. Also editable from **Settings → Thresholds**. See [Delivery SLA](sweeps-and-operations.md#delivery-sla). | | `sentinel` | Suspicious-activity alerts: flags open PRs (any author) that touch sensitive files or look like security overrides, privilege escalation, or codebase damage. | Default ON; observe-and-alert only. See [Suspicious-activity alerts](sweeps-and-operations.md#suspicious-activity-alerts-sentinel). | diff --git a/src/docs/security-model.md b/src/docs/security-model.md index ae61713948..9c906ec9c4 100644 --- a/src/docs/security-model.md +++ b/src/docs/security-model.md @@ -219,6 +219,18 @@ login. The hub put that entry there after it signed the person in with GitHub, so the hive trusts it. If your access list is edited by hand, an entry like that gives the named person's profile the matching GitHub activity. +One part of the section is a request your browser makes, not the hive. The list +shows a GitHub picture for each person with a confirmed GitHub login, so the +browser asks `https://github.com/.png` for the people on screen, lazily +and with no referrer. GitHub learns the viewer's IP address and which logins were requested, so it can +tell that this viewer has those GitHub users in their customer list, and nothing +else about them. The hive does not proxy or store pictures, and +nobody known only by an email address is looked up anywhere (no Gravatar or +other service keyed by a hash of an address). The dashboard's `img-src` already +allows `https:`, so no policy changes; a test pins it. Set +`customers.avatars.enabled: false`, `HIVE_CUSTOMERS_AVATARS_ENABLED=false` or the +Settings, Features switch to show initials and make no such request. + A read-only user sees only their own profile. An identity they add is shown as unconfirmed. It links nothing until the owner or a read-write user confirms it. diff --git a/src/hive.yaml.example b/src/hive.yaml.example index cc7f1fccfa..33d2522128 100644 --- a/src/hive.yaml.example +++ b/src/hive.yaml.example @@ -1369,3 +1369,5 @@ data: # enabled: true # false (or env HIVE_CUSTOMERS_ENABLED=false) opens no store and hides the section # inference: # enabled: false # true (or env HIVE_CUSTOMERS_INFERENCE_ENABLED=true) suggests goals and satisfaction with the meetings model; default off +# avatars: +# enabled: true # false (or env HIVE_CUSTOMERS_AVATARS_ENABLED=false) shows initials and makes no browser request to github.com for pictures; default on diff --git a/src/pkg/config/customers.go b/src/pkg/config/customers.go index af8911fb72..62e8e4d694 100644 --- a/src/pkg/config/customers.go +++ b/src/pkg/config/customers.go @@ -18,6 +18,29 @@ type CustomersConfig struct { // never signed up, to the model the meetings feature is configured to // use. Inference CustomersInferenceConfig `yaml:"inference,omitempty" json:"inference,omitempty"` + // Avatars gates GitHub profile pictures in the Customers list. Default + // ON. It is the one part of the section that makes the viewer's browser + // contact another site: github.com, for people already on screen. + Avatars CustomersAvatarsConfig `yaml:"avatars,omitempty" json:"avatars,omitempty"` +} + +// EnvCustomersAvatarsEnabled overrides customers.avatars.enabled when it +// holds a recognised boolean. +const EnvCustomersAvatarsEnabled = "HIVE_CUSTOMERS_AVATARS_ENABLED" + +// CustomersAvatarsConfig (`customers.avatars:`) turns GitHub profile pictures +// on the Customers list on or off. On, the viewer's browser requests +// https://github.com/.png for each customer or suggestion whose +// identity is a GitHub login, with no referrer. Off, the list shows initials +// and makes no such request. +type CustomersAvatarsConfig struct { + // Enabled turns avatars on. nil = true. + Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"` +} + +// IsEnabled reports whether avatars are on (default on). +func (c CustomersAvatarsConfig) IsEnabled() bool { + return c.Enabled == nil || *c.Enabled } // EnvCustomersInferenceEnabled overrides customers.inference.enabled when it @@ -72,3 +95,17 @@ func (c *Config) CustomersInferenceEnabled() bool { } return c.Customers.Inference.IsEnabled() } + +// CustomersAvatarsEnabled reports whether GitHub avatars show on the +// Customers list: the HIVE_CUSTOMERS_AVATARS_ENABLED env wins over +// customers.avatars.enabled when it holds a recognised boolean. A nil config +// is the default, on. +func (c *Config) CustomersAvatarsEnabled() bool { + if v, ok := parseBoolEnv(EnvCustomersAvatarsEnabled); ok { + return v + } + if c == nil { + return true + } + return c.Customers.Avatars.IsEnabled() +} diff --git a/src/pkg/config/customers_test.go b/src/pkg/config/customers_test.go index 626437542d..d655ef43fd 100644 --- a/src/pkg/config/customers_test.go +++ b/src/pkg/config/customers_test.go @@ -83,3 +83,30 @@ func TestCustomersInferenceDefaultsOffAndNeedsCustomers(t *testing.T) { t.Fatal("a nil config has inference off") } } + +func TestCustomersAvatarsEnabled(t *testing.T) { + t.Setenv(EnvCustomersAvatarsEnabled, "") + cfg := &Config{} + if !cfg.CustomersAvatarsEnabled() { + t.Fatal("avatars must default on") + } + off, on := false, true + cfg.Customers.Avatars.Enabled = &off + if cfg.CustomersAvatarsEnabled() { + t.Fatal("explicit false") + } + t.Setenv(EnvCustomersAvatarsEnabled, "true") + if !cfg.CustomersAvatarsEnabled() { + t.Fatal("env true must win over config false") + } + cfg.Customers.Avatars.Enabled = &on + t.Setenv(EnvCustomersAvatarsEnabled, "false") + if cfg.CustomersAvatarsEnabled() { + t.Fatal("env false must win over config true") + } + var none *Config + t.Setenv(EnvCustomersAvatarsEnabled, "") + if !none.CustomersAvatarsEnabled() { + t.Fatal("a nil config has avatars on") + } +} diff --git a/src/pkg/dashboard/api_customers.go b/src/pkg/dashboard/api_customers.go index 39fc6c4723..615b0b326a 100644 --- a/src/pkg/dashboard/api_customers.go +++ b/src/pkg/dashboard/api_customers.go @@ -292,7 +292,28 @@ func (s *Server) handleCustomersList(w http.ResponseWriter, r *http.Request) { s.customersError(w, r, err) return } - jsonResponse(w, out) + jsonResponse(w, s.withCustomersAvatars(out)) +} + +// withCustomersAvatars adds the live avatars switch to the list answer, so +// the page knows whether it may ask github.com for profile pictures. It is +// read per request, so turning it off in Settings takes effect on the next +// refresh, and the answer is unchanged if the list cannot be re-encoded. +func (s *Server) withCustomersAvatars(out any) any { + raw, err := json.Marshal(out) + if err != nil { + return out + } + var m map[string]any + if json.Unmarshal(raw, &m) != nil || m == nil { + return out + } + on := true + if s.deps != nil && s.deps.Config != nil { + on = s.deps.Config.CustomersAvatarsEnabled() + } + m["avatars"] = on + return m } func (s *Server) handleCustomersGet(w http.ResponseWriter, r *http.Request) { diff --git a/src/pkg/dashboard/api_customers_test.go b/src/pkg/dashboard/api_customers_test.go index 99fd2cc653..bbd1057b15 100644 --- a/src/pkg/dashboard/api_customers_test.go +++ b/src/pkg/dashboard/api_customers_test.go @@ -7,6 +7,8 @@ import ( "net/http/httptest" "strings" "testing" + + "github.com/hivecommons/hive/pkg/config" ) // fakeCustomersService records the viewer each call was made with, so the @@ -426,3 +428,34 @@ func TestCustomersMergeSplitExportBodiesAndAudit(t *testing.T) { t.Fatalf("a conflicting merge = %d", rec.Code) } } + +// The list answer carries the live avatars switch, so the page asks github.com +// for pictures only while the hive allows it. +func TestCustomersListCarriesAvatarsSwitch(t *testing.T) { + t.Setenv(config.EnvCustomersAvatarsEnabled, "") + s, _ := apiServer(t) + s.SetCustomersService(&fakeCustomersService{}) + if s.deps.Config == nil { + s.deps.Config = &config.Config{} + } + get := func() map[string]any { + rec := customersDo(s, custOwner, http.MethodGet, "/api/customers", "") + var m map[string]any + if rec.Code != http.StatusOK || json.Unmarshal(rec.Body.Bytes(), &m) != nil { + t.Fatalf("list = %d %s", rec.Code, rec.Body.String()) + } + return m + } + if got := get(); got["avatars"] != true || got["enabled"] != true { + t.Fatalf("default list = %v, want avatars on", got) + } + off := false + s.deps.Config.Customers.Avatars.Enabled = &off + if got := get(); got["avatars"] != false { + t.Fatalf("avatars off = %v", got) + } + t.Setenv(config.EnvCustomersAvatarsEnabled, "true") + if got := get(); got["avatars"] != true { + t.Fatalf("env on must win = %v", got) + } +} diff --git a/src/pkg/dashboard/api_governor_features.go b/src/pkg/dashboard/api_governor_features.go index 2c86a6ddc0..58e217a67f 100644 --- a/src/pkg/dashboard/api_governor_features.go +++ b/src/pkg/dashboard/api_governor_features.go @@ -142,6 +142,9 @@ func (s *Server) handleGovernorFeatures(w http.ResponseWriter, r *http.Request) // #18742: customers.inference.enabled, goal and satisfaction // suggestions made with a model. Default off. CustomersInferenceEnabled *bool `json:"customersInferenceEnabled"` + // customers.avatars.enabled: GitHub profile pictures on the + // Customers list. Default on. + CustomersAvatarsEnabled *bool `json:"customersAvatarsEnabled"` AutonomyAutoPromote *bool `json:"autonomyAutoPromote"` AutonomyAutoDemote *bool `json:"autonomyAutoDemote"` @@ -371,6 +374,10 @@ func (s *Server) handleGovernorFeatures(w http.ResponseWriter, r *http.Request) on := *body.CustomersInferenceEnabled cfg.Customers.Inference.Enabled = &on } + if body.CustomersAvatarsEnabled != nil { + on := *body.CustomersAvatarsEnabled + cfg.Customers.Avatars.Enabled = &on + } if claimsTTLsChanged { applyClaimsTTLs(&cfg.Governor.Claims, body.ClaimsTTLS, body.ClaimsHumanTTLS, body.ClaimsAgentTTLS, body.ClaimsContributorTTLS, body.ClaimsMaxTTLS) // Live claims keep their expiry; claims made or renewed from now on @@ -577,6 +584,8 @@ func featuresSectionResponse(cfg *config.Config) map[string]interface{} { "customersEffective": cfg.CustomersEnabled(), "customersInference": cfg.Customers.Inference.IsEnabled(), "customersInferenceEffective": cfg.CustomersInferenceEnabled(), + "customersAvatars": cfg.Customers.Avatars.IsEnabled(), + "customersAvatarsEffective": cfg.CustomersAvatarsEnabled(), "publicationEnabled": cfg.Publication.Enabled, "publicationPrivateChannel": cfg.Publication.PrivateChannel, "publicationOwner": cfg.Publication.Owner, diff --git a/src/pkg/dashboard/customers_ui_test.go b/src/pkg/dashboard/customers_ui_test.go index 71cacc1757..d7ffa73d31 100644 --- a/src/pkg/dashboard/customers_ui_test.go +++ b/src/pkg/dashboard/customers_ui_test.go @@ -96,6 +96,8 @@ func TestCustomersViewGates(t *testing.T) { "customersSuggestionGroupHtml", "customersAttachHtml", "customersSuggestionOrder", "customersNeighbour", "customersFocusSuggestion", "customersAfterSuggestion", "customersAccept", "customersDismiss", "customersShowMore", "customersPickerOpen", "customersProfilePickerOpen", "customersPickerClose", "customersAttach", "customersHintAnswer", + "customersAvatarsOn", "customersGithubLogin", "customersAvatarHtml", "customersMorePill", "customersSourcePills", + "customersOriginPill", "customersTagPill", "customersTagPills", "graphcanvasRound", "graphcanvasLabel", "graphcanvasLayout", "graphcanvasSvg", } { fns = append(fns, jsFunc(t, html, name)) @@ -103,6 +105,7 @@ func TestCustomersViewGates(t *testing.T) { consts := "" for _, name := range []string{"CUSTOMERS_KIND_LABELS", "CUSTOMERS_ADDABLE_KINDS", "CUSTOMERS_LEVEL_LABELS", "CUSTOMERS_LEVEL_PILL", "CUSTOMERS_ORIGIN_LABELS", "CUSTOMERS_REF_KIND_LABELS", "CUSTOMERS_REF_GH", "CUSTOMERS_REF_WORDS", "CUSTOMERS_GROUP_SHOWN", "CUSTOMERS_SUGGESTED_GROUPS", "CUSTOMERS_OTHER_GROUP", "CUSTOMERS_KIND_ICONS", + "CUSTOMERS_ORIGIN_SHORT", "CUSTOMERS_SOURCE_PILLS_SHOWN", "CUSTOMERS_TAG_PILLS_SHOWN", "CUSTOMERS_GITHUB_LOGIN", "CUSTOMERS_AVATAR_PX", "CUSTOMERS_AVATAR_FETCH_PX", "GRAPHCANVAS_W", "GRAPHCANVAS_H", "GRAPHCANVAS_RING_ARTEFACT", "GRAPHCANVAS_RING_PEOPLE", "GRAPHCANVAS_MAX_ARTEFACTS", "GRAPHCANVAS_LABEL_MAX"} { consts += jsConstBlock(t, html, name) + "\n" } @@ -125,7 +128,7 @@ const person = { merged_from: [{ person: { id: 'p_old', name: 'Old ' }, by: 'olivia', at: '2026-10-01T00:00:00Z' }], counts: { authored: 3 }, hints: [{ id: 'h_1', other_kind: 'email', other_value: 'ada@.org', reason: 'the address and the login start the same' }, { id: 'h_2', other_kind: 'customer', other_value: 'Ada B' }] }; -const base = { enabled: true, me: Object.assign({}, person, { id: 'p_me', me: true, name: 'Me' }), people: [person, { id: 'p_two', name: 'Two' }], suggestions: [{ id: 's_1', kind: 'github', value: 'stranger', counts: { authored: 2 }, evidence: ['gh:issue:o/r#9'] }], default_tags: ['maintainer', 'contributor', 'end-user', 'stakeholder'], levels: ['unknown', 'at_risk', 'neutral', 'satisfied'] }; +const base = { enabled: true, avatars: true, me: Object.assign({}, person, { id: 'p_me', me: true, name: 'Me' }), people: [person, { id: 'p_two', name: 'Two' }], suggestions: [{ id: 's_1', kind: 'github', value: 'stranger', counts: { authored: 2 }, evidence: ['gh:issue:o/r#9'] }], default_tags: ['maintainer', 'contributor', 'end-user', 'stakeholder'], levels: ['unknown', 'at_risk', 'neutral', 'satisfied'] }; // Owner: everything. _customersData = Object.assign({}, base, { full: true, owner: true }); @@ -335,6 +338,46 @@ must(meRow.includes('me') && !meRow.incl must(meRow.includes('class="customers-avatar"') && meRow.includes('>C') && meRow.includes('customers-row-actions') && meRow.includes('My profile'), 'a row lacks its avatar or its action group'); must(customersGoalsHtml({ goals: [] }).includes('No goal yet.'), 'the profile does not say "No goal yet"'); +// Avatars: a confirmed GitHub login gets the GitHub picture, lazily, with no +// referrer, at a fixed size, over the initial; nothing keyed by an email is ever +// requested; the hive can switch them off. +const ghPerson = { id: 'p_gh', name: 'Grace ', origin: 'accepted', identities: [{ kind: 'email', value: 'grace@example.com' }, { kind: 'github', value: 'ghopper' }], tags: [] }; +let ghRow = customersRowHtml(ghPerson, false); +must(ghRow.includes('G'), 'the initial must stay under the picture'); +const hosts = (ghRow.match(/(?:src|href)="https?:\/\/[^"\/]+/g) || []); +must(hosts.every(h => h.endsWith('://github.com')), 'a row asks a host other than github.com: ' + hosts); +const emailOnly = customersRowHtml({ id: 'p_e', name: 'Eve', identities: [{ kind: 'email', value: 'eve@example.com' }, { kind: 'slack', value: 'U1' }, { kind: 'github', value: 'not a login', }, { kind: 'github', value: 'mallory', claimed: true }] }, false); +must(!emailOnly.includes('G'), 'avatars off must show the initial and request nothing'); +_customersData = Object.assign({}, base, { full: true, owner: true }); +delete _customersData.avatars; +must(!customersRowHtml(ghPerson, false).includes('maintainer'), 'a default tag is not a toned pill: ' + pillRow); +must(!/class="badge customers-chip"/.test(pillRow) && !pillRow.includes('customers-row-meta'), 'tags are still plain badges or the meta line is back'); +must(pillRow.includes('customers-tag" data-source="manual" title="vip - Set by olivia"') && !pillRow.includes('data-tag="vip"') && pillRow.includes('customers-tag-dot'), 'a free-form manual tag must be neutral and marked'); +must(!pillRow.includes('>end-user<'), 'an off tag is shown'); +must((pillRow.match(/customers-tag"/g) || []).length === CUSTOMERS_TAG_PILLS_SHOWN && pillRow.includes('customers-more" title="stakeholder">+1'), 'tag overflow: ' + pillRow); +must(pillRow.includes('customers-source" data-kind="github"') && pillRow.includes('customers-source" data-kind="email"') && pillRow.includes('customers-more" title="Slack: U9">+1') && !pillRow.includes('>U9<') && !pillRow.includes('data-kind="hive_user"') && !pillRow.includes('data-kind="name"'), 'identity pills: ' + pillRow); +must(pillRow.includes('customers-origin" title="hive user, updated ') && pillRow.includes('>hive user') && pillRow.includes('data-status="ok"') && pillRow.includes('customers-updated'), 'origin, status or date: ' + pillRow); +must(pillRow.indexOf('customers-source') < pillRow.indexOf('customers-origin') && pillRow.indexOf('customers-origin') < pillRow.indexOf('customers-tag') && pillRow.indexOf('customers-tag') < pillRow.indexOf('data-status="ok"') && pillRow.indexOf('data-status="ok"') < pillRow.indexOf('customers-updated') && pillRow.indexOf('customers-updated') < pillRow.indexOf('customers-row-actions'), 'order'); +must(!/class="customers-row-title"/.test(pillRow) && (pillRow.match(/
{ console.error(e.stack || e.message); process.exit(1); }); ` + +// The avatar request goes to github.com from the browser, which the page's +// img-src must allow, and to nothing less narrow than https. This pins that +// the policy admits it without ever admitting plain http or a wildcard host. +func TestCustomersAvatarsCSPImgSrc(t *testing.T) { + got := cspDirective(servedCSP(t), "img-src") + if got != "img-src 'self' data: https:" { + t.Fatalf("img-src = %q; GitHub avatars (https://github.com/.png, which redirects to avatars.githubusercontent.com) need https:, and nothing broader (no http:, no *) is acceptable", got) + } +} + +// The Features tab renders the avatars switch wired to the key the API reads. +func TestFeaturesTab_CustomersAvatarsToggleMarkup(t *testing.T) { + html := featuresMarkup(t) + for _, want := range []string{ + `data-section="features" data-key="customersAvatarsEnabled"`, + `yamlHint('customers.avatars.enabled')`, + `f.customersAvatarsEffective !== f.customersAvatars`, + `HIVE_CUSTOMERS_AVATARS_ENABLED overrides this setting`, + } { + if !strings.Contains(html, want) { + t.Errorf("index.html missing %q", want) + } + } +} + +// customers.avatars.enabled: default on, owner-only, persisted, reported with +// the effective value, left alone by an unrelated PUT and overridden by env. +func TestGovernorFeatures_CustomersAvatarsToggleRoundTrip(t *testing.T) { + t.Setenv(config.EnvCustomersAvatarsEnabled, "") + s := covApiServer(t) + type payload struct { + Features struct { + Avatars bool `json:"customersAvatars"` + AvatarsEffective bool `json:"customersAvatarsEffective"` + } `json:"features"` + } + read := func() payload { + var p payload + if err := json.Unmarshal(doOwnerGet(s, "/api/config/governor").Body.Bytes(), &p); err != nil { + t.Fatal(err) + } + return p + } + if got := read(); !got.Features.Avatars || !got.Features.AvatarsEffective { + t.Fatalf("default payload = %+v, want on", got.Features) + } + if rec := putFeatures(s, map[string]any{"customersAvatarsEnabled": false}, func(r *http.Request) { + r.Header.Set("X-Hive-Role", "read-write") + }); rec.Code != http.StatusForbidden || !s.deps.Config.Customers.Avatars.IsEnabled() { + t.Fatalf("non-owner PUT = %d", rec.Code) + } + if rec := doPut(s, "/api/config/governor/features", map[string]any{"customersAvatarsEnabled": false}); rec.Code != http.StatusOK { + t.Fatalf("PUT off: %d - %s", rec.Code, rec.Body.String()) + } + if got := read(); got.Features.Avatars || got.Features.AvatarsEffective { + t.Fatalf("after disable = %+v", got.Features) + } + if rec := doPut(s, "/api/config/governor/features", map[string]any{"retroEnabled": true}); rec.Code != http.StatusOK || s.deps.Config.Customers.Avatars.IsEnabled() { + t.Fatalf("an unrelated PUT changed it: %d", rec.Code) + } + t.Setenv(config.EnvCustomersAvatarsEnabled, "true") + if got := read(); got.Features.Avatars || !got.Features.AvatarsEffective { + t.Fatalf("env override = %+v", got.Features) + } +} diff --git a/src/pkg/dashboard/static-src/css/customers.css b/src/pkg/dashboard/static-src/css/customers.css index aa58e3211f..a693f568b5 100644 --- a/src/pkg/dashboard/static-src/css/customers.css +++ b/src/pkg/dashboard/static-src/css/customers.css @@ -7,19 +7,36 @@ .customers-hint { max-width: 80ch; line-height: 1.5; } .customers-group { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-4); min-width: 0; } .customers-group-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); } - /* Person and suggestion card: avatar, content, actions. */ - .customers-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-4); row-gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0; max-width: 100%; } + /* Person and suggestion card: one line at desktop width. Avatar, a flowing line of name and pills, the date, the actions. On a narrow screen the pills wrap under the name and the actions take their own line. */ + .customers-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--sp-3); row-gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); min-height: calc(var(--tap-target) - var(--sp-1)); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0; max-width: 100%; } .customers-card[data-me="true"] { border-color: var(--accent); } - .customers-avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); flex: none; } + .customers-avatar { position: relative; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--r-pill); overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex: none; } .customers-card[data-kind="suggestion"] .customers-avatar { background: color-mix(in srgb, var(--border) 30%, var(--surface)); } + .customers-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-pill); background: var(--surface); } .customers-row-main { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1 1 16em; } - .customers-card .customers-row-main { flex: none; } - .customers-row-title { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); } - .customers-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .customers-card .customers-row-main { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); } + .customers-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .customers-card .customers-name { font-size: var(--fs-base); font-weight: var(--fw-semibold); } .customers-me { flex: none; } - .customers-row-meta { overflow-wrap: anywhere; line-height: 1.5; } + .customers-updated { white-space: nowrap; text-align: right; } + /* Pills share the status pill's shape and type size (kc-pill); these are quieter: outlined, a lighter weight. */ + .kc-pill.customers-pill { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; padding: 0 var(--sp-3); line-height: 1.6; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--muted); background: transparent; border: 1px solid var(--border); } + .kc-pill.customers-source { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; font-family: var(--font-mono); font-weight: 400; color: var(--text); } + .kc-pill.customers-source[data-claimed="true"] { border-style: dashed; } + .kc-pill.customers-more { cursor: help; } + .kc-pill.customers-tag { color: var(--text); border-color: color-mix(in srgb, var(--customers-tone, var(--muted)) 55%, var(--border)); background: color-mix(in srgb, var(--customers-tone, var(--muted)) 16%, var(--surface)); } + .kc-pill.customers-tag[data-tag="maintainer"] { --customers-tone: var(--accent); } + .kc-pill.customers-tag[data-tag="contributor"] { --customers-tone: var(--cyan); } + .kc-pill.customers-tag[data-tag="end-user"] { --customers-tone: var(--green); } + .kc-pill.customers-tag[data-tag="stakeholder"] { --customers-tone: var(--yellow); } + .customers-tag-dot { width: var(--sp-3); height: var(--sp-3); border-radius: var(--r-pill); background: var(--customers-tone, var(--muted)); flex: none; } + .customers-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } + .customers-row-title { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); } .customers-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); } .customers-card[data-kind="suggestion"] .customers-row-actions { width: var(--customers-actions-w); } + /* The disclosure sits in the pill line; opened, its body takes the full width under it. */ + .customers-why { flex: 0 1 auto; min-width: 0; } + .customers-why[open] { flex-basis: 100%; } .customers-why summary { cursor: pointer; width: fit-content; } .customers-why-body { margin-top: var(--sp-1); overflow-wrap: anywhere; line-height: 1.5; } .customers-picker { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--bg); min-width: 0; } @@ -48,6 +65,7 @@ .customers-notes { width: 100%; min-height: 6em; } @media (max-width: 720px) { .customers-form { grid-template-columns: 1fr; } - .customers-card { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); } + .customers-card { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-2) var(--sp-3); align-items: start; } + .customers-updated { display: none; } .customers-card .customers-row-actions, .customers-card[data-kind="suggestion"] .customers-row-actions { grid-column: 1 / -1; width: auto; justify-content: flex-start; } } diff --git a/src/pkg/dashboard/static-src/js/config-features.js b/src/pkg/dashboard/static-src/js/config-features.js index 9c5dc73b06..eaa2121a44 100644 --- a/src/pkg/dashboard/static-src/js/config-features.js +++ b/src/pkg/dashboard/static-src/js/config-features.js @@ -889,6 +889,11 @@ Suggest goals and satisfaction ${yamlHint('customers.inference.enabled')} ${settingHelpMark('settings', 'features', 'Customer goal and satisfaction suggestions', `OFF by default. When on, the hive reads what a customer has written (the issues they opened, the pull requests they authored and mail from them that was approved) and asks the model configured for meetings to suggest what they are trying to get done and how it is going for them. This sends that text, which can be about people who never signed up, to that model, and spends the model's daily budget (about forty thousand tokens a day). It only ever suggests: a person confirms, edits or rejects each one, a confirmed or manual value is never overwritten, and nothing suggested is shared outside the hive. Needs Customers on and a meetings model (an OpenAI-compatible endpoint or an Anthropic key). HIVE_CUSTOMERS_INFERENCE_ENABLED overrides it. See src/docs/design/customers.md.`)}
${f.customersInferenceEffective !== f.customersInference ? `

HIVE_CUSTOMERS_INFERENCE_ENABLED (or turning Customers off) overrides this setting: suggestions are currently ${f.customersInferenceEffective ? 'on' : 'off'}.

` : ''} +
+
+ Customer avatars ${yamlHint('customers.avatars.enabled')} ${settingHelpMark('settings', 'features', 'Customer avatars', `ON by default. The Customers list shows a person's GitHub picture next to their name when they have a confirmed GitHub login. This is the one thing in Customers that leaves your browser: it asks github.com for https://github.com/.png, once per person on screen, and sends no referrer. Nothing goes to the hive's server or the hub, and nobody known only by email is looked up anywhere. Off, the list shows initials and makes no request to github.com. Applies on the next refresh. HIVE_CUSTOMERS_AVATARS_ENABLED overrides it. See src/docs/design/customers.md.`)} +
+ ${f.customersAvatarsEffective !== f.customersAvatars ? `

HIVE_CUSTOMERS_AVATARS_ENABLED overrides this setting: avatars are currently ${f.customersAvatarsEffective ? 'on' : 'off'}.

` : ''}
diff --git a/src/pkg/dashboard/static-src/js/config-state.js b/src/pkg/dashboard/static-src/js/config-state.js index 8b60836514..a93ab77dd3 100644 --- a/src/pkg/dashboard/static-src/js/config-state.js +++ b/src/pkg/dashboard/static-src/js/config-state.js @@ -113,6 +113,7 @@ { tab: 'Features', section: 'Agents & tooling', label: 'Agent policy repo', key: 'policies.repo', text: 'agent policies policy repo claude.md branch path local dir poll interval policies.repo policies.branch policies.path policies.local_dir policies.poll_interval' }, { tab: 'Features', section: 'Agents & tooling', label: 'Customers', key: 'customers.enabled', text: 'customers people profile person identities tags goals satisfaction suggested forget customer graph HIVE_CUSTOMERS_ENABLED customers.enabled' }, { tab: 'Features', section: 'Agents & tooling', label: 'Customer goal and satisfaction suggestions', key: 'customers.inference.enabled', text: 'customers inference infer suggest goals satisfaction model confirm HIVE_CUSTOMERS_INFERENCE_ENABLED customers.inference.enabled' }, + { tab: 'Features', section: 'Agents & tooling', label: 'Customer avatars', key: 'customers.avatars.enabled', text: 'customers avatars avatar pictures photos github profile picture privacy HIVE_CUSTOMERS_AVATARS_ENABLED customers.avatars.enabled' }, { tab: 'Features', section: 'Agents & tooling', label: 'Re-entrant turns and PR follow-up windows', key: 'turn.reentrant.enabled', text: 'reentrant re-entrant turn envelope background fleet pr follow-up resume window retention turn.reentrant.enabled turn.reentrant.background_fleet_enabled turn.pr_follow_up.max_age turn.pr_follow_up.resume_id_max_age turn.pr_follow_up.retention' }, { tab: 'Features', section: 'Agents & tooling', label: 'Data directories and session retention', key: 'data.metrics_dir', text: 'data directories metrics logs agent configs claude copilot bob sessions retention prune janitor data.agents_dir data.bob_sessions_dir data.claude_sessions_dir data.copilot_sessions_dir data.logs_dir data.metrics_dir data.session_retention_days' }, { tab: 'Features', section: 'Integrations & observability', label: 'Standalone deployment upgrades', key: 'deployment.podman_mode', text: 'deployment podman quadlet rootless rootful docker compose upgrade helper request dir deployment.podman_mode deployment.upgrade_helper deployment.upgrade_request_dir' }, diff --git a/src/pkg/dashboard/static-src/js/customers.js b/src/pkg/dashboard/static-src/js/customers.js index 4086464398..3616b14045 100644 --- a/src/pkg/dashboard/static-src/js/customers.js +++ b/src/pkg/dashboard/static-src/js/customers.js @@ -14,6 +14,17 @@ // Satisfaction level to the kc-pill status palette. const CUSTOMERS_LEVEL_PILL = { at_risk: 'error', neutral: 'syncing', satisfied: 'ok' }; const CUSTOMERS_ORIGIN_LABELS = { hive_user: 'hive user', manual: 'added by hand', accepted: 'accepted suggestion' }; + // The short origin pill on a row; the long wording stays in its tooltip. + const CUSTOMERS_ORIGIN_SHORT = { hive_user: 'hive user', manual: 'added', accepted: 'accepted' }; + // A row shows this many identity pills and tag pills, then "+N". + const CUSTOMERS_SOURCE_PILLS_SHOWN = 2; + const CUSTOMERS_TAG_PILLS_SHOWN = 3; + // A GitHub login: letters, digits and single hyphens, at most 39 long. + const CUSTOMERS_GITHUB_LOGIN = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/; + // The avatar box is 28 CSS pixels (see .customers-avatar); the picture is + // asked for at twice that so it stays sharp on a dense screen. + const CUSTOMERS_AVATAR_PX = 28; + const CUSTOMERS_AVATAR_FETCH_PX = 56; const CUSTOMERS_EVIDENCE_SHOWN = 5; let _customersData = null; let _customersError = ''; @@ -138,6 +149,78 @@ return m ? m[0].toUpperCase() : '?'; } + // customersAvatarsOn: GitHub avatars show only while the hive says so + // (customers.avatars.enabled). Off, the list makes no request to github.com. + function customersAvatarsOn() { return !!(_customersData && _customersData.avatars === true); } + + // customersGithubLogin is the login of a person's confirmed GitHub + // identity, or '' when they have none. An unconfirmed (claimed) identity + // never picks a picture: anyone can type any login there. + function customersGithubLogin(p) { + const ids = (p && p.identities) || []; + for (let n = 0; n < ids.length; n++) { + const i = ids[n]; + if (i && i.kind === 'github' && !i.claimed && CUSTOMERS_GITHUB_LOGIN.test(String(i.value || ''))) return String(i.value); + } + return ''; + } + + // customersAvatarHtml draws the initial (or a source icon) in a circle and, + // for a GitHub login, the picture over it. The box has a fixed size, so + // nothing moves when the picture arrives; if it fails the picture hides + // itself and the initial stays. Email-only people never get a picture: no + // service keyed by an address is asked. + function customersAvatarHtml(name, login, icon, title) { + const face = icon || escapeHtml(customersInitial(name)); + let img = ''; + if (login && CUSTOMERS_GITHUB_LOGIN.test(login) && customersAvatarsOn()) { + img = '' + escapeHtml(name) + ''; + } + return '' + img + ''; + } + + // customersMorePill is the "+N" pill; its tooltip lists what it hides. + function customersMorePill(rest) { + if (!rest.length) return ''; + return '+' + rest.length + ''; + } + + // customersSourcePills: the identities a person is known by, as compact + // monospace pills. The dashboard-user and name identities say nothing a + // row does not already say. + function customersSourcePills(p) { + const ids = ((p && p.identities) || []).filter(i => i && i.value && i.kind !== 'hive_user' && i.kind !== 'name'); + const label = i => (CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + ': ' + i.value + (i.claimed ? ' (unconfirmed)' : ''); + return ids.slice(0, CUSTOMERS_SOURCE_PILLS_SHOWN).map(i => + '' + escapeHtml(i.value) + '').join('') + + customersMorePill(ids.slice(CUSTOMERS_SOURCE_PILLS_SHOWN).map(label)); + } + + // customersOriginPill: where the person came from, in one short word. + function customersOriginPill(p, updated) { + const origin = p && p.origin; + if (!origin) return ''; + const long = (CUSTOMERS_ORIGIN_LABELS[origin] || origin) + (updated ? ', updated ' + updated : ''); + return '' + escapeHtml(CUSTOMERS_ORIGIN_SHORT[origin] || origin) + ''; + } + + // customersTagPill: a tag that is on. A default tag has its own tone; a + // free-form tag is neutral. A tag a person set carries a dot, and the + // tooltip says who set it or which rule did. + function customersTagPill(t) { + const manual = t.source === 'manual'; + const why = manual ? 'Set by ' + (t.by || 'a person') : (t.rule ? 'Automatic: ' + t.rule : 'Automatic'); + const isDefault = ((_customersData && _customersData.default_tags) || []).indexOf(t.name) >= 0; + return '' + + (manual ? '' : '') + escapeHtml(t.name) + (manual ? ' (set by hand)' : '') + ''; + } + + function customersTagPills(p) { + const on = ((p && p.tags) || []).filter(t => t && t.name && t.state === 'on'); + return on.slice(0, CUSTOMERS_TAG_PILLS_SHOWN).map(customersTagPill).join('') + + customersMorePill(on.slice(CUSTOMERS_TAG_PILLS_SHOWN).map(t => t.name)); + } + function customersEvidenceLabel(ref) { const s = String(ref || ''); const m = CUSTOMERS_REF_GH.exec(s); @@ -168,23 +251,24 @@ } // ── List ── + // One line per customer: picture, name, then pills (identities, origin, + // tags, goals to review, satisfaction), the date, the actions. On a narrow + // screen the pills wrap under the name. function customersRowHtml(p, isMe) { const goals = customersGoalsSplit(p); - const tags = customersActiveTags(p).map(t => '' + escapeHtml(t) + '').join(''); const pill = customersLevelPill(p.satisfaction && p.satisfaction.level); const pending = goals.suggested.length + (p.satisfaction && p.satisfaction.suggestion ? 1 : 0); - const meta = [CUSTOMERS_ORIGIN_LABELS[p.origin] || p.origin || '']; + const extra = []; // No goals is the usual case, so it is not said on every row. - if (goals.confirmed.length) meta.push(goals.confirmed.length + ' goal' + (goals.confirmed.length === 1 ? '' : 's')); - if (pending) meta.push(pending + ' suggestion' + (pending === 1 ? '' : 's') + ' to review'); + if (goals.confirmed.length) extra.push('' + goals.confirmed.length + ' goal' + (goals.confirmed.length === 1 ? '' : 's') + ''); + if (pending) extra.push('' + pending + ' to review'); const updated = customersFormatTime(p.updated_at); - if (updated) meta.push('updated ' + updated); const name = p.name || p.id || ''; return '
' + - '' + - '
' + escapeHtml(name) + '' + (isMe ? 'me' : '') + '
' + - '
' + escapeHtml(meta.filter(Boolean).join(' · ')) + '
' + - (tags || pill ? '
' + tags + pill + '
' : '') + '
' + + customersAvatarHtml(name, customersGithubLogin(p), '', '') + + '
' + escapeHtml(name) + '' + (isMe ? 'me' : '') + + customersSourcePills(p) + customersOriginPill(p, updated) + customersTagPills(p) + extra.join('') + pill + '
' + + (updated ? '' + escapeHtml(updated) + '' : '') + '
'; } @@ -203,15 +287,18 @@ function customersSuggestionRowHtml(s) { const id = escapeHtml(s.id); - const counts = Object.keys(s.counts || {}).sort().map(k => s.counts[k] + ' ' + k.replace(/_/g, ' ')).join(', '); + const countList = Object.keys(s.counts || {}).sort().map(k => s.counts[k] + ' ' + k.replace(/_/g, ' ')); const seen = customersFormatTime(s.last_seen); const value = s.value || ''; const kind = CUSTOMERS_KIND_LABELS[s.kind] || s.kind || ''; + const login = s.kind === 'github' ? value : ''; return '
' + - '' + - '
' + escapeHtml(value) + '
' + - '
' + escapeHtml([counts, seen ? 'last seen ' + seen : ''].filter(Boolean).join(' · ')) + '
' + + customersAvatarHtml(value, login, CUSTOMERS_KIND_ICONS[s.kind] || '', kind) + + '
' + escapeHtml(value) + '' + + countList.slice(0, CUSTOMERS_SOURCE_PILLS_SHOWN).map(c => '' + escapeHtml(c) + '').join('') + + customersMorePill(countList.slice(CUSTOMERS_SOURCE_PILLS_SHOWN)) + customersWhyHtml(s.id, s.evidence) + '
' + + (seen ? '' + escapeHtml(seen) + '' : '') + '
' + '' + '' + @@ -495,10 +582,11 @@ } function customersProfileHtml(p) { - const tags = customersActiveTags(p).map(t => '' + escapeHtml(t) + '').join(''); + const name = p.name || p.id || ''; return '
' + - '
' + escapeHtml(p.name || p.id) + '' + (p.me ? 'me' : '') + '
' + - '
' + tags + customersLevelPill(p.satisfaction && p.satisfaction.level) + '
' + + customersAvatarHtml(name, customersGithubLogin(p), '', '') + + '
' + escapeHtml(name) + '' + (p.me ? 'me' : '') + '
' + + '
' + customersSourcePills(p) + customersOriginPill(p, '') + customersTagPills(p) + customersLevelPill(p.satisfaction && p.satisfaction.level) + '
' + '
' + '' + customersGoalsHtml(p) + customersSatisfactionHtml(p) + customersTagsHtml(p) + customersIdentitiesHtml(p) + customersAttachHtml(p) + diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index e02ca1334c..39c21e0b2e 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -6403,19 +6403,36 @@ .customers-hint { max-width: 80ch; line-height: 1.5; } .customers-group { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-4); min-width: 0; } .customers-group-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); } - /* Person and suggestion card: avatar, content, actions. */ - .customers-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-4); row-gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0; max-width: 100%; } + /* Person and suggestion card: one line at desktop width. Avatar, a flowing line of name and pills, the date, the actions. On a narrow screen the pills wrap under the name and the actions take their own line. */ + .customers-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--sp-3); row-gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); min-height: calc(var(--tap-target) - var(--sp-1)); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0; max-width: 100%; } .customers-card[data-me="true"] { border-color: var(--accent); } - .customers-avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); flex: none; } + .customers-avatar { position: relative; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--r-pill); overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex: none; } .customers-card[data-kind="suggestion"] .customers-avatar { background: color-mix(in srgb, var(--border) 30%, var(--surface)); } + .customers-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-pill); background: var(--surface); } .customers-row-main { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1 1 16em; } - .customers-card .customers-row-main { flex: none; } - .customers-row-title { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); } - .customers-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .customers-card .customers-row-main { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); } + .customers-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .customers-card .customers-name { font-size: var(--fs-base); font-weight: var(--fw-semibold); } .customers-me { flex: none; } - .customers-row-meta { overflow-wrap: anywhere; line-height: 1.5; } + .customers-updated { white-space: nowrap; text-align: right; } + /* Pills share the status pill's shape and type size (kc-pill); these are quieter: outlined, a lighter weight. */ + .kc-pill.customers-pill { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; padding: 0 var(--sp-3); line-height: 1.6; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--muted); background: transparent; border: 1px solid var(--border); } + .kc-pill.customers-source { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; font-family: var(--font-mono); font-weight: 400; color: var(--text); } + .kc-pill.customers-source[data-claimed="true"] { border-style: dashed; } + .kc-pill.customers-more { cursor: help; } + .kc-pill.customers-tag { color: var(--text); border-color: color-mix(in srgb, var(--customers-tone, var(--muted)) 55%, var(--border)); background: color-mix(in srgb, var(--customers-tone, var(--muted)) 16%, var(--surface)); } + .kc-pill.customers-tag[data-tag="maintainer"] { --customers-tone: var(--accent); } + .kc-pill.customers-tag[data-tag="contributor"] { --customers-tone: var(--cyan); } + .kc-pill.customers-tag[data-tag="end-user"] { --customers-tone: var(--green); } + .kc-pill.customers-tag[data-tag="stakeholder"] { --customers-tone: var(--yellow); } + .customers-tag-dot { width: var(--sp-3); height: var(--sp-3); border-radius: var(--r-pill); background: var(--customers-tone, var(--muted)); flex: none; } + .customers-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } + .customers-row-title { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); } .customers-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); } .customers-card[data-kind="suggestion"] .customers-row-actions { width: var(--customers-actions-w); } + /* The disclosure sits in the pill line; opened, its body takes the full width under it. */ + .customers-why { flex: 0 1 auto; min-width: 0; } + .customers-why[open] { flex-basis: 100%; } .customers-why summary { cursor: pointer; width: fit-content; } .customers-why-body { margin-top: var(--sp-1); overflow-wrap: anywhere; line-height: 1.5; } .customers-picker { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--bg); min-width: 0; } @@ -6444,7 +6461,8 @@ .customers-notes { width: 100%; min-height: 6em; } @media (max-width: 720px) { .customers-form { grid-template-columns: 1fr; } - .customers-card { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); } + .customers-card { grid-template-columns: auto minmax(0, 1fr); padding: var(--sp-2) var(--sp-3); align-items: start; } + .customers-updated { display: none; } .customers-card .customers-row-actions, .customers-card[data-kind="suggestion"] .customers-row-actions { grid-column: 1 / -1; width: auto; justify-content: flex-start; } } /* Graph view: one person and what they touched (hivecommons/hive issue 18742) */ @@ -53514,6 +53532,17 @@ // Satisfaction level to the kc-pill status palette. const CUSTOMERS_LEVEL_PILL = { at_risk: 'error', neutral: 'syncing', satisfied: 'ok' }; const CUSTOMERS_ORIGIN_LABELS = { hive_user: 'hive user', manual: 'added by hand', accepted: 'accepted suggestion' }; + // The short origin pill on a row; the long wording stays in its tooltip. + const CUSTOMERS_ORIGIN_SHORT = { hive_user: 'hive user', manual: 'added', accepted: 'accepted' }; + // A row shows this many identity pills and tag pills, then "+N". + const CUSTOMERS_SOURCE_PILLS_SHOWN = 2; + const CUSTOMERS_TAG_PILLS_SHOWN = 3; + // A GitHub login: letters, digits and single hyphens, at most 39 long. + const CUSTOMERS_GITHUB_LOGIN = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/; + // The avatar box is 28 CSS pixels (see .customers-avatar); the picture is + // asked for at twice that so it stays sharp on a dense screen. + const CUSTOMERS_AVATAR_PX = 28; + const CUSTOMERS_AVATAR_FETCH_PX = 56; const CUSTOMERS_EVIDENCE_SHOWN = 5; let _customersData = null; let _customersError = ''; @@ -53638,6 +53667,78 @@ return m ? m[0].toUpperCase() : '?'; } + // customersAvatarsOn: GitHub avatars show only while the hive says so + // (customers.avatars.enabled). Off, the list makes no request to github.com. + function customersAvatarsOn() { return !!(_customersData && _customersData.avatars === true); } + + // customersGithubLogin is the login of a person's confirmed GitHub + // identity, or '' when they have none. An unconfirmed (claimed) identity + // never picks a picture: anyone can type any login there. + function customersGithubLogin(p) { + const ids = (p && p.identities) || []; + for (let n = 0; n < ids.length; n++) { + const i = ids[n]; + if (i && i.kind === 'github' && !i.claimed && CUSTOMERS_GITHUB_LOGIN.test(String(i.value || ''))) return String(i.value); + } + return ''; + } + + // customersAvatarHtml draws the initial (or a source icon) in a circle and, + // for a GitHub login, the picture over it. The box has a fixed size, so + // nothing moves when the picture arrives; if it fails the picture hides + // itself and the initial stays. Email-only people never get a picture: no + // service keyed by an address is asked. + function customersAvatarHtml(name, login, icon, title) { + const face = icon || escapeHtml(customersInitial(name)); + let img = ''; + if (login && CUSTOMERS_GITHUB_LOGIN.test(login) && customersAvatarsOn()) { + img = '' + escapeHtml(name) + ''; + } + return '' + img + ''; + } + + // customersMorePill is the "+N" pill; its tooltip lists what it hides. + function customersMorePill(rest) { + if (!rest.length) return ''; + return '+' + rest.length + ''; + } + + // customersSourcePills: the identities a person is known by, as compact + // monospace pills. The dashboard-user and name identities say nothing a + // row does not already say. + function customersSourcePills(p) { + const ids = ((p && p.identities) || []).filter(i => i && i.value && i.kind !== 'hive_user' && i.kind !== 'name'); + const label = i => (CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + ': ' + i.value + (i.claimed ? ' (unconfirmed)' : ''); + return ids.slice(0, CUSTOMERS_SOURCE_PILLS_SHOWN).map(i => + '' + escapeHtml(i.value) + '').join('') + + customersMorePill(ids.slice(CUSTOMERS_SOURCE_PILLS_SHOWN).map(label)); + } + + // customersOriginPill: where the person came from, in one short word. + function customersOriginPill(p, updated) { + const origin = p && p.origin; + if (!origin) return ''; + const long = (CUSTOMERS_ORIGIN_LABELS[origin] || origin) + (updated ? ', updated ' + updated : ''); + return '' + escapeHtml(CUSTOMERS_ORIGIN_SHORT[origin] || origin) + ''; + } + + // customersTagPill: a tag that is on. A default tag has its own tone; a + // free-form tag is neutral. A tag a person set carries a dot, and the + // tooltip says who set it or which rule did. + function customersTagPill(t) { + const manual = t.source === 'manual'; + const why = manual ? 'Set by ' + (t.by || 'a person') : (t.rule ? 'Automatic: ' + t.rule : 'Automatic'); + const isDefault = ((_customersData && _customersData.default_tags) || []).indexOf(t.name) >= 0; + return '' + + (manual ? '' : '') + escapeHtml(t.name) + (manual ? ' (set by hand)' : '') + ''; + } + + function customersTagPills(p) { + const on = ((p && p.tags) || []).filter(t => t && t.name && t.state === 'on'); + return on.slice(0, CUSTOMERS_TAG_PILLS_SHOWN).map(customersTagPill).join('') + + customersMorePill(on.slice(CUSTOMERS_TAG_PILLS_SHOWN).map(t => t.name)); + } + function customersEvidenceLabel(ref) { const s = String(ref || ''); const m = CUSTOMERS_REF_GH.exec(s); @@ -53668,23 +53769,24 @@ } // ── List ── + // One line per customer: picture, name, then pills (identities, origin, + // tags, goals to review, satisfaction), the date, the actions. On a narrow + // screen the pills wrap under the name. function customersRowHtml(p, isMe) { const goals = customersGoalsSplit(p); - const tags = customersActiveTags(p).map(t => '' + escapeHtml(t) + '').join(''); const pill = customersLevelPill(p.satisfaction && p.satisfaction.level); const pending = goals.suggested.length + (p.satisfaction && p.satisfaction.suggestion ? 1 : 0); - const meta = [CUSTOMERS_ORIGIN_LABELS[p.origin] || p.origin || '']; + const extra = []; // No goals is the usual case, so it is not said on every row. - if (goals.confirmed.length) meta.push(goals.confirmed.length + ' goal' + (goals.confirmed.length === 1 ? '' : 's')); - if (pending) meta.push(pending + ' suggestion' + (pending === 1 ? '' : 's') + ' to review'); + if (goals.confirmed.length) extra.push('' + goals.confirmed.length + ' goal' + (goals.confirmed.length === 1 ? '' : 's') + ''); + if (pending) extra.push('' + pending + ' to review'); const updated = customersFormatTime(p.updated_at); - if (updated) meta.push('updated ' + updated); const name = p.name || p.id || ''; return '
' + - '' + - '
' + escapeHtml(name) + '' + (isMe ? 'me' : '') + '
' + - '
' + escapeHtml(meta.filter(Boolean).join(' · ')) + '
' + - (tags || pill ? '
' + tags + pill + '
' : '') + '
' + + customersAvatarHtml(name, customersGithubLogin(p), '', '') + + '
' + escapeHtml(name) + '' + (isMe ? 'me' : '') + + customersSourcePills(p) + customersOriginPill(p, updated) + customersTagPills(p) + extra.join('') + pill + '
' + + (updated ? '' + escapeHtml(updated) + '' : '') + '
'; } @@ -53703,15 +53805,18 @@ function customersSuggestionRowHtml(s) { const id = escapeHtml(s.id); - const counts = Object.keys(s.counts || {}).sort().map(k => s.counts[k] + ' ' + k.replace(/_/g, ' ')).join(', '); + const countList = Object.keys(s.counts || {}).sort().map(k => s.counts[k] + ' ' + k.replace(/_/g, ' ')); const seen = customersFormatTime(s.last_seen); const value = s.value || ''; const kind = CUSTOMERS_KIND_LABELS[s.kind] || s.kind || ''; + const login = s.kind === 'github' ? value : ''; return '
' + - '' + - '
' + escapeHtml(value) + '
' + - '
' + escapeHtml([counts, seen ? 'last seen ' + seen : ''].filter(Boolean).join(' · ')) + '
' + + customersAvatarHtml(value, login, CUSTOMERS_KIND_ICONS[s.kind] || '', kind) + + '
' + escapeHtml(value) + '' + + countList.slice(0, CUSTOMERS_SOURCE_PILLS_SHOWN).map(c => '' + escapeHtml(c) + '').join('') + + customersMorePill(countList.slice(CUSTOMERS_SOURCE_PILLS_SHOWN)) + customersWhyHtml(s.id, s.evidence) + '
' + + (seen ? '' + escapeHtml(seen) + '' : '') + '
' + '' + '' + @@ -53995,10 +54100,11 @@ } function customersProfileHtml(p) { - const tags = customersActiveTags(p).map(t => '' + escapeHtml(t) + '').join(''); + const name = p.name || p.id || ''; return '
' + - '
' + escapeHtml(p.name || p.id) + '' + (p.me ? 'me' : '') + '
' + - '
' + tags + customersLevelPill(p.satisfaction && p.satisfaction.level) + '
' + + customersAvatarHtml(name, customersGithubLogin(p), '', '') + + '
' + escapeHtml(name) + '' + (p.me ? 'me' : '') + '
' + + '
' + customersSourcePills(p) + customersOriginPill(p, '') + customersTagPills(p) + customersLevelPill(p.satisfaction && p.satisfaction.level) + '
' + '
' + '' + customersGoalsHtml(p) + customersSatisfactionHtml(p) + customersTagsHtml(p) + customersIdentitiesHtml(p) + customersAttachHtml(p) + @@ -63857,6 +63963,7 @@

Configure LiteLLM

{ tab: 'Features', section: 'Agents & tooling', label: 'Agent policy repo', key: 'policies.repo', text: 'agent policies policy repo claude.md branch path local dir poll interval policies.repo policies.branch policies.path policies.local_dir policies.poll_interval' }, { tab: 'Features', section: 'Agents & tooling', label: 'Customers', key: 'customers.enabled', text: 'customers people profile person identities tags goals satisfaction suggested forget customer graph HIVE_CUSTOMERS_ENABLED customers.enabled' }, { tab: 'Features', section: 'Agents & tooling', label: 'Customer goal and satisfaction suggestions', key: 'customers.inference.enabled', text: 'customers inference infer suggest goals satisfaction model confirm HIVE_CUSTOMERS_INFERENCE_ENABLED customers.inference.enabled' }, + { tab: 'Features', section: 'Agents & tooling', label: 'Customer avatars', key: 'customers.avatars.enabled', text: 'customers avatars avatar pictures photos github profile picture privacy HIVE_CUSTOMERS_AVATARS_ENABLED customers.avatars.enabled' }, { tab: 'Features', section: 'Agents & tooling', label: 'Re-entrant turns and PR follow-up windows', key: 'turn.reentrant.enabled', text: 'reentrant re-entrant turn envelope background fleet pr follow-up resume window retention turn.reentrant.enabled turn.reentrant.background_fleet_enabled turn.pr_follow_up.max_age turn.pr_follow_up.resume_id_max_age turn.pr_follow_up.retention' }, { tab: 'Features', section: 'Agents & tooling', label: 'Data directories and session retention', key: 'data.metrics_dir', text: 'data directories metrics logs agent configs claude copilot bob sessions retention prune janitor data.agents_dir data.bob_sessions_dir data.claude_sessions_dir data.copilot_sessions_dir data.logs_dir data.metrics_dir data.session_retention_days' }, { tab: 'Features', section: 'Integrations & observability', label: 'Standalone deployment upgrades', key: 'deployment.podman_mode', text: 'deployment podman quadlet rootless rootful docker compose upgrade helper request dir deployment.podman_mode deployment.upgrade_helper deployment.upgrade_request_dir' }, @@ -78439,6 +78546,11 @@

${esc(s.title)}

Suggest goals and satisfaction ${yamlHint('customers.inference.enabled')} ${settingHelpMark('settings', 'features', 'Customer goal and satisfaction suggestions', `OFF by default. When on, the hive reads what a customer has written (the issues they opened, the pull requests they authored and mail from them that was approved) and asks the model configured for meetings to suggest what they are trying to get done and how it is going for them. This sends that text, which can be about people who never signed up, to that model, and spends the model's daily budget (about forty thousand tokens a day). It only ever suggests: a person confirms, edits or rejects each one, a confirmed or manual value is never overwritten, and nothing suggested is shared outside the hive. Needs Customers on and a meetings model (an OpenAI-compatible endpoint or an Anthropic key). HIVE_CUSTOMERS_INFERENCE_ENABLED overrides it. See src/docs/design/customers.md.`)}
${f.customersInferenceEffective !== f.customersInference ? `

HIVE_CUSTOMERS_INFERENCE_ENABLED (or turning Customers off) overrides this setting: suggestions are currently ${f.customersInferenceEffective ? 'on' : 'off'}.

` : ''} +
+
+ Customer avatars ${yamlHint('customers.avatars.enabled')} ${settingHelpMark('settings', 'features', 'Customer avatars', `ON by default. The Customers list shows a person's GitHub picture next to their name when they have a confirmed GitHub login. This is the one thing in Customers that leaves your browser: it asks github.com for https://github.com/.png, once per person on screen, and sends no referrer. Nothing goes to the hive's server or the hub, and nobody known only by email is looked up anywhere. Off, the list shows initials and makes no request to github.com. Applies on the next refresh. HIVE_CUSTOMERS_AVATARS_ENABLED overrides it. See src/docs/design/customers.md.`)} +
+ ${f.customersAvatarsEffective !== f.customersAvatars ? `

HIVE_CUSTOMERS_AVATARS_ENABLED overrides this setting: avatars are currently ${f.customersAvatarsEffective ? 'on' : 'off'}.

` : ''}
From de76d6c073ddf296174f28c8d057cd1139af52ea Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 17 Nov 2026 23:17:10 -0500 Subject: [PATCH 2/4] docs: keep security-model readable (no URL inside inline code) Signed-off-by: Andrew Anderson --- src/docs/security-model.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/docs/security-model.md b/src/docs/security-model.md index 9c906ec9c4..eb6d8f07ee 100644 --- a/src/docs/security-model.md +++ b/src/docs/security-model.md @@ -219,17 +219,18 @@ login. The hub put that entry there after it signed the person in with GitHub, so the hive trusts it. If your access list is edited by hand, an entry like that gives the named person's profile the matching GitHub activity. -One part of the section is a request your browser makes, not the hive. The list -shows a GitHub picture for each person with a confirmed GitHub login, so the -browser asks `https://github.com/.png` for the people on screen, lazily -and with no referrer. GitHub learns the viewer's IP address and which logins were requested, so it can -tell that this viewer has those GitHub users in their customer list, and nothing -else about them. The hive does not proxy or store pictures, and -nobody known only by an email address is looked up anywhere (no Gravatar or -other service keyed by a hash of an address). The dashboard's `img-src` already -allows `https:`, so no policy changes; a test pins it. Set -`customers.avatars.enabled: false`, `HIVE_CUSTOMERS_AVATARS_ENABLED=false` or the -Settings, Features switch to show initials and make no such request. +One part of this section is a request your browser makes, not the hive. The list +shows a GitHub picture for each person with a confirmed GitHub login. Your +browser asks `github.com/.png` over https for the people on screen. It does +this late, only for rows you can see, and it sends no referrer. GitHub learns +your IP address and which logins were asked for. So it can tell you have those +GitHub users in your customer list. It learns nothing else about them. The hive +does not fetch or keep the pictures. A person known only by an email address is +never looked up, and neither is any hash of the address. The dashboard already +allows `https:` images, so no policy changes, and a test pins it. To turn the +pictures off, set `customers.avatars.enabled: false` or +`HIVE_CUSTOMERS_AVATARS_ENABLED=false`, or use the switch in Settings. The list +then shows initials and asks GitHub for nothing. A read-only user sees only their own profile. An identity they add is shown as unconfirmed. It links nothing until the owner or a read-write user confirms it. From f07e766ae874529b747a4d9f0ade68214050c166 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 17 Nov 2026 23:23:50 -0500 Subject: [PATCH 3/4] config: add customers.avatars to the golden parse Signed-off-by: Andrew Anderson --- src/pkg/config/testdata/agent_runtime_golden.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/config/testdata/agent_runtime_golden.json b/src/pkg/config/testdata/agent_runtime_golden.json index caa5a05e9c..100b7b01a8 100644 --- a/src/pkg/config/testdata/agent_runtime_golden.json +++ b/src/pkg/config/testdata/agent_runtime_golden.json @@ -783,7 +783,8 @@ "grounded_answers": {} }, "customers": { - "inference": {} + "inference": {}, + "avatars": {} }, "duplicate_sweep": {}, "good_first_issue": {}, From e7caff727a4e47b0bbbad7f2e205cc83e171efb1 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 17 Nov 2026 23:25:27 -0500 Subject: [PATCH 4/4] Customers: style the me badge as a pill (#18885) Signed-off-by: Andrew Anderson --- src/pkg/dashboard/static-src/css/customers.css | 2 +- src/pkg/dashboard/static/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/dashboard/static-src/css/customers.css b/src/pkg/dashboard/static-src/css/customers.css index a693f568b5..0dae13a78b 100644 --- a/src/pkg/dashboard/static-src/css/customers.css +++ b/src/pkg/dashboard/static-src/css/customers.css @@ -17,7 +17,7 @@ .customers-card .customers-row-main { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); } .customers-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .customers-card .customers-name { font-size: var(--fs-base); font-weight: var(--fw-semibold); } - .customers-me { flex: none; } + .customers-me { flex: none; padding: 0 var(--sp-3); border: 1px solid var(--accent); border-radius: var(--r-pill); color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.6; } .customers-updated { white-space: nowrap; text-align: right; } /* Pills share the status pill's shape and type size (kc-pill); these are quieter: outlined, a lighter weight. */ .kc-pill.customers-pill { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; padding: 0 var(--sp-3); line-height: 1.6; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--muted); background: transparent; border: 1px solid var(--border); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 39c21e0b2e..41727abed1 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -6413,7 +6413,7 @@ .customers-card .customers-row-main { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); } .customers-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .customers-card .customers-name { font-size: var(--fs-base); font-weight: var(--fw-semibold); } - .customers-me { flex: none; } + .customers-me { flex: none; padding: 0 var(--sp-3); border: 1px solid var(--accent); border-radius: var(--r-pill); color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.6; } .customers-updated { white-space: nowrap; text-align: right; } /* Pills share the status pill's shape and type size (kc-pill); these are quieter: outlined, a lighter weight. */ .kc-pill.customers-pill { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; padding: 0 var(--sp-3); line-height: 1.6; white-space: nowrap; font-weight: var(--fw-semibold); color: var(--muted); background: transparent; border: 1px solid var(--border); }