docs: extract hub-core import refactor workplan
This commit is contained in:
@@ -257,95 +257,11 @@ Refactor the standalone `/home/worsch/state-hub` codebase:
|
||||
- Ensure all existing tests pass with the new import structure
|
||||
- Update pyproject.toml to depend on hub-core
|
||||
|
||||
Implementation start (2026-06-07): added `/home/worsch/hub-core` as an editable
|
||||
`hub-core` dependency of `/home/worsch/state-hub`, synced `uv.lock`, and
|
||||
converted State Hub's message and DoI response schema modules into
|
||||
compatibility re-exports from `hub_core.schemas`. Added
|
||||
`tests/test_hub_core_imports.py` to pin the import seam. Verification:
|
||||
`python -m pytest` in State Hub passed with 349 tests.
|
||||
|
||||
Implementation slice 2 (2026-06-07): aligned hub-core's TPSC schemas and GDPR
|
||||
report payload with the existing State Hub contract, then converted State Hub's
|
||||
`api.schemas.tpsc` module into a compatibility re-export from
|
||||
`hub_core.schemas.tpsc`. Verification: hub-core `pytest` passed with 15 tests;
|
||||
State Hub import/core-router/recently-on-scope focused tests passed. A full
|
||||
State Hub run reached 349 passed / 1 failed; the lone recently-on-scope failure
|
||||
passed when rerun alone and with the new import seam tests.
|
||||
|
||||
Implementation slice 3 (2026-06-07): converted State Hub's base domain schemas
|
||||
(`DomainCreate`, `DomainRead`, `DomainRename`, `DomainUpdate`) into imports
|
||||
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.
|
||||
|
||||
Implementation slice 5 (2026-06-07): extended
|
||||
`hub_core.routers.policy.create_policy_router` with an optional update callback,
|
||||
then replaced State Hub's local `api.routers.policy` implementation with the
|
||||
hub-core factory while keeping State Hub's policy path validation/read/write
|
||||
callbacks local. Verification: hub-core `pytest` passed with 17 tests; State
|
||||
Hub policy/import/MCP/core-router focused tests passed when split to avoid live
|
||||
API test-DB contention.
|
||||
|
||||
Implementation slice 6 (2026-06-07): added host-model injection to
|
||||
`hub_core.routers.tpsc.create_tpsc_router`, then replaced State Hub's local
|
||||
`api.routers.tpsc` implementation with the hub-core factory while injecting
|
||||
State Hub's own repo and TPSC models. Verification: hub-core `pytest` passed
|
||||
with 18 tests; State Hub TPSC/import/MCP focused tests passed with 17 tests and
|
||||
core-router tests passed with 54 tests.
|
||||
|
||||
Implementation slice 7 (2026-06-07): added host-model and schema injection to
|
||||
`hub_core.routers.progress.create_progress_router`, then replaced State Hub's
|
||||
local `api.routers.progress` implementation with the hub-core factory while
|
||||
injecting State Hub's own progress model and schemas. The shared router now
|
||||
preserves State Hub's topic/workstream/task filters and exposes the hub-core
|
||||
risk/alert progress views. Verification: hub-core pytest passed with 19 tests;
|
||||
State Hub MCP/import/core-router focused tests passed with 71 tests.
|
||||
|
||||
Implementation slice 8 (2026-06-07): added host-model/schema injection,
|
||||
optional update-route registration, and detail/archive callbacks to
|
||||
`hub_core.routers.domains.create_domains_router`, then replaced State Hub's
|
||||
local `api.routers.domains` implementation with the hub-core factory. State Hub
|
||||
keeps its own domain detail counts and active-topic archive guard in local
|
||||
callbacks. Verification: hub-core pytest passed with 20 tests; State Hub
|
||||
core/import/MCP/recently-on-scope/capability focused tests passed with 102
|
||||
tests.
|
||||
|
||||
Implementation slice 9 (2026-06-07): converted State Hub's matching generic
|
||||
schema classes to hub-core imports: capability catalog create/patch/read,
|
||||
capability request status/dispute, and repo path registration. State Hub's repo
|
||||
create/read schemas now extend hub-core contracts while keeping dev-hub-only
|
||||
fields local, and repo creation now persists `host_paths` from the shared
|
||||
create contract. State Hub keeps dev-hub-specific capability request, reroute,
|
||||
repo dispatch, onboarding, and scope-health schemas local. Verification: State
|
||||
Hub import/capability/core/DoI scope/MCP focused tests passed with 100 tests.
|
||||
|
||||
Implementation slice 10 (2026-06-07): added
|
||||
`hub_core.routers.capabilities.create_capability_catalog_router` with host
|
||||
domain/repo/catalog model injection, then replaced State Hub's local capability
|
||||
catalog CRUD implementation with that hub-core factory. State Hub keeps the
|
||||
capability request workflow routes local because they still enforce State Hub
|
||||
flow transitions, notifications, rerouting, and task-unblock side effects.
|
||||
Verification: hub-core pytest passed with 21 tests; State Hub
|
||||
capability/import/MCP/core focused tests passed with 95 tests.
|
||||
|
||||
Implementation slice 11 (2026-06-07): added
|
||||
`hub_core.routers.capabilities.create_capability_request_read_router` with host
|
||||
domain/request model and response-schema injection, then replaced State Hub's
|
||||
local capability request list/detail routes with that hub-core factory. State
|
||||
Hub keeps request creation, acceptance, status transitions, metadata patching,
|
||||
dispute, and reroute routes local because they still enforce State Hub flow
|
||||
transitions, notifications, and task-unblock side effects. Verification:
|
||||
hub-core compile checks passed, hub-core pytest passed with 22 tests, the
|
||||
post-format import slice passed with 14 tests, State Hub compile checks passed,
|
||||
and State Hub capability/import/MCP/core focused tests passed with 95 tests.
|
||||
Extracted child workplan (2026-06-07): T08 became complex enough to deserve its
|
||||
own progress surface. Ongoing implementation and slice history now live in
|
||||
`CUST-WP-0048 - Hub-Core State Hub Import Refactor`. This umbrella task remains
|
||||
`in_progress` until the child workplan finishes and hands control back to the
|
||||
Phase 2 dev-hub rename sequence.
|
||||
|
||||
### T09 — Rename MCP server state-hub to dev-hub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user