finish deterministic identifier migration

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
tegwick 2026-08-31 19:40:29 +02:00
parent 4c146f5a92
commit 14ee8e7558
6 changed files with 3387 additions and 25 deletions

View file

@ -34,23 +34,13 @@ Registry: [`config/workplan-prefix-registry.yaml`](../config/workplan-prefix-reg
Work: `RMGR-WP-0004-T01`, `RMGR-WP-0004-T08`.
## Identifier registrar (interim)
## Identifier derivation and legacy repair
Until UUIDv5 derivation lands (`RMGR-WP-0005-T03`), only the registrar
instance may mint `state_hub_workstream_id` / `state_hub_task_id` into
files (`ADR-007` decision 2). Other hubs may read and project; they must
not write new hub primary keys into git.
| Signal | Registrar? |
| --- | --- |
| `STATEHUB_REGISTRAR=1` / `true` / `yes` / `on` | yes |
| `STATEHUB_REGISTRAR=0` / `false` / `no` / `off` | no |
| env unset, hostname starts with `railiance` | yes |
| env unset, any other hostname | no |
The interim registrar rule is superseded for new canonical workplans and tasks.
Any host may derive the same missing UUIDv5 value; existing UUIDs are preserved
and replacement remains a separately sealed migration. The normal path is:
UUIDv5 derivation is live fleet-wide (`RMGR-WP-0005`). Any State Hub instance
may reconcile canonical workplans, tasks, intakes, and decisions: the fleet
namespace plus canonical record id produces the same identifier and
byte-identical writeback on every instance. `STATEHUB_REGISTRAR` no longer gates
the State Hub C-06/C-11/C-32 paths. The normal path is:
```bash
rmgr sync --path . --push
@ -61,8 +51,10 @@ verifies the State Hub identity, and requests one central reconciliation of the
exact pushed commit. Disconnected work remains valid in files and receives an
explicit pending receipt rather than being written to a local cache database.
The production fleet sweep remains disabled. The bounded on-demand registrar
below is retained only for sealed legacy identifier migration and repair:
The production fleet sweep remains disabled. The compatibility command below
is retained only for sealed legacy identifier migration and repair; its name and
scoped environment preserve compatibility with older State Hub releases and do
not impose a single-writer rule on ordinary reconciliation:
```bash
uv run --project ~/repo-manager rmgr registrar-reconcile \
@ -74,10 +66,9 @@ uv run --project ~/repo-manager rmgr registrar-reconcile \
The command verifies the authoritative State Hub health endpoint, refuses dirty
or ahead/behind branches and retired Gitea origins, serializes local registrar
runs, and grants `STATEHUB_REGISTRAR=1` only to its scoped child process. Agents
must not export that variable themselves. If the command is unavailable, send
one deduplicated request to `repo-manager`; repeated `fix-consistency` runs cannot
resolve the gate and waste execution time.
runs, and scopes its compatibility environment to the child process. Agents do
not need to export `STATEHUB_REGISTRAR`; ordinary `fix-consistency` runs derive
canonical identifiers without it.
`--confirm-primary` is an operator assertion, not endpoint discovery. Always
pass the central API explicitly; under ADR-010 the workstation service at