R165 Keep the shared main checkout read-only

On by default

Where work is divided among agents the way Agent Fleet does, treat the main checkout the agents share as read-only and switch no branch in it, and do work that needs a checkout or runs tests in a worktree of your own.

Reason

Several agents read the main checkout: the agent talking with principals, the agents responsible for jobs and the workers. When one of them switches a branch there, changes a file or runs a command that writes files, the others no longer read the main branch, and when something goes wrong no one can tell who caused it (Art. III §2). Worktrees of their own do not affect one another.

Verification

This rule is for the jurisdictions of rule 28. The shared main checkout is the checkout of a repository that the agents of the jurisdiction read in common, as opposed to the worktrees each opens for its own work; with Agent Fleet, it is the one in the scope’s paths.checkouts. A worktree is opened the way the tool that starts the agents provides, when it provides one (with Agent Fleet, fleet worktree <repo> --branch <type>/<short-desc> or --detach <sha>, not a bare git worktree add). Reading files and running read-only Git commands (git log, git show, git fetch) in the main checkout is not a violation. Where the repository’s instructions say who does what in the main checkout (for example, that the agent responsible for a job deploys the merged main branch to a machine from it), it is done as they say.

Violated when an agent switches a branch, changes or creates a file, commits, or runs a command that writes into the working tree (a build, the tests) in the shared main checkout, other than as the repository’s instructions provide.

Provisions of the constitution it cites

Relations

Parent
R78 Agent Fleet
Requires
none
Conflicts with
none

Metadata

ID
165
Revision
3
Kind
rule
Status
trial
Slug
shared-main-checkout-read-only
Default level
project
Constitution revisions
>=1
Check
none
Default
on
Uses
Instructions instructions
Original language
English en
Translations
Chinese zh