fix registrar writebacks and own the State Hub access map

Ignore generated WORK-RECORDS.md/.custodian-brief.md in the registrar git
precondition, commit identifier writebacks even when registration is
incomplete, and name the remaining records in the error. Add
config/state-hub-access.yaml as the single source for the AGENTS.md port
map, rendered by rmgr scaffold and refreshed with --refresh-hub-access.

Assistant: grok
Assistant-Session: 01a04996-76e8-7f53-b971-1885cfbed436
This commit is contained in:
tegwick 2026-08-28 20:48:21 +02:00
parent 77caca1ab8
commit 7ea7690dfc
10 changed files with 480 additions and 44 deletions

View file

@ -295,12 +295,21 @@ def main(argv: list[str] | None = None) -> int:
p_scaf = sub.add_parser("scaffold", help="Create flavor-correct repository baseline files")
p_scaf.add_argument("--path", required=True)
p_scaf.add_argument("--flavor", required=True, choices=["experimental", "research", "project", "tooling", "product", "business"])
p_scaf.add_argument(
"--flavor",
default=None,
choices=["experimental", "research", "project", "tooling", "product", "business"],
)
p_scaf.add_argument("--slug", default=None)
p_scaf.add_argument("--domain", default="infotech")
p_scaf.add_argument("--wp-prefix", default=None)
p_scaf.add_argument("--force", action="store_true")
p_scaf.add_argument("--no-commit", action="store_true")
p_scaf.add_argument(
"--refresh-hub-access",
action="store_true",
help="Replace the State Hub access table in AGENTS.md from config/state-hub-access.yaml",
)
p_provenance = sub.add_parser(
"assistant-provenance",
@ -742,17 +751,23 @@ def main(argv: list[str] | None = None) -> int:
return 0 if report.get("ok") else 1
if args.command == "scaffold":
from repo_manager.commands.scaffold import scaffold_repository
from repo_manager.commands.scaffold import refresh_hub_access, scaffold_repository
result = scaffold_repository(
Path(args.path),
flavor=args.flavor,
slug=args.slug,
domain=args.domain,
wp_prefix=args.wp_prefix,
force=args.force,
commit=not args.no_commit,
)
if args.refresh_hub_access and not args.flavor:
result = refresh_hub_access(Path(args.path), commit=not args.no_commit)
else:
if not args.flavor:
print("scaffold: --flavor is required unless --refresh-hub-access is set", file=sys.stderr)
return 2
result = scaffold_repository(
Path(args.path),
flavor=args.flavor,
slug=args.slug,
domain=args.domain,
wp_prefix=args.wp_prefix,
force=args.force,
commit=not args.no_commit,
)
print(json.dumps(result.to_dict(), indent=2))
return 0 if result.status == "applied" else 1