Skip to content

feat(transport): ensure CEP-15 schemaHash consistency in announcement…#42

Closed
sagar-h007 wants to merge 1 commit intoContextVM:masterfrom
sagar-h007:cep-15-announcement-schemahash
Closed

feat(transport): ensure CEP-15 schemaHash consistency in announcement…#42
sagar-h007 wants to merge 1 commit intoContextVM:masterfrom
sagar-h007:cep-15-announcement-schemahash

Conversation

@sagar-h007
Copy link
Copy Markdown

CEP-15: Ensure schemaHash consistency in announcement events (kind:11317)

Problem

CEP-15 uses schemaHash so clients can recognize when two tools are actually the same across different providers. For that to work, the hash has to be consistent no matter how the tool is discovered.

Right now, direct tools/list responses already include schemaHash (from PR #38), but announcement events (kind:11317) don’t. That means a client discovering a tool via relay announcements won’t see the same metadata as when it fetches the tool directly. As a result, it can’t reliably match or deduplicate tools across providers, which defeats the purpose of schema-based interoperability.

Solution

This PR fixes that gap by making announcement events consistent with direct responses. Inside publishAnnouncementEvent(), it reuses the existing helper from PR #37 to enrich tools/list results with schemaHash before serializing them. A schema check ensures this only applies to tools/list payloads, so other announcement types remain unchanged.

Why this matters

After this change, both discovery paths produce the same schemaHash, so clients can reliably compare tools regardless of how they were discovered. This makes CEP-15 actually usable in practice, enabling proper deduplication and smoother provider switching.

@abhayguptas
Copy link
Copy Markdown

Hi @sagar-h007, thanks for working on this.

I took a closer look, and PR #38 already updates the announcement path as well, so the kind:11317 content is enriched with the same schemaHash metadata as direct tools/list responses. The implementation there uses a shared transport-side transformer passed into AnnouncementManager, rather than importing the helper directly inside announcement-manager.ts, but the goal is the same.

I also noticed this PR copies the schema helper files again under canonical-schema.*, which seems to duplicate the CEP-15 helper work already introduced in PR #37. It may be better to build on the existing helper/transport path instead of reintroducing the same schema logic in a second place.

I think the remaining CEP-15 follow-up after PR #38 is the outer i / k discovery tags on announcement events, rather than the announcement-content consistency itself.

@ContextVM-org
Copy link
Copy Markdown
Contributor

Hey @sagar-h007 I'm closing this pr in favour of #38 hope that's ok for you. We can continue the work and discussion there. Thanks

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.

3 participants