improvement(search): reduce redundant metadata reads

Merged
WA
2mo ago
+778-78

Summary

  • Batch knowledge-base references and tag definitions during search, reducing those reads from 40 statements to 2 for 20 bases while preserving ordering, missing entries, and fresh authorization.
  • Skip GitHub connector discovery for explicitly filtered non-GitHub searches. Keep default/GitHub discovery, ranking, and live access checks unchanged.

Type of Change

  • Performance improvement

Testing

  • 820 unit tests and 62 PostgreSQL integration tests passed, covering ACLs, source/date filters, GitHub access, organization MCP search, and batching parity.
  • Local synthetic benchmark: 480 paired scenario groups; 20-base reference/tag p50 improved from 7.67 ms to 1.91 ms. This measures preparation only; single-base SQL is unchanged.
  • Lint, repository audits, block-registry validation, and docs manifest validation passed. The batching regression is included in the existing PostgreSQL CI job.

Checklist

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