Skip to content

fix(people): resolve experts only by verified identities, validate SCIM time zones on write, fair Slack identity sweep - #10572

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/people-identity-hardening
Dec 1, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/people-identity-hardening

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Fixes from an audit of People (#10538) and expert search (#10565):

  • Experts resolve only by verified identities (medium). A contributor now resolves to a directory person only by a verified email: one from the source's own account, or the one behind the organization's own Slack identity.
    • Before, a contributor named only by name (a GitLab commit author, a GitHub commit with no linked account, a Slack Connect guest, an outside display name) matched any directory person with that unique name. Anyone pushing a commit as "Jane Smith" was credited as the directory's Jane Smith.
    • Names now only land in otherContributors. resolveDirectoryIdentities drops name matching.
  • SCIM time zones are validated on write. SCIM staging keeps a time zone only when Postgres knows it (one hashed pg_timezone_names lookup per sync), like Okta and Slack, which validate with directoryTimeZone.
    • Person reads now take the stored zone instead of a correlated pg_timezone_names scan per row (0.3 to 3 ms a row).
    • An invalid zone already stored from SCIM is replaced on that organization's next directory sync.
  • The Slack identity sweep is fairer.
    • Leases go never-visited first, then longest overdue.
    • Leases are taken one at a time, so an organization without People, which only has its identities cleared, no longer takes one of the sweep's two refreshes.
  • No contract or generated file changes; no migration. Mothership needs nothing.

Type of Change

  • Bug fix

Testing

Each new test fails when its guard is reverted:

  • experts.integration.ts: a commit author name, and a Slack ID outside the organization's identities, both equal to a unique directory name, are never credited as an expert.
  • sync/snapshot.integration.ts: a SCIM time zone Postgres doesn't know is dropped at staging, and a known one is kept.
  • slack-identities.integration.ts:
    • The never-visited and longest-overdue organizations are refreshed first.
    • Organizations without People are cleared without taking a refresh.
    • The People-disabled clear path empties the list and checks again a day later.

Also run: related unit and integration suites, type-check, and the audits test-types, test-patterns, comment-hygiene, boundaries, unused-exports, source-conventions and explicit-any.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 1, 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 Dec 1, 2026 1:45pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues remain from this review.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain from this review.

Summary

This PR limits expert matches to email and organization Slack identities, checks SCIM time zones before storing them, and makes the Slack sweep visit organizations more fairly.

  • Expert search connects directory people only through verified identities.
  • SCIM sync stores known time zones in the catalog’s spelling.
  • Slack identity sweeps clear organizations fairly and save refresh slots for active directories.

Reviews (2) · Last reviewed commit: "fix(people): stage a SCIM time zone in t..." · Reviewed by Greptile

@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 7 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/people/repository.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 Dec 1, 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 7 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

…IM time zones on write; fair Slack identity sweep

- Expert search resolves a contributor to a directory person only by a verified email or the organization's own Slack identity. A name, such as a commit author or a Slack Connect guest, is free text anyone can set, so it stays an outside contributor.
- SCIM time zones are validated as they are staged, so person reads take the stored zone instead of scanning pg_timezone_names for every row.
- The Slack identity sweep takes never-visited and longest-overdue organizations first, and one without People only has its identities cleared, without taking a refresh from one that has it.
@waleedlatif1
waleedlatif1 force-pushed the fix/people-identity-hardening branch from a408026 to e183901 Compare December 1, 2026 13:45
@waleedlatif1
waleedlatif1 merged commit 42bef23 into staging Dec 1, 2026
83 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/people-identity-hardening branch December 1, 2026 16:53

This branch was previously deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant