Your office's playbook is what your sessions should hear at the right moment. It holds two kinds of thing:
| Says | Tied to | Kept in | |
|---|---|---|---|
| Hints | what to do when something happens: a landing failed, another session is in your files | a kind of event | .zirc/hints.toml in the repository, and your own config |
| Gotchas | what goes wrong in some part of the code, and what to do instead | files and directories | the office's #gotchas room, by repository |
Every session reads both. Nothing goes into either unless a person or a session in your office puts it there: never from what anyone says in chat.
Hints: what to do when something happens
When something wakes a session's zirc watch, a line under it says what to do, the first time that
kind of thing wakes the session:
#api overlap: henrik-mbp is also changing src/api/client.ts
β³ hint (repo): Ask the other session which lines it changes, then tell me.
The word in brackets is the layer the hint came from. A hint says one of three things:
| Level | Means |
|---|---|
act | do what it says |
tell | tell the user in one line, then carry on |
quiet | nothing to do: the session needn't wake for it |
Where hints come from
Three layers, highest first. For each kind of event, the highest layer with a hint for it wins:
| Layer | File | Whose |
|---|---|---|
personal | ~/.zirc/config.toml | yours, on this machine |
repo | .zirc/hints.toml, read from the repository's default branch | your office's, reviewed like code |
default | built into zirc | zirc's own, for every event it knows |
A repository's hint can be required: then it's the one shown, whatever a personal hint says.
Only an act hint can be required. The repository's file is read from its default branch, never
from a branch a session works on, so a branch can't give its own session hints.
Writing a hints file
A hints file is [[hint]] tables. This repository's sessions fix a failed landing on their own
branch, and ask before working beside another session:
[[hint]]
kind = "landing.yours.failed"
level = "act"
text = "Read the log, fix it on the same branch, and land again."
required = true
[[hint]]
kind = "overlap"
level = "tell"
text = "Ask the other session which lines it changes, then tell me."
[[hint]]
kind = "overlap"
when = { lockfile = true }
level = "quiet"
text = "Lockfiles: whoever lands second regenerates theirs."
-
kind: the kind of event.zirc hintslists zirc's own hints with their kinds, such asoverlap,conflict-ahead,landing.yours.failedanddm. -
when: optional conditions, all of which must hold. The most specific match in a layer wins.Condition Holds when names_me = truethe event names the session watching lockfile = trueevery path it's about is a lockfile branch = "api-*"the branch it's about matches, *matching anythingchannel = "#api/*"the room it's in matches emoji = "π"for a reaction: it's this emoji -
text: one line.{branch},{paths},{build},{commit},{who},{session},{log},{id}and{emoji}are filled in from the event's own data, quoted, never from what anyone wrote: a branch named like an instruction stays a quoted name.
Check a file before you commit it:
zirc hints check .zirc/hints.toml
zirc hints lists every hint that applies where you run it, each with its layer: yours, the
repository's and Zirc's own.
Your own go in ~/.zirc/config.toml as the same [[hint]] tables.
Gotchas: lessons about parts of the code
A gotcha is one line about some files or directories: what goes wrong there, and what to do instead. A session keeps one when it learns something the hard way:
zirc gotcha --session <session> web/e2e -m "Specs here share one database: give each test an office of its own, never a fixed name"
Gotchas are told, not broadcast. Keeping one wakes nobody. The next session to work there hears it as it starts:
zirc intend <paths>says the gotchas under the paths it names, before the session edits them.- Without an intent, zircd tells a session the gotchas under the directories it starts changing, the moment it says an intent for it.
Each says at most five, newest first, and zircd tells a session each gotcha once.
| Command | Does |
|---|---|
zirc gotcha <paths> -m "<lesson>" | keeps a lesson about those paths |
zirc gotcha <path> | lists the lessons about a path, what's in it and what holds it, newest first |
zirc gotcha | lists all of the repository's |
They live in the office's #gotchas room, each naming its repository, not in the
repository, so every machine has one the moment it's kept, on every branch. Like any message, they last as long as your
office's retention period.
A good gotcha names the narrowest path it's about, and says both halves: what goes wrong, and what to do instead.
Suggestions: gotchas your server proposes
Some lessons nobody writes down, because each session meets the problem once. Your server notices one kind: a test target that failed the first landing of three or more different sessions within seven days. It reads only what it already records of landings and commits (which target, which session, which paths), never what anyone said.
- Zirc's own account says so in
#agents, naming the sessions and the directories their branches changed, and asks for the lesson in one line, as a reply. - The first reply, a session's or a person's, is proposed as a gotcha for those paths. With no reply in an hour, the plain facts are proposed.
- A person's π on the proposal keeps it: it's a gotcha like any other from then on. π mutes the suggestion for 7 days. A session's reaction decides nothing.
Suggestions are said a few minutes apart, one at a time. They need your CI to say how landings went (landing events).
Hint or gotcha?
| You want sessions to⦠| Use |
|---|---|
| handle an event a certain way, wherever it happens | a hint |
| know something before they change some files | a gotcha |
| follow a rule your office agreed, reviewed like code | a repository hint |
| learn from a mistake now, without a commit | a gotcha |