Skip to content

Repository config

A repository can keep Yak’s settings in a .yak/ directory on its default branch. Changes then go through a PR and review like any other code. Every file is optional.

.yak/
config.yml # behaviour: routing, CI, walkthrough, PR size, co-owner gate, review policy
preview.yml # how a branch preview is started and refreshed
preview.sh # optional, existing hook; wins over preview.yml's checkout_refresh
risk-profile.yml # concerns used by the co-owner gate and the PR reviewer
AGENTS.md # Yak-only agent rules; general guidance stays in the root AGENTS.md / CLAUDE.md
.github/
CODEOWNERS # reviewer rules for GitHub; Yak treats it as a protected file

Yak does not read CODEOWNERS to decide who co-owns a held change (see The co-owner gate), but a change to it always needs a human. The file lives outside .yak/.

  • Yak reads .yak/ from the head commit of the repository’s default branch. It never reads a task branch or a PR branch.
  • A missing file, or a missing key, falls back to the value stored in Yak. This is how migration works: a repository with no .yak/ keeps behaving as it does today.
  • Yak reads again after every push to the default branch.
  • An invalid file never replaces a valid one. Yak keeps using the last valid version, and the repository page shows the error, the commit that introduced it, and a link to fix it. A file that has never been valid is ignored, and its settings come from Yak.
  • Once any valid version of config.yml says co_owner_gate.mode: enforce, the mode stays enforce while the file is broken or unreadable. A typo cannot switch the gate off.

Each file has a JSON Schema. The yaml-language-server line at the top of the examples gives editors completion and inline errors:

# yaml-language-server: $schema=https://raw.githubusercontent.com/Geocodio/yak/main/schemas/config.schema.json
version: 1
# One line on what this repository is. Yak's router uses it to pick a repository for a task.
description: Geocoding API, customer dashboard and billing # max 1000 characters
# Where Yak reads CI results after it pushes a branch. Detected from the repository when absent.
ci: github_actions # github_actions | drone | none
walkthrough:
# Shown in the walkthrough video's browser bar instead of the preview address.
public_site_url: https://dash.geocod.io
pull_requests:
# Above this many changed lines, the PR description gets a "large change" note.
large_change_lines: 200 # at least 1
co_owner_gate:
# enforce: hold risky Yak changes until someone with write access co-owns them.
# Once any valid version says enforce, a broken file keeps the gate on.
mode: enforce # off | enforce
data:
# A dataset Yak fetches once and clones into every sandbox and preview of this repository.
name: addresses # lowercase letters, digits and dashes, max 40
prefix: datasets/addresses # object key prefix in the bucket
version_key: datasets/addresses/CURRENT # object whose first line is the current version
mount_path: /data/addresses # absolute path inside the sandbox
size_gb: 40 # optional hint for admins
review:
# Yak reviews every open, non-draft PR on this repository.
enabled: true
# Opt in to a second, deeper pass on risky or large PRs.
deep:
enabled: false
# How Yak words its comments: "labels" (default) or "plain".
comment_style: labels
# Findings on these paths are not posted. Up to 100 globs.
exclude_paths:
- "public/build/**"
- "*.min.js"
- "database/schema/*.sql"

The smallest useful file is:

