From 30b17adde16139733059e4ed6fbabccfaf91e2ce Mon Sep 17 00:00:00 2001 From: tegwick Date: Fri, 21 Aug 2026 21:38:29 +0200 Subject: [PATCH] docs: route registrar skips through repo-manager --- scripts/project_rules/agents-codex.template | 14 ++++++++++++-- scripts/project_rules/first-session.template | 12 ++++++++++++ scripts/project_rules/session-protocol.template | 7 +++++++ scripts/project_rules/workplan-convention.template | 14 ++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/scripts/project_rules/agents-codex.template b/scripts/project_rules/agents-codex.template index a8269ff..e53796a 100644 --- a/scripts/project_rules/agents-codex.template +++ b/scripts/project_rules/agents-codex.template @@ -118,6 +118,15 @@ curl -s -X PATCH "http://127.0.0.1:8000/tasks/" \ ``` Coding agents should run this directly; ask the operator only if the CLI or State Hub API is unavailable. This syncs task status from files into the hub DB. + If C-06/C-11 reports that this host is not the identifier registrar, do not + retry, export `STATEHUB_REGISTRAR`, or register records by hand. Commit and + push the file-backed work first, then run the repo-manager fallback once: + ```bash + uv run --project ~/repo-manager rmgr registrar-reconcile \ + --path . --confirm-primary --push + ``` + If unavailable, send one deduplicated registrar request to `repo-manager` + naming the repo and canonical ids; UUID absence does not block local work. --- @@ -195,5 +204,6 @@ not a kind. Fleet list lives on State Hub, not in `SCOPE.md`. To create a new workplan: 1. Write the file following the format above -2. Run `statehub fix-consistency` locally; ask the operator only if the CLI or - State Hub API is unavailable. +2. Run `statehub fix-consistency` locally. +3. On a non-registrar C-06/C-11 skip, use the repo-manager fallback documented + above exactly once; never set registrar authority directly. diff --git a/scripts/project_rules/first-session.template b/scripts/project_rules/first-session.template index 195f8ca..50d3df0 100644 --- a/scripts/project_rules/first-session.template +++ b/scripts/project_rules/first-session.template @@ -29,6 +29,18 @@ C-06 creates the hub workplan + tasks and writes `state_hub_workstream_id` (legacy frontmatter name — holds the workplan UUID) and `state_hub_task_id` back into the file. +If C-06/C-11 is skipped because the host is not the identifier registrar, +commit and push the new workplan, then invoke the governed fallback once: + +```bash +uv run --project ~/repo-manager rmgr registrar-reconcile \ + --path . --confirm-primary --push +``` + +Never export `STATEHUB_REGISTRAR` or create the hub records manually. If the +fallback is unavailable, send one request to `repo-manager` and keep working +from the authoritative files. + **Step 5 — Record the setup** ``` add_progress_event( diff --git a/scripts/project_rules/session-protocol.template b/scripts/project_rules/session-protocol.template index 8187702..777ecf5 100644 --- a/scripts/project_rules/session-protocol.template +++ b/scripts/project_rules/session-protocol.template @@ -61,6 +61,11 @@ If no workplans: follow First Session Protocol (`first-session.md`). > and run `fix-consistency`; C-06 registers the workplan and tasks and writes > IDs back into the file. Manual registration creates duplicates when > fix-consistency runs. Work structure belongs in repo files (ADR-001). +> If C-06/C-11 is skipped on a non-registrar host, do not retry or set registrar +> authority directly. Commit and push the file changes, then run once: +> `uv run --project ~/repo-manager rmgr registrar-reconcile --path . +> --confirm-primary --push`. If unavailable, send one deduplicated request to +> `repo-manager` and continue from the files. > > Legacy: `create_workstream` and `/workstreams/` remain as metered aliases — > see `workplan-convention.md` (compatibility footnote). @@ -73,6 +78,8 @@ If no workplans: follow First Session Protocol (`first-session.md`). only as prose or in `SCOPE.md`. See work-record-types § Residuals. 3. Log progress (below). 4. `statehub fix-consistency` when workplan/queue files changed. + A non-registrar C-06/C-11 skip uses the scoped repo-manager fallback above; + repeated consistency runs cannot assign the missing UUIDs. With MCP tools: ``` diff --git a/scripts/project_rules/workplan-convention.template b/scripts/project_rules/workplan-convention.template index cadb613..976532d 100644 --- a/scripts/project_rules/workplan-convention.template +++ b/scripts/project_rules/workplan-convention.template @@ -26,6 +26,20 @@ visible at session start. Pick one up by creating the workplan file, committing, and running `statehub fix-consistency` — C-06 registers the workplan in the hub. Never register by hand with `create_workplan` (legacy MCP alias: `create_workstream`). +If `fix-consistency` reports C-06/C-11 skipped because this host is not the +identifier registrar, further retries cannot help. Do not set +`STATEHUB_REGISTRAR` and do not create hub rows manually. Commit and push the +file-backed work, then run the scoped repo-manager fallback once: + +```bash +uv run --project ~/repo-manager rmgr registrar-reconcile \ + --path . --confirm-primary --push +``` + +If it is unavailable, send one request to `repo-manager` naming the repository +and missing canonical ids. Continue local work from files; hub UUID absence is +an indexing delay, not a reason to repeat the same checks. + Task blocks use this shape: ```task