@johngaynor/ocnus 2.0.1-next.76 → 2.0.1-next.80

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/cli/lib/host.sh CHANGED
@@ -27,8 +27,8 @@
27
27
  # so that no process counts toward two, and the shares add up to the agents'
28
28
  # totals. A share names its terminal's work by the card its labels give, the
29
29
  # phase its tab gives, and the step that card is in, from the hand-off store,
30
- # which the recorder only ever reads. `host report` ranks the steps and
31
- # phases by them.
30
+ # which the recorder only ever reads. `host report` sums them up by step and
31
+ # by phase, never card by card.
32
32
  #
33
33
  # Each reading also counts the agents open as working or waiting, and each
34
34
  # share says which its agent was. An agent is working while it takes its
@@ -43,7 +43,7 @@
43
43
  # memory it held at once. A test run is named by its card and repo alone.
44
44
  # Its command is kept only as a fingerprint, a number the same for the same
45
45
  # command and from which its text cannot be read back, and nothing else of
46
- # its command line is kept. `host report` ranks the test runs too.
46
+ # its command line is kept. `host report` sums the test runs up by repo.
47
47
  #
48
48
  # With each reading go the shares of the test runs going then, too, each
49
49
  # worked out as a terminal's is, from the processes under the run's job,
@@ -1214,11 +1214,11 @@ host_day() {
1214
1214
  # How the host worked over a period, in its numbers alone: how much of the
1215
1215
  # period was recorded, in all and on each day, with time with no reading
1216
1216
  # shown as missing, never as idle (host_report_sql). Then the host's numbers
1217
- # summed up (host_numbers_sql), the steps, phases and test runs that used the
1218
- # most (host_ranks_sql), and it ends with where the steps' time went
1219
- # (host_split_sql).
1217
+ # summed up (host_numbers_sql), the work summed up by step, by phase and by
1218
+ # repo (host_work_sql), and it ends with where the steps' time went, by step
1219
+ # (host_split_sql). It ranks nothing, and names no card.
1220
1220
  host_report() {
1221
- local period=${1:-7d} now start end n first last row have ranks=0 works=0 splits=0
1221
+ local period=${1:-7d} now start end n first last row have
1222
1222
  # A card's readings, as JSON, are a form of their own.
1223
1223
  for n in "$@"; do
1224
1224
  case $n in --card | --json) host_card "$@"; return ;; esac
@@ -1264,23 +1264,13 @@ host_report() {
1264
1264
  fi
1265
1265
  # A store the recorder has not opened since a table or a column came has
1266
1266
  # none of it, and the report only reads the store, so it never adds them.
1267
- # A number whose column the store lacks is not read. The lists of what
1268
- # used the most need the readings' cores, the shares and the test runs,
1269
- # and where the steps' time went needs the shares, and the splits to split
1270
- # it.
1267
+ # A column the store lacks is read as null, so that its number is not
1268
+ # read, and a table it lacks as one with no rows (host_select).
1271
1269
  have=$(host_columns) || have=' '
1272
- case $have in *' shares.'*) works=1 ;; esac
1273
- case $have in *' splits.'*) splits=$works ;; esac
1274
- case $have in *' readings.cores '*) case $have in *' test_runs.'*) ranks=$works ;; esac ;; esac
1275
1270
  store "$HOST_DB" "$(host_report_sql "$start" "$end" "$period")" || die "could not read $HOST_DB"
1276
1271
  store "$HOST_DB" "$(host_numbers_sql "$start" "$end" "$have")" || die "could not read $HOST_DB"
1277
- if [ "$ranks" = 1 ]; then
1278
- store "$HOST_DB" "$(host_ranks_sql "$start" "$end")" || die "could not read $HOST_DB"
1279
- else
1280
- say ''
1281
- say 'No step, phase or test run was recorded in this period.'
1282
- fi
1283
- store "$HOST_DB" "$(host_split_sql "$start" "$end" "$works" "$splits")" || die "could not read $HOST_DB"
1272
+ store "$HOST_DB" "$(host_work_sql "$start" "$end" "$have")" || die "could not read $HOST_DB"
1273
+ store "$HOST_DB" "$(host_split_sql "$start" "$end" "$have")" || die "could not read $HOST_DB"
1284
1274
  }
