You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SDK] Implement adapter contract in @common-grants/sdk and common-grants-sdk #743
Implement the adapter contract defined in ADR 0022 in both @common-grants/sdk (TypeScript) and common-grants-sdk (Python). This means creating the createAdapter factory (TS) and Adapter class (Python) that accept an AdapterConfig and return an object with a transform(source) method returning a validated CommonGrants model.
Acceptance Criteria
@common-grants/sdk exports createAdapter(schema, config) returning an object with transform(source): z.infer<typeof schema>
common-grants-sdk exports Adapter(model, config) with transform(source_data) -> model_instance
Both implementations satisfy the structural contract (TS interface / Python Protocol) defined in ADR 0022
Both implementations support declarative (mappings) and imperative (custom transform()) construction paths
Unit tests cover: declarative transform, imperative transform, invalid config rejection
@SnowboardTechie small note -- I would recommend splitting this ticket into two, one for Python SDK and one for TypeScript SDK. That's what we did for:
I also took the opportunity to refresh the bodies to match the post-rework Plugin framework shape (the expanded definePlugin() / define_plugin() with schemas.<Object> = { native, common, toCommon, fromCommon }), since the original text here pre-dated that rework.
Closing this one as superseded. Sibling issues #744–#746 have similar stale framing and I'll freshen those in a follow-up.
Activity
docs(adr): #657 complete adapter contract sections in ADR 0022
widal001 commentedon Apr 21, 2026
@SnowboardTechie small note -- I would recommend splitting this ticket into two, one for Python SDK and one for TypeScript SDK. That's what we did for:
define_plugin()and build-time generator #508definePlugin()andPlugininterface #509SnowboardTechie commentedon Apr 22, 2026
Good call, thanks @widal001! I've split this into:
@common-grants/sdkcommon-grants-sdkI also took the opportunity to refresh the bodies to match the post-rework Plugin framework shape (the expanded
definePlugin()/define_plugin()withschemas.<Object> = { native, common, toCommon, fromCommon }), since the original text here pre-dated that rework.Closing this one as superseded. Sibling issues #744–#746 have similar stale framing and I'll freshen those in a follow-up.