Boilerplate completo para construir soluciones agénticas sobre IBM watsonx Orchestrate (ADK 2.x) con una capa web encima. Destilado de cotemar-poc-n1 y dun-casos-prueba. Incluye: - 11 docs (best practices, architecture patterns, ADK cheatsheet, observability, tool authoring, deployment, RUNBOOK, DEPLOY_TO_NEW_WOX, known-issues con 16 errores reales y fix, eval strategy, INDEX) - 13 templates WxO (orchestrator/specialist/single-meta agents, 3 connections, KB + runbook, observable_tool decorator, coercion helpers, Python tools, OpenAPI spec, backend filter endpoint, webhook validator HMAC, MCP connection) - 6 scripts (deploy idempotente con fallback ADK, undeploy, reset, check-adk-version, new-specialist scaffold, eval-agents runner) - 4 eval pieces (linter de best practices, runner, smoke-test, direct backend probe) + scenario templates - 8 subagentes Claude (.claude/agents/) — wxo-architect, wxo-agent-author, wxo-tool-author, runbook-author, mock-builder, backend-tool-builder, eval-author, web-layer-builder - Skill bundle fit-wxo-bootstrap/ (SKILL.md + 3 templates) listo para copiar a ~/.claude/skills/ - Web layer default FastAPI+HTMX con vista timeline observable + endpoint receptor de trazas - Docker compose Coolify-ready (healthcheck wget -qO-, sin labels Traefik, network split internal:true) - CI Gitea workflow con lint + smoke Best practices enforced por evals/lint_wxo_yaml.py: - A1: máx 10 tools por agente - A3: orchestrator sin tools de remediación - A6: agente sin propósito (react sin tools ni KB) - T1: @observable_tool obligatorio, no @tool directo - T3: _compat shim inline en tools.py - D1: docker-compose sin wget --spider - I-005: OpenAPI con description per-operation - I-009: sin labels Traefik manuales Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
2.0 KiB
Bash
Executable File
56 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Smoke test mínimo: end-to-end del flujo principal.
|
|
#
|
|
# Sirve como:
|
|
# - Validación post-deploy
|
|
# - Health check nightly (cron en CI)
|
|
# - Reproducible bug report
|
|
#
|
|
# Pasos:
|
|
# 1. Healthcheck del backend público
|
|
# 2. Llamar al endpoint principal con un input válido
|
|
# 3. Pollear hasta done
|
|
# 4. Assert sobre el estado final
|
|
|
|
set -euo pipefail
|
|
|
|
PUBLIC_HOST="${PUBLIC_HOST:-mi-cliente.fitlabs.dev}"
|
|
BASE="https://${PUBLIC_HOST}"
|
|
|
|
echo "→ [1/4] Healthcheck"
|
|
curl -sf "${BASE}/health" > /dev/null && echo " ✓ 200 OK" || { echo " ✗ FAIL"; exit 1; }
|
|
|
|
echo "→ [2/4] Create case (smoke input)"
|
|
# REPLACE: ajustar al endpoint y payload de tu solución
|
|
RESULT=$(curl -sf -X POST "${BASE}/api/v1/cases/run" \
|
|
-H "Content-Type: application/json" \
|
|
-H "X-Orchestrate-Token: ${WXO_BACKEND_TOKEN:-smoke-test-token}" \
|
|
-d '{"case_id":"smoke-001","target_id":1}' \
|
|
2>&1) || { echo " ✗ FAIL: $RESULT"; exit 1; }
|
|
echo " ✓ accepted: $RESULT"
|
|
|
|
echo "→ [3/4] Poll until done (max 60s)"
|
|
for i in $(seq 1 60); do
|
|
STATUS=$(curl -sf "${BASE}/api/v1/cases/smoke-001" | python3 -c "import sys,json; print(json.load(sys.stdin).get('status','?'))" 2>/dev/null || echo "?")
|
|
[ "$STATUS" = "done" ] && { echo " ✓ done after ${i}s"; break; }
|
|
[ "$STATUS" = "failed" ] && { echo " ✗ failed"; exit 1; }
|
|
sleep 1
|
|
done
|
|
[ "$STATUS" = "done" ] || { echo " ✗ timeout (last status: $STATUS)"; exit 1; }
|
|
|
|
echo "→ [4/4] Assert final state"
|
|
# REPLACE: ajustar al assert de tu solución
|
|
RESULT=$(curl -sf "${BASE}/api/v1/cases/smoke-001")
|
|
echo "$RESULT" | python3 -c "
|
|
import sys, json
|
|
data = json.load(sys.stdin)
|
|
assert data['status'] == 'done', f'status={data[\"status\"]}'
|
|
assert data.get('package_url'), 'no package_url'
|
|
print(' ✓ assertions OK')
|
|
"
|
|
|
|
echo ""
|
|
echo "════════════════════════════════════════"
|
|
echo " ✓ Smoke test passed"
|
|
echo "════════════════════════════════════════"
|