Thanks for taking the time to contribute.
Follow the Setup section of the README, then install the development dependencies:
pip install -r backend/requirements-dev.txt
cd frontend && npm installEvery one of these must pass. CI runs the same commands and blocks on failure.
# Backend
cd backend
ruff check .
ruff format --check .
pytest -q
# Frontend
cd frontend
npm run format:check
npm run lint
npm run typecheck
npm run test:coverage
npm run buildBoth suites enforce a coverage floor (fail_under in backend/pyproject.toml,
thresholds in frontend/vitest.config.ts). If a change lowers coverage below
it, add tests rather than lowering the threshold.
Language. All code, identifiers, comments and user-facing strings are in English.
Python. Type annotations are required. ruff handles formatting and import
order; do not hand-format. Prefer X | None over Optional[X].
TypeScript. strict mode is on and any is not permitted — use unknown
and narrow. Prefer undefined over null. prettier handles formatting.
Hardware. Any code that selects a compute device must go through
app.core.device.resolve_device(), which resolves CUDA → MPS → CPU. Never
hardcode "cuda".
Secrets. No credentials, tokens or API keys in source or in commits. Read
configuration from the environment via app.core.config.settings.
Add tests for behaviour changes. Bug fixes should come with a regression test
that fails without the fix — see backend/tests/test_hybrid_search.py for the
pattern.
- Backend tests live in
backend/tests/and are namedtest_*.py. Shared fixtures belong inbackend/tests/conftest.py, not in individual test files. - Frontend tests live in
frontend/tests/and are named*.test.ts(x).
Tests must not load models or contact Ollama. Stub those boundaries; the existing fixtures show how.
<type>(<scope>): <short summary>
<optional body explaining why the change was made>
Types: feat, fix, refactor, test, docs, chore. Keep the subject under
72 characters and use the imperative mood ("add", not "added").
Please include the CodeScope version, your OS, Python and Node versions, the
output of GET /health, and the steps to reproduce.
For security issues, follow SECURITY.md instead of opening a public issue.