@johngaynor/ocnus 0.0.0-stage → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +988 -2
- package/agents/linear-mcp.json +1 -0
- package/agents/ocnus-build.md +23 -0
- package/agents/ocnus-write-up.md +20 -0
- package/cli/host-mark +36 -0
- package/cli/lib/agents.sh +350 -0
- package/cli/lib/approval.sh +94 -0
- package/cli/lib/archive.sh +447 -0
- package/cli/lib/billing.sh +166 -0
- package/cli/lib/close.sh +189 -0
- package/cli/lib/commands.sh +220 -0
- package/cli/lib/common.sh +215 -0
- package/cli/lib/finish.sh +288 -0
- package/cli/lib/github.sh +162 -0
- package/cli/lib/guard.sh +134 -0
- package/cli/lib/handoff.sh +551 -0
- package/cli/lib/host.sh +1802 -0
- package/cli/lib/linear.sh +1389 -0
- package/cli/lib/links.sh +135 -0
- package/cli/lib/merges.sh +853 -0
- package/cli/lib/recipes.sh +54 -0
- package/cli/lib/settings.sh +465 -0
- package/cli/lib/space.sh +343 -0
- package/cli/lib/task.sh +847 -0
- package/cli/lib/tests.sh +268 -0
- package/cli/lib/trust.sh +70 -0
- package/cli/ocnus +630 -0
- package/herdr/README.md +2238 -0
- package/herdr/layouts/default.json +259 -0
- package/herdr/mods/agent-settings/cog.svg +4 -0
- package/herdr/mods/agent-settings/main.js +356 -0
- package/herdr/mods/agent-settings/mod.json +1 -0
- package/herdr/mods/cards/main.js +450 -0
- package/herdr/mods/cards/mod.json +1 -0
- package/herdr/mods/cards/refresh.svg +4 -0
- package/herdr/mods/cpu/main.js +90 -0
- package/herdr/mods/cpu/mod.json +1 -0
- package/herdr/mods/layout-switch/main.js +48 -0
- package/herdr/mods/layout-switch/mod.json +1 -0
- package/herdr/mods/names/main.js +69 -0
- package/herdr/mods/names/mod.json +1 -0
- package/herdr/mods/ocnus-spaces/main.js +376 -0
- package/herdr/mods/ocnus-spaces/mod.json +1 -0
- package/herdr/mods/steps/main.js +354 -0
- package/herdr/mods/steps/mod.json +1 -0
- package/herdr/spaces/template/SPACE.md +19 -0
- package/package.json +27 -4
- package/prompts/task-build.md +11 -0
- package/prompts/task-new.md +17 -0
- package/skills/brief/SKILL.md +64 -0
- package/skills/sdlc-breakdown/SKILL.md +312 -0
- package/skills/sdlc-build/SKILL.md +182 -0
- package/skills/sdlc-define/SKILL.md +203 -0
- package/skills/sdlc-plan/SKILL.md +202 -0
- package/skills/sdlc-pr/SKILL.md +339 -0
- package/skills/sdlc-review/SKILL.md +227 -0
package/herdr/README.md
ADDED
|
@@ -0,0 +1,2238 @@
|
|
|
1
|
+
# herdr
|
|
2
|
+
|
|
3
|
+
Shared setup for the [Herdr](https://herdr.dev) desktop app: mods (panels) and
|
|
4
|
+
a layout (a whole-window arrangement of mods).
|
|
5
|
+
|
|
6
|
+
## What's here
|
|
7
|
+
|
|
8
|
+
| Path | What it is |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `mods/cpu/` | Live CPU usage with a scrolling history. macOS only (reads `/usr/bin/top`). |
|
|
11
|
+
| `mods/layout-switch/` | A dropdown that shows the current layout and switches to another. |
|
|
12
|
+
| `mods/ocnus-spaces/` | The Ocnus spaces panel: every space in your config, open or not. Click one to show it; `+` makes a new one. It is not `spaces`, which is Herdr's own list of the spaces it has open. |
|
|
13
|
+
| `mods/cards/` | The open Linear cards of the space that is showing, under their statuses. Start writes a card up with `task new`; Open shows the tab of a card already started. |
|
|
14
|
+
| `mods/steps/` | The steps of the card whose tab is selected: what each did, how long it took, and how long it waited on you. With no card's tab selected, the space's cards and where each stands. |
|
|
15
|
+
| `mods/agent-settings/` | The settings button, a cog at the right end of the tab bar, and the popup it opens: the model and effort of each phase profile and dev profile, then the breakdown approval, archiving, the tests setting and billing, each of which a click changes. See [The settings button](#the-settings-button). |
|
|
16
|
+
| `mods/names/` | Draws nothing. It gives the spaces and tabs the app takes in from herdr-core, for agents started while the app was closed, the names ocnus gave them. See [Writing the card up](#writing-the-card-up). |
|
|
17
|
+
| `layouts/default.json` | Herdr's own layout with ocnus's panels: the Ocnus spaces panel, the `ocnus-spaces` mod, in place of Herdr's own list of spaces; the layout dropdown, the Cards and Steps panels and the CPU mod in the sidebar; and the settings button beside the tabs. The tab bar is a row of Herdr's `tabs`, `agent-settings` and `names`, in a block 1px wide, since a mod runs only while a layout places it. |
|
|
18
|
+
| `spaces/template/` | The starting `SPACE.md` for every new space. |
|
|
19
|
+
|
|
20
|
+
The skills are in [../skills/](../skills/), outside this folder. They are
|
|
21
|
+
linked into `~/.claude/skills` (`CLAUDE_CONFIG_DIR` picks another `~/.claude`)
|
|
22
|
+
by the same `ocnus install` and `ocnus update`. So are the phase
|
|
23
|
+
profiles in [../agents/](../agents/), into `~/.claude/agents`: the ones
|
|
24
|
+
`task new` and `task build` start `claude` with.
|
|
25
|
+
|
|
26
|
+
## How it works
|
|
27
|
+
|
|
28
|
+
Herdr reads its whole interface from files in `~/.config/herdr-app`. This repo
|
|
29
|
+
holds the mods and the layout we own, and each machine symlinks them into that
|
|
30
|
+
folder. The linked files are the tracked files, so a `git pull` is all it
|
|
31
|
+
takes to update a machine.
|
|
32
|
+
|
|
33
|
+
Per-machine things stay out of the repo: the Herdr account, `settings.json`,
|
|
34
|
+
`keys.json`, and which layout is showing.
|
|
35
|
+
|
|
36
|
+
## Set up a clean machine
|
|
37
|
+
|
|
38
|
+
1. Install Herdr:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
curl -fsSL https://releases.herdr.dev/app/install.sh | sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This installs the Herdr app, herdr-core (which runs the terminals, and so
|
|
45
|
+
is the host of the agent in each tab), and the `herdr-app` and `hc`
|
|
46
|
+
commands in `~/.local/bin`.
|
|
47
|
+
|
|
48
|
+
Put that folder on your `PATH` if it is not there yet; the installer says
|
|
49
|
+
when it is not. ocnus finds both commands in it either way, but these
|
|
50
|
+
docs have you run `hc` yourself, such as `hc server start`. With zsh, the
|
|
51
|
+
shell macOS starts:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
With bash, add the same line to `~/.bashrc` instead. Then open a new
|
|
58
|
+
terminal, where `which hc herdr-app` prints both.
|
|
59
|
+
|
|
60
|
+
2. Open Herdr once and sign in, now or after the next two steps. The first
|
|
61
|
+
start creates `~/.config/herdr-app` and fills it with Herdr's own mods
|
|
62
|
+
and layouts. ocnus links its own mods and layout into that folder, so
|
|
63
|
+
they wait until it is there.
|
|
64
|
+
|
|
65
|
+
3. Install ocnus (needs Node):
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm install -g @johngaynor/ocnus
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
4. Run the installer:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
ocnus install
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
It links every mod and layout into Herdr, every skill into
|
|
78
|
+
`~/.claude/skills` and both phase profiles into `~/.claude/agents`, and
|
|
79
|
+
refreshes Herdr if the app is open. It also makes
|
|
80
|
+
`~/.config/ocnus/settings.json`, the model and effort each of the four
|
|
81
|
+
profiles runs on, with every profile on Opus at `xhigh` effort (see
|
|
82
|
+
[Agent settings](#agent-settings)). It is safe to re-run, and it never
|
|
83
|
+
replaces a real file or someone else's link that is already there, or a
|
|
84
|
+
settings file that is there.
|
|
85
|
+
|
|
86
|
+
The app does not have to be open. With it closed, Herdr reads the links
|
|
87
|
+
when it starts. Before Herdr has been opened, `install` does all of this
|
|
88
|
+
but the mods and layouts, makes nothing in `~/.config/herdr-app`, and says
|
|
89
|
+
so on a line of its own:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
waiting mods and layouts: Herdr has not been opened yet. Open it once, then run: ocnus update
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Once Herdr has been opened, `ocnus update` links them.
|
|
96
|
+
|
|
97
|
+
5. Switch Herdr to the `default` layout, which holds ocnus's panels:
|
|
98
|
+
press `ctrl-shift-l` until it shows. Herdr starts on its own layout, which
|
|
99
|
+
has no Layout dropdown; on `default` the dropdown is at the top of the
|
|
100
|
+
sidebar.
|
|
101
|
+
|
|
102
|
+
## Keeping a machine up to date
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
ocnus update
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This reinstalls the latest ocnus through npm, links any mod, layout, skill
|
|
109
|
+
or phase profile that is new, removes links to ones that were deleted or
|
|
110
|
+
renamed, makes the settings file if it is missing, writes the dev profiles'
|
|
111
|
+
subagents again on a clone (see [Agent settings](#agent-settings)), writes
|
|
112
|
+
and loads again the launchd agent that wakes ocnus's watch on the merges
|
|
113
|
+
when it has changed (see [Hand-offs](#hand-offs)), and
|
|
114
|
+
refreshes Herdr so it re-reads everything, when the app is open. As
|
|
115
|
+
`install` does, it leaves the mods and layouts waiting before Herdr has been
|
|
116
|
+
opened, and links them with the app open or closed once it has.
|
|
117
|
+
|
|
118
|
+
- **Check a machine:** `ocnus status` first says whether herdr-core,
|
|
119
|
+
which runs each agent's terminal, is running. It asks herdr-core alone,
|
|
120
|
+
never the app, so the app being closed is in order:
|
|
121
|
+
|
|
122
|
+
| It says | When | Its exit code |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `herdr-core running` | herdr-core answers. | not changed |
|
|
125
|
+
| `herdr-core not running; ocnus starts it when a task needs it` | herdr-core does not answer. `task new` and `task start` start it. | not changed |
|
|
126
|
+
| `problem`, that Herdr is not installed, with the line that installs it | `herdr-app` or `hc` is neither on your `PATH` nor in `~/.local/bin`. | non-zero |
|
|
127
|
+
|
|
128
|
+
Then it lists each mod, layout, skill and phase profile and whether it is
|
|
129
|
+
linked, and on a clone each dev profile's subagent and whether it is
|
|
130
|
+
written. Before Herdr has been opened, each mod and layout is `waiting`,
|
|
131
|
+
which is in order too, and a line says to open Herdr once, then run
|
|
132
|
+
`ocnus update`. A settings file that is not valid settings is a
|
|
133
|
+
problem it names. After the spaces, under
|
|
134
|
+
`Watch on the merges: ocnus-merges, in herdr-core`, it shows
|
|
135
|
+
ocnus's watch on the merges (see [Hand-offs](#hand-offs)), from the
|
|
136
|
+
files it leaves and the hand-offs, and the launchd agent that brings it
|
|
137
|
+
back after a restart. It never starts either one: it runs no terminal,
|
|
138
|
+
starts no herdr-core and loads nothing into launchd. A card waits when its
|
|
139
|
+
latest hand-off is the `pr` step's question.
|
|
140
|
+
|
|
141
|
+
| It says | When | Its exit code |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `watch`, `running`, how long ago its last pass began, and how many cards wait on their merge | herdr-core runs, and the watch began a pass in the last 3 minutes (`merges/.alive`). | not changed |
|
|
144
|
+
| `watch`, `not running`, and that no card waits on its merge | No card waits, so nothing needs it. | not changed |
|
|
145
|
+
| `problem`, that the watch is not running, or has not begun a pass for how long, with how many cards wait, and to run `ocnus update` | Cards wait, herdr-core runs, and the watch has not begun a pass in the last 3 minutes. `update` wakes it. | non-zero |
|
|
146
|
+
| `problem`, as above, saying that herdr-core is not running and to start it with `hc server start`, then run `ocnus update` | Cards wait, and herdr-core is not running. An update never starts it. With Herdr not installed, it says to install it instead. | non-zero |
|
|
147
|
+
| `problem`, that `gh` needs signing in, with `gh`'s words, and to run `gh auth login` | Cards wait, and the watch's last pass, in the last 3 minutes, found `gh` signed out or its token refused (`merges/.gh`). | non-zero |
|
|
148
|
+
| `note`, that the last pass could not ask GitHub, with `gh`'s words | Cards wait, and the watch's last pass, in the last 3 minutes, could not ask GitHub for another reason, such as the network. It asks again each minute. | not changed |
|
|
149
|
+
| `launchd`, `written`, and the launchd agent's file | `~/Library/LaunchAgents/com.johngaynor.ocnus.merges.plist` is what `install` and `update` would write, given the `PATH` it has: `status` may run with another `PATH` than `update` did. | not changed |
|
|
150
|
+
| `problem`, that the launchd agent is missing or out of date, and to run `ocnus update` | The file is not there, or differs in anything but its `PATH`, such as naming another `ocnus`. | non-zero |
|
|
151
|
+
| `note`, that `launchctl` is not on this machine | The machine has no launchd, so the watch comes back after a restart only when a command wakes it. | not changed |
|
|
152
|
+
|
|
153
|
+
Then it checks your Linear key (see
|
|
154
|
+
[Seeing a space's cards](#seeing-a-spaces-cards)), by asking Linear whose
|
|
155
|
+
it is, and says where the key is set and one of these:
|
|
156
|
+
|
|
157
|
+
| It says | When | Its exit code |
|
|
158
|
+
|---|---|---|
|
|
159
|
+
| `works`, and whose the key is | Linear knows the key. | not changed |
|
|
160
|
+
| `note`, that no Linear key is saved | Neither the env file nor your environment holds one. `task ls` and the Cards panel need one, and so does `task start` unless it is given the card's type and title; save one with `ocnus linear key`. Nothing is asked of Linear. | not changed |
|
|
161
|
+
| `problem`, that Linear rejected the key | Linear does not know the key, or `LINEAR_API_KEY` does not hold a key at all. Make a new key in Linear and save it with `ocnus linear key`. | non-zero |
|
|
162
|
+
| `note`, that the key was not checked, and why | Linear is out of reach, something between this machine and Linear answered for it, or `curl` or `jq` is not installed. It says nothing of the key, which may still work. Linear gets the 20 seconds every Linear command waits for it. | not changed |
|
|
163
|
+
|
|
164
|
+
When the key works, a second line under it says whether the key can change
|
|
165
|
+
cards. It is asked by a change to a card that cannot exist, which changes
|
|
166
|
+
nothing: Linear refuses it to a key without Write permission, and tells a
|
|
167
|
+
key with it that there is no such card. Nothing is asked about writing for
|
|
168
|
+
any other key.
|
|
169
|
+
|
|
170
|
+
| It says | When | Its exit code |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| `writes`, that the key can change cards | Linear said there is no such card. | not changed |
|
|
173
|
+
| `problem`, that the key can read cards but not change them | Linear refused the change for want of Write permission. `task ls`, the Cards panel and `linear read` work, but `linear type`, `linear section`, `linear slices` and `linear move` fail, and the card skills fall back to the agent's own Linear tools. Make a key with Write permission in Linear and save it with `ocnus linear key`. | non-zero |
|
|
174
|
+
| `note`, that this was not checked, and why | Linear went out of reach, something between this machine and Linear answered for it, or Linear's answer said neither. It does not say the key cannot change cards. | not changed |
|
|
175
|
+
|
|
176
|
+
The key itself is never shown.
|
|
177
|
+
|
|
178
|
+
Last, it says which account the agents `task new` and `task build` start
|
|
179
|
+
run on, and whether an Anthropic API key is saved (see [Billing](#billing)),
|
|
180
|
+
under `Billing:` and the settings file's path:
|
|
181
|
+
|
|
182
|
+
| It says | When | Its exit code |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| `mode`, `subscription` or `api`, and what the agents run on | The settings file can be read. From one that cannot, a problem of its own, nothing is said of billing. | not changed |
|
|
185
|
+
| `key`, that an Anthropic API key is saved, and in which file | One is saved in the env file. | not changed |
|
|
186
|
+
| `key`, that none is saved, and the subscription needs none | None is saved, and billing is on the subscription. | not changed |
|
|
187
|
+
| `problem`, that none is saved, so `task new` and `task build` stop before an agent starts | None is saved, and billing is on `api`. Save one with `ocnus billing key`, or go back with `ocnus billing subscription`. An `ANTHROPIC_API_KEY` you export is not a saved key. | non-zero |
|
|
188
|
+
|
|
189
|
+
The Anthropic key is never shown either, and is not checked with Anthropic.
|
|
190
|
+
- **Remove one from a machine:** delete its link in `~/.config/herdr-app/mods`
|
|
191
|
+
or `layouts`. The next `ocnus update` will link it again, so remove it
|
|
192
|
+
from the repo to drop it everywhere.
|
|
193
|
+
- **A folder left behind on a clone:** a mod is linked only while its folder
|
|
194
|
+
has a `mod.json`, and a skill only while its folder has a `SKILL.md`; a
|
|
195
|
+
folder without one is not linked, and `ocnus status` does not list it.
|
|
196
|
+
When a mod is renamed or removed upstream, `git pull` can leave its folder
|
|
197
|
+
behind, holding only the `jsconfig.json` and `gpui-kit.d.ts` that
|
|
198
|
+
`herdr-app check` writes and git ignores. `ocnus update` removes that
|
|
199
|
+
mod's link and says so, and leaves the folder, which you can delete by
|
|
200
|
+
hand. A machine installed through npm never has one, since npm replaces
|
|
201
|
+
the whole package.
|
|
202
|
+
- **Herdr updates itself:** it replaces its own shipped mods and layouts on
|
|
203
|
+
every start and leaves ours alone, because ours have different names. That
|
|
204
|
+
is why the Ocnus spaces panel is the `ocnus-spaces` mod: `spaces` is
|
|
205
|
+
Herdr's own, a real folder in `~/.config/herdr-app/mods`, which
|
|
206
|
+
`ocnus update` leaves as it is.
|
|
207
|
+
- **Something broke the window:** `ctrl-alt-shift-escape` always returns Herdr
|
|
208
|
+
to its own `main` layout.
|
|
209
|
+
|
|
210
|
+
## Spaces
|
|
211
|
+
|
|
212
|
+
A space is a group of repos that opens in Herdr as one space, the word Herdr
|
|
213
|
+
uses for it too. Only the template is in this repo. Your own spaces are in
|
|
214
|
+
`~/.config/ocnus/spaces` (`OCNUS_HOME` picks another
|
|
215
|
+
`~/.config/ocnus`), one folder each:
|
|
216
|
+
|
|
217
|
+
| In a space's folder | What it is |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `SPACE.md` | What the space is and what belongs in each repo. You write this. |
|
|
220
|
+
| `repos` | One repo path per line. `ocnus space add` writes it; you can edit it. |
|
|
221
|
+
| `teams` | The keys of the space's Linear teams, one per line, `#` for comments. `ocnus space team` writes it; you can edit it. See [Seeing a space's cards](#seeing-a-spaces-cards). |
|
|
222
|
+
| `links/` | Generated: a link to each repo, named after its folder. |
|
|
223
|
+
| `tasks/` | One folder per task, holding a worktree of each repo. See [Tasks](#tasks). |
|
|
224
|
+
| `CLAUDE.md`, `AGENTS.md` | Generated: links to `SPACE.md`, so an agent started in the space reads it. |
|
|
225
|
+
|
|
226
|
+
A machine set up before keeps `~/.config/ocnus/projects` and `PROJECT.md`.
|
|
227
|
+
While it has no `spaces` folder, ocnus finds its spaces there, makes a
|
|
228
|
+
new one there too and moves nothing. Each of those spaces has its doc under
|
|
229
|
+
that name, and its `CLAUDE.md` and `AGENTS.md` link to it.
|
|
230
|
+
|
|
231
|
+
- **Make one:** `ocnus space new <name>`, then
|
|
232
|
+
`ocnus space add <name> <path>` for each repo. The repo must already
|
|
233
|
+
be cloned on this machine. Paths after the name add those repos as the
|
|
234
|
+
space is made: `ocnus space new <name> <path>...`. Every one is
|
|
235
|
+
checked first, and a path that is not a repo stops it with nothing made.
|
|
236
|
+
- **Make one in Herdr:** click the `+` at the top of the Ocnus spaces
|
|
237
|
+
panel (on the `default` layout) and choose a repo's folder. The New space
|
|
238
|
+
dialog suggests a name from the folder, lists the repo, and can add more.
|
|
239
|
+
Create makes the space with `ocnus space new` and shows it; whatever
|
|
240
|
+
the command refuses (a name in use, a folder that is not a repo) is shown
|
|
241
|
+
in the dialog.
|
|
242
|
+
- **Open it:** `ocnus space open <name>` rebuilds the links and shows
|
|
243
|
+
the space in Herdr, making Herdr's space for it if it is not open. Herdr's
|
|
244
|
+
space has the space's folder as its folder. A Herdr space with that folder
|
|
245
|
+
is the space's; failing that, so is the one holding a terminal that
|
|
246
|
+
herdr-core labels `ocnus.space=<name>`, as the app's space for agents
|
|
247
|
+
started while it was closed does (see
|
|
248
|
+
[Writing the card up](#writing-the-card-up)), so the space does not get a
|
|
249
|
+
second one. That second look needs `jq`. The app has to be open: with it
|
|
250
|
+
closed, `space open` says to open Herdr and run it again, and changes
|
|
251
|
+
nothing, not even the links.
|
|
252
|
+
- **List them:** `ocnus space ls`. `--json` prints the same list as
|
|
253
|
+
JSON, under the key `spaces`, with each space's folder; the Ocnus
|
|
254
|
+
spaces, Cards and Steps panels read it.
|
|
255
|
+
- **Check them:** `ocnus status` reports a repo that has moved or gone,
|
|
256
|
+
and a `SPACE.md` that is still the template. Delete the template's first
|
|
257
|
+
line once you have filled it in.
|
|
258
|
+
- **Remove a repo:** delete its line from `repos`; the next `open` drops its
|
|
259
|
+
link. To remove a space, close it in Herdr and delete its folder.
|
|
260
|
+
- **The linked repos are shared.** A repo in two spaces is the same clone
|
|
261
|
+
in both, so switching branches in one changes it in the other.
|
|
262
|
+
|
|
263
|
+
## Tasks
|
|
264
|
+
|
|
265
|
+
A task is one piece of work in a space, usually a Linear card. Two
|
|
266
|
+
commands make it, in this order: `task new`, then `task start`, which the
|
|
267
|
+
write-up phase runs for you once you approve the card, unless you hold it.
|
|
268
|
+
Two more, `task handoff` and `task log`, record and show how each step ended.
|
|
269
|
+
`task ls` lists the cards there are to start.
|
|
270
|
+
|
|
271
|
+
### Seeing a space's cards
|
|
272
|
+
|
|
273
|
+
```sh
|
|
274
|
+
ocnus task ls <space> [--json]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
- **It lists the open cards of the space's Linear teams**, under their
|
|
278
|
+
statuses, in the order Linear shows the statuses. Open means not done, not
|
|
279
|
+
cancelled and not a duplicate, so a card In Progress or In Review is listed.
|
|
280
|
+
Each card is its ID and its title, and under each status the card changed
|
|
281
|
+
last comes first. A status with no cards is listed with a count of 0.
|
|
282
|
+
- **It asks Linear itself, with no agent running.** That needs two things, each
|
|
283
|
+
set once:
|
|
284
|
+
|
|
285
|
+
| Set once | With | What it is |
|
|
286
|
+
|---|---|---|
|
|
287
|
+
| Your Linear API key | `ocnus linear key` | Make the key in Linear, under Settings, Account, Security & access, Personal API keys. Read permission is enough to list cards and to read one with `ocnus linear read`; the card skills' writes need Write too (see [Writing the card up](#writing-the-card-up)), and so do the card's moves (see [Starting the work](#starting-the-work)). The command asks for it without showing it, checks it with Linear, and saves it. It also checks whether the key can change cards, as `ocnus status` does: a key that cannot is still saved, and a note after it says so, and that a key with Write permission fixes it. A note says too when that could not be checked. |
|
|
288
|
+
| The space's teams | `ocnus space team <space> <team>...` | A team's key is what its cards' IDs start with: `ABC` for `ABC-122`. A space can name several teams, and several spaces can name the same team. With no team given, the command prints the ones that are set. |
|
|
289
|
+
|
|
290
|
+
- **The key is one of ocnus's variables, `LINEAR_API_KEY`.** `linear key`
|
|
291
|
+
writes it as a line of ocnus's env file, `~/.config/ocnus/.env`,
|
|
292
|
+
which only you can read. A key you export in your shell works too, and wins
|
|
293
|
+
over the file. See [ocnus's variables](#ocnuss-variables).
|
|
294
|
+
- **The key is never shown.** It is handed to `curl` on its stdin, never as an
|
|
295
|
+
argument, and no message prints it. To take it off the machine, delete its
|
|
296
|
+
line from the env file.
|
|
297
|
+
- **`ocnus status` checks the key** each time it runs, by asking Linear
|
|
298
|
+
whose it is. It says when the key works, when none is saved, when Linear
|
|
299
|
+
rejects it, and when it could not be checked. For a key that works, it also
|
|
300
|
+
checks whether the key can change cards, with a change that changes
|
|
301
|
+
nothing. A rejected key and a key that cannot change cards make it exit
|
|
302
|
+
non-zero. See
|
|
303
|
+
[Keeping a machine up to date](#keeping-a-machine-up-to-date).
|
|
304
|
+
- **When it cannot list, it says which thing is wrong:** no key saved, a key
|
|
305
|
+
Linear rejects, Linear out of reach, something between this machine and
|
|
306
|
+
Linear answering for it (a proxy's or a firewall's page), a space with no
|
|
307
|
+
team, a `teams` file it cannot read, a line of that file that is not a team
|
|
308
|
+
key, or a team key Linear does not have.
|
|
309
|
+
- **The `teams` file can be edited by hand.** Keys may be in lower case, a `#`
|
|
310
|
+
starts a comment, and blank lines and white space are skipped. A line that is
|
|
311
|
+
still not a team key is named in the message.
|
|
312
|
+
- **A list it cannot fetch whole is not printed.** If Linear says it has more
|
|
313
|
+
cards but not where they start, the command fails rather than list part of
|
|
314
|
+
them. A card that comes on two pages is listed once, and a card in a status
|
|
315
|
+
Linear did not name up front is listed under that status.
|
|
316
|
+
- **In the plain list, control characters in titles become spaces**, so a title
|
|
317
|
+
cannot start what looks like another card or send escape sequences to your
|
|
318
|
+
terminal. `--json` keeps the text as Linear gave it.
|
|
319
|
+
- **Your `~/.curlrc` is not read**, so a line there such as `--fail` cannot
|
|
320
|
+
change what ocnus reads back. A proxy set in the environment, such as
|
|
321
|
+
`HTTPS_PROXY`, is still used.
|
|
322
|
+
- **`--json` prints the list as one line for programs**: the space, under the
|
|
323
|
+
key `space`, its teams, and each status with its `name`, its `type`
|
|
324
|
+
(`triage`, `backlog`, `unstarted` or `started`) and its `cards`, each with an
|
|
325
|
+
`id`, a `title` and a `url`. When it fails it prints nothing on stdout.
|
|
326
|
+
- **Two teams' cards share a group when their statuses have the same name and
|
|
327
|
+
the same type**, such as a Backlog of type `backlog` in each. A status only
|
|
328
|
+
one team has is a group of its own, and so is one whose name another team
|
|
329
|
+
gives to a status of another type.
|
|
330
|
+
- **It needs `curl` and `jq`**, and says which is missing.
|
|
331
|
+
|
|
332
|
+
### Writing the card up
|
|
333
|
+
|
|
334
|
+
```sh
|
|
335
|
+
ocnus task new <space> <card>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
- **The card is its ID**, like `ABC-122`. Upper or lower case both work.
|
|
339
|
+
- **It opens a tab named after the card** in the space, in the space's
|
|
340
|
+
folder, and starts an agent in it for the write-up phase. The
|
|
341
|
+
harness is `claude`; `OCNUS_HARNESS` picks another command.
|
|
342
|
+
- **The Herdr app does not have to be open.** The tab is a terminal in
|
|
343
|
+
herdr-core, which runs it whether or not the app's window is open:
|
|
344
|
+
- **With the app open**, the app opens the tab, as it always has.
|
|
345
|
+
- **With the app closed**, `task new` starts the terminal in herdr-core
|
|
346
|
+
itself, with `hc run --bg --keep --no-parent`, in the space's folder,
|
|
347
|
+
and prints its address and `hc attach <address>`, which shows it in the
|
|
348
|
+
terminal you run that in. Its command is the one a tab the app opens
|
|
349
|
+
has: your login shell (`$SHELL`, else `/bin/sh`) runs the agent, then
|
|
350
|
+
takes its place, so the terminal is left with a shell when the agent
|
|
351
|
+
ends. `--no-parent` keeps the agent running when the terminal you ran
|
|
352
|
+
`task new` in is closed.
|
|
353
|
+
- **Opening the app shows it as a tab**, since the terminal carries
|
|
354
|
+
Herdr's own labels, `herdr.space=<id>` and `herdr.tab=<id>`. The space's
|
|
355
|
+
id is the one a terminal of the space already has: first one labelled
|
|
356
|
+
`ocnus.space=<space>`, then one whose folder is in the space's
|
|
357
|
+
folder, as the app's own tabs there are. A space with neither gets a new
|
|
358
|
+
id, which the app shows as a new space. The tab's id is always new.
|
|
359
|
+
Finding the space's id needs `jq`; without it, the id is new.
|
|
360
|
+
- **The `names` mod names them**, once the app has taken them in. The app
|
|
361
|
+
calls a space or tab it makes of an id it does not know by its own names:
|
|
362
|
+
a space after where its first terminal is, a tab after its place. The
|
|
363
|
+
mod renames such a tab to its terminal's `ocnus.tab` label, the
|
|
364
|
+
card, and such a space to its `ocnus.space` label, the space's name.
|
|
365
|
+
It renames only a space or tab nobody has named, so a name you give
|
|
366
|
+
stays, and asks for each name once while it runs, so one you give
|
|
367
|
+
Herdr's own name again keeps it. It runs while a layout places it, and
|
|
368
|
+
the `default` layout does, in the tab bar. The Cards panel finds a
|
|
369
|
+
card's tab in the Herdr space whose folder is the space's, as it always
|
|
370
|
+
has.
|
|
371
|
+
- **Closing or quitting the app stops no agent.** herdr-core keeps the
|
|
372
|
+
terminal running, and opening the app again shows the tab again, in the
|
|
373
|
+
same space.
|
|
374
|
+
- **Each agent's terminal is labelled**, however it was opened:
|
|
375
|
+
`ocnus.space=<space>`, `ocnus.card=<card>` and
|
|
376
|
+
`ocnus.tab=<card>`, the tab's name. `hc ls --label
|
|
377
|
+
ocnus.space=<space>` lists a space's agents. When the app opens the tab
|
|
378
|
+
and its terminal cannot be labelled, a note says so, and the agent runs as
|
|
379
|
+
it is.
|
|
380
|
+
- **herdr-core is started when it is not running**, with `hc server start`,
|
|
381
|
+
and `task new` says so and goes on. It starts without the variables of a
|
|
382
|
+
Claude Code session that `task new` was run from (see
|
|
383
|
+
[ocnus's variables](#ocnuss-variables)). When Herdr is not
|
|
384
|
+
installed, which is `herdr-app` or `hc` not found, it stops with Herdr's
|
|
385
|
+
install line. When herdr-core does not start, it stops with what `hc` said,
|
|
386
|
+
and says to run `hc server start`. Either way it stops before anything is
|
|
387
|
+
opened.
|
|
388
|
+
- **`claude` starts with the write-up phase profile**,
|
|
389
|
+
[../agents/ocnus-write-up.md](../agents/ocnus-write-up.md), linked
|
|
390
|
+
into `~/.claude/agents`, on the `write-up` profile's model and effort:
|
|
391
|
+
`env -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN claude
|
|
392
|
+
--agent=ocnus-write-up --strict-mcp-config
|
|
393
|
+
--mcp-config=<repo>/agents/linear-mcp.json --model=opus --effort=xhigh`.
|
|
394
|
+
`env` keeps the two variables out, so the agent runs on your Claude
|
|
395
|
+
subscription (see [ocnus's variables](#ocnuss-variables)). With
|
|
396
|
+
billing on `api`, `--settings=` and an `apiKeyHelper` come after
|
|
397
|
+
`--effort=`, and the agent runs on the Anthropic API key you saved instead
|
|
398
|
+
(see [Billing](#billing)).
|
|
399
|
+
The profile gives the session only the tools the write-up phase uses, the
|
|
400
|
+
MCP config gives it Linear's server alone, whatever your own sessions have,
|
|
401
|
+
and the model and effort are the ones `~/.config/ocnus/settings.json`
|
|
402
|
+
names for the `write-up` profile, which beat your own Claude Code settings
|
|
403
|
+
(see [Agent settings](#agent-settings)). Claude Code asks once to sign in to
|
|
404
|
+
Linear as `linear-server` on a machine where it is not signed in under that
|
|
405
|
+
name. Another harness starts as it is, with no profile, model or effort.
|
|
406
|
+
- **The space's folder is trusted first.** Claude Code asks "do you trust this
|
|
407
|
+
folder?" the first time it starts somewhere, which would leave the agent
|
|
408
|
+
waiting. So `space new`, and `task new` before it opens the tab, mark the
|
|
409
|
+
space's folder as trusted in Claude Code's own file (`~/.claude.json`).
|
|
410
|
+
Only a space folder ocnus made is marked: never a repo, and not a
|
|
411
|
+
space folder you linked in from somewhere else. Where it cannot be done
|
|
412
|
+
(no `jq`, or Claude Code has never run on the machine), ocnus says so
|
|
413
|
+
and Claude Code asks once.
|
|
414
|
+
- **The agent's first message** is [prompts/task-new.md](../prompts/task-new.md)
|
|
415
|
+
with the card and space filled in. It tells the agent to start with
|
|
416
|
+
`sdlc-define` and follow each skill's handoff block to the next
|
|
417
|
+
(`sdlc-plan`, then `sdlc-breakdown`), in that one session, and to wait for
|
|
418
|
+
your approval at the end, then start the build phase unless you hold it.
|
|
419
|
+
With the breakdown approval off, it tells the agent that `sdlc-breakdown`
|
|
420
|
+
approves a card it has no doubt about by itself, and that the agent then
|
|
421
|
+
runs `task start` as for an approval to start now (see
|
|
422
|
+
[The breakdown approval](#the-breakdown-approval)). Edit that file to change
|
|
423
|
+
what the agent is told.
|
|
424
|
+
- **Your approval moves the card.** Once you approve it, and its sub-issues
|
|
425
|
+
exist when it was sliced, the agent records the approval, and recording it
|
|
426
|
+
moves the card in Linear to its team's first not-started status (Todo in
|
|
427
|
+
Lab, Ready for Dev in PHY), and each of its sub-issues with it, by its own
|
|
428
|
+
team's statuses (see [Hand-offs](#hand-offs)). A card already further
|
|
429
|
+
along, done or canceled stays where it is. When a card cannot be moved, the
|
|
430
|
+
approval is still recorded, and the agent tells you which card, and why.
|
|
431
|
+
With the breakdown approval off, an approval the setting gave, on a card
|
|
432
|
+
the agent has no doubt about, moves the card the same way, and its summary
|
|
433
|
+
says that the setting gave it.
|
|
434
|
+
- **Your approval starts the build phase, unless you hold it.** The approval
|
|
435
|
+
asks whether to start the build phase now. With `approve and start`, or any approval
|
|
436
|
+
that does not hold it back, the agent runs `ocnus task start` itself
|
|
437
|
+
once the approval is recorded (see [Starting the work](#starting-the-work)),
|
|
438
|
+
and the task's new tab opens, in the Herdr app, or in herdr-core while the
|
|
439
|
+
app is closed, as when you run it yourself. For a card
|
|
440
|
+
that was sliced, it starts the first sub-issue that is not already started,
|
|
441
|
+
done or canceled. With `approve, start later`, or an approval that holds it
|
|
442
|
+
back in other words, the approval is the same and moves the card the same
|
|
443
|
+
way, but the agent gives you the command to run when you want the build
|
|
444
|
+
phase to start. The agent passes on what `task start` says still needs you, such as
|
|
445
|
+
a repo Claude Code will ask about trusting. When `task start` stops, the
|
|
446
|
+
agent does not run it again: it tells you what it said and what to run once
|
|
447
|
+
that is fixed. `task log` shows which you chose, in your answer and the
|
|
448
|
+
approval's summary. A started task adds a `start` row under the card it
|
|
449
|
+
started, which for a sliced card is the sub-issue, so it is in that
|
|
450
|
+
sub-issue's log. With the breakdown approval off, the agent asks you
|
|
451
|
+
nothing on a card it has no doubt about: the setting's approval is one to
|
|
452
|
+
start now, so it runs `task start` itself. A card it has a doubt about still
|
|
453
|
+
waits for your answer.
|
|
454
|
+
- **The write-up session is put away once the build phase starts.** The
|
|
455
|
+
approval itself closes nothing. Once `task start` has opened the build tab,
|
|
456
|
+
the write-up agent's session ends when its turn does, and its tab closes
|
|
457
|
+
(see [Putting the write-up away](#putting-the-write-up-away)). So with
|
|
458
|
+
`approve and start`, the agent passes on what `task start` said in the turn
|
|
459
|
+
that ran it, and asks nothing after. With `approve, start later`, the
|
|
460
|
+
session stays open until you run `task start`, from any terminal. When
|
|
461
|
+
`task start` stops, it stays open, and the agent says what to run next.
|
|
462
|
+
- **It makes no branch, worktree or task folder.** The card has no type until
|
|
463
|
+
the agent has defined it, and the type is the start of the branch name.
|
|
464
|
+
- **It checks first.** An unknown space, something that is not a card ID,
|
|
465
|
+
Herdr not installed, herdr-core not running and not starting (see above),
|
|
466
|
+
no harness on your `PATH`, the skills not linked into
|
|
467
|
+
`~/.claude/skills`, or, for `claude`, the write-up phase profile not linked
|
|
468
|
+
into `~/.claude/agents` stops it before anything is opened. Run
|
|
469
|
+
`ocnus update` to link them. So does a settings file that is not valid
|
|
470
|
+
settings, for `claude`, saying what in it is wrong.
|
|
471
|
+
- **With a Linear key saved, it checks that Linear has the card**, so a
|
|
472
|
+
mistyped ID stops it before an agent starts. It looks the card up by its
|
|
473
|
+
team's key and number, so it does not check that the card is one of the
|
|
474
|
+
space's teams. Only a definite no stops it: with no key saved, Linear is
|
|
475
|
+
not asked, and when Linear cannot be asked (the network, a rejected key, no
|
|
476
|
+
`curl` or `jq`), the card starts as before, with a note saying why.
|
|
477
|
+
- **The skills read and write the card through ocnus.** The agent reads
|
|
478
|
+
the card with one ocnus command, and sets the type, writes each section
|
|
479
|
+
and makes a sliced card's sub-issues with three more, so the read and the
|
|
480
|
+
writes go the same way on every run. A fifth, which `sdlc-pr` runs once its
|
|
481
|
+
pull requests are open, moves the card (see [Hand-offs](#hand-offs)). The
|
|
482
|
+
agent's own Linear tools are for when ocnus cannot read or write the
|
|
483
|
+
card, and for other reads, such as a related card:
|
|
484
|
+
|
|
485
|
+
| Command | What it does |
|
|
486
|
+
|---|---|
|
|
487
|
+
| `ocnus linear read <card> [--json]` | Prints the card whole: its ID and title, then its status, labels, parent and Linear project (each when it has one) and URL, the description with its sections as written, each comment with who wrote it and when, oldest first, and each sub-issue with its ID, status and title. A comment an app made is the app's. Control characters become spaces, as in `task ls`, but the description and the comments keep their line breaks. `--json` prints the same as one line for programs such as a mod, with the text as Linear gave it: `{"id", "title", "url", "status": {"name", "type"}, "type", "labels", "parent": {"id", "title"}, "project": {"name"}, "description", "comments": [{"author", "createdAt", "body"}], "subIssues": [{"id", "title", "status": {"name", "type"}}]}`. `type` is the card's label in the `Type` group, `labels` the names of all its labels, and `type`, `parent` and the Linear project are `null` when the card has none. A card with more than 100 comments, 50 sub-issues or 100 labels is not printed, since what was read would pass for the whole: the command says so and exits non-zero. When it fails it prints nothing on stdout. It needs only Read permission. |
|
|
488
|
+
| `ocnus linear type <card> <feat\|fix\|chore>` | Sets the card's type: its one label in the `Type` label group, the team's or else the workspace's. Any other type comes off; the card's other labels are never touched. A missing label is refused, never made. |
|
|
489
|
+
| `ocnus linear section <card> <Specification\|Plan\|Breakdown\|Review> [--replace]` | Adds the section, its body on stdin, below the description. Specification, Plan and Review are folded away, in the form Linear keeps them in, `+++ ## <name>` … `+++` (one written as `>>>` is read the same); the Breakdown is left open, because you read it to approve the card. The Review, which the review step writes, comes after the Breakdown, and each later round puts its own in the last one's place with `--replace`. A section of that name already there is refused, unless `--replace` puts the new one in its place; `--replace` with none there is refused too. A body is refused when a line in it would end the section early or start a second one: a fold line, and in the Breakdown a `#` or `##` heading. A line inside a fenced code block is never taken for a section. |
|
|
490
|
+
| `ocnus linear slices <card>` | Makes the card's slices, given on stdin, as its sub-issues, in order: for each slice a line `<n>. <name>`, and its description indented below it. Each is made in the card's team, with the name as its title, the description, and the card's type, its one label in the `Type` group; each but the first is marked as blocked by the slice before it. It prints a line for each slice, `Slice <n> of <total>: <ID> <name>`, saying whether it was made or was there already. A slice is there already when the card has a sub-issue with its name as its title, exactly: it is left as it is, and only its blocker is added when it lacks one. So a run that stopped partway, which says what it made and why it stopped, is finished by running it again with the same slices, and no slice is made twice. Any other sub-issue of the card is named, and left alone. It makes nothing when the slices are fewer than two, numbered out of order, of one name twice or without a description, or when the card has no type or more than one, is itself a sub-issue, has more than 50 sub-issues, or has two sub-issues of one slice's name. |
|
|
491
|
+
| `ocnus linear move <card> <approved\|started\|review\|done>` | Moves the card forward to its team's first not-started status (Todo in Lab, Ready for Dev in PHY), its first started status (In Progress), its last started one (In Review), or its first completed one (Done), picked by its kind and its place in the team's order, not by its name. `approved` moves each of the card's sub-issues after it the same way, by its own team's statuses, and is the move your approval makes. For a slice, `started` and `done` move the card it was sliced from after it the same way: `started` as `task start` does, and `done` as the merge does, only once the slice is closed and every other sub-issue of that card is closed too, done, canceled or a duplicate. While any is open the parent stays where it is, and the command names the open ones, as `ABC-100 stays in In Progress: 2 of its 3 slices are still open (ABC-123, ABC-124)`, and exits zero. A parent with more than 50 sub-issues is not moved, since one it did not read may be open, and neither is the parent of a slice that was not moved. In a team with one started status, `review` is that status. A card already there, further on, done or canceled stays where it is, and the command says so and exits zero. A move that cannot be made, such as with Linear out of reach or a key without Write permission, exits non-zero, saying which card was not moved and why; the other cards still move. |
|
|
492
|
+
|
|
493
|
+
The four that write read back what Linear saved before they say they are
|
|
494
|
+
done: one type, the one asked for; the section there once, and the text
|
|
495
|
+
above it as it was; each slice made a sub-issue of the card, with the
|
|
496
|
+
slice's name and the card's type, and each blocker added; the card in the
|
|
497
|
+
status it was moved to. All four need your key to have Write permission.
|
|
498
|
+
With no key saved, or a key Linear rejects, the skills read the card, and
|
|
499
|
+
write the type and the sections and make the slices, with the agent's
|
|
500
|
+
Linear tools instead, and say so in the hand-off's flags; the card is not
|
|
501
|
+
moved then, and `sdlc-pr` says so. `sdlc-review` writes the Review with
|
|
502
|
+
them, and `sdlc-breakdown` the Breakdown and the slices, when Linear answers
|
|
503
|
+
the write with an error too, as it does for a key without Write permission.
|
|
504
|
+
|
|
505
|
+
### The Cards panel
|
|
506
|
+
|
|
507
|
+
On the `default` layout, the Cards panel under the Ocnus spaces panel
|
|
508
|
+
shows the open cards of the space that is showing, each with a button that
|
|
509
|
+
writes the card up. Each card is under its status in Linear, which shows where
|
|
510
|
+
its work is: your approval moves a card and its sub-issues to Todo,
|
|
511
|
+
`task start` moves it to In Progress, opening its pull requests moves it to In
|
|
512
|
+
Review, and recording its merge moves it to Done, which takes it off the list
|
|
513
|
+
(see [Starting the work](#starting-the-work)). A sliced card follows its
|
|
514
|
+
slices: to In Progress when the first starts, and to Done once the last
|
|
515
|
+
has merged.
|
|
516
|
+
|
|
517
|
+
- **It shows what `task ls` lists**: the same statuses in the same order, each
|
|
518
|
+
with its count, and the cards under them. A click on a status closes its
|
|
519
|
+
group, and another opens it again. Which groups are closed is kept between
|
|
520
|
+
starts of Herdr.
|
|
521
|
+
- **Start runs `ocnus task new <space> <card>`**, so the card's tab
|
|
522
|
+
opens in the space with the agent running. One card starts at a
|
|
523
|
+
time. The button reads Starting… until the command is done, and if the
|
|
524
|
+
command fails, a notification shows what it said.
|
|
525
|
+
- **A card whose tab is open reads Open**, and a click shows that tab rather
|
|
526
|
+
than starting the card a second time. A tab is the card's when it is named
|
|
527
|
+
after the card's ID, as `task new` names it.
|
|
528
|
+
- **A card whose agent is stuck or has stopped has a mark**, a `!` before its
|
|
529
|
+
button, with what `task log` says about the agent in its tooltip, such as
|
|
530
|
+
agent waiting on a permission prompt (see [Hand-offs](#hand-offs)). So
|
|
531
|
+
does a card whose pull requests wait on you while one is closed or in
|
|
532
|
+
conflict with no agent running to wake, or while nothing is watching
|
|
533
|
+
them, with what `task log` says, such as
|
|
534
|
+
`acme/api#7 in conflict, no agent running`. The
|
|
535
|
+
panel reads `ocnus task log <space> --json` after each read of the
|
|
536
|
+
cards, every 6 seconds, and as soon as Herdr's tabs in the space change,
|
|
537
|
+
so a change shows within 5 seconds while the window is visible. When
|
|
538
|
+
`task log` cannot say, no card is marked.
|
|
539
|
+
- **When the cards cannot be listed, the panel shows why**, in the words of
|
|
540
|
+
`task ls`: no Linear key saved, a space with no team, Linear out of reach.
|
|
541
|
+
A Herdr space that is not one of ocnus's spaces says so.
|
|
542
|
+
- **It reads the cards again** when another space is shown, about once a
|
|
543
|
+
minute while the window is visible, and when the refresh button above the
|
|
544
|
+
list is clicked.
|
|
545
|
+
- **It works nothing out itself.** The space comes from
|
|
546
|
+
`ocnus space ls --json`, the cards from
|
|
547
|
+
`ocnus task ls <space> --json` and each card's agent from
|
|
548
|
+
`ocnus task log <space> --json`, so the panel and the commands always
|
|
549
|
+
agree. It needs what `task ls` needs: the Linear key and the
|
|
550
|
+
space's teams.
|
|
551
|
+
- **On the sidebar's narrow rail**, each card shows as its number, and a click
|
|
552
|
+
does what its button would. The number of a card whose agent is stuck or
|
|
553
|
+
has stopped is in the mark's colour, and its tooltip says what `task log`
|
|
554
|
+
says.
|
|
555
|
+
|
|
556
|
+
### Hand-offs
|
|
557
|
+
|
|
558
|
+
Each step of the write-up phase ends by handing off: which step it was, how it
|
|
559
|
+
ended (`done`, `needs-human` or `failed`) and what comes next. Breakdown, the
|
|
560
|
+
last of them, hands off `done` with `start` next once you approve the card,
|
|
561
|
+
or once the setting does, with the breakdown approval off (see below):
|
|
562
|
+
the next step is `ocnus task start`, which the agent runs, or gives
|
|
563
|
+
you to run when you chose to start later. Recording that hand-off moves the card in Linear to its team's first not-started status (Todo
|
|
564
|
+
in Lab, Ready for Dev in PHY), and each of its sub-issues with it, by its own
|
|
565
|
+
team's statuses. What happened to each card is said on stderr; when one cannot
|
|
566
|
+
be moved, the hand-off is still recorded, the note names each card that was
|
|
567
|
+
not moved and why, and the agent tells you. Each card that was not moved is
|
|
568
|
+
added to the hand-off's flags too, after any the agent gave, so `task log`
|
|
569
|
+
shows it under the breakdown row, as `flags:`; an approval that moves every
|
|
570
|
+
card adds nothing. The build phase hands off too. The
|
|
571
|
+
build step, which the `sdlc-build` skill runs in a started task, hands off as
|
|
572
|
+
`build`, `done` only when the tests pass, with `review` next. So does the
|
|
573
|
+
review step after it, which the `sdlc-review` skill runs: it hands off as
|
|
574
|
+
`review`, `done` with `pr` next when every Done when item is met, or with
|
|
575
|
+
`build` next, naming each item that is not. Once it has sent the work back, it
|
|
576
|
+
asks you instead, as `needs-human`, whether to build again. So does the pr
|
|
577
|
+
step after that, which the `sdlc-pr` skill runs: it hands off as `pr`. Once
|
|
578
|
+
every pull request for the card is open, it moves the card in Linear to its
|
|
579
|
+
team's last started status (In Review) with
|
|
580
|
+
`ocnus linear move <card> review`; in a team with one started status the
|
|
581
|
+
card stays in it. When the card cannot be moved, it still goes on, and says
|
|
582
|
+
so, and why, in its hand-offs. With the pull requests open it waits as
|
|
583
|
+
`needs-human`, with their links, while you merge them, and runs no watch of
|
|
584
|
+
its own, so you don't have to tell it they have merged. A change you ask for
|
|
585
|
+
in the tab instead goes on the task's branch and into the same pull
|
|
586
|
+
requests, and it waits as `needs-human` again. Telling it they have merged
|
|
587
|
+
has it record your answer and wait as `needs-human` again, saying that
|
|
588
|
+
ocnus's watch records the merge within a minute; it records no merge
|
|
589
|
+
itself. Once GitHub says every pull request for the card has merged,
|
|
590
|
+
ocnus's watch on the merges (see below) records that as your answer,
|
|
591
|
+
`answered`, so the log shows how long the pull requests waited on you, and
|
|
592
|
+
then `done` with `merged` next. Recording that hand-off moves the card in
|
|
593
|
+
Linear to its team's first completed status (Done), whatever recorded it. A
|
|
594
|
+
card that is done or canceled already stays as it is. For a slice, it then
|
|
595
|
+
moves the card it was sliced from to Done too, once every one of that card's
|
|
596
|
+
sub-issues is closed; while any is open, that card stays where it is and the
|
|
597
|
+
note names the open ones. With
|
|
598
|
+
archiving on (see [Archiving merged cards](#archiving-merged-cards)), it then
|
|
599
|
+
archives the card in Linear, and every other done, canceled or duplicate card
|
|
600
|
+
of the space's teams, a sliced card with its slices once all of them are
|
|
601
|
+
closed; a card that is not archived is a note naming it and why, and the
|
|
602
|
+
hand-off is recorded either way. When a pull
|
|
603
|
+
request is closed without merging, ocnus's watch wakes the agent, which
|
|
604
|
+
records that as the answer and asks you whether to stop, and the card is not
|
|
605
|
+
moved. When one is in conflict with its default branch, ocnus's watch
|
|
606
|
+
wakes the agent, which records that the same way and brings it up to date
|
|
607
|
+
without asking you: it merges the default branch in, never by a rebase, fixes what the
|
|
608
|
+
tests find, commits the merge and hands off `done` with `review` next. The
|
|
609
|
+
review step checks each Done when item again, with the merge, and hands back
|
|
610
|
+
to `pr`, which pushes only the branch that moved, never forced, adds a
|
|
611
|
+
**Brought up to date:** line to its pull request's description, with the files
|
|
612
|
+
that conflicted and what the fix changed, and waits as `needs-human` again. It
|
|
613
|
+
asks you about a conflict, as `needs-human` naming the pull request and the
|
|
614
|
+
files in conflict, only when the tests cannot be made to pass or the fix would
|
|
615
|
+
change what a Done when item says, and pushes nothing until you answer. What
|
|
616
|
+
happened to the card is said on stderr, so the block printed is the one
|
|
617
|
+
recorded; when the card cannot be moved, the hand-off is still recorded, and
|
|
618
|
+
the note says why. Right after the merge, ocnus's watch finishes the
|
|
619
|
+
task with `ocnus task finish` (see
|
|
620
|
+
[Finishing a task](#finishing-a-task)): its worktrees, its branch in each repo
|
|
621
|
+
and its folder go, and then its tab closes. When that would lose work, it
|
|
622
|
+
removes nothing, and the watch leaves the task as it is, with everything it
|
|
623
|
+
named on the merge's flags. A pull request closed without merging finishes
|
|
624
|
+
nothing either: the agent asks you whether to stop. When it cannot push or open a pull
|
|
625
|
+
request, such as when `gh` is not signed in or a repo has no remote, it hands
|
|
626
|
+
off `failed` with the reason. `merged` is where a card ends: it is only ever
|
|
627
|
+
next, and `task handoff` refuses it in the `step:` line, which names the step
|
|
628
|
+
a hand-off is for. It does the same with `start`, since only `task start`
|
|
629
|
+
records that step. The agent records each hand-off itself, with the block on
|
|
630
|
+
stdin:
|
|
631
|
+
|
|
632
|
+
```sh
|
|
633
|
+
ocnus task handoff <space> <card> <<'EOF'
|
|
634
|
+
step: define
|
|
635
|
+
status: done
|
|
636
|
+
next: plan
|
|
637
|
+
summary: Set the type to fix. The Specification has six Done when items.
|
|
638
|
+
EOF
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
```sh
|
|
642
|
+
ocnus task log <space> [<card>]
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
- **The command holds the rules.** It refuses a block with a missing line, an
|
|
646
|
+
unknown status or step, a line that doesn't belong to that status, or a
|
|
647
|
+
value that runs onto a second line, and says what to fix. A block from an
|
|
648
|
+
agent that started before the step's line was called `step:` is refused
|
|
649
|
+
once, with `step:` to write in its place. Run it with no block to see the
|
|
650
|
+
rules.
|
|
651
|
+
- **It is a command because wording wasn't enough.** An agent going from one
|
|
652
|
+
skill straight into the next writes nothing in between, but it does run
|
|
653
|
+
commands.
|
|
654
|
+
- **`task new` records the start,** so the time each step took can be read
|
|
655
|
+
from the hand-offs alone.
|
|
656
|
+
- **`task start` records a start too,** as `start` in the log, with `build`
|
|
657
|
+
next, so the build phase's first step is timed from it and not from your
|
|
658
|
+
approval. It is the step breakdown named, so the log reads
|
|
659
|
+
`breakdown done, then start` and then `start done, then build`. A
|
|
660
|
+
hand-off recorded before the step was called `start` keeps the name it was
|
|
661
|
+
recorded with, `setup`. Like the start of the write-up phase it shows as
|
|
662
|
+
started, with no time, but it begins no new run: the Steps panel shows the
|
|
663
|
+
write-up phase and the build phase of a card together. Its flags are the
|
|
664
|
+
notes `task start` printed that still need you, joined by `; `, such as
|
|
665
|
+
where the branch's type and title came from, a repo Claude Code will ask
|
|
666
|
+
about trusting, a terminal it could not label, or a card it could not move
|
|
667
|
+
in Linear. So `task log` shows them under the start row, as `flags:`, and in
|
|
668
|
+
`--json`, whoever ran `task start`, once the tab that printed them has
|
|
669
|
+
gone. A `task start` with no such notes records no flags.
|
|
670
|
+
- **ocnus's watch records the merge.** It is the only watch on the
|
|
671
|
+
pull requests: no agent runs one of its own. It is one
|
|
672
|
+
terminal in herdr-core, called `ocnus-merges`, running
|
|
673
|
+
`ocnus task merges`; `hc attach ocnus-merges` shows it. It has no
|
|
674
|
+
labels, so the app shows no tab for it and the host recorder does not count
|
|
675
|
+
it as an agent, and no parent, so it goes on when the tab that woke it
|
|
676
|
+
closes. `task handoff` wakes it once it records a `pr` `needs-human`, and
|
|
677
|
+
`task new`, `task start`, `task build` and `ocnus update` wake it too,
|
|
678
|
+
the last for cards that were waiting before it was there. So does a launchd
|
|
679
|
+
agent, `~/Library/LaunchAgents/com.johngaynor.ocnus.merges.plist`,
|
|
680
|
+
which `ocnus install` and `update` write and load: launchd runs
|
|
681
|
+
`ocnus task merges --wake` once it is loaded, as at login, and every
|
|
682
|
+
minute after, so after a restart the watch is back within a minute of
|
|
683
|
+
herdr-core starting, however herdr-core was started, and a watch that died
|
|
684
|
+
comes back the same way. herdr-core cannot bring it back itself: `--keep`
|
|
685
|
+
puts a shell in place of a lost program and never runs it again. Each wake
|
|
686
|
+
starts it only while a card waits on its merge and herdr-core is running:
|
|
687
|
+
it never starts herdr-core, and while one runs a second is not started.
|
|
688
|
+
Every minute, it reads the store for each card, in any space, whose latest
|
|
689
|
+
hand-off is `pr`
|
|
690
|
+
`needs-human`, however long ago, and asks GitHub about the pull requests of
|
|
691
|
+
every such card in one call, with `gh api graphql`, however many cards wait
|
|
692
|
+
and in however many spaces and repos (past 100 worktrees, in calls of 100).
|
|
693
|
+
It names each worktree's repo by its `origin` on GitHub, and only a
|
|
694
|
+
branch's newest pull request counts. A
|
|
695
|
+
repo that GitHub answers with an error, or a worktree whose origin is not on
|
|
696
|
+
GitHub, leaves only its own card as it is, and `task log` says why. It
|
|
697
|
+
records the card's merge, as your answer
|
|
698
|
+
(`merged on GitHub, seen by ocnus's watch`) and then `done` with
|
|
699
|
+
`merged` next, naming each pull request, once every one has merged and the
|
|
700
|
+
agent is not busy: the task's tab is closed, its shell is back in the
|
|
701
|
+
foreground, or its agent is idle, its turn over, which needs no turn from
|
|
702
|
+
it. It leaves the card alone while a pull request is open, closed without
|
|
703
|
+
merging or in conflict, and while the agent is busy or runs a program that
|
|
704
|
+
reports no status, which a later pass looks at again; it pushes nothing.
|
|
705
|
+
Recording the merge moves the card to Done, and a card that could not be
|
|
706
|
+
moved is added to the merge's flags, so `task log` shows why. Then it
|
|
707
|
+
finishes the task, which no agent does: it ends an idle agent in the tab
|
|
708
|
+
with `/exit`, as `task close`
|
|
709
|
+
does, never killing it, then runs `task finish`. A task it cannot finish is
|
|
710
|
+
left as it is, with `task not finished: …` on the merge's flags (see
|
|
711
|
+
[Finishing a task](#finishing-a-task)). It runs itself again after each minute, so each check
|
|
712
|
+
runs the ocnus the machine has then, and ends once no card waits.
|
|
713
|
+
`ocnus task merges --once` checks once. A worktree's copy of ocnus
|
|
714
|
+
refuses it, since it records.
|
|
715
|
+
- **ocnus's watch wakes an agent for a closed or conflicting pull
|
|
716
|
+
request.** When a pull request of a card waiting on its merge is closed
|
|
717
|
+
without merging, or in conflict with its default branch, a pass wakes the
|
|
718
|
+
card's agent. A closed one comes first. What it does depends on what is in
|
|
719
|
+
the task's tab: an agent that is idle, or whose turn is done, is sent a
|
|
720
|
+
message with `hc send`, which starts with `ocnus-merges:`, names the
|
|
721
|
+
pull request and what was seen, and tells it to bring it up to date, or to
|
|
722
|
+
ask you whether to stop, as `sdlc-pr` says; with the agent exited
|
|
723
|
+
and the tab's own shell in the foreground, the shell is sent
|
|
724
|
+
`ocnus task build <space> <card> --continue '<message>'`, which starts
|
|
725
|
+
`claude` again on its last session, with its build profile, model and
|
|
726
|
+
effort. A busy agent, a program that reports no status, and a closed tab
|
|
727
|
+
get nothing: a later pass looks again. The agent then brings the pull
|
|
728
|
+
request up to date, or asks you about the closed one, as `sdlc-pr` says;
|
|
729
|
+
the watch records nothing and pushes nothing for it. It wakes the agent
|
|
730
|
+
once for each closed or conflicting pull request, noting each wake that hc
|
|
731
|
+
took, a line each (`conflict <url>` or `closed <url>`), in
|
|
732
|
+
`~/.config/ocnus/merges/<space>/<card>.woke`; a send hc refuses is made
|
|
733
|
+
again at the next pass. Later passes that see it still so wake no one. A
|
|
734
|
+
line is dropped once its pull request shows another state, and the file
|
|
735
|
+
goes once the card no longer waits, as once the agent has recorded what it
|
|
736
|
+
was woken for: so a new conflict, after the pull request was brought up to
|
|
737
|
+
date, wakes it again. It never wakes the agent for a pull request it saw
|
|
738
|
+
itself and is asking you about: one it
|
|
739
|
+
recorded the `pr` step's answer for, `closed on GitHub, …<url>` or
|
|
740
|
+
`in conflict on GitHub, …<url>`, since the card's latest hand-off of
|
|
741
|
+
another step. A card that was waiting before this came in is woken the
|
|
742
|
+
same way, once `ocnus update` wakes the watch.
|
|
743
|
+
- **Nothing is recorded after the merge.** Once a card's merge is recorded,
|
|
744
|
+
`task handoff` refuses any block for the card, saying that the merge is
|
|
745
|
+
recorded already, until `task new` starts the card again. The check is
|
|
746
|
+
part of recording the row, so the merge is recorded once, and the agent
|
|
747
|
+
records nothing more and runs no `task finish`.
|
|
748
|
+
- **It records your answers too.** When you reply to a question, the agent
|
|
749
|
+
records a hand-off with `status: answered` and what you said in a few
|
|
750
|
+
words. `task log` shows how long each step took, and the time a question
|
|
751
|
+
waited on you as a line of its own, counted in no step. A question with no
|
|
752
|
+
answer yet shows how long it has been waiting. A step that followed a
|
|
753
|
+
question with no recorded answer is marked as including the wait.
|
|
754
|
+
- **It records when the setting approved a card, not you.** With the
|
|
755
|
+
breakdown approval off (see [The breakdown approval](#the-breakdown-approval)),
|
|
756
|
+
breakdown's `done` block with `start` next ends with `approved: setting`
|
|
757
|
+
when the setting approved the card, and `task log` shows it as a line under
|
|
758
|
+
the breakdown row:
|
|
759
|
+
|
|
760
|
+
```
|
|
761
|
+
2026-11-30T10:41:53Z breakdown done, then start 2m 10s
|
|
762
|
+
summary: Approved by the setting, with the breakdown approval off, to start now. One piece.
|
|
763
|
+
approved: by the setting (ocnus approval --breakdown off), not the human
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
No one was asked, so there is no `needs-human` or `answered` row for that
|
|
767
|
+
approval. Your approval is your `answered` row, and its block has no
|
|
768
|
+
`approved:` line. `--json` gives each step an `approved`, `"setting"` or
|
|
769
|
+
null. `task handoff` takes the line only on breakdown's `done` block with
|
|
770
|
+
`next: start`, only as `setting`, and only while the settings file is
|
|
771
|
+
valid settings with the breakdown approval off, as it is when the block is
|
|
772
|
+
recorded. Anything else it refuses, saying that you approve the card then,
|
|
773
|
+
and records nothing. A store made before the line has no column for it:
|
|
774
|
+
`task log` reads it as it is, changing nothing, and the next hand-off
|
|
775
|
+
recorded in it adds the column.
|
|
776
|
+
- **With no card, it lists the space's cards.** `task log <space>` shows
|
|
777
|
+
every card in the space that has hand-offs, newest first by its latest
|
|
778
|
+
one, with where it stands (waiting on you, failed, the step it finished
|
|
779
|
+
and the one that comes next, or merged once its pull requests have) and
|
|
780
|
+
for how long. A card with no hand-offs is
|
|
781
|
+
not listed: `task ls` lists the cards in Linear.
|
|
782
|
+
- **It says when a card's agent is stuck or has stopped,** with the Herdr
|
|
783
|
+
app open or closed. A card's agent is the one running its current phase.
|
|
784
|
+
That is the write-up phase, in the tab named after the card, until the
|
|
785
|
+
work starts, then the build phase, in the task's tab, named after its
|
|
786
|
+
folder. The card's latest hand-off says which, and the tab is found by its
|
|
787
|
+
name in the space. The space's tabs are read from herdr-core, which runs
|
|
788
|
+
each tab's terminal whether or not the app is open: each terminal that
|
|
789
|
+
`task new` or `task start` opened is labelled with the space and its tab.
|
|
790
|
+
While the app is open, its tabs in the space are read too, so a tab opened
|
|
791
|
+
before ocnus labelled its terminals is still found. For each terminal
|
|
792
|
+
in the tab, `hc` says what the agent last reported. When the tab has
|
|
793
|
+
several, the most urgent counts. What `task log` says:
|
|
794
|
+
|
|
795
|
+
| When | It shows |
|
|
796
|
+
|---|---|
|
|
797
|
+
| The agent is blocked, on any card | agent waiting on a permission prompt, agent asking a question in its tab, agent waiting for a sign-in, or agent waiting on you in its tab when hc does not say which |
|
|
798
|
+
| The agent hit an error, on any card | agent hit an error |
|
|
799
|
+
| A step is under way, and the agent's turn has ended without a hand-off | agent stopped without handing off |
|
|
800
|
+
| A step is under way, and the tab is closed, or its shell is back in the foreground: the agent has exited or never started | agent not running |
|
|
801
|
+
| The pull requests wait on you, ocnus's watch saw one closed without merging, and no agent is running to wake: the tab is closed, or its shell is back in the foreground | `acme/api#7 closed without merging, no agent running`, naming each one closed |
|
|
802
|
+
| The same, with one in conflict with its default branch | `acme/api#7 in conflict, no agent running`, naming each one in conflict |
|
|
803
|
+
| The pull requests wait on you, and nothing can watch them: ocnus's watch is not running, or it cannot ask GitHub | `nothing watching its pull requests:` and why: `herdr-core not running`, `Herdr's hc not installed`, `ocnus's watch not running`, or what `gh` said, such as that it needs signing in |
|
|
804
|
+
|
|
805
|
+
A step is under way when the latest hand-off is an answer, or `done` with
|
|
806
|
+
a step an agent runs next. A card waiting on you, failed, approved and not
|
|
807
|
+
yet started, or merged has none, so it shows as before unless its agent is
|
|
808
|
+
blocked or hit an error. The exception is a card whose pull requests wait
|
|
809
|
+
on you, its latest hand-off the `pr` step's question: then it shows what
|
|
810
|
+
can see them, as the last three rows say. That holds with the agent idle
|
|
811
|
+
in its tab too, except for a pull request closed or in conflict, which
|
|
812
|
+
ocnus's watch wakes an idle agent for. While ocnus's watch is
|
|
813
|
+
watching and no pull request is closed or in conflict, it shows as
|
|
814
|
+
before. `task log` learns what ocnus's watch saw from the files
|
|
815
|
+
each pass leaves: `~/.config/ocnus/merges/.alive`, the time its
|
|
816
|
+
latest pass began, and `~/.config/ocnus/merges/<space>/<card>`, the
|
|
817
|
+
time and what it saw of the card's pull requests. Beside them, a pass
|
|
818
|
+
whose call to GitHub failed leaves `~/.config/ocnus/merges/.gh`, for
|
|
819
|
+
`ocnus status`: the time, `sign-in` when `gh` needs signing in or else
|
|
820
|
+
`failed`, and `gh`'s words. The next pass whose call works, or that asks
|
|
821
|
+
GitHub nothing, removes it, and it goes with the others once no card
|
|
822
|
+
waits. A watch that has not
|
|
823
|
+
begun a pass in the last 3 minutes is not running, and what it saw longer
|
|
824
|
+
ago than that is not counted. For 15 seconds after `task new` or `task start`
|
|
825
|
+
records its start the agent is still starting, so it is not yet called
|
|
826
|
+
stopped or not running. A program in the tab that reports nothing, or a
|
|
827
|
+
terminal hc cannot answer for, says nothing either way. The plain list
|
|
828
|
+
shows it in place of where the card stands, with how long it has been so,
|
|
829
|
+
counted from when the agent's status last changed, or else from the
|
|
830
|
+
latest hand-off, and for the pull requests always from the latest
|
|
831
|
+
hand-off. A card's own log ends with `now:` and the same.
|
|
832
|
+
`--json` gives each card an `agent`: null, or its `state` (`blocked`,
|
|
833
|
+
`error`, `stopped`, `not running`, `closed`, `conflict` or `unwatched`),
|
|
834
|
+
its `kind` (`permission`, `question`, `auth` or null), its `tab` (null
|
|
835
|
+
when closed), its `label`, `for`, `seconds` and `pulls`: the URLs of the
|
|
836
|
+
pull requests its label names, an empty list for any state but `closed`
|
|
837
|
+
and `conflict`. The card's own `state`, `for` and `seconds` keep
|
|
838
|
+
their meaning. None of it is stored: it is read from Herdr and those
|
|
839
|
+
files each time, and no row or step's time changes with it. With `jq`
|
|
840
|
+
missing, every card shows as before. With `hc` missing, or with neither
|
|
841
|
+
herdr-core able to list its terminals nor the app open and able to list
|
|
842
|
+
its tabs, every card shows as before but one whose pull requests wait on
|
|
843
|
+
you, for which no agent is running then.
|
|
844
|
+
- **They are kept in `~/.config/ocnus/ocnus.db`,** a SQLite file
|
|
845
|
+
beside your spaces, on this machine only, each one with its space. It
|
|
846
|
+
needs `sqlite3`, which macOS ships; `OCNUS_SQLITE` picks another
|
|
847
|
+
command. Without it `task new` still starts the agent, the hand-offs are
|
|
848
|
+
not recorded, and `ocnus status` says so.
|
|
849
|
+
- **The card stays in Linear.** The store records how a step ended, not what
|
|
850
|
+
was written.
|
|
851
|
+
- **The Steps panel shows it in Herdr.** Select a card's tab, the one `task
|
|
852
|
+
new` opened, and the panel lists that card's steps: the time of day, what
|
|
853
|
+
the step did, how long it took, and its summary. A wait on you stands out,
|
|
854
|
+
and so does a question still waiting. It shows the latest run of a card
|
|
855
|
+
written up more than once. With no card's tab selected, it lists the
|
|
856
|
+
space's cards instead, and a card waiting on you stands out. A card
|
|
857
|
+
whose pull requests have merged shows as merged. Click a card
|
|
858
|
+
to see its steps, even when its tab is closed, and "All cards" to go back;
|
|
859
|
+
selecting another tab goes back too. The panel draws what
|
|
860
|
+
`ocnus task log <space> [<card>] --json` prints, which names the space
|
|
861
|
+
under the key `space`, and works nothing out itself, so the two always
|
|
862
|
+
agree. When `task log` says a card's agent is stuck or has stopped, or
|
|
863
|
+
that a pull request of the card's is closed or in conflict with no agent
|
|
864
|
+
running, or that nothing is watching its pull requests, the
|
|
865
|
+
list shows that in place of where the card stands, with how long it has
|
|
866
|
+
been so, and the card's steps end with a line that starts `now` and says
|
|
867
|
+
the same, both in the colour of a wait on you. A card with no agent state
|
|
868
|
+
shows as before.
|
|
869
|
+
- **The panels show a change in an agent's state within 5 seconds.** While
|
|
870
|
+
Herdr's window is visible, the Steps and Cards panels look at Herdr's tabs
|
|
871
|
+
in the space every second or two, and read `task log` again as soon as a
|
|
872
|
+
tab opens, closes or is renamed, or one of its terminals reports another
|
|
873
|
+
status. They also read it again every 6 seconds.
|
|
874
|
+
|
|
875
|
+
### Starting the work
|
|
876
|
+
|
|
877
|
+
One branch for an approved card, checked out as a git worktree of the repos
|
|
878
|
+
the task needs, and shown as a tab in its space.
|
|
879
|
+
|
|
880
|
+
```sh
|
|
881
|
+
ocnus task start <space> <card> [--type <type> --title <title>] [<repo>[:<group>[,<group>...]] ...]
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
- **The card is its ID**, like `ABC-122`, as for `task new`. The write-up
|
|
885
|
+
phase runs this command once you approve the card, or gives it to you when
|
|
886
|
+
you chose to start later. For a card that was sliced, it uses the first
|
|
887
|
+
sub-issue that is not already started, done or canceled. When no Linear key
|
|
888
|
+
is saved, or Linear rejected the key, the command has that card's type and
|
|
889
|
+
title too.
|
|
890
|
+
- **Linear names the branch.** `task start` asks Linear for the card, with
|
|
891
|
+
the key `linear key` saved (see
|
|
892
|
+
[Seeing a space's cards](#seeing-a-spaces-cards)), and makes the branch
|
|
893
|
+
`<type>/<card-id>-<short-name>`. The type is the card's label in the `Type`
|
|
894
|
+
group, which the write-up phase sets. The short name is the first four words
|
|
895
|
+
of the card's title, in lowercase with hyphens, leaving out a, an and the,
|
|
896
|
+
and anything a branch name cannot hold. "Insert the task here" gives
|
|
897
|
+
`feat/abc-122-insert-task-here`.
|
|
898
|
+
- **The type and title given name it when Linear cannot.**
|
|
899
|
+
`--type <type> --title <title>`, given anywhere after the card, before or
|
|
900
|
+
among the targets, name the branch the way Linear's would:
|
|
901
|
+
`--type feat --title 'Insert the task here'` gives
|
|
902
|
+
`feat/abc-122-insert-task-here`. They are used only when no key is saved,
|
|
903
|
+
or when Linear cannot be asked: it rejects the key, it is out of reach,
|
|
904
|
+
`LINEAR_API_KEY` does not hold a key, or `curl` or `jq` is missing. A note
|
|
905
|
+
says why Linear was not used. With a key Linear accepts, Linear's type and
|
|
906
|
+
title name the branch even when others are given, and a note names each
|
|
907
|
+
given one that differs, with what Linear has. The title goes between single
|
|
908
|
+
quotes, with each `'` in it written as `'\''`, as the write-up phase
|
|
909
|
+
writes it, so that the shell takes it as it is.
|
|
910
|
+
- **It stops before it makes anything** when Linear has no such card or the
|
|
911
|
+
card has no type yet (write it up first with `task new`), and, with no type
|
|
912
|
+
and title given, when no key is saved or Linear cannot be asked. It says
|
|
913
|
+
what to do: with no key, that the card can be started with `--type` and
|
|
914
|
+
`--title`. A given type that is not a branch type, only one of the two, a
|
|
915
|
+
flag with no value, or an option it does not know stops it too, before
|
|
916
|
+
Herdr or Linear is asked. A branch in place of the card is refused too,
|
|
917
|
+
with a note that `task start` takes the card now.
|
|
918
|
+
- **Targets say what the task works on.** Each one names a repo of the
|
|
919
|
+
space by its folder name, and optionally groups inside it:
|
|
920
|
+
|
|
921
|
+
| After the card | The task gets |
|
|
922
|
+
|---|---|
|
|
923
|
+
| nothing | every repo of the space, each with its whole setup |
|
|
924
|
+
| `app:athlete` | the `app` repo, set up for its `athlete` group |
|
|
925
|
+
| `app:athlete,coach` | `app`, set up for both groups |
|
|
926
|
+
| `app:athlete billing` | two repos: `app` for `athlete`, and all of `billing` |
|
|
927
|
+
|
|
928
|
+
A repo that is not named gets no worktree and no setup; read it through the
|
|
929
|
+
space's `links/`. A group is the repo's own word for a part of itself
|
|
930
|
+
(see [What a repo provides](#what-a-repo-provides)): lowercase letters,
|
|
931
|
+
digits and dashes. ocnus passes it on and does not check that the repo
|
|
932
|
+
knows it. A repo whose folder name has a colon in it cannot be named as a
|
|
933
|
+
target.
|
|
934
|
+
|
|
935
|
+
- **The branch follows [Conventional Branch](https://conventionalbranch.org).**
|
|
936
|
+
A card's type is `feat`, `fix` or `chore`. A type label that is not one of
|
|
937
|
+
the spec's types (`feature`, `feat`, `bugfix`, `fix`, `hotfix`, `release`,
|
|
938
|
+
`chore`, `ai`, `claude`, `codex`, `copilot` or `cursor`) stops it.
|
|
939
|
+
- **Everything after the type names the task.** `feat/abc-122-insert-task-here` makes
|
|
940
|
+
the folder `tasks/abc-122-insert-task-here` and a tab of that name.
|
|
941
|
+
- **Each of the task's repos gets a worktree** at `tasks/<task>/<repo>`, on the new branch,
|
|
942
|
+
cut from the remote's default branch after a fetch. A repo that cannot be
|
|
943
|
+
fetched starts from what is local, with a warning.
|
|
944
|
+
- **The repos' own checkouts are not touched.** They stay on whatever branch
|
|
945
|
+
they were on.
|
|
946
|
+
- **Where the tab starts:** in the worktree when the task has one repo; in
|
|
947
|
+
the task folder when it has several. That folder has `CLAUDE.md` and
|
|
948
|
+
`AGENTS.md` links to the space's `SPACE.md`.
|
|
949
|
+
- **The Herdr app does not have to be open**, as for `task new` (see
|
|
950
|
+
[Writing the card up](#writing-the-card-up)). The tab is a terminal in
|
|
951
|
+
herdr-core either way:
|
|
952
|
+
- **With the app open**, the app opens the tab, named after the task, as it
|
|
953
|
+
always has.
|
|
954
|
+
- **With the app closed**, `task start` starts the terminal in herdr-core
|
|
955
|
+
itself, as `task new` does: with `hc run --bg --keep --no-parent`, in the
|
|
956
|
+
folder the tab would start in, in the same login-shell wrapper, and with
|
|
957
|
+
Herdr's own `herdr.space` and `herdr.tab` labels, so that opening the app
|
|
958
|
+
shows it as a tab of the space, which the `names` mod names after the
|
|
959
|
+
task, as for `task new`. It prints the terminal's address and
|
|
960
|
+
`hc attach <address>`.
|
|
961
|
+
- **Its terminal is labelled** `ocnus.space=<space>`,
|
|
962
|
+
`ocnus.card=<card>` and `ocnus.tab=<task>`, the tab's name,
|
|
963
|
+
however it was opened. That is how `task finish` finds it with the app
|
|
964
|
+
closed.
|
|
965
|
+
- **herdr-core is started when it is not running**, and `task start` says
|
|
966
|
+
so and goes on. When Herdr is not installed, or herdr-core does not
|
|
967
|
+
start, it stops before it makes anything, as `task new` does.
|
|
968
|
+
- **When no tab can be opened** once the task is made, because the app
|
|
969
|
+
could not open one or herdr-core could not start the terminal, the task
|
|
970
|
+
is kept: `task start` exits non-zero, saying where the task is, why, and
|
|
971
|
+
the line to run in a terminal there to start its agent.
|
|
972
|
+
- **The agent starts in the tab.** The tab's command is
|
|
973
|
+
`/bin/sh -c '<setup> && ocnus task build <space> <card>'`, with the
|
|
974
|
+
setup part only when setup runs, so the agent starts on the card with no
|
|
975
|
+
one typing there, nothing is typed into a shell, and the agent does not
|
|
976
|
+
start before setup has finished. The tab is left with your shell once the
|
|
977
|
+
agent ends. `task build` starts the agent for the build
|
|
978
|
+
phase in its harness (`OCNUS_HARNESS`, or `claude`) in the folder it is
|
|
979
|
+
run in, with the first message in
|
|
980
|
+
[prompts/task-build.md](../prompts/task-build.md). `claude` starts with the
|
|
981
|
+
build phase profile,
|
|
982
|
+
[../agents/ocnus-build.md](../agents/ocnus-build.md), and Linear's
|
|
983
|
+
server alone, on the account billing sets, as `task new` starts the write-up
|
|
984
|
+
phase's: the tools the build phase uses, on the model and effort the
|
|
985
|
+
settings file names for the `build` profile. The first message has it build
|
|
986
|
+
the card with `sdlc-build`, then
|
|
987
|
+
check that work with `sdlc-review`, and go back to the build step when the
|
|
988
|
+
review step sends it back. When the review step finds every item met,
|
|
989
|
+
`sdlc-pr` pushes the branch and opens the pull requests, and waits for you
|
|
990
|
+
to merge them, running no watch of its own. ocnus's watch on the
|
|
991
|
+
merges asks GitHub every minute, however long the pull requests have been
|
|
992
|
+
open, and wakes the agent when one is in conflict with its default branch,
|
|
993
|
+
which the agent then brings up to date, or closed without merging, which it
|
|
994
|
+
asks you about. Telling the agent in the tab that they have merged has it
|
|
995
|
+
say that ocnus's watch records the merge within a minute, and do
|
|
996
|
+
nothing more. Once every one has merged, ocnus's watch records the
|
|
997
|
+
merge with `merged` next and finishes the task with `task finish`, which
|
|
998
|
+
ends the agent and closes the tab, and the run is over. No agent merges a
|
|
999
|
+
pull request. `task build`
|
|
1000
|
+
refuses to run outside the card's own task folder, with no harness on your
|
|
1001
|
+
`PATH`, with the skills not linked, or, for `claude`, with the build phase
|
|
1002
|
+
profile not linked or a settings file that is not valid settings. If the agent stops, run the same command again in the
|
|
1003
|
+
tab. `task build <space> <card> --continue <message>` continues `claude`'s
|
|
1004
|
+
last session in the task instead, with the message, after the build
|
|
1005
|
+
profile's flags: ocnus's watch types it into the tab's shell to wake an
|
|
1006
|
+
agent that has exited, so that it comes back with its profile, model and
|
|
1007
|
+
effort, which a bare `claude --continue` would lose. Another harness
|
|
1008
|
+
refuses `--continue`, starting nothing.
|
|
1009
|
+
- **The card moves to In Progress.** Once the tab is open, `task start` moves
|
|
1010
|
+
the card in Linear to its team's first started status: picked by its kind
|
|
1011
|
+
and its place in the team's order, not by its name, so it is In Progress in
|
|
1012
|
+
a team that calls it that and Doing in one that calls it Doing. A card only
|
|
1013
|
+
moves forward: one already further along, such as In Review, stays there,
|
|
1014
|
+
and one that is done or canceled is never moved; the output says why. The
|
|
1015
|
+
move needs your key to have Write permission. When no key is saved,
|
|
1016
|
+
Linear cannot be reached, or it refuses the move, the task is still made
|
|
1017
|
+
and open, and the output says that the card was not moved, and why. The
|
|
1018
|
+
note is kept in `task log` too, under the start row (see
|
|
1019
|
+
[Hand-offs](#hand-offs)). Move it by hand then. For a slice, the card it
|
|
1020
|
+
was sliced from moves the same way, after it, on a `card` line of its own,
|
|
1021
|
+
and one that cannot be moved is a note too.
|
|
1022
|
+
Once every pull request is open, `sdlc-pr` moves it to In Review, and once
|
|
1023
|
+
every one has merged, recording the merge moves it to Done (see
|
|
1024
|
+
[Hand-offs](#hand-offs)).
|
|
1025
|
+
- **Claude Code asks once to trust a repo it does not know.** With one repo,
|
|
1026
|
+
the tab starts in its worktree, and a worktree takes the trust of its repo's
|
|
1027
|
+
own checkout, not of the space's folder above it. When Claude Code's file
|
|
1028
|
+
(`~/.claude.json`) has not trusted the repo yet, `task start` says that
|
|
1029
|
+
Claude Code will ask once in the tab. ocnus never answers that question
|
|
1030
|
+
for a repo. With several repos the tab is in the task folder, inside the
|
|
1031
|
+
space's folder that `space new` trusted, so there is nothing to ask.
|
|
1032
|
+
- **Setup is off for now**, while the local environment each task gets is
|
|
1033
|
+
worked out. The output says it was not run. Set `OCNUS_SETUP=1` (see
|
|
1034
|
+
[ocnus's variables](#ocnuss-variables)) to turn it on. The next
|
|
1035
|
+
two points describe it when it is on, and groups in targets only matter then.
|
|
1036
|
+
- **Setup runs in the tab.** For each repo that has a `setup` recipe (see
|
|
1037
|
+
[What a repo provides](#what-a-repo-provides)), `just setup`, followed by
|
|
1038
|
+
the target's groups if it named any, is the first part of the tab's
|
|
1039
|
+
command, so `task start` returns within a second or two and you watch the
|
|
1040
|
+
install where you will work. With several repos they run one after
|
|
1041
|
+
another, and one that fails stops the rest, and the agent with them. A repo
|
|
1042
|
+
without the recipe is skipped and named in the output.
|
|
1043
|
+
- **Setup never fails the task.** The task and its tab are there either way.
|
|
1044
|
+
Without `just`, the output says setup was skipped.
|
|
1045
|
+
- **Nothing is made unless everything can be.** A task or branch of that name
|
|
1046
|
+
that already exists, a missing repo, Herdr not installed, or herdr-core not
|
|
1047
|
+
running and not starting stops it first, and a worktree that fails partway
|
|
1048
|
+
is undone.
|
|
1049
|
+
- **The write-up session is put away.** Once the build tab is open, and the
|
|
1050
|
+
start is recorded, `task start` starts `task close` for the card's write-up
|
|
1051
|
+
tab, the one `task new` named after the card, and, for a sub-issue, for the
|
|
1052
|
+
tab of the card it was sliced from, its parent in Linear (see
|
|
1053
|
+
[Putting the write-up away](#putting-the-write-up-away)). It does so only
|
|
1054
|
+
for a tab of that name open in the space, in the app or in herdr-core, and
|
|
1055
|
+
says so in a `write-up` line. A card with no write-up tab open starts as
|
|
1056
|
+
before. When Linear cannot be asked, as with no key saved, `task start`
|
|
1057
|
+
cannot know the parent, so the parent's write-up tab stays open. When
|
|
1058
|
+
`task start` stops before this, whether before it made the task or because
|
|
1059
|
+
no tab could be opened for it, the write-up session stays open.
|
|
1060
|
+
- **When the work has merged**, the agent runs `task finish` itself, which
|
|
1061
|
+
removes the task and closes its tab, or ends its terminal with the app
|
|
1062
|
+
closed (see [Finishing a task](#finishing-a-task)).
|
|
1063
|
+
|
|
1064
|
+
### Putting the write-up away
|
|
1065
|
+
|
|
1066
|
+
Once a card's build phase has started, its write-up session has nothing left
|
|
1067
|
+
to do. One command ends it and closes its tab. `task start` runs it itself, so
|
|
1068
|
+
you run it only for a write-up session it left open.
|
|
1069
|
+
|
|
1070
|
+
```sh
|
|
1071
|
+
ocnus task close <space> <card>
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
- **`task start` runs it detached**, as
|
|
1075
|
+
`hc run --bg --no-parent --rm --name ocnus-close-<card> -- ocnus task close <space> <card>`,
|
|
1076
|
+
with the card in lower case in the name, as `ocnus-close-abc-122`, in
|
|
1077
|
+
the space's folder, once the build tab is open. Its terminal has none of
|
|
1078
|
+
ocnus's or Herdr's labels, so the Herdr app shows no tab for it and
|
|
1079
|
+
`host` counts no agent for it, and `--rm` removes it once it has ended. It
|
|
1080
|
+
is not a child of the tab it was started from, so it goes on when that tab
|
|
1081
|
+
closes. When an `ocnus-close-<card>` terminal is already waiting, hc
|
|
1082
|
+
refuses the name, and `task start` says one is already waiting. When it
|
|
1083
|
+
cannot be started, a note says so: close the tab yourself then.
|
|
1084
|
+
- **It finds the card's write-up tab** as `task log` finds a card's agent
|
|
1085
|
+
(see [Hand-offs](#hand-offs)): the tab named after the card, among the
|
|
1086
|
+
terminals in herdr-core labelled `ocnus.space=<space>` and
|
|
1087
|
+
`ocnus.tab=<card>`, and among the app's tabs in the space's folder while
|
|
1088
|
+
the app is open. With no such tab open, it says there is nothing to put
|
|
1089
|
+
away. Another space's tab of the same name is not the card's.
|
|
1090
|
+
- **It waits for the agent's turn to end.** For each terminal in the tab, it
|
|
1091
|
+
reads what hc says the program is doing. While the agent is working, it
|
|
1092
|
+
waits with `hc wait`. While it is blocked on a person or hit an error, it
|
|
1093
|
+
checks every 5 seconds. It waits however long that takes.
|
|
1094
|
+
- **Then it ends the session with `/exit`**, sent with `hc send`, and checks
|
|
1095
|
+
every second, for up to 30 seconds, until the tab's own shell is back in the
|
|
1096
|
+
foreground with no status. The tab's command is the login-shell wrapper that
|
|
1097
|
+
`task new` gives it, so a shell is left there once the agent exits.
|
|
1098
|
+
- **Then it closes the tab**, as `task finish` closes a task's: with the app
|
|
1099
|
+
open, the tab named after the card, with `tab.close`; then, with the app open
|
|
1100
|
+
or closed, each terminal still labelled for it in herdr-core, with `hc kill`,
|
|
1101
|
+
which covers a tab the app shows under another name. Opening the app after
|
|
1102
|
+
that shows no tab for it.
|
|
1103
|
+
- **The clean exit archives the session in the Claude app.** With Remote
|
|
1104
|
+
Control on, Claude Code archives its session in the Claude app's list as it
|
|
1105
|
+
exits. `hc kill` hangs up and then escalates, which can skip that, so it
|
|
1106
|
+
never ends a live agent: when the agent has not exited 30 seconds after
|
|
1107
|
+
`/exit`, or a terminal in the tab runs a program that reports no status, or
|
|
1108
|
+
that hc cannot answer for, it ends nothing and leaves the tab open, saying
|
|
1109
|
+
so, and exits non-zero. The session's transcript is not touched, so
|
|
1110
|
+
`claude --resume` still opens it.
|
|
1111
|
+
- **Only the card's own write-up tab** is put away. The build tab, other
|
|
1112
|
+
cards' write-up tabs and the terminal `task start` was run in stay open.
|
|
1113
|
+
- **It refuses to run in the write-up tab itself** (`$HC_TERMINAL_ID` is one
|
|
1114
|
+
of its terminals), where it would wait on its own turn. It changes nothing
|
|
1115
|
+
then.
|
|
1116
|
+
- **It needs `jq` and `hc`**, and stops before it changes anything without
|
|
1117
|
+
either, or when neither herdr-core nor the app can list the space's tabs.
|
|
1118
|
+
It changes no file on the machine.
|
|
1119
|
+
|
|
1120
|
+
### Finishing a task
|
|
1121
|
+
|
|
1122
|
+
Once a task's pull requests have merged, one command ends it. ocnus's
|
|
1123
|
+
watch runs it once it has recorded the merge, and no agent runs it (see
|
|
1124
|
+
[Hand-offs](#hand-offs)). So you run it only for a task the watch left, such
|
|
1125
|
+
as one it refused.
|
|
1126
|
+
|
|
1127
|
+
```sh
|
|
1128
|
+
ocnus task finish <space> <card>
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
- **ocnus's watch ends an idle agent first.** When the agent in the
|
|
1132
|
+
task's tab is idle, its turn over, the watch ends it as `task close` ends
|
|
1133
|
+
one (see [Putting the write-up away](#putting-the-write-up-away)): `/exit`,
|
|
1134
|
+
then up to 30 seconds for the tab's own shell to come back. It never kills
|
|
1135
|
+
an agent, and never waits on one that has started a turn since it looked.
|
|
1136
|
+
Once no agent runs in the tab, it runs `task finish` as below, with the
|
|
1137
|
+
Herdr app open or closed. With the tab closed, or the agent already exited,
|
|
1138
|
+
it sends nothing. When the agent does not exit, has started a turn, or a
|
|
1139
|
+
program in the tab reports no status, or when `task finish` refuses, the
|
|
1140
|
+
task is left as it is, and the merged row's flags say what is in the way,
|
|
1141
|
+
as `task not finished: its agent did not exit` or `task not finished:`
|
|
1142
|
+
followed by what `task finish` named, its lines joined by `; `. So
|
|
1143
|
+
`task log <space> <card>` shows it under the row. The watch does not try
|
|
1144
|
+
again: run `task finish` yourself once you have dealt with it.
|
|
1145
|
+
|
|
1146
|
+
- **It removes what `task start` made**: each of the task's worktrees, the
|
|
1147
|
+
task's branch in each repo, and the task's folder with its `CLAUDE.md` and
|
|
1148
|
+
`AGENTS.md` links. Then it closes the task's tab, the one named after the
|
|
1149
|
+
task in its space.
|
|
1150
|
+
- **Run it anywhere, the task's own tab included.** It works from the space's
|
|
1151
|
+
folder, so it can remove the worktree it was run in. Closing the tab is the
|
|
1152
|
+
last thing it does, so from the task's own tab everything else is done, and
|
|
1153
|
+
said, before the tab closes. When it is the space's last tab, Herdr asks
|
|
1154
|
+
first, since closing it closes the space. When `jq` is missing or no such
|
|
1155
|
+
tab is open, it says so and leaves the tab.
|
|
1156
|
+
- **With the Herdr app closed, it ends the task's terminals** in herdr-core
|
|
1157
|
+
instead: each live one labelled `ocnus.space=<space>` and
|
|
1158
|
+
`ocnus.tab=<task>`, as `task start` labels it, with `hc kill`, and the
|
|
1159
|
+
one it runs in last (`$HC_TERMINAL_ID`), since ending that one ends the
|
|
1160
|
+
command. It names each one as it ends it. When none is labelled for the
|
|
1161
|
+
task, or `hc` or `jq` is missing, it says so and ends nothing.
|
|
1162
|
+
- **It finds the task from the card**, as the folder `tasks/<card>-…` that
|
|
1163
|
+
`task start` made, without asking Linear. A card with no task on this
|
|
1164
|
+
machine stops it, and nothing is changed.
|
|
1165
|
+
- **It checks every repo of the task before it removes anything**, and
|
|
1166
|
+
removes nothing when that would lose work. It names every problem in every
|
|
1167
|
+
repo in one go, then says that nothing was removed:
|
|
1168
|
+
|
|
1169
|
+
| It stops for | It names |
|
|
1170
|
+
|---|---|
|
|
1171
|
+
| Changes that are not committed: staged, unstaged or untracked | each file, as `git status` shows it |
|
|
1172
|
+
| Commits on the branch that are not in the remote's default branch, pushed or not, such as a fix pushed to the branch after its pull request merged | each commit |
|
|
1173
|
+
| Git-ignored files that the repo's setup does not make again (see [What a repo provides](#what-a-repo-provides)), such as `.env` or notes in an ignored `docs/` | each file |
|
|
1174
|
+
| Anything in the task folder outside its worktrees | each one |
|
|
1175
|
+
| A worktree that is locked, or not on the task's branch | the worktree |
|
|
1176
|
+
|
|
1177
|
+
- **Merged means in the default branch's history**, where a merge commit puts
|
|
1178
|
+
a pull request's commits. A pull request merged by squash or rebase leaves
|
|
1179
|
+
them out, so its task is refused, which loses nothing.
|
|
1180
|
+
- **It fetches each repo first.** A repo that cannot be fetched is checked
|
|
1181
|
+
against what is local, with a warning, which can only make it refuse.
|
|
1182
|
+
- **Ignored files the repo's setup makes again**, such as `node_modules`, are
|
|
1183
|
+
removed with the worktree without a word. Without `just`, or in a repo with
|
|
1184
|
+
no `made-by-setup` recipe, every ignored file counts as work, and it says
|
|
1185
|
+
why.
|
|
1186
|
+
- **It forces nothing.** `git worktree remove` keeps git's own refusal, and
|
|
1187
|
+
the branch is deleted only while it is still on the commit that was
|
|
1188
|
+
checked.
|
|
1189
|
+
- **It leaves the rest alone**: the branch on the remote, the card in Linear
|
|
1190
|
+
and the card's hand-offs, so `task log` still shows the card.
|
|
1191
|
+
- **To throw away a task it refuses**, remove it by hand: in each repo run
|
|
1192
|
+
`git worktree remove --force <space folder>/tasks/<task>/<repo>` and
|
|
1193
|
+
`git branch -D <branch>`, then delete the task's folder and close its tab.
|
|
1194
|
+
|
|
1195
|
+
## Agent settings
|
|
1196
|
+
|
|
1197
|
+
Each of the four profiles, the two phase profiles and the two dev profiles,
|
|
1198
|
+
runs on a model and an effort of its own, kept in
|
|
1199
|
+
`~/.config/ocnus/settings.json` (`OCNUS_HOME` picks another
|
|
1200
|
+
`~/.config/ocnus`). It is not Herdr's `settings.json`, nor Claude Code's.
|
|
1201
|
+
|
|
1202
|
+
```sh
|
|
1203
|
+
ocnus profile ls [--json]
|
|
1204
|
+
ocnus profile set <profile> <model|effort> <value>
|
|
1205
|
+
```
|
|
1206
|
+
|
|
1207
|
+
| Profile | Kind | What starts on it | How the values reach it |
|
|
1208
|
+
|---|---|---|---|
|
|
1209
|
+
| `write-up` | phase profile | the agent `task new` starts, for the write-up phase | `--model=` and `--effort=` on its `claude` command |
|
|
1210
|
+
| `build` | phase profile | the agent `task build` starts, for the build phase | the same |
|
|
1211
|
+
| `reviewer` | dev profile | the `ocnus-reviewer` subagent, for work on ocnus itself | written into its file in `~/.claude/agents` |
|
|
1212
|
+
| `verifier` | dev profile | the `ocnus-verifier` subagent, the same | the same |
|
|
1213
|
+
|
|
1214
|
+
- **`install` makes the file**, with every profile on Opus at `xhigh` effort,
|
|
1215
|
+
and `update` makes it again when it is missing. Neither changes a file that
|
|
1216
|
+
is there, even one that is not valid settings.
|
|
1217
|
+
- **`profile ls` shows each profile's model and effort**, and what starts on
|
|
1218
|
+
it. `--json` prints them as one line for programs, with the models and
|
|
1219
|
+
efforts there are to choose from; the settings button reads it.
|
|
1220
|
+
- **`profile set` changes one value**, and the file then holds it. It takes a
|
|
1221
|
+
model that is one of claude's aliases (`fable`, `opus`, `sonnet`, `haiku`)
|
|
1222
|
+
or a full model name like `claude-opus-5-5` or `claude-opus-5-5[1m]`, an
|
|
1223
|
+
effort of `low`, `medium`, `high`, `xhigh` or `max`, and one of the four
|
|
1224
|
+
profiles. Anything else is refused, saying what it takes, and the file is
|
|
1225
|
+
left as it was. With no file yet, it makes one that names every profile.
|
|
1226
|
+
- **The next agent starts with it.** A change reaches the next `task new` or
|
|
1227
|
+
`task build`, not an agent that is already running. `--model=` and
|
|
1228
|
+
`--effort=` beat the phase profile's own `model:` and your own Claude Code
|
|
1229
|
+
settings; only `CLAUDE_CODE_EFFORT_LEVEL` beats the effort.
|
|
1230
|
+
- **A profile or a value the file leaves out is Opus at `xhigh`**, and so is
|
|
1231
|
+
every profile when there is no file.
|
|
1232
|
+
- **A file that is not valid settings stops `task new` and `task build`**
|
|
1233
|
+
before an agent starts, and says what in it is wrong: not JSON, a profile
|
|
1234
|
+
that is not one of the four, or a model or effort it does not take.
|
|
1235
|
+
`profile ls` and `profile set` stop the same way, and `ocnus status`
|
|
1236
|
+
reports it as a problem. Fix the file, or move it aside to go back to the
|
|
1237
|
+
defaults.
|
|
1238
|
+
- **The dev profiles, the reviewer and the verifier, are written, not
|
|
1239
|
+
linked.** A subagent runs on the model and effort in its own file, and the
|
|
1240
|
+
Agent tool cannot give it an effort. So a clone of ocnus writes
|
|
1241
|
+
[../.claude/profiles/](../.claude/profiles/)`ocnus-reviewer.md` and
|
|
1242
|
+
`ocnus-verifier.md` into `~/.claude/agents`, with `model:` and
|
|
1243
|
+
`effort:` from the settings file and a comment naming the source, at
|
|
1244
|
+
`install`, at `update`, and at each `profile set` for one of them. It
|
|
1245
|
+
replaces or removes only a file with that comment: one of your own of the
|
|
1246
|
+
same name is left alone, and named. `ocnus status` lists each as
|
|
1247
|
+
`written`, `stale`, `missing` or `skipped`. Their names start with
|
|
1248
|
+
`ocnus-`, so they do not take the place of a `reviewer` of your own. An
|
|
1249
|
+
npm install writes neither, since only a clone works on ocnus.
|
|
1250
|
+
- **It needs `jq`.** Without it `profile` stops and says so, and `task new`
|
|
1251
|
+
and `task build` stop only when there is a file to read.
|
|
1252
|
+
- **Another harness**, named by `OCNUS_HARNESS`, starts with no model or
|
|
1253
|
+
effort, as before, and the file is not read.
|
|
1254
|
+
|
|
1255
|
+
### The settings button
|
|
1256
|
+
|
|
1257
|
+
On the `default` layout, the tab bar is a row: Herdr's tabs, which take the
|
|
1258
|
+
room and drag the window as before, then the settings button at the right end.
|
|
1259
|
+
|
|
1260
|
+
- **The button is a cog.** Hover it to see that it opens ocnus's
|
|
1261
|
+
settings; a screen reader says the same.
|
|
1262
|
+
- **A click opens a popup** with a row for each of the four profiles: its
|
|
1263
|
+
name, its model and its effort. Hover a name to see what starts on it.
|
|
1264
|
+
- **A click on a model or an effort lists the choices**: claude's aliases,
|
|
1265
|
+
and the profile's own model when it is a full name, or the five efforts.
|
|
1266
|
+
Picking one runs `ocnus profile set`, then reads the profiles again, so
|
|
1267
|
+
the popup shows what the file now holds and `ocnus profile ls` agrees.
|
|
1268
|
+
The next `task new` or `task build` starts with it.
|
|
1269
|
+
- **Below the profiles, a row for each of four settings**, each with its
|
|
1270
|
+
two values and the one it is set to marked: the breakdown approval, on or
|
|
1271
|
+
off ([The breakdown approval](#the-breakdown-approval)), archiving, on or off
|
|
1272
|
+
([Archiving merged cards](#archiving-merged-cards)), test runs, share or
|
|
1273
|
+
queue ([Test runs one at a time](#test-runs-one-at-a-time)), and billing,
|
|
1274
|
+
subscription or API key ([Billing](#billing)). With nothing in the settings
|
|
1275
|
+
file, they show the defaults: the approval on, archiving off, the test runs
|
|
1276
|
+
sharing and billing on the subscription. Hover a name to see what it does.
|
|
1277
|
+
- **A click on the value a setting is not set to sets it**, with
|
|
1278
|
+
`ocnus approval --breakdown on|off`, `ocnus linear archive on|off`,
|
|
1279
|
+
`ocnus tests share|queue` or `ocnus billing subscription|api`.
|
|
1280
|
+
Then the popup reads the profiles and the settings again, all at once, so
|
|
1281
|
+
it shows what the file now holds, and the command says the same. The rest
|
|
1282
|
+
of the file stays as it was.
|
|
1283
|
+
- **What ocnus refuses shows in the popup**, in its words, such as a
|
|
1284
|
+
settings file that is not valid settings, and the file is left as it was.
|
|
1285
|
+
A message that several reads gave shows once. A setting ocnus could not
|
|
1286
|
+
read shows neither value, and cannot be clicked.
|
|
1287
|
+
- **It works nothing out itself.** The profiles, their values and the choices
|
|
1288
|
+
come from `ocnus profile ls --json`, and a change is made with
|
|
1289
|
+
`ocnus profile set`. The four settings come from
|
|
1290
|
+
`ocnus approval --json`, `ocnus linear archive --json`,
|
|
1291
|
+
`ocnus tests --json` and `ocnus billing --json`, and are set with
|
|
1292
|
+
those commands. The mod reads no file, so the button and the command
|
|
1293
|
+
always agree. When `ocnus` is not on Herdr's `PATH`, it runs the copy
|
|
1294
|
+
the mod is linked from.
|
|
1295
|
+
|
|
1296
|
+
### Archiving merged cards
|
|
1297
|
+
|
|
1298
|
+
The settings file also says whether a merged card is archived in Linear, as
|
|
1299
|
+
`"archive": true` or `false` beside `"profiles"`. Linear's free plan makes no
|
|
1300
|
+
new card once 250 are not archived, and a done card stays in its team's lists
|
|
1301
|
+
until Linear's own auto-archive takes it, months later.
|
|
1302
|
+
|
|
1303
|
+
```sh
|
|
1304
|
+
ocnus linear archive [on|off|--json]
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
- **It is off until you turn it on.** With no `"archive"` in the file, or no
|
|
1308
|
+
file, archiving is off, and `install` and `update` never write one. With it
|
|
1309
|
+
off, a merged card stays in Done, and the merge asks Linear nothing more.
|
|
1310
|
+
- **`linear archive` says whether it is on.** `--json` prints the same as one
|
|
1311
|
+
line for programs, with the file it is kept in:
|
|
1312
|
+
`{"file":"…/settings.json","archive":false}`, so a mod can read it.
|
|
1313
|
+
- **`linear archive on` and `linear archive off` set it**, and leave the
|
|
1314
|
+
profiles as they are. Anything else is refused, saying what it takes, and
|
|
1315
|
+
the file is left as it was. With no file yet, `on` or `off` makes one that
|
|
1316
|
+
names every profile on the defaults. An `"archive"` that is not `true` or
|
|
1317
|
+
`false` makes the file not valid settings, which `linear archive`,
|
|
1318
|
+
`profile`, `task new`, `task build` and `ocnus status` all say.
|
|
1319
|
+
- **With it on, recording a merge archives closed cards.** Once the merge's
|
|
1320
|
+
hand-off has moved the card to Done, the card is archived, and then every
|
|
1321
|
+
other card of the space's teams that is in a completed or canceled status,
|
|
1322
|
+
such as Done, Canceled or Duplicate. Each is one `issueArchive` call, without
|
|
1323
|
+
`trash`: an archived card still opens by its ID, and can be restored from its
|
|
1324
|
+
team's archive. Every page of closed cards is listed before one is archived,
|
|
1325
|
+
up to 50 pages of 100; past that, the next merge archives the rest.
|
|
1326
|
+
- **A sliced card is archived with its slices, once all are closed.** A card
|
|
1327
|
+
with a parent or sub-issues belongs to a family: the parent and its
|
|
1328
|
+
sub-issues. Since archiving a card archives its sub-issues with it, a family
|
|
1329
|
+
is archived only when the parent is closed and is no one's sub-issue, every
|
|
1330
|
+
one of its sub-issues is closed and has none of its own, and it has at most
|
|
1331
|
+
50 of them. Then each slice is archived, and then the parent. The merged
|
|
1332
|
+
card's family is asked about after the merge's moves, so the merge of a
|
|
1333
|
+
parent's last open slice, which closes the parent, archives the whole
|
|
1334
|
+
family. The other closed cards are taken a family at a time: Linear is
|
|
1335
|
+
asked about each family once, in one more question, however many of its
|
|
1336
|
+
cards are listed, and a slice whose parent is open is left without asking.
|
|
1337
|
+
A family that stays has a note for each of its cards listed, saying why,
|
|
1338
|
+
such as `ABC-20 was not archived in Linear: it has 1 of its 2 slices still
|
|
1339
|
+
open (ABC-21)`.
|
|
1340
|
+
- **Archiving never stops the merge.** The hand-off is recorded first, and a
|
|
1341
|
+
card that is not archived is a note on stderr naming it and why: no Linear
|
|
1342
|
+
key saved, a key without Write permission, Linear out of reach, a card
|
|
1343
|
+
that is not in a closed status, or a family with a card still open. The
|
|
1344
|
+
first call Linear refuses or cannot answer ends the archiving for that
|
|
1345
|
+
merge, naming the card it was on, even part way through a family, since
|
|
1346
|
+
every card after it would fail the same way, and the next merge goes on
|
|
1347
|
+
with it. A last line says how many other closed cards were archived,
|
|
1348
|
+
counting each card of a family.
|
|
1349
|
+
- **In Herdr, the settings button shows it and turns it on or off** with a
|
|
1350
|
+
click, through these commands (see [The settings button](#the-settings-button)).
|
|
1351
|
+
- **In a worktree**, `./cli/ocnus linear archive`, alone or with `--json`,
|
|
1352
|
+
reads as the installed copy does; `on` and `off` are refused.
|
|
1353
|
+
|
|
1354
|
+
### Test runs one at a time
|
|
1355
|
+
|
|
1356
|
+
The settings file also says how the runs of ocnus's own tests on this
|
|
1357
|
+
machine, `npm test` in a clone of ocnus or a worktree of one, use its
|
|
1358
|
+
processors, as `"tests": "share"` or `"queue"` beside `"profiles"`.
|
|
1359
|
+
|
|
1360
|
+
```sh
|
|
1361
|
+
ocnus tests [share|queue|--json]
|
|
1362
|
+
```
|
|
1363
|
+
|
|
1364
|
+
- **They share until you choose otherwise.** With no `"tests"` in the file,
|
|
1365
|
+
or no file, the runs share, and `install` and `update` never write one.
|
|
1366
|
+
Sharing, runs going at the same time run one case per processor between
|
|
1367
|
+
them, through `test-runs` in `~/.config/ocnus`.
|
|
1368
|
+
- **`tests` says which is set.** `--json` prints the same as one line for
|
|
1369
|
+
programs, with the file it is kept in:
|
|
1370
|
+
`{"file":"…/settings.json","tests":"share"}`, so a mod can read it.
|
|
1371
|
+
- **`tests share` and `tests queue` set it**, leaving the profiles and
|
|
1372
|
+
`"archive"` as they are. Anything else is refused,
|
|
1373
|
+
naming both, and the file is left as it was. With no file yet, either makes
|
|
1374
|
+
one that names every profile on the defaults. A `"tests"` that is not
|
|
1375
|
+
`"share"` or `"queue"` makes the file not valid settings, which `tests`,
|
|
1376
|
+
`profile`, `linear archive`, `task new`, `task build` and `ocnus status`
|
|
1377
|
+
all say.
|
|
1378
|
+
- **With `queue`, a run waits its turn.** A run that starts while another is
|
|
1379
|
+
going prints that it is waiting, and how many runs are ahead of it, again
|
|
1380
|
+
each time that number changes, and starts no case until none that started
|
|
1381
|
+
before it is going. Then it takes the processors as a run that shares does,
|
|
1382
|
+
so that alone it has them all. Runs that wait start in the order they
|
|
1383
|
+
started, and a run with `OCNUS_TEST_JOBS` set waits its turn too, then
|
|
1384
|
+
runs that many cases at a time.
|
|
1385
|
+
- **A run stopped part-way lets the next one start.** After Ctrl-C, the run
|
|
1386
|
+
waiting behind it starts at once, though a case the stopped run had going
|
|
1387
|
+
runs to its end and keeps its processor until then. After `kill -9`, the
|
|
1388
|
+
run waiting finds that the one ahead has gone, and starts.
|
|
1389
|
+
- **Each run reads the setting as it starts**, with `jq` alone, so a run that
|
|
1390
|
+
is already going, or waiting, keeps to what it started with. A run that
|
|
1391
|
+
does not find `"queue"` there, with no file, no `jq` or a file that is not
|
|
1392
|
+
valid settings, shares.
|
|
1393
|
+
- **In Herdr, the settings button shows it and switches it** between share
|
|
1394
|
+
and queue with a click, through these commands (see
|
|
1395
|
+
[The settings button](#the-settings-button)).
|
|
1396
|
+
- **In a worktree**, `./cli/ocnus tests`, alone or with `--json`, reads as
|
|
1397
|
+
the installed copy does; `share`, `queue` and `run` are refused.
|
|
1398
|
+
- **`tests run <command>` is something else**: it runs a test command,
|
|
1399
|
+
whole suite or part, in any repo, and records the test run in the host's
|
|
1400
|
+
readings while recording is on (see [Recording the host](#recording-the-host)).
|
|
1401
|
+
The build phase's skills run every test command through it. A run of
|
|
1402
|
+
`npm test` through it shares the processors, or waits its turn, as it
|
|
1403
|
+
does run alone.
|
|
1404
|
+
|
|
1405
|
+
### The breakdown approval
|
|
1406
|
+
|
|
1407
|
+
The settings file also says whether breakdown, the last step of the write-up
|
|
1408
|
+
phase, asks you to approve each card, as `"approval": {"breakdown": true}` or
|
|
1409
|
+
`false` beside `"profiles"`. It is an object so that a later approval gets a
|
|
1410
|
+
key beside `breakdown`.
|
|
1411
|
+
|
|
1412
|
+
```sh
|
|
1413
|
+
ocnus approval [--json | --breakdown on|off]
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
- **It is on until you turn it off.** With no `"approval"` in the file, or no
|
|
1417
|
+
file, or an `"approval"` that leaves `breakdown` out, it is on, and
|
|
1418
|
+
`install` and `update` never write one. With it on, breakdown asks you to
|
|
1419
|
+
approve the card and waits for your answer, as in
|
|
1420
|
+
[Writing the card up](#writing-the-card-up).
|
|
1421
|
+
- **`approval` says whether it is on.** `--json` prints the same as one line
|
|
1422
|
+
for programs, with the file it is kept in:
|
|
1423
|
+
`{"file":"…/settings.json","approval":{"breakdown":true}}`.
|
|
1424
|
+
- **`approval --breakdown off` and `approval --breakdown on` set it**, and
|
|
1425
|
+
leave the profiles, `"archive"` and `"tests"` as they are. Anything else is
|
|
1426
|
+
refused, saying what it takes, and the file is left as it was. With no file
|
|
1427
|
+
yet, either makes one that names every profile on the defaults. An
|
|
1428
|
+
`"approval"` that is not an object, that names an approval other than
|
|
1429
|
+
`breakdown`, or whose `breakdown` is not `true` or `false`, makes the file
|
|
1430
|
+
not valid settings, which `approval`, `profile`, `linear archive`, `tests`,
|
|
1431
|
+
`task new`, `task build` and `ocnus status` all say.
|
|
1432
|
+
- **With it off, breakdown approves a card it has no doubt about.**
|
|
1433
|
+
`sdlc-breakdown` runs `ocnus approval --json` when it gets to the
|
|
1434
|
+
approval, so the setting as it is then is the one it goes by, not the one
|
|
1435
|
+
when the card was started. With it off, it writes the Breakdown, makes the
|
|
1436
|
+
sub-issues when the card is sliced, records its `done` hand-off as an
|
|
1437
|
+
approval to start now, whose summary and `approved: setting` line say the
|
|
1438
|
+
setting gave it (see [Hand-offs](#hand-offs)), and runs
|
|
1439
|
+
`ocnus task start` itself, without asking. Recording it moves the card
|
|
1440
|
+
as your approval does. `task handoff` refuses that line while the approval
|
|
1441
|
+
is on, so a card the setting did not approve cannot be logged as one.
|
|
1442
|
+
- **A doubt still waits for you.** With it off, breakdown still asks, and
|
|
1443
|
+
waits, when it has a doubt to raise: a card it cannot cut that is large, one
|
|
1444
|
+
with more than six slices, which looks like several cards, or a sub-issue
|
|
1445
|
+
that looks too big to stay one piece. The questions define and plan ask
|
|
1446
|
+
earlier in the write-up wait for you too. When breakdown cannot read the
|
|
1447
|
+
setting, such as when the file is not valid settings, it asks you, and
|
|
1448
|
+
says why.
|
|
1449
|
+
- **In Herdr, the settings button shows it and turns it on or off** with a
|
|
1450
|
+
click, through these commands (see [The settings button](#the-settings-button)).
|
|
1451
|
+
- **In a worktree**, `./cli/ocnus approval`, alone or with `--json`,
|
|
1452
|
+
reads as the installed copy does; `--breakdown on` and `--breakdown off`
|
|
1453
|
+
are refused.
|
|
1454
|
+
|
|
1455
|
+
### Billing
|
|
1456
|
+
|
|
1457
|
+
The settings file also says which account every agent `task new` and
|
|
1458
|
+
`task build` start runs on, as `"billing": "subscription"` or `"api"` beside
|
|
1459
|
+
`"profiles"`: your Claude subscription, or an Anthropic API key you save for
|
|
1460
|
+
ocnus. Claude Code sessions you start yourself keep their own login
|
|
1461
|
+
either way.
|
|
1462
|
+
|
|
1463
|
+
```sh
|
|
1464
|
+
ocnus billing [--json | api | subscription]
|
|
1465
|
+
ocnus billing key
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
- **It is the subscription until you choose otherwise.** With no
|
|
1469
|
+
`"billing"` in the file, or no file, it is the subscription, and `install`
|
|
1470
|
+
and `update` never write one. On the subscription, `claude` starts through
|
|
1471
|
+
`env -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN`, so it runs on the
|
|
1472
|
+
subscription you signed in to with `/login` (see
|
|
1473
|
+
[ocnus's variables](#ocnuss-variables)).
|
|
1474
|
+
- **`billing key` saves an Anthropic API key**, as the line
|
|
1475
|
+
`ANTHROPIC_API_KEY=…` in ocnus's env file, as `linear key` saves the
|
|
1476
|
+
Linear key: it asks for the key without showing it, or reads it from stdin,
|
|
1477
|
+
and never takes it as an argument. Every other line of the file is kept,
|
|
1478
|
+
and the file is left readable by you alone. A linked env file, or one in a
|
|
1479
|
+
git repo, is left alone, and it says which line to add yourself. It takes
|
|
1480
|
+
only a key that starts `sk-ant-`, followed by letters, digits, `-` and `_`,
|
|
1481
|
+
and does not check it with Anthropic.
|
|
1482
|
+
- **`billing` says which is set**, and whether a key is saved, never the key
|
|
1483
|
+
itself. `--json` prints the same as one line for programs, with the file it
|
|
1484
|
+
is kept in: `{"file":"…/settings.json","billing":"subscription","key":true}`.
|
|
1485
|
+
- **`billing api` and `billing subscription` set it**, and leave the
|
|
1486
|
+
profiles, `"archive"`, `"tests"` and `"approval"` as they are. Anything else
|
|
1487
|
+
is refused, saying what it takes, and the file is left as it was. With no
|
|
1488
|
+
file yet, either makes one that names every profile on the defaults.
|
|
1489
|
+
`billing api` with no key saved says that `task new` and `task build` stop
|
|
1490
|
+
until one is. A `"billing"` that is not `"subscription"` or `"api"` makes
|
|
1491
|
+
the file not valid settings, which `billing`, `profile`, `linear archive`,
|
|
1492
|
+
`tests`, `approval`, `task new`, `task build` and `ocnus status` all
|
|
1493
|
+
say.
|
|
1494
|
+
- **On `api`, the agent runs on the saved key.** `claude` starts with
|
|
1495
|
+
`--settings={"apiKeyHelper":"OCNUS_HOME='…' '<repo>/cli/ocnus'
|
|
1496
|
+
billing key --print"}` after its profile's flags. Claude Code runs that
|
|
1497
|
+
command to get the key, and takes a key from it ahead of the `/login`
|
|
1498
|
+
sign-in, so its `/status` shows the API key, and it starts without asking
|
|
1499
|
+
whether to use it. The key is in no argument given to `claude`, `hc` or
|
|
1500
|
+
`herdr-app`, and in no agent's environment: `billing key --print` prints it
|
|
1501
|
+
to Claude Code alone, read from the env file. `env` still keeps an exported
|
|
1502
|
+
`ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` out, since either would come
|
|
1503
|
+
before the helper.
|
|
1504
|
+
- **On `api` with no key saved, `task new` and `task build` stop** before an
|
|
1505
|
+
agent starts, and say to run `ocnus billing key`.
|
|
1506
|
+
- **A change reaches the next agent started.** One already running keeps the
|
|
1507
|
+
account it started on: the helper prints the saved key whatever is set when
|
|
1508
|
+
Claude Code asks, and an agent started on the subscription has no helper.
|
|
1509
|
+
- **The profiles' model and effort hold either way.** The
|
|
1510
|
+
`ocnus-reviewer` and `ocnus-verifier` subagents bill as the session
|
|
1511
|
+
they run in. Another harness, named by `OCNUS_HARNESS`, starts as it
|
|
1512
|
+
always has.
|
|
1513
|
+
- **A Claude Code signed in to a Console API key** with `/login` uses that key
|
|
1514
|
+
whatever billing says, since Claude Code takes it ahead of anything
|
|
1515
|
+
ocnus sets.
|
|
1516
|
+
- **`ocnus status` shows it**, below the Linear key: which is set, and
|
|
1517
|
+
whether a key is saved. On `api` with no key saved, it lists that as a
|
|
1518
|
+
problem, saying to run `ocnus billing key`, and exits non-zero (see
|
|
1519
|
+
[Keeping a machine up to date](#keeping-a-machine-up-to-date)).
|
|
1520
|
+
- **In Herdr, the settings button shows it and switches it** between
|
|
1521
|
+
subscription and API key with a click, through `billing subscription` and
|
|
1522
|
+
`billing api` (see [The settings button](#the-settings-button)). The key is
|
|
1523
|
+
saved in a terminal, with `ocnus billing key`: the button never asks
|
|
1524
|
+
for it. Switched to API key with no key saved, the next `task new` or
|
|
1525
|
+
`task build` stops until one is, and `ocnus status` says so.
|
|
1526
|
+
- **In a worktree**, `./cli/ocnus billing`, alone or with `--json`, reads
|
|
1527
|
+
as the installed copy does; `api`, `subscription`, `key` and `key --print`
|
|
1528
|
+
are refused.
|
|
1529
|
+
|
|
1530
|
+
## Recording the host
|
|
1531
|
+
|
|
1532
|
+
ocnus can keep a record of how hard the host, the machine it runs on,
|
|
1533
|
+
works while its agents are open. Then whether the machine holds the work
|
|
1534
|
+
back can be read afterwards, without watching it happen. It is off until you
|
|
1535
|
+
turn it on, and works on macOS only.
|
|
1536
|
+
|
|
1537
|
+
```sh
|
|
1538
|
+
ocnus host # whether recording is on, and what it has
|
|
1539
|
+
ocnus host on # turn recording on
|
|
1540
|
+
ocnus host off # turn it off, and delete every reading
|
|
1541
|
+
ocnus host report [<period>] # how often CPU, memory and disk were at their limit, with how many agents working and how much slower test runs were, what was going then, what used the most, where the steps' time went, whether the network may be the cause, and what to upgrade first
|
|
1542
|
+
ocnus tests run <command> # run a test command, and record the test run
|
|
1543
|
+
```
|
|
1544
|
+
|
|
1545
|
+
- **On and off.** `host on` makes `~/.config/ocnus/host/`, with the
|
|
1546
|
+
readings in `readings.db` there, and recording is on while that folder is
|
|
1547
|
+
there. It checks first that the machine is a Mac, and that `sqlite3`, `jq`
|
|
1548
|
+
and Herdr's `hc` are installed. `host off` stops the recorder and deletes
|
|
1549
|
+
the folder, every reading with it, each agent's share and the work it
|
|
1550
|
+
names, the test runs and their shares, and the marks of the agents' time,
|
|
1551
|
+
their splits and the waits on the model, included. The hand-offs are kept elsewhere, in `ocnus.db`, so
|
|
1552
|
+
`host off` never touches one. Each says so when recording is already on
|
|
1553
|
+
or off.
|
|
1554
|
+
- **The recorder** is one terminal in herdr-core, called `ocnus-host`,
|
|
1555
|
+
running `ocnus host record`. `hc attach ocnus-host` shows it.
|
|
1556
|
+
`host on`, `task new`, `task start` and `task build` start it while
|
|
1557
|
+
recording is on, so it starts with the first agent. hc lets one live
|
|
1558
|
+
terminal hold a name, so there is never a second one. An agent never waits
|
|
1559
|
+
on it: when it cannot start, the agent starts anyway, and nothing is said.
|
|
1560
|
+
Its terminal has no `herdr.space` label, so the Herdr app never shows it as
|
|
1561
|
+
a tab, and no parent, so it goes on when the tab that started it closes.
|
|
1562
|
+
- **Only while an agent is open.** Before each reading it asks herdr-core for
|
|
1563
|
+
the terminals labelled with one of your spaces, and counts an agent open
|
|
1564
|
+
while its terminal's shell has a child: once the agent ends, its tab holds
|
|
1565
|
+
a login shell alone. With none open, it exits without a reading. It also
|
|
1566
|
+
exits when the host folder has gone, and when `hc kill` hangs it up.
|
|
1567
|
+
- **Ocnus's agents apart from the rest.** Every process under a
|
|
1568
|
+
terminal labelled with one of your spaces is ocnus's: its shell,
|
|
1569
|
+
whether an agent is running there or its tab holds its shell alone, the
|
|
1570
|
+
agent, and everything the agent runs, such as a test run. A reading keeps
|
|
1571
|
+
their CPU and memory apart from everything else on the host, which is one
|
|
1572
|
+
number each, and the recorder's own CPU apart from both. A process that
|
|
1573
|
+
leaves its terminal, such as one launchd takes over when its parent exits,
|
|
1574
|
+
counts in the rest from then on, as a task's containers do.
|
|
1575
|
+
- **Each agent's share, and its work.** With each reading go the shares of
|
|
1576
|
+
the terminals labelled with one of your spaces, one each: the CPU and
|
|
1577
|
+
memory of every process under that terminal, the agent and every command
|
|
1578
|
+
it started, such as a test run, included. A process is under the first
|
|
1579
|
+
terminal that reaches it, so none counts toward two, and the shares add up
|
|
1580
|
+
to the reading's `cpu_agents` and `mem_agents_mb`. A tab that holds its
|
|
1581
|
+
shell alone has a share too, marked as not open. Each share names its
|
|
1582
|
+
terminal's work, from what herdr-core and the hand-offs say:
|
|
1583
|
+
- **its card**, the terminal's `ocnus.card` label, which `task new`
|
|
1584
|
+
and `task start` give it, when that is a card ID;
|
|
1585
|
+
- **its phase**, the write-up phase when its tab, its `ocnus.tab`
|
|
1586
|
+
label, is named after the card, as `task new` names it, and the build
|
|
1587
|
+
phase otherwise, as `task start` names the tab after the task;
|
|
1588
|
+
- **the step that card is in**, from its latest hand-off in its space: the
|
|
1589
|
+
step it names as next when it is done, and its own step otherwise. It is
|
|
1590
|
+
left empty when it is not one of the phase's steps, as for a write-up tab
|
|
1591
|
+
still open once `task start` has started the build phase.
|
|
1592
|
+
|
|
1593
|
+
hc is asked for a terminal's labels once, with its process. The step is
|
|
1594
|
+
read once a reading, with one `sqlite3` that opens `ocnus.db`
|
|
1595
|
+
read-only, so the recorder never changes a hand-off, and never makes the
|
|
1596
|
+
store when there is none.
|
|
1597
|
+
- **Working or waiting.** Each reading counts the agents open as working
|
|
1598
|
+
or as waiting, and each share says whether its agent was working. An
|
|
1599
|
+
agent is working while it takes its turn, and waiting while it is open
|
|
1600
|
+
but its turn has ended, it waits on you in its tab, it hit an error, or
|
|
1601
|
+
it has reported no status. That is the status herdr-core gives its
|
|
1602
|
+
terminal, `working` or else `idle`, `done`, `blocked`, `error` or none,
|
|
1603
|
+
read from the same list of each space's terminals the recorder asks hc
|
|
1604
|
+
for before every reading, so it asks hc for nothing more. A tab that
|
|
1605
|
+
holds its shell alone is not open, so it is neither, whatever its status.
|
|
1606
|
+
- **Each agent's time, split in three.** While recording is on, `task new`
|
|
1607
|
+
and `task build` start `claude` with one more flag, `--settings=`, which
|
|
1608
|
+
holds Claude Code hooks that mark the agent's time, for the first start
|
|
1609
|
+
and for `task build --continue`. Each hook runs
|
|
1610
|
+
`cli/host-mark <mark> <file>`, which appends one line, `<mark> <time>`, to
|
|
1611
|
+
the file, with the time in seconds since 1970, to the millisecond, from
|
|
1612
|
+
`perl`'s `Time::HiRes`. The file is
|
|
1613
|
+
`~/.config/ocnus/host/marks/<space>/<card>.<phase>`, one for each
|
|
1614
|
+
card's phase, which every session of that phase appends to; the space's
|
|
1615
|
+
folder is made with the flag. Another harness gets no hooks, and neither
|
|
1616
|
+
does an agent while recording is off or with no `perl`.
|
|
1617
|
+
|
|
1618
|
+
| Mark | Claude Code's hooks | What follows it |
|
|
1619
|
+
|---|---|---|
|
|
1620
|
+
| `start` | `SessionStart`, as the session starts or is continued | The rest, with no tool running |
|
|
1621
|
+
| `prompt` | `UserPromptSubmit` | Waiting on the model, with no tool running |
|
|
1622
|
+
| `pre` | `PreToolUse` | On the host, while one tool or more runs |
|
|
1623
|
+
| `post` | `PostToolUse`, `PostToolUseFailure` | Waiting on the model, once no tool runs |
|
|
1624
|
+
| `ask` | `PermissionRequest` | The rest, until the next tool's end: the human is asked |
|
|
1625
|
+
| `stop` | `Stop`, `StopFailure`, `SessionEnd` | The rest, with no tool running |
|
|
1626
|
+
|
|
1627
|
+
- **`host-mark` holds nothing of the work.** It never reads its stdin,
|
|
1628
|
+
where Claude Code gives a hook the prompt, the reply, or what a tool was
|
|
1629
|
+
called with and gave back, so none of it can reach the file. It prints
|
|
1630
|
+
nothing, since what a `SessionStart` or `UserPromptSubmit` hook prints
|
|
1631
|
+
goes into the agent's context, and it always exits 0, since a
|
|
1632
|
+
`PreToolUse` hook that exits 2 stops the tool. It writes only while the
|
|
1633
|
+
file's folder is there, so after `host off` it writes nothing, and only
|
|
1634
|
+
the six marks above. One run takes about 10 ms.
|
|
1635
|
+
- **The split.** With each reading, for each terminal whose agent is open
|
|
1636
|
+
and has a card and a phase, one `awk` replays that phase's marks file
|
|
1637
|
+
from its start, so the recorder keeps nothing between readings, and
|
|
1638
|
+
splits the seconds the reading covers. Each `pre` raises a count of
|
|
1639
|
+
tools running, and each `post` lowers it, never below 0: while it is
|
|
1640
|
+
above 0, the agent is on the host. At 0, from a `post` or a `prompt`, it
|
|
1641
|
+
waits on the model. An `ask` is the rest until the next tool's end, and
|
|
1642
|
+
`start` and `stop` are the rest. A `prompt`, `start` or `stop` puts the
|
|
1643
|
+
count at 0, so a session ended in the middle of a tool leaves none
|
|
1644
|
+
running. The step is the share's, and the rest is the reading's seconds
|
|
1645
|
+
less the other two, so the three add up to the time the agent was open.
|
|
1646
|
+
An agent with no marks file, as one started in another harness or while
|
|
1647
|
+
recording was off, has no split, nor does a tab that holds its shell
|
|
1648
|
+
alone.
|
|
1649
|
+
- **Known limits.** No hook marks a permission being given, so a tool
|
|
1650
|
+
that asked for one is the rest from the ask to its end. Auto mode's
|
|
1651
|
+
check on a tool call counts as time on the host, and so does all the
|
|
1652
|
+
time a subagent works, which is one tool call of its agent's. A tool
|
|
1653
|
+
whose end is never marked counts as on the host until the next
|
|
1654
|
+
`prompt`, `start` or `stop`.
|
|
1655
|
+
|
|
1656
|
+
Each split is a row of the table `splits`:
|
|
1657
|
+
|
|
1658
|
+
| Column | What it holds |
|
|
1659
|
+
|---|---|
|
|
1660
|
+
| `at` | The `at` of its reading |
|
|
1661
|
+
| `card`, `phase`, `step` | The agent's work, as its share names it |
|
|
1662
|
+
| `host_secs` | The seconds of the reading the agent was on the host, to the millisecond |
|
|
1663
|
+
| `model_secs` | The seconds of the reading it waited on the model, to the millisecond |
|
|
1664
|
+
|
|
1665
|
+
- **Each wait on the model.** The same `awk` gives each wait on the model
|
|
1666
|
+
that ended in the reading's seconds, after the reading before and by
|
|
1667
|
+
this one. A wait starts as the agent comes to wait on the model, with a
|
|
1668
|
+
`prompt`, or a `post` that leaves no tool running, and ends as it stops
|
|
1669
|
+
waiting, with a `pre`, an `ask`, a `start` or a `stop`. As the file is
|
|
1670
|
+
replayed from its start, a wait that began before the reading keeps its
|
|
1671
|
+
real start, and one that spans readings is written once, by the reading
|
|
1672
|
+
it ends in. One that ends where no reading is taken, as while the
|
|
1673
|
+
machine sleeps, or has not ended by the last reading, as when the
|
|
1674
|
+
agent's tab is closed while it waits, is not written. Its work is the
|
|
1675
|
+
split's.
|
|
1676
|
+
|
|
1677
|
+
Each wait is a row of the table `model_waits`, in the same transaction as
|
|
1678
|
+
its reading:
|
|
1679
|
+
|
|
1680
|
+
| Column | What it holds |
|
|
1681
|
+
|---|---|
|
|
1682
|
+
| `card`, `phase`, `step` | The agent's work, as its split names it |
|
|
1683
|
+
| `started`, `ended` | When the wait started and ended, in seconds since 1970, to the millisecond |
|
|
1684
|
+
- **Nothing starts with the machine.** No launchd agent, login item or cron
|
|
1685
|
+
job starts the recorder, and its terminal has no `--keep`, so nothing
|
|
1686
|
+
brings it back after a restart. It starts again with the next agent. (The
|
|
1687
|
+
launchd agent that `install` writes wakes only ocnus's watch on the
|
|
1688
|
+
merges.)
|
|
1689
|
+
- **A reading every 10 seconds** holds numbers only, each worked out from
|
|
1690
|
+
the change since the reading before:
|
|
1691
|
+
|
|
1692
|
+
| Column | What it holds |
|
|
1693
|
+
|---|---|
|
|
1694
|
+
| `at`, `secs` | When it was taken, in seconds since 1970, and the seconds before it that it covers |
|
|
1695
|
+
| `agents` | How many agents were open |
|
|
1696
|
+
| `working`, `waiting` | How many of those were working, taking their turn, and how many were waiting: their turn had ended, they waited on you, they hit an error, or they had reported no status; empty in a reading from before they were counted |
|
|
1697
|
+
| `cpu_busy`, `cpu_system` | The share of all cores' time that was busy, and the share spent in the system |
|
|
1698
|
+
| `cpu_p`, `cpu_e` | How busy the performance and the efficiency cores were, on a Mac that has both; empty on one that has not |
|
|
1699
|
+
| `cpu_self` | The CPU recording itself used, every tool it ran included, as a share of all cores |
|
|
1700
|
+
| `cpu_agents`, `cpu_rest` | The share of all cores' time that ocnus's agents used, everything in their terminals included, and the share everything else used; the recorder's own is in neither |
|
|
1701
|
+
| `mem_pressure` | macOS's memory pressure: 1 normal, 2 warning, 4 critical |
|
|
1702
|
+
| `mem_used_mb`, `compressed_mb` | Memory used, as Activity Monitor's Memory Used counts it, and the memory the compressor holds |
|
|
1703
|
+
| `mem_agents_mb`, `mem_rest_mb` | The memory ocnus's agents hold, as the sum of their processes' resident memory, and the rest of the memory used |
|
|
1704
|
+
| `swap_used_mb`, `swap_ins`, `swap_outs` | Swap in use, and the pages swapped in and out |
|
|
1705
|
+
| `disk_read_kb`, `disk_write_kb` | What every disk read and wrote |
|
|
1706
|
+
| `disk_free_pct` | The share of the disk holding your home folder that is free |
|
|
1707
|
+
| `net_in_kb`, `net_out_kb` | What the network interface in use took in and sent; empty when it is not the one in use the reading before |
|
|
1708
|
+
| `net_wifi` | 1 when the interface in use is the Wi-Fi, 0 when it is another, such as a wired one; empty when the host is offline |
|
|
1709
|
+
| `net_resent_pct` | The share of the TCP bytes sent that had to be sent again |
|
|
1710
|
+
| `wifi_rssi`, `wifi_noise` | The Wi-Fi's signal and noise, in dBm; empty when the host is not on Wi-Fi |
|
|
1711
|
+
| `on_battery`, `low_power` | 1 when the host runs on its battery, and when Low Power Mode is on, 0 when not |
|
|
1712
|
+
| `thermal` | macOS's thermal state: 0 nominal, 1 fair, 2 serious, 3 critical, when the host slows itself down to cool |
|
|
1713
|
+
| `cores` | How many cores the reading counted, so that a share of all cores' time can be made CPU time again |
|
|
1714
|
+
|
|
1715
|
+
Offline, every network column is empty, and power and heat are still
|
|
1716
|
+
read. A value that cannot be read is empty, and the rest of the reading is
|
|
1717
|
+
kept.
|
|
1718
|
+
|
|
1719
|
+
Each share is a row of the table `shares`:
|
|
1720
|
+
|
|
1721
|
+
| Column | What it holds |
|
|
1722
|
+
|---|---|
|
|
1723
|
+
| `at` | The `at` of its reading |
|
|
1724
|
+
| `card` | The card the agent works on, as `LAB-150`; empty when its terminal's label is not a card ID |
|
|
1725
|
+
| `phase` | `write-up` or `build`; empty with no card |
|
|
1726
|
+
| `step` | `define`, `plan` or `breakdown` in the write-up phase, `build`, `review` or `pr` in the build phase; empty when the card is in none of its phase's steps |
|
|
1727
|
+
| `open` | 1 when its agent was open, 0 when its tab held its shell alone |
|
|
1728
|
+
| `working` | 1 when its agent was working, 0 when it was waiting or not open; empty in a share from before they were told apart |
|
|
1729
|
+
| `cpu` | The share of all cores' time its processes used, as `cpu_agents` counts it |
|
|
1730
|
+
| `mem_mb` | The memory its processes held, as `mem_agents_mb` counts it |
|
|
1731
|
+
|
|
1732
|
+
It comes from macOS's own tools, run as you: `ps` for the agents'
|
|
1733
|
+
processes and their memory, one `osascript` that asks the kernel for each
|
|
1734
|
+
core's ticks and for the CPU time of each of the agents' processes, with
|
|
1735
|
+
that of the children it has waited for, so that a test run's short-lived
|
|
1736
|
+
processes count, and asks macOS for the Wi-Fi interface's signal and noise,
|
|
1737
|
+
the thermal state and Low Power Mode, `vm_stat`, `sysctl`, `ioreg` and
|
|
1738
|
+
`df`, `scutil --nwi` for the interface in use, `netstat` for its bytes,
|
|
1739
|
+
`nettop` for each process's TCP bytes sent and sent again, `pmset` for the
|
|
1740
|
+
power source, and bash's own count of the CPU the recorder has used. A gap
|
|
1741
|
+
of over 30 seconds, such as the machine sleeping, gives no reading: the
|
|
1742
|
+
next one starts from the new sample.
|
|
1743
|
+
- **Each test run.** The build phase's skills run every test command
|
|
1744
|
+
through `ocnus tests run`, whole suite or part, as in
|
|
1745
|
+
`ocnus tests run npm test`, in ocnus and in every other repo of a
|
|
1746
|
+
space. It runs the command as it is: its output goes straight through, it
|
|
1747
|
+
gets the stdin, and it exits as the command did. While recording is on,
|
|
1748
|
+
with a card named and in one of the space's repos, it records the test
|
|
1749
|
+
run. Otherwise, or without `sqlite3`, `perl` or macOS's `time`, it runs the
|
|
1750
|
+
command and records nothing.
|
|
1751
|
+
- **Its card and repo.** `task build` names the card and the space to its
|
|
1752
|
+
agent, as `OCNUS_CARD` and `OCNUS_SPACE`, so that every command
|
|
1753
|
+
the agent runs has them; the env file cannot set them. The repo is the
|
|
1754
|
+
one whose git common dir the folder it runs in has, so a run in the
|
|
1755
|
+
task's worktree, in the repo's own checkout or in a worktree made to
|
|
1756
|
+
check a test on the default branch is that repo's, named by its folder.
|
|
1757
|
+
- **What it measures.** It runs the command under macOS's `time -l`, as a
|
|
1758
|
+
job, which says how long it took, to 0.01 s, the CPU it and everything
|
|
1759
|
+
it waited for used, and the largest process's peak memory, whatever the
|
|
1760
|
+
run's length, so a run between two readings is there too. While the job
|
|
1761
|
+
runs, `ps` every second adds up the memory of all its processes, and the
|
|
1762
|
+
most it held at once is the larger of that and time's peak. bash leaves
|
|
1763
|
+
Ctrl-C ignored in a job it starts, so `perl` puts it back, and the job
|
|
1764
|
+
stops as the command run alone would.
|
|
1765
|
+
- **The fingerprint of its command.** Before the job starts,
|
|
1766
|
+
`/usr/bin/shasum -a 256` hashes the command's arguments, each ended by a
|
|
1767
|
+
NUL, and the first 15 hex digits of the hash, as a number, are the run's
|
|
1768
|
+
`cmd`. The same arguments give the same number, so `host report` can set
|
|
1769
|
+
runs of the same command in the same repo against each other, and the
|
|
1770
|
+
command's text cannot be read back from it. It is all that is kept of
|
|
1771
|
+
the command line. `shasum` runs as part of watching the run, so its CPU
|
|
1772
|
+
is in the run's `watch_secs`; without it, `cmd` is empty and the run is
|
|
1773
|
+
still recorded.
|
|
1774
|
+
- **Its row** goes in the table `test_runs` as it starts, and gets its end
|
|
1775
|
+
and its figures when the job ends, or on Ctrl-C, `TERM` or a hangup,
|
|
1776
|
+
which go on to the command first. A run whose process has gone with no
|
|
1777
|
+
end, as after `kill -9`, is ended by the recorder at its next reading, as
|
|
1778
|
+
cut short, with the CPU the recorder counted of it as its CPU, or none
|
|
1779
|
+
when it counted none.
|
|
1780
|
+
|
|
1781
|
+
| Column | What it holds |
|
|
1782
|
+
|---|---|
|
|
1783
|
+
| `card`, `repo` | The card, as `LAB-150`, and the repo, by its folder's name |
|
|
1784
|
+
| `started`, `ended` | When it started and ended, in seconds since 1970; no end while it runs |
|
|
1785
|
+
| `secs` | How long it took, to 0.01 s |
|
|
1786
|
+
| `cpu_secs` | The CPU its command, and everything that command waited for, used; for a run cut short, what the recorder counted of it, and empty when it counted none |
|
|
1787
|
+
| `mem_mb` | The most memory its processes held at once |
|
|
1788
|
+
| `watch_secs` | The CPU watching it used, which counts as recording's own |
|
|
1789
|
+
| `pid` | Its job's process, by which the recorder tells a run that has gone |
|
|
1790
|
+
| `cut` | 1 when the recorder ended it, 0 otherwise |
|
|
1791
|
+
| `cmd` | The fingerprint of its command; empty in a run from before they were kept |
|
|
1792
|
+
- **Each test run's share.** With each reading go the shares of the test
|
|
1793
|
+
runs going then, one each. The recorder reads the test runs with no end
|
|
1794
|
+
from `test_runs` before it walks the processes, and a run's share is the
|
|
1795
|
+
CPU and memory of its job and every process under it, worked out as a
|
|
1796
|
+
terminal's share is. A process is under the first run that reaches it,
|
|
1797
|
+
and only a process under a terminal counts, so a run's share is part of
|
|
1798
|
+
its agent's share, never beside it, and a run with no process under a
|
|
1799
|
+
terminal has no share. A process that exited counts once: its time is
|
|
1800
|
+
taken away again from the run only when the process that waited for it
|
|
1801
|
+
is in that run.
|
|
1802
|
+
- **The rest of a run that ended.** A run that ends between two readings
|
|
1803
|
+
used CPU after the first of them, and by the second none of its
|
|
1804
|
+
processes is left to show it. So the reading after its end gives it the
|
|
1805
|
+
rest: the CPU its row says it used,
|
|
1806
|
+
less what the readings counted of it, never below 0, with the most
|
|
1807
|
+
memory it held at once as its memory. It gets the rest once, and a run
|
|
1808
|
+
that starts and ends between two readings gets all its CPU that way. A
|
|
1809
|
+
run that was going at the reading before with nothing counted of it,
|
|
1810
|
+
as one under no terminal, gets no rest.
|
|
1811
|
+
- **What was counted** of each run going is kept in the recorder's
|
|
1812
|
+
sample file until the next reading, as numbers: what the readings gave
|
|
1813
|
+
it, on top of what its processes had used by the first sample that saw
|
|
1814
|
+
them, when that gave no reading, as the first of the recorder's run
|
|
1815
|
+
does. A run that was going before the recorder started does not count
|
|
1816
|
+
that time in the reading after its end. A run the recorder cuts short
|
|
1817
|
+
gets what was counted of it as its CPU.
|
|
1818
|
+
|
|
1819
|
+
Each run's share is a row of the table `run_shares`:
|
|
1820
|
+
|
|
1821
|
+
| Column | What it holds |
|
|
1822
|
+
|---|---|
|
|
1823
|
+
| `at` | The `at` of its reading |
|
|
1824
|
+
| `run` | The `id` of its run in `test_runs` |
|
|
1825
|
+
| `cpu` | The share of all cores' time its processes used, as `cpu_agents` counts it; in the reading after its end, the rest of its CPU |
|
|
1826
|
+
| `mem_mb` | The memory its processes held; in the reading after its end, the most it held at once |
|
|
1827
|
+
- **What a reading never holds**: another app's name, a command line, a
|
|
1828
|
+
file's contents, a window title, a prompt or a reply, and no address, host
|
|
1829
|
+
or site reached, or the network's name: the Wi-Fi is never asked which
|
|
1830
|
+
network it has joined. The agents' processes are known by number alone,
|
|
1831
|
+
and a process outside their terminals counts only in the rest: not even
|
|
1832
|
+
its number is written down, and the recorder never asks for its time.
|
|
1833
|
+
`nettop` lists every process with its bytes; their names are dropped as
|
|
1834
|
+
they are read, and their numbers and bytes are kept in the recorder's
|
|
1835
|
+
memory until the next reading, never in a file. Whatever else a tool
|
|
1836
|
+
prints is never kept. Every column is a number but the card, phase and
|
|
1837
|
+
step of a share, a split and a wait on the model, and a test run's card
|
|
1838
|
+
and repo, and those hold only the values
|
|
1839
|
+
ocnus gives them: a card ID, `write-up` or `build`, one of that
|
|
1840
|
+
phase's steps, and the name of one of the space's repos. Any other value,
|
|
1841
|
+
such as a label that is not a card ID, is left empty. The space's name and
|
|
1842
|
+
the tab's are never kept, and nothing of a test run's command line but its
|
|
1843
|
+
fingerprint, nor its folder or its branch: time's file holds numbers, and
|
|
1844
|
+
goes with the run. A marks file holds a mark and a time a line, and
|
|
1845
|
+
nothing of what the agent was given or did; its space and card are only
|
|
1846
|
+
in its path.
|
|
1847
|
+
- **Safe on a work computer.** It needs no admin rights and runs no `sudo`,
|
|
1848
|
+
`powermetrics` or `wdutil`: the CPU time it asks for is that of your own
|
|
1849
|
+
processes alone. It sends nothing off the machine: the network it reads
|
|
1850
|
+
is the traffic already there. Readings older than 90 days are deleted,
|
|
1851
|
+
with their shares, their splits and their test runs' shares, the waits on
|
|
1852
|
+
the model that ended then, the test runs that started then, and the marks
|
|
1853
|
+
files untouched for 90 days, when
|
|
1854
|
+
the recorder starts and every hour of readings. A reading takes about a quarter of a
|
|
1855
|
+
second of CPU, and watching a test run about 20 ms of CPU a second while
|
|
1856
|
+
it runs, for one `ps` and the sums, and about 20 ms once, for the
|
|
1857
|
+
fingerprint of its command, so recording uses well under 1% of the CPU,
|
|
1858
|
+
all cores together, and `host report` says how much it used, watching
|
|
1859
|
+
the test runs included.
|
|
1860
|
+
|
|
1861
|
+
`host report` takes the period it reports on:
|
|
1862
|
+
|
|
1863
|
+
| Period | Covers |
|
|
1864
|
+
|---|---|
|
|
1865
|
+
| none | The last 7 days, as `7d` does |
|
|
1866
|
+
| `<n>d`, `<n>h` | That many days or hours back from now, like `7d` or `12h` |
|
|
1867
|
+
| `2026-11-29` | That day, from midnight in your time zone; today ends now |
|
|
1868
|
+
| `2026-11-01..2026-11-29` | Those two days and every day between them |
|
|
1869
|
+
|
|
1870
|
+
Anything else, such as a day that does not exist like `2026-02-30`, is
|
|
1871
|
+
refused. It says how much of the period was recorded and how much was
|
|
1872
|
+
missing, then, for each of CPU, memory and disk, how long and how much of the
|
|
1873
|
+
recorded time it was at its limit. A line for each day follows, with the same
|
|
1874
|
+
figures.
|
|
1875
|
+
|
|
1876
|
+
- **At its limit** means the CPU was at least 90% busy across all cores,
|
|
1877
|
+
memory pressure was at warning or critical, or under 10% of the home
|
|
1878
|
+
folder's disk was free.
|
|
1879
|
+
- **Time with no reading is shown as missing, never as idle.** That is the
|
|
1880
|
+
time no agent was open, as well as when the machine slept or recording was
|
|
1881
|
+
off. A period with no readings at all says so.
|
|
1882
|
+
|
|
1883
|
+
Then come the agents working at once, under `Agents working at once:`, to
|
|
1884
|
+
tell how many agents to run at once:
|
|
1885
|
+
|
|
1886
|
+
- **A line for each number of agents working** in the period, from none
|
|
1887
|
+
up: how long that many were working, and how long and how much of that
|
|
1888
|
+
time the CPU or the memory was at its limit. Each reading counts for the
|
|
1889
|
+
part of it in the period, as above.
|
|
1890
|
+
- **Readings from before the agents working were counted** hold no count.
|
|
1891
|
+
They are left out of these lines, never counted as none working, and
|
|
1892
|
+
their time is on a line of its own, `not counted`.
|
|
1893
|
+
- **How much slower test runs were.** Under each number from 2 up comes
|
|
1894
|
+
how much slower test runs were than with one agent working, as
|
|
1895
|
+
`test runs 30% slower than with 1 working, from 3 runs of 1 command
|
|
1896
|
+
against 3 with 1 working`, or as `faster` when they were faster:
|
|
1897
|
+
- **A test run counts at one number of agents working**: the one that
|
|
1898
|
+
covers most of its time, from when it started for as long as it took,
|
|
1899
|
+
over the readings that counted them, and the larger number on a tie. A
|
|
1900
|
+
run under 10 seconds, shorter than a reading, counts at the number of
|
|
1901
|
+
the reading that holds most of it. Runs that started in the period
|
|
1902
|
+
count, but a run cut short, one still going, one with no `cmd`, from
|
|
1903
|
+
before the fingerprints were kept, and one that overlaps no reading
|
|
1904
|
+
with a count of the agents working are left out.
|
|
1905
|
+
- **A command is a repo and a `cmd`**, so only runs of the same command
|
|
1906
|
+
in the same repo are set against each other. A command counts at a
|
|
1907
|
+
number when it ran at least 3 times with that many working and 3 times
|
|
1908
|
+
with one. Its ratio is the median time of its runs at that number over
|
|
1909
|
+
the median of its runs at one, and the figure is the median of those
|
|
1910
|
+
commands' ratios, with the runs and the commands it rests on, and the
|
|
1911
|
+
runs with one working. Medians keep one odd run, such as one that
|
|
1912
|
+
failed early, from moving the figure.
|
|
1913
|
+
- **With no such command**, it says it cannot tell yet for that number.
|
|
1914
|
+
- **A store from before the fingerprints** has no `cmd`, and the report
|
|
1915
|
+
leaves these lines out. It never alters the store: the next test run or
|
|
1916
|
+
recorder start adds the column.
|
|
1917
|
+
- **The last line names the number from which the host was the limit**:
|
|
1918
|
+
the fewest working at which the CPU or memory was at its limit for at
|
|
1919
|
+
least a quarter of the time. With no such number, it says the host was
|
|
1920
|
+
not the limit at any number of working agents in the period, and with no
|
|
1921
|
+
reading that counted them, it says so.
|
|
1922
|
+
|
|
1923
|
+
Then come the longest stretches when the CPU or the memory was at its limit:
|
|
1924
|
+
|
|
1925
|
+
- **A stretch** is readings in a row, each starting where the one before
|
|
1926
|
+
ended, each with the CPU or memory at its limit. A reading under the
|
|
1927
|
+
limit, or time with no reading, ends it. Each reading counts for the part
|
|
1928
|
+
of it in the period.
|
|
1929
|
+
- **The 5 longest** in the period are listed, longest first, or fewer when
|
|
1930
|
+
there are fewer. Each says when it started, how long it lasted, and
|
|
1931
|
+
whether the CPU, the memory or both were at their limit in it.
|
|
1932
|
+
- **Under each, the work going then**: every card, with its step, or its
|
|
1933
|
+
phase when its card was in none of that phase's steps, then every test
|
|
1934
|
+
run, by its card, its repo and when it started. Each has its share of all
|
|
1935
|
+
cores over the stretch, each reading's share counted for that reading's
|
|
1936
|
+
seconds, and the most memory it held in one reading. Each card also says
|
|
1937
|
+
for how much of the stretch its agent was working, as `working 50% of
|
|
1938
|
+
it`, or `working not read` for shares from before that was read. A share
|
|
1939
|
+
that names no card is left out, and a stretch with no card or test run
|
|
1940
|
+
going says so.
|
|
1941
|
+
- **With none**, the report says the host was never at its limit for CPU or
|
|
1942
|
+
memory in the period. Disk is not among the stretches: under 10% free is
|
|
1943
|
+
not caused by a moment's work.
|
|
1944
|
+
|
|
1945
|
+
Then come the steps, the phases and the test runs that used the most:
|
|
1946
|
+
|
|
1947
|
+
- **The 10 steps and the 10 phases that used the most CPU time** in the
|
|
1948
|
+
period, and **the 10 of each that held the most memory at once**. Each is
|
|
1949
|
+
one card's own, such as LAB-150's build step or its write-up phase. A
|
|
1950
|
+
step's CPU time is its shares' CPU, as a share of all cores, over the part
|
|
1951
|
+
of each reading in the period, on that reading's cores, and a phase's is
|
|
1952
|
+
its steps' together. Its memory is the most its shares held in one
|
|
1953
|
+
reading. Beside each is how long it ran: the recorded time it was in.
|
|
1954
|
+
- **The 10 test runs that used the most CPU time**, of those that started in
|
|
1955
|
+
the period, and **the 10 that held the most memory at once**, each named by
|
|
1956
|
+
its card, its repo and when it started, with how long it ran. A run the
|
|
1957
|
+
recorder cut short says so, and is ranked by the CPU the recorder counted
|
|
1958
|
+
of it, or by its memory alone when it counted none; one still going says
|
|
1959
|
+
that in place of its time.
|
|
1960
|
+
- **With no step, phase or test run in the period**, as when no agent was
|
|
1961
|
+
tied to a card, the report says so in place of the lists. With some, a
|
|
1962
|
+
list that has none says `none recorded`.
|
|
1963
|
+
|
|
1964
|
+
Then comes where the steps' time went:
|
|
1965
|
+
|
|
1966
|
+
- **All agents**: their time on the host, waiting on the model and the
|
|
1967
|
+
rest, from the splits in the period, each reading's split counted for the
|
|
1968
|
+
part of the reading in the period, as the report counts a reading. With
|
|
1969
|
+
it is how long they were open, which the three add up to.
|
|
1970
|
+
- **The 10 steps open longest**, each one card's own, such as LAB-152's
|
|
1971
|
+
build step, with the same: how long its agents were open with a split,
|
|
1972
|
+
and its three parts, each to the second.
|
|
1973
|
+
- **How many steps had no split**: steps open in the period with no split,
|
|
1974
|
+
as of an agent started in another harness or while recording was off.
|
|
1975
|
+
With no split in the period, or a store made before the splits, the
|
|
1976
|
+
report says no step was split.
|
|
1977
|
+
|
|
1978
|
+
Then, after a blank line, it says whether the network may be the cause, as
|
|
1979
|
+
a slow wait on the model can be the network rather than the host:
|
|
1980
|
+
|
|
1981
|
+
- **A slow wait** took over twice the median of every wait in
|
|
1982
|
+
`model_waits`, so 90 days at most. The median is the wait halfway in order
|
|
1983
|
+
of length, the later of the two for an even count. A wait of exactly twice
|
|
1984
|
+
it is not slow.
|
|
1985
|
+
- **It counts for the network** when there is a reading over it, in whole or
|
|
1986
|
+
in part, and every reading over it had the CPU, memory and disk below
|
|
1987
|
+
their limit, as above. A slow wait with no reading over it does not count.
|
|
1988
|
+
- **The period's waits** are those that ended in it, whenever they started.
|
|
1989
|
+
- **With any that count**, it says how many of the period's waits on the
|
|
1990
|
+
model were slow while the host was below its limit, and the median, to a
|
|
1991
|
+
tenth of a second under a minute: `The network may be the cause: 14 of 412
|
|
1992
|
+
waits on the model were slow (over twice the median of 6.2s) while CPU,
|
|
1993
|
+
memory and disk were below their limit.` With none, or a store made before
|
|
1994
|
+
the waits on the model, it says nothing.
|
|
1995
|
+
- **It cannot tell a slow network from a slow model**: the line says only
|
|
1996
|
+
that the network may be the cause.
|
|
1997
|
+
|
|
1998
|
+
Last comes the verdict on the host, one line after a blank one, with the
|
|
1999
|
+
numbers behind it, so that money goes on what slows the agents' work on the
|
|
2000
|
+
host. It is the first of these that holds:
|
|
2001
|
+
|
|
2002
|
+
- **Too little data yet**, with fewer than 10 steps with their time split in
|
|
2003
|
+
the period, each one card's own, or under 1 hour of the agents' time on
|
|
2004
|
+
the host. It says how many steps and how long, against the 10 and the
|
|
2005
|
+
hour. With no split in the period, or a store made before the splits,
|
|
2006
|
+
both are none.
|
|
2007
|
+
- **The one to upgrade first**: of CPU, memory and disk, the one at its
|
|
2008
|
+
limit, as above, for the most of the agents' time on the host, when that
|
|
2009
|
+
is at least 10% of it; the CPU before memory, and memory before the disk,
|
|
2010
|
+
when two were at their limit as long. The line gives its share of the
|
|
2011
|
+
agents' time on the host, that time, and the other two's shares:
|
|
2012
|
+
`upgrade memory first: it was at its limit for 23.0% of the agents' 6h
|
|
2013
|
+
10m on the host (CPU 8.0%, disk 0.0%)`.
|
|
2014
|
+
- **The power state was the limit**, in place of an upgrade, when over half
|
|
2015
|
+
of that one's time at its limit was on battery, in Low Power Mode, or with
|
|
2016
|
+
the thermal state at serious or critical: plugging in, turning Low Power
|
|
2017
|
+
Mode off or letting the machine cool costs nothing. The line gives how
|
|
2018
|
+
much of that time it was, too. At exactly half it is an upgrade. A
|
|
2019
|
+
reading from before the power state was read counts as on power.
|
|
2020
|
+
- **The network was the limit**, when none of the three was at its limit
|
|
2021
|
+
for 10% of the agents' time on the host, and the slow waits that count for
|
|
2022
|
+
the network, as above, are at least 10% of the period's waits on the
|
|
2023
|
+
model: `the network was the limit: 12.0% of the 100 waits on the model
|
|
2024
|
+
were slow (over twice the median of 6.2s) while CPU, memory and disk were
|
|
2025
|
+
below their limit, and each was at its limit for under 10% of the agents'
|
|
2026
|
+
2h 46m on the host (CPU 0.0%, memory 4.0%, disk 0.0%)`. Then no host
|
|
2027
|
+
upgrade is bought that would not have helped. A store made before the
|
|
2028
|
+
waits on the model never has it.
|
|
2029
|
+
- **No upgrade is needed**, otherwise, with the three shares.
|
|
2030
|
+
|
|
2031
|
+
The agents' time on the host is the seconds their tools ran, from the
|
|
2032
|
+
splits, an agent's second each: two agents on the host for a second are two
|
|
2033
|
+
seconds of it. A reading counts for the verdict by the agents' time on the
|
|
2034
|
+
host in it, each split counted for the part of its reading in the period,
|
|
2035
|
+
so time at the limit while the agents waited on the model or on you, or
|
|
2036
|
+
with no split, counts for none of it.
|
|
2037
|
+
|
|
2038
|
+
```
|
|
2039
|
+
The host from 2026-11-22 17:20 to 2026-11-29 17:20 (7d)
|
|
2040
|
+
recorded 9h 41m of 7d 00h
|
|
2041
|
+
missing 6d 14h, shown as missing, not idle: no reading was taken then
|
|
2042
|
+
CPU at its limit 2h 03m, 21.2% of the recorded time (at least 90% busy across all cores)
|
|
2043
|
+
memory at its limit 0s, 0.0% of the recorded time (memory pressure at warning or critical)
|
|
2044
|
+
disk at its limit 0s, 0.0% of the recorded time (under 10% free on the disk holding the home folder)
|
|
2045
|
+
recording used 0.22% of the CPU, all cores together, on average
|
|
2046
|
+
|
|
2047
|
+
By day:
|
|
2048
|
+
...
|
|
2049
|
+
|
|
2050
|
+
Longest stretches with CPU or memory at its limit:
|
|
2051
|
+
2026-11-29 14:02:40 for 12m 30s, CPU at its limit
|
|
2052
|
+
LAB-150 build step CPU 61.4%, memory 3412 MB
|
|
2053
|
+
LAB-151 write-up phase CPU 4.2%, memory 1204 MB
|
|
2054
|
+
LAB-150 ocnus test run 2026-11-29 14:02 CPU 52.8%, memory 1830 MB
|
|
2055
|
+
2026-11-28 10:41:10 for 4m 20s, CPU and memory at their limit
|
|
2056
|
+
LAB-149 review step CPU 48.0%, memory 1890 MB
|
|
2057
|
+
LAB-149 ocnus test run 2026-11-28 10:41 CPU 41.5%, memory 1795 MB
|
|
2058
|
+
|
|
2059
|
+
Steps that used the most CPU time:
|
|
2060
|
+
LAB-150 build step CPU time 1h 12m, ran 2h 40m
|
|
2061
|
+
LAB-149 review step CPU time 22m 05s, ran 51m 10s
|
|
2062
|
+
Steps that held the most memory at once:
|
|
2063
|
+
LAB-150 build step memory 3412 MB, ran 2h 40m
|
|
2064
|
+
LAB-149 review step memory 1890 MB, ran 51m 10s
|
|
2065
|
+
Phases that used the most CPU time:
|
|
2066
|
+
LAB-150 build phase CPU time 1h 31m, ran 3h 48m
|
|
2067
|
+
LAB-151 write-up phase CPU time 9m 40s, ran 1h 05m
|
|
2068
|
+
Phases that held the most memory at once:
|
|
2069
|
+
LAB-150 build phase memory 3412 MB, ran 3h 48m
|
|
2070
|
+
LAB-151 write-up phase memory 1204 MB, ran 1h 05m
|
|
2071
|
+
Test runs that used the most CPU time:
|
|
2072
|
+
LAB-150 ocnus 2026-11-29 14:02 CPU time 6m 10s, ran 2m 05s
|
|
2073
|
+
LAB-149 ocnus 2026-11-28 10:41 CPU time 5m 58s, ran 2m 01s
|
|
2074
|
+
Test runs that held the most memory at once:
|
|
2075
|
+
LAB-150 ocnus 2026-11-29 14:02 memory 1830 MB, ran 2m 05s
|
|
2076
|
+
LAB-149 ocnus 2026-11-28 10:41 memory 1795 MB, ran 2m 01s
|
|
2077
|
+
|
|
2078
|
+
Where the steps' time went:
|
|
2079
|
+
all agents open 3h 31m: on the host 1h 02m, waiting on the model 1h 49m, the rest 40m 00s
|
|
2080
|
+
LAB-150 build step open 2h 40m: on the host 51m 20s, waiting on the model 1h 22m, the rest 26m 40s
|
|
2081
|
+
LAB-149 review step open 51m 10s: on the host 10m 40s, waiting on the model 27m 00s, the rest 13m 30s
|
|
2082
|
+
1 step had no split, as an agent's time is split only when it starts in Claude Code while recording is on
|
|
2083
|
+
|
|
2084
|
+
The network may be the cause: 14 of 412 waits on the model were slow (over twice the median of 6.2s) while CPU, memory and disk were below their limit.
|
|
2085
|
+
|
|
2086
|
+
Verdict: too little data yet: 2 steps had their time split, with 1h 02m of the agents' time on the host, and a verdict takes at least 10 steps and 1h 00m.
|
|
2087
|
+
```
|
|
2088
|
+
|
|
2089
|
+
- **In a worktree**, `./cli/ocnus host` and `./cli/ocnus host report`
|
|
2090
|
+
read as the installed copy does; `on`, `off` and `record` are refused.
|
|
2091
|
+
|
|
2092
|
+
## What a repo provides
|
|
2093
|
+
|
|
2094
|
+
ocnus knows nothing about how a repo is built or run. A repo says so
|
|
2095
|
+
itself, in a [justfile](https://just.systems) at its root, with recipes that
|
|
2096
|
+
have the same names in every repo. ocnus only knows the names.
|
|
2097
|
+
|
|
2098
|
+
| Recipe | What it must do | Used by |
|
|
2099
|
+
|---|---|---|
|
|
2100
|
+
| `setup` | Make a fresh checkout ready to work in: install dependencies and anything else a new worktree lacks. Safe to run twice. Called with group names (`just setup athlete coach`), make ready only what those groups need, and fail with a clear message for a group the repo does not have. | `ocnus task start`, when `OCNUS_SETUP=1` |
|
|
2101
|
+
| `made-by-setup` | Print what `setup` makes again, as patterns like `.gitignore`'s, one per line, such as `node_modules/`. Print nothing else, and change nothing. | `ocnus task finish`, which removes the git-ignored files these match with the worktree, and stops for any other ignored file |
|
|
2102
|
+
|
|
2103
|
+
```just
|
|
2104
|
+
setup:
|
|
2105
|
+
npm install
|
|
2106
|
+
|
|
2107
|
+
# What setup makes again, so a task can throw it away.
|
|
2108
|
+
made-by-setup:
|
|
2109
|
+
@echo node_modules/
|
|
2110
|
+
@echo dist/
|
|
2111
|
+
```
|
|
2112
|
+
|
|
2113
|
+
- **`made-by-setup` says which ignored files are not work.** A task's
|
|
2114
|
+
worktree is checked out from the branch, so the recipe is the branch's own.
|
|
2115
|
+
It runs in the worktree, and its `@` keeps `just` from printing each line
|
|
2116
|
+
before it runs. A pattern that matches a folder matches everything in it;
|
|
2117
|
+
a folder it matches only part of is checked file by file. A repo without
|
|
2118
|
+
the recipe can still finish a task with no ignored files in it.
|
|
2119
|
+
|
|
2120
|
+
- **Only a justfile at the repo's own root counts**: `justfile`, `Justfile` or
|
|
2121
|
+
`.justfile`. One in a folder above is never used.
|
|
2122
|
+
- **A repo with several codebases names its own groups**, such as `athlete`
|
|
2123
|
+
for a web app with the API and database it needs. A target like
|
|
2124
|
+
`app:athlete` reaches the recipe as `just setup athlete`. A repo with one
|
|
2125
|
+
codebase needs none: its `setup` takes no arguments.
|
|
2126
|
+
- **`ocnus status` notes** each repo with no justfile or no `setup`
|
|
2127
|
+
recipe. A note is not a problem: tasks in that space still start, without
|
|
2128
|
+
setup.
|
|
2129
|
+
- **`just` has to be installed** on the machine. Without it, tasks start
|
|
2130
|
+
without setup and `ocnus status` says so.
|
|
2131
|
+
- **Say in the repo's docs how a fresh checkout is made ready.** While setup
|
|
2132
|
+
is off, the `sdlc-build` skill reads the repo's `CLAUDE.md`, `AGENTS.md` or
|
|
2133
|
+
`README` to learn what to install before it runs the tests, and installs
|
|
2134
|
+
that into the task's worktree. It installs only: it starts no app, server
|
|
2135
|
+
or database, and asks you when the tests need one running or a tool
|
|
2136
|
+
installed on the machine.
|
|
2137
|
+
|
|
2138
|
+
## ocnus's variables
|
|
2139
|
+
|
|
2140
|
+
ocnus reads a few environment variables. Each can be exported in your
|
|
2141
|
+
shell, or written as a `NAME=value` line in ocnus's env file,
|
|
2142
|
+
`~/.config/ocnus/.env`.
|
|
2143
|
+
|
|
2144
|
+
| Variable | What it sets |
|
|
2145
|
+
|---|---|
|
|
2146
|
+
| `LINEAR_API_KEY` | Your Linear API key. `ocnus linear key` writes this line for you. |
|
|
2147
|
+
| `ANTHROPIC_API_KEY` | The Anthropic API key every agent runs on with billing on `api` (see [Billing](#billing)). `ocnus billing key` writes this line for you. Read from the file alone: an `ANTHROPIC_API_KEY` you export is never taken for it. |
|
|
2148
|
+
| `OCNUS_HARNESS` | The harness: the command `task new` and `task build` start the agent with. `claude` when it is not set, which starts with a phase profile. Another harness starts as it is, with no profile. |
|
|
2149
|
+
| `OCNUS_SQLITE` | The command that records hand-offs. `sqlite3` when it is not set. |
|
|
2150
|
+
| `OCNUS_SETUP` | `1` makes `task start` run each repo's `setup` recipe. Off when it is not set, for now. |
|
|
2151
|
+
| `HERDR_APP_HOME` | Herdr's folder. `~/.config/herdr-app` when it is not set. |
|
|
2152
|
+
| `CLAUDE_CONFIG_DIR` | Claude Code's folder, where skills and phase profiles are linked and the dev profiles written. `~/.claude` when it is not set. |
|
|
2153
|
+
| `OCNUS_HOME` | ocnus's own folder. `~/.config/ocnus` when it is not set. Export only: it says where the env file is, so the file cannot set it. |
|
|
2154
|
+
| `OCNUS_LIVE` | `1` lets the copy of ocnus in a git worktree of its repo change the machine, for that run (see [Changing things](#changing-things)). Export only, best on the command line: the file cannot set it, so it is never left on. |
|
|
2155
|
+
| `OCNUS_SPACE`, `OCNUS_CARD` | The space and the card `task build` names to its agent, so that every command the agent runs has them, and `ocnus tests run` records its test runs as that card's (see [Recording the host](#recording-the-host)). Set by `task build`: the file cannot set them, so a test run outside an agent's tab is never named a card. |
|
|
2156
|
+
|
|
2157
|
+
- **Use the file for anything a Herdr mod's run of ocnus needs.** Herdr
|
|
2158
|
+
starts a command without your shell's exports, so a variable set only in your
|
|
2159
|
+
shell profile is missing there. The file is read every time, wherever
|
|
2160
|
+
ocnus is started from.
|
|
2161
|
+
- **A variable you export wins** over its line in the file, unless it is
|
|
2162
|
+
empty: an empty one counts as not set.
|
|
2163
|
+
- **Of two lines for a name, the last is used**, so a line added at the end
|
|
2164
|
+
takes over.
|
|
2165
|
+
- **The file is read, never run.** A line that is not `NAME=value` is skipped,
|
|
2166
|
+
and nothing in a value is expanded. These are allowed: `export` before the
|
|
2167
|
+
name, spaces around the `=`, one pair of quotes around the value, and a `#`
|
|
2168
|
+
comment after a value that has no quotes. Only ocnus's own variables are
|
|
2169
|
+
taken from it: the ones in the table, and any other whose name starts with
|
|
2170
|
+
`OCNUS_`. A line for anything else, such as `PATH`, is ignored.
|
|
2171
|
+
- **The keys stay with ocnus.** The other variables are passed on to
|
|
2172
|
+
the programs ocnus starts, so they find the same folders it does. The
|
|
2173
|
+
Linear key from the file is not: it reaches only `curl`, on its stdin. Nor
|
|
2174
|
+
is the Anthropic key: it reaches only Claude Code, from
|
|
2175
|
+
`ocnus billing key --print`, which an agent's `apiKeyHelper` runs.
|
|
2176
|
+
- **An agent's `claude` runs on your Claude subscription**, unless billing is
|
|
2177
|
+
on `api` (see [Billing](#billing)). `task new` and
|
|
2178
|
+
`task build` start `claude` through `env -u ANTHROPIC_API_KEY -u
|
|
2179
|
+
ANTHROPIC_AUTH_TOKEN`. Either variable, exported in your shell, would put
|
|
2180
|
+
the agent on the API instead of the subscription you signed in to with
|
|
2181
|
+
`/login`, since Claude Code takes them before that sign-in. They are taken
|
|
2182
|
+
out as `claude` starts, not by ocnus: `task new`'s agent starts in a
|
|
2183
|
+
login shell that reads your shell profile again, and that profile may
|
|
2184
|
+
export them. `CLAUDE_CODE_OAUTH_TOKEN`, a subscription token, reaches it as
|
|
2185
|
+
it is. Another harness starts with every variable, as it always has.
|
|
2186
|
+
- **A Claude Code session's variables stay out of Herdr.** Run from inside
|
|
2187
|
+
Claude Code, as an agent runs it, ocnus has that session's variables,
|
|
2188
|
+
such as `CLAUDECODE` and `CLAUDE_CODE_CHILD_SESSION`. It runs `hc` and
|
|
2189
|
+
`herdr-app` without any variable whose name starts with `CLAUDE`, apart from
|
|
2190
|
+
`CLAUDE_CONFIG_DIR`, which reaches them as it is. Every other variable
|
|
2191
|
+
reaches them unchanged. This is because any `hc` command starts herdr-core
|
|
2192
|
+
when it is not running, and herdr-core keeps the environment it was started
|
|
2193
|
+
with until it is stopped. A `claude` in one of its terminals that sees
|
|
2194
|
+
`CLAUDE_CODE_CHILD_SESSION` says transcript saving is off and saves none, so
|
|
2195
|
+
a later `claude --continue` in that tab has nothing to resume.
|
|
2196
|
+
- An `hc` command that you or an agent run inside Claude Code, not through
|
|
2197
|
+
ocnus, can still start herdr-core with them. That is Herdr's to fix.
|
|
2198
|
+
- herdr-core started that way keeps them until it starts again. To give it
|
|
2199
|
+
a clean environment, run `hc server restart --fresh` from a terminal
|
|
2200
|
+
outside Herdr. Its terminals keep running.
|
|
2201
|
+
- **Keep the file to yourself.** It holds your keys. `linear key` and
|
|
2202
|
+
`billing key` make it readable only by you; if you make it by hand, run
|
|
2203
|
+
`chmod 600 ~/.config/ocnus/.env`. A file ocnus cannot read stops every
|
|
2204
|
+
command, with a message saying so, rather than being skipped, and so does
|
|
2205
|
+
anything at `.env` that is not a file, such as a folder.
|
|
2206
|
+
- **A linked env file, or one in a git repo, is left alone.** If `.env` is a
|
|
2207
|
+
link, for example into a dotfiles repo, or ocnus's folder is inside a git
|
|
2208
|
+
repo, as it is when GNU Stow links the whole folder into one, `linear key`
|
|
2209
|
+
and `billing key` save nothing and say so, so that the key does not land in
|
|
2210
|
+
that repo. Add the `LINEAR_API_KEY` or `ANTHROPIC_API_KEY` line yourself,
|
|
2211
|
+
once the repo ignores the file.
|
|
2212
|
+
|
|
2213
|
+
## Changing things
|
|
2214
|
+
|
|
2215
|
+
- Work from a git clone, not the npm install: clone the repo and run
|
|
2216
|
+
`cli/ocnus install` from it. A clone links Herdr to the working files and
|
|
2217
|
+
updates with `git pull`. If the machine was set up through npm first, remove
|
|
2218
|
+
the old links in `~/.config/herdr-app/mods` and `layouts` before installing
|
|
2219
|
+
from the clone, because existing links are never replaced.
|
|
2220
|
+
- Edit files in the clone, not in `~/.config/herdr-app`: the links mean they
|
|
2221
|
+
are the same files.
|
|
2222
|
+
- Herdr does not notice edits made through a link straight away. Run
|
|
2223
|
+
`ocnus update --no-pull` to refresh it without pulling.
|
|
2224
|
+
- Run `herdr-app check herdr/mods/<name>` after editing a mod. The
|
|
2225
|
+
`jsconfig.json` and `.d.ts` files it writes into the mod's folder are
|
|
2226
|
+
git-ignored, and go with a task's worktree when the task finishes.
|
|
2227
|
+
- A worktree's copy of the CLI, `./cli/ocnus` in a git worktree of this
|
|
2228
|
+
repo, runs only the commands that read: `help`, `status`, `space ls`,
|
|
2229
|
+
`space team <name>`, `profile ls`, `linear archive` (alone or with
|
|
2230
|
+
`--json`), `tests` (alone or with `--json`), `billing` (alone or with
|
|
2231
|
+
`--json`), `task ls`, `task log`, `host` and `host report`. Any other command stops
|
|
2232
|
+
before it changes anything, and says to run plain `ocnus` for a card's
|
|
2233
|
+
own steps, to write a test case to try the command, or to run it for real
|
|
2234
|
+
with `OCNUS_LIVE=1 ./cli/ocnus …`. Plain `ocnus` is never
|
|
2235
|
+
stopped.
|
|
2236
|
+
- Herdr's shipped layouts and mods are read-only. To build on one, clone it
|
|
2237
|
+
(`herdr-app do layout.clone '{"name":"main","as":"<name>"}'`) and move the
|
|
2238
|
+
clone here.
|