1285
1275
 
1286
1276
  # The tables and the columns the readings' store has, each column as its
@@ -1290,6 +1280,33 @@ host_columns() {
1290
1280
  from sqlite_master m join pragma_table_info(m.name) p where m.type = 'table';"
1291
1281
  }
1292
1282
 
1283
+ # SQL that selects the columns $3 onward of the table $2, from a store whose
1284
+ # tables and columns $1 lists, as host_columns gives them: a column the
1285
+ # store lacks as null, and no row at all when it lacks the table.
1286
+ host_select() {
1287
+ local have=$1 table=$2 c cols=''
1288
+ shift 2
1289
+ for c in "$@"; do
1290
+ case $have in *" $table.$c "*) cols="$cols, $c" ;; *) cols="$cols, null as $c" ;; esac
1291
+ done
1292
+ case $have in
1293
+ *" $table."*) printf 'select %s from %s' "${cols#, }" "$table" ;;
1294
+ *) printf 'select %s where 0' "${cols#, }" ;;
1295
+ esac
1296
+ }
1297
+
1298
+ # SQL for the place of the value of the column $1 among the names $2 onward,
1299
+ # from 1 in their order; a value that is none of them comes after them all.
1300
+ host_order() {
1301
+ local col=$1 name sql='' n=0
1302
+ shift
1303
+ for name in "$@"; do
1304
+ n=$((n + 1))
1305
+ sql="$sql when '$name' then $n"
1306
+ done
1307
+ printf 'case %s%s else %s end' "$col" "$sql" $((n + 1))
1308
+ }
1309
+
1293
1310
  # The top of the report, for the period from $1 to $2, named $3: how much of
1294
1311
  # it was recorded and how much is missing, then the same for each day. A
1295
1312
  # reading covers the secs before its at, so each one counts for the part of
@@ -1459,128 +1476,147 @@ host_state() {
1459
1476
  else $shown || case when $left > 0 then ', $none ' || $(sql_took "($left)") else '' end end"
1460
1477
  }
1461
1478
 
1462
- # The steps and the phases that used the most CPU time, and that held the
1463
- # most memory at once, from $1 to $2: ten of each, each one card's own. Each
1464
- # counts what its shares say for the part of their reading in the period,
1465
- # as the report counts a reading: its CPU time is its share of all cores
1466
- # times that part times the cores, its memory the most its shares held in one
1467
- # reading, and its time those parts together.
1479
+ # The work from $1 to $2, summed up by kind, never card by card: each step,
1480
+ # each phase, and each repo's test runs. $3 lists the store's tables and
1481
+ # columns, as host_columns gives them: a column the store lacks is read as
1482
+ # null, and a table it lacks as one with no rows (host_select).
1483
+ #
1484
+ # A step or a phase counts each card's shares while its agent was open, for
1485
+ # the part of their reading in the period, as the report counts a reading,
1486
+ # and once a reading however many of the card's tabs were in it: so a
1487
+ # step's time in all is the time its agents were open, which where the
1488
+ # steps' time went splits. A card's CPU time in it is its shares' share of
1489
+ # all cores, over that part, on the reading's cores, and its memory the most
1490
+ # its shares held in one reading. Its line gives how many cards were in it,
1491
+ # their time in all, on average and at the longest, their CPU time added up,
1492
+ # and the most memory one of them held.
1493
+ #
1494
+ # A repo's line counts its test runs that started in the period: how many,
1495
+ # the time in all, on average and at the longest of those that ended, their
1496
+ # CPU time added up, and the most memory one held. When any were cut short,
1497
+ # ended by the recorder as their process had gone, or are still going, it
1498
+ # ends with how many of each.
1468
1499
  #
