Repair production automation truth and schedule cleanup
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 18s

This commit is contained in:
tegwick 2026-08-20 11:20:23 +02:00
parent 8bcb416285
commit 944fd158de
19 changed files with 441 additions and 64 deletions

View file

@ -46,6 +46,60 @@ GROUP BY d.name, d.enabled
ORDER BY runs DESC, d.name;
\"
echo
echo '--- execution outcomes by activity ---'
kubectl -n ${NS} exec actcore-app-db-0 -- psql -U actcore -d actcore -c \"
SELECT d.name, o.state, count(*) AS runs,
min(o.created_at) AS first_created,
max(o.updated_at) AS last_updated
FROM ops_runs o
JOIN activity_definitions d ON d.id = o.activity_definition_id
WHERE o.created_at >= timestamptz '${SINCE_UTC}'
GROUP BY d.name, o.state
ORDER BY d.name, o.state;
\"
echo
echo '--- failed or unclaimed execution detail (bounded) ---'
kubectl -n ${NS} exec actcore-app-db-0 -- psql -U actcore -d actcore -c \"
SELECT o.created_at, d.name, o.state, o.attempt, o.claim_owner,
left(o.title, 72) AS title,
left(coalesce(o.result->>'error', o.result->>'reason', ''), 240) AS failure
FROM ops_runs o
JOIN activity_definitions d ON d.id = o.activity_definition_id
WHERE o.created_at >= timestamptz '${SINCE_UTC}'
AND o.state IN ('failed', 'open', 'claimed')
ORDER BY o.created_at DESC
LIMIT 30;
\"
echo
echo '--- daily triage validation evidence (bounded) ---'
kubectl -n ${NS} exec deploy/actcore-api -- /app/.venv/bin/python3 -c '
import json, urllib.parse, urllib.request
from datetime import datetime
since = datetime.fromisoformat(\"${SINCE_UTC}\")
url = \"http://actcore-statehub-edge-relay:8000/progress/?\" + urllib.parse.urlencode(
{\"event_type\": \"daily_triage\", \"limit\": 100}
)
items = json.load(urllib.request.urlopen(url, timeout=10))
rows = []
for item in items:
created_raw = item.get(\"created_at\")
if not created_raw:
continue
created = datetime.fromisoformat(created_raw.replace(\"Z\", \"+00:00\"))
if created < since:
continue
detail = item.get(\"detail\") or {}
rows.append({
\"created_at\": created_raw,
\"run_id\": detail.get(\"activity_core_run_id\"),
\"output_validated\": detail.get(\"output_validated\"),
\"summary\": str(item.get(\"summary\") or \"\")[:200],
\"validation_error\": str(detail.get(\"validation_error\") or \"\")[:240],
})
print(json.dumps(rows[:14], indent=2))
'
echo
echo '--- non-high-frequency fires ---'
kubectl -n ${NS} exec actcore-app-db-0 -- psql -U actcore -d actcore -c \"
SELECT d.name, r.fired_at, r.tasks_spawned, r.run_id