Migrate remaining in-repo workstream REST callers to /workplans
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 6s

Point cleanup_stale_tasks, validate_repo_adr, custodian_cli, dashboard data
loaders, extensions poll, MCP legacy resource, and consistency_check task
queries at preferred /workplans routes. Add caller inventory evidence doc.
This commit is contained in:
tegwick 2026-07-09 00:25:45 +02:00
parent 050cbbceb9
commit b05ca2ca8c
10 changed files with 66 additions and 16 deletions

View file

@ -241,14 +241,14 @@ def cmd_register(args: argparse.Namespace) -> None:
print(f"==> Creating onboarding workstream '{ws_slug}' ...")
# Check if it already exists
existing_ws = next(
(w for w in _api_get("/workstreams/") if w.get("slug") == ws_slug and w.get("status") == "active"),
(w for w in _api_get("/workplans/") if w.get("slug") == ws_slug and w.get("status") == "active"),
None,
)
if existing_ws:
print(" Onboarding workstream already exists — skipping task creation.")
if repo_id and not existing_ws.get("repo_id"):
existing_owner = existing_ws.get("owner")
_api_patch(f"/workstreams/{existing_ws['id']}/", {
_api_patch(f"/workplans/{existing_ws['id']}/", {
"repo_id": repo_id,
"owner": repo_slug if existing_owner in (None, domain) else existing_owner,
})
@ -260,7 +260,7 @@ def cmd_register(args: argparse.Namespace) -> None:
)
else:
try:
ws = _api_post("/workstreams/", {
ws = _api_post("/workplans/", {
"topic_id": topic_id,
"title": f"Repo Integration: {repo_slug}",
"slug": ws_slug,
@ -430,7 +430,7 @@ def cmd_create_workstream(args: argparse.Namespace) -> None:
slug = args.slug or re.sub(r"[^a-z0-9]+", "-", args.title.lower()).strip("-")
ws = _api_post("/workstreams/", {
ws = _api_post("/workplans/", {
"topic_id": topic_id,
"title": args.title,
"slug": slug,
@ -460,7 +460,7 @@ def cmd_create_task(args: argparse.Namespace) -> None:
# Resolve workstream: accept UUID or slug
workstream_id = args.workstream
if not _is_uuid(workstream_id):
wss = _api_get("/workstreams/")
wss = _api_get("/workplans/")
match = next((w for w in wss if w.get("slug") == workstream_id), None)
if not match:
print(f"ERROR: No workstream found with slug '{workstream_id}'.")