Coordination rules for parallel coding sessions
Copy what you need. Replace the numbers with your own. Each rule says what to do and how to check it.
Roles
One session coordinates and writes no product code.
No other session acts before the coordinator answers. If there is no coordinator, it says so and does nothing but read.
One holder for each area (a repository, or a named part of one) at a time.
A message meant for another session is relayed word for word, in order, with what was already done about it.
Permits
Ask before: starting a full build or test run, editing a shared area, pushing to main, publishing, opening a window, using a device, spending anything.
A request names: who, repository, paths, action, expected duration, resources, and what it waits for.
The answer is one of: GRANTED, GRANTED WITH LIMITS, WAIT (on whom), DENIED (why).
A push permit is for one exact commit hash. A rebase or amend means asking again.
A request quotes the head of main it was built on, and the time it was read. The coordinator reads it again before answering.
Only a clear yes from the owner is a yes. A question, or a reply that could be a question, is not.
A permit relayed by another session is information, not authority.
Check before granting a push:
git ls-remote origin main # is this still the parent in the request?
git merge-base --is-ancestor <host> <ask> # fast-forward only
git diff --stat <host> <ask> # is it only what the request described?
Finished means landed
A change is finished when all three hold: it is on main on the server, the owner’s clone is at that commit, and that clone is clean.
git ls-remote origin main
git -C <owner-clone> rev-parse HEAD
git -C <owner-clone> status --porcelain # must print nothing
Unfinished work goes to a work-in-progress branch and is named in the report.
Every report ends with what was checked, what was not, and what was cleaned up.
Work left unfinished gets a starting document: where it stands, what was checked, the next step, what waits on the owner.
The shared machine
Read the load before a heavy run. Above the agreed limit, wait.
Count one slot for one full build or test run. The coordinator sets how many slots a machine has.
Boot one simulator at a time, and shut it down between batches.
Test windows stay off the screen. A visible run needs the owner’s word that the screen is free, and says “windows will appear now”.
One speech queue per machine. A session speaks only when it needs the owner or when asked, and begins with its own name.
Another machine is a resource too: its own slots, a time limit on every remote run, and the result trusted only from the server.
Correctness
Oracle first: before building anything that must be correct, build the source of the right answer, and decide the question, the input domain, the authority, the equivalence and the failure report. Check: every case is handled, failed, or named as unsupported or blocked, never skipped silently.
Growth
Every piece of work leaves the system better able to do the next one.
One session owns the shared tools. A missing tool is requested from it, never worked around.
Libraries are tried by their users, and what they find goes back to the owner as an issue.
A subject has a home repository. Open a session there instead of teaching the subject elsewhere.
Experts are not appointed, they are promoted. A repository that goes deep into a subject becomes its expert when many other repositories and sessions turn to it. From then on questions on that subject go there, and its notes and checks get held to a higher standard.
The coordinator keeps the list of experts: one subject, one repository. A session that needs to know who the expert is asks.
Knowledge
- Every finding becomes a file in the repository the moment it is found.
- A rule is written the day something goes wrong, next to the story that caused it.
- A rule broken twice becomes a check that runs before the action.
- A new check is tried with a planted fault: it must fail once before it is trusted.
- The coordinator keeps a log: one line for each permit, with the time.