version: 1
co_owner_gate:
mode: enforce
KeyMeaning
versionThe file format version. Always 1. Required.
descriptionA short description of what the repository is, shown to Yak as context. Up to 1000 characters.
ciThe CI system Yak reads build results from: github_actions, drone or none. When absent, it falls back to the CI system stored in Yak, which setup detects.
destroy_after_hoursHours a stopped thread sandbox is kept before it is destroyed. At least 1. Without it, the host default applies (YAK_THREADS_STOP_TO_DESTROY_HOURS, 72). The host caps the value (YAK_THREADS_MAX_DESTROY_AFTER_HOURS, 168).
walkthrough.public_site_urlThe public origin shown in the mock URL bar of walkthrough videos. Up to 255 characters.
pull_requests.large_change_linesThe number of changed lines above which a PR counts as large. At least 1. Without it, the host default applies (YAK_LARGE_CHANGE_THRESHOLD, 200).
co_owner_gate.modeoff (default) or enforce. See The co-owner gate.
data.nameThe dataset name: lowercase letters, digits and dashes, up to 40 characters. Required when data is set.
data.prefixThe object key prefix in the dataset bucket. No leading slash and no .., up to 500 characters. The data for version V is under <prefix>/V/. Required when data is set.
data.version_keyThe object whose first line is the current version string. Same character rules as prefix. Required when data is set.
data.mount_pathWhere the dataset is mounted in the sandbox. Absolute, no .., up to 200 characters, and not /, /workspace or /results. Required when data is set.
data.size_gbAn optional size hint in GB, at least 1, shown to admins. An admin sets the enforced cap.
review.enabledWhether Yak reviews pull requests in this repository.
review.deep.enabledWhether Yak runs a second, deep review pass on pull requests that warrant one. Off unless set here or on the repository in Yak.
review.comment_styleHow Yak words its pull request comments: labels (default) starts a comment with a label such as [Correctness · SHOULD_FIX]; plain starts it with how serious it is in words (Blocks merge., Should fix., Nit., Question.) and ends it with a small line naming the category. Falls back to the repository’s setting in Yak.
review.exclude_pathsPath globs Yak leaves out of reviews. Up to 100, each up to 500 characters. When the key is present it replaces the dashboard list and the host defaults.
review.approvalIgnored. Yak still accepts the block so older files stay valid, but the approval level and mode are set on the repository’s Auto-approval settings in Yak.

Required checks match by name. A check run or commit status counts if its name equals the entry, whichever app reported it.

Path globs may contain letters, digits, _, ., /, -, * and ?.

With review.comment_style: plain, Yak posts each review as text first, so a review is never late because of an image. Right after, it edits that review to add graphics: once in the normal case, and a second time only when the pills could not all be drawn at the first try, so the verdict card never waits for them. The final review (the deep review when one runs, else the first review, also when the deep review does not finish) gets a verdict card with the counts and the reviewed commit in place of its bold verdict sentence, and a findings table with one row per file and one small linked pill per finding, which opens the finding’s inline comment. On a pull request that Yak did not open, the first review also gets the files changed map. An image that cannot be drawn leaves its part as text: the verdict sentence stays, or the table keeps its text links.

The data block gives a repository a large read-only dataset, such as a database fixture. An admin configures the S3-compatible store on the host (see Operations). Yak fetches the dataset once, when the version named in version_key changes, and clones it into every sandbox and preview of the repository at mount_path. A missing or failed dataset never blocks a sandbox from starting.

co_owner_gate:
mode: enforce

mode is off (the default) or enforce. The PR review section shows the gate’s status: whether a concerns file is present and whether the fallback owner resolves. If enforce is on and there is no fallback owner, the page says so, and held changes wait for anyone with write access who has linked their GitHub account, who can approve from the co-owner card on the thread.

What is held. With enforce on, a Yak PR waits for a code owner when its changes touch any of the repository’s concerns (Yak checks them against the diff), when that check is unsure or fails, or when it touches any of Yak’s own config files (.yak/config.yml, .yak/risk-profile.yml, CODEOWNERS in any standard location: CODEOWNERS, .github/CODEOWNERS or docs/CODEOWNERS, AGENTS.md, CLAUDE.md). System tasks (setup, review and research modes, Sentry and flaky-test tasks) skip the concern check, but a change to one of those config files still holds them, and so does a compare that fails or lists 300 or more files. A held task shows as “Needs co-owner” in the sidebar thread list and does not open its PR until someone approves.

Who is asked. Up to three people, in this order:

  1. The co-owner tagged when the task was created, if any.
  2. The person who requested changes last, if there was a round.
  3. The repository’s default responsible user (the fallback owner).

Only people who have linked their GitHub account in Yak and have write access to the repository count. CODEOWNERS owners are not asked.

Write access means an admin, maintain or write role, or the push permission. Yak checks it live on GitHub and caches the answer for 10 minutes.

