feat(v2): implement Canonical Model and Provider SPI (Sub-Project 1) - #27
Open
adityak74 wants to merge 10 commits into
Open
feat(v2): implement Canonical Model and Provider SPI (Sub-Project 1)#27adityak74 wants to merge 10 commits into
adityak74 wants to merge 10 commits into
Conversation
…nd conformance harness
…mpatibility shims
Deploying open-context with
|
| Latest commit: |
6316acd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5bfe3f7b.open-context.pages.dev |
| Branch Preview URL: | https://canonical-model-provider-spi.open-context.pages.dev |
adityak74
force-pushed
the
canonical-model-provider-spi
branch
from
August 26, 2026 04:58
e0a68de to
6316acd
Compare
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.
Description
This PR implements Sub-Project 1: Canonical Model & Provider SPI as part of the Open Context 2.0 architecture rewrite. It establishes the strict, deterministic data plane and the unified storage backend contracts while ensuring 100% backward compatibility for all existing 1.x MCP operations.
Key Highlights
@opencontext/coreand@opencontext/provider-sdkpackages.CanonicalContextspecification with 80-bit randomized, strictly monotonic ULIDs and deterministic SHA-256 object hashing.ContextStorecapability contract with built-in multitenancy isolation and robust, type-safe error structures.ContextStoreV1Shimwhich acts as a virtual translation layer, allowing all 11 legacy MCP tools to seamlessly run against the new v2 engines with zero regressions.MemoryContextStore: Thread-safe, highly concurrent in-memory store.JsonContextStore: Atomic, file-backed JSON serialization store.SqlContextStore: Multi-dialect SQL mapping with implementedSqliteDialect(using zero-dependencynode:sqlite) andPostgresDialect.StoreManagerto dynamically load engines via DSN (memory://,json://tmp/ctx.json,sqlite://:memory:).revision-based Optimistic Concurrency Control (OCC) across all engines.Testing & Validation
tests/integration/providers-consistency.test.ts) that mutates, queries, and filters the exact same context datasets across the Memory, JSON, and SQLite providers to verify bit-for-bit structural consistency.Notes for Reviewers
While this PR introduces the new native v2 MCP tools (
save_canonical_context,query_canonical_context), legacy 1.x tools remain the default until the ecosystem fully migrates.