refactor(core): move the resource schema into arcade-core [TOO-1931] - #923
Open
EricGustin wants to merge 1 commit into
Open
refactor(core): move the resource schema into arcade-core [TOO-1931]#923EricGustin wants to merge 1 commit into
EricGustin wants to merge 1 commit into
Conversation
This was referenced Aug 26, 2026
EricGustin
commented
Aug 26, 2026
EricGustin
force-pushed
the
ericgustin/too-1931-resource-schema-to-arcade-core
branch
from
August 26, 2026 20:32
1d296c5 to
d3eb3a2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
EricGustin
marked this pull request as ready for review
August 26, 2026 21:20
Greptile SummaryThe PR moves shared MCP resource schemas into
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| libs/arcade-core/arcade_core/resource_schema.py | Introduces the centralized resource wire models and fixes name-based population of aliased _meta fields. |
| libs/arcade-mcp-server/arcade_mcp_server/types.py | Replaces local resource model definitions with backward-compatible re-exports while retaining JSON-RPC request envelopes. |
| libs/arcade-core/pyproject.toml | Applies the required minor version increase for the new core schema module. |
| libs/arcade-mcp-server/pyproject.toml | Applies a patch version increase and raises the core dependency floor to the version containing the imported module. |
| libs/tests/core/test_resource_schema.py | Covers resource wire shapes, aliased metadata, pagination defaults, validation, and text/blob distinctions. |
| libs/tests/arcade_mcp_server/test_types_reexport.py | Ensures legacy and core import paths resolve to the same schema objects. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Serve[arcade-serve] --> Core[arcade_core.resource_schema]
MCP[arcade_mcp_server.types] -->|re-exports| Core
Consumers[Existing MCP consumers] --> MCP
Reviews (3): Last reviewed commit: "refactor(core): move the resource schema..." | Re-trigger Greptile
EricGustin
force-pushed
the
ericgustin/too-1931-resource-schema-to-arcade-core
branch
2 times, most recently
from
August 27, 2026 00:15
77fee3a to
b8871e0
Compare
arcade-serve needs the worker format's resource shapes to serve them, and it cannot import arcade-mcp-server because the dependency runs the other way. Move the result-shaped half of the resource surface into arcade-core and re-export it from arcade_mcp_server.types, so both libraries read one definition. The request envelopes stay behind. ListResourcesRequest and its siblings extend JSONRPCRequest, which would pull JSONRPCMessage, Request and RequestId into arcade-core to no purpose: a transport that does not carry a JSON-RPC envelope needs the params object alone. ListResourcesParams is added for that params object, which arcade-mcp-server never modelled (PaginatedRequest.params is a bare dict). Also fixes a live serialization bug in the models being moved. Resource, ResourceTemplate and ResourceContents declare meta with alias="_meta", but their config never set populate_by_name, so Resource(meta=...) was accepted as an extra field and emitted as "meta". No caller reads that key, so a developer-declared _meta.ui.csp would have vanished with no error at any layer. Result already had populate_by_name, which is why the two behaved differently.
EricGustin
force-pushed
the
ericgustin/too-1931-resource-schema-to-arcade-core
branch
from
August 27, 2026 15:28
b8871e0 to
5944cbf
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Summary
arcade-serveneeds the resource shapes so it can serve them, and it cannot importarcade-mcp-server, because the dependency runs the other way. This moves the result-shaped half of the resource models down intoarcade-coreand re-exports them fromarcade_mcp_server.types, so both libraries read one definition instead of drifting apart.Part 1 of 6 in a stack. Replaces #917, which GitHub auto-closed when I renamed the head branch. Same commit, same content.
Resolves: https://linear.app/arcadedev/issue/TOO-1931
Design decisions
The models land in
arcade_core/resource_schema.py, parallel to the existingarcade_core/schema.pythat holds the tool schema. Moved:Result,PaginatedResult,BaseMetadata,Icon,Annotations,Cursor,Role,Resource,ResourceTemplate,ResourceContents,TextResourceContents,BlobResourceContents,ListResourcesResult,ListResourceTemplatesResult,ReadResourceResult,ReadResourceParams.The three request envelopes stay where they are.
ListResourcesRequestand its siblings extendJSONRPCRequest, so moving them would dragJSONRPCMessage,RequestandRequestIdintoarcade-corefor no gain. A transport that carries no JSON-RPC envelope only ever needs the params object.ListResourcesParamsis new.arcade-mcp-servernever modelled it, sincePaginatedRequest.paramsis a baredict[str, Any].A serialization bug came along with the move
Resource,ResourceTemplateandResourceContentsall declaremetawithalias="_meta", but their model config never setpopulate_by_name. Combine that withextra="allow"andResource(meta=...)gets quietly accepted as an extra field, then serialized under the wrong key:Nothing reads
meta, so anything a developer put in_metawould have disappeared without an error at any layer.Resultalready setpopulate_by_name, which is why the classes behaved differently and why nobody caught it. Fixed here with a regression test, since these are the classes being moved.Scope
In scope: relocating the models, adding the missing params object, keeping
arcade_mcp_server.typesimportable exactly as before.Not in scope: anything that reads or serves these models. That starts in #918.
Test plan
uv run pytest libs/tests: 3807 passed, 1 skippeduv run mypy .clean in each ofarcade-core,arcade-serve,arcade-tdk,arcade-mcp-serverruff checkandruff format --checkclean on every touched filelibs/tests/core/test_resource_schema.pycovering the field names, the_metaalias in both directions, and the text-versus-blob distinctionAuthor checklist
Before moving this PR from Draft to Ready for Review:
make checkandmake testare green locally; CI is expected to passNote
Medium Risk
Touches shared wire-contract Pydantic models and serialization behavior for
_meta; backward compatible for import paths but any consumer depending on the old silentmetaextra could see different output.Overview
Moves MCP resource list/read result models from
arcade_mcp_server.typesinto newarcade_core.resource_schema, soarcade-servecan share one wire definition without depending onarcade-mcp-server.arcade_mcp_server.typesre-exports the same classes (identity asserted in tests) so existing imports keep working; JSON-RPC request types likeListResourcesRequeststay in the MCP package.Adds
ListResourcesParams(optional pagination cursor) for non–JSON-RPC callers. While relocating models, fixes_metahandling:populate_by_nameonBaseMetadataandResourceContentssometa=maps to the_metawire key instead of being swallowed as an extra field undermeta.Bumps
arcade-coreto 4.12.0 andarcade-mcp-serverto 1.26.1 with the updated core floor. New tests lock wire serialization (_meta, text vs blob, MIME strings) and re-export parity.Reviewed by Cursor Bugbot for commit 5944cbf. Bugbot is set up for automated code reviews on this repo. Configure here.