1469
- # Then the ten test runs that started in the period and used the most CPU
1470
- # time, and the ten that held the most memory at once, each named by its
1471
- # card, its repo and when it started, with how long it ran. A run the
1472
- # recorder cut short says so, and has as its CPU what the recorder counted
1473
- # of it: with none counted, it is only ranked by its memory. One still going
1474
- # says that in place of its time. With no step, phase or test run in the
1475
- # period, it says so in place of the lists.
1476
- host_ranks_sql() {
1477
- local s=$1 e=$2 name ran
1478
- name="' ' || printf('%-32s', card || ' ' || repo || ' ' || strftime('%Y-%m-%d %H:%M', started, 'unixepoch', 'localtime'))"
1479
- ran="case when ended is null then ', still going'
1480
- else ', ran ' || $(sql_took "cast(round(secs) as integer)") || case when cut = 1 then ', cut short' else '' end end"
1500
+ # The order is fixed, never by size: the steps from define to pr, write-up
1501
+ # before build, the repos by name. A list with none says none recorded, and
1502
+ # with no step, phase or test run at all, it says so in place of the lists.
1503
+ # A figure no row holds says not read, as SQLite's printf would print a null
1504
+ # as 0, and sql_took of a null is null.
1505
+ host_work_sql() {
1506
+ local s=$1 e=$2 have=$3 line
1507
+ line="' ' || printf('%-18s ', name) || many || noun || ', '
1508
+ || case when ran is null then 'time not read'
1509
+ else $(sql_took ran) || ' in all, ' || $(sql_took mean) || ' on average, ' || $(sql_took longest) || ' at the longest' end
1510
+ || '; CPU time ' || case when cpu is null then 'not read' else $(sql_took cpu) end
1511
+ || '; memory ' || case when mem is null then 'not read' else mem || ' MB at most' end || tail"
1481
1512
  cat <<EOF
1482
1513
  with
1483
- runs(card, repo, started, ended, secs, cpu, mem, cut) as (
1484
- select card, repo, started, ended, secs, cpu_secs, mem_mb, cut from test_runs where started >= $s and started < $e),
1514
+ r(at, secs, cores) as ($(host_select "$have" readings at secs cores)),
1485
1515
  parts(at, d, cores) as (
1486
- select at, max(0, min(at, $e) - max(at - secs, $s)), cores from readings
1516
+ select at, max(0, min(at, $e) - max(at - secs, $s)), cores from r
1487
1517
  where at > $s and at < $e + $HOST_GAP and at - secs < $e),
1518
+ sh(at, card, phase, step, open, cpu, mem) as ($(host_select "$have" shares at card phase step open cpu mem_mb)),
1488
1519
  owned(kind, card, what, at, d, cpu, mem) as (
1489
- select 'step', s.card, s.step, p.at, p.d, s.cpu * p.d * p.cores / 100.0, s.mem_mb
1490
- from parts p join shares s on s.at = p.at where s.card is not null and s.step is not null
1520
+ select 'step', s.card, s.step, p.at, p.d, s.cpu * p.d * p.cores / 100.0, s.mem
1521
+ from parts p join sh s on s.at = p.at where s.open = 1 and s.card is not null and s.step is not null
1491
1522
  union all
1492
- select 'phase', s.card, s.phase, p.at, p.d, s.cpu * p.d * p.cores / 100.0, s.mem_mb
1493
- from parts p join shares s on s.at = p.at where s.card is not null and s.phase is not null),
1523
+ select 'phase', s.card, s.phase, p.at, p.d, s.cpu * p.d * p.cores / 100.0, s.mem
1524
+ from parts p join sh s on s.at = p.at where s.open = 1 and s.card is not null and s.phase is not null),
1494
1525
  once(kind, card, what, d, cpu, mem) as (
1495
1526
  select kind, card, what, max(d), sum(cpu), sum(mem) from owned group by kind, card, what, at),
1496
1527
  totals(kind, card, what, ran, cpu, mem) as (
1497
- select kind, card, what, sum(d), cast(round(sum(cpu)) as integer), max(mem) from once group by kind, card, what),
1498
- ranked(n, k, line) as (
1499
- select case kind when 'step' then 1 else 3 end, row_number() over (partition by kind order by cpu desc, card, what),
1500
- ' ' || printf('%-24s', card || ' ' || what || ' ' || kind) || ' CPU time ' || $(sql_took cpu) || ', ran ' || $(sql_took ran)
1501
- from totals where cpu is not null
1528
+ select kind, card, what, sum(d), sum(cpu), max(mem) from once group by kind, card, what),
1529
+ t(repo, started, ended, secs, cpu, mem, cut) as ($(host_select "$have" test_runs repo started ended secs cpu_secs mem_mb cut)),
1530
+ runs(repo, many, ran, mean, longest, cpu, mem, cut, going) as (
1531
+ select repo, count(*), sum(took), avg(took), max(took), sum(cpu), max(mem),
1532
+ sum(case when cut = 1 then 1 else 0 end), sum(case when ended is null then 1 else 0 end)
1533
+ from (select repo, case when ended is not null then secs end as took, ended, cpu, mem, cut from t
1534
+ where started >= $s and started < $e)
1535
+ group by repo),
1536
+ sums(n, o, name, many, noun, ran, mean, longest, cpu, mem, tail) as (
1537
+ select case kind when 'step' then 1 else 2 end,
1538
+ case kind when 'step' then $(host_order what $HOST_WRITE_UP_STEPS $HOST_BUILD_STEPS) else $(host_order what write-up build) end,
1539
+ what, count(*), case when count(*) = 1 then ' card' else ' cards' end,
1540
+ sum(ran), avg(ran), max(ran), sum(cpu), max(mem), ''
1541
+ from totals group by kind, what
1502
1542
  union all
1503
- select case kind when 'step' then 2 else 4 end, row_number() over (partition by kind order by mem desc, card, what),
1504
- ' ' || printf('%-24s', card || ' ' || what || ' ' || kind) || ' memory ' || mem || ' MB, ran ' || $(sql_took ran)
1505
- from totals where mem is not null
1506
- union all
1507
- select 5, row_number() over (order by cpu desc, started, card, repo),
1508
- $name || ' CPU time ' || $(sql_took "cast(round(cpu) as integer)") || $ran
1509
- from runs where cpu is not null
1510
- union all
1511
- select 6, row_number() over (order by mem desc, started, card, repo),
1512
- $name || ' memory ' || mem || ' MB' || $ran
1513
- from runs where mem is not null),
1514
- heads(n, head) as (values (1, 'Steps that used the most CPU time:'), (2, 'Steps that held the most memory at once:'),
1515
- (3, 'Phases that used the most CPU time:'), (4, 'Phases that held the most memory at once:'),
1516
- (5, 'Test runs that used the most CPU time:'), (6, 'Test runs that held the most memory at once:')),
1517
- found(yes) as (select exists (select 1 from totals) or exists (select 1 from runs)),
1518
- lines(n, k, line) as (
1519
- select 0, 0, ''
1520
- union all select 0, 1, 'No step, phase or test run was recorded in this period.' from found where not yes
1521
- union all select n, 0, head from heads, found where yes
1522
- union all select n, 1, ' none recorded' from heads h, found
1523
- where yes and not exists (select 1 from ranked r where r.n = h.n)
1524
- union all select n, k, line from ranked where k <= 10)
1525
- select line from lines order by n, k;
1543
+ select 3, 1, repo, many, case when many = 1 then ' run' else ' runs' end, ran, mean, longest, cpu, mem,
1544
+ case when cut > 0 then '; ' || cut || ' cut short' else '' end
1545
+ || case when going > 0 then case when cut > 0 then ', ' else '; ' end || going || ' still going' else '' end
1546
+ from runs),
1547
+ shown(n, o, name, line) as (
1548
+ select n, o, name, $line from (
1549
+ select n, o, name, many, noun, cast(round(ran) as integer) as ran, cast(round(mean) as integer) as mean,
1550
+ cast(round(longest) as integer) as longest, cast(round(cpu) as integer) as cpu,
1551
+ cast(round(mem) as integer) as mem, tail
1552
+ from sums)),
1553
+ heads(n, head) as (values (1, 'Steps:'), (2, 'Phases:'), (3, 'Test runs:')),
1554
+ found(yes) as (select exists (select 1 from sums)),
1555
+ lines(n, o, name, line) as (
1556
+ select 0, 0, '', ''
1557
+ union all select 0, 1, '', 'No step, phase or test run was recorded in this period.' from found where not yes
1558
+ union all select n, 0, '', head from heads, found where yes
1559
+ union all select n, 1, '', ' none recorded' from heads h, found
1560
+ where yes and not exists (select 1 from sums s where s.n = h.n)
1561
+ union all select n, o, name, line from shown)
1562
+ select line from lines order by n, o, name;
1526
1563
  EOF
