feat(desktop): add team sharing to community catalog - #3995
Conversation
5c11456 to
8bd3c8e
Compare
28c614f to
a4c603a
Compare
8ed79f3 to
f573bdc
Compare
wesbillman
left a comment
There was a problem hiding this comment.
Reviewing on Wes's behalf. Requesting changes for two security blockers in the catalog review surface:
-
Verify relay events before they can affect paging, coordinate selection, attribution, or displayed content.
fetchCatalogEventscurrently inserts every rawRelayEventreturned by the socket intobyIdand derivesoldestCreatedAtfrom it;sharedCatalogHeadsthen trusts the rawid,pubkey,created_at, tags, and content.RelayClient.fetchEventsis only a transport fetch and does not verify signatures. A forged/unsigned 30178 event can therefore appear under another publisher, claim or retract their coordinate ahead of a valid signed head, and control the pagination cursor. The backend re-fetch and verification correctly prevents adoption, but it does not protect browsing, publisher attribution, remote image loads, or denial/shadowing of legitimate entries. Please verify ID + signature on a fresh wire-shaped object before adding an event to the paging map or deriving a cursor/head from it, and add regressions for a forged newer head, forged author/content, malformed signature, and an invalid event attempting to controluntil. The equivalent hardening and tests already exist in PR #4220 for kind 30175; this shared helper should preserve that invariant for both 30175 and 30178 rather than regress it. -
Render executable team/member instructions byte-for-byte, not as Markdown, and reject non-reviewable controls at the adoption boundary.
TeamCatalogDialog.tsxpasses bothteam.instructionsandmember.systemPromptthrough the chat Markdown renderer. Markdown can conceal spoiler bodies, link destinations, and image sources, so the instructions reviewed in the dialog can differ materially from the plaintext later executed by the adopted agents. The current team catalog validators only enforce schema/size bounds, so bidi/default-ignorable controls can also make reviewed text differ from execution. Please use the literal instruction-review component/invariant from PR #4220 and apply its executable-text validation to team instructions and every member prompt before publication/adoption. Add coverage proving Markdown syntax stays literal, hidden controls fail closed, and accepted bytes are preserved exactly through adoption.
The feature has unusually substantial coverage otherwise: this head adds/changes 62 test/spec/fixture files, including the Rust adoption/pending/sharing/reconcile suites, TS relay/parser tests, and Playwright catalog/screenshot specs. CI is green at e64aa20ff81e236ca068aab3b9ad93142fb839e3, but the existing fixtures use placeholder sig: "sig" values and therefore do not exercise the first trust boundary.
e64aa20 to
131a906
Compare
…e2e tests Parse layer (teamCatalogRelay.ts, catalogRelay.ts) decodes kind 30178 projection events and feeds the catalog hooks. CommunityCatalogDialog unifies the Agents and Teams sections in a single browsable surface with selection-state helpers (communityCatalogSelection.ts) covering preferred-loading, vanished-item repair, and cross-section auto-init. TeamShareDialog publishes and unshares catalog entries. Playwright e2e suite covers the full catalog flow and screenshot regression set. PersonaCatalogDialog is removed; persona browsing now lives inside the unified dialog. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
3bcca7e to
f869c80
Compare





























Stack: #5112 → this PR
Stacks on the team catalog backend PR (#5112). Contains all
desktop/src/**,desktop/tests/**, anddesktop/playwright.config.tschanges — 32 files, +4,322/−693 lines.TS parse layer
teamCatalogRelay.tsdecodes kind 30178 projection events intoTeamCatalogEntryrecords.catalogRelay.tsgeneralizes the persona catalog relay into a shared base that both persona and team catalog hooks extend, eliminating the per-kind duplication in the previous persona-only implementation.Hooks
useTeamCatalogRelay.tssubscribes to the team catalog kind, applies freshness ordering, and exposes the decoded entries.useAgentsDataRefresh.tsgains team catalog invalidation alongside the existing persona refresh path.CommunityCatalogDialog
Single unified surface replacing the two former separate dialogs. Agents and Teams appear as labeled sections; the selection helper (
communityCatalogSelection.ts) handles preferred-loading, vanished-item repair (explicit selection cleared when the encoded key leaves live data), and cross-section auto-init. All selection transitions are covered by 15 deterministic unit tests incommunityCatalogSelection.test.mjs.TeamShareDialog
Publishes and unshares catalog entries via the backend
set_team_sharedTauri command (both share and unshare transitions callset_team_shared).e2e + screenshots
team-catalog.spec.tscovers the full browse + adopt flow.team-catalog-screenshots.spec.tsproduces the 8-image pixel-regression set (comment 5208042093).Deletion
PersonaCatalogDialog.tsxis removed; persona browsing now lives inside the unifiedCommunityCatalogDialog.