Skip to content

fix: export schema reflection models in the v1 type stub - #343

Open
Kayvan-Zahiri wants to merge 1 commit into
authzed:mainfrom
Kayvan-Zahiri:codex/export-schema-reflection-types
Open

Kayvan-Zahiri wants to merge 1 commit into
authzed:mainfrom
Kayvan-Zahiri:codex/export-schema-reflection-types

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

The v1 runtime exports 19 schema-reflection/diff models that are missing from the hand-maintained __init__.pyi. For example, importing ReflectSchemaRequest and ReflectionSchemaFilter from authzed.api.v1 works at runtime but produces mypy attr-defined errors. Those missing types then become Any, hiding errors in consumers.

Add the existing runtime schema-model imports and __all__ entries to the type stub. No runtime behavior or generated Protobuf files change.

Add a consumer regression program that imports all 19 models through the public package, builds a filtered reflection request and response, checks serialization, and asserts the inferred field types. Run the same program at runtime and through strict mypy.

Refs #207. This addresses the schema-model export mismatch; it does not claim to resolve every runtime/stub mismatch or update generated gRPC method signatures. The open generated-API update (#342) does not change this hand-maintained stub.

Validation, Python 3.12 with the unchanged uv lock:

  • Before: runtime consumer passes; mypy consumer fails with 21 diagnostics.
  • After: both consumer tests pass. All available offline tests: four passed, three existing remote-call tests skipped, 48 existing protovalidate deprecation warnings.
  • Full mypy: success across 32 source files.
  • Full Ruff lint and format check: pass (22 files formatted).
  • Source distribution and wheel build; whitespace check passes.
  • Existing SpiceDB integration tests require a running service and were not executed; no live AuthZed account, customer data, or network API calls.

Signed off under the project's DCO.

Signed-off-by: kzahiri1 <kzahiri@dons.usfca.edu>
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Kayvan-Zahiri

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

authzedbot added a commit to authzed/cla that referenced this pull request Oct 21, 2026
@tstirrat15

Copy link
Copy Markdown
Contributor

Is this ready for review?

@Kayvan-Zahiri
Kayvan-Zahiri marked this pull request as ready for review November 5, 2026 19:12
@Kayvan-Zahiri

Copy link
Copy Markdown
Author

Yes, sorry for the slow reply. Marked it ready. The one red check is CodeQL's Go analysis failing with "could not process any code written in Go", which isn't related to this change.

@Kayvan-Zahiri
Kayvan-Zahiri requested a review from a team as a code owner November 5, 2026 19:12

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.

2 participants