@johngaynor/ocnus 2.0.1-next.7 → 2.0.1-next.73

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.
Files changed (43) hide show
  1. package/README.md +518 -98
  2. package/cli/lib/agents.sh +32 -16
  3. package/cli/lib/asks.sh +762 -0
  4. package/cli/lib/banner.sh +181 -0
  5. package/cli/lib/brief.sh +375 -0
  6. package/cli/lib/chain.sh +363 -0
  7. package/cli/lib/close.sh +5 -3
  8. package/cli/lib/cost.sh +500 -0
  9. package/cli/lib/finish.sh +30 -4
  10. package/cli/lib/github.sh +106 -26
  11. package/cli/lib/guard.sh +39 -10
  12. package/cli/lib/handoff.sh +196 -31
  13. package/cli/lib/host.sh +340 -384
  14. package/cli/lib/linear.sh +552 -56
  15. package/cli/lib/links.sh +6 -3
  16. package/cli/lib/merges.sh +126 -27
  17. package/cli/lib/sessions.sh +132 -0
  18. package/cli/lib/settings.sh +31 -15
  19. package/cli/lib/task.sh +169 -54
  20. package/cli/lib/tests.sh +302 -7
  21. package/cli/lib/usage.sh +204 -0
  22. package/cli/ocnus +274 -76
  23. package/herdr/README.md +930 -232
  24. package/herdr/layouts/default.json +30 -11
  25. package/herdr/layouts/showcase.json +291 -0
  26. package/herdr/layouts/vibe.json +162 -0
  27. package/herdr/layouts/vibe.svg +41 -0
  28. package/herdr/mods/agent-settings/main.js +19 -7
  29. package/herdr/mods/memory/main.js +128 -0
  30. package/herdr/mods/memory/mod.json +1 -0
  31. package/herdr/mods/memory/reading.js +88 -0
  32. package/herdr/mods/names/main.js +22 -4
  33. package/herdr/mods/step-counts/main.js +281 -0
  34. package/herdr/mods/step-counts/mod.json +1 -0
  35. package/herdr/mods/usage/main.js +149 -0
  36. package/herdr/mods/usage/mod.json +1 -0
  37. package/package.json +1 -1
  38. package/prompts/task-new.md +1 -1
  39. package/skills/brief/SKILL.md +8 -0
  40. package/skills/sdlc-breakdown/SKILL.md +66 -18
  41. package/skills/sdlc-build/SKILL.md +6 -2
  42. package/skills/sdlc-pr/SKILL.md +2 -2
  43. package/skills/sdlc-review/SKILL.md +5 -5
package/README.md CHANGED
@@ -1,3 +1,11 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="assets/banner-dark.gif">
4
+ <source media="(prefers-color-scheme: light)" srcset="assets/banner-light.gif">
5
+ <img src="https://raw.githubusercontent.com/johngaynor/ocnus-ai/main/assets/banner-light.gif" width="822" alt="OCNUS in block letters, beside Ocnus on his rock plaiting a rope that his donkey eats as fast as he makes it">
6
+ </picture>
7
+ </p>
8
+
1
9
  # ocnus
2
10
 
3
11
  A software factory: agent skills, and the Herdr setup to run them, that take a
@@ -16,11 +24,11 @@ Six skills do the work, one for each step an agent runs, and a seventh,
16
24
  |---|---|
17
25
  | `sdlc-define` | The define step: sets a card's type and writes its Specification |
18
26
  | `sdlc-plan` | The plan step: reads the card and the code, and writes the Plan |
19
- | `sdlc-breakdown` | The breakdown step: decides whether the card is one piece or several slices, then asks you to approve it, unless you have turned that approval off |
27
+ | `sdlc-breakdown` | The breakdown step: decides whether the card is one piece or several slices, then asks you to approve it, unless you have turned that approval off, and once it is approved records in Linear the other cards it waits on, and the cards in Todo that wait on it |
20
28
  | `sdlc-build` | The build step: builds an approved card in its task, making the change the Plan describes, running the tests and committing, pushing nothing |
21
29
  | `sdlc-review` | The review step: checks the build step's work against the card's Done when, writes what it found on the card as its Review, and sends what is not met back to the build step |
22
30
  | `sdlc-pr` | The pr step: pushes a reviewed card's branch, opens its pull requests, moves the card to In Review and waits while you merge them, running no watch of its own: ocnus's watch records the merge and finishes the task. It never merges |
23
- | `brief` | Not a step: a catch-up on the session, in no more than five lines and three parts: the original task, what has happened so far, and what the agent is working on right now. In a session ocnus started for a card, it reads the card, with its parent card and Linear project, `task log` and the branch's commits. For a slice it reads the parent card too, and gives the card's place among its slices, as slice 2 of 4, and which of them have shipped; for a card with slices of its own, which of those have. Say "brief" or `/brief` in any Claude Code session for one. It records nothing, is never an answer to a question, and never stops a run |
31
+ | `brief` | Not a step: a catch-up on the session, in no more than five lines and three parts: the original task, what has happened so far, and what the agent is working on right now. In a session ocnus started for a card, it reads the card, with its parent card and Linear project, `task log` and the branch's commits. For a slice it reads the parent card too, and gives the card's place among its slices, as slice 2 of 4, and which of them have shipped; for a card with slices of its own, which of those have. Say "brief" or `/brief` in any Claude Code session for one, or run `ocnus task brief <space> <card>` for the brief of a card's agent without going to its tab. It records nothing, is never an answer to a question, and never stops a run |
24
32
 
25
33
  They live in [skills/](skills/). `ocnus install` links them into
26
34
  `~/.claude/skills`, so any Claude Code session on the machine can run one by
@@ -36,8 +44,10 @@ the Steps panel in Herdr shows the same for the card whose tab is selected.
36
44
  With no card, both list the space's cards and where each stands.
37
45
  A `needs-human` stop opens with a brief, above its block, with the question
38
46
  as what is happening now, and "brief" or `/brief` gets one at any time. A
