From f5f07aa9aebb87ce6986442499a969e9554c14be Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 16 Oct 2026 22:56:25 -0700 Subject: [PATCH] feat(neighbors): filter by state and merge time before ranking 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 #238. Co-authored-by: Masato Hoshino --- CHANGELOG.md | 1 + docs/clustering.md | 27 ++ docs/commands.md | 2 +- internal/cli/default_output_golden_test.go | 227 +++++++++++++++ internal/cli/help.go | 7 +- internal/cli/neighbors.go | 114 ++++++-- internal/cli/neighbors_test.go | 271 ++++++++++++++++++ .../neighbors-closed-source.json | 96 +++++++ .../neighbors-include-closed.json | 83 ++++++ .../neighbors-limit-threshold.json | 54 ++++ .../testdata/default_output/neighbors.json | 54 ++++ .../cli/testdata/default_output/neighbors.txt | 55 ++++ internal/store/runs.go | 33 +++ internal/store/vectors.go | 28 ++ internal/store/vectors_where_test.go | 103 +++++++ internal/syncer/closed_sweep_test.go | 17 ++ 16 files changed, 1154 insertions(+), 18 deletions(-) create mode 100644 internal/cli/default_output_golden_test.go create mode 100644 internal/cli/neighbors_test.go create mode 100644 internal/cli/testdata/default_output/neighbors-closed-source.json create mode 100644 internal/cli/testdata/default_output/neighbors-include-closed.json create mode 100644 internal/cli/testdata/default_output/neighbors-limit-threshold.json create mode 100644 internal/cli/testdata/default_output/neighbors.json create mode 100644 internal/cli/testdata/default_output/neighbors.txt create mode 100644 internal/store/vectors_where_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index c9cd4e64..c71c3b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Add `neighbors --open-at`, `--created-after`, and `--merged-after` to filter similar rows by time before ranking, with thread metadata and a complete-sync watermark in the output. Thanks @masatohoshino. - Fix large neighbor and search result lookups failing with SQLite's SQL variable limit. Thanks @masatohoshino for reporting. - Update the D-Bus dependency used by Linux credential storage to v5.2.4, retaining the Go 1.27.2 minimum. diff --git a/docs/clustering.md b/docs/clustering.md index 294c3eb8..a8afe12b 100644 --- a/docs/clustering.md +++ b/docs/clustering.md @@ -127,6 +127,33 @@ gitcrawl neighbors owner/repo --number 123 --limit 10 | `--limit ` | `10` | Maximum neighbors | | `--threshold ` | `0.2` | Minimum cosine score | | `--include-closed` | _(off)_ | Include closed issue and pull request vectors | +| `--open-at