Skip to content

refactor: enforce all-mode Python typing and full Ruff preview - #371

Merged
swkeever merged 8 commits into
mainfrom
skeever/python-all-mode-audit
Sep 24, 2026
Merged

swkeever merged 8 commits into
mainfrom
skeever/python-all-mode-audit

Conversation

@swkeever

@swkeever swkeever commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Enable basedpyright all, Ruff's complete pinned preview rules, and global strict mypy Any checks across runtime code, tests, contract bindings, examples, scripts, and local stubs. Remove broad Any/private-access exemptions without a diagnostic baseline.

  • Split authentication, transport operations, durable adaptation, realtime lifecycle, and response validation into typed internal collaborators. Preserve public methods and direct VolcanoClient construction of client-bound facades and database builders. Channels retain the documented Realtime.channel() factory; its former constructor required private lifecycle configuration.
  • Use pytest's native in-package layout for runtime tests and typed probes. Hatch excludes tests from wheels, including wheels rebuilt from the sdist; the sdist retains test sources.
  • Generate typed request adapters and UUID | str wire inputs through pinned OpenAPI templates. Regeneration comparisons verify generated output.
  • Keep 100% runtime line/branch coverage and the complete mandatory mutation matrix. Mutmut's pinned native generator identifies modules with no candidates; missing reports, survivors, uncovered code, crashes, and timeouts fail separately.
  • Pin Python patch versions while preserving Python 3.11–3.14 check names. Record exact compatibility/tool exceptions and task authorization separately from human review approval. Negative fixtures prevent widening the approved expressions, scopes, and diagnostic codes.

Validation: uv run --locked poe checks passes with 2,322 tests and 100% coverage across 5,715 runtime statements and 1,344 branches. Ruff ALL+preview, strict mypy, basedpyright all, dependency audit, generated provenance, wheel/sdist consumer smoke tests, optional-dependency environments, and installed-package type completeness (100%) pass. Direct constructor examples also type-check against the installed wheel. The complete native mutation matrix and final Codex review must pass before merge; shared live contract acceptance remains coordinated with Hosting.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T17:56:11.752178Z d8eba69 Manual request
🔒 Security Review ✅ Completed 2026-09-24T17:53:58.572229Z d8eba69 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 7c9917f714

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c9917f714

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread maintainers/quality-exceptions.json Outdated
Comment on lines +25 to +27
"approved_by": "swkeever",
"approved_at": "2026-09-24",
"approval_evidence": "User explicitly approved all six exact subprocess import scopes in the Codex strict SDK guardrails conversation on 2026-09-24."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Obtain human approval before recording exceptions

This Codex-authored change adds seven quality-policy exceptions and records swkeever as their approver based only on a Codex conversation; because the policy checker pins and accepts these records immediately, this effectively approves suppressions on the human reviewer's behalf. Leave the new exceptions unapproved until the human reviewer supplies and records the approval through the repository's review process.

AGENTS.md reference: AGENTS.md:L6-L8

Useful? React with 👍 / 👎.

Comment on lines +40 to +42
client.capture_session_binding()
)
self._fallback_token: str = client.function_token()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve direct facade construction with VolcanoClient

Functions remains a public class whose constructor says it binds to a Volcano client, but Functions(VolcanoClient(...)).invoke(...) now reaches this call and raises AttributeError because VolcanoClient provides _capture_session_binding() and _function_token(), not the new public capability methods. Existing callers that instantiate the facade directly therefore break; adapt a VolcanoClient to its internal context in the constructor or keep accepting the former context shape.

Useful? React with 👍 / 👎.

@swkeever

swkeever commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Restored direct construction with VolcanoClient for every public facade and database builder through two typed internal context adapters. Twelve runtime regressions cover live credentials, follow-on builders, binary storage results, auth state, lock ownership, and async realtime behavior; an installed consumer typing fixture covers the constructors.

Exception records now distinguish explicit task authorization from GitHub review approval. The user explicitly approved the six subprocess import scopes and later delegated pragmatic compatibility/tool exceptions. No human repository review is being asserted or submitted. The two private factory returns are exact scoped Ruff/Basedpyright exceptions with negative fixtures; all other private-access checks remain active.

The mutation report gate now asks pinned Mutmut's own generator for candidates instead of inferring mutability from an AST. Missing nonempty reports still fail. Added assertions cover the database, realtime, and durable survivors found by the first complete matrix.

@swkeever

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d8eba69b4d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: d8eba69b4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@swkeever
swkeever marked this pull request as ready for review September 24, 2026 18:01
@swkeever
swkeever requested a review from a team as a code owner September 24, 2026 18:01
@swkeever
swkeever merged commit a018194 into main Sep 24, 2026
70 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