Skip to content

0.2.8: RegisteredClassChoices validates registry keys in pydantic - #22

Merged
trissim merged 4 commits into
mainfrom
e1-registered-class-pydantic
Oct 11, 2026
Merged

trissim merged 4 commits into
mainfrom
e1-registered-class-pydantic

Conversation

@trissim

@trissim trissim commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

A field annotated with RegisteredClassChoices(family) now accepts a member class or its registry key in pydantic, serializes to the key, and publishes the keys as a JSON-schema enum. OpenHCS's MCP tool schemas expose family-valued config fields (E1 converts more enums to families), and pydantic rejected their registry-key spellings.

For OpenHCS consolidation surface E1.

🤖 Generated with Claude Code

trissim and others added 2 commits October 11, 2026 10:39
A field annotated with RegisteredClassChoices(family) now accepts a member
class or its registry key, emits the key, and publishes the keys as a JSON
schema enum, so pydantic-built tool schemas (MCP) accept family-valued fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:58

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

trissim and others added 2 commits October 11, 2026 13:15
registered_class_from_key compared each member's to_jsonable spelling, so
decoding a family-valued field ran the encoder; scalar registry keys are
their own spelling and are read directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field's schema is a $ref to a definition titled with the family's name,
described by its docstring's first paragraph, listing the registry keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim force-pushed the e1-registered-class-pydantic branch from 7a96904 to 47e33a2 Compare October 11, 2026 17:19
@trissim
trissim merged commit a88fe56 into main Oct 11, 2026
15 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.

2 participants