HUB-WP-0006-T06: seed legacy topic aliases and add RM_SLICE_TOPICSPINE

- hub_core/runtime/data/legacy_topic_aliases.json: checked-in, versioned
  (2026-10-13.1) seed of the 16 State Hub topics from the STATE-WP-0098-T01
  capture -> primary_domain facet, residual owner STATE-WP-0079, expiry
  2027-03-31T23:59:59Z. Never fetched live; topic UUIDs kept verbatim.
- legacy_topic_aliases.py: loader validated against the 1.0.0
  legacyTopicAlias schema; per-response active/expired status; underscore
  slugs emitted hyphenated (1.0.0 pattern forbids '_').
- RM_SLICE_TOPICSPINE setting (off|shadow|on, default off). off keeps the
  navigation output unchanged (aliases []); shadow/on serve the aliases and
  mark responses with X-RM-Slice-Topicspine. Documented as the A5 rollback
  switch in docs/runtime.md.
- tests/test_legacy_topic_aliases.py: seed, flag and local A5 comparison
  cases (C01, C02/C08, C03, C10) against fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 356991@bnt-lap001
Assistant-Session: 5d99ea69-ed55-4a1e-8d97-f4f312db247f
This commit is contained in:
tegwick 2026-10-13 23:33:42 +02:00
parent e8fb648f25
commit 9e4d5ba23c
10 changed files with 762 additions and 2 deletions

View file

@ -12,6 +12,7 @@ from hub_core.runtime.config import RuntimeSettings
from hub_core.runtime.compat import SQLCompatibilityStore, create_compatibility_router
from hub_core.runtime.models import HealthResponse, ReadinessResponse
from hub_core.runtime.ports import create_ports_router
from hub_core.runtime.legacy_topic_aliases import load_legacy_topic_aliases
from hub_core.runtime.repository_navigation import (
ProjectionRejected,
RepoProjectionClient,
@ -86,6 +87,14 @@ def create_app(
repository_navigation = RepositoryNavigationService(
client=resolved_repo_projection_client,
store=resolved_store,
topic_spine_mode=resolved_settings.rm_slice_topicspine,
# Loaded (and validated) only when the A5 slice is not off, so the
# default path is unchanged; a bad seed fails startup closed.
legacy_topic_aliases=(
load_legacy_topic_aliases()
if resolved_settings.rm_slice_topicspine != "off"
else None
),
)
workload_projection = WorkloadProjectionService(
client=workload_projection_client,