docs: align repository and launch copy with clarified premise #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Live Demo Smoke | |
| on: | |
| pull_request: | |
| paths: | |
| - "README.md" | |
| - "docs/LAUNCH.md" | |
| - ".github/workflows/live-demo-smoke.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| smoke: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| env: | |
| LIVE_URL: https://safe-agent-playground.onrender.com | |
| steps: | |
| - name: Public endpoints | |
| run: | | |
| curl --fail --retry 5 --retry-delay 5 --max-time 60 "$LIVE_URL/" | grep -q "Safe Agent Playground" | |
| curl --fail --retry 5 --retry-delay 5 --max-time 60 "$LIVE_URL/health" | grep -q '"status":"ok"' | |
| curl --fail --retry 5 --retry-delay 5 --max-time 60 "$LIVE_URL/docs" | grep -q "Swagger UI" | |
| curl --fail --retry 5 --retry-delay 5 --max-time 60 "$LIVE_URL/openapi.json" | grep -q '"/v1/run-demo"' | |
| - name: Five public Playground scenarios | |
| shell: python | |
| run: | | |
| import json | |
| import os | |
| import urllib.request | |
| base = os.environ["LIVE_URL"] | |
| scenarios = [ | |
| ({"actor_tenant_id":"tenant-a","resource_tenant_id":"tenant-a","tool":"read_record","human_approved":False,"request_id":"smoke-same-tenant"}, True, "policy_allowed", True), | |
| ({"actor_tenant_id":"tenant-a","resource_tenant_id":"tenant-b","tool":"read_record","human_approved":False,"request_id":"smoke-cross-tenant"}, False, "tenant_mismatch", False), | |
| ({"actor_tenant_id":"tenant-a","resource_tenant_id":"tenant-a","tool":"send_notification","human_approved":False,"request_id":"smoke-approval-required"}, False, "human_approval_required", False), | |
| ({"actor_tenant_id":"tenant-a","resource_tenant_id":"tenant-a","tool":"send_notification","human_approved":True,"request_id":"smoke-approved"}, True, "policy_allowed", True), | |
| ({"actor_tenant_id":"tenant-a","resource_tenant_id":"tenant-a","tool":"delete_record","human_approved":True,"request_id":"smoke-delete-blocked"}, False, "destructive_tool_disabled_in_demo", False), | |
| ] | |
| for payload, expected_allowed, expected_reason, expected_executed in scenarios: | |
| request = urllib.request.Request( | |
| f"{base}/v1/run-demo", | |
| data=json.dumps(payload).encode(), | |
| headers={"Content-Type":"application/json"}, | |
| method="POST", | |
| ) | |
| with urllib.request.urlopen(request, timeout=60) as response: | |
| assert response.status == 200 | |
| body = json.load(response) | |
| assert body["decision"]["allowed"] is expected_allowed, body | |
| assert body["decision"]["reason"] == expected_reason, body | |
| assert body["executed"] is expected_executed, body | |
| assert body["audit_event"]["correlation_id"] == payload["request_id"], body | |
| assert body["audit_event"]["allowed"] is expected_allowed, body | |
| print(payload["request_id"], body["decision"]["allowed"], body["decision"]["reason"]) |