Skip to content

Fix transaction read parity and cache isolation; release 0.2.2 - #59

Merged
eldonm merged 1 commit into
mainfrom
codex/db-transaction-parity-0-2-2
Oct 13, 2026
Merged

eldonm merged 1 commit into
mainfrom
codex/db-transaction-parity-0-2-2

Conversation

@eldonm

@eldonm eldonm commented Oct 13, 2026

Copy link
Copy Markdown
Member

Native transaction handles did not expose the complete database read contract. Consumers performing graph listings inside PostgreSQL transactions could fail on find_ids or find_many, while cached entities could escape the transaction's connection or expose uncommitted state.

This change completes the shared transaction read API and gives PostgreSQL native reads on its held connection. It serializes concurrent connection operations, preserves tenant settings, bootstraps collections without acquiring another connection, and isolates graph transaction caches. MongoDB retains session-bound fallback reads and awaits session cleanup; cancellation rolls back, and graph transactions reject unavailable native handles. JSON, SQLite, and DynamoDB continue to explicitly reject unsupported native transactions.

Successful database observations no longer emit routine or slow-call logs, or allocate logging payloads. Failure ERROR records and operation/slow-call metrics remain available.

Documentation cleanup adds a transaction guide, corrects backend and observability contracts, replaces obsolete architecture and examples content, refreshes indexes, and repairs local documentation links. Version and release notes advance from 0.2.1 to 0.2.2.

Validation:

  • Python 3.12 full suite with test/AWS/PostgreSQL extras: 2,799 passed, 22 skipped; 70.95% coverage.
  • Live PostgreSQL transaction tests; live MongoDB reads, commit/rollback and uncommitted isolation for both Motor and asynchronous PyMongo on the local replica set.
  • Benchmark smoke run: 21 passed, 4 skipped; short sampling qualifies execution, not production performance.
  • All-files pre-commit checks pass, including formatting, lint, mypy and secret scanning.
  • Wheel and sdist build and twine check pass; a clean Python 3.12 wheel install verifies version and transaction exports.
  • Documentation local-target check: no missing targets. External links and deployment-specific topology are not covered by that check.

The release workflow publishes after merge; this PR does not publish or change Integral Core's dependency pin. AWS checks use test doubles, not a live DynamoDB deployment.

@github-actions

Copy link
Copy Markdown

Benchmark comparison

Threshold: ±25% (informational, does not block merge)

benchmark baseline (s) current (s) delta status
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_deferred_save_batched_100 0.028385 0.012996 -54.2% IMPROVED (-54.2%)
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_immediate_save_100 0.028838 0.011991 -58.4% IMPROVED (-58.4%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[hierarchy] 0.004618 0.002251 -51.3% IMPROVED (-51.3%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[ontology] 0.005612 0.002352 -58.1% IMPROVED (-58.1%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_projection_capture[relationships] 0.004872 0.002241 -54.0% IMPROVED (-54.0%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[hierarchy] 0.004158 0.002026 -51.3% IMPROVED (-51.3%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[ontology] 0.004225 0.001914 -54.7% IMPROVED (-54.7%)
tests/benchmarks/test_graph_projection_benchmarks.py::test_warm_rich_projection_capture[relationships] 0.004262 0.001877 -56.0% IMPROVED (-56.0%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_batched_saves_500 0.467340 0.430435 -7.9% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_empty_query 0.002145 0.001375 -35.9% IMPROVED (-35.9%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_filtered 0.108179 0.058558 -45.9% IMPROVED (-45.9%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_find_filtered 0.109151 0.057066 -47.7% IMPROVED (-47.7%)
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_save_throughput 0.001678 0.002010 +19.8% OK
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_find_many_bulk 0.001090 0.000538 -50.7% IMPROVED (-50.7%)
tests/benchmarks/test_postgres_benchmarks.py::test_bench_postgres_traverse_depth 0.000675 0.000303 -55.1% IMPROVED (-55.1%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_empty 0.000312 0.000129 -58.9% IMPROVED (-58.9%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_fallback_via_regex 0.030414 0.016455 -45.9% IMPROVED (-45.9%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_pushdown 0.001514 0.000752 -50.3% IMPROVED (-50.3%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_fallback_via_regex 0.030557 0.016169 -47.1% IMPROVED (-47.1%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_pushdown 0.000476 0.000216 -54.7% IMPROVED (-54.7%)
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_sort_limit_pushdown 0.002659 0.001360 -48.9% IMPROVED (-48.9%)

@eldonm
eldonm merged commit fdd03fe into main Oct 13, 2026
6 checks passed
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