refactor(core): replace __getattribute__ op magic with typed explicit…#53
Merged
Merged
Conversation
… dispatch
Implements plans/refactor/02-typed-operation-dispatch.md:
- APIOperation/StreamOperation become frozen generic dataclasses;
response_model drives both validation and the static return type
(types.NoneType for void endpoints, replacing type(None) sentinels)
- New execute_operation(client, op, *, data, params, path_params) frees
the dispatch from executor state: endpoint templates are formatted from
explicit path params instead of scraping executor __dict__/model_dump
- input_model is now enforced: dict payloads are validated before the
request is sent (previously declared but silently ignored)
- Fix falsy-body bug: data={} is now sent as a JSON body (previously
dropped by a truthiness check)
- ResourceBase and new BoundModel (pydantic entity base carrying the
bound HTTP client) each expose a typed generic _execute; entities
(Team, Workspace, Domain) migrate from the executor mixin
- Delete _APIOperationExecutor, APIRequestHandler, AsyncCallable and all
Field(default=<op>) wiring; domain ops are defined once with their
final response models instead of model_copy overrides;
Domain.verify_status return type fixed to DomainVerificationStatus
- Remove src/codesphere/core and src/codesphere/resources from the ty
ratchet; uv run ty check passes over both
- CONTRIBUTING.md: new-resource recipe and public-API policy
Public user-facing API is unchanged; codesphere.core internals are
declared private.
🛡️ Bandit Security Scan Results✅ No security issues found by Bandit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… dispatch
Implements plans/refactor/02-typed-operation-dispatch.md:
Public user-facing API is unchanged; codesphere.core internals are declared private.