{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"$schema":{"type":"string"},"version":{"type":"number","const":1},"runtimes":{"default":{},"description":"Resolved by mise inside the sandbox, e.g. node: \"22.11\".","type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string","minLength":1}},"services":{"default":{},"type":"object","properties":{"postgres":{"type":"object","properties":{"version":{"type":"string","pattern":"^\\d+(\\.\\d+)*$","description":"Engine version; quote it in YAML (\"16\", not 16)."},"port":{"type":"integer","minimum":1,"maximum":65535},"db":{"type":"string","minLength":1},"user":{"type":"string","minLength":1},"password":{"type":"string"}},"required":["version","port"],"additionalProperties":false},"mysql":{"type":"object","properties":{"version":{"type":"string","pattern":"^\\d+(\\.\\d+)*$","description":"Engine version; quote it in YAML (\"16\", not 16)."},"port":{"type":"integer","minimum":1,"maximum":65535},"db":{"type":"string","minLength":1},"user":{"type":"string","minLength":1},"password":{"type":"string"}},"required":["version","port"],"additionalProperties":false},"redis":{"type":"object","properties":{"version":{"type":"string","pattern":"^\\d+(\\.\\d+)*$","description":"Engine version; quote it in YAML (\"16\", not 16)."},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["version","port"],"additionalProperties":false},"mongodb":{"type":"object","properties":{"version":{"type":"string","pattern":"^\\d+(\\.\\d+)*$","description":"Engine version; quote it in YAML (\"16\", not 16)."},"port":{"type":"integer","minimum":1,"maximum":65535},"db":{"type":"string","minLength":1},"user":{"type":"string","minLength":1},"password":{"type":"string"}},"required":["version","port"],"additionalProperties":false},"mailpit":{"type":"object","properties":{"version":{"type":"string","pattern":"^\\d+(\\.\\d+)*$","description":"Engine version; quote it in YAML (\"16\", not 16)."},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["version","port"],"additionalProperties":false}},"additionalProperties":false,"description":"Native sidecars started by process-compose before setup."},"apps":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]*$"},"additionalProperties":{"type":"object","properties":{"cwd":{"default":".","type":"string","minLength":1},"install":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"build":{"description":"null = dev mode (mirrors local); set to run prod builds.","anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"start":{"type":"string","minLength":1},"port":{"type":"integer","minimum":1,"maximum":65535},"role":{"default":"ui","type":"string","enum":["ui","api","worker"],"description":"The single ui app gates readiness and is what the browser opens."},"health":{"type":"object","properties":{"path":{"default":"/","type":"string","format":"starts_with","pattern":"^\\/.*"},"mode":{"default":"http-any","type":"string","enum":["http-any","http-2xx","tcp"],"description":"http-any: any HTTP response; http-2xx: 2xx only; tcp: port accepts."},"timeout":{"default":"120s","type":"string","pattern":"^\\d+(ms|s|m|h)$"},"host":{"description":"Host header for host-routed apps (e.g. Django ALLOWED_HOSTS).","type":"string","minLength":1}},"additionalProperties":false}},"required":["start"],"additionalProperties":false}},"setup":{"default":[],"description":"Run after services are healthy, before apps start.","type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"run":{"type":"string","minLength":1},"soft":{"default":false,"description":"A failing soft step warns instead of failing the boot.","type":"boolean"},"cwd":{"type":"string","minLength":1}},"required":["run"],"additionalProperties":false}]}},"env":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","pattern":"^(?!secret:\\/\\/)[\\s\\S]*$|^secret:\\/\\/(generated\\/)?[A-Z_][A-Z0-9_]*$"}},"integrations":{"default":{},"type":"object","properties":{"stripe":{"type":"object","properties":{"forward_webhooks_to":{"type":"string","format":"starts_with","pattern":"^\\/.*","description":"Path on the ui app; runs `stripe listen --forward-to`."}},"required":["forward_webhooks_to"],"additionalProperties":false}},"additionalProperties":false},"auth":{"default":{"strategy":"none"},"oneOf":[{"type":"object","properties":{"strategy":{"type":"string","const":"none"}},"required":["strategy"],"additionalProperties":false},{"type":"object","properties":{"strategy":{"type":"string","const":"credentials"},"username":{"type":"string","minLength":1,"pattern":"^(?!secret:\\/\\/)[\\s\\S]*$|^secret:\\/\\/(generated\\/)?[A-Z_][A-Z0-9_]*$"},"password":{"type":"string","minLength":1,"pattern":"^(?!secret:\\/\\/)[\\s\\S]*$|^secret:\\/\\/(generated\\/)?[A-Z_][A-Z0-9_]*$"},"login_path":{"type":"string","format":"starts_with","pattern":"^\\/.*"},"start":{"description":"signed-in (default): sign in once per run and start each case with that session; sign-in cases (tagged auth) still start signed out. signed-out: every case signs in itself.","type":"string","enum":["signed-in","signed-out"]},"sign_in":{"type":"object","properties":{"username_selector":{"description":"CSS selector of the username or email field.","type":"string","minLength":1},"password_selector":{"description":"CSS selector of the password field.","type":"string","minLength":1},"submit_selector":{"description":"CSS selector of the submit button; default presses Enter in the password field.","type":"string","minLength":1},"check_path":{"description":"A signed-in page opened after signing in; the session counts only if it doesn't land on the login page.","type":"string","format":"starts_with","pattern":"^\\/.*"}},"additionalProperties":false,"description":"How the runner signs the test user in, once per run."},"sign_up":{"type":"object","properties":{"path":{"default":"/signup","description":"The sign-up page; default /signup.","type":"string","format":"starts_with","pattern":"^\\/.*"},"submit_selector":{"description":"CSS selector of the submit button; default presses Enter in the password field.","type":"string","minLength":1}},"additionalProperties":false,"description":"Sign the test user up through the app when signing in fails."}},"required":["strategy","username","password"],"additionalProperties":false}],"description":"The test user the agent signs in as."},"sandbox":{"type":"object","properties":{"size":{"default":"small","type":"string","enum":["small","large"],"description":"small (default): 2 vCPU / 4 GiB. large: 4 vCPU / 8 GiB, for heavy builds or memory-hungry stacks."}},"additionalProperties":false,"description":"Size of the cloud sandbox this repo runs in."},"database":{"type":"object","properties":{"reset":{"default":"per-case","description":"per-case (default): put the data back to how it was before the first case, before every case and retry. none: cases share one database and see each other's rows.","type":"string","enum":["per-case","none"]},"command":{"description":"Your own reset, run before every case and retry instead of the built-in Postgres reset. Works with any database. It must leave the test user in place.","anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"run":{"type":"string","minLength":1},"soft":{"default":false,"description":"A failing soft step warns instead of failing the boot.","type":"boolean"},"cwd":{"type":"string","minLength":1}},"required":["run"],"additionalProperties":false}]}},"additionalProperties":false,"description":"How cases share the app's Postgres database."},"triggers":{"type":"object","properties":{"pull_request":{"type":"object","properties":{"enabled":{"default":false,"description":"Start a run when a PR is opened, pushed to or marked ready for review.","type":"boolean"},"branches":{"description":"Only PRs into these base branches (globs). Omit for every branch.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"paths":{"description":"Only PRs that change a matching file (globs; `!` excludes). Omit for every change.","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"skip_drafts":{"default":true,"description":"Don't run draft PRs; they run once marked ready for review.","type":"boolean"},"instructions":{"description":"What automatic runs focus on, like the text after `@interleave test`.","type":"string","minLength":1,"maxLength":4000}},"additionalProperties":false,"description":"Automatic runs on pull_request events."}},"additionalProperties":false,"description":"When runs start without a comment. Default: only `@interleave test` comments start runs."}},"required":["version","apps"],"additionalProperties":false,"title":"interleave.yml","description":"Interleave environment recipe: how the cloud sandbox boots this repo.","$id":"https://interleave.run/schema/interleave.schema.json"}