Linking GitHub. Each person connects their account in Settings > Profile, in the “GitHub account” card. The operator setup is in Channels. Yak keeps only the GitHub id and login.

Acting on a hold. Co-owners act from Slack (Approve, Reject, and for the requester Withdraw) or from the card on the thread, which also lets them request changes with feedback. Approve opens the PR. Reject and Withdraw delete the branch. Request changes runs a follow-up task with the feedback.

Early warning. On an enforced repository, when someone without write access starts a task from Slack (a single repository), the dashboard or Linear, Yak makes a quick guess from the request, using a small Haiku agent that reads the concerns, about which of them the change will likely touch. If there are any, it tells the requester right away that a co-owner will be needed: a Slack thread reply with a co-owner picker and “No thanks”, an early-warning card with a picker on the thread, or a message on Linear. The run never waits for a reply. The warning is a guess; the check at PR time is the actual rule. The picker lists only linked users with write access. A tagged co-owner is asked first if the change is held. If they have lost write access by then, Yak says so and asks others instead.

There is no warning without a concerns file, for exempt tasks, for follow-ups, for multi-repository or clarification Slack requests, or when the requester already has write access.

Timing. Yak reminds the asked people after 2 days. After 7 days the request expires and the task stops; the branch is kept.

After approval. Follow-ups on an approved PR push without a new approval. When a follow-up touches a concern the approval did not cover, Yak comments on the PR to say so. On repositories where the gate is enforced, Yak never approves its own PRs.

# yaml-language-server: $schema=https://raw.githubusercontent.com/Geocodio/yak/main/schemas/preview.schema.json
port: 80 # 1 to 65535
health_probe_path: /up
cold_start: docker compose up -d
checkout_refresh: |
docker compose exec -T app composer install --no-interaction
docker compose exec -T app php artisan migrate --force
docker compose exec -T app npm ci
docker compose exec -T app npm run build
wake_timeout_seconds: 120 # at least 1
# Optional. Each defaults to the host value shown in the table below.
cold_start_timeout_seconds: 60
checkout_refresh_timeout_seconds: 900
health_probe_timeout_seconds: 60
KeyMeaningDefault when absent
portThe port the app listens on inside the preview. 1 to 65535. Required in the file.80 (YAK_DEPLOYMENTS_DEFAULT_PORT)
health_probe_pathThe path Yak requests to check the preview is up. Starts with a slash. Required in the file./
cold_startThe command that starts the app from a stopped preview.none
checkout_refreshThe command that refreshes a preview after a new commit.none
wake_timeout_secondsSeconds to wait for a sleeping preview to wake. At least 1.120
cold_start_timeout_secondsSeconds to wait for the cold start command to finish. At least 1.60
checkout_refresh_timeout_secondsSeconds to wait for the checkout refresh command to finish. At least 1.900
health_probe_timeout_secondsSeconds to wait for the health probe to answer. At least 1.60

The defaults are the host’s YAK_DEPLOYMENTS_DEFAULT_* settings.

If the repository also has an existing .yak/preview.sh hook, it wins over checkout_refresh.

Config normally comes from the default branch only, but previews are the exception:

  • A pull request that changes .yak/preview.yml previews with its own copy of the file, so a change to the recipe proves itself before it merges.
  • Every other branch uses the default branch’s preview.yml, so a fix there reaches older branches once it merges.
  • If the pull request’s copy is missing, invalid or unreadable, the preview falls back to the default branch’s recipe. Without a file there, it uses the manifest stored in Yak (the Previews section of the repository’s settings), then the host defaults above.

See Previews.

The file lists the kinds of change a human must look at before Yak approves, in plain language. The co-owner gate, the PR reviewer and the PR description read it. The file is invalid without version: 2.

