chore: repo hygiene — fix connection leaks, clear all lint findings, drop stray root script - #55
Merged
Merged
Conversation
…drop stray root script Production fix: - SQLiteConnection/SQLiteTraceStore no longer leak the underlying sqlite3 connection when construction fails partway (setup PRAGMAs or schema creation raising on a non-database file). Both now close before re-raising. Hygiene: - Clear all 22 ruff findings outside the CI-gated package: unused imports across tests/examples/conformance, two unused locals in demo_gif.py, and ambiguous `l` loop variables renamed in two test files. - Remove the dead sys.path bootstrap remnant in conformance_event.py. - Close every store/connection tests open — the suite now runs with zero ResourceWarnings (was 18 unclosed-database warnings under -W always). - Delete record_example.py from the repo root: unreferenced anywhere and superseded by examples/basic_agent_trace.py and examples/regression_testing.py. Verified: 479 passed / 4 skipped; ruff clean repo-wide; mypy clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A full-repo hygiene pass. One real production fix, plus lint and test cleanup that takes the suite to zero ResourceWarnings and ruff to clean across the whole repo (not just the CI-gated package).
Production fix
SQLiteConnection/SQLiteTraceStoreno longer leak connections on failed construction. Opening either against a file that is not a usable SQLite database raised the expectedDatabaseErrorfrom the first PRAGMA / schema statement — but the already-opensqlite3connection was orphaned. Every error-path test (typo'd--db, corrupt golden baseline) leaked a file descriptor this way. Both constructors now close before re-raising. CHANGELOG entry added under Unreleased → Fixed.Hygiene
dprovenancekit/): removed 16 unused imports across tests/examples/conformance, two unused locals indemo/demo_gif.py, renamed ambiguouslloop variables intest_cli_export.py/test_facade.py.sys.pathbootstrap remnant inconformance/conformance_event.py(_SRCwas computed but thesys.path.insertit fed is long gone), plus its now-stalenoqa: E402comments.-W always): every store/connection tests open is now closed —test_conformance,test_sqlite_get_run,test_sqlite_insert_failure_drop,test_raw_store_roundtrip,test_integration_openai_agents,test_integration_langchain,test_instrument.record_example.pyfrom the repo root — referenced nowhere, superseded byexamples/basic_agent_trace.pyandexamples/regression_testing.py.Deliberately not done: no mass
ruff format(the pyproject config explicitly locks in the current style without a reformat).Testing
pytest: 479 passed, 4 skippedpython -W always::ResourceWarning -m pytest: no unclosed-database warnings (only the machine-local IPython-in-conda-base warning remains)ruff check .: clean repo-widemypy dprovenancekit/: clean🤖 Generated with Claude Code