Skip to content

Enable signal-scoped entity enrichment producers - #854

Merged
jeevanpillay merged 25 commits into
mainfrom
feat/real-entity-enrichment-producers
Jun 7, 2026
Merged

jeevanpillay merged 25 commits into
mainfrom
feat/real-entity-enrichment-producers

Conversation

@jeevanpillay

@jeevanpillay jeevanpillay commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Starts entity enrichment from persisted Signals only, deriving X/GitHub targets from signal entity links.
  • Adds provider profile fetchers, local emulator fixtures, and a keyless development classifier fallback for end-to-end local debugging.
  • Projects canonical graph people into People as one bridge row per graph person, with source identities and aliases reconciled back onto signal links.

Scope notes

  • No broad connector/profile enrichment yet; this is intentionally signal-scoped.
  • Exa and future migration/product expansion remain deferred.
  • Local dev can use the stable fixture pair @ava_ai + https://github.com/avachen.

Test Plan

  • pnpm --filter @repo/ai exec vitest run src/__tests__/signal-classifier/classify.test.ts
  • pnpm --filter @api/app exec vitest run --passWithNoTests entity-index-workflow.test.ts signal-workflow.test.ts signal-entity-enrichment-fetchers.test.ts entity-resolution-workflow.test.ts
  • pnpm --filter @db/app exec vitest run src/__tests__/people.test.ts src/__tests__/signal-entity-links.test.ts
  • pnpm --filter @repo/x-emulator test -- src/__tests__/server.test.ts
  • pnpm --filter @repo/github-emulator test -- src/__tests__/server.test.ts
  • pnpm check
  • pnpm typecheck

Local verification

  • Created a test Signal mentioning @ava_ai and https://github.com/avachen.
  • Verified provider observations converge into one canonical graph person and one projected People row.
  • Verified both signal links resolve to the same People id in the UI.

Summary by CodeRabbit

  • New Features
    • Signal entity enrichment: automatic fetching and integration of X and GitHub profile data for identified users.
    • Local signal classification fallback for development when AI gateway is unavailable.
    • Manual retry for signal enrichment in non-production/development environments.
    • Richer profile metadata captured (bio, location, company/blog/profile URL, twitter handle) for better identity resolution.

@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

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

4 Skipped Deployments
Project Deployment Actions Updated (UTC)
lightfast-app Ignored Ignored Preview Jun 7, 2026 2:24pm
lightfast-mcp Ignored Ignored Preview Jun 7, 2026 2:24pm
lightfast-platform Ignored Ignored Preview Jun 7, 2026 2:24pm
lightfast-www Ignored Ignored Preview Jun 7, 2026 2:24pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@jeevanpillay, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e2dc240-9825-478e-869f-dc4f789b768c

📥 Commits

Reviewing files that changed from the base of the PR and between 2d1339c and 00b0d24.

📒 Files selected for processing (17)
  • .github/actions/turbo-summary/action.yml
  • api/app/src/__tests__/connectors-x-mcp-bridge.test.ts
  • api/app/src/services/connectors/x-mcp-bridge.ts
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/people/_components/people-detail-content.tsx
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/people/_components/people-detail-sheet.test.tsx
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/people/_components/people-detail-sheet.tsx
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/signals/_components/signal-detail-content.tsx
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/signals/_components/signal-detail-sheet.test.tsx
  • apps/app/src/app/(app)/(pending-not-allowed)/[slug]/(workspace)/signals/_components/signal-detail-sheet.tsx
  • db/app/src/__tests__/people.test.ts
  • db/app/src/index.ts
  • db/app/src/utils/people.ts
  • emulators/x/src/__tests__/server.test.ts
  • emulators/x/src/fixtures.ts
  • emulators/x/src/plugin/index.ts
  • packages/x-app-node/src/__tests__/tools.test.ts
  • packages/x-app-node/src/operations.ts
📝 Walkthrough

Walkthrough
Adds deterministic local signal classification fallback, queues enrichment via a new Inngest workflow, fetches X/GitHub profiles resiliently, converts payloads to observations with deterministic IDs, projects entity-graph people into org people, and reconciles signal-based links during resolution.

Changes

Signal Enrichment Pipeline

