Skip to content

feat(search-assistant): person filter and people directory lookup for the organization Assistant - #10451

Merged
waleedlatif1 merged 2 commits into
stagingfrom
feat/assistant-search-involving-people
Nov 27, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
feat/assistant-search-involving-people

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Gives the organization Assistant (Mothership) the two Search MCP capabilities that landed in #10439 and #10435, through the same use cases, and fixes pasted-link reads in the Assistant.

  • involving on search_workspace: added to searchWorkspaceInputFieldsSchema (the wire field and its description now live once there; the Search MCP keeps its stricter liveSearchInvolvingSchema validator and reuses the description). The Assistant tool forwards it to searchLiveKnowledge, which already validates me/email and applies each provider's person clause.
  • search_people for the organization Assistant: a new Assistant tool contract and server tool backed by listPeople / getPerson.
    • organization.people.list/get now admit organization_delegated copilot principals under the sim:knowledge audience (contentDelivery: 'none'). The People feature flag and the organization.member_directory capability stay enforced in the use cases.
    • executeCopilotPeopleRead builds the principal from the trusted turn and binds it to the member's private organization chat (authorizeOrganizationChatDelegation), like the Assistant's org search.
    • Result shaping (single match expands to managerChain/directReports, no-match note, name-sorted cursor) moves from the MCP tool into lib/people/directory-lookup.ts, shared by the MCP and the Assistant. The people input schema is also shared (searchPeopleInputSchema).
  • people entitlement, Assistant turns only: an evaluator can now declare an assistant scope; Assistant turns are asked only those (previously they always sent []), Build/Plan turns never evaluate it. The worker offers search_people only when granted.
  • Fix: read_document by pasted link in the Assistant. The tool turned the requested ID into a documentIds filter; for a link, the use case resolves a canonical ID that never matches the raw URL, so every pasted link failed with "outside the selected search filters". Links now pass only the selected Assistant scope, which the use case checks against the resolved ID.
  • Regenerated the worker-synced copies (generated/protocol.ts, generated/sim-assistant-tools.generated.ts) and the tool catalog.

Merge order

This PR first; the worker companion only offers search_people once Sim sends the people entitlement, and Sim already accepts every field the worker sends. Entitlement names are free-form on the worker wire, so this PR is safe ahead of the worker.

Companion: simstudioai/mothership#1024

Testing

  • people.integration.ts (real Postgres): a member's own org chat gets the match with its reporting line and a personId expansion; another member's chat is refused; a chat owner who is no longer a member is refused; workspace conversations are refused.
  • workspace-search.test.ts: involving reaches the use case, and a pasted link reaches the read use case with only the selected scope. Both fail on the pre-fix tool.
  • Existing MCP people tests pass unchanged against the shared module.
  • Local: targeted vitest (49 files), biome, check:boundaries, check:principal-kind-parity, check:permission-group-enforcement, check:file-names, check:test-patterns, check:comment-hygiene, check:application-graph, check:mcp-operations, mship-tools:check (against the companion catalog). Full gate in CI.

… the organization Assistant

The Assistant's search_workspace takes the involving filter the Search MCP gained, and organization
Assistant turns get search_people, backed by the People list/get use cases through a copilot
organization delegation bound to the member's private chat. Result shaping moves to
lib/people/directory-lookup.ts so the MCP and the Assistant share it. A people entitlement,
evaluated only on Assistant turns, tells the worker when to offer the tool.

Also fixes read_document by pasted link in the Assistant: the tool no longer turns the raw link
into a documentIds filter that the resolved document ID could never match.
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 27, 2026 1:28am UTC

Request Review

@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • ❌ simstudioai/mothership#1024 — OPEN, not merged (targets staging) — feat(worker): offer search_people and involving to the organization Assistant

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 24 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new blocking issue remains.RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no new blocking issue remains.

Summary

Adds organization Assistant people lookup, forwards involving to live search, and fixes document reads from pasted links.

  • The organization Assistant can look up people and their reporting lines.
  • Assistant workspace searches can filter results by who acted on them.
  • The Assistant can read a pasted source link under the selected scope.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Organization Assistant turn] --> B[Check directory access]
  B --> C[Grant people entitlement]
  C --> D[search_people]
  D --> E[Check Assistant mode and private chat]
  E --> F[People use cases]
  F --> G[Check membership and directory permission]
  G --> H[Return people and reporting lines]
Loading

Reviews (3) · Last reviewed commit: "fix(search-assistant): keep person-filte..." · Reviewed by Greptile

Comment thread apps/sim/lib/mothership/entitlements.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 26 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 7ef574c into staging Nov 27, 2026
85 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 80bd914b Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant