Repository navigation
chore(env): add Cloud Agent environment config for native CORTEX stack [CORTEX-ENV-1] - #124
Merged
Merged
Conversation
astra-ssj
marked this pull request as ready for review
September 13, 2026 12:53
…k [CORTEX-ENV-1] Adds .cursor/environment.json plus idempotent install.sh and start.sh so future Cloud Agents provision PostgreSQL 16, the Python venv, the DB schema/seed, and frontend deps, and boot the FastAPI API (:8000) and Vite frontend (:3000) as terminals. Co-authored-by: Astra <astra-ssj@users.noreply.github.com>
…EX-CI-1] The lock pinned pydantic-core==2.48.0 while pydantic 2.13.5 requires ==2.46.5, so the constrained CI install (pip install -e .[dev] -c requirements.lock.txt) failed to resolve, reddening Backend Pytest/Lint/Smoke and the Dependency Audit. Align install.sh to use the now-consistent lock, mirroring CI. Co-authored-by: Astra <astra-ssj@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/setup-cloud-agent-environment-4188
branch
from
September 13, 2026 13:09
28068dd to
118e12b
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The repository had no committed Cloud Agent environment configuration, so a fresh Cloud Agent VM booted with nothing installed (no PostgreSQL, no Python venv, no frontend deps). This adds a repository-managed
.cursor/environment.jsonplus idempotentinstall/startscripts so future Cloud Agents come up with the full native stack described inAGENTS.md(no Docker), ready to run the learning loop end-to-end.It also fixes a pre-existing broken dependency lock that was reddening backend/security CI on
main.Changes
.cursor/environment.json— repository-managed environment:install→bash .cursor/install.sh,start→bash .cursor/start.sh, plus two named terminals (apion :8000,frontendon :3000) and exposed ports..cursor/install.sh— idempotent baseline setup: installs PostgreSQL 16 + Python venv/build tooling (apt), provisions thecortexmigration role (withCREATEROLEso migration 016 can createcortex_app) and thecortexdatabase, creates.venvand installs the backend editable package with dev extras againstrequirements.lock.txt(mirroring CI), applies the schema/seed migrations only on a fresh DB, and syncs the non-superusercortex_apppassword..cursor/start.sh— per-boot: starts the PostgreSQL 16 cluster (no systemd in the container) and waits for readiness.requirements.lock.txt— CI fix: correctpydantic-corefrom2.48.0to2.46.5.pydantic 2.13.5requirespydantic-core==2.46.5exactly, so the constrained CI install (pip install -e ".[dev]" -c requirements.lock.txt) was unsatisfiable, failing Backend Pytest/Lint/Smoke and the Dependency Audit.pydantic-coreis only pulled in viapydantic, so this is the correct pin and nothing else changes.No application code, schema, or auth changes. No secrets committed — only the dev-only local Postgres password and JWT dev secret already documented in
AGENTS.md/.env.example.Notes for reviewers
pydantic-corepin was introduced by the recent dependabot bump9ce1aa6and affectsmaindirectly (its backend CI is red for the same reason); this PR corrects it.scripts/apply_cortex_schema.shis only safe on a fresh database (migration 016 enablesFORCE ROW LEVEL SECURITY, which blocks replayinginit.sql's seed insert), soinstall.shguards it with ato_regclass('public.scenarios')check to stay idempotent.How tested
On a fresh VM, ran the scripts to completion and exercised the product; also validated every CI step locally with a CI-parity (constrained) venv:
bash .cursor/install.sh— succeeds and is idempotent (skips migration replay, keeps services healthy).bash .cursor/start.sh— starts Postgres and reports ready; idempotent when already running.pip install -e ".[dev]" -c requirements.lock.txtin a fresh venv → resolves cleanly (pydantic 2.13.5+pydantic-core 2.46.5).pytest -q(locked deps) → 215 passed, 23 skipped.ruff check→ clean;bandit -ll→ no issues;pip-audit→ no known vulnerabilities;scripts/smoke_happy_path.sh→ OK.frontend/):tsc --noEmit(0 errors),npm run lint(0 errors),npm run test→ 58 passed,npm run build→ succeeds./health→{"status":"ok"};POST /api/v1/auth/token(admin/admin) → JWT; started a learning session and submitted a decision → graded across competency dimensions with risk resolved tocontrolled.PR checklist
feat(...): ... [CORTEX-104]) — see.cursor/rules/sdlc.md