From 9d5c13abb6f5f463e43582eca9f52332e0ce3328 Mon Sep 17 00:00:00 2001 From: tegwick Date: Sat, 6 Jun 2026 22:14:02 +0200 Subject: [PATCH] docs: record hub-core utilities slice --- docs/hub-core-extraction-boundary.md | 28 +++++++++++++++++++++ workplans/CUST-WP-0025-fos-hub-bootstrap.md | 7 ++++++ 2 files changed, 35 insertions(+) diff --git a/docs/hub-core-extraction-boundary.md b/docs/hub-core-extraction-boundary.md index 3cbd71b..6712fe5 100644 --- a/docs/hub-core-extraction-boundary.md +++ b/docs/hub-core-extraction-boundary.md @@ -63,6 +63,9 @@ Current implementation status: - 2026-06-06: router factory functions were added for domains, repos, messages, TPSC, and policy lookup. These factories accept host-supplied dependencies instead of importing State Hub globals. +- 2026-06-06: shared utilities and migration scaffold were added: slug + normalization, pagination, repo path resolution, trailing-slash path + normalization, Alembic templates, and an initial core-schema migration. ## Extract Now @@ -95,6 +98,31 @@ app.include_router(create_domains_router(get_session)) That shape lets each hub keep its own database session configuration and mount only the generic routers it wants. +## Shared Utilities + +The initial utility set is intentionally small and dependency-light: + +| Module | Purpose | +| --- | --- | +| `hub_core.utils.slugs` | Convert user-facing names into stable lowercase slugs. | +| `hub_core.utils.pagination` | Shared limit/offset bounds and SQLAlchemy pagination. | +| `hub_core.utils.paths` | Resolve repo paths from `host_paths` before falling back to `local_path`. | +| `hub_core.utils.routing` | Normalize a path or URL path component while preserving query strings and fragments. | + +## Migration Scaffold + +`/home/worsch/hub-core` now carries Alembic template files under +`hub_core/migrations/` plus `versions/0001_core_schema.py`. The first migration +covers only the currently extracted core tables: + +- `domains` +- `managed_repos` +- `agent_messages` +- `capability_catalog` +- `tpsc_catalog` +- `tpsc_snapshots` +- `tpsc_entries` + ## Needs An Adapter Seam These are still part of the target architecture, but the current State Hub diff --git a/workplans/CUST-WP-0025-fos-hub-bootstrap.md b/workplans/CUST-WP-0025-fos-hub-bootstrap.md index 3976eec..22312d7 100644 --- a/workplans/CUST-WP-0025-fos-hub-bootstrap.md +++ b/workplans/CUST-WP-0025-fos-hub-bootstrap.md @@ -171,6 +171,13 @@ binding to State Hub globals, preserving the package boundary for future hubs. Verification currently covers package compilation, SQLAlchemy metadata registration, and router factory construction. +Implementation slice 3 (2026-06-06): added hub-core shared utilities for slug +normalization, pagination, repo path resolution, and trailing-slash path +normalization. Added Alembic migration templates plus an initial core schema +migration covering domains, managed repos, agent messages, capability catalog, +and TPSC tables. Hub-core verification now covers package compilation, router +construction, registered metadata, and utility behavior. + ### T06 — Hub-core FastMCP base server ```task