feat(activity): repo-scoped automation review CLI (WP-0028)
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Container Image / build-and-push (push) Successful in 20s

Ship the activity console script for consumer-repo morning review: list,
status, runs, deliverables, inbox, checkpoint, and ack. Offline-first with
git + local defs; enriches from ops API and State Hub. Multi-source trust
matrix never reports did-not-run when git has the artefact. Adds
target_repo filter on GET /ops/automations.
This commit is contained in:
tegwick 2026-08-06 13:05:46 +02:00
parent 0a7fcfa4a0
commit 01ba1865ce
17 changed files with 1836 additions and 1 deletions

View file

@ -75,13 +75,38 @@ class MutateBody(BaseModel):
@router.get("/automations")
async def list_automations(
enabled: str = Query(default="all"),
target_repo: str | None = Query(
default=None,
description="Filter automations whose name/id/labels mention this repo slug (ACTIVITY-WP-0028)",
),
) -> dict[str, Any]:
return await ops_inventory(
report = await ops_inventory(
db_url=_db_url(),
temporal_host=os.environ.get("TEMPORAL_HOST"),
temporal_namespace=os.environ.get("TEMPORAL_NAMESPACE", "default"),
enabled=enabled,
)
if target_repo and isinstance(report, dict):
needle = target_repo.strip().lower()
autos = report.get("automations") or []
if isinstance(autos, list) and needle:
filtered = []
for a in autos:
if not isinstance(a, dict):
continue
blob = " ".join(
str(a.get(k) or "")
for k in ("name", "id", "activity_id", "slug", "labels")
).lower()
if needle in blob:
filtered.append(a)
report = dict(report)
report["automations"] = filtered
report["filters"] = {
**(report.get("filters") or {}),
"target_repo": target_repo,
}
return report
@router.get("/automations/status")