Repository navigation
feat(search-experts): find who knows a topic from contributors across connected sources - #10565
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryAdds
|
There was a problem hiding this comment.
1 issue found across 40 files
Confidence score: 3/5
- In
apps/sim/lib/internal/organization-search/search-experts.ts, this workflow can callsearchExperts.executewithout checking whether organization search is available. AddrequireOrganizationSearchAvailable(call.principal.organizationId)before the call; the nested live-search gate does not cover this path.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/internal/organization-search/search-experts.ts">
<violation number="1" location="apps/sim/lib/internal/organization-search/search-experts.ts:12">
P2: Gate this workflow handler with `requireOrganizationSearchAvailable(call.principal.organizationId)` before invoking `searchExperts.execute`; do not rely on the nested live-search gate.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
a2c7e71 to
fd24aa5
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 42 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@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 review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
… connected sources Adds search_experts to the Search MCP, the Assistant and the Organization Search block. Live providers report each result's contributors when asked; the use case ranks them by role, source, recency and rank, matches them to the People directory by email, Slack account or an unambiguous name, and returns evidence links to the items.
…ence, keep self-declared emails out of identity - Contributors resolve to their directory person before ranking, so an email in one source and a unique name in another add up. - An item two connected accounts both return counts once. - GitHub people are named by login; git commit emails and GitLab public emails no longer identify anyone; Slack file authors count. - Linear emails and the Drive last editor are fetched only for expert searches. - A Slack ID that two workspaces give different people resolves to no one, and Slack emails are folded. - The Assistant's citation readers collect expert evidence; its summary mentions outside contributors. - Without directory access, department and location filters no longer hide every contributor; the note says they were not applied. - The workflow tool projects every filter a secret could fill, not only the query.
…ge when compacted, match only unshared emails - The Assistant tool projects the query, department and location through the turn's secret registry and refuses protected content, as search_workspace does. - Compacted expert results keep their partial-coverage marker. - An email two directory people share resolves to neither, as names already did. - GitLab results with only the singular assignee field keep that assignee.
…ent masking and shared-identity rules - search_experts admits its content up front, as live search does; in Chat the nested search's accounting does not reach the outer operation, so every Assistant call failed as unaccounted content. - The Assistant tool sends the connected sources only the projected query and never answers with a secret filter. - The workflow tool projects a secret-filled department out of returned profiles. - An email two directory people share, or a Slack ID that two workspaces give different people, matches no one.
There was a problem hiding this comment.
All reported issues were addressed across 44 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…stray doc line, regenerate after staging
48228f8 to
9256559
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 45 files
Confidence score: 4/5
mothership-assistant-tools.tsaccepts source strings that expert search cannot use, so a typo can silently return no results. Validate sources withliveSearchProviderSchema.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/api/contracts/mothership-assistant-tools.ts">
<violation number="1" location="apps/sim/lib/api/contracts/mothership-assistant-tools.ts:586">
P2: This accepts arbitrary source strings even though expert search only targets live provider IDs. Reject invalid sources with `liveSearchProviderSchema` so a typo does not silently produce a no-results search.</violation>
</file>
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
…s on every surface The Assistant answered with a directory department that matched a run secret; profiles and outside contributors are now projected through the result registry in the use case, and the Assistant test asserts on a returned expert so it cannot pass vacuously.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 45 files
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
…rt; test a withheld member directory When contributors were found but none matched the department or location filter, the note now says so instead of claiming no one worked on the topic. The directory-closed tests now also cover a plain member kept out by a withheld member directory, with People enabled.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 45 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Summary
Adds
search_experts: find who in the organization knows a topic, ranked by what they did on matching items the caller can read.lib/knowledge/experts/rank.ts): weighted by role, source, recency and rank within the account. Slack items per person are capped, people who appear across several sources get a bonus, and each person keeps up to 5 evidence links.lib/knowledge/application/experts.ts, underknowledgeOperations.search):canLookUpPeople) gets contributors as their sources name them, without profiles.personFactsassearch_people.LiveSourceStatus; when a search reached no source, the note carries live search's guidance.search_experts.search_experts, which adds citation IDs to evidence and tells the model how to cite and how to reconnect.search_experts, which is now the sixth entry inORGANIZATION_SEARCH_OPERATIONS. It runs as the person who started the run.searchExpertsInputSchemareuses the 92-day activity window rule and the People field filters.?: T | undefinedfor exactOptionalPropertyTypes.Mothership
search_expertsto the Assistant's tool set with the catalog entry (already intool-catalog-v1), and regeneratesim-assistant-tools.generated.tsfromapps/sim/lib/api/contracts/mothership-assistant-tools.ts(bun run generate:cli-inventoryin the worker).route: 'sim'); nothing else is needed.Type of Change
Testing
lib/mothership/tools/server/knowledge/experts.integration.tsruns the Assistant tool over a real directory and copilot delegation. It checks that the connected sources get only the projected query and that a secret filter never comes back in the answer. It also covers the Chat content-accounting fix,admitContentat the top of the use case; without it every Assistant call failed.execute-tool.integration.ts: a secret-filled department is projected out of the returned profiles in a workflow run.experts.integration.ts: an email two directory people share, or a Slack ID that two workspaces give different people, matches no one.lib/knowledge/application/experts.integration.ts, against a real database:lib/internal/organization-search/execute-tool.integration.ts:search_expertsin a workflow run with no connected source.lib/sim-search/live/atlassian.test.ts: contributors are extracted, and contributor fields are requested only when asked for.bun run generateandlint; audits: test-types, boundaries, tool-effects, api-validation:strict, canvas-sentences, integration-catalog, organization-egress, comment-hygiene, explicit-any, source-conventions, unused-exports, tool-registry-boundary.Checklist
test-auditauthoring gate)