Layer / File(s) Summary
Local classifier and workflow gating
ai/src/signal-classifier/local.ts, ai/src/signal-classifier/index.ts, ai/src/__tests__/signal-classifier/classify.test.ts, api/app/src/inngest/workflow/classify-signal.ts, api/app/src/__tests__/signal-workflow.test.ts
Adds classifySignalInputLocally, re-exports it, tests deterministic outcomes, and conditionally uses it in classify-signal when running in development without AI_GATEWAY_API_KEY.
Provider fetchers, adapters & deterministic IDs
api/app/src/services/entity-enrichment/provider-fetchers.ts, api/app/src/services/entity-enrichment/adapters.ts, api/app/src/services/entity-enrichment/ids.ts, api/app/src/services/entity-enrichment/index.ts, api/app/src/__tests__/signal-entity-enrichment-fetchers.test.ts, api/app/src/__tests__/entity-enrichment-adapters.test.ts
Concurrent X/GitHub profile fetch orchestration, diagnostics aggregation, X emulator token fallback/retry, payload→observation adapters, and deterministic ingestion/event id generation + tests.
Enrichment workflow, event schemas, and wiring
api/app/src/inngest/workflow/enrich-signal-entities.ts, api/app/src/inngest/schemas/app.ts, api/app/src/inngest/index.ts, api/app/src/__tests__/signal-entity-enrichment-workflow.test.ts, api/app/src/__tests__/inngest-route.test.ts
New enrichSignalEntities workflow that emits app/connector.profile.observed with source metadata; adds app/signal.entity-enrichment.requested event schema; registers workflow in Inngest and tests its registration and behavior.
DB enrichment targets, reconciliation & graph projection
db/app/src/utils/signal-entity-links.ts, db/app/src/utils/people.ts, db/app/src/index.ts, db/app/src/__tests__/signal-entity-links.test.ts, db/app/src/__tests__/people.test.ts, packages/app-validation/src/schemas/people.ts
Derives per-provider enrichment targets (with skip reasons and caps), expands reconciliation to include entityGraph aliases, adds graph→org projection (projectEntityGraphPeopleToOrgPeople) with entity_graph personSource, exports types, and updates validation/tests.
Resolution workflow integration
api/app/src/inngest/workflow/run-entity-resolution.ts, api/app/src/__tests__/entity-resolution-workflow.test.ts, api/app/src/inngest/workflow/index-signal-entities.ts
When source.kind === signal_entity_enrichment, run projection and reconciliation, capture projectedPeople and entityLinksResolved, and include them in persisted events and returned results.
Router mutation & connector helper
api/app/src/router/(pending-not-allowed)/workspace-entity-graph.ts, api/app/src/services/connectors/x-mcp-bridge.ts, api/app/src/__tests__/workspace-entity-graph-router.test.ts, api/app/src/__tests__/connectors-x-mcp-bridge.test.ts
Adds dev-only retrySignalEnrichment mutation emitting app/signal.entity-enrichment.requested with manual_retry; exports getFreshXConnectorAccessToken used by fetchers and tested.
Emulators & client changes
emulators/x/*, emulators/github/*, packages/x-app-node/src/tools.ts, packages/github-app-node/src/user.ts, packages/github-app-node/src/index.ts, related tests
Expand emulator fixtures/serializers to richer user profiles; add user.fields query to X tool URLs; add getGitHubUserByLogin and re-exports; update tests accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant Signal as SignalProducer
  participant Classifier as classifySignalInputLocally
  participant Indexer as classify-signal workflow
  participant Enricher as enrichSignalEntities workflow
  participant Provider as ProviderFetchers (X/GitHub)
  participant Resolver as runEntityResolution
  Signal->>Classifier: classify input (input, signalId)
  Classifier-->>Indexer: classification result (routing, visibility)
  Indexer->>Indexer: persist classification & resolved links
  Indexer->>Enricher: enqueue app/signal.entity-enrichment.requested
  Enricher->>Provider: fetchSignalEntityProfiles(targets)
  Provider-->>Enricher: payloads (xPayloads, githubPayloads, diagnostics)
  Enricher->>Enricher: convert to observations, compute IDs
  Enricher->>Resolver: emit app/connector.profile.observed (observations + source)
  Resolver->>Resolver: project graph people & reconcile links (if source=signal)
  Resolver-->>Indexer: emit app/entity.graph.persisted (projectedPeople, entityLinksResolved)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Review issues (categorize: [blocker]/[warning]/[nit])

[warning] app event schema and persisted counters changed — verify backwards compatibility in consumers (file: api/app/src/inngest/schemas/app.ts). Why: adding optional source and new numeric counters changes persisted event shape and may break consumers expecting previous exact schema.

[warning] Env gating for local classification/deterministic-only linking uses VERCEL_ENV + absence of process.env.AI_GATEWAY_API_KEY (files: api/app/src/inngest/workflow/classify-signal.ts, api/app/src/inngest/workflow/index-signal-entities.ts). Why: accidental use in CI or atypical dev setups could trigger local paths; confirm environment semantics and CI test coverage.

[nit] Exporting getFreshXConnectorAccessToken (file: api/app/src/services/connectors/x-mcp-bridge.ts) is small API surface increase — ensure intended public usage and add brief docstring where consumed. Why: minor maintenance clarity.

[nit] Ensure new enum expansion (entity_graph) (file: packages/app-validation/src/schemas/people.ts) is reflected where PersonSource is stored/read (DB migrations/tests). Why: widen enum may affect type narrowing or serialization assumptions.

End.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bfee3bad1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread db/app/src/utils/people.ts Outdated
inArray(orgEntityPeople.primarySourceIdentityId, sourceIdentityIds),
...input.sourceIdentities.map(
(identity) =>
sql`${orgEntityPeople.canonicalKey} like ${`%${escapeLikePattern(identity.identityKey)}%`} escape '\\\\'`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match graph people by exact source-identity tokens

When an enriched handle is a prefix of another handle, this substring LIKE can load the wrong canonical graph person; for example x:handle:ava matches a canonical key like person:x:handle:ava_ai, and graphPersonContainsSourceIdentity also uses .includes, so projection can create/resolve a People row for @ava using the @ava_ai graph metadata. This can incorrectly resolve signal links and is avoidable by matching delimited canonical-key tokens or joining through exact source identity ids instead of substring matching.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🧹 Nitpick comments (4)
api/app/src/inngest/workflow/index-signal-entities.ts (1)

33-35: ⚡ Quick win

[warning] Centralize the dev keyless fallback gate used by both workflows

shouldUseDeterministicOnlyEntityLinking() duplicates the same condition used in api/app/src/inngest/workflow/classify-signal.ts (Line 123-125). If one branch changes later, classification and indexing can diverge in non-obvious ways. Extract a shared helper and reuse it in both files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/app/src/inngest/workflow/index-signal-entities.ts` around lines 33 - 35,
The dev keyless fallback condition is duplicated in
shouldUseDeterministicOnlyEntityLinking; extract that condition into a single
exported helper (e.g., isDevKeylessFallback or
useDeterministicOnlyEntityLinkingGate) in a shared utilities module and replace
the local implementation in index-signal-entities.ts and the duplicate in
classify-signal.ts to import and call the new helper; ensure the helper returns
the same boolean expression (env.VERCEL_ENV === "development" &&
!process.env.AI_GATEWAY_API_KEY) and update both files to remove their local
functions and use the shared export.
db/app/src/__tests__/signal-entity-links.test.ts (1)

460-548: ⚡ Quick win

[warning] Cap-path behavior is not actually exercised

This test name says “capped provider targets,” but the fixture never exceeds MAX_ENRICHMENT_TARGETS_PER_PROVIDER, so over_cap is untested. Add >10 unique x targets and assert only 10 remain plus skipped.reason === "over_cap" for the rest.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@db/app/src/__tests__/signal-entity-links.test.ts` around lines 460 - 548, The
test "derives capped provider targets from unresolved persisted links" never
exceeds MAX_ENRICHMENT_TARGETS_PER_PROVIDER so the over_cap path is untested;
update the fixture passed to makeTargetDb (used by
listSignalEntityEnrichmentTargets) to include more than
MAX_ENRICHMENT_TARGETS_PER_PROVIDER unique x/profile targets (e.g., create >10
distinct links with provider "x"/normalizedValue "ava_ai_<n>") so the cap logic
runs, then assert the returned x array contains only
MAX_ENRICHMENT_TARGETS_PER_PROVIDER items and that the extra links appear in
skipped with reason "over_cap"; keep other assertions (github target and
unsupported skips) and the spies.where / spies.orderBy call-count checks.
packages/github-app-node/src/__tests__/user.test.ts (1)

53-102: ⚡ Quick win

[nit] Add one failure-path behavior test for profile validation

Line 53-102 only validates the success path. Add one reject case (e.g., type: "Organization" or malformed profile payload) so the GITHUB_API_RESPONSE_INVALID guard stays locked by behavior, not just implementation.

Suggested test addition
 describe("getGitHubUserByLogin", () => {
+  it("rejects non-user profiles", async () => {
+    const fetchMock = vi.fn(async () =>
+      Response.json({ id: 1, login: "acme", type: "Organization" })
+    );
+
+    await expect(
+      getGitHubUserByLogin({
+        fetch: fetchMock,
+        login: "acme",
+        token: "installation_token",
+      })
+    ).rejects.toMatchObject({ code: "GITHUB_API_RESPONSE_INVALID" });
+  });
+
   it("returns a rich user profile from GET /users/{login}", async () => {

As per coding guidelines, "Prefer behavior-based assertions over implementation details".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/github-app-node/src/__tests__/user.test.ts` around lines 53 - 102,
Add a failure-path test for getGitHubUserByLogin that exercises the
GITHUB_API_RESPONSE_INVALID guard: create a fetch mock that returns a GitHub
profile payload which is invalid (e.g., type: "Organization" or missing required
fields like login/id) and assert that getGitHubUserByLogin rejects (or throws)
with the expected error (or error code/message) instead of resolving; reference
getGitHubUserByLogin and the GITHUB_API_RESPONSE_INVALID guard when locating
where to add the test and ensure the test also verifies the fetch call was
invoked with the same request headers as the success test.
api/app/src/__tests__/connectors-x-mcp-bridge.test.ts (1)

227-251: ⚡ Quick win

[nit] Assert refresh is skipped for fresh access tokens

Line 227-251 validates decrypt behavior, but it does not explicitly lock the “no refresh” branch. Add a refreshXOAuthTokenMock negative assertion to catch unnecessary refresh regressions.

Suggested assertion
   it("exposes the shared fresh access-token helper", async () => {
     await expect(
       getFreshXConnectorAccessToken({
         config: {
@@
     expect(decryptMock).toHaveBeenCalledWith(
       "encrypted_x_access",
       envMock.ENCRYPTION_KEY
     );
+    expect(refreshXOAuthTokenMock).not.toHaveBeenCalled();
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/app/src/__tests__/connectors-x-mcp-bridge.test.ts` around lines 227 -
251, The test for getFreshXConnectorAccessToken should also assert that the
refresh path was not taken: after the existing
expect(...).resolves.toBe("x_access_token") and the decryptMock assertion, add a
negative assertion verifying refreshXOAuthTokenMock was not called (e.g.
expect(refreshXOAuthTokenMock).not.toHaveBeenCalled()) so regressions that
trigger unnecessary token refreshes are caught; place this in the "exposes the
shared fresh access-token helper" test alongside decryptMock assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/app/src/inngest/workflow/enrich-signal-entities.ts`:
- Around line 44-52: The timestamp and observation conversion are done outside a
step, breaking determinism on retries; move creation of observedAt and the
mapping/filtering (the block using observedAt, xUserPayloadToObservation,
githubUserPayloadToObservation, and isNonNullish) into a single step.run call
(e.g., step.run("convert observations", async () => { ... })) immediately after
fetching profiles so the timestamp is stable and the conversion benefits from
step-level retries.

In `@db/app/src/utils/people.ts`:
- Around line 381-399: The canonical-key matching currently uses substring LIKE
fragments (see orgEntityPeople.canonicalKey with escapeLikePattern and
input.sourceIdentities) which causes false positives; replace these raw SQL LIKE
fragments with delimiter-aware exact token membership checks using the Drizzle
query builder (e.g., split canonicalKey by the delimiter and use equality or
array membership operators provided by Drizzle instead of sql`` fragments), and
also ensure the primarySourceIdentityId match
(orgEntityPeople.primarySourceIdentityId) is preserved; remove all raw sql
string construction (escapeLikePattern/sql`` usage) and build the equivalent
safe query using Drizzle functions/operators so tokens are matched exactly
rather than via '%...%'.

In `@packages/github-app-node/src/index.ts`:
- Around line 36-41: The package entrypoint is missing the exported input type
for getGitHubUserByLogin: add GetGitHubUserByLoginInput to the re-exports in
packages/github-app-node/src/index.ts (alongside getGitHubUserByLogin and the
other types) so the public API surfaces the new input type; alternatively if the
input should be internal, remove its export from
packages/github-app-node/src/user.ts, but ensure consistency by either
re-exporting GetGitHubUserByLoginInput or making it non-exported in user.ts.

---

Nitpick comments:
In `@api/app/src/__tests__/connectors-x-mcp-bridge.test.ts`:
- Around line 227-251: The test for getFreshXConnectorAccessToken should also
assert that the refresh path was not taken: after the existing
expect(...).resolves.toBe("x_access_token") and the decryptMock assertion, add a
negative assertion verifying refreshXOAuthTokenMock was not called (e.g.
expect(refreshXOAuthTokenMock).not.toHaveBeenCalled()) so regressions that
trigger unnecessary token refreshes are caught; place this in the "exposes the
shared fresh access-token helper" test alongside decryptMock assertions.

In `@api/app/src/inngest/workflow/index-signal-entities.ts`:
- Around line 33-35: The dev keyless fallback condition is duplicated in
shouldUseDeterministicOnlyEntityLinking; extract that condition into a single
exported helper (e.g., isDevKeylessFallback or
useDeterministicOnlyEntityLinkingGate) in a shared utilities module and replace
the local implementation in index-signal-entities.ts and the duplicate in
classify-signal.ts to import and call the new helper; ensure the helper returns
the same boolean expression (env.VERCEL_ENV === "development" &&
!process.env.AI_GATEWAY_API_KEY) and update both files to remove their local
functions and use the shared export.

In `@db/app/src/__tests__/signal-entity-links.test.ts`:
- Around line 460-548: The test "derives capped provider targets from unresolved
persisted links" never exceeds MAX_ENRICHMENT_TARGETS_PER_PROVIDER so the
over_cap path is untested; update the fixture passed to makeTargetDb (used by
listSignalEntityEnrichmentTargets) to include more than
MAX_ENRICHMENT_TARGETS_PER_PROVIDER unique x/profile targets (e.g., create >10
distinct links with provider "x"/normalizedValue "ava_ai_<n>") so the cap logic
runs, then assert the returned x array contains only
MAX_ENRICHMENT_TARGETS_PER_PROVIDER items and that the extra links appear in
skipped with reason "over_cap"; keep other assertions (github target and
unsupported skips) and the spies.where / spies.orderBy call-count checks.

In `@packages/github-app-node/src/__tests__/user.test.ts`:
- Around line 53-102: Add a failure-path test for getGitHubUserByLogin that
exercises the GITHUB_API_RESPONSE_INVALID guard: create a fetch mock that
returns a GitHub profile payload which is invalid (e.g., type: "Organization" or
missing required fields like login/id) and assert that getGitHubUserByLogin
rejects (or throws) with the expected error (or error code/message) instead of
resolving; reference getGitHubUserByLogin and the GITHUB_API_RESPONSE_INVALID
guard when locating where to add the test and ensure the test also verifies the
fetch call was invoked with the same request headers as the success test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 297e40a0-1d83-4c07-b5ed-6543e08f0493

📥 Commits

Reviewing files that changed from the base of the PR and between 6c07fa7 and 3bfee3b.

⛔ Files ignored due to path filters (3)
  • docs/superpowers/plans/2026-06-07-signal-scoped-entity-enrichment.md is excluded by !docs/**
  • docs/superpowers/runbooks/2026-06-07-signal-enrichment-agent-browser.md is excluded by !docs/**
  • docs/superpowers/specs/2026-06-07-real-entity-enrichment-producers-design.md is excluded by !docs/**
📒 Files selected for processing (42)
  • ai/src/__tests__/signal-classifier/classify.test.ts
  • ai/src/signal-classifier/index.ts
  • ai/src/signal-classifier/local.ts
  • api/app/src/__tests__/connectors-x-mcp-bridge.test.ts
  • api/app/src/__tests__/entity-enrichment-adapters.test.ts
  • api/app/src/__tests__/entity-index-workflow.test.ts
  • api/app/src/__tests__/entity-resolution-workflow.test.ts
  • api/app/src/__tests__/inngest-route.test.ts
  • api/app/src/__tests__/signal-entity-enrichment-fetchers.test.ts
  • api/app/src/__tests__/signal-entity-enrichment-workflow.test.ts
  • api/app/src/__tests__/signal-workflow.test.ts
  • api/app/src/__tests__/workspace-entity-graph-router.test.ts
  • api/app/src/inngest/index.ts
  • api/app/src/inngest/schemas/app.ts
  • api/app/src/inngest/workflow/classify-signal.ts
  • api/app/src/inngest/workflow/enrich-signal-entities.ts
  • api/app/src/inngest/workflow/index-signal-entities.ts
  • api/app/src/inngest/workflow/run-entity-resolution.ts
  • api/app/src/router/(pending-not-allowed)/workspace-entity-graph.ts
  • api/app/src/services/connectors/x-mcp-bridge.ts
  • api/app/src/services/entity-enrichment/adapters.ts
  • api/app/src/services/entity-enrichment/ids.ts
  • api/app/src/services/entity-enrichment/index.ts
  • api/app/src/services/entity-enrichment/provider-fetchers.ts
  • db/app/src/__tests__/people.test.ts
  • db/app/src/__tests__/signal-entity-links.test.ts
  • db/app/src/index.ts
  • db/app/src/utils/people.ts
  • db/app/src/utils/signal-entity-links.ts
  • emulators/github/src/__tests__/server.test.ts
  • emulators/github/src/fixtures.ts
  • emulators/x/src/__tests__/server.test.ts
  • emulators/x/src/fixtures.ts
  • emulators/x/src/plugin/index.ts
  • emulators/x/src/plugin/users.ts
  • packages/app-validation/src/__tests__/people.test.ts
  • packages/app-validation/src/schemas/people.ts
  • packages/github-app-node/src/__tests__/user.test.ts
  • packages/github-app-node/src/index.ts
  • packages/github-app-node/src/user.ts
  • packages/x-app-node/src/__tests__/tools.test.ts
  • packages/x-app-node/src/tools.ts

Comment thread api/app/src/inngest/workflow/enrich-signal-entities.ts Outdated
Comment thread db/app/src/utils/people.ts
Comment thread packages/github-app-node/src/index.ts
@vercel
vercel Bot temporarily deployed to Preview – lightfast-platform June 7, 2026 13:18 Inactive
@vercel
vercel Bot temporarily deployed to Preview – lightfast-www June 7, 2026 13:18 Inactive

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@db/app/src/utils/people.ts`:
- Around line 406-447: The fallback selection uses sourceIdentities[0] from an
unordered set, causing non-deterministic flips; make selection deterministic by
ordering the source identities before returning/using them: in
loadCanonicalSourceIdentitiesForGraphPeople ensure the returned array is sorted
by a stable key (e.g., identityKey or a concatenation of provider/type/value or
id) so callers (and the primarySourceIdentityId fallback logic) always pick the
same provider; apply the same deterministic sort where sourceIdentities is
consumed (the fallback that reads primarySourceIdentityId) so fallback selection
is stable across runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 041dde81-d23b-44b5-86f2-cbbd6969bbcf

📥 Commits

Reviewing files that changed from the base of the PR and between 3bfee3b and 2d1339c.

📒 Files selected for processing (6)
  • api/app/src/inngest/workflow/enrich-signal-entities.ts
  • db/app/src/__tests__/people.test.ts
  • db/app/src/__tests__/signal-entity-links.test.ts
  • db/app/src/utils/people.ts
  • db/app/src/utils/signal-entity-links.ts
  • packages/github-app-node/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/github-app-node/src/index.ts
  • api/app/src/inngest/workflow/enrich-signal-entities.ts
  • db/app/src/tests/signal-entity-links.test.ts
  • db/app/src/utils/signal-entity-links.ts

Comment thread db/app/src/utils/people.ts
@vercel
vercel Bot temporarily deployed to Preview – lightfast-www June 7, 2026 13:57 Inactive
@vercel
vercel Bot temporarily deployed to Preview – lightfast-platform June 7, 2026 13:57 Inactive
@vercel
vercel Bot temporarily deployed to Preview – lightfast-www June 7, 2026 14:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – lightfast-platform June 7, 2026 14:12 Inactive
@jeevanpillay

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 2 file(s) based on 1 CodeRabbit feedback item(s).

Files modified:

  • db/app/src/utils/people.ts
  • db/app/src/__tests__/people.test.ts

Commit: d43d2fc355ab

The latest autofix changes are on the feat/real-entity-enrichment-producers branch.

…chment-producers

# Conflicts:
#	api/app/src/__tests__/connectors-x-mcp-bridge.test.ts
#	packages/x-app-node/src/__tests__/tools.test.ts
#	packages/x-app-node/src/tools.ts
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