state-hub/workplans/STATE-WP-0080-register-project-flavor-awareness.md

197 lines
6.6 KiB
Markdown
Raw Normal View History

---
id: STATE-WP-0080
type: workplan
title: "statehub register: stop repo scaffolding, hand off to repo-manager"
domain: infotech
repo: state-hub
status: active
owner: codex
topic_slug: infotech
created: "2026-08-16"
updated: "2026-08-16"
parent_project: prj-state-hub-retirement
parent_workplan: SHR-WP-0001
related:
- RMGR-WP-0004
- STATE-WP-0079
- CFED-WP-0001
- SHR-WP-0001
state_hub_workstream_id: "bbfce36a-0b19-462f-af78-167f9eb89b86"
---
# statehub register: stop repo scaffolding, hand off to repo-manager
## Goal
Stop `statehub register` from producing non-conformant repository files, and
hand repository scaffolding and standards conformance to `repo-manager` — where
decision `747011c6` places them.
**This workplan does not implement flavor awareness.** That is `RMGR-WP-0004`.
The state-hub side is a guard, a delegation, and a clean exit.
## Why this changed shape
Drafted 2026-08-16 as a full flavor-awareness implementation inside
`statehub_register.py`; retargeted the same day after decision `747011c6`:
> Hubs are registers: they index and project repository-owned records. They do
> not scaffold, template, or rewrite repository files. Repo Manager owns
> repository representation and governed mutation, and therefore owns the
> standards repositories must comply with.
Implementing here would have built the capability twice, inside the component
being retired under `STATE-WP-0079`, and deepened exactly the boundary violation
the hub refactor exists to remove. The originating residual (`SHR-WP-0001-T01`)
is unchanged; only its owner is.
Tasks T05–T08 below are `cancel`led with pointers to their `RMGR-WP-0004`
successors. They are retained rather than deleted so the handoff is legible.
## The defect being contained
`statehub_register.py` has no reference to `.repo-classification.yaml`,
`category`, or `repo_flavor` in 872 lines, so it cannot distinguish a project
repository from a durable product repository. It therefore:
- writes `INTENT.md` unconditionally (`:248`) and treats missing intent as a hard
error (`:786`–`:790`), though `project-repository-flavor_v0.1` calls shipping
both `INTENT.md` and `GOAL.md` an anti-pattern and forbids requiring
`INTENT.md` on `prj-` repos;
- derives the workplan prefix from the slug (`:78`, `_default_wp_prefix`),
yielding `PRJ-WP-` for every project repo, so all `prj-` repos collide;
- writes a generic `{PREFIX}-0001-statehub-bootstrap.md` (`:269`) that competes
with the project's real foundation workplan.
Hit twice: `prj-state-hub-retirement` and `prj-canon-federation`, both requiring
manual deletion after registration.
## Guard against non-conformant scaffolding
```task
id: STATE-WP-0080-T01
status: todo
priority: high
state_hub_task_id: "6b01a939-7d60-4a0c-90db-af8e31c45359"
```
Add a minimal flavor guard to the register path — detect project flavor from
`.repo-classification.yaml` `category`, `GOAL.md` `repo_flavor`, or the `prj-`
slug prefix, and on a match **refuse to scaffold**, with a message pointing at
`repo-manager`, rather than writing files the standard forbids.
Deliberately a refusal, not an implementation: a partial flavor-aware templating
path here would become a second source of truth competing with `RMGR-WP-0004`.
Durable-repo behaviour is untouched.
## Delegate registration scaffolding
```task
id: STATE-WP-0080-T02
status: wait
priority: high
state_hub_task_id: "bd6a9069-b455-4f5e-b1a5-4a87d014e8f6"
```
Once `RMGR-WP-0004-T03` lands, route scaffolding through Repo Manager instead of
refusing, using the dual-run strangler pattern already proven in `RMGR-WP-0002`
and `RMGR-WP-0003`. Hub-side registration keeps only what a register legitimately
does: record the repo, its identity, and its host path.
Coordinate the cutover point with `RMGR-WP-0004-T05`.
## Correct the inventory disposition
```task
id: STATE-WP-0080-T03
status: wait
priority: medium
state_hub_task_id: "b141b378-10d0-4865-a67b-159806bcf037"
```
Confirm the register/scaffolding capability is dispositioned `move` →
`repo-manager` in `prj-state-hub-retirement/inventory/`, not `keep`. If it is
recorded as `keep`, correct it and cite decision `747011c6` — `SHR-INV-0001` is
the retirement lane's source of truth, and a stale disposition would resurrect
the boundary violation during cutover.
## Remove the templating path
```task
id: STATE-WP-0080-T04
status: wait
priority: low
state_hub_task_id: "d933ae91-ad40-4a88-9ce3-90872cd1f3d7"
```
After delegation is live and `RMGR-WP-0004-T06` compatibility tests pass, delete
the templating code from `statehub_register.py` — `INTENT.md` generation, the
`AGENTS.md` / `CLAUDE.md` / `.custodian-brief.md` templates, `project_rules/`,
and bootstrap-workplan generation.
Sequence behind `STATE-WP-0079`'s strangler so removal lands with the rest of the
retirement rather than as an isolated breaking change.
## Moved: generated templates and briefs
```task
id: STATE-WP-0080-T05
status: cancel
priority: medium
state_hub_task_id: "9eb5ddb5-28d9-4244-8a4f-8fe2a50b5d27"
```
Cancelled — moved to **`RMGR-WP-0004-T04`** by decision `747011c6`.
Worth carrying forward explicitly: `make update-agent-instructions` runs
fleet-wide and shares the flavor-blind templates, so it silently re-breaks
conformant `prj-` repos on every run. That is a larger blast radius than first
registration, and it must not be lost in the handoff.
## Moved: conformance check
```task
id: STATE-WP-0080-T06
status: cancel
priority: low
state_hub_task_id: "3467ae11-1301-46ab-9e7e-75c4f55f53fe"
```
Cancelled — moved to **`RMGR-WP-0004-T02`** by decision `747011c6`.
Conformance checking is the clearest case for the new boundary: judging whether a
repository satisfies its standard is repository representation, not hub
projection. Repo Manager exposes it as a command and a contract; the hub consumes
the result rather than computing it.
## Moved: tests
```task
id: STATE-WP-0080-T07
status: cancel
priority: medium
state_hub_task_id: "126ddd07-df9d-4b65-a651-fff0ad2d4074"
```
Cancelled — moved to **`RMGR-WP-0004-T06`** by decision `747011c6`.
The byte-identical-output regression guard for durable repos stays essential:
the handoff must not change what ordinary repositories receive.
## Superseded: carry the fix forward
```task
id: STATE-WP-0080-T08
status: cancel
priority: medium
state_hub_task_id: "405526b7-b133-4746-aab5-6301c1a0b72e"
```
Cancelled — superseded by decision `747011c6`, which answered this task's open
question outright. It asked whether `repo-manager` was close enough to take the
work; the decision settled that repository standards belong there regardless of
timing, and `RMGR-WP-0004` now carries the whole implementation.
Retained as the record of where the retarget originated.