Skip to content

feat: add cross-OS DB portability tests and pre-commit lint tooling - #334

Draft
ofriw wants to merge 74 commits into
mainfrom
db-portability
Draft

ofriw wants to merge 74 commits into
mainfrom
db-portability

Conversation

@ofriw

@ofriw ofriw commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Note: This PR was generated by an AI agent. If you'd like to talk with other humans, drop by our Discord!


What this PR does

Adds cross-OS database portability infrastructure and pre-commit lint tooling to ChunkHound.

Added

  • Cross-OS DB portability CI (.github/workflows/cross-os-portability.yml) — Creates a DuckDB on Ubuntu, verifies it works on macOS/Windows without sidecar files
  • Pre-commit hook system (scripts/pre_commit.py, .pre-commit-config.yaml) — Ruff lint+format on staged Python files before commit
  • lint-changed-ruff CI job — Lints only changed .py/.pyi files in PRs (not the whole repo)
  • Portability contract tests — End-to-end tests verifying DB contents are portable (relative unix paths, no backslashes)
  • Path normalization tests — Contract tests for normalize_path_for_lookup invariants
  • Schema auto-creation test — Verifies missing embeddings table gets created on connect

Changed

  • Makefile — Added install-hooks target; expanded lint to cover scripts and tests directories
  • Contributing docs — Added pre-commit installation instructions and hook behavior explanation
  • fake_providers.py — Exposed generate_deterministic_vector and base_url property for test reuse

Why it matters

DuckDB stores paths as relative unix-style strings. This PR proves that a DB created on Linux works identically on macOS and Windows — no path translation, no sidecar dependency. The pre-commit system catches lint issues locally before CI, reducing round-trips.

Breaking changes

None. All additions are new infrastructure and tests.


Attached is an agent optimized description of the changes in this PR - AGENT_REVIEW.md

@ofriw
ofriw marked this pull request as draft June 12, 2026 10:36
@ofriw ofriw changed the title test: add contract tests and CI for cross-OS DB path portability feat: add pre-commit lint tooling, cross-OS DB portability verification, and contract tests Jun 14, 2026
@ofriw ofriw changed the title feat: add pre-commit lint tooling, cross-OS DB portability verification, and contract tests feat: add cross-OS DB portability tests and pre-commit lint tooling Jun 14, 2026
ofriw added 27 commits June 22, 2026 15:37
Resolved 4 conflict sites and 5 auto-merge gaps between db-portability
(code hygiene, DB portability, lint fixes across 400+ files) and main
(#361 config forwarding, #356 cosine similarity scoring).

Conflict 1: discovery.py - _read_startup_timeout -> _resolve_startup_timeout
Conflict 2: search_service.py - query param in search_regex_async
Conflict 3: unified_search.py - skip_rerank, exclude_ids params
Conflict 4: elbow_filter.py - get_unified_score similarity field handling

Auto-merge gaps fixed:
- query kwarg signature in SerialDatabaseProvider.search_regex_async
- score_fn support in chunk_dedup.py
- Depth exploration base_cosine search class integration
- gap_detection.py scoring path unification
- duckdb_provider.py type annotation boundary fix

Fixes included:
- query: str | None = None param added to SerialDatabaseProvider.search_regex_async
- Test assertions updated: _read_startup_timeout -> _resolve_startup_timeout

This branch has not been deployed

No deployments
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.

1 participant