@johngaynor/ocnus 2.0.1-next.73 → 2.0.1-next.78
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/README.md +67 -6
- package/cli/lib/agents.sh +25 -12
- package/cli/lib/asks.sh +13 -0
- package/cli/lib/events.sh +482 -0
- package/cli/lib/guard.sh +4 -2
- package/cli/lib/handoff.sh +86 -17
- package/cli/lib/task.sh +2 -1
- package/cli/ocnus +28 -5
- package/herdr/README.md +182 -6
- package/herdr/layouts/showcase.json +12 -0
- package/herdr/layouts/vibe.json +4 -2
- package/herdr/mods/card-list/main.js +658 -0
- package/herdr/mods/card-list/mod.json +1 -0
- package/package.json +1 -1
package/cli/lib/handoff.sh
CHANGED
|
@@ -447,18 +447,28 @@ log_read() {
|
|
|
447
447
|
# them: a card whose pull requests have merged stands on no step.
|
|
448
448
|
COUNT_STEPS='define plan breakdown start build review pr'
|
|
449
449
|
|
|
450
|
+
# SQL for the step a card stands on, from the columns of its latest hand-off:
|
|
451
|
+
# the step that comes next when that hand-off is done, with setup, start's
|
|
452
|
+
# old name, counted as start, and that hand-off's own step otherwise: the
|
|
453
|
+
# step that asked, was answered or failed. A card whose next step is merged
|
|
454
|
+
# stands on no step, and this is null for it. The counts and the card list
|
|
455
|
+
# both place a card by it, as the column stand of the table latest
|
|
456
|
+
# (log_cards), so a card's dot in the Step counts section and its row in the
|
|
457
|
+
# card list are on the same step.
|
|
458
|
+
stand_sql() {
|
|
459
|
+
printf '%s' "case when status = 'done'
|
|
460
|
+
then case next when 'setup' then 'start' when 'merged' then null else next end
|
|
461
|
+
else step end"
|
|
462
|
+
}
|
|
463
|
+
|
|
450
464
|
# How many of the space's cards stand on each of COUNT_STEPS, and how each
|
|
451
465
|
# card's agent is doing, for the list's JSON: its counts, which the Step
|
|
452
466
|
# counts section in Herdr draws, holding no rules of its own. It prints the
|
|
453
467
|
# SQL for the table counted (step, nth, count, marks), a row for each step,
|
|
454
468
|
# with nth its place among them. It reads the tables latest, each card's
|
|
455
|
-
# latest row
|
|
456
|
-
# (agents.sh), so it follows them in the
|
|
457
|
-
#
|
|
458
|
-
# A card stands on the step that comes next when its latest hand-off is
|
|
459
|
-
# done, with setup, start's old name, counted as start, and on that
|
|
460
|
-
# hand-off's own step otherwise: the step that asked, was answered or
|
|
461
|
-
# failed. So a card whose next step is merged stands on no step.
|
|
469
|
+
# latest row with the step it stands on (stand_sql), and agents, what Herdr
|
|
470
|
+
# and ocnus's watch say of each card (agents.sh), so it follows them in the
|
|
471
|
+
# query. A card whose next step is merged stands on no step.
|
|
462
472
|
#
|
|
463
473
|
# count is how many cards stand on the step, and marks is a JSON list with a
|
|
464
474
|
# mark for each of them. A card's mark is the first of these that holds:
|
|
@@ -482,9 +492,7 @@ counts_sql() {
|
|
|
482
492
|
done
|
|
483
493
|
printf "steps (step, nth) as (values %s),
|
|
484
494
|
placed as (
|
|
485
|
-
select status, json_extract(agent, '\$.state') as doing, coalesce(ready, 0) as ready,
|
|
486
|
-
case when status = 'done' then case when next = 'setup' then 'start' else next end
|
|
487
|
-
else step end as stand
|
|
495
|
+
select status, json_extract(agent, '\$.state') as doing, coalesce(ready, 0) as ready, stand
|
|
488
496
|
from latest left join agents using (card)),
|
|
489
497
|
marked as (
|
|
490
498
|
select stand,
|
|
@@ -516,36 +524,97 @@ counts_none() {
|
|
|
516
524
|
printf '[%s]' "$out"
|
|
517
525
|
}
|
|
518
526
|
|
|
527
|
+
# What the card list in Herdr shows of each card, for the list's JSON: SQL
|
|
528
|
+
# for the table shows (card, stand, running, word, mark, need), a row for
|
|
529
|
+
# each card. It reads the tables latest and agents, as counts_sql does, and
|
|
530
|
+
# the card list draws it, holding no rules of its own.
|
|
531
|
+
#
|
|
532
|
+
# stand is the step the card stands on (stand_sql). running is 1 while a tab
|
|
533
|
+
# ocnus opened for the card is open for the phase going on: the tab its
|
|
534
|
+
# agent is looked for in (card_seen, in agents.sh), the write-up tab until
|
|
535
|
+
# the work starts and then the task's tab, is open (the agents table's seen
|
|
536
|
+
# is not closed), and the card stands on a step, so not once it has merged.
|
|
537
|
+
# At start the card is approved, and its write-up agent's turn there is over
|
|
538
|
+
# but for the `task start` it runs, so only an agent working, blocked or with
|
|
539
|
+
# an error counts there.
|
|
540
|
+
#
|
|
541
|
+
# word is the card's status in the list, the first of these that holds, with
|
|
542
|
+
# its mark, the colour the counts give it, and its need, its place in the
|
|
543
|
+
# order of need, from 0, the most urgent:
|
|
544
|
+
# Stuck stuck 0 its agent has any state but blocked, as the
|
|
545
|
+
# log says it, or its step failed
|
|
546
|
+
# Permission needs-human 1 its agent is blocked on a permission prompt
|
|
547
|
+
# Approve? needs-human 1 breakdown asks the human to approve the card
|
|
548
|
+
# Asking needs-human 1 its agent is blocked otherwise, or it asks
|
|
549
|
+
# any other question but for the merge
|
|
550
|
+
# Merge? needs-human 2 its pull requests wait on the human to merge
|
|
551
|
+
# or ready them: ready once ocnus's watch says they
|
|
552
|
+
# are ready (the agents table's ready)
|
|
553
|
+
# Working working 3 it is running
|
|
554
|
+
# A card none of these holds for is not running, and its word, mark and need
|
|
555
|
+
# are null. An approval and a merge are told as `task asks` tells them
|
|
556
|
+
# (ask_kind_sql, in asks.sh).
|
|
557
|
+
cards_sql() {
|
|
558
|
+
printf "shows as (
|
|
559
|
+
select card, stand, running, word,
|
|
560
|
+
case when word is null then null when word = 'Stuck' then 'stuck'
|
|
561
|
+
when word = 'Working' then 'working' when word = 'Merge?' and ready = 1 then 'ready'
|
|
562
|
+
else 'needs-human' end as mark,
|
|
563
|
+
case word when 'Stuck' then 0 when 'Permission' then 1 when 'Approve?' then 1
|
|
564
|
+
when 'Asking' then 1 when 'Merge?' then 2 when 'Working' then 3 end as need
|
|
565
|
+
from (
|
|
566
|
+
select *,
|
|
567
|
+
case when (doing is not null and doing <> 'blocked') or status = 'failed' then 'Stuck'
|
|
568
|
+
when doing = 'blocked' and prompt = 'permission' then 'Permission'
|
|
569
|
+
when asked = 'approval' then 'Approve?'
|
|
570
|
+
when doing = 'blocked' or asked = 'choice' then 'Asking'
|
|
571
|
+
when asked = 'merge' then 'Merge?'
|
|
572
|
+
when running then 'Working' end as word
|
|
573
|
+
from (
|
|
574
|
+
select latest.card as card, stand, status, coalesce(ready, 0) as ready,
|
|
575
|
+
json_extract(agent, '\$.state') as doing, json_extract(agent, '\$.kind') as prompt,
|
|
576
|
+
case when status = 'needs-human' then %s end as asked,
|
|
577
|
+
coalesce(seen, 'closed') <> 'closed' and stand is not null
|
|
578
|
+
and (stand <> 'start' or seen in ('working', 'blocked', 'error')) as running
|
|
579
|
+
from latest left join agents using (card))))" "$(ask_kind_sql step options)"
|
|
580
|
+
}
|
|
581
|
+
|
|
519
582
|
# The space's cards that have hand-offs, newest first by their latest row:
|
|
520
583
|
# where each stands and how long it has stood there, or what its agent is
|
|
521
584
|
# doing when Herdr says it is stuck or has stopped, then what the card's
|
|
522
585
|
# agents have used in all, or that it is not recorded. With --json, the same
|
|
523
586
|
# as one line of JSON, with the agent beside where the card stands, and the
|
|
524
587
|
# card's total as tokens and cost, each null when nothing is recorded, and
|
|
525
|
-
# partial, true when a step of the card is not recorded;
|
|
526
|
-
#
|
|
527
|
-
# each
|
|
588
|
+
# partial, true when a step of the card is not recorded; what the card list
|
|
589
|
+
# in Herdr shows of it, its stand, running, word, mark and need (cards_sql);
|
|
590
|
+
# and then counts: the seven steps in order, each with how many cards stand
|
|
591
|
+
# on it, a mark for each card and its text (counts_sql).
|
|
528
592
|
# log_cards <space> <json: 1 or 0> <view>
|
|
529
593
|
log_cards() {
|
|
530
594
|
local name=$1 json=$2 list
|
|
531
|
-
# Each card's latest row is the one with nothing after it
|
|
595
|
+
# Each card's latest row is the one with nothing after it, with the step
|
|
596
|
+
# the card stands on.
|
|
532
597
|
list="$3, latest as (
|
|
533
|
-
select *, max(cast(strftime('%s', 'now') - strftime('%s', at) as integer), 0) as since
|
|
598
|
+
select *, max(cast(strftime('%s', 'now') - strftime('%s', at) as integer), 0) as since,
|
|
599
|
+
$(stand_sql) as stand
|
|
534
600
|
from shown where after is null), $AGENTS_SQL"
|
|
535
601
|
if [ "$json" = 1 ]; then
|
|
536
602
|
if [ ! -e "$STORE" ]; then
|
|
537
603
|
printf '{"space":"%s","cards":[],"counts":%s}\n' "$(json_str "$name")" "$(counts_none)"
|
|
538
604
|
return
|
|
539
605
|
fi
|
|
540
|
-
log_read "$name" "$list, $(counts_sql)" "
|
|
606
|
+
log_read "$name" "$list, $(counts_sql), $(cards_sql)" "
|
|
541
607
|
select json_object('space', $(sql_str "$name"),
|
|
542
608
|
'cards', (select json_group_array(json(c)) from (
|
|
543
609
|
select json_object('card', latest.card, 'at', at, 'state', state,
|
|
544
610
|
'waiting', nullif(waiting, ''), 'for', $(sql_took since), 'seconds', since,
|
|
545
611
|
'run', run, 'step', latest.step, 'status', status, 'next', next,
|
|
546
612
|
'agent', json(agent), 'tokens', json(t.tokens), 'cost', json(t.cost),
|
|
547
|
-
'partial', json(case when t.missing > 0 then 'true' else 'false' end)
|
|
613
|
+
'partial', json(case when t.missing > 0 then 'true' else 'false' end),
|
|
614
|
+
'stand', s.stand, 'running', json(case when s.running then 'true' else 'false' end),
|
|
615
|
+
'word', s.word, 'mark', s.mark, 'need', s.need) as c
|
|
548
616
|
from latest left join agents using (card) join told t on t.part = 2 and t.card = latest.card
|
|
617
|
+
join shows s on s.card = latest.card
|
|
549
618
|
order by at desc, latest.id desc)),
|
|
550
619
|
'counts', (select json_group_array(json(c)) from (
|
|
551
620
|
select json_object('step', step, 'count', count, 'marks', json(marks),
|
package/cli/lib/task.sh
CHANGED
|
@@ -991,6 +991,7 @@ cmd_task() {
|
|
|
991
991
|
# It decides nothing when anything goes wrong, so it never fails.
|
|
992
992
|
hold) shift; task_hold "$@" || true ;;
|
|
993
993
|
brief) shift; task_brief "$@" ;;
|
|
994
|
-
|
|
994
|
+
events) shift; task_events "$@" ;;
|
|
995
|
+
*) die "usage: ocnus task ls <space> [--json], or: ocnus task new <space> <card>, or: ocnus task start <space> <card> $START_ARGS, or: ocnus task ready <space>, or: ocnus task build <space> <card> [--continue <message>], or: ocnus task close <space> <card>, or: ocnus task finish <space> <card>, or: ocnus task merges [--once | --wake], or: ocnus task handoff <space> <card>, or: ocnus task log <space> [<card>] [--json], or: ocnus task asks <space> [--json], or: ocnus task answer <space> <card> <question> <answer>, or: ocnus task brief <space> <card> [--json] [--refresh], or: ocnus task events <space> <card> [--step <step>] [--json] (see: ocnus help)" ;;
|
|
995
996
|
esac
|
|
996
997
|
}
|
package/cli/ocnus
CHANGED
|
@@ -72,6 +72,11 @@ Usage:
|
|
|
72
72
|
its task, what has happened so far and what it is doing now
|
|
73
73
|
(a model call; the last brief is kept until the card's next
|
|
74
74
|
hand-off, and --refresh makes a new one)
|
|
75
|
+
ocnus task events <space> <card> [--step <step>] [--json]
|
|
76
|
+
list what the card's agents did, step by step, without the
|
|
77
|
+
code: the files each edited, its test runs and their totals,
|
|
78
|
+
its commands, its commits, and what it asked and was told
|
|
79
|
+
(--step for one step alone, --json for programs)
|
|
75
80
|
ocnus linear key save your Linear API key, so ocnus can read and write Linear cards
|
|
76
81
|
(it says when the key can read cards but not change them)
|
|
77
82
|
ocnus linear read <card> [--json] print a card whole: its head, with the cards that block it
|
|
@@ -354,6 +359,24 @@ agent runs in another harness, and one whose transcript Claude Code no
|
|
|
354
359
|
longer keeps get no brief: it says why, and exits non-zero, as it does when
|
|
355
360
|
Claude Code could not make the brief. --json gives the brief, or why there
|
|
356
361
|
is none, as one line for programs.
|
|
362
|
+
`task events` lists what the card's agents did, oldest first, under each
|
|
363
|
+
step the card has been in, as `task log` times its steps: each event with
|
|
364
|
+
its time, its kind and one line of text. An edit names the files the agent
|
|
365
|
+
edited, edits made one after another being one event; a test run says how
|
|
366
|
+
many cases passed and how many failed, or has no totals while it is still
|
|
367
|
+
going or when they cannot be read, never 0; a commit gives its short hash
|
|
368
|
+
and its subject; a command, any other command the agent ran, says what it
|
|
369
|
+
was for, as the agent described it; a question is what the agent asked you
|
|
370
|
+
in a needs-human hand-off, and an answer what you said to it. It never gives
|
|
371
|
+
a file's contents or a diff, and of what a command printed only a test run's
|
|
372
|
+
totals and a commit's hash and subject. --step lists one step alone, each
|
|
373
|
+
time the card was in it. It reads the transcripts Claude Code keeps of the
|
|
374
|
+
sessions `task new` and `task build` record, so it lists what an agent has
|
|
375
|
+
done so far while it works, and still lists a card that has merged. A step
|
|
376
|
+
whose agent's session was not recorded, as for a card from before sessions
|
|
377
|
+
were, or whose transcript Claude Code no longer keeps, says not recorded,
|
|
378
|
+
never that the agent did nothing. --json gives the same as one line, for
|
|
379
|
+
programs.
|
|
357
380
|
|
|
358
381
|
`host on` turns on a record of how hard this machine, the host, works while
|
|
359
382
|
ocnus's agents are open, and `host off` turns it off and deletes every
|
|
@@ -644,10 +667,10 @@ read: help, status, space ls, space team <name> with no teams,
|
|
|
644
667
|
profile ls, linear archive alone or with --json, tests and tests ls, each
|
|
645
668
|
alone or with --json, approval alone or with --json, billing alone or with
|
|
646
669
|
--json, chain alone or with --json, usage alone or with --json, task ls,
|
|
647
|
-
task log and task
|
|
648
|
-
hand-off store, without changing either, and usage record,
|
|
649
|
-
usage reading and cost.db, is refused. Every other command
|
|
650
|
-
does anything, says why, and leaves this machine as it was.
|
|
670
|
+
task log, task asks and task events. task log and usage read cost.db as
|
|
671
|
+
they read the hand-off store, without changing either, and usage record,
|
|
672
|
+
which writes the usage reading and cost.db, is refused. Every other command
|
|
673
|
+
stops before it does anything, says why, and leaves this machine as it was.
|
|
651
674
|
OCNUS_LIVE=1, set for that one run, runs it for real. The installed
|
|
652
675
|
ocnus is never stopped, whatever folder it is run from.
|
|
653
676
|
EOF
|
|
@@ -801,7 +824,7 @@ TEMPLATE_MARK='<!-- ocnus:template -->'
|
|
|
801
824
|
|
|
802
825
|
# Sourced, so every file shares the settings above and each other's functions.
|
|
803
826
|
LIB=$REPO/cli/lib
|
|
804
|
-
for part in common guard banner links recipes trust settings space linear archive tests approval billing chain usage cost task finish close agents github merges handoff asks sessions brief host commands; do
|
|
827
|
+
for part in common guard banner links recipes trust settings space linear archive tests approval billing chain usage cost task finish close agents github merges handoff asks sessions brief host events commands; do
|
|
805
828
|
[ -f "$LIB/$part.sh" ] ||
|
|
806
829
|
{ printf 'ocnus: %s is missing; reinstall ocnus\n' "$LIB/$part.sh" >&2; exit 1; }
|
|
807
830
|
# shellcheck source=/dev/null
|
package/herdr/README.md
CHANGED
|
@@ -13,13 +13,14 @@ layouts (whole-window arrangements of mods).
|
|
|
13
13
|
| `mods/layout-switch/` | A dropdown that shows the current layout and switches to another. |
|
|
14
14
|
| `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. |
|
|
15
15
|
| `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. |
|
|
16
|
+
| `mods/card-list/` | The card list, at the top of the `vibe` layout's middle column, and in a column of its own beside the terminals on `showcase`: the cards of the space that is showing, in two views. Agents lists the cards running now, the ones that need you first; Linear lists every open card under its parent card, with Start for a card not approved yet. A click on a running card opens its agent on the right. See [The card list](#the-card-list). |
|
|
16
17
|
| `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. |
|
|
17
18
|
| `mods/step-counts/` | The Step counts section, right above Usage and about as small: the seven steps, each with a dot for every card of the space that is showing that stands on it, coloured by how the card's agent is doing, and how many there are. See [The Step counts section](#the-step-counts-section). |
|
|
18
19
|
| `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). |
|
|
19
20
|
| `mods/names/` | Draws nothing but a note saying what it does, and that only where a layout asks for it, as `showcase` does. 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). |
|
|
20
21
|
| `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, the Step counts section, the Usage section, the Memory mod and the CPU mod in the sidebar, with the Step counts right above Usage, Usage above Memory and CPU, and Memory right above CPU; and the settings button beside the tabs. Herdr's Agents section, its `agents` mod, is not on it. 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. |
|
|
21
|
-
| `layouts/showcase.json` | For seeing each mod working before you choose what to put in a layout of your own: it places every mod ocnus ships, each in a block of its own that shows as soon as the layout opens, and each is the mod itself, on this machine's own data, as on `default`. It is `default` with
|
|
22
|
-
| `layouts/vibe.json` | Three columns side by side, each the window's full height, for steering every agent without reading code. The left one is the sidebar, 268px wide as `default`'s is: Herdr's brand, the layout dropdown, the Ocnus spaces panel and, at its bottom, the Step counts section, the Usage section, the Memory mod and the CPU mod, stacked in that order with nothing between them. The middle one is the
|
|
22
|
+
| `layouts/showcase.json` | For seeing each mod working before you choose what to put in a layout of your own: it places every mod ocnus ships, each in a block of its own that shows as soon as the layout opens, and each is the mod itself, on this machine's own data, as on `default`. It is `default` with three changes: the card list, which `default` does not have, is a column of its own left of the terminals, 540px wide; the Usage section, the Memory mod and the CPU mod leave the sidebar for a row along the bottom, under the terminals; and `names` sits at the end of that row, where it draws a note saying that it draws nothing, and what it does. `npm test` fails, naming the mod, when a mod in `mods/` is not on it, so a card that adds a mod adds it here too. |
|
|
23
|
+
| `layouts/vibe.json` | Three columns side by side, each the window's full height, for steering every agent without reading code. The left one is the sidebar, 268px wide as `default`'s is: Herdr's brand, the layout dropdown, the Ocnus spaces panel and, at its bottom, the Step counts section, the Usage section, the Memory mod and the CPU mod, stacked in that order with nothing between them. The middle one is the card list, the `card-list` mod, which fills its place there (see [The card list](#the-card-list)), above the place for Brainstorm (LAB-240), and the right one is the place for Needs you (LAB-238), which turns into the opened agent (LAB-239). Those two places are still empty: each is a column with nothing in it, which its card swaps for the mod's block, so the layout names no mod that is not installed. It shows no files, diffs or split terminals: it has no Files panel, no Changes panel, no tab bar and no block for a tab's terminals, shown or hidden, so code is only in the pull requests. It has no settings button and no footer either: the settings button is on `default`, and Herdr's Settings still opens by its key. The `names` mod is beside the brand, in a block 1px wide. `layouts/vibe.svg`, beside it, is its picture in Herdr's Settings: `ocnus install` and `ocnus update` link it, and `ocnus status` lists it, as they do a layout. |
|
|
23
24
|
| `spaces/template/` | The starting `SPACE.md` for every new space. |
|
|
24
25
|
|
|
25
26
|
The skills are in [../skills/](../skills/), outside this folder. They are
|
|
@@ -614,6 +615,118 @@ has merged.
|
|
|
614
615
|
has stopped is in the mark's colour, and its tooltip says what `task log`
|
|
615
616
|
says.
|
|
616
617
|
|
|
618
|
+
### The card list
|
|
619
|
+
|
|
620
|
+
On the `vibe` layout, the card list fills the top of the middle column,
|
|
621
|
+
above the place for Brainstorm, and `showcase` has it in a column of its own
|
|
622
|
+
beside the terminals. It shows the cards of the space that is showing in two
|
|
623
|
+
views, so that you can tell where each card stands, start one and open its
|
|
624
|
+
agent with a click, without looking for a tab or opening Linear.
|
|
625
|
+
|
|
626
|
+
- **A toggle at its top picks the view**: Agents or Linear, each with how
|
|
627
|
+
many cards it has, the running cards and the open ones. The list shows
|
|
628
|
+
Agents until you click Linear, and a click on either side shows that
|
|
629
|
+
view. Herdr starts it on Agents again. A list too long for its place
|
|
630
|
+
scrolls there, and Brainstorm's place below it stays as it is.
|
|
631
|
+
- **Agents lists the cards that are running**, and no others, one row each
|
|
632
|
+
however many tabs a card has. A card is running while a tab ocnus opened
|
|
633
|
+
for it is open and the phase that tab is for is still going on: its
|
|
634
|
+
write-up tab until the card is approved and its agent's turn there has
|
|
635
|
+
ended, then its task's tab, from when `task start` records the start until
|
|
636
|
+
its pull requests have merged. So when the build phase starts, the card's
|
|
637
|
+
row goes on with the newer agent. A held card whose write-up tab is still
|
|
638
|
+
open is not running once its agent's turn there has ended, and neither is
|
|
639
|
+
a merged card whose tab has not closed yet, nor a card whose tab you closed
|
|
640
|
+
while its step was under way. A card you start with `task new` is running
|
|
641
|
+
as soon as its write-up tab is open.
|
|
642
|
+
- **Its rows come in order of need**: Stuck first, then Permission, Approve?
|
|
643
|
+
and Asking together, then Merge?, then Working. Rows of the same need come
|
|
644
|
+
in the order of their IDs, by number, so a row moves only when its status
|
|
645
|
+
changes.
|
|
646
|
+
- **A row shows** the card's ID, its title and, under it, which sub-issue of
|
|
647
|
+
which parent card it is, as `2/4 of LAB-30` and that card's title, or
|
|
648
|
+
`no parent card`. Then a bar of seven boxes, one for each step, define,
|
|
649
|
+
plan, breakdown, start, build, review and pr: the box of the step the card
|
|
650
|
+
stands on, as `task log` has it, is in the colour of its status, the boxes
|
|
651
|
+
before it are done, and the bar's tooltip names the step. Then its status,
|
|
652
|
+
and how long it has been so, as `ocnus task log <space>` gives it, over
|
|
653
|
+
the tokens the card's agents have used so far over all its steps, as
|
|
654
|
+
`640k tok` or `1.2M tok` (see [Hand-offs](#hand-offs)). A card with no
|
|
655
|
+
figures shows the time alone, never 0.
|
|
656
|
+
- **A status is the first of these that holds**, in its colour:
|
|
657
|
+
|
|
658
|
+
| Status | Colour | The card |
|
|
659
|
+
|---|---|---|
|
|
660
|
+
| Stuck | Red | `task log` says its agent is stuck or has stopped: it hit an error, stopped without handing off or is not running, or a pull request of the card's is closed, in conflict or unwatched. A card whose step failed is Stuck too |
|
|
661
|
+
| Permission | Amber | Its agent waits on a permission prompt in its tab |
|
|
662
|
+
| Approve? | Amber | `sdlc-breakdown` asks you to approve the card |
|
|
663
|
+
| Asking | Amber | It waits on you for anything else: a question its step asked, or its agent asking in its tab or waiting for a sign-in |
|
|
664
|
+
| Merge? | Green or amber | Its pull requests wait on you to merge them: green once the card is ready to merge, as its dot in the Step counts section is, and amber until then |
|
|
665
|
+
| Working | Blue | It is running, and none of those holds: its step is under way |
|
|
666
|
+
|
|
667
|
+
Answering is Needs you's: a row only shows that a card is asking.
|
|
668
|
+
- **Linear lists every open card of the space's teams**, the cards
|
|
669
|
+
`ocnus task ls <space>` lists, each under the row of its parent card,
|
|
670
|
+
parents in the order of their IDs, the highest number first, and each
|
|
671
|
+
sub-issue in its place, which its row starts with, as `2/4`. A parent has
|
|
672
|
+
a row even when it is not running, when it is not open itself and when it
|
|
673
|
+
is in another team. Its row shows only its ID, its title, its status when
|
|
674
|
+
it is running, or `no agent`, and how many of its sub-issues have merged,
|
|
675
|
+
as `1/4 merged`: no steps and no button. A sub-issue that is a parent too
|
|
676
|
+
shows only as the head of its own sub-issues. Cards with no parent come
|
|
677
|
+
last, under `No parent card`, the highest number first. A running card's
|
|
678
|
+
row shows what its row in Agents shows, but for the line about its parent.
|
|
679
|
+
Any other row is the first of these that fits:
|
|
680
|
+
- **Not started**, with an empty bar and a Start button, for a card not
|
|
681
|
+
approved yet: in Backlog, or another status before its team's first
|
|
682
|
+
not-started one (a status of type `triage` or `backlog`).
|
|
683
|
+
- **Held**, with its bar on start and each card it waits on, as
|
|
684
|
+
`waits on LAB-9`, for a card `task ls` says is held (see
|
|
685
|
+
[Starting the work](#starting-the-work)).
|
|
686
|
+
- **Its bar and status as `task log` has them**, such as Stuck when its
|
|
687
|
+
agent has stopped or Merge? when its pull requests wait on you, or, when
|
|
688
|
+
no status holds, its status in Linear, such as Todo, in grey. A card
|
|
689
|
+
that is not running is never Working.
|
|
690
|
+
- **Start runs `ocnus task new <space> <card>`**, as Start does in the
|
|
691
|
+
Cards panel: one card starts at a time, the button reads Starting… until
|
|
692
|
+
the command is done, and if it fails, a notification shows what it said.
|
|
693
|
+
Once the card's tab is open, its row is a running one.
|
|
694
|
+
- **A row with no button is not one to start here**: a card that is
|
|
695
|
+
approved or further on never has Start, and a parent's row has none.
|
|
696
|
+
Starting again a card whose agent has stopped is for its tab, or for
|
|
697
|
+
`task build --continue` (see [Starting the work](#starting-the-work)).
|
|
698
|
+
- **A click on a running card's row opens its agent**, in either view, a
|
|
699
|
+
parent's row too: it sets Herdr's shared value `ocnus.open` to
|
|
700
|
+
`{"space": "<space>", "card": "<card>"}`, which every mod can read. The
|
|
701
|
+
opened agent (LAB-239) shows that card on the right side of `vibe`, and
|
|
702
|
+
the row is marked for as long as the value names it. A row of a card that
|
|
703
|
+
is not running has no click. Before the opened agent is installed, a
|
|
704
|
+
click marks the row and does nothing more.
|
|
705
|
+
- **It updates on its own** while Herdr's window is visible, with no click
|
|
706
|
+
or restart. It looks at Herdr's tabs in the space every 2 seconds, and
|
|
707
|
+
reads `task log` again as soon as a tab opens, closes or is renamed, or
|
|
708
|
+
one of its terminals reports another status, and every 6 seconds: an
|
|
709
|
+
agent's change of state shows within 5 seconds, and a card's move to
|
|
710
|
+
another step within 10, as in the Step counts section. It reads the cards
|
|
711
|
+
of `task ls` again about once a minute, so a change in Linear, such as a
|
|
712
|
+
new card, a merge or a blocker that is done, shows within about a minute,
|
|
713
|
+
and at once when another space is shown.
|
|
714
|
+
- **One line stands in place of the rows** when the space that is showing is
|
|
715
|
+
not an ocnus space, when the `ocnus` on the machine is too old to say
|
|
716
|
+
which cards are running, when `task log` fails, in which case it is what
|
|
717
|
+
`ocnus` said, with no card running, in Agents, and with no open card, in
|
|
718
|
+
Linear. When the cards cannot be read from Linear, Linear says why in the
|
|
719
|
+
words of `task ls`, such as no Linear key saved or Linear out of reach,
|
|
720
|
+
and Agents still lists the running cards, each with its ID, its bar, its
|
|
721
|
+
status and its time.
|
|
722
|
+
- **It works nothing out itself.** The space comes from
|
|
723
|
+
`ocnus space ls --json`, the cards, with their parents, places and
|
|
724
|
+
blockers, from `ocnus task ls <space> --json`, and where each card stands,
|
|
725
|
+
whether it is running, its status, its colour and its place in the order
|
|
726
|
+
of need, with its time and its tokens, from `ocnus task log <space> --json`
|
|
727
|
+
(see [Hand-offs](#hand-offs)), joined by card ID. When `ocnus` is not on
|
|
728
|
+
Herdr's `PATH`, it runs the copy the mod is linked from.
|
|
729
|
+
|
|
617
730
|
### Hand-offs
|
|
618
731
|
|
|
619
732
|
Each step of the write-up phase ends by handing off: which step it was, how it
|
|
@@ -1098,8 +1211,19 @@ ocnus task answer <space> <card> <question> <answer>
|
|
|
1098
1211
|
`needs-human`, `ready` or `working`, most urgent first, and none at
|
|
1099
1212
|
`start`), and its `text`, the count as the Step counts section shows it,
|
|
1100
1213
|
such as `2 held` at `start` (see
|
|
1101
|
-
[The Step counts section](#the-step-counts-section)).
|
|
1102
|
-
|
|
1214
|
+
[The Step counts section](#the-step-counts-section)). Each of its
|
|
1215
|
+
`cards` has what the card list shows of it too (see
|
|
1216
|
+
[The card list](#the-card-list)):
|
|
1217
|
+
|
|
1218
|
+
| Key | What it is |
|
|
1219
|
+
|---|---|
|
|
1220
|
+
| `stand` | The step the card stands on, as the counts place it, so the card's row and its dot are on the same step: the step that comes next after one that is done, or the step that asked, was answered or failed. `null` once its pull requests have merged |
|
|
1221
|
+
| `running` | `true` while a tab ocnus opened for the card is open for the phase going on: the tab its agent is looked for in, until the card has merged. At `start`, the card is approved, and it is running only while its write-up agent is working, blocked or has hit an error. `false` with no tab to look in |
|
|
1222
|
+
| `word` | Its status in the card list, the first of these that holds: `Stuck` (any agent state but `blocked`, or a step that failed), `Permission` (`blocked` on a permission prompt), `Approve?` (breakdown's question for the approval), `Asking` (`blocked` otherwise, or any other question but the wait for the merge), `Merge?` (the pr step's wait for the merge) and `Working` (the card is running). `null` when none holds. The approval and the merge are told as `task asks` tells them |
|
|
1223
|
+
| `mark` | The word's colour, as the marks of `counts` name them: `stuck` for Stuck, `ready` for a Merge? that is ready to merge, `working` for Working, and `needs-human` for the rest; `null` with no word |
|
|
1224
|
+
| `need` | The word's place in the order of need: 0 for Stuck, 1 for Permission, Approve? and Asking, 2 for Merge? and 3 for Working; `null` with no word |
|
|
1225
|
+
|
|
1226
|
+
None of it is stored: it is read from Herdr and those
|
|
1103
1227
|
files each time, and no row or step's time changes with it. With `jq`
|
|
1104
1228
|
missing, every card shows as before. With `hc` missing, or with neither
|
|
1105
1229
|
herdr-core able to list its terminals nor the app open and able to list
|
|
@@ -1166,6 +1290,58 @@ ocnus task answer <space> <card> <question> <answer>
|
|
|
1166
1290
|
error or gives no brief with all three parts, with what it said. Each of
|
|
1167
1291
|
them but the last is found before any model call. A worktree's copy of
|
|
1168
1292
|
ocnus refuses `task brief`, since it is a model call and keeps the brief.
|
|
1293
|
+
- **`task events` lists what a card's agents did, step by step.**
|
|
1294
|
+
|
|
1295
|
+
```sh
|
|
1296
|
+
ocnus task events <space> <card> [--step <step>] [--json]
|
|
1297
|
+
```
|
|
1298
|
+
|
|
1299
|
+
It reads three things and writes nothing: the card's steps, from the store
|
|
1300
|
+
through the view `task log` reads, its sessions, from the `sessions`
|
|
1301
|
+
table, and each session's transcript, the `<ID>.jsonl` Claude Code keeps
|
|
1302
|
+
for it, found as `task build --continue` finds it, with `jq`. A step is
|
|
1303
|
+
each time the card was in it, as `host report --card` has it: hand-offs of one step
|
|
1304
|
+
in a row, from the hand-off before the first to the last, the step under
|
|
1305
|
+
way running to now; `new` and `start` have none. An entry of a write-up
|
|
1306
|
+
session, a line of its transcript, goes in define, plan or breakdown, and
|
|
1307
|
+
one of a build session in build, review or pr, of the run the session
|
|
1308
|
+
started in: the first of those steps that ends at or after the entry's
|
|
1309
|
+
second, else the last. So the command that records a hand-off is in the
|
|
1310
|
+
step it ends, and the write-up agent's `task start` is under breakdown. A
|
|
1311
|
+
step is recorded when a transcript has an entry in it, and so is the step
|
|
1312
|
+
under way once the newest session of its phase has a transcript. The
|
|
1313
|
+
events are read from the main conversation, a subagent's left out: an
|
|
1314
|
+
edit is an `Edit` or `Write` call that worked; a test run a `Bash` call
|
|
1315
|
+
whose command, without its heredocs' bodies, runs `ocnus tests run`, with
|
|
1316
|
+
its totals from the last line it printed with `<n> passed`, and
|
|
1317
|
+
`<n> failed` from that line, or, when its output went to a file or it ran
|
|
1318
|
+
in the background, from the first command after it that names the file
|
|
1319
|
+
and printed such a line; a commit a `Bash` call that worked, runs
|
|
1320
|
+
`git commit` and printed git's own `[<branch> <hash>] <subject>` line or
|
|
1321
|
+
a `git log --oneline` line for it; a question an `ocnus task handoff` call
|
|
1322
|
+
that worked with `status: needs-human`, its `question:` line; an answer a
|
|
1323
|
+
prompt with `origin.kind` `human`, but for the transcript's first, one
|
|
1324
|
+
that starts `ocnus-merges:`, and `brief`; and a command any other `Bash`
|
|
1325
|
+
call, its `description`, or `Ran <program>` with none. `--step` gives one
|
|
1326
|
+
step alone, each time the card was in it. In words it prints a line naming
|
|
1327
|
+
the card, then each step with its start, then a line an event with its
|
|
1328
|
+
time, its kind and its text, or `not recorded`, or `nothing to list` for a
|
|
1329
|
+
recorded step with no event. `--json` prints one line, with `space`,
|
|
1330
|
+
`card` and `steps`, oldest first. A step has `run`, as in
|
|
1331
|
+
`task log --json`, `step`, `start` and `end`, in UTC as `task log --json`
|
|
1332
|
+
gives times, `open`, true for the step under way, `recorded`, and
|
|
1333
|
+
`events`: null when `recorded` is false, else a list, oldest first. An
|
|
1334
|
+
event has `at` and `clock`, as a row of `task log --json` has them,
|
|
1335
|
+
`kind`, one of `edit`, `test run`, `command`, `commit`, `question` and
|
|
1336
|
+
`answer`, and `text`, one line of at most 200 characters. An edit has
|
|
1337
|
+
`files`, each once, and `count`; a test run has `passed`, `failed` and
|
|
1338
|
+
`running`, true while it is still going, a total that is not known being
|
|
1339
|
+
null; a commit has `hash` and `subject`. A card with no hand-offs has
|
|
1340
|
+
`"steps": []` and exits 0, as `task log --json` does. A space that does
|
|
1341
|
+
not exist, a card that is not a card ID, a `--step` that is not define,
|
|
1342
|
+
plan, breakdown, build, review or pr, and an option it does not know are
|
|
1343
|
+
refused on stderr, with exit 1 and nothing on stdout. A worktree's copy of
|
|
1344
|
+
ocnus runs it, since it only reads.
|
|
1169
1345
|
- **They are kept in `~/.config/ocnus/ocnus.db`,** a SQLite file
|
|
1170
1346
|
beside your spaces, on this machine only, each one with its space. It
|
|
1171
1347
|
needs `sqlite3`, which macOS ships; `OCNUS_SQLITE` picks another
|
|
@@ -2949,8 +3125,8 @@ shell, or written as a `NAME=value` line in ocnus's env file,
|
|
|
2949
3125
|
`space team <name>`, `profile ls`, `linear archive` (alone or with
|
|
2950
3126
|
`--json`), `tests` (alone or with `--json`), `billing` (alone or with
|
|
2951
3127
|
`--json`), `usage` (alone or with `--json`), `task ls`, `task log`,
|
|
2952
|
-
`task asks`, `host` and `host report`. Any other command
|
|
2953
|
-
before it changes anything, and says to run plain `ocnus` for a card's
|
|
3128
|
+
`task asks`, `task events`, `host` and `host report`. Any other command
|
|
3129
|
+
stops before it changes anything, and says to run plain `ocnus` for a card's
|
|
2954
3130
|
own steps, to write a test case to try the command, or to run it for real
|
|
2955
3131
|
with `OCNUS_LIVE=1 ./cli/ocnus …`. Plain `ocnus` is never
|
|
2956
3132
|
stopped.
|
|
@@ -137,6 +137,18 @@
|
|
|
137
137
|
"id": "work-body",
|
|
138
138
|
"type": "row",
|
|
139
139
|
"children": [
|
|
140
|
+
{
|
|
141
|
+
"id": "card-list",
|
|
142
|
+
"type": "block",
|
|
143
|
+
"content": {
|
|
144
|
+
"mod": "card-list"
|
|
145
|
+
},
|
|
146
|
+
"size": {
|
|
147
|
+
"px": 540
|
|
148
|
+
},
|
|
149
|
+
"min": 280,
|
|
150
|
+
"max": 900
|
|
151
|
+
},
|
|
140
152
|
{
|
|
141
153
|
"id": "main",
|
|
142
154
|
"type": "block",
|