Add native module registration and scoped application bindings - #58
Merged
Merged
Conversation
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.
Application integration currently requires separate module and topology registration and rebuilding typed client bindings for each tenant. This adds native framework building blocks that register each module with its topology and bind an application once before creating authorized tenant handles.
cellule-app::CellBindingandApplicationBuilder::modulederive role, shards, and schema range from the module descriptor while keeping stable names, namespace IDs, partition modes, and limits explicit. Topology errors fail before registration hooks. All three partition versions retain byte-identical descriptors compared with explicitCellTypedeclarations.ApplicationBinding<A>validates the author type and client registry once, then createsApplicationHandle<A>withscope(authorized_tenant). Scoped handles retain tenant/application checks and configured read policy and Blob storage. Existing handle constructors use the same validation path.CellNode::bind_local_applicationuses the existing runtime and derives the installation ID from a supplied storage layout.bind_applicationsupports an application-configured client. These helpers preserve the node's existing admission, readiness, and drain ownership.The standalone Axum/OpenAPI service at
crates/cellule-axum/examples/application-builder-serviceconsumes these APIs and retains application-owned authorization, provisioning, listener setup, and command evidence. Its HTTP layer is specific to Axum; compilation and scoped bindings are general framework APIs. The example retains an independent manifest and lockfile so cookbook startup dependencies remain application-owned. It demonstrates two isolated tenants, receipt-bound reads, exact retry/recovery, and HTTP-first shutdown followed by node drain and enrollment withdrawal. Updated guides include ASCII diagrams and compiled registration examples; CI now compiles/lints the standalone service and checks its Rust 1.97 minimum.Both Axum service examples expose interactive Swagger UI at
/docsfrom one shared HTML page and retain/openapi.jsonfor SDK generation. The original adapter example is namedtyped-api-service; its specification now includes recovery, authorized scope, and readiness alongside the generated total routes. The UI uses pinned CDN assets, with the browser internet requirement and bearer authorization steps documented.Managed startup and general schema activation/recovery remain a later framework stage. The runnable service uses the existing schema-version-one cookbook recipe, an in-memory provider, and local fixture credentials, as documented in its README.
Validation:
cellule-appandcellule-hosttests with all features, including public registration, descriptor compatibility, factory identity, and scope rejection tests, in an isolated snapshot.