1527
1564
  }
1528
1565
 
1529
- # Where the steps' time went from $1 to $2, from the shares when $3 is 1 and
1530
- # the splits when $4 is 1: first the agents' time in all on the host,
1531
- # waiting on the model and the rest, over the splits, then the same for the
1532
- # 10 steps open longest with a split, each one card's own, longest first.
1533
- # Each split counts for the part of its reading in the period, as the report
1534
- # counts a reading: its seconds on the host and on the model in that
1535
- # proportion, and the rest is that part less the two. Each line says how
1536
- # long it was open, and its three parts, to the second, which add up to
1537
- # that. Then how many steps were open in the period with no split. With no
1538
- # split, it says no step was split, and why.
1566
+ # Where the steps' time went from $1 to $2, from the splits: first the
1567
+ # agents' time in all on the host, waiting on the model and the rest, then
1568
+ # the same for each step, every card's splits in it added up, in the order
1569
+ # the steps go, from define to pr. Each split counts for the part of its
1570
+ # reading in the period, as the report counts a reading: its seconds on the
1571
+ # host and on the model in that proportion, and the rest is that part less
1572
+ # the two. Each line says how long it was open, and its three parts, to the
1573
+ # second, which add up to that. Then how many steps were open in the period
1574
+ # with no split, each card's step counted once. With no split, it says no
1575
+ # step was split, and why. $3 lists the store's tables and columns, as
1576
+ # host_columns gives them: a store with no table of shares or of splits is
1577
+ # read as one with none of them (host_select).
1539
1578
  HOST_NO_SPLIT="an agent's time is split only when it starts in Claude Code while recording is on"
