feat(similar): cache the team board in ~/.linear-cli/cache.sqlite, synced by updatedAt (PHNX-4105) - #55
Conversation
…nced by updatedAt tasks --similar paginated the whole team on every run (~11 s of a 16 s run on a 3,931-issue team). The board now lives in cache.sqlite next to the embedding vectors: first run fetches everything, later runs pull only issues whose updatedAt moved, a full refresh runs weekly to drop archived issues, --project filters locally, and a failed refresh answers from the cache with one stderr line. embeddings.sqlite from 0.24.0 is renamed in place. Measured: cold 16.95 s, warm 0.75 s. (PHNX-4105) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FQ3w5SAvum8nShzmBo21Ar
Restore CACHE_DB_PATH (not the removed EMBEDDINGS_DB_PATH) in two test cleanups; inclusive gte watermark so a same-instant update is re-fetched instead of skipped; a full refresh that hits the pagination rail keeps the cached board and says so; the legacy rename tolerates a parallel first run; comment names team moves as a second drift source. 220 tests OK, 4 skipped. (PHNX-4105) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FQ3w5SAvum8nShzmBo21Ar
|
APPROVE — independent non-author review (code-reviewer subagent, session 87d560af, reviewed at 996b3b2; verdict was CHANGES REQUESTED on one blocker, which is fixed in 1b06e81 along with every SHOULD). Traced by the reviewer: incremental filter and watermark math, aware-datetime full-refresh comparison, no partial cache writes (one commit inside the successful-fetch branch), deterministic row order, legacy rename gated on the new file being absent with vectors surviving, ISSUE_FIELDS carries project { id }, every rank_similar-reaching test class isolated, stderr-only refresh-failed line, only the five owned files changed, no version bump, cost is O(delta) with the _MAX_PAGES rail intact. Applied in 1b06e81: (blocker) two test cleanups restored the removed EMBEDDINGS_DB_PATH instead of CACHE_DB_PATH, leaving a deleted temp path in place for later classes; (should) watermark is now gte with id upserts so a same-instant update is re-fetched, never skipped; (should) a full refresh that hits the pagination rail keeps the cached board and prints one stderr line instead of overwriting with a truncated board, with a test; (should) the legacy os.replace tolerates a parallel first run; (nice) the comment names team moves as a second drift source. 220 tests OK, 4 skipped. |
Board cache in ~/.linear-cli/cache.sqlite synced by updatedAt (PR #55). Pins install.sh and README to v0.24.1; EXPECTED_SHA256 is the checksum of the bumped linear file. (PHNX-4105) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FQ3w5SAvum8nShzmBo21Ar
feature.
tasks --similarstops re-fetching the whole team on every run.Tracking: https://linear.app/getrush/issue/PHNX-4105
What changed
# ---- board cache ----section:cached_team_issues()keeps the team's issues in~/.linear-cli/cache.sqlite(tablesissues+sync, besidevectors). First run fetches everything; later runs addupdatedAt: { gt: <last sync> }to the filter and upsert only what moved; a full refresh runs when the last one is older than 7 days so archived issues drop out;--projectfilters the cached board locally; a failed refresh over a warm cache answers from the cache and prints one stderr line.rank_similaruses it for the lexical and embeddings candidates.EMBEDDINGS_DB_PATHbecomesCACHE_DB_PATH; an existingembeddings.sqliteis renamed in place on first open._IsolatedCachemixin so every test that reachesrank_similarruns against a temp cache;BoardCacheTests(full then incremental, failed refresh, cold failure, local project filter, weekly full refresh, legacy rename); twoSimilarTestsassertions updated for local project filtering and cache ordering.Verification
Real run against the live board (3,931 issues) with the worktree binary and an isolated temp HOME holding only config.json. Ticket titles are redacted in the capture because this repo is public.
Same run in text:
python3 -m unittest→ 219 tests OK, 4 skipped;linear tasks --similar "token renewal" --limit 3cold 15.68 s, then warm 1.07 s and 0.89 s with identical rows;cache.sqlitemode 0600, 13080 KB, 3931 issues, one sync row.🤖 Generated with Claude Code
https://claude.ai/code/session_01FQ3w5SAvum8nShzmBo21Ar