feat(semble): upgrade to v0.4.1, flatten result parsing, localize status messages#734
feat(semble): upgrade to v0.4.1, flatten result parsing, localize status messages#734navedmerchant wants to merge 4 commits into
Conversation
…tus messages - Bump SEMBLE_VERSION v0.3.1 -> v0.4.1 and refresh SEMBLE_SHA256 checksums - Adapt to semble v0.4.0+ flat JSON output (no chunk wrapper); remove SembleChunk and flatten SembleSearchResult (file_path, start_line, end_line, score, content) - Update provider.ts and semble-cli.ts parsing accordingly - Version-prefix the local archive cache path so a stale archive from a previous semble version is never reused or verified against the new checksum; remove partial archive before re-downloading - Add cleanupStaleArchives to best-effort sweep orphaned archives after a version upgrade - Localize SembleProvider status strings via i18n embeddings:semble.* keys across all 18 locales - Update provider/cli/downloader unit tests for the new shape and version-prefixed cache path Closes #733
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
✅ Files skipped from review due to trivial changes (12)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughSemble is upgraded to v0.4.1, its search result schema is flattened across types, CLI parsing, provider conversion, and tests, provider status messages move to locale-backed i18n strings, and the downloader now uses version-prefixed archives with stale-cache cleanup. ChangesSemble v0.4.1 upgrade
Sequence Diagram(s)sequenceDiagram
participant downloadSemble
participant fs.promises
participant https
participant cleanupStaleArchives
downloadSemble->>fs.promises: delete stale cached archive and inspect storageDir
downloadSemble->>https: fetch v0.4.1 archive
downloadSemble->>fs.promises: extract binary and write .semble-version
downloadSemble->>cleanupStaleArchives: remove orphaned versioned archives
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/services/code-index/semble/__tests__/semble-downloader.spec.ts`:
- Around line 639-679: The stale-archive cleanup path in downloadSemble is not
actually being exercised because the test only verifies removal of the new
v0.4.1 cache file while readdir is still empty. Update the
semblle-downloader.spec test around downloadSemble to simulate an existing
prior-version archive (v0.4.0-*) in the cache and assert that it is deleted
during the upgrade flow, using the same versioned archive path logic already
referenced by versionedArchive and fs.unlink so the cleanup regression is
covered.
In `@src/services/code-index/semble/semble-downloader.ts`:
- Around line 116-127: The cleanupStaleArchives routine only matches names
ending with "-${archiveName}", so it misses the legacy unversioned cache file
name used before v0.4.0. Update the filtering logic in cleanupStaleArchives to
also recognize the exact unversioned archive name for the current archive, while
still excluding currentArchivePath and preserving the existing versioned suffix
cleanup behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ba37b79d-4e4c-46f6-b7e1-a242d398b312
📒 Files selected for processing (26)
src/i18n/locales/ca/embeddings.jsonsrc/i18n/locales/de/embeddings.jsonsrc/i18n/locales/en/embeddings.jsonsrc/i18n/locales/es/embeddings.jsonsrc/i18n/locales/fr/embeddings.jsonsrc/i18n/locales/hi/embeddings.jsonsrc/i18n/locales/id/embeddings.jsonsrc/i18n/locales/it/embeddings.jsonsrc/i18n/locales/ja/embeddings.jsonsrc/i18n/locales/ko/embeddings.jsonsrc/i18n/locales/nl/embeddings.jsonsrc/i18n/locales/pl/embeddings.jsonsrc/i18n/locales/pt-BR/embeddings.jsonsrc/i18n/locales/ru/embeddings.jsonsrc/i18n/locales/tr/embeddings.jsonsrc/i18n/locales/vi/embeddings.jsonsrc/i18n/locales/zh-CN/embeddings.jsonsrc/i18n/locales/zh-TW/embeddings.jsonsrc/services/code-index/semble/__tests__/provider.spec.tssrc/services/code-index/semble/__tests__/semble-cli.spec.tssrc/services/code-index/semble/__tests__/semble-downloader.spec.tssrc/services/code-index/semble/index.tssrc/services/code-index/semble/provider.tssrc/services/code-index/semble/semble-cli.tssrc/services/code-index/semble/semble-downloader.tssrc/services/code-index/semble/types.ts
…e sweep CodeRabbit PR #734 follow-ups: - cleanupStaleArchives now also matches the exact unversioned archive name (pre-v0.4.0 cache layout) in addition to the version-prefixed suffix, so a v0.3.1 -> v0.4.1 upgrade also clears the legacy file. The current archive path is still preserved. - semble-downloader.spec: the version-upgrade test now simulates a prior-version archive (v0.4.0-*) and a legacy unversioned archive in the cache, and asserts both are swept during the upgrade flow. - Add coverage for the cleanupStaleArchives catch block (readdir rejects) and for the current-archive/unrelated-file preservation behavior. - provider.spec: add a test that rejects search with a non-Error value to cover the 'error instanceof Error' false branch of the telemetry payload (stack: undefined), raising provider.ts patch coverage.
…essage
Export SEMBLE_VERSION from semble-downloader and re-export from the semble
barrel. SembleProvider now interpolates the active version into the
'embeddings:semble.ready' system-state message (set in both _doInitialize and
startIndexing), so the CodeIndexPopover status line shows e.g.
'Indexed - Semble v0.4.1 is ready. Searches index on-the-fly.'
- semble-downloader.ts: export SEMBLE_VERSION.
- index.ts: re-export SEMBLE_VERSION.
- provider.ts: pass { version: SEMBLE_VERSION } to t('embeddings:semble.ready').
- i18n: update semble.ready across all 18 locales to include {{version}}.
- provider.spec.ts: mock SEMBLE_VERSION, update the ready-message mock to
interpolate version, and add a test asserting the version appears in the
ready status message.
Related GitHub Issue
Closes: #733
Description
Upgrades the bundled semble code-search binary from v0.3.1 to v0.4.1 and adapts the provider to semble v0.4.0+'s flattened JSON output format. Also localizes all SembleProvider status messages and hardens the downloader against stale archives left over from prior versions.
Key implementation details:
SEMBLE_VERSIONv0.3.1 → v0.4.1 with refreshedSEMBLE_SHA256for linux-x64, linux-arm64, darwin-arm64, and win32-x64.chunkobject. Removed theSembleChunkinterface and flattenedSembleSearchResultto{ file_path, start_line, end_line, score, content? }. UpdatedSembleProviderresult conversion andSembleCLIparsing/docs accordingly.contentis now optional (omitted when semble is invoked with--max-snippet-lines 0).${SEMBLE_VERSION}-${archive}) so a leftover archive from a previous version can never be reused or verified against the new checksum. A partial archive is also unlinked before re-downloading. AddedcleanupStaleArchivesto best-effort sweep orphaned archives after a successful install.SembleProviderintoembeddings.jsonsemble.*keys (downloadingBinary,ready,unsupportedPlatform,downloadFailed,checkFailed,providerReset) across all 18 locales.provider.spec.ts,semble-cli.spec.ts, andsemble-downloader.spec.tsfor the flat result shape and version-prefixed cache path.Reviewers should pay attention to: the flattened
SembleSearchResultshape (breaking type change, but semble-internal), the version-prefixed archive cache path, and the newsemble.*i18n keys across locales.Test Procedure
srcworkspace):cd src && npx vitest run services/code-index/semble/__tests__/provider.spec.tscd src && npx vitest run services/code-index/semble/__tests__/semble-cli.spec.tscd src && npx vitest run services/code-index/semble/__tests__/semble-downloader.spec.tsturbo lint,turbo check-types).Pre-Submission Checklist
Screenshots / Videos
N/A — no UI changes; status strings are surfaced via existing system-state infrastructure.
Documentation Updates
Additional Notes
The
SembleChunkexport was removed fromindex.ts; confirm no external consumers depend on it (it is semble-internal).Get in Touch
Summary by CodeRabbit
New Features
Bug Fixes
Tests