casework-client-py: publish concrete TypedDict review output types

Open
#1,200 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
openapi, python, rust

Research direction

Start in crates/registry-casework-client-py/python/registry_casework_client/init.pyi and inspect the review-output aliases described in the issue. Compare their shapes with the Rust DTOs, Node declaration, and generated OpenAPI document, then review the existing native runtime tests and Rust facade catalogue test for regression-test patterns. Done means the public snapshot and accountability aliases use concrete TypedDict shapes and type-level coverage catches DTO members missing from them.

Written by the indexing model from the issue text.

Description

Follow-up from the PR 1189 review (codex finding on `crates/registry-casework-client-py/python/registry_casework_client/init.pyi`).

Problem

Several review-output aliases in the Python facade discard the closed public shapes:

  • review-kind snapshots and protected accountability records are typed as unrestricted `JsonObject` / `dict`-style aliases, while the Rust DTOs, the Node declaration, and the OpenAPI document all define their required and optional members.

Python type checkers therefore accept missing identities, stages, event ids, actors, and retention timestamps, and cannot safely type field access on valid responses.

Proposal

Expose corresponding `TypedDict` definitions for the review output roots (review-kind snapshot, accountability record, and any sibling aliases in the same family) instead of unrestricted object aliases, keeping them in parity with the Rust DTOs and the generated OpenAPI shapes. Add type-level regression coverage alongside the existing native runtime tests.

Scope notes

  • Typing only: no runtime behavior change is expected.
  • The tagged-union result lookups and the `Literal` state kinds are already concrete; this is about the remaining snapshot/record aliases.
  • Pair with a check that new public review DTO members fail the Python type check until the `TypedDict` is updated, mirroring the Rust facade catalogue test.
Dominant language
Rust
Stars
2
Forks
0
Avg merge
3h 45m
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from registrystack/registry-stack

All issues in registrystack/registry-stack

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.