From a6cb0a76e6840cc22d06e23db93c694f28d8da62 Mon Sep 17 00:00:00 2001 From: demo-bot Date: Sun, 9 Aug 2026 15:44:21 +0000 Subject: [PATCH] decomposer: generate deliverable files for Define the service contract and project architecture for the FastAPI endpoint monitoring service.; Implement the typed monitor CRUD API and concurrency-safe in-memory state according to the service design.; Implement secure on-demand endpoint checks with status updates, latency measurement, robust error handling, and redacted structured logs.; Add operational API endpoints and environment-driven runtime configuration to the monitoring service.; Create automated tests for the monitoring service.; Package the service with Docker and developer documentation.; Validate the complete project. --- scripts/verify.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/verify.sh diff --git a/scripts/verify.sh b/scripts/verify.sh new file mode 100644 index 0000000..0800f78 --- /dev/null +++ b/scripts/verify.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -eu +ruff format --check . +ruff check . +mypy app +pytest + +docker build -t endpoint-monitor:verify . +container="$(docker run -d -p 127.0.0.1:18000:8000 endpoint-monitor:verify)" +trap 'docker rm -f "$container" >/dev/null 2>&1 || true' EXIT +tries=0 +until python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:18000/health/ready', timeout=1)"; do + tries=$((tries + 1)) + [ "$tries" -lt 20 ] || exit 1 + sleep 0.5 +done +python - <<'PY' +import json +import urllib.request +base = "http://127.0.0.1:18000" +assert json.load(urllib.request.urlopen(base + "/health/live")) == {"status": "ok"} +request = urllib.request.Request( + base + "/monitors", + data=b'{"name":"smoke","url":"https://example.com"}', + headers={"content-type": "application/json"}, + method="POST", +) +created = json.load(urllib.request.urlopen(request)) +assert created["name"] == "smoke" +assert len(json.load(urllib.request.urlopen(base + "/monitors"))) == 1 +PY