1540
1579
  host_split_sql() {
1541
- local s=$1 e=$2 shares splits line why
1580
+ local s=$1 e=$2 have=$3 line why
1542
1581
  why=$(sql_str "$HOST_NO_SPLIT")
1543
- shares='select at, card, step, open from shares'
1544
- [ "${3:-0}" = 1 ] || shares='select null, null, null, null where 0'
1545
- splits='select at, card, step, host_secs, model_secs from splits'
1546
- [ "${4:-0}" = 1 ] || splits='select null, null, null, null, null where 0'
1547
- line="' ' || printf('%-24s', name) || ' open ' || $(sql_took d) || ': on the host ' || $(sql_took h)
1582
+ line="' ' || printf('%-18s ', name) || 'open ' || $(sql_took d) || ': on the host ' || $(sql_took h)
1548
1583
  || ', waiting on the model ' || $(sql_took m) || ', the rest ' || $(sql_took r)"
1549
1584
  cat <<EOF
1550
1585
  with
1551
1586
  parts(at, secs, d) as (
1552
1587
  select at, secs, max(0, min(at, $e) - max(at - secs, $s)) from readings
1553
1588
  where at > $s and at < $e + $HOST_GAP and at - secs < $e and secs > 0),
1554
- sh(at, card, step, open) as ($shares),
1555
- x(at, card, step, host, model) as ($splits),
1589
+ sh(at, card, step, open) as ($(host_select "$have" shares at card step open)),
1590
+ x(at, card, step, host, model) as ($(host_select "$have" splits at card step host_secs model_secs)),
1556
1591
  sp(card, step, d, host, model) as (
1557
1592
  select x.card, x.step, p.d, 1.0 * x.host * p.d / p.secs, 1.0 * x.model * p.d / p.secs
1558
1593
  from parts p join x on x.at = p.at),
1559
1594
  steps(card, step, d, host, model) as (
1560
1595
  select card, step, sum(d), sum(host), sum(model) from sp
1561
1596
  where card is not null and step is not null group by card, step),
1562
- shown(k, name, d, host, model) as (
1563
- select 0, 'all agents', d, host, model from (select count(*) n, sum(d) d, sum(host) host, sum(model) model from sp) where n > 0
1597
+ shown(k, o, name, d, host, model) as (
1598
+ select 0, 0, 'all agents', d, host, model from (select count(*) n, sum(d) d, sum(host) host, sum(model) model from sp) where n > 0
1564
1599
  union all
1565
- select row_number() over (order by d desc, card, step), card || ' ' || step || ' step', d, host, model from steps),
1566
- timed(k, name, d, h, m, r) as (
1567
- select k, name, d, cast(round(host) as integer),
1600
+ select 1, $(host_order step $HOST_WRITE_UP_STEPS $HOST_BUILD_STEPS), step, sum(d), sum(host), sum(model)
1601
+ from steps group by step),
1602
+ timed(k, o, name, d, h, m, r) as (
1603
+ select k, o, name, d, cast(round(host) as integer),
1568
1604
  cast(round(host + model) as integer) - cast(round(host) as integer),
1569
1605
  max(0, d - cast(round(host + model) as integer))
1570
- from shown where k <= 10),
1606
+ from shown),
1571
1607
  unsplit(n) as (
1572
1608
  select count(*) from (
1573
1609
  select distinct sh.card, sh.step from parts p join sh on sh.at = p.at
1574
1610
  where sh.open = 1 and sh.card is not null and sh.step is not null
1575
1611
  except select card, step from steps)),
1576
- lines(k, line) as (
1577
- select -2, '' union all select -1, 'Where the steps'' time went:'
1578
- union all select k, $line from timed
1579
- union all select 11, ' ' || n || case when n = 1 then ' step' else ' steps' end
1612
+ lines(k, o, name, line) as (
1613
+ select -2, 0, '', '' union all select -1, 0, '', 'Where the steps'' time went:'
1614
+ union all select k, o, name, $line from timed
1615
+ union all select 2, 0, '', ' ' || n || case when n = 1 then ' step' else ' steps' end
1580
1616
  || ' had no split, as ' || $why from unsplit
1581
1617
  where n > 0 and exists (select 1 from sp)
1582
- union all select 0, ' no step was split, as ' || $why where not exists (select 1 from sp))
1583
- select line from lines order by k;
1618
+ union all select 0, 0, '', ' no step was split, as ' || $why where not exists (select 1 from sp))
1619
+ select line from lines order by k, o, name;
1584
1620
  EOF
1585
1621
  }