39
- brief is in the session only: it is never recorded, so the log and the Steps
40
- panel read after it as they did before.
47
+ brief is never a hand-off: it is never recorded, so the log and the Steps
48
+ panel read after it as they did before. `ocnus task brief <space> <card>`
49
+ gives you the brief of a card's agent from outside its tab, and leaves the
50
+ agent alone (see [Tasks](#tasks)).
41
51
 
42
52
  **What a machine needs.** ocnus runs on macOS or Linux. It needs:
43
53
 
@@ -65,7 +75,8 @@ worked out. Until then the build step itself installs into each worktree what
65
75
  the tests need, and [`just`](https://just.systems) matters only once setup is
66
76
  on; see [what a repo provides](herdr/README.md#what-a-repo-provides). On
67
77
  Linux, the CPU mod in the `default` layout shows an error where its reading
68
- would be, since it reads macOS's `/usr/bin/top`.
78
+ would be, since it reads macOS's `/usr/bin/top`, and so does the Memory mod
79
+ above it, which reads macOS's `sysctl`, `vm_stat` and `ps`.
69
80
 
70
81
  ## Setting up a machine
71
82
 
@@ -80,9 +91,32 @@ and the two phase profiles in [agents/](agents/), which it links into
80
91
  `~/.claude/agents`; see [herdr/README.md](herdr/README.md) for the full
81
92
  walkthrough. `install` ends by telling you to switch Herdr to the `default`
82
93
  layout, which holds ocnus's panels: the Ocnus spaces panel, the Cards
83
- and Steps panels, the Layout dropdown and the settings button. Herdr starts on
94
+ and Steps panels, the Step counts section right above the Usage section,
95
+ which is above Memory and CPU, the Layout dropdown and the settings button.
96
+ Herdr's own Agents section is not on it. Herdr starts on
84
97
  its own layout, which has no Layout dropdown, so the first switch is
85
- `ctrl-shift-l`, pressed until `default` shows.
98
+ `ctrl-shift-l`, pressed until `default` shows. The Layout dropdown lists
99
+ `showcase` and `vibe` too. `showcase` places every mod ocnus ships, each in
100
+ a block of its own, so that you can see each one working before you choose
101
+ what to put in a layout of your own. `vibe` is three columns for steering
102
+ every agent without reading code, with no files, diffs or split terminals,
103
+ and the dropdown again, to come back to `default`. The `layouts/vibe.json`
104
+ row in [herdr/README.md](herdr/README.md#whats-here) says what each column
105
+ holds.
106
+
107
+ In a terminal, `ocnus install` and `ocnus help`, which `ocnus` with no
108
+ command is too, open with a banner: OCNUS in block letters beside Ocnus on
109
+ his rock, plaiting a rope that his donkey eats as fast as he makes it. A
110
+ terminal at least 79 columns wide and 24 rows tall, whose `TERM` is not
111
+ `dumb`, shows the whole banner. It moves once, for about three seconds, then
112
+ stays, and the command goes on below it; Ctrl-C while it moves stops
113
+ `ocnus` before the command runs. With `NO_COLOR` set, it is still and has no
114
+ colour. Any other terminal at least 44 columns wide gets the OCNUS letters
115
+ alone, six lines, in colour unless `NO_COLOR` is set or `TERM` is `dumb`.
116
+ Piped or sent to a file, or in a terminal narrower than 44 columns, both
117
+ print what they print without it, so `ocnus help | less` reads as it
118
+ always has. No other command shows either, nor does the usage an unknown
119
+ command gets.
86
120
 
87
121
  Neither `install` nor `update` needs the Herdr app open, or even opened
88
122
  before. The mods and layouts go in Herdr's folder, `~/.config/herdr-app`,
@@ -173,7 +207,8 @@ stops `task new` and `task build` before an agent starts, saying what in it is
173
207
  wrong, and `ocnus status` says so too. The file is read with `jq`. In
174
208
  Herdr, the settings button, a cog at the right end of the tab bar, shows and
175
209
  changes the same values, and below them archiving, the tests setting, the
176
- breakdown approval and billing, which follow here, each with a click; see
210
+ breakdown approval, billing and the chain, which follow here, each with a
211
+ click; see
177
212
  [herdr/README.md](herdr/README.md#the-settings-button).
178
213
 
179
214
  The same file says whether a merged card is archived in Linear, as
@@ -211,6 +246,7 @@ otherwise: with no `"tests"` in the file, or no file, and `install` and
211
246
  ocnus tests # say which is set (--json for programs)
212
247
  ocnus tests queue # have test runs go one at a time
213
248
  ocnus tests share # have them share the processors again
249
+ ocnus tests ls # list the test runs going, and how each uses the processors (--json for programs)
214
250
  ```
215
251
 
216
252
  Sharing, runs going at the same time run one case per processor between
@@ -227,6 +263,16 @@ refused, naming both, with the file left as it was; a `"tests"` that is not
227
263
  `"share"` or `"queue"` makes the file not valid settings. A test run reads
228
264
  the file with `jq` alone, and shares when it does not find `"queue"` there.
229
265
 
266
+ `ocnus tests ls` lists the runs going, in the order they started, under a
267
+ line that says which is set. Each line names its run's card, such as
268
+ `LAB-241`, when the run was started in a task's folder, and its folder's
269
+ name otherwise, then says whether it is sharing the processors, waiting its
270
+ turn, having its turn or running with `OCNUS_TEST_JOBS`, how long ago it
271
+ started, and how many processors it holds, such as `5/10`. A run that
272
+ started before a switch and still goes the way it started, sharing though the
273
+ runs now queue, or waiting though they now share, is marked `old mode`. With
274
+ no run going it says so in one line.
275
+
230
276
  The file also says whether breakdown, the last step of the write-up phase,
231
277
  asks you to approve each card, as `"approval": {"breakdown": true}` or
232
278
  `false`. It is on until you turn it off: with no `"approval"` in the file, or
@@ -269,9 +315,10 @@ ocnus billing subscription # run them on the subscription again
269
315
  the Linear key: it is never an argument, the file is left readable by you
270
316
  alone, and a linked env file, or one in a git repo, is left alone. Only a key
271
317
  that starts `sk-ant-` is taken, and it is not checked with Anthropic. On
272
- `api`, `claude` starts with an `apiKeyHelper` in `--settings=`, a command it
273
- runs to ask ocnus for the key, so the key is in no argument and in no
274
- agent's environment, and the agent starts without asking whether to use it.
318
+ `api`, `claude` starts with an `apiKeyHelper` in `--settings=`, beside its
319
+ `statusLine`, a command it runs to ask ocnus for the key, so the key is in
320
+ no argument and in no agent's environment, and the agent starts without
321
+ asking whether to use it.
275
322
  An `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` you export is still kept from
276
323
  it, and is never taken for the saved key. On `api` with no key saved, `task
277
324
  new` and `task build` stop before an agent starts, and say how to save one. A
@@ -293,6 +340,68 @@ In Herdr, the settings button shows which is set and switches it with a
293
340
  click, through `billing subscription` and `billing api`; the key is saved in a
294
341
  terminal, with `billing key`.
295
342
 
343
+ The file also says whether the chain is on, as `"chain": true` or `false`:
344
+ whether ocnus's watch starts each card once the cards that block it are
345
+ done, so that you do not come back to start it. It is on until you turn it
346
+ off: with no `"chain"` in the file, or no file, and `install` and `update`
347
+ never write one.
348
+
349
+ ```sh
350
+ ocnus chain # say whether it is on (--json for programs)
351
+ ocnus chain off # have the watch start no card
352
+ ocnus chain on # have it start them again
353
+ ```
354
+
355
+ With it on, the watch starts a card that `task start` held once its blockers
356
+ are done: at the merge of the last one, or within about half an hour when
357
+ the last one was closed some other way; see [Tasks](#tasks). With it
358
+ off, the watch starts no card, and a held card waits in Todo until you start
359
+ it, with `task start` or with `ocnus task ready <space>`, which starts
360
+ every card of the space's teams that is ready. `--json` prints it as one
361
+ line, such as `{"file":"…/settings.json","chain":true}`. `on` and `off` leave
362
+ the rest of the file as it is, and anything else is refused, with the file
363
+ left as it was; a `"chain"` that is not `true` or `false` makes the file not
364
+ valid settings. In Herdr, the settings button shows it as Start blocked
365
+ cards, and switches it with a click.
366
+
367
+ On the subscription, the Usage section, above Memory and CPU in the `default`
368
+ layout's sidebar, shows how much of your Claude subscription's five-hour and
369
+ weekly usage limits is used, as a percentage and a bar each, and when each
370
+ resets.
371
+
372
+ ```sh
373
+ ocnus usage # say the same in words (--json for programs, which the section reads every 30 seconds)
374
+ ```
375
+
376
+ The reading comes from the agents ocnus starts. On either account,
377
+ `claude` starts with a `statusLine` in `--settings=` that runs
378
+ `ocnus usage record` with the agent's space, card, phase and account. It
379
+ saves the limits Claude Code hands it to `~/.config/ocnus/usage.json`, adds
380
+ what the agent's session has used to `~/.config/ocnus/cost.db` for
381
+ `task log` (see [Tasks](#tasks)), and prints nothing, so the agents' status
382
+ line is blank. An agent on `api` has no limits to hand it, so the reading is
383
+ as fresh as the last turn of an agent on the subscription. Older than ten
384
+ minutes, it says how old it is, and a limit whose reset has passed since
385
+ shows no number. With no reading, or one that cannot be read, the section
386
+ shows one line saying so. Claude Code sessions you start yourself are not
387
+ read. See [herdr/README.md](herdr/README.md#the-usage-section).
388
+
389
+ With billing on `api`, `ocnus usage` also says what the agents ocnus
390
+ started on an Anthropic API key have spent: today, from midnight, with the
391
+ card that has spent the most today, and this week, from Monday at midnight,
392
+ with how many cards that is for and how many of them have merged, both in
393
+ this machine's time:
394
+
395
+ ```
396
+ Spent on the API key today: $4.45, most of it on ABC-1 in my-space ($3.10)
397
+ Spent on the API key this week, from Monday 2026-11-30: $6.95, on 5 cards, 1 of them merged
398
+ ```
399
+
400
+ It is the cost Claude Code reports for each agent's session, added up by the
401
+ day each part of it was recorded. Work an agent did on the subscription is
402
+ in none of it, and on the subscription `usage` gives no spend. `--json`
403
+ gives it as `spend`, which is `null` on the subscription.
404
+
296
405
  ## Spaces
297
406
 
298
407
  A space groups the repos that belong together, with a `SPACE.md` saying
@@ -316,8 +425,9 @@ than making a second one.
316
425
 
317
426
  In Herdr, the `+` at the top of the Ocnus spaces panel does the same
318
427
  without a terminal: choose a repo's folder, name the space in the New space
319
- dialog, and it opens. The panel is the `ocnus-spaces` mod, on the
320
- `default` layout; Herdr's own list of spaces is its `spaces` mod.
428
+ dialog, and it opens. The panel is the `ocnus-spaces` mod, on all three of
429
+ ocnus's layouts, `default`, `showcase` and `vibe`; Herdr's own list of
430
+ spaces is its `spaces` mod.
321
431
 
322
432
  Your spaces live in `~/.config/ocnus/spaces`, outside this repo, so
323
433
  they are never published and survive updates.
@@ -338,7 +448,8 @@ A task is one piece of work in a space, usually a Linear card. Two commands
338
448
  make it, in this order: `task new`, then `task start`, which the write-up phase
339
449
  runs as soon as you approve the card: approving a card starts it. A card you
340
450
  want to hold, leave unapproved. A card that another card blocks waits by
341
- itself: `task start` holds it until every card that blocks it is done.
451
+ itself: `task start` holds it until every card that blocks it is done, and
452
+ ocnus's watch starts it then.
342
453
 
343
454
  To see which cards there are first, `task ls` lists the open cards of the
344
455
  space's Linear teams, under their statuses:
@@ -349,6 +460,13 @@ ocnus space team my-space ABC # once: the team whose cards are ABC-122
349
460
  ocnus task ls my-space
350
461
  ```
351
462
 
463
+ With `--json`, for programs, the list also says which cards are held and
464
+ which cards each of them waits on: a card is held while it is in a
465
+ not-started status, such as Todo, and a card that blocks it, or its parent,
466
+ is not done, which is when `task start` holds it. Each card names its parent
467
+ there too, with its place among the parent's sub-issues and how many of them
468
+ are done.
469
+
352
470
  It asks Linear itself, with no agent running. `ocnus status` checks the
353
471
  saved key with Linear each time it runs: it says whose the key is when it
354
472
  works, notes when no key is saved or when the key could not be checked, and
@@ -356,9 +474,9 @@ lists a key Linear rejects as a problem, which makes `status` exit non-zero.
356
474
  For a key that works, it also checks whether the key can change cards, by
357
475
  asking Linear to change a card that cannot exist, which changes nothing. A
358
476
  key with Read permission alone lists cards, so `task ls` and the Cards panel
359
- work with it, but `linear type`, `linear section`, `linear slices` and
360
- `linear move` fail with it, and the card skills fall back to the agent's own
361
- Linear tools.
477
+ work with it, but `linear type`, `linear section`, `linear slices`,
478
+ `linear block` and `linear move` fail with it, and the card skills fall
479
+ back to the agent's own Linear tools.
362
480
  `status` lists such a key as a problem too, and exits non-zero. `linear key`
363
481
  checks the same before it saves a key: it saves one that cannot change cards,
364
482
  then says so. Either way, the fix is a key with Write permission, saved with
@@ -385,6 +503,17 @@ running, `task new` starts it, without the variables of a Claude Code session
385
503
  it was run from, so that a `claude` in its terminals still saves its
386
504
  transcript. See [herdr/README.md](herdr/README.md#writing-the-card-up).
387
505
 
506
+ Before it asks you to approve, breakdown looks for the cards this one waits
507
+ on: every other card that the card, or one of its slices, needs merged
508
+ first, a slice of another card too, and any card already approved and in
509
+ Todo that needs this one first. The Breakdown and the summary you approve
510
+ from name them. Nothing is recorded before you approve. Once you do, the
511
+ agent records them in Linear with `ocnus linear block`, before `task start`
512
+ runs: each blocker on the card, or on the slice it blocks, and this card as
513
+ a blocker of each card in Todo that needs it, so that one is not started
514
+ first. `ocnus linear read <card>` shows the cards that block a card and
515
+ the cards it blocks, each with its status.
516
+
388
517
  Recording your approval moves the card in Linear to its team's first
389
518
  not-started status (Todo in Lab), and each of its sub-issues with it. When a
390
519
  card cannot be moved, the approval is still recorded, and the agent tells you
@@ -428,8 +557,59 @@ row has a line under it that says the setting approved it:
428
557
  approved: by the setting (ocnus approval --breakdown off), not the human
429
558
  ```
430
559
 
560
+ Under each row, `task log` also says what the card's agents used in the
561
+ step that row ended. At the end it says what the step the card is in has
562
+ used so far, and what the card has used in all:
563
+
564
+ ```
565
+ 2026-11-30T10:30:11Z plan done, then breakdown 12m 04s
566
+ tokens: 410k in (93% from cache), 21k out, ≈$1.42 at API prices
567
+ ...
568
+ 2026-11-30T11:52:40Z build done, then review 38m 15s
569
+ tokens: 2.1M in (95% from cache), 64k out, ≈$4.80 at API prices
570
+ so far in review: 320k in (97% from cache), 9k out, ≈$0.41 at API prices
571
+ in all: 3.2M in (94% from cache), 120k out, ≈$7.95 at API prices
572
+ ```
573
+
574
+ - **What is counted.** Each model turn of the Claude Code sessions the card's
575
+ agents ran in, the turns of the subagents they started included, each
576
+ counted once. A step's figures are those of the turns after the row
577
+ before it, up to its own row. The write-up agent's last words, after
578
+ `task start` has recorded its row, count on that row, and the build
579
+ phase's agent's words after its merge is recorded count on the merge's
580
+ row.
581
+ - **The tokens.** `in` is all that went into the model: new input, and
582
+ what was read from the prompt cache and written to it. The share in
583
+ brackets is the cache share: how much of what went in was read from the
584
+ cache. `out` is what the model wrote. `--json` gives each of the four,
585
+ input, output, cache read and cache write, and their total.
586
+ - **The cost.** It is the cost Claude Code reports for each agent's session,
587
+ which it works out at API prices. On the Claude subscription that is not
588
+ money paid, and it says so: `≈$1.42 at API prices`. On an Anthropic API
589
+ key, with billing on `api`, it is money spent: `$1.42 spent on the API
590
+ key`. A step or a card with some of each says both:
591
+ `≈$1.42 at API prices, $0.40 of it spent on the API key`. Which it is goes
592
+ by the account the agent ran on, whatever `ocnus billing` says when you
593
+ read it.
594
+ - **Not recorded.** The figures come from the agents' status line, so a step
595
+ whose agent ran before this version, or whose figures could not be
596
+ recorded, such as with no `sqlite3`, says `not recorded`, never 0. A card
597
+ with none says `tokens: not recorded for this card` once. A total that
598
+ leaves a step out says `not the whole card` and how many steps are not
599
+ recorded. A step that used nothing, such as a `start` row after which the
600
+ write-up agent said nothing more, says 0.
601
+ - **When they move.** Each time an agent's status line updates, which Claude
602
+ Code does as the agent works, so the step under way shows what it has used
603
+ so far. They are kept in `~/.config/ocnus/cost.db`, which `task log`
604
+ only reads, so they stay once the card has merged, its task is finished
605
+ and Claude Code no longer keeps the session's transcript.
606
+ - **What is not in it.** Claude Code sessions you start yourself, and, for a
607
+ card that was sliced, its slices' figures: each slice has its own.
608
+
431
609
  Leave the card out to see every card in the space that has hand-offs,
432
- newest first, with where each stands, such as waiting on you, or merged:
610
+ newest first, with where each stands, such as waiting on you, or merged,
611
+ and what it has used in all, or `tokens not recorded`. `--json` gives every
612
+ card's total in one call:
433
613
 
434
614
  ```sh
435
615
  ocnus task log my-space
@@ -457,6 +637,180 @@ the card's own log and in the Steps and Cards panels, which draw what
457
637
  request is closed or in conflict, the card shows as waiting on you, as
458
638
  before.
459
639
 
640
+ On the `default` layout, the Step counts section, right above Usage in the
641
+ sidebar, shows where every card of the space that is showing stands, at a
642
+ glance: the seven steps, from `define` to `pr`, each with a dot for every
643
+ card that stands on it, and how many there are. A dot is amber when its card
644
+ needs you, waiting on you or with its agent blocked on a prompt in its tab;
645
+ blue while its agent is working; green, at `pr`, once the card is ready to
646
+ merge, with its pull requests all open, none in conflict and every check on
647
+ them passed; and red when `task log` says its agent is stuck or has stopped,
648
+ or that a pull request of the card's is closed, in conflict or unwatched.
649
+ `start` has no dots: it says how many approved cards are held, their work
650
+ not yet started. The section draws what `task log <space> --json` counts,
651
+ and updates on its own. See
652
+ [herdr/README.md](herdr/README.md#the-step-counts-section).
653
+
654
+ `task asks` lists every question that waits on you in a space, oldest first,
655
+ so that you, or a board, can see what each agent is asking without opening
656
+ its tab:
657
+
658
+ ```sh
659
+ ocnus task asks my-space
660
+ ```
661
+
662
+ ```
663
+ Questions waiting on you in 'my-space', oldest first
664
+ ABC-122 approval 41 asked 2026-12-04T10:41:53Z, 12m 05s ago
665
+ Approve ABC-122 as specified, planned and broken down, and start its build phase?
666
+ options: approve | change breakdown | change plan | change specification
667
+ ABC-98 permission p3f9a12c4 asked 2026-12-04T10:52:10Z, 1m 48s ago
668
+ Allow Bash to run: npm test -- orders
669
+ options: allow | refuse | allow from now on
670
+ ABC-77 merge 38 asked 2026-12-04T10:53:40Z, 18s ago, agent not running
671
+ Merge https://github.com/acme/api/pull/7. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
672
+ pull requests: https://github.com/acme/api/pull/7
673
+ options: merge | a change you want made | stop here
674
+ ```
675
+
676
+ Each line names the card, the question's kind, its id, and when it was
677
+ asked. Under it come the question's text, any summary the agent recorded,
678
+ and its options. With none waiting it says so. A question has one of four
679
+ kinds:
680
+
681
+ | Kind | What is asking | Its options |
682
+ |---|---|---|
683
+ | `approval` | sdlc-breakdown, for your approval of the card | the skill's own: `approve`, or the section to change |
684
+ | `merge` | sdlc-pr, waiting for you to merge the card's pull requests. It comes with the links of those still open, as ocnus's watch last saw them, or as the question names them before its first pass | `merge`, a change you want made, or to stop |
685
+ | `choice` | any other question an agent handed off as `needs-human`, such as which way to settle a conflict | the agent's own list |
686
+ | `permission` | Claude Code, before it runs a tool. The text names the tool and what it would do: the command, the file or the address | `allow`, `refuse` and, where the prompt offers it, `allow from now on` |
687
+
688
+ The first three are a card's latest hand-off, while that is `needs-human`,
689
+ and the id is its number in the store. A permission prompt's id starts with
690
+ `p`. `--json` prints the same as one line, for a program:
691
+ `{"space": …, "questions": […]}`, the list empty when none waits. Each
692
+ question has its `id`, `card`, `kind`, `text`, `options` (a list), `at` (when
693
+ it was asked, in UTC), `seconds` (how long ago), `summary` (or `null`),
694
+ `words` (whether it can be answered in your own words) and `running`
695
+ (whether its agent is running, to take an answer). A merge also has `pulls`,
696
+ the links of its open pull requests, and a permission prompt `tool`, the
697
+ tool's name.
698
+
699
+ `task answer` answers one of them, named by its card and its id, with no one
700
+ typing in the agent's tab:
701
+
702
+ ```sh
703
+ ocnus task answer my-space ABC-122 41 approve
704
+ ocnus task answer my-space ABC-122 41 change plan: keep the old exporter
705
+ ocnus task answer my-space ABC-98 p3f9a12c4 allow
706
+ ocnus task answer my-space ABC-77 38 merge
707
+ ```
708
+
709
+ - **An approval, a choice or a merge** takes one of its options, or your own
710
+ words in place of one. Either goes to the card's agent as if you had typed
711
+ it in its tab, and the agent goes on as it does when you answer there: it
712
+ records your answer and carries on. Words after the first are joined, so
713
+ they need no quotes.
714
+ - **A permission prompt** takes only one of its options. `allow` and `refuse`
715
+ close the prompt as the same choice in the tab does, and a refusal does not
716
+ interrupt the agent. `allow from now on` allows it with the rules the
717
+ prompt itself suggested, and is an option only of a prompt that suggested
718
+ some. Nothing is typed into the tab for it.
719
+ - **A merge answered with `merge`** is not sent to the agent. It merges each
720
+ of the card's open pull requests on GitHub, by the method GitHub's own
721
+ merge button would use for you in that repo (a merge commit, a squash or a
722
+ rebase), and only at the commit GitHub was asked about. ocnus's watch
723
+ then records the merge and finishes the task, as it does when you merge on
724
+ GitHub. When GitHub would not merge one of them as it stands, such as one
725
+ in conflict, with a required check not passed, behind its base branch or a
726
+ draft, none is merged: the command names that pull request and why, and
727
+ exits non-zero. Nothing is forced, and no auto-merge is turned on. It needs
728
+ `gh`, signed in. In a repo whose method is a squash or a rebase, the watch
729
+ records the merge and leaves the task for you to finish, as when you merge
730
+ that way on GitHub (see `task finish`, below).
731
+
732
+ An answer is for one question, the one the list showed. When that question
733
+ no longer waits, because it was answered in the tab or by an earlier answer,
734
+ or the agent has asked another since, nothing is sent or merged, and the
735
+ command says why and exits non-zero. The same goes for a question whose
736
+ agent is not running, with its tab closed or its own shell in the
737
+ foreground, which the list marks with `agent not running`: an answer goes
738
+ to a running agent, so start it again in its tab first. A merge answered
739
+ with `merge` needs no agent. An agent still ending its turn is waited for,
740
+ for half a minute. The command exits zero only once the agent has taken the
741
+ answer, which is once Herdr shows it working again, once the hook of a
742
+ permission prompt has taken the option, or once the pull requests have
743
+ merged.
744
+
745
+ Only you answer. Run from inside the session of an agent ocnus started,
746
+ `task answer` sends nothing and merges nothing, and says so; `task asks`
747
+ lists there as anywhere.
748
+
749
+ A permission prompt is seen through a Claude Code hook, which `task new` and
750
+ `task build` give every `claude` they start: `ocnus task hold <space>
751
+ <card>`. Claude Code runs it beside the prompt. It writes the question to
752
+ `~/.config/ocnus/asks/<space>/<card>/<id>.json`, the tool and what it
753
+ would do and nothing else of the session, and waits. `task answer` leaves
754
+ the option beside that file, and the hook prints the decision that closes
755
+ the prompt. Once the prompt is answered in the tab, the hook sees that its
756
+ terminal is no longer blocked and ends without deciding, and its file goes.
757
+ So the list shows a prompt only while its hook waits and Herdr says its
758
+ terminal is blocked. What it cannot see:
759
+
760
+ - A prompt only the person in the tab can answer: a question the agent asks
761
+ mid-step with its own options (`AskUserQuestion`), and a plan to approve
762
+ (`ExitPlanMode`). The hook leaves both alone.
763
+ - Any other prompt of Claude Code's, such as a sign-in, and the prompts of a
764
+ harness other than `claude`. `task log` still says the agent is waiting in
765
+ its tab.
766
+ - The prompts of an agent that was started before this hook was there, or
767
+ not by `task new` or `task build`, until it is started again by one.
768
+ - A prompt on a machine without `jq` or Herdr's `hc`, or of an agent whose
769
+ terminal is not one of herdr-core's.
770
+
771
+ When an agent has two prompts at once, both are listed, and each is answered
772
+ by its own id. One of them answered in the tab stays in the list until the
773
+ other is answered too, since the terminal stays blocked until then, and an
774
+ answer to it does nothing.
775
+
776
+ To catch up on a card's agent without going to its tab, ask for its brief:
777
+ the one the `brief` skill gives in the tab, with the original task, what has
778
+ happened so far and what the agent is doing now, in no more than five lines.
779
+
780
+ ```sh
781
+ ocnus task brief my-space ABC-122
782
+ ```
783
+
784
+ It leaves the agent alone. `task new` and `task build` give `claude` the ID
785
+ of the session they start it in, and record it as the card's, so `claude`
786
+ makes the brief in a copy of the card's newest session: its build agent's
787
+ once `task build` has started one, the one started last, or else its
788
+ write-up agent's. The copy has no tools and is never saved, and nothing is
789
+ sent to the agent's tab, so an agent in the middle of a turn keeps working,
790
+ and a question it is waiting on, in a hand-off or on a permission prompt,
791
+ stays unanswered. The brief says what the agent was doing or asking when the
792
+ copy was made. It is given whatever the agent is doing, with its tab open or
793
+ closed, and once the card has merged and its task is finished, for as long
794
+ as Claude Code keeps the session's transcript.
795
+
796
+ A new brief is a model call, so it runs on `haiku` at low effort, since it
797
+ reads the agent's whole conversation (`OCNUS_BRIEF_MODEL` picks another
798
+ model), and it is paid for as the agents are: on your Claude subscription, or
799
+ on the saved Anthropic key when `ocnus billing` is on `api`, where it stops
800
+ before the call with no key saved. So ocnus keeps the last brief of each
801
+ card. Asked again before another hand-off is recorded for the card, or
802
+ another agent is started on it, it gives the kept one, saying when it was
803
+ made, and makes no model call. `--refresh` makes a new one. `--json` gives
804
+ the brief as one line for programs, with when it was made and whether it is
805
+ the kept one.
806
+
807
+ A card gets no brief when no session of its agent is recorded, as when no
808
+ agent was started on it, or only before ocnus recorded sessions, when its
809
+ agent runs in another harness, and when Claude Code no longer keeps the
810
+ session's transcript. The command then says why and exits non-zero, as it
811
+ does when Claude Code could not make the brief. See
812
+ [herdr/README.md](herdr/README.md#hand-offs).
813
+
460
814
  `task start` starts the work, once you have approved the card. It takes the
461
815
  card too, makes a branch and a git worktree of it in every repo of the
462
816
  space, opens a tab for it, and starts the agent there that runs the build
@@ -478,7 +832,8 @@ start, it stops before it makes anything. See
478
832
  `task start` holds a card while a card that blocks it, or the card it was
479
833
  sliced from, is not done yet in Linear. It makes no branch, worktree or tab,
480
834
  leaves the card in Todo, names each card that holds it, with its status, and
481
- exits non-zero. Run it again once those cards are done. When Linear is not
835
+ exits non-zero. ocnus's watch starts the card once those cards are done,
836
+ unless the chain is off, as the watch's paragraphs below say. When Linear is not
482
837
  asked, as when the card's type and title are given with no key saved, it
483
838
  starts the card with a note that its blockers were not checked.
484
839
 
@@ -499,9 +854,10 @@ for it. The clean exit is what archives the session in the Claude app's list
499
854
  of sessions, with Remote Control on. Its transcript stays, so
500
855
  `claude --resume` still opens it. A live agent is never killed: when it has
501
856
  not exited 30 seconds after `/exit`, or the tab runs a program that reports
502
- no status, the tab is left open. When `task start` holds the card, the
503
- write-up session stays open until you run `task start` again, from any
504
- terminal, once the cards that hold it are done. When `task start` stops,
857
+ no status, the tab is left open. When `task start` holds the card, it puts
858
+ the write-up session away too, since all there is to know of a held card is
859
+ in Linear, its status and its blockers, and the watch opens a new build tab
860
+ once it starts the card. When `task start` stops,
505
861
  before it has made the task or without opening its tab, the write-up session
506
862
  stays open. Only the card's own write-up tab is closed: the build tab, other
507
863
  cards' write-up tabs and the terminal `task start` ran in stay open, and a
@@ -576,10 +932,13 @@ has it build the card with the `sdlc-build` skill, check that work with the
576
932
  `sdlc-review` skill, and then put it up as a pull request with the `sdlc-pr`
577
933
  skill. If the agent stops, run the same command again in the tab. It runs only
578
934
  in the card's own task folder. With `--continue <message>` after the card, it
579
- continues `claude`'s last session in the task instead, with that message, on
580
- the same profile, model and effort, which a bare `claude --continue` would
581
- not give it; ocnus's watch runs it to wake an agent that has exited (see
582
- below). Another harness refuses `--continue`. When a phase profile is not linked, `task new`
935
+ continues the card's build session instead, with that message, on the same
936
+ profile, model and effort, which a bare `claude --continue` would not give
937
+ it. That is the session of the build agent `task build` started last, by the
938
+ ID it gave `claude`, or `claude`'s last session in the task when none is
939
+ recorded, as for an agent started before ocnus recorded sessions. ocnus's
940
+ watch runs it to wake an agent that has exited (see below). Another harness
941
+ refuses `--continue`. When a phase profile is not linked, `task new`
583
942
  and `task build` stop before they start anything, and say to run
584
943
  `ocnus update`. Both start the agent on the account `ocnus billing`
585
944
  sets, the subscription unless it is `api`; on `api` with no Anthropic key
@@ -631,8 +990,9 @@ team with one started status the card stays in it. When the card cannot be
631
990
  moved, it says so, and why, and goes on.
632
991
 
633
992
  Then it asks you to merge them, as `needs-human` with their links, and
634
- waits, running no watch of its own. Merge each one on GitHub yourself; you
635
- don't have to tell the agent. ocnus's watch on the merges (see below)
993
+ waits, running no watch of its own. Merge each one on GitHub yourself, or
994
+ have `ocnus task answer <space> <card> <question> merge` merge them (see
995
+ above); you don't have to tell the agent. ocnus's watch on the merges (see below)
636
996
  asks GitHub every minute, however long the pull requests have been open,
637
997
  whatever the agent is doing, so a merge is seen within a minute or so. Once
638
998
  every one has merged, it records the merge, as your answer, so `task log`
@@ -698,8 +1058,9 @@ launchd agent that `install` and `update` write (see
698
1058
  back within a minute of herdr-core starting, whether the Herdr app, the
699
1059
  phone or an `ocnus` command started it, and a watch that died comes back
700
1060
  the same way. `--wake` only wakes it, and says nothing. It starts only
701
- while a card waits on its merge and herdr-core is running, never starts
702
- herdr-core, and never runs twice. Every minute, it asks GitHub about the
1061
+ while a card waits on its merge, or once its half-hourly look for ready
1062
+ cards is due, as below, and herdr-core is running;
1063
+ it never starts herdr-core, and never runs twice. Every minute, it asks GitHub about the
703
1064
  pull requests of every card whose latest hand-off is the pr step's question,
704
1065
  in any space and however long ago, in one call, with `gh api graphql`,
705
1066
  however many cards wait and in however many spaces and repos; past 100
@@ -729,8 +1090,9 @@ come back, never killed, then `task finish` (below) removes the task and
729
1090
  closes its tab, with the Herdr app open or closed. When `task finish` refuses,
730
1091
  as for work it would lose, or the agent does not exit, the task is left as it
731
1092
  is, and `task log` shows why, as `task not finished: …` in the merge's flags;
732
- run `task finish` yourself once you have dealt with it. It ends once no card
733
- waits, and `--once` checks once. Once a card's merge is recorded,
1093
+ run `task finish` yourself once you have dealt with it. Then it starts the
1094
+ cards the merged card was blocking that are ready, as the chain's paragraphs
1095
+ below say. It ends once no card waits, and `--once` checks once. Once a card's merge is recorded,
734
1096
  `task handoff` refuses any other block for it, saying the merge is recorded
735
1097
  already, so it is recorded once. Then the agent records nothing more and
736
1098
  runs no `task finish`.
@@ -754,13 +1116,85 @@ What it woke each card's agent for is kept in
754
1116
  `~/.config/ocnus/merges/<space>/<card>.woke` while the card waits.
755
1117
  For `task log`, each pass also leaves when it began, in
756
1118
  `~/.config/ocnus/merges/.alive`, and what it saw of each card's pull
757
- requests, in `~/.config/ocnus/merges/<space>/<card>`. For
1119
+ requests, in `~/.config/ocnus/merges/<space>/<card>`. For `task asks`,
1120
+ it keeps each pull request it saw, with its state, in
1121
+ `~/.config/ocnus/merges/<space>/<card>.pulls`. For
758
1122
  `ocnus status`, a pass whose call to GitHub failed leaves when, whether
759
1123
  `gh` needs signing in, and `gh`'s words, in
760
1124
  `~/.config/ocnus/merges/.gh`, which the next pass whose call works, or
761
- that asks GitHub nothing, removes. All of them go once no card waits.
1125
+ that asks GitHub nothing, removes. All of them go once no card waits. When
1126
+ the watch last looked for ready cards stays, in
1127
+ `~/.config/ocnus/merges/.ready`.
1128
+
1129
+ **The chain.** A card that `task start` held starts by itself once the cards
1130
+ that block it are done: the watch starts it, with `task start`, as you would.
1131
+ Once the watch has recorded a card's merge and finished its task, it asks
1132
+ Linear once for the cards that card was blocking, and, when the merge closed
1133
+ the card it was sliced from, for the cards that card was blocking too. It
1134
+ starts each one that is ready:
1135
+
1136
+ - it is in a not-started status, which is where your approval puts it: Todo
1137
+ in Lab, so a card still in Backlog is never started;
1138
+ - its team is in a space's teams (`ocnus space team`);
1139
+ - its description has a Specification and a Plan;
1140
+ - every card that blocks it, or the card it was sliced from, is done. A
1141
+ blocker that was canceled is not done, so it still holds the card.
1142
+
1143
+ A ready card that was sliced starts through its first sub-issue that is not
1144
+ started, done or canceled, as breakdown picks one. Each card starts in the
1145
+ merged card's own space when its teams hold the card's team, or else in the
1146
+ one space that lists the team, and from its repos' default branches as they
1147
+ are after the merge, since `task start` fetches first. A card under another
1148
+ parent card starts the same way: only its blockers count. There is no limit on
1149
+ how many cards start at once.
1150
+
1151
+ The watch never starts a card that is not ready. It names each one it leaves,
1152
+ with why, and each one it starts, in the merge's flags, so `task log` shows
1153
+ them under the merge:
1154
+
1155
+ ```
1156
+ 2026-03-02T10:14:09Z pr done, then merged 0s
1157
+ summary: Merged on GitHub: https://github.com/acme/api/pull/7. Recorded by ocnus's watch.
1158
+ flags: ABC-123 was started; ABC-124 was not started: ABC-121, in In Review, still blocks it; ABC-125 was not started: it has no Plan
1159
+ ```
762
1160
 
763
- To have something changed instead of merging, say what in the tab. The agent
1161
+ A card it leaves because it cannot be sure of it is named too: one whose
1162
+ team more than one other space lists, one with more relations or sub-issues
1163
+ in Linear than it reads, one that has a task on this machine already, and one
1164
+ `task start` stopped on, with what `task start` said. When Linear cannot be
1165
+ asked, the flags say that the cards were not looked for. With no Linear key
1166
+ saved, it looks for none and says nothing.
1167
+
1168
+ A start can be missed at the merge: `task start` stopped, Linear could not be
1169
+ asked, the chain was off, or the last blocker was closed some other way, such
1170
+ as by hand in Linear, with no merge for the watch to see. The catch-up starts
1171
+ those:
1172
+
1173
+ ```sh
1174
+ ocnus task ready my-space
1175
+ ```
1176
+
1177
+ It asks Linear for the cards of the space's teams that wait in a not-started
1178
+ status, 20 to a question, with their blockers, and starts each one that is
1179
+ ready, by the same rules, in that space. It says what became of each card that
1180
+ waits, a line each, and exits non-zero when a card that was ready could not
1181
+ be started. The watch runs it too, for every space that has a team, once its
1182
+ last look is half an hour old, with a card waiting on its merge or not: so a
1183
+ ready card starts within about half an hour whatever freed it, at the cost
1184
+ of one question to Linear for each space each half hour, while no more than
1185
+ 20 of its cards wait. The watch names no
1186
+ space of its own, so it leaves a card whose team more than one space lists:
1187
+ start that one yourself. What its look found is in its terminal,
1188
+ `hc attach ocnus-merges`, and is recorded nowhere, since a card that
1189
+ starts records its own start.
1190
+
1191
+ `ocnus chain off` turns the chain off: the watch then starts no card, at
1192
+ a merge or at its half-hourly look. `task ready` still starts the ready cards
1193
+ when you run it. See [Setting up a machine](#setting-up-a-machine) for the
1194
+ setting.
1195
+
1196
+ To have something changed instead of merging, say what in the tab, or with
1197
+ `task answer` in your own words. The agent
764
1198
  makes the change on the task's branch, with its test, runs the whole test
765
1199
  suite, then commits and pushes it, never forced, so the pull request shows
766
1200
  it, and adds it to the pull request's description. Then it asks you again,
@@ -811,7 +1245,10 @@ that together they still run one case per processor, or, after
811
1245
  `ocnus tests queue`, go one at a time, each waiting its turn (see above).
812
1246
  `OCNUS_TEST_JOBS=<n> npm test` runs n at a time however many other runs
813
1247
  are going, though it still waits its turn when they go one at a time, and
814
- `OCNUS_TEST_JOBS=1 npm test` runs the cases one at a time. Once
1248
+ `OCNUS_TEST_JOBS=1 npm test` runs the cases one at a time.
1249
+ `OCNUS_TEST_TIMES=<file> npm test` also writes a line to the file for each
1250
+ case, with its wall, user and sys times, whether it passed, its area and its
1251
+ name; [test/TIMES.md](test/TIMES.md) says where a whole run's time goes. Once
815
1252
  a pull request merges, `scripts/after-merge <name>`, run from the clone,
816
1253
  removes the Claude Code worktree under `.claude/worktrees/` that the work was
817
1254
  done in, deletes its branch and updates the clone; see
@@ -821,9 +1258,10 @@ A git worktree of the repo, such as the one `task start` makes for one of
821
1258
  ocnus's own cards, holds a copy of the CLI that is a change being built.
822
1259
  Its `./cli/ocnus` runs only the commands that read: `help`, `status`,
823
1260
  `space ls`, `space team <name>`, `profile ls`, `linear archive` (alone or
824
- with `--json`), `tests` (alone or with `--json`), `approval` (alone or with
825
- `--json`), `billing` (alone or with `--json`), `task ls`, `task log`,
826
- `host` and `host report`.
1261
+ with `--json`), `tests` and `tests ls` (each alone or with `--json`),
1262
+ `approval` (alone or with `--json`), `billing` (alone or with `--json`),
1263
+ `chain` (alone or with `--json`), `usage` (alone or with `--json`),
1264
+ `task ls`, `task log`, `task asks`, `host` and `host report`.
827
1265
  Any other command stops before it does anything, says that it is a
828
1266
  worktree's copy, and gives the command that runs it for real:
829
1267
  `OCNUS_LIVE=1 ./cli/ocnus …`, for that one run. The installed `ocnus` is never stopped, whatever folder
@@ -837,7 +1275,8 @@ read afterwards. It is off until you turn it on, and works on macOS only.
837
1275
 
838
1276
  ```sh
839
1277
  ocnus host on # turn recording on
840
- 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
1278
+ ocnus host report [<period>] # the host's numbers summed up, what used the most, and where the steps' time went
1279
+ ocnus host report --card <space> <card> --json # what the host recorded while each of a card's steps ran, as JSON for programs
841
1280
  ocnus host off # turn it off, and delete every reading
842
1281
  ocnus host # whether recording is on, and what it has
843
1282
  ocnus tests run <command> # run a test command, and record the test run
@@ -903,36 +1342,19 @@ waits on the model are kept for 90 days, in `~/.config/ocnus/host`, and
903
1342
  recording uses well under 1% of the CPU.
904
1343
 
905
1344
  `host report` takes the last 7 days, `<n>d` or `<n>h` back from now, a day
906
- such as `2026-11-29`, or `2026-11-01..2026-11-29`. For each of CPU, memory
907
- and disk it says how much of the recorded time it was at its limit: the CPU
908
- at least 90% busy across all cores, memory pressure at warning or critical,
909
- or under 10% of the home folder's disk free. Time with no reading, such as
910
- when no agent was open, is shown as missing, never as idle. It also says how
911
- much of the CPU recording used, watching the test runs included. Then, for
912
- each number of agents working at once, from none up, it says how long that
913
- many were working and how much of that time the CPU or memory was at its
914
- limit. It names the fewest working at which that was at least a quarter of
915
- the time, as the number from which the host was the limit, so you can tell
916
- how many agents to run at once, or says the host was not the limit at any
917
- number. Readings from before the agents working were counted are left out
918
- of these figures, and their time is counted on a line of its own. Under
919
- each number from 2 up, it says how much slower test runs were than with one
920
- agent working, as a percentage, such as `test runs 30% slower than with 1
921
- working, from 3 runs of 1 command against 3 with 1 working`. It sets only
922
- runs of the same command in the same repo against each other, and a command
923
- counts only once it has run at least 3 times with that many working and 3
924
- times with one; with none that has, it says it cannot tell yet. A test run
925
- counts at the number of agents working for most of its time. Runs cut
926
- short, runs from before the fingerprints were kept, and runs while no
927
- reading counted the agents working are left out. Then it names the 5
928
- longest stretches in the period when the CPU or memory was at its limit,
929
- longest first: when each started, how long it lasted and which of the two
930
- was at its limit, then every card going then, with its step, or its phase
931
- when it was in none, and every test run going then, each with its share of
932
- all cores over the stretch and the most memory it held. Each card also says
933
- for how much of the stretch its agent was working. With none, it says the
934
- host was never at its limit for CPU or memory. Disk is not among them: a
935
- full disk is not caused by a moment's work. Then it lists the
1345
+ such as `2026-11-29`, or `2026-11-01..2026-11-29`. It says how much of the
1346
+ period was recorded, in all and on each day. Time with no reading, such as
1347
+ when no agent was open, is shown as missing, never as idle. Then it sums up
1348
+ each number the readings hold of the host, under CPU, memory, disk, network,
1349
+ and power and heat, and judges none of them: a total for an amount, such as
1350
+ the bytes read from the disk; an average and the most in one reading for a
1351
+ level, such as how busy the CPU was, or the least for the disk's free space
1352
+ and the Wi-Fi's signal; and how long each state lasted, such as each level
1353
+ of memory pressure. An average weighs each reading by its seconds in the
1354
+ period. One of the levels is how much of the CPU recording used, its
1355
+ average with watching the test runs included. A number that no reading in
1356
+ the period holds, as on a Mac without it or in readings from before it was
1357
+ recorded, is shown as not read, never as 0. Then it lists the
936
1358
  10 steps and the 10 phases that used the most CPU time in the period, and
937
1359
  the 10 of each that held the most memory at once, each one card's own, such
938
1360
  as LAB-150's build step, with how long it ran. Then come the 10 test runs
@@ -943,35 +1365,33 @@ host, waiting on the model and the rest, then the same for the 10 steps open
943
1365
  longest, each one card's own, such as LAB-152's build step, and how many
944
1366
  steps had no split.
945
1367
 
946
- Then it says whether the network may be the cause, as a slow wait on the
947
- model can be the network rather than the host. A wait is slow when it took
948
- over twice the median of every wait on the model recorded, up to 90 days.
949
- When waits that ended in the period were slow while CPU, memory and disk
950
- were all below their limit, in every reading over the wait, it says so:
951
- `The network may be the cause: 14 of 120 waits on the model were slow (over
952
- twice the median of 6.2s) while CPU, memory and disk were below their
953
- limit.` A slow wait with no reading over it does not count. With none, it
954
- says nothing. It cannot tell a slow network from a slow model.
955
-
956
- Last comes the verdict, one line with the numbers behind it, so that money
957
- goes on what slows the agents' work on the host. It weighs each reading by
958
- the agents' time on the host in it, the seconds their tools ran, an agent's
959
- second each, from the splits. With fewer than 10 steps with their time
960
- split in the period, or under 1 hour of the agents' time on the host, there
961
- is too little data yet, and it says how many and how long. Otherwise, of
962
- CPU, memory and disk, the one at its limit for the most of the agents' time
963
- on the host, when that is at least 10% of it, is the one to upgrade first:
964
- `upgrade memory first: it was at its limit for 23.0% of the agents' 6h 10m
965
- on the host (CPU 8.0%, disk 0.0%)`. When over half of its time at its limit
966
- was on battery, in Low Power Mode or with the thermal state at serious or
967
- critical, the verdict is that the power state was the limit, in place of an
968
- upgrade: plugging in, or letting the machine cool, costs nothing. With none
969
- at its limit for 10%, the network was the limit when at least 10% of the
970
- period's waits on the model were slow while CPU, memory and disk were below
971
- their limit, so that no host upgrade is bought that would not have helped.
972
- Otherwise no upgrade is needed.
1368
+ `ocnus host report --card <space> <card> --json` gives a program what
1369
+ the host recorded while each of a card's steps ran, as one line of JSON, so
1370
+ that a slow step can be set beside how busy the host was then. Its `steps`
1371
+ are each time the card was in a step, oldest first, with the start and end
1372
+ `task log` gives it, the time it waited on you included. The step the card
1373
+ is in now runs to now and is marked `open`. Each step has its `points`,
1374
+ one for each reading, with the time it covers, how busy the CPU was across
1375
+ all cores, the memory used, and the memory pressure as `normal`, `warning`
1376
+ or `critical`. They are the whole host's figures, not the card's own share.
1377
+
1378
+ A step with 60 readings or fewer comes back reading by reading. One with
1379
+ more comes back as 60 points at most: its time is cut into 60 equal parts,
1380
+ and each part with a reading in it gives one point, with the average of
1381
+ its readings' CPU and memory and the worst of their memory pressure, so
1382
+ every reading counts and none is dropped. Time with no reading has no
1383
+ point, so it is never given as idle or as 0. Each step says how many
1384
+ readings it has and how many of its seconds they cover, and with recording
1385
+ off the JSON says `"recording": false` and still lists the steps, so a
1386
+ program can show "not recorded" in place of an empty chart. It can be asked
1387
+ at any point in a card's life, and after its task is finished, for as long
1388
+ as the readings are kept. A request it cannot make sense of, such as a
1389
+ period beside `--card` or a card that is not a card ID, is refused with a
1390
+ message on stderr, exit 1 and nothing on stdout, so a program never reads
1391
+ words as JSON.
1392
+
973
1393
  See [herdr/README.md](herdr/README.md#recording-the-host) for what a
974
- reading holds.
1394
+ reading holds, and for every key of a card's JSON.
975
1395
 
976
1396
  ## Releasing
977
1397