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.
This commit is contained in:
parent
564830c4aa
commit
0709262ffd
21 changed files with 1082 additions and 55 deletions
|
|
@ -18,6 +18,7 @@ This directory is the specification map for Core Hub. The specs are intentionall
|
|||
- [Operator UI Rebuild Backlog](operator-ui-rebuild-backlog.md) - gated first-screen backlog after API/CLI proof
|
||||
- [whynot UI Adapter](whynot-ui-adapter.md) - design-system consumption and adapter rules
|
||||
- [Testing, Release, and Migration](testing-release-and-migration.md) - verification, deployment, and cutover gates
|
||||
- [Pagination adoption](pagination-adoption.md) - hub-core utils deferral and adoption trigger
|
||||
|
||||
## Contract Artifacts
|
||||
|
||||
|
|
|
|||
|
|
@ -44,3 +44,5 @@ Build the production interaction framework as a small set of explicit layers rat
|
|||
- 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`.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,16 @@ consumers need during bootstrap and smoke testing:
|
|||
- Store only hashes, prefixes, labels, and non-secret lifecycle metadata.
|
||||
- Record row counts, relationship checks, and fixture replays for every migration batch.
|
||||
|
||||
## Open Questions
|
||||
## Resolved decisions (2026-07-09, CUST-WP-0057)
|
||||
|
||||
- Whether Core Hub owns the canonical workplan task tables or continues reading from State Hub until cutover.
|
||||
- Whether Inter-Hub admin-only entities should be migrated as historical records or redesigned as Core Hub-native resources.
|
||||
- **Workplan/task tables:** State Hub remains canonical. Core Hub may index and
|
||||
display workplan data via HTTP ingestion later; it does not fork tables in
|
||||
this consolidation lane. See `the-custodian/docs/hub-ecosystem-architecture.md`.
|
||||
- **Inter-Hub admin entities:** Migrated as historical records where consumers
|
||||
depend on identifiers; deferred protected surfaces stay empty compatibility
|
||||
collections until a consumer requires them.
|
||||
|
||||
## Open questions
|
||||
|
||||
- Whether Core Hub adds a read-model ingestion path from State Hub progress/messages
|
||||
(`STATE-WP-0074`) or remains framework-only for coordination data.
|
||||
|
|
|
|||
47
docs/specs/pagination-adoption.md
Normal file
47
docs/specs/pagination-adoption.md
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Pagination Adoption — hub-core utils in Core Hub
|
||||
|
||||
**Updated:** 2026-07-09
|
||||
**Workplan:** `CORE-WP-0009-T05`
|
||||
**Decision:** Defer DB pagination; document trigger for adoption
|
||||
|
||||
---
|
||||
|
||||
## Current state
|
||||
|
||||
Core Hub `/api/v2` list endpoints (`hubs`, `hub-capability-manifests`,
|
||||
`api-consumers`, `widgets`, `interaction-events`) load full result sets and wrap
|
||||
them with an in-memory helper:
|
||||
|
||||
```python
|
||||
def page(data: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
return {"data": data, "count": len(data)}
|
||||
```
|
||||
|
||||
Production table counts remain small (bootstrap/smoke scale). Inter-Hub
|
||||
compatibility fixtures expect `{data, count}` without `limit`/`offset` query
|
||||
params today.
|
||||
|
||||
## hub-core utility
|
||||
|
||||
`hub_core.utils.pagination` provides sync SQLAlchemy `PageParams` and
|
||||
`apply_pagination()` for `Select` queries. Core Hub uses **async**
|
||||
SQLAlchemy (`AsyncSession.execute(select(...))`).
|
||||
|
||||
## Decision
|
||||
|
||||
**Defer adoption** until either:
|
||||
|
||||
1. A list endpoint needs server-side `limit`/`offset` (or cursor) for performance, or
|
||||
2. Inter-Hub compatibility spec adds optional pagination query parameters.
|
||||
|
||||
When triggered:
|
||||
|
||||
- Add `hub_core.utils.pagination_async` (or equivalent) with the same bounds as
|
||||
`PageParams` (limit 1–1000, offset ≥ 0).
|
||||
- Apply to list routes before `session.execute`.
|
||||
- Extend contract fixtures and ops-hub smokes for paginated responses.
|
||||
|
||||
## Non-action
|
||||
|
||||
Do not import sync `apply_pagination` into async routes without an async adapter.
|
||||
Do not change response shape until compatibility spec records the addition.
|
||||
Loading…
Add table
Add a link
Reference in a new issue