Python DX: complete type stubs with a CI typing gate + error-message audit
- Dominant language
- Rust
- Stars
- 32
- Forks
- 5
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 21
Description
## Motivation
Python is a first-class runtime, and typing is how Python developers experience an API's quality. The `.pyi` stubs exist but have drifted before (the ADR-023 claim-ring kwargs were documented-but-not-plumbed until the 0.6 pre-flight caught it). Errors that surface from the PyO3 boundary should name the fix, not just the failure.
## Scope
- **Stub completeness**: audit `.pyi` against the actual PyO3 surface; add a CI gate that fails when the compiled module exposes symbols/signatures the stubs don't match (and vice versa).
- **Type-check the examples**: mypy/pyright run over `awa-python/examples/` and the README snippets' source files in CI, so the documented API is the typed API.
- **Error-message audit**: every error raised across the bridge names the likely fix or links a docs anchor (e.g., schema-mismatch → "run `awa migrate`"; non-finalized cluster in 0.7 → the finalize steps; NOTIFY failure → pooler docs).
- Confirm the `awa-pg` wheel matrix covers current CPython versions and platforms; document the support matrix.
## Acceptance
- CI fails on stub/API drift (demonstrated with an intentional drift in a test).
- Examples type-check clean.
- Error audit checklist merged with before/after samples for the top ten operator-facing errors.
## References
Roadmap: `docs/0.7-roadmap.md` (WS-6, NEW-14). Related: ADR-004 (PyO3 bridge), ADR-009 (sync parity), 0.5→0.6 pre-flight known-issue (claim-ring kwargs).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with docs/0.7-roadmap.md and ADR-004 and ADR-009, then inspect the existing .pyi files, the compiled PyO3 surface, and awa-python/examples/. Trace how CI currently handles these sources and the README snippets. Done means CI detects intentional stub drift, examples type-check cleanly, the top ten operator-facing errors have before/after audit samples, and the wheel support matrix is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- ci-cd, developer-experience, documentation, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100