Create tooling/db/common.py with resolve_db_path(), load_config(),
get_connection(), and ensure_venv(). Update ticket, sprint,
sqlite_connector.py, and decisions_sync.py to import from common
instead of duplicating. Fixes pre-existing NameError in
decisions_sync.py (missing import os). Add pyproject.toml with
ruff config (ruff==0.15.9, CVE-clean) and dev dependencies.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add venv auto-activation to audio_batch, audio_connector,
image_connector, qdrant_connector, and trellis_connector.
Scripts re-exec into .venv/bin/python when invoked outside
the venv, with a friendly error if .venv is missing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop unused hashlib, math, and os imports from assign-astro-ids,
generate-star-map, and test_quaternius_raw to pass ruff clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Python/ruff block to .config/hooks/pre-push (runs on tooling/
changes). Add lint-python and setup-venv Makefile targets, wire
both into make lint and make setup respectively.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
tooling/db/common.pyfrom duplicated DB path resolution, config loading, and connection setup across 4 consumer scripts (#777)ensure_venv()auto-activation for Python scripts with third-party dependencies — friendly error when.venvis missingpyproject.tomlwith ruff config (ruff==0.15.9, CVE-clean),make lint-pythontarget, and Python/ruff block in pre-push hookNameErrorindecisions_sync.py(missingimport os) and remove unused imports across 3 tooling scriptsChanges
tooling/db/common.py—resolve_db_path(),load_config(),get_connection(),ensure_venv()pyproject.toml— ruff config + dev dependenciesticket,sprint,sqlite_connector.py,decisions_sync.py— import fromcommonensure_venv()wiringMakefile—lint-python,setup-venvtargets.config/hooks/pre-push— Python/ruff lint blockTest plan
ruff check tooling/— 0 errorstooling/db/ticket list --sprint 31— workstooling/db/ticket show 777— workstooling/db/sprint status— workstooling/db/sqlite-query "SELECT count(*) FROM tickets"— worksmake lint-python— worksensure_venv()friendly error when.venvmissing — verifiedReview: sprint-31/ci -> main (type: code)
Reviewers: Hoshe (code quality), Tyre (architecture)
Hoshe (Code Quality): APPROVE
Shared module correctly extracts duplicated patterns. All consumers updated. Ruff config sensible. DB access verified.
load_config()— incomplete adoption. Follow-up ticket.lint-pythonnot included inpre-pr-lint— ruff findings won't block pre-PR checklist.cmd_start/cmd_stopcallconn.close()inline without try/finally — pre-existing but inconsistent.Tyre (Architecture): APPROVE
Clean structural refactor.
common.pyarchitecture appropriate for scale.ensure_venv()well-scoped. Ruff rule selection minimal and correct.pip install 'ruff>=0.9'but should saymake setup-venv.-> NoReturnreturn type annotation onos.execvpath.Verdict: APPROVED
Pull request closed