1586
1622
 
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
- *) 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] (see: ocnus help)" ;;
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
@@ -122,10 +127,9 @@ Usage:
122
127
  ocnus host on record it every 10 seconds while an agent is open
123
128
  ocnus host off stop recording, and delete every reading
124
129
  ocnus host report [<period>] the host's CPU, memory, disk, network, and power and heat,
125
- summed up, the steps, phases and test runs that used the
126
- most CPU and memory, and where the steps' time went: <n>d
127
- or <n>h back from now (7d when none is given), a day
128
- YYYY-MM-DD, or <day>..<day>
130
+ and the work by step, phase and repo, summed up, and where
131
+ the steps' time went: <n>d or <n>h back from now (7d when
132
+ none is given), a day YYYY-MM-DD, or <day>..<day>
129
133
  ocnus host report --card <space> <card> --json
130
134
  what the host recorded while each of a card's steps ran, as
131
135
  one line of JSON for programs: each step's start and end,
@@ -354,6 +358,24 @@ agent runs in another harness, and one whose transcript Claude Code no
354
358
  longer keeps get no brief: it says why, and exits non-zero, as it does when
355
359
  Claude Code could not make the brief. --json gives the brief, or why there
356
360
  is none, as one line for programs.
361
+ `task events` lists what the card's agents did, oldest first, under each
362
+ step the card has been in, as `task log` times its steps: each event with
363
+ its time, its kind and one line of text. An edit names the files the agent
364
+ edited, edits made one after another being one event; a test run says how
365
+ many cases passed and how many failed, or has no totals while it is still
366
+ going or when they cannot be read, never 0; a commit gives its short hash
367
+ and its subject; a command, any other command the agent ran, says what it
368
+ was for, as the agent described it; a question is what the agent asked you
369
+ in a needs-human hand-off, and an answer what you said to it. It never gives
370
+ a file's contents or a diff, and of what a command printed only a test run's
371
+ totals and a commit's hash and subject. --step lists one step alone, each
372
+ time the card was in it. It reads the transcripts Claude Code keeps of the
373
+ sessions `task new` and `task build` record, so it lists what an agent has
374
+ done so far while it works, and still lists a card that has merged. A step
375
+ whose agent's session was not recorded, as for a card from before sessions
376
+ were, or whose transcript Claude Code no longer keeps, says not recorded,
377
+ never that the agent did nothing. --json gives the same as one line, for
378
+ programs.
357
379
 
