← Back to Pull requests

[Bug] Stabilize vector store pagination for equal creation timestamps #4011

Closed
unknown closed this pull request without merging on Sep 23, 2026 03:18 UTC
View on GitHub
unknown unknown commented on Sep 21, 2026 13:57 UTC
Author

<!-- markdownlint-disable -->

Closes #4003
<!-- For split PRs that should not auto-close the issue on merge, use: Related #xxxx -->
<!-- The linked issue must be accepted and have exactly one recognized owner. -->

Purpose

Vector store pagination used second-resolution CreatedAt as its only sort key. When multiple stores were created within the same second, ListStores copied entries from a Go map whose iteration order is nondeterministic. Cursor pagination using after or before could therefore repeat or omit stores.

Keep CreatedAt as the primary sort key and use ID as a deterministic tie-breaker for both ascending and descending order.

The change is limited to vector store ordering and regression tests. It does not change cursor formats, timestamp precision, schemas, or unrelated storage behavior.

Assisted-by: Codex GPT-5

Test Plan

  • gofmt and git diff --check

  • go vet ./pkg/vectorstore ./pkg/apiserver

  • Focused manager and API pagination tests

  • Pure-Go package tests and race tests

  • make check with the three changed files

  • make harness-check

  • RISC-V compile-only check for the vectorstore test binary
  • Test Result

  • gofmt, git diff --check, go vet, pre-commit, architecture checks, and golangci-lint passed.

  • Pure-Go package tests and race tests passed.

  • Harness registry, workflow validation, 380 harness tests, and 2/2 E2E framework unit tests passed.

  • No unrelated files were modified.
  • ---
    <details>
    <summary>Semantic Router PR Checklist</summary>

  • PR title begins with exactly one bracketed category

  • Affected modules are described without stacked title prefixes

  • Linked issue is accepted and owned by wg/data-plane-networking

  • Commits are signed off with git commit -s

  • Purpose, Test Plan, and Test Result reflect the scope and remaining blockers
  • </details>

    See [CONTRIBUTING.md](../CONTRIBUTING.md) for the full contributor workflow and commit guidance.

    Diff: 245 lines (+183 / -62) across 3 files Reviewer: FAUST-BENCHOU Review duration: 2241m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 245 lines diff across 3 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.329
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4011"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.9% (MEDIUM) · Higher = larger blast radius
    43.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.3% · Safe to merge
    17.3%