Fixed two concrete gaps in the MCP knowledge-search endpoint: no locale field existed at all (now nl-BE/en-GB/fr-BE, wired to the knowledge provider's existing language param), and the correlation ID was always freshly minted, ignoring any inbound X-Correlation-Id header. Added a shared dependency and applied it to all four MCP endpoints so Fleet Ops's own audit log preserves the Hub's real correlation ID end to end. MCP_HUB_BASE_URL/MCP_PROVIDER_ID were declared in .env.example but never read anywhere. Since the Hub's own registration is catalog-driven (it never needs Fleet Ops to push a registration call), wired mcp_hub_base_url for a real Hub reachability health check instead of an unneeded self-registration call. Renamed Fleet Ops's own internal audit tool labels mobilityops_* -> fleet_ops_* (mirrored in contracts/mcp-tools.json with mobilityops_* kept as deprecated aliases); documented that the live Hub connector's own dotted tool namespace is a separate, Hub-owned naming layer, deliberately not touched. Automation page's MCP card now shows real evidence (last tool/client/count/ timestamp, honest no-evidence state) instead of just the registration flag. Also fixed a real methodology gap found mid-session: compose.yaml's api service has no bind mount, so `docker compose run --rm api` silently tests a stale image until rebuilt. Re-ran every local gate after rebuilding; fixed one genuinely stale test assertion and two lint line-length errors surfaced by that rebuild. 176 tests passing, ruff clean, mypy clean (50 files). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
56 lines
2.4 KiB
Python
56 lines
2.4 KiB
Python
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
# The visible product name is fixed and never translated or configured per-deployment --
|
|
# see docs/fleet-ops-correction/current-gap-audit.md section 1. Internal identifiers
|
|
# (package name, Compose project, database name, repository) intentionally remain
|
|
# "mobilityops"; this constant is only for user-facing surfaces (e.g. the OpenAPI title).
|
|
PRODUCT_NAME = "Fleet Ops"
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
mobilityops_env: str = "development"
|
|
mobilityops_demo_mode: bool = True
|
|
database_url: str = "postgresql+psycopg://mobilityops:mobilityops@db:5432/mobilityops"
|
|
knowledge_provider: str = "demo"
|
|
ragcore_base_url: str = "http://ragcore-api:8000"
|
|
ragcore_tenant: str = "northstar-mobility-demo"
|
|
ragcore_workspace: str = "mobilityops"
|
|
ragcore_collection: str = "internal-procedures"
|
|
ragcore_api_token: str = ""
|
|
ragcore_space_id: str = ""
|
|
ragcore_http_timeout_seconds: float = 5.0
|
|
n8n_webhook_url: str = "http://n8n:5678/webhook/mobilityops-return"
|
|
n8n_webhook_trigger_token: str = "replace-me-n8n-webhook-trigger-token"
|
|
n8n_callback_token: str = "replace-me-n8n-callback-token"
|
|
n8n_dispatch_enabled: bool = True
|
|
n8n_dispatch_interval_seconds: float = 3.0
|
|
n8n_http_timeout_seconds: float = 5.0
|
|
n8n_max_attempts: int = 5
|
|
n8n_delivery_lease_seconds: float = 120.0
|
|
app_secret: str = "replace-in-production"
|
|
session_cookie_name: str = "mobilityops_session"
|
|
session_ttl_seconds: int = 60 * 60 * 8
|
|
session_cookie_secure: bool = False
|
|
seed_dir: str = "/app/seed"
|
|
knowledge_dir: str = "/app/knowledge/procedures"
|
|
mcp_hub_service_token: str = "replace-me-mcp-hub-token"
|
|
mcp_hub_registration_enabled: bool = False
|
|
# MCP Hub's own registration is catalog-driven on the Hub side (the Hub reconciles
|
|
# its catalog into the gateway; Fleet Ops never pushes a registration call), so
|
|
# these are only used for an honest reachability health check, not self-registration.
|
|
mcp_hub_base_url: str = ""
|
|
mcp_provider_id: str = "fleet-ops"
|
|
cors_allow_origins: str = "http://localhost:1228"
|
|
demo_organization_name: str = "Northstar Mobility"
|
|
demo_timezone: str = "Europe/Brussels"
|
|
demo_allow_reset: bool = True
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|