Skip to content

feat(indexer): route ProfileCount to Hyperindex - #236

Closed
Kzoeps wants to merge 1 commit into
stage0-hyperindex-foundationfrom
stage1-profile-counts
Closed

feat(indexer): route ProfileCount to Hyperindex#236
Kzoeps wants to merge 1 commit into
stage0-hyperindex-foundationfrom
stage1-profile-counts

Conversation

@Kzoeps

@Kzoeps Kzoeps commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on top of #235.

This PR migrates exactly one operation to Hyperindex:

  • ProfileCount

Everything else remains Magic-backed.

Implementation details:

  • Adds a Hyperindex-specific query for ProfileCount.

  • Routes ProfileCount through the per-operation backend switchboard to hyperindex.

  • Keeps the public /api/indexer operation contract unchanged.

  • Translates Magic's excludeAuthorLabels: ["likely-test"] into Hyperindex's typed label predicate:

    where: {
      authorLabels: {
        none: {
          val: { in: ["likely-test"] }
          activeOnly: true
        }
      }
    }

Known parity note

At implementation time, the stage-specific sample returned:

  • Magic ProfileCount: 3388
  • Hyperindex ProfileCount: 3236

This is a visible count difference on the welcome/landing stats. It appears to be due to backend indexing/label semantics rather than a client mapper change. Please manually verify whether this semantic difference is acceptable before merging.

What did not change

  • No other count operations moved.
  • OrganizationCount, ActivityCount, ProjectCount, AwardCount, UserActivityCount, and ActorWorkspaceCounts remain Magic-backed.
  • No writes changed.
  • No client hook/component API changed.

Checks run

  • npm test -- src/app/api/indexer/__tests__/route.test.ts
  • npm run typecheck
  • npx eslint src/app/api/indexer/route.ts src/app/api/indexer/__tests__/route.test.ts

Manual test instructions

  1. Deploy this stacked branch after chore(indexer): add Hyperindex migration foundation #235.

  2. Open /welcome or the landing surface that renders network stats.

  3. Confirm the users/profile count still renders without an error.

  4. Confirm /api/indexer responses for ProfileCount include:

    X-Indexer-Backend: hyperindex
  5. Confirm other count operations still report:

    X-Indexer-Backend: magic

Rollback

Revert this PR or remove ProfileCount: "hyperindex" from OPERATION_BACKENDS. Other operations are unaffected.

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
certified-app Ready Ready Preview, Comment Jul 7, 2026 6:55pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e0b5f81-b110-4558-913b-3fc8544be6c1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stage1-profile-counts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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