Skip to content

chore: repo hygiene — fix connection leaks, clear all lint findings, drop stray root script - #55

Merged
Therealdk8890 merged 1 commit into
mainfrom
chore/repo-cleanup
Jul 18, 2026
Merged

chore: repo hygiene — fix connection leaks, clear all lint findings, drop stray root script#55
Therealdk8890 merged 1 commit into
mainfrom
chore/repo-cleanup

Conversation

@Therealdk8890

Copy link
Copy Markdown
Owner

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 / SQLiteTraceStore no longer leak connections on failed construction. Opening either against a file that is not a usable SQLite database raised the expected DatabaseError from the first PRAGMA / schema statement — but the already-open sqlite3 connection 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

  • Ruff clean repo-wide (CI only gates dprovenancekit/): removed 16 unused imports across tests/examples/conformance, two unused locals in demo/demo_gif.py, renamed ambiguous l loop variables in test_cli_export.py / test_facade.py.
  • Removed the dead sys.path bootstrap remnant in conformance/conformance_event.py (_SRC was computed but the sys.path.insert it fed is long gone), plus its now-stale noqa: E402 comments.
  • Zero ResourceWarnings in the test suite (was 18 unclosed-database warnings under -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.
  • Deleted record_example.py from the repo root — referenced nowhere, superseded by examples/basic_agent_trace.py and examples/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 skipped
  • python -W always::ResourceWarning -m pytest: no unclosed-database warnings (only the machine-local IPython-in-conda-base warning remains)
  • ruff check .: clean repo-wide
  • mypy dprovenancekit/: clean

🤖 Generated with Claude Code

…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>
@Therealdk8890
Therealdk8890 merged commit d1a8660 into main Jul 18, 2026
9 checks passed
@Therealdk8890
Therealdk8890 deleted the chore/repo-cleanup branch July 18, 2026 07:02
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