Skip to content

feat(python): add asyncio port with shared conformance replay - #200

Open
lan17 wants to merge 6 commits into
mainfrom
codex/python-port
Open

lan17 wants to merge 6 commits into
mainfrom
codex/python-port

Conversation

@lan17

@lan17 lan17 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Python applications can now use DialCache's explicit request scopes, layered caching, runtime policy, and tracked Redis invalidation through an asyncio-native package for Python 3.11+.

The API retains source-reviewed gcache conveniences (cached, id_arg, argument adapters, context managers, aget, and ainvalidate) while implementing DialCache's behavioral and wire contracts. The port includes coalescing, deadline and cancellation ownership, stale recovery, shadow validation, compression, and a borrowed-client Redis/Cluster adapter.

Also adds independent Python replay of all 17 shared profiles, completion fingerprint checks, native and real-server CI, packaging, and Python examples throughout the shared documentation. python/API-DESIGN.md records the gcache revision and API choices.

Local validation

Validated source commit: a34989f6a087f39500b0945db0b3f70bdc166891.

  • make check: all four language checks, package checks, documentation build, and audit gates passed.
  • Complete shared corpus regeneration and committed Quint fixture checks passed.
  • make formal-python: 7,759 conformance cases passed, including 6,022 generated/regression histories, 244 scenarios, 1,477 protocol vectors, and 16 witness checks.
  • Python 3.14: 2,200 native/wire/scenario/smoke tests passed. Python 3.11: 2,098 passed with 102 expected eager-task-feature skips; asyncio.eager_task_factory was introduced in Python 3.12.
  • Real Redis and Valkey integration: 343 tests passed per server, including six-node Redis Cluster and TypeScript interoperability; zero skips.
  • Minimum zstandard 0.23.0: 1,515 protocol cases passed. Redis adapter/routing checks passed with redis-py 5.0.0 and 6.4.0.

Scope

The package is experimental and unpublished. The complete replay gate establishes finite shared conformance evidence; a Python-specific semantic mutation campaign is not yet registered. Cached wrappers are always awaitable, and applications own their event loop and Redis client lifecycle.

— Levicus 🤖

# Conflicts:
#	.github/workflows/formal-full.yaml
#	README.md
#	formal/explore.mjs
#	formal/go-parity.json
#	formal/source-audit.json
#	formal/validation.mjs
#	scripts/generate-docs.mjs
#	typescript/test/formal-exploration.test.ts
@lan17
lan17 marked this pull request as ready for review September 22, 2026 07:25
# Conflicts:
#	docs/index.md
#	docs/maintainers.md
#	formal/go-parity.json
#	formal/source-audit.json
Keep mismatch details in logger events, discard denied async predicates without starting work, bound oversized decoder memory, and bind validation and saved replay inventories to their source snapshots.

— Levicus 🤖
Require primary-only Cluster connections for tracked reads across redirects. Make integration acceptance verify every required case and bind documented scenarios to the selected backend.

— Levicus 🤖

This branch has not been deployed

No deployments
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