Repository navigation
feat(neighbors): filter by state and merge time before ranking - #239
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThis PR adds three filters before neighbor ranking, thread metadata in results, and a complete-sync freshness timestamp. Example: Find similar PRs merged after openclaw/openclaw pull request 160462 was created at 2026-09-28T12:59:02Z.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: current main lacks these filters, the contribution demonstrates useful behavior, and no actionable introduced defect was found; the public CLI surface still needs owner direction. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe neighbors CLI reads cached SQLite thread embeddings, selects eligible vectors, ranks similarity, and returns hydrated thread metadata alongside recorded sync freshness. flowchart LR
A[CLI arguments] --> B[Neighbors command]
C[SQLite archive] --> D[Filtered vectors]
B --> D
D --> E[Similarity ranking]
E --> F[Neighbor output]
C --> G[Sync freshness]
G --> F
Technical reviewBest possible solution: Add approved filters within the existing neighbor query while preserving default selection, scoring, storage, and documented history limitations. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the missing filters and metadata, and supplied baseline CLI output demonstrates the expensive workaround; this review executed no target code. Is this the best way to solve the issue? Filtering in the existing SQL query before decoding and scoring directly addresses the workload without a competing implementation or storage migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd30790d7735. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 12:56 PM ET / 16:56 UTC (Revision 2). |
Pass bulk thread IDs through a single JSON parameter so large neighbor, search, and cluster lookups do not exceed SQLite's bind-variable limit. Preserve repository filtering, duplicate and missing-ID behavior, and caller ordering. Add regression coverage for 32,768 IDs and document large neighbor result limits. Thanks @masatohoshino for reporting the failure in #238; its separate temporal-filter proposal remains open in #239. Validated with focused regression tests, the full check gates and snapshot artifacts on AWS Crabbox, independent Codex review through P3, and green exact-head CI.
Add opt-in temporal filters before vector decoding and ranking, preserving existing default selection and scoring. Include additive thread metadata and a successful complete sync-and-sweep watermark, with explicit historical coverage, reopening, and timestamp-precision limits. Verify freshness through real sync-runner paths as well as stored run records. Closes openclaw#238. Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
44f46b6 to
f5f07aa
Compare
Closes #238.
What Problem This Solves
Finding similar PRs merged after another PR was opened requires retrieving broad neighbor results and joining a separate thread dump for merge times.
User Impact
User impact:
neighborscan filter candidates with--merged-after,--open-at, and--created-afterbefore vector scoring and--limit. Results add state, URL, draft, author, and timestamp metadata. Existing default candidate selection, scores, and fields are preserved; no schema migration is needed.Why This Change Was Made
Maintainer decision: accept all three opt-in filters and additive metadata.
--open-atand--merged-afterimply--include-closed;--created-afteralso accepts a same-repository issue/PR reference.state_as_ofrecords the start of the newest successful complete open/all sync and closed-thread sweep. It is omitted without a qualifying run; bounded, targeted, failed, and checkpoint runs cannot advance it. It does not certify historical backfill. The clustering guide and CLI help explain legacy sweep gaps, missing historical rows, SQLite millisecond timestamp precision, and the fact that reopening prevents--open-atfrom reconstructing exact history. Similarity produces candidates to verify before acting.The contribution is by @masatohoshino. Maintainer completion resolves conflicts against current main, strengthens sync-runner freshness tests, clarifies the freshness contract, and retains contributor credit and the Unreleased changelog acknowledgment. The separate large-ID hydration failure from #238 was already fixed in #255.
Evidence
Focused neighbor, default-output, legacy SQL preservation, time-boundary, freshness, and sync-runner tests pass. Independent Codex autoreview is clean through P3.
Full
make checkpassed on Linux with Go 1.27.2, Node 26.10.0, and GoReleaser 2.18.2: 85.1% coverage, no vulnerabilities, clean formatting/vet/deadcode, CLI and release-script smoke tests, docs/link checks, and six platform snapshot builds. No release was published.A freshly built CLI also passed against an isolated synthetic SQLite archive. Default results were
[201,205];--open-at 2026-09-10T12:00:00Zreturned[201,204];--created-after '#202' --include-closedreturned[204,205,203];--merged-after 2026-09-10 --limit 1returned[203]even though other candidates ranked higher before filtering. An exact merge boundary excluded the boundary row. All outputs carried the expected metadata and complete-sync watermark.Exact-head CI: https://github.com/openclaw/gitcrawl/actions/runs/39008076538 (Linux, macOS, Windows and docs).