From 5926206e67ac414fb0e8a5ab60b423cf0ace77a9 Mon Sep 17 00:00:00 2001 From: github-ops Date: Thu, 14 May 2026 18:58:39 +0000 Subject: [PATCH] runtime: wire builder into community binaries --- TASKS.md | 1 + apps/admin-api/src/main.rs | 8 +++++--- apps/mcp-server/src/main.rs | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/TASKS.md b/TASKS.md index 717040d..7319818 100644 --- a/TASKS.md +++ b/TASKS.md @@ -153,5 +153,6 @@ Progress: - Phase 0 / task `0.9`: `crank-adapter-rest::RestAdapter` реализует новый `ProtocolAdapter` contract, а seam дополнен явным `Target` и window parameters для реального adapter wiring - Phase 0 / task `0.10`: `RuntimeExecutor` переведен с hardcoded adapter fields на `AdapterRegistry`, `crank-runtime` больше не держит protocol feature flags, а общий `PreparedRequest` seam дополнен `timeout_ms` для корректного runtime dispatch - Phase 0 / task `0.11`: добавлены `RuntimeExecutorBuilder` и `community_default()`, а default community runtime wiring вынесен из `RuntimeExecutor` в отдельный builder layer + - Phase 0 / task `0.12`: `apps/admin-api` и `apps/mcp-server` переведены на `community_default().with_limits(...).with_response_cache(...).build()` вместо прямой сборки runtime через `RuntimeExecutor::with_limits(...)` - Phase 0 / task `0.13`: введены `RegistryExtension`, `ExtensionMigration` и `apply_extension_migrations(...)` в `crank-registry` как отдельный public seam для additive private migrations - backward-compatible alias `CommunityMachineCredentialVerifier` сохранен, поведение Community не изменено diff --git a/apps/admin-api/src/main.rs b/apps/admin-api/src/main.rs index b0747f6..b8adf5f 100644 --- a/apps/admin-api/src/main.rs +++ b/apps/admin-api/src/main.rs @@ -23,7 +23,7 @@ use crate::{ }; use crank_runtime::{ RequestRateLimitConfig, RequestRateLimiter, RuntimeCacheConfig, RuntimeCacheStores, - RuntimeExecutor, RuntimeLimits, SecretCrypto, + RuntimeLimits, SecretCrypto, community_default, }; #[tokio::main] @@ -66,8 +66,10 @@ async fn main() -> Result<(), Box> { let cache_stores = RuntimeCacheStores::from_config(&cache_config).await?; let api_rate_limit = admin_api_rate_limit_config_from_env()?; let secret_crypto = SecretCrypto::new(&env::var("CRANK_MASTER_KEY")?)?; - let runtime = RuntimeExecutor::with_limits(runtime_limits) - .with_response_cache_store(cache_stores.response.clone()); + let runtime = community_default() + .with_limits(runtime_limits) + .with_response_cache(cache_stores.response.clone()) + .build(); let service = AdminService::new_with_runtime( registry, storage_root, diff --git a/apps/mcp-server/src/main.rs b/apps/mcp-server/src/main.rs index bb91304..3678fe7 100644 --- a/apps/mcp-server/src/main.rs +++ b/apps/mcp-server/src/main.rs @@ -9,7 +9,7 @@ use std::{env, net::SocketAddr, time::Duration}; use crank_registry::{PostgresPoolConfig, PostgresRegistry}; use crank_runtime::{ RequestRateLimitConfig, RequestRateLimiter, RuntimeCacheConfig, RuntimeCacheStores, - RuntimeExecutor, RuntimeLimits, SecretCrypto, + RuntimeLimits, SecretCrypto, community_default, }; use sqlx::postgres::PgConnectOptions; use tokio::net::TcpListener; @@ -54,8 +54,10 @@ async fn main() -> Result<(), Box> { ) .await?; let secret_crypto = SecretCrypto::new(&env::var("CRANK_MASTER_KEY")?)?; - let runtime = RuntimeExecutor::with_limits(runtime_limits) - .with_response_cache_store(cache_stores.response.clone()); + let runtime = community_default() + .with_limits(runtime_limits) + .with_response_cache(cache_stores.response.clone()) + .build(); let app = build_app( registry, refresh_interval,