feat(schema-adapter): implement adapter for Schema Compilers & Tooling#398
Open
Mohammad-Hassan027 wants to merge 4 commits into
Open
feat(schema-adapter): implement adapter for Schema Compilers & Tooling#398Mohammad-Hassan027 wants to merge 4 commits into
Mohammad-Hassan027 wants to merge 4 commits into
Conversation
Author
|
Hey team, everything is green, fully tested, and ready to go. Mind taking a quick look so we can get this merged? CC: @keepsloading |
Author
|
Hey @keepsloading , dropping a quick bump on this. I need to get this adapter merged so I can unblock and start working on the next set of issues dependent on it. Everything is green and fully covered by the new unit tests. Let me know if you need any adjustments! |
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
This PR introduces the
SchemaAdapterutility, which acts as a vital bridge for schema compilers and downstream SDK tooling. It dynamically imports and normalizes the two distinct category metadata patterns currently present in the Context repository (legacycontextFieldsstructures and the declarative_SCHEMAobject formats) into a single, uniform JSON schema representation.Protocol Alignment
Changes Made
src/schema-adapter.mjs: Added theSchemaAdapterclass to dynamically load, merge, and normalize schema constraints (including sensitivity and durability rules) from category modules.src/engine.mjs: ExposedSchemaAdapteras a top-level export on the engine.package.json: Added the./schema-adapterentry point to theexportsmap to allow clean integration by external compilers.test/schema-adapter.test.mjs: Added focused unit tests validating the accurate parsing of both Format 1 (e.g., fitness, dining) and Format 2 (e.g., learning, gaming) categories, alongside parallel schema resolution.Testing
npm testto ensure native Node.js tests cover all edge cases, successfully validating 11/11 tests, including loading all 34 categories dynamically without runtime failures.Checklist
Linked Issue
Closes #386