Skip to content

Fix semantic cache sqlite-vec compatibility and re-enable tests#270

Merged
d-oit merged 3 commits into
mainfrom
fix/semantic-cache-sqlite-vec-compat-14464046622754380036
Apr 24, 2026
Merged

Fix semantic cache sqlite-vec compatibility and re-enable tests#270
d-oit merged 3 commits into
mainfrom
fix/semantic-cache-sqlite-vec-compat-14464046622754380036

Conversation

@d-oit
Copy link
Copy Markdown
Owner

@d-oit d-oit commented Apr 24, 2026

This PR fixes semantic cache test failures by addressing compatibility issues with newer versions of sqlite-vec.

Key changes:

  1. sqlite-vec Compatibility: Migrated vector search to the MATCH syntax and implemented the correct distance-to-similarity conversion for normalized vectors (1 - d^2/2).
  2. Dependency Update: Added pysqlite3-binary to requirements.txt to ensure enable_load_extension is available in CI and other restricted environments.
  3. CI/CD: Re-enabled semantic cache tests in .github/workflows/ci.yml and ensured full dependency installation.
  4. Test Refactoring: Improved tests/test_semantic_cache.py by using robust mocks for the singleton instance, removing the need for manual state synchronization in orchestration modules.
  5. Cleanup: Removed debugging scripts and temporary artifacts used during investigation.

Fixes #251


PR created automatically by Jules for task 14464046622754380036 started by @d-oit

…ache tests

- Updated semantic cache query to use `MATCH` syntax for `sqlite-vec` compatibility.
- Corrected cosine similarity calculation from L2 distance for normalized embeddings.
- Added `pysqlite3-binary` to dependencies for reliable extension loading.
- Re-enabled semantic cache tests in CI workflow.
- Refactored integration tests to properly mock the cache singleton.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
do-web-doc-resolover Ready Ready Preview, Comment Apr 24, 2026 10:33am

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Apr 24, 2026

DeepSource Code Review

We reviewed changes in 53dd0ba...084baec on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Apr 24, 2026 10:33a.m. Review ↗
Python Apr 24, 2026 10:33a.m. Review ↗
Rust Apr 24, 2026 10:33a.m. Review ↗
Shell Apr 24, 2026 10:33a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Comment thread tests/test_semantic_cache.py Outdated
Comment thread tests/test_semantic_cache.py Outdated
@d-oit d-oit marked this pull request as ready for review April 24, 2026 10:21
@d-oit
Copy link
Copy Markdown
Owner Author

d-oit commented Apr 24, 2026

@jules Run black --check .
would reformat /home/runner/work/do-web-doc-resolver/do-web-doc-resolver/scripts/semantic_cache.py

Oh no! 💥 💔 💥
1 file would be reformatted, 36 files would be left unchanged.
Error: Process completed with exit code 1.

- Reformat code with black to fix CI lint failure.
- Merge collapsible with statements in tests as suggested by DeepSource.
- Remove unused imports and clean up temporary debug scripts.
- Refactor integration tests to use cleaner singleton mocking.
- Ensure similarity calculation correctly handles normalized vectors with MATCH syntax.

Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
@d-oit d-oit merged commit c283dfa into main Apr 24, 2026
31 of 32 checks passed
@d-oit d-oit deleted the fix/semantic-cache-sqlite-vec-compat-14464046622754380036 branch April 24, 2026 10:56
d-oit added a commit that referenced this pull request May 13, 2026
…on guard (#367)

* fix(nightly): replace direct push to main with PR creation

The nightly-bridge workflow was pushing format fixups directly to main,
which violates branch protection rules (no direct pushes, required status
checks). Switch to creating a PR via gh CLI on a dated branch instead.

Also fix the underlying formatting drift in tests/test_routing_foundation.py
that caused nightly to produce a diff every run.

* feat(swarm): execute Wave 2 + Wave 5 with version regression guard

Wave 2 (CI Config):
- Fix coverage upload condition, gitleaks branches, checkout pin
- Add flake8 to CI lint, fix shellcheck severity
- Update duckduckgo-search to ddgs, add 3.13 classifier
- Update AGENTS.md Playwright command to all 3 projects

Wave 5 (Rust Splits + Dedup):
- Split config.rs into config/{mod,defaults,parsing}.rs (712→383 lines)
- Split semantic_cache.rs into 4 submodules (1056→max 401 lines)
- Extract duplicate build_budget() to cascade.rs
- Remove dead Profile::is_provider_allowed() + max_hops()

Version Regression Guard:
- release.sh now uses sync_versions.py --set instead of raw sed
- CI validate-version job enforces manifest >= latest git tag
- Quality gate warns on version regression pre-commit
- Docs: AGENTS.md, agents-docs/RELEASES.md updated
- markdownlint: fix config format, suppress noisy rules, exclude skill refs

Version: 0.3.4 (sync after drift from PR #270)

* fix: revert duckduckgo-search rename (ddgs doesn't provide duckduckgo_search module)

* fix: pre-existing ruff lint errors (UP017, UP043) blocking CI

* fix: cargo fmt, black fmt, and pyproject.toml target versions for CI

* fix: revert UTC changes, ignore UP017, fix black format

---------

Co-authored-by: do-it <do-it@ik.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Semantic cache tests failing with sqlite-vec compatibility issues

1 participant