Code ownership
Ownership is declared next to the code it governs. An OWNERS.toml in any
directory requires review approval for changes beneath it.
[approvals]owners = ["user:alice", "user:bob"]min = 1Full schema: OWNERS.toml, or garden docs owners.
Ownership is hierarchical
Section titled “Ownership is hierarchical”A changed file is governed by the OWNERS.toml in its own directory and every
one above it. A change to services/api/auth/token.go might need approval
from the auth owners, the api owners, and a repository-wide owner — each
scope evaluated independently.
To stop inheriting, sever the chain:
no_parent = true
[approvals]owners = ["user:carol"]Generated subtrees
Section titled “Generated subtrees”A scope can require nothing:
no_parent = true
[approvals]min = 0With no_parent, this is the standard shape for generated code: no owner needed
beneath it, and the repository-wide owners above aren’t dragged in either.
A positive min with no owners is rejected — it could never be satisfied.
Principals
Section titled “Principals”Owners are kind:id. Only user:<id> is supported today; team:<id> is
reserved.
min is the number of distinct, non-author approvals a scope needs,
defaulting to 1. Authors never approve their own change, however many scopes
they own.
Enforcement
Section titled “Enforcement”At merge time, not push time. garden pr merge computes the changed-file set,
loads every governing scope, and requires each to have at least min distinct
non-author owners with an APPROVED review — one of the three merge
gates.
garden pr view 42 shows which approvals are outstanding.