From 73846777d7a4f3ae7b1e9e4f36ed4e49b7132c2b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 22 Aug 2026 07:31:38 +0000 Subject: [PATCH] Add Cloud Agent development environment config Introduce .cursor/environment.json and an idempotent .cursor/install.sh that bootstrap an isolated virtualenv with the thin-subnet mechanism/test toolchain (matching required-checks CI) plus the publisher runtime deps needed by the default SQLite-backed FastAPI server. Expose the publisher on port 8000 via a terminal for local development. Co-authored-by: Ancient Runner --- .cursor/environment.json | 11 +++++++++++ .cursor/install.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .cursor/environment.json create mode 100755 .cursor/install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 00000000..d6da7af9 --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,11 @@ +{ + "name": "Cathedral SN39", + "install": "bash .cursor/install.sh", + "terminals": [ + { + "name": "publisher", + "command": "source .venv/bin/activate && CATHEDRAL_DB_PATH=/tmp/publisher.db PORT=8000 uvicorn scaffold.publisher.server:app --host 0.0.0.0 --port 8000" + } + ], + "ports": [{ "name": "publisher", "port": 8000 }] +} diff --git a/.cursor/install.sh b/.cursor/install.sh new file mode 100755 index 00000000..bd128890 --- /dev/null +++ b/.cursor/install.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Idempotent Cloud Agent bootstrap for the Cathedral SN39 repository. +# +# Sets up an isolated virtualenv with the thin-subnet mechanism/test toolchain +# (matches .github/workflows/required-checks.yml) plus the two extra runtime +# deps the SQLite-backed publisher server needs (multipart form parsing and +# canonical blake3 hashing). Safe to run repeatedly. +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo_root" + +# Cursor's default image ships Python 3.12 but omits the venv seed package, so +# `python3 -m venv` fails with an ensurepip error until it is installed. +if ! python3 -c "import ensurepip" >/dev/null 2>&1; then + sudo apt-get update -qq + sudo apt-get install -y -qq python3.12-venv +fi + +if [ ! -x .venv/bin/python ]; then + python3 -m venv .venv +fi + +# shellcheck disable=SC1091 +. .venv/bin/activate + +python -m pip install --upgrade pip + +# Core mechanism + reviewed test/lint toolchain (`.[test]`) matches CI. The two +# trailing deps are the publisher runtime essentials for the default SQLite +# backend; Postgres (psycopg2) and S3 (boto3) stay optional and load lazily. +python -m pip install -e '.[test]' 'python-multipart>=0.0.9' 'blake3>=1.0' + +echo "Cathedral dev environment ready: $(.venv/bin/python --version)"