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

@ -66,6 +66,29 @@ canonical content hash. MCP exposes the same surface through
`query_repository_navigation` and `get_repository_navigation_facet`. No
classification-write endpoint exists.
### `RM_SLICE_TOPICSPINE` (A5 topic-spine rollback switch)
`RM_SLICE_TOPICSPINE` controls whether hub-core serves the A5 topic-spine
reads. These are the legacy topic aliases on the navigation responses. It
takes one of three values:
| Value | Behaviour |
| --- | --- |
| `off` (default) | Unchanged output: `legacy_topic_aliases` is `[]`, there are no extra headers, and the alias seed is not loaded. |
| `shadow` | Serves the checked-in aliases so the A5 comparison can run. Responses carry `X-RM-Slice-Topicspine: shadow` and `X-Legacy-Topic-Alias-Set: <version>`. Callers have not switched. |
| `on` | Same payload with header value `on`. hub-core is now the switched A5 read source. |
Any other value fails startup. In `shadow` and `on`, a bad alias seed also
fails startup. When the flag is not `off`, `/readyz` reports
`rm_slice_topicspine`.
**Rollback:** set `RM_SLICE_TOPICSPINE=off` and restart. State Hub's
`GET /topics/` and `GET /topics/{id}` remain the fallback throughout.
Confirm the rollback with packet case A5-C10. The flag does not re-point
callers; each caller owner switches its own base URL. Do not move the flag
from `off` in any environment until HUB-WP-0006-T06's switch window is
approved.
Workload projection uses a distinct injected `WorkloadProjectionClient` and
the authoritative `helixforge.workload-reference/v1` identity pair. Migration
`0004_workload_projection` stores only normalized transport rows and source