retire identifier registrar guard
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
parent
667ed28037
commit
5dd04dcb3d
3 changed files with 106 additions and 72 deletions
|
|
@ -11,7 +11,7 @@ Checks:
|
|||
C-04 workstream-status-drift WARN Yes File status != DB status (file wins)
|
||||
C-05 workstream-title-drift WARN Yes File title != DB title (file wins)
|
||||
C-06 workstream-unlinked WARN Yes Workplan has no state_hub_workstream_id
|
||||
Identifier minting (--fix create+writeback) is registrar-only (ADR-007)
|
||||
--fix derives the UUID from the canonical record id and writes it back
|
||||
C-07 orphan-db-active FAIL No Active DB workstream, no backing file
|
||||
C-08 orphan-db-closed INFO No Finished/archived DB workstream, no file
|
||||
C-09 workstream-repo-mismatch FAIL Yes DB workstream repo_id != file location
|
||||
|
|
@ -46,10 +46,10 @@ Usage:
|
|||
python scripts/consistency_check.py --all [--fix] [--no-writeback] [--json] [--api-base URL]
|
||||
python scripts/consistency_check.py --here [PATH] [--fix] [--no-writeback] [--json] [--api-base URL]
|
||||
|
||||
Registrar (ADR-007 interim / RMGR-WP-0005-T01):
|
||||
C-06 / C-11 / C-32 mint hub IDs into files only when this instance is the
|
||||
identifier registrar. Default: hostname starts with ``railiance``.
|
||||
Override with STATEHUB_REGISTRAR=1 or =0. Read/project checks are unchanged.
|
||||
Identifiers (ADR-007 / RMGR-WP-0005):
|
||||
C-06 / C-11 / C-32 derive UUIDv5 identifiers from the fleet namespace and
|
||||
canonical record id. Any instance may reconcile; independent instances
|
||||
produce the same identifier and byte-identical writeback.
|
||||
|
||||
Exit codes (single-repo / local CLI):
|
||||
0 — clean (no FAILs or WARNs; INFOs are allowed)
|
||||
|
|
@ -2834,38 +2834,6 @@ def _write_custodian_brief(api_base: str, repo_slug: str, repo_path: str) -> boo
|
|||
return True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Identifier registrar (ADR-007 decision 2 / RMGR-WP-0005-T01)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _is_identifier_registrar() -> bool:
|
||||
"""True when this instance may mint hub IDs into repository files."""
|
||||
try:
|
||||
from repo_manager.registrar import is_identifier_registrar
|
||||
|
||||
return is_identifier_registrar()
|
||||
except ImportError:
|
||||
raw = os.environ.get("STATEHUB_REGISTRAR", "").strip().lower()
|
||||
if raw in {"1", "true", "yes", "on"}:
|
||||
return True
|
||||
if raw in {"0", "false", "no", "off"}:
|
||||
return False
|
||||
return socket.gethostname().lower().startswith("railiance")
|
||||
|
||||
|
||||
def _skip_non_registrar_mint(report: "ConsistencyReport", check_id: str, label: str) -> bool:
|
||||
if _is_identifier_registrar():
|
||||
return False
|
||||
report.fixes_applied.append(
|
||||
f"{check_id} skipped: this instance is not the identifier registrar "
|
||||
f"({label}; do not retry or set STATEHUB_REGISTRAR directly; after "
|
||||
"committing and pushing file-backed work run once: "
|
||||
"uv run --project ~/repo-manager rmgr sync --path . --push; "
|
||||
"ADR-012 / STATE-WP-0086)"
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Fix engine
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
@ -3019,8 +2987,6 @@ def fix_repo(
|
|||
)
|
||||
|
||||
elif issue.check_id == "C-06":
|
||||
if _skip_non_registrar_mint(report, "C-06", "workplan UUID"):
|
||||
continue
|
||||
wp_file = Path(ctx["wp_file"])
|
||||
meta = ctx["meta"]
|
||||
domain = ctx["domain"]
|
||||
|
|
@ -3179,8 +3145,6 @@ def fix_repo(
|
|||
)
|
||||
|
||||
elif issue.check_id == "C-32":
|
||||
if _skip_non_registrar_mint(report, "C-32", "work-record UUID"):
|
||||
continue
|
||||
md_path = ctx["md_path"]
|
||||
kind = ctx["kind"]
|
||||
rid = ctx["rid"]
|
||||
|
|
@ -3316,8 +3280,6 @@ def fix_repo(
|
|||
)
|
||||
|
||||
elif issue.check_id == "C-11":
|
||||
if _skip_non_registrar_mint(report, "C-11", "task UUID"):
|
||||
continue
|
||||
ws_id = ctx["ws_id"]
|
||||
ws_status = ctx.get("ws_status", "")
|
||||
task = ctx["task"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue