From 72478e820e879f267bd3910a6a6efa85eaeea015 Mon Sep 17 00:00:00 2001 From: tegwick Date: Sun, 7 Jun 2026 11:30:50 +0200 Subject: [PATCH] docs: record messages router import seam --- docs/hub-core-extraction-boundary.md | 13 ++++++++----- workplans/CUST-WP-0025-fos-hub-bootstrap.md | 8 ++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/hub-core-extraction-boundary.md b/docs/hub-core-extraction-boundary.md index 2d9909c..798de11 100644 --- a/docs/hub-core-extraction-boundary.md +++ b/docs/hub-core-extraction-boundary.md @@ -91,6 +91,9 @@ Current implementation status: - 2026-06-07: T08 domain schema imports started. State Hub now imports base domain schemas from `hub_core.schemas.domain` while keeping dev-hub-specific domain detail and summary schemas local. +- 2026-06-07: T08 router imports started. State Hub now mounts the hub-core + messages router factory with State Hub's own `AgentMessage` model injected, + proving the router seam can avoid cross-metadata SQLAlchemy model imports. ## Extract Now @@ -198,8 +201,8 @@ to import it: ## Next Step -Continue T08 by replacing the next lowest-risk generic schema imports. Router -imports should wait until the model metadata/migration strategy is explicit, -or use host-model injection rather than importing hub-core SQLAlchemy models -directly into State Hub. Do not rename State Hub to dev-hub until T05-T08 prove -the shared package boundary. +Continue T08 by applying the host-model injection pattern to the next +lowest-risk generic routers. Repos, domains, TPSC, progress, and capability +requests each need a small dependency-injection review before replacement. Do +not rename State Hub to dev-hub until T05-T08 prove the shared package +boundary. diff --git a/workplans/CUST-WP-0025-fos-hub-bootstrap.md b/workplans/CUST-WP-0025-fos-hub-bootstrap.md index 1d8d0f1..7013a72 100644 --- a/workplans/CUST-WP-0025-fos-hub-bootstrap.md +++ b/workplans/CUST-WP-0025-fos-hub-bootstrap.md @@ -278,6 +278,14 @@ from `hub_core.schemas.domain` while keeping dev-hub-specific `DomainDetail` and `DomainSummary` local. Verification: State Hub import/core-router focused tests passed with 58 tests. +Implementation slice 4 (2026-06-07): added host-model injection to +`hub_core.routers.messages.create_messages_router`, then replaced State Hub's +local `api.routers.messages` implementation with the hub-core factory while +injecting State Hub's own `AgentMessage` model. This is the first router import +that avoids importing hub-core SQLAlchemy metadata into State Hub. Verification: +hub-core `pytest` passed with 16 tests; State Hub import/core-router/MCP smoke +focused tests passed with 70 tests. + ### T09 — Rename MCP server state-hub to dev-hub ```task