hub-core/workplans/HUB-WP-0003-ecosystem-consolidation-library-lane.md

151 lines
4.3 KiB
Markdown
Raw Normal View History

---
id: HUB-WP-0003
type: workplan
title: "Ecosystem consolidation — library lane"
domain: infotech
repo: hub-core
status: finished
owner: codex
topic_slug: infotech
created: "2026-07-09"
updated: "2026-07-11"
state_hub_workstream_id: "ee4f1eef-3a26-4af3-b735-f0c1c638656f"
---
# Ecosystem consolidation — library lane
## Goal
Prepare `hub-core` as the shared library anchor for the three-repo hub stack
defined in `~/the-custodian/workplans/CUST-WP-0057-hub-ecosystem-consolidation.md`.
Extend package seams so `core-hub` can adopt utilities and contracts without
pulling in dev-hub or `/api/v2` framework code.
Parent workplan: `CUST-WP-0057`
## Scope
In scope:
- `hub_core.utils` parity and tests for cross-repo adoption
- SCOPE/INTENT ecosystem position and sibling boundary table
- Capability registry relations to core-hub and state-hub
- Optional async metadata seam evaluation (no breaking sync API changes)
- Version bump when core-hub merges first consumer PR
Out of scope:
- core-hub `/api/v2` routes or framework models
- state-hub workplan/task tables
- MCP tool changes beyond documenting host boundaries
## Task: Add ecosystem position to INTENT and SCOPE
```task
id: HUB-WP-0003-T01
status: done
priority: high
state_hub_task_id: "ee668745-face-4650-a652-24fd9d36f12b"
```
Add an "Ecosystem position" subsection to `INTENT.md` and expand the "Boundaries
with sibling repos" table in `SCOPE.md` to include:
| Repo | Relationship |
| --- | --- |
| `state-hub` | Primary consumer — mounts router factories and MCP composition |
| `core-hub` | Secondary consumer — adopts utils/schemas; does not duplicate framework tables here |
| `the-custodian` | Owns `hub-ecosystem-architecture.md` decision record |
Done when both files reference `CUST-WP-0057` and the three-layer model.
## Task: Utils parity tests for core-hub adoption
```task
id: HUB-WP-0003-T02
status: done
priority: high
state_hub_task_id: "d5007472-3cfd-4075-adb5-6acfb3bbc6f7"
```
Ensure `hub_core.utils.slugs` covers the cases core-hub `api/v2.py` uses
(lowercase, non-alphanumeric folding, empty fallback). Add regression tests in
`tests/test_utils.py` with documented examples from core-hub bootstrap payloads.
Export `slugify` alias if naming alignment helps core-hub import ergonomics.
Done when core-hub can replace local `slugify()` with a tested hub-core import.
## Task: Document SQLAlchemy metadata isolation guidance
```task
id: HUB-WP-0003-T03
status: done
priority: medium
state_hub_task_id: "29e02eef-602c-408d-b0da-be791b822dfe"
```
Add `docs/metadata-isolation.md` (or a section in README) explaining:
- hub-core `Base` is for shared primitive tables only;
- core-hub and state-hub keep separate metadata for host-specific tables;
- router factories inject host models — core-hub framework models stay in
`core_hub.models`, not hub-core.
Done when CORE-WP-0009 T04 can link to this doc without ambiguity.
## Task: Evaluate async base seam (spike only)
```task
id: HUB-WP-0003-T04
status: done
priority: low
state_hub_task_id: "a88d15d7-0297-4707-85cf-c8c365d4ade8"
```
Spike whether `hub_core.models.base` can expose an async-compatible declarative
base or mixin without breaking state-hub sync SQLAlchemy usage. Record outcome
in a short decision note under `the-custodian/docs/` or close as "defer — hosts
keep separate async bases."
Done when the spike has a written recommendation; implementation is optional.
## Task: Update capability registry relations
```task
id: HUB-WP-0003-T05
status: done
priority: medium
state_hub_task_id: "32fc0e4f-94ac-4fcb-aac4-d18128ed8e35"
```
Update `registry/capabilities/capability.infotech.hub-core-library.md`:
```yaml
relations:
supports:
- capability.statehub.workstream-coordinate
related_to:
- capability.infotech.core-hub
```
Sync `registry/indexes/capabilities.yaml`.
Done when reuse-surface federation reflects hub-core as library under the stack.
## Task: Release note for first core-hub consumer
```task
id: HUB-WP-0003-T06
status: done
priority: medium
state_hub_task_id: "77ca7168-c302-4531-95ba-a4eae65bafd7"
```
When `core-hub` merges hub-core utils import (CORE-WP-0009 T02):
- bump `hub_core.__version__` to `0.2.0`;
- add CHANGELOG entry listing utils adoption and ecosystem consolidation;
- verify `uv run pytest -q` still passes.
Done when core-hub CI pins the new hub-core version and both test suites are green.