Skip to content

Refactor Python SDK Catalog Architecture for Web Core Parity#1612

Merged
nan-yu merged 8 commits into
a2ui-project:mainfrom
nan-yu:re-arch-4
Jun 12, 2026
Merged

Refactor Python SDK Catalog Architecture for Web Core Parity#1612
nan-yu merged 8 commits into
a2ui-project:mainfrom
nan-yu:re-arch-4

Conversation

@nan-yu

@nan-yu nan-yu commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes #1606

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the A2UI catalog and validation system by consolidating ModelCatalog and JsonCatalog into a single unified Catalog class, and merging their validators into a single CatalogValidator using the jsonschema engine. The review feedback highlights several critical bugs and defensive programming opportunities, including: incorrect handling of undefined Pydantic fields (which default to PydanticUndefined rather than None), false-positive validation errors for schema-only components lacking a model_class, potential IndexErrors when normalizing empty function names, and potential AttributeErrors when parsing non-dictionary schemas (such as booleans or lists) in Catalog.from_json and CatalogValidator.

Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/components.py
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/validating/catalog_validator.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/validating/catalog_validator.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated

@jacobsimionato jacobsimionato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wow, thanks for jumping on this so fast!!

Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py
@nan-yu nan-yu requested a review from jacobsimionato June 11, 2026 07:03
@nan-yu nan-yu force-pushed the re-arch-4 branch 5 times, most recently from f0cbce1 to da3a36e Compare June 12, 2026 00:13
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/catalog.py Outdated

self.theme_schema = theme_schema
self.theme_class = theme_class
self._catalog_schema: Optional[Dict[str, Any]] = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not blocking: I think we should remove this seeing as it's optional anyway, but feel free to leave it for now and we can always do that later once you're back!

Here is a proposal: #1626

And here is a proposal I'm making to the 1.0 specification to further restrict the catalog format to help us move in this direction: #1627

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This will go to a separate PR to unblock the chain.

@nan-yu nan-yu merged commit 79e8625 into a2ui-project:main Jun 12, 2026
21 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Jun 12, 2026
@nan-yu nan-yu deleted the re-arch-4 branch June 12, 2026 17:28
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.

Refactor Python SDK Catalog Architecture for Web Core Parity

2 participants