core-hub/docs/specs/core-hub-architecture.md
tegwick 0709262ffd
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / pytest-smoke (push) Failing after 2s
Build and Publish Container Image / build-and-push (push) Failing after 1m51s
feat(ecosystem): adopt hub-core dependency and CI pin gate (CORE-WP-0009)
Import slugify_or_default from hub-core, add contract tests, vendor hub-core in
Docker/Forgejo CI, document metadata isolation and pagination deferral, and
align INTENT/SCOPE with three-repo stack.
2026-07-11 01:26:53 +02:00

48 lines
1.5 KiB
Markdown

# Core Hub Architecture Spec
## Goal
Build the production interaction framework as a small set of explicit layers rather than a monolith.
## Layers
1. Contract/IR layer
- OpenAPI
- JSON Schema
- Alembic/SQL schema
- event, widget, and capability catalogs
- fixtures and compatibility examples
2. Runtime service layer
- FastAPI app
- Pydantic v2 request/response DTOs
- SQLAlchemy async persistence
- Alembic migrations
- asyncpg/Postgres
- httpx clients for integration probes
3. Compatibility layer
- Inter-Hub `/api/v2` routes required by current consumers
- auth/error compatibility
- response-shape fixtures
- smoke scripts for ops-hub and activity-core
4. Operator UI layer
- dashboard/console surfaces
- whynot-design aligned tokens/components
- adapter-friendly component model
5. Migration and operations layer
- import/export tools
- row-count and referential checks
- dual-run smokes
- release/cutover runbook
## Boundary Decisions
- Core Hub owns the framework contract and primary implementation.
- Domain hubs own their domain data and domain-specific runtime logic.
- Credential systems keep owning secrets; Core Hub records non-secret evidence and routing metadata only.
- State Hub remains active until Core Hub has a proven compatibility and migration path.
- SQLAlchemy metadata stays separate from hub-core; see `hub-core/docs/metadata-isolation.md`.
- Shared slug/pagination utilities come from `hub_core.utils`; framework tables stay in `core_hub.models`.