# yaml-language-server: $schema=https://raw.githubusercontent.com/Geocodio/yak/main/schemas/risk-profile.schema.json
version: 2
concerns: # up to 10 concerns, may be empty
- name: Customer charges and Stripe writes # unique, max 120 characters
approval: always_human # always_human | when_tested
description: >-
Code that decides how much a customer is charged or credited, or that
writes to Stripe.
- name: Usage metering and credit accounting
approval: when_tested
description: Counting and attributing billable requests to accounts.
KeyMeaning
versionAlways 2. Required.
concernsKinds of change a human must look at. Up to 10 entries. Required, may be an empty list.
concerns[].nameA unique name for the concern. Up to 120 characters.
concerns[].approvalalways_human never approves a change that touches the concern. when_tested approves only when the change includes a test.
concerns[].descriptionWhat kind of change counts as touching the concern. Up to 1000 characters.

Yak can write this file for you. Starting concerns generation opens a PR on the yak/risk-profile branch, or updates the open one. Merging the PR approves the concerns. The Approvals page lists them and is where you draft them; the old risk profile page address redirects there.

In the PR description. The “Where the risk is” section lists the concerns the change touches and sets a risk label from them: a concern that always needs a human, or an unsure check, gives risk: high; a concern that needs a test change gives risk: medium; no touched concern gives risk: low. When the check fails, the change is too large or no file has a patch, the section says so and sets no label.

.yak/AGENTS.md holds rules for Yak tasks only. General guidance for every coding agent stays in the root AGENTS.md or CLAUDE.md.

# Yak rules for geocodio
These apply to Yak tasks only. General codebase
guidance lives in the root CLAUDE.md.
## Tests
- Never run the full address import in tests. Use the
`small` fixture set.
- Run `php artisan test --compact --filter=...`,
never the whole suite.
## UI changes
- Record a walkthrough for any change under
`resources/js/`.
## Never
- Change API response shapes without a version bump.
- Touch `config/billing.php`.

Yak does not use CODEOWNERS to choose who co-owns a held change; see The co-owner gate. GitHub still applies your CODEOWNERS rules to review requests, and a change to a CODEOWNERS file (CODEOWNERS, .github/CODEOWNERS or docs/CODEOWNERS) always needs a human.

When a PR touches .yak/**, Yak adds a check run named yak / config to the PR head commit. It validates every .yak/ file present at that commit, and it fails a risk-profile.yml that is not version 2. The check reads only the PR’s head commit. Config used by Yak itself still comes only from the default branch.

Make yak / config a required status check in branch protection, so a broken file cannot merge. This needs the Checks (Read & Write) permission. See Accepting new permissions.

The host floor is a fixed list of paths that always need a human reviewer, at every approval level. A repository cannot change it.

  • Yak’s own rules: .yak/config.yml and .yak/risk-profile.yml (so a PR cannot loosen the policy it is reviewed under), AGENTS.md, CLAUDE.md, .claude/** and the CODEOWNERS files
  • CI: .github/**, .drone*, .gitlab-ci.yml, .circleci/** and Jenkinsfile
  • Docker and infrastructure: Dockerfile*, docker/**, compose files, .dockerignore, ansible/**, *.tf, *.tfvars and Procfile
  • Database migrations: database/migrations/**, migrations/**, **/migrations/** and db/migrate/**
  • Secrets and auth config: .env*, *.pem, *.key, auth.json, config/auth.php, config/sanctum.php and config/fortify.php

The rest of .yak/, such as setup.sh and preview.yml, is reviewed like ordinary code. Everything else, such as billing or authorization code, is judged by the repository’s concerns in .yak/risk-profile.yml.

A repository that was added before .yak/ existed keeps its settings in Yak. To move them into the repository, either:

  • click Open a config PR on the repository page, or
  • run php artisan yak:migrate-config on the server. Add --repo=<slug> for one repository and --dry-run to see what would be written without opening a PR.

Yak opens a PR on the yak/config-migration branch with the yak label. The PR reproduces today’s effective values. The one difference is that required checks no longer pin a GitHub App ID, because they match by name. The PR body says so. yak:migrate-config skips repositories that already have .yak/ files. A repository whose .yak/ Yak could not read is not skipped: the command reports it as an error, continues with the other repositories, and exits with a failure code.

New repositories get the same thing from setup: it opens a PR on yak/setup-config that adds config.yml and preview.yml. Setup opens its PR only when neither config.yml nor preview.yml exists. Settings apply once the PR merges.