358
380
  `host on` turns on a record of how hard this machine, the host, works while
359
381
  ocnus's agents are open, and `host off` turns it off and deletes every
@@ -392,9 +414,13 @@ reading by its seconds in the period. One of the levels is how much of the
392
414
  CPU recording used, its average with watching the test runs included. A
393
415
  number that no reading in the period holds, as on a Mac without it or in
394
416
  readings from before it was recorded, is shown as not read, never as 0.
395
- Then it lists the 10 steps and the 10 phases, each one card's own, that
396
- used the most CPU time, and that held the most memory at once, then the 10
397
- test runs that did.
417
+ Then it sums up the work by kind, never card by card, and ranks none of
418
+ it: for each step from define to pr, and each phase, how many cards were in
419
+ it, how long their agents were open in all, on average and at the longest,
420
+ the CPU time they used and the most memory one held at once; and for each
421
+ repo's test runs, how many there were, how long they took in all, on
422
+ average and at the longest, the CPU time they used, the most memory one
423
+ held, and how many were cut short or are still going.
398
424
 
399
425
  While the host is recorded, `task new` and `task build` also start claude
400
426
  with hooks that mark when its agent starts and stops, is given a prompt,
@@ -404,8 +430,9 @@ or did. From them each reading splits each agent's time into time on the
404
430
  host, while its tools run, waiting on the model, and the rest, such as
405
431
  waiting on you. Then `host report` says where the steps' time went: the
406
432
  agents' time in all on the host, waiting on the model and the rest, the
407
- same for the 10 steps open longest, and how many steps had no split, as an
408
- agent started in another harness or while recording was off has none.
433
+ same for each step, every card's in it together, and how many steps had no
434
+ split, as an agent started in another harness or while recording was off
435
+ has none.
409
436
 
410
437
  Each wait on the model is kept too, as its start and end alone, for 90
411
438
  days.
@@ -644,10 +671,10 @@ read: help, status, space ls, space team <name> with no teams,
644
671
  profile ls, linear archive alone or with --json, tests and tests ls, each
645
672
  alone or with --json, approval alone or with --json, billing alone or with
646
673
  --json, chain alone or with --json, usage alone or with --json, task ls,
647
- task log and task asks. task log and usage read cost.db as they read the
648
- hand-off store, without changing either, and usage record, which writes the
649
- usage reading and cost.db, is refused. Every other command stops before it
650
- does anything, says why, and leaves this machine as it was.
674
+ task log, task asks and task events. task log and usage read cost.db as
675
+ they read the hand-off store, without changing either, and usage record,
676
+ which writes the usage reading and cost.db, is refused. Every other command
677
+ stops before it does anything, says why, and leaves this machine as it was.
651
678
  OCNUS_LIVE=1, set for that one run, runs it for real. The installed
652
679
  ocnus is never stopped, whatever folder it is run from.
653
680
  EOF
@@ -801,7 +828,7 @@ TEMPLATE_MARK='<!-- ocnus:template -->'
801
828
 
802
829
  # Sourced, so every file shares the settings above and each other's functions.
803
830
  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
831
+ 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
832
  [ -f "$LIB/$part.sh" ] ||
806
833
  { printf 'ocnus: %s is missing; reinstall ocnus\n' "$LIB/$part.sh" >&2; exit 1; }
807
834
  # shellcheck source=/dev/null