version: 1 project: name: mixed-node-python description: Example contract for a repo with a Node frontend and Python service type: application execution: default_context: host contexts: host: backend: native toolchains: node: provider: corepack version: "22" package_managers: pnpm: "10" python: provider: uv version: ">=3.12" package_managers: uv: "*" env: vars: OTA_API_ENV: required: true allowed: - local - staging tasks: setup: context: host description: Materialize local env and install frontend and backend dependencies category: setup prepare: kind: sequence steps: - kind: ensure_env_file path: .env.local vars: OTA_API_ENV: value: local - kind: dependency_hydration medium: package_dependencies source: kind: node_package_manager cwd: . manager: pnpm mode: install - kind: dependency_hydration medium: package_dependencies source: kind: uv cwd: . requirements: toolchains: - node - python effects: writes: - .env.local - node_modules - .venv network: true network_kind: dependency_hydration safe_for_agent: true dev: context: host description: Start the frontend dev server category: dev run: pnpm dev depends_on: - setup api-test: context: host description: Run the backend test suite category: test command: exe: uv args: - run - pytest checks: - name: node-installed kind: precondition severity: error run: node --version - name: python-installed kind: precondition severity: error run: python --version agent: entrypoint: setup default_task: api-test safe_tasks: - setup - api-test verify_after_changes: - api-test writable_paths: - src - app - docs - .env.local - node_modules - .venv protected_paths: - ota.yaml notes: | Use `ota run api-test` after code changes to keep the contract honest. Keep dependency installation in `setup` and verify the app with the test task.