refactor(objectql): extract metadata-protocol + add lean ./core entry (ADR-0076 Step 1)#2415
Merged
Merged
Conversation
…adata-protocol (ADR-0076 Step 1) protocol.ts (ObjectStackProtocol impl — sys_metadata CRUD, draft/publish, locks, package ownership, diagnostics) plus its sys-metadata-repository, metadata-diagnostics, seed-loader and build-probes helpers were metadata-domain code living inside @objectstack/objectql for historical reasons. They now live in a new @objectstack/metadata-protocol package. - protocol no longer references the concrete ObjectQL class; it is typed against an injected MetadataHostEngine interface (engine still injected at runtime). - Dependency is one-way (objectql -> metadata-protocol); no cycle. - Non-breaking: objectql re-exports every previously public symbol (ObjectStackProtocolImplementation, SysMetadataRepository, SysMetadataEngine, SeedLoaderService, runBuildProbes, ...), so existing imports keep working. - metadata-protocol added to the fixed version group. Verified: full turbo build green (incl. DTS) across the chain; objectql suite 57 files / 718 tests pass (incl. real-engine protocol integration tests); runtime + rest + metadata downstream (25 pkgs) build clean. This is Step 1 of ADR-0076. A later step turns the protocol into a capability plugin so objectql itself stops depending on it (lean engine by construction). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 14 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…dary ratchet (ADR-0076)
A thin embedder (e.g. the objectbase gateway) can import `@objectstack/objectql/core`
to get the engine/registry/hooks/validation surface with NO kernel plugin, kernel
factory, or metadata protocol — so `@objectstack/metadata-protocol` (and its 268KB)
never enters its bundle/graph.
- New src/core.ts lean barrel; objectql now builds two entries (index + core) via a
local tsup config; package.json gains the `./core` export.
- New core-boundary ratchet test walks core.ts's full import closure and fails if
anything reachable imports @objectstack/metadata-protocol / ./plugin / ./kernel-factory.
Verified: build emits dist/core.{mjs,js,d.ts} with 0 references to metadata-protocol
(vs 5 in index); runtime smoke confirms ObjectQL is exported and ObjectQLPlugin /
ObjectStackProtocolImplementation are not; objectql suite 58 files / 719 tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`@objectstack/metadata-protocol` had a `test` script but no test files, so `vitest run` exited non-zero and failed CI's Test Core (`turbo run test`). Adds a smoke that imports the package and asserts its public exports + pure helpers without needing a data engine (protocol behavior is covered e2e by the objectql suite). Full `turbo run test` now green (126/126 tasks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
ADR-0076 — makes
@objectstack/objectqlcleanly embeddable, in two non-breaking parts:1. Relocate metadata management →
@objectstack/metadata-protocolprotocol.ts(ObjectStackProtocolimpl — sys_metadata CRUD, draft/publish, locks, package ownership, diagnostics) plussys-metadata-repository,metadata-diagnostics,seed-loader,build-probeswere metadata-domain code living in objectql for historical reasons. They now live in a new@objectstack/metadata-protocolpackage. The protocol is typed against an injectedMetadataHostEngineinterface (engine still injected at runtime), so dependency is one-way (objectql → metadata-protocol), no cycle. Non-breaking: objectql re-exports every previously public symbol.2. Lean
@objectstack/objectql/coreentryA thin embedder (e.g. the objectbase gateway) imports
@objectstack/objectql/coreto get the engine/registry/hooks/validation surface with no kernel plugin, kernel factory, or metadata protocol — so@objectstack/metadata-protocol(268KB) never enters its bundle. A boundary ratchet test walkscore.ts's full import closure and fails if anything reachable imports the protocol/plugin/kernel.Why
protocol.tsco-changes withengine.tsonly ~6% of the time but withmetadata-core/metadata/spec~43% — it belongs in the metadata layer.engine.ts/registry.tscommits are cross-package (engine API still co-evolving), and cloud bootsObjectQLPlugindirectly in ~8 places — a breaking boot-contract change isn't worth it now. The./coreentry delivers the lean-embed goal without any of that cost.Verification
dist/core.*has 0 references to metadata-protocol (vs 5 in index); runtime smoke confirmsObjectQLexported,ObjectQLPlugin/protocol not.@objectstack/objectqlsuite: 58 files / 719 tests (incl. real-engine protocol integration + the new boundary ratchet).runtime+rest+metadata(25 pkgs) build clean — public surface intact.🤖 Generated with Claude Code