Pane views: gc roles view beads and gc roles view mail #16

Merged
city-root merged 10 commits from worker/gascitypacks-w8j into main 2026-11-11 18:15:21 +00:00
Contributor

Adds gc roles view beads and gc roles view mail, the two commands for the panes the city's Rex tab shows to the right of the Operator in place of gc supervisor logs --follow. Only the commands: the rexcity change that lets a city declare panes, and the gascity-root change that names these commands and bumps the pins, are separate. Shell and jq, like the pack's other commands and orders: no build step, and the grouping and the line formatting are pure jq, so the tests feed them fixtures.

The command line for each pane

gc roles view beads
gc roles view mail

roles is the binding of the import in the city's pack.toml. Each runs until it is killed, in a pane of any width, and needs jq on the PATH. gc does not change directory for a pack command, so each cds to GC_CITY_PATH, which gc sets: the cwd the runtime gives does not matter. --once draws or prints once and exits, for a check by hand and for the tests.

Screens

From the live city, in a terminal pane (tmux, 90 columns), running the commands of this branch. view beads, at 17:18:

waiting on you
  gascitypacks-464  CI: download gc from the package registry instead of building…  PR 15
with the Operator                                                                    none
being worked
  rexcity-8meqi     City tab panes declared by the city, replacing the hard-coded log pa…
                    └ Self-review and run tests · since 16:42
  gascitypacks-w8j  Pane views: gc roles view beads and gc roles view mail
                    └ Push, open the pull request, hand the bead to the us… · since 17:14
queued                                                                               none
backlog  rexcity 30 · root 6 · gascitypacks 4
recently closed
  root-ons.19       Clean up what saraksh's teardown left                           17:10
  gascitypacks-eij  City-scoped Worker: work HQ beads, open PRs on gascity-root     16:52
  root-ons.14       Drop saraksh's dataset                                          16:48
  gascitypacks-r3f  Upgrade order: fix review findings on #11                       16:02
  root-ons.13       First start                                                     15:55

view mail: the last three lines are me exercising it, mailing my own session, reading and archiving the message while the view followed.

16:36  operator read      gcg-13313  NOTICE: main has failing pre-flights
16:37  operator archived  gcg-13313  NOTICE: main has failing pre-flights
16:37  worker → gcg-session-c851a2bd210472979835414deabd551b  view-mail live test (worke…
16:38  gcg-session-c851a2bd210472979835414deabd551b read  gcg-14337  view-mail live test…
16:38  gcg-session-c851a2bd210472979835414deabd551b archived  gcg-14337  view-mail live …

Where "the user" comes from

Nothing is hard-coded. It is formula_vars.user of each [[rigs]] in city.toml, read with gc config show (its [rigs.formula_vars] tables), and human: what mol-worker-work assigns when no user is named, as it does for the city's own Worker (#13), whose slings have no rig. The Operator is the city-scoped agent named operator in gc agent list, as permission-request.sh finds it.

What I decided where the bead did not say

  • More is bookkeeping than the bead lists. Besides sessions, startup-health episodes, synthetic input convoys and workflow roots and steps, the view drops beads of type message (unread mail is assigned to the Operator and would sit under "with the Operator"), gc.kind beads (wisps), beads labelled order-tracking (1,329 of the 1,407 closes in one live day, so "recently closed" would show nothing else), and any bead with a gc: label: the runtime's record of each live ACP session, type op, which put a gcg 1 into the backlog the first time I ran this on the live city.
  • An empty group is one line each, in the stated order (queued … none). The bead's sketch puts two empty groups on one line; its text says each.
  • Recently closed comes from the bead.closed events, which carry the bead, so no bead is read again. A bead gc reports closed twice is listed once, one that is open again is skipped, and I added the time it was closed, at the right.
  • A workflow between steps (its root records a session, no step is claimed just now) is "being worked · between steps", not queued: a Worker's turn between two steps takes seconds. Checked live on this very workflow, in the gap after a step closed.
  • Queued is a workflow no Worker has picked up, or a bead whose gc.routed_to names a Worker pool, any agent named worker, a rig's or the city's, with nobody holding it. A stale route to another pool (rexcity-h89g, rexcity/gastown.polecat) is backlog.
  • Within a group: waiting and with the Operator by updated_at, queued by created_at, being worked by when it was claimed.
  • Cost. The list every 3 s; the configuration and agents once a minute; the closes every 30 s and whenever a bead leaves the list, so a merged bead moves to "recently closed" without a gap. GC_NO_API=1 reads the stores directly, 0.86 s a call against 0.09 s through the cache, so it is not the default; help.md says how to ask for it.
  • gc events --follow delivers in batches about every 8 s, so a new mail line can take that long.

Verified

  • Both commands on the live city, and in real terminal panes (tmux) at several sizes, resized while running: lines never exceed the width, a short pane gets … N more and does not scroll, the cursor is hidden while the view runs and back when it is killed, NO_COLOR leaves no escape sequence.
  • Mail: sent, read and archived a message while the view followed. Killing an early version left gc events --follow running, because a jq filter in the pipe only learned its reader had gone when a mail event passed; gc now writes to a FIFO that the shell reads and that cleanup kills by pid, and a test checks by pid that nothing is left.
  • Run through gc itself from a scratch city that imports this pack by path: gc passes --city on to the script, which both commands accept. gc roles permission deny does not: gascitypacks-gen.
  • tests/view-beads.sh and tests/view-mail.sh, on fixtures shaped like the live city's (tests/view): the step, root, convoy, work bead chain; every bookkeeping kind; a bead closed twice and one closed and opened again; mail with offset times, session names and unknown subjects; and the commands against a stub gc, with how often each gc command runs, a dropped stream, the failure line and the exit status. Broken on purpose ten ways each, and more since, every one is caught. Run under jq 1.6, 1.7.1 and 1.8.2 and bash 3.2 and 5.3: jq 1.6 and 1.7.1 found a compile error 1.8.2 had let through. Shellcheck is clean and gc lint . passes.
  • By hand only: the terminal behaviour in a pane (redraw, resize, cursor). CI has no terminal.

Known limits

  • A raw session id used as a mail address (gcg-session-…) is not shortened; the name form the bead gives (roles__worker-gcg-session-…) is.
  • Widths count characters, so a double-width character can overflow a pane by a column.
  • The commands are for the local city: gc's remote-city flags (--city-url, --context) are not honoured, and are refused.

🤖 Generated with Claude Code

Bead: gascitypacks-w8j

Adds `gc roles view beads` and `gc roles view mail`, the two commands for the panes the city's Rex tab shows to the right of the Operator in place of `gc supervisor logs --follow`. Only the commands: the rexcity change that lets a city declare panes, and the gascity-root change that names these commands and bumps the pins, are separate. Shell and jq, like the pack's other commands and orders: no build step, and the grouping and the line formatting are pure jq, so the tests feed them fixtures. ## The command line for each pane ``` gc roles view beads gc roles view mail ``` `roles` is the binding of the import in the city's `pack.toml`. Each runs until it is killed, in a pane of any width, and needs `jq` on the `PATH`. gc does not change directory for a pack command, so each `cd`s to `GC_CITY_PATH`, which gc sets: the cwd the runtime gives does not matter. `--once` draws or prints once and exits, for a check by hand and for the tests. ## Screens From the live city, in a terminal pane (tmux, 90 columns), running the commands of this branch. `view beads`, at 17:18: ``` waiting on you gascitypacks-464 CI: download gc from the package registry instead of building… PR 15 with the Operator none being worked rexcity-8meqi City tab panes declared by the city, replacing the hard-coded log pa… └ Self-review and run tests · since 16:42 gascitypacks-w8j Pane views: gc roles view beads and gc roles view mail └ Push, open the pull request, hand the bead to the us… · since 17:14 queued none backlog rexcity 30 · root 6 · gascitypacks 4 recently closed root-ons.19 Clean up what saraksh's teardown left 17:10 gascitypacks-eij City-scoped Worker: work HQ beads, open PRs on gascity-root 16:52 root-ons.14 Drop saraksh's dataset 16:48 gascitypacks-r3f Upgrade order: fix review findings on #11 16:02 root-ons.13 First start 15:55 ``` `view mail`: the last three lines are me exercising it, mailing my own session, reading and archiving the message while the view followed. ``` 16:36 operator read gcg-13313 NOTICE: main has failing pre-flights 16:37 operator archived gcg-13313 NOTICE: main has failing pre-flights 16:37 worker → gcg-session-c851a2bd210472979835414deabd551b view-mail live test (worke… 16:38 gcg-session-c851a2bd210472979835414deabd551b read gcg-14337 view-mail live test… 16:38 gcg-session-c851a2bd210472979835414deabd551b archived gcg-14337 view-mail live … ``` ## Where "the user" comes from Nothing is hard-coded. It is `formula_vars.user` of each `[[rigs]]` in `city.toml`, read with `gc config show` (its `[rigs.formula_vars]` tables), and `human`: what `mol-worker-work` assigns when no user is named, as it does for the city's own Worker (#13), whose slings have no rig. The Operator is the city-scoped agent named `operator` in `gc agent list`, as `permission-request.sh` finds it. ## What I decided where the bead did not say - **More is bookkeeping than the bead lists.** Besides sessions, startup-health episodes, synthetic input convoys and workflow roots and steps, the view drops beads of type `message` (unread mail is assigned to the Operator and would sit under "with the Operator"), `gc.kind` beads (wisps), beads labelled `order-tracking` (1,329 of the 1,407 closes in one live day, so "recently closed" would show nothing else), and any bead with a `gc:` label: the runtime's record of each live ACP session, type `op`, which put a `gcg 1` into the backlog the first time I ran this on the live city. - **An empty group is one line each**, in the stated order (`queued … none`). The bead's sketch puts two empty groups on one line; its text says each. - **Recently closed** comes from the `bead.closed` events, which carry the bead, so no bead is read again. A bead gc reports closed twice is listed once, one that is open again is skipped, and I added the time it was closed, at the right. - **A workflow between steps** (its root records a session, no step is claimed just now) is "being worked · between steps", not queued: a Worker's turn between two steps takes seconds. Checked live on this very workflow, in the gap after a step closed. - **Queued** is a workflow no Worker has picked up, or a bead whose `gc.routed_to` names a Worker pool, any agent named `worker`, a rig's or the city's, with nobody holding it. A stale route to another pool (`rexcity-h89g`, `rexcity/gastown.polecat`) is backlog. - Within a group: waiting and with the Operator by `updated_at`, queued by `created_at`, being worked by when it was claimed. - **Cost.** The list every 3 s; the configuration and agents once a minute; the closes every 30 s and whenever a bead leaves the list, so a merged bead moves to "recently closed" without a gap. `GC_NO_API=1` reads the stores directly, 0.86 s a call against 0.09 s through the cache, so it is not the default; `help.md` says how to ask for it. - `gc events --follow` delivers in batches about every 8 s, so a new mail line can take that long. ## Verified - Both commands on the live city, and in real terminal panes (tmux) at several sizes, resized while running: lines never exceed the width, a short pane gets `… N more` and does not scroll, the cursor is hidden while the view runs and back when it is killed, `NO_COLOR` leaves no escape sequence. - Mail: sent, read and archived a message while the view followed. Killing an early version left `gc events --follow` running, because a jq filter in the pipe only learned its reader had gone when a mail event passed; gc now writes to a FIFO that the shell reads and that cleanup kills by pid, and a test checks by pid that nothing is left. - Run through gc itself from a scratch city that imports this pack by path: gc passes `--city` on to the script, which both commands accept. `gc roles permission deny` does not: gascitypacks-gen. - `tests/view-beads.sh` and `tests/view-mail.sh`, on fixtures shaped like the live city's (`tests/view`): the step, root, convoy, work bead chain; every bookkeeping kind; a bead closed twice and one closed and opened again; mail with offset times, session names and unknown subjects; and the commands against a stub gc, with how often each gc command runs, a dropped stream, the failure line and the exit status. Broken on purpose ten ways each, and more since, every one is caught. Run under jq 1.6, 1.7.1 and 1.8.2 and bash 3.2 and 5.3: jq 1.6 and 1.7.1 found a compile error 1.8.2 had let through. Shellcheck is clean and `gc lint .` passes. - By hand only: the terminal behaviour in a pane (redraw, resize, cursor). CI has no terminal. ## Known limits - A raw session id used as a mail address (`gcg-session-…`) is not shortened; the name form the bead gives (`roles__worker-gcg-session-…`) is. - Widths count characters, so a double-width character can overflow a pane by a column. - The commands are for the local city: gc's remote-city flags (`--city-url`, `--context`) are not honoured, and are refused. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Bead: gascitypacks-w8j
The city's Rex tab runs `gc supervisor logs --follow` in a pane to the right
of the Operator, which tells the user nothing they have to act on. This is the
first of the two commands that replace it: a city-wide list of beads, grouped
by who has to act, redrawn in place every three seconds until it is killed.

The list is `gc beads list --format=json`. gc's own beads are dropped first,
by type, metadata and label and never by the prefix of an id: sessions, mail,
the input convoys of a sling, the roots and steps of a workflow, wisps, and the
beads that track an order's run. The last kind is why the closed beads need
the filter at all: 1,329 of the 1,407 closes in one live day were order runs.
What is left falls in the first group it fits: waiting on the user, with the
Operator (and its halt_reason), being worked, queued, and a backlog counted for
each rig, with the last five closed beads under them, dimmed. A bead is being
worked when a Worker holds a step of its workflow, found by following step ->
gc.root_bead_id -> gc.input_convoy_id -> the convoy's `tracks` dependency; a
workflow whose root records a session but holds no step just now is between
steps, not queued.

The grouping and the drawing are jq (assets/jq), pure functions of the data, so
that tests can feed them fixtures; run.sh keeps the loop. The user is not
hard-coded: it is formula_vars.user of the rigs in city.toml, read with
`gc config show` (a rig that sets none gives its beads to "human", as the
Worker's formula does). What a bead does not say is read less often than the
list: the configuration and agents once a minute, the closes from gc events
every half minute and at once when a bead has left the list, so that a merged
bead moves to "recently closed" without a gap. `gc beads list` goes through the
supervisor's bead cache; GC_NO_API=1 reads the stores directly, at ten times
the cost.

Every line is cut to the pane's width, read again at every frame; the last row
stays blank so a full frame cannot scroll; NO_COLOR and an output that is not
a terminal turn styling off; control characters in a title become spaces so a
bead cannot write to the terminal; when gc does not answer the frame is one line
that says what failed, that it retries, and what gc said.

Validated against the live city, and in a real terminal pane (tmux) at several
sizes, resized while it ran. Tests follow in the next commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The second pane command: a delivery log of the city's mail. It shows what was
sent, read, marked read and archived in the last hour, then each such event as
it happens, one line each, the newest last, so that a sent line with nothing
after it is mail nobody has picked up. gc's own alerts to the human mailbox
appear like any other mail.

gc events takes one --type, so the history is read once for each of the four
mail types and the stream, which takes none, is filtered in the command. The
stream starts where the history stopped, at the head `gc events --seq` names
before anything is read, so no event is shown twice or missed, and after a drop
it resumes from the last event shown. A read or archived line names its message
and, where known, its subject: from the sent events of the last day, which
covers mail archived long after it was sent (gc mail peek cannot see an
archived message), else from `gc mail peek`, which does not mark it read.
Names are shortened the way rexcity labels its tabs, and a session's own id is
left off: roles__worker-gcg-session-0dfb... is worker.

gc is read with nothing between it and the loop: gc writes to a FIFO this shell
reads, and cleanup kills it by pid. An earlier version put a jq filter between
them, and a killed view left `gc events --follow` running until the next mail
event, which can be hours, because the filter only learned its reader was gone
when it wrote. The mail events are picked out by their text and checked exactly
by the formatter.

When gc does not answer, one line says so and it retries from the last event;
it does not say so again until gc has answered once. Lines are cut to the
pane's width, read again for every line; NO_COLOR and an output that is not a
terminal turn styling off; what a message's subject says cannot reach the
terminal as an escape sequence.

Validated against the live city, sending, reading and archiving a message
while the view ran, and by killing it and looking for survivors.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The grouping and the mail line formatting are pure jq, so they are tested
against fixtures shaped like the live city's (tests/view): fat session beads,
synthetic input convoys, workflow roots and steps for a bead being worked, one
between steps and one queued, a bead routed to a Worker pool and one routed to
a pool that is none, mail assigned to the Operator, order-tracking beads and
wisps, a bead closed twice and one closed and opened again; and mail events
with offset times, session names, a rig-qualified name, and messages whose
subject is not known. The expected screens are golden files
(tests/view/*.want*); UPDATE_GOLDEN=1 writes them again. Rules that matter are
also asserted one by one, so a failure names the rule rather than a diff.

The commands are tested against a stub gc that serves the same fixtures: the
width taken from COLUMNS, NO_COLOR, the one-line failure and the exit status,
the flags gc forwards (--city), how often each gc command is run (the
configuration once, the beads every cycle, the closes again when a bead leaves
the list), and, for the mail stream, a connection that drops, fails once more
silently and resumes from the last event shown. A killed view must leave no
temporary directory and, checked by pid, no `gc events --follow`.

Each test was also run against deliberately broken code, ten ways each (mail
not dropped as bookkeeping, the follow not killed, a drop reported at every
try, ...); every one fails with a message that names it. Both pass under bash
5 and macOS's bash 3.2, which runs the commands too. CI runs them after jq is
installed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The README names the two commands in the roles row and in a section of their
own: what each shows, that both run until killed, start in the city directory
and fit a pane of any width, that the user is formula_vars.user of the rigs,
and what NO_COLOR and GC_NO_API do. The CHANGELOG gets one entry for each
command under [Unreleased], as statements of what is new for the reader.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Self-review of the pane views, run against jq 1.6 and 1.7.1 as well as the
1.8.2 they were written on, and read once more.

beads.jq did not compile on jq 1.6 or 1.7.1: an object value with an operator,
`{keep: $idw + 12}`, needs its parentheses there, and only 1.8 relaxes that. CI
installs whichever jq the runner's distribution has, so the beads test would
have failed there. The mail program has no such construct. Both suites now pass
under jq 1.6, 1.7.1 and 1.8.2, each with bash 3.2 and bash 5.

Both commands say at once that jq is not on the PATH, with the status of a
command that is not found, 127. Without that the beads view reported "cannot
read the city's configuration" with nothing after it, which names the wrong
thing. The test runs the command with an empty PATH, which needs no command to
reach the message.

A Worker pool is any agent named worker, of a rig or of the city. meta.jq took
only those with a rig, so a bead routed straight to a city-scoped Worker, which
gascitypacks-eij is about to make, would never have been queued. The fixtures
gain that agent and a bead routed to it.

The tests wait for a killed view to be gone instead of sleeping one second: a
shell finishes the command it waits for before it exits, and the beads view is
in a one-second sleep between frames. Fifteen runs, three at a time, pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
view_note is the line that says a view is failing, and falls back to the text
as it is where jq itself fails. That text is the last thing gc said, which is
not ours to put on a terminal as it comes: the fallback now drops control
characters, as the jq path replaces them. A test sources the helper with a jq
program directory that does not exist and feeds it an escape sequence and a tab.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The user of the beads view was formula_vars.user of the rigs, and "human" only
where a rig set none. The city's Worker, which landed on main while this was
under review, works the HQ store: a sling to it has no rig behind it, so no
formula_vars apply and mol-worker-work gives the bead to its default user,
"human", once its pull request is open, unless the sling passes --var user.
In a city whose every rig names the user, which is this city, such a bead was
assigned to someone the view did not know and was counted in the backlog,
where the user would not look for it.

"human" is now a user always, besides the names the rigs give. It is the
formula's own default for the assignee, not a name this command made up; the
README and the help say so. The fixtures gain an HQ bead with a pull request
that the city's Worker gave to human, and a city that names no user at all, or
one whose only rig names someone else, still has human.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fix(roles): leave out the runtime record gc keeps for each session (gascitypacks-w8j)
Some checks failed
test / changelog (pull_request) Successful in 5s
test / scripts (pull_request) Failing after 16s
test / lint (pull_request) Successful in 3m11s
dd72c83a69
Running the finished view on the live city showed `gcg 1` in the backlog: a
bead of type "op", id gcg-rt-..., labels gc:rt and gc:rt-conv:<session>, titled
"runtime <session>". It is the runtime's record of a live ACP session, so every
running Worker would have put one more of them on the screen. It did not exist
when the fixtures were taken from the live city.

A bead that carries a label starting with "gc:" is gc's own, and is now
bookkeeping like a session or a workflow step. gc's labels are reserved by that
prefix, and none the city's own beads use (needs-user, parked, wayfinder:*,
hold:*) starts with it, which is why this is a rule and not one more type in the
list. The fixtures gain the record, open and closed; the backlog assertion is
now the whole line, since a substring would have let an extra entry through.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CI failed tests/view-beads.sh on ubuntu-latest with "a line of the screen for
80 columns has 84", and 44, 28 and 14 at 40, 24 and 12 columns. The screens
were not too wide: jq counts exactly 80, 40, 24 and 12 characters in the longest
line of each. The test measured them with awk's length(), which counts bytes in
the C locale, and always in mawk, the awk of Debian and Ubuntu, whatever the
locale. The screens carry ·, … and └, of 2, 3 and 3 bytes for one character
each: the line that is longest in bytes has a └ and a …, so it is 4 over, and at
12 columns a line with just one of them is 2 over. The Mac passes because its
awk counts characters in a UTF-8 locale.

The test now measures with widest(), the length in jq of each line. jq counts
characters in any locale and beside any awk, and the view's own cut is jq's
length too, so the test and the view share one unit. It is characters, not
display columns: a wide glyph counts as one, in the view as it did before.
tests/view-mail.sh measured its 56- and 57-column checks the same way, and has
never run on Linux, because the job stops at view-beads.sh.

Reproduced and checked in Ubuntu 22.04 (jq 1.6, mawk 1.3.4-20200120) and 24.04
(jq 1.7, mawk 1.3.4-20240123) containers: the width failures are gone from both
scripts. The kill failures that remain there have another cause and are the next
commit. Both scripts still pass on the Mac (jq 1.8.2).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test(roles): start a view as a child of the test, so that a killed one is reaped (gascitypacks-7nw)
All checks were successful
test / changelog (pull_request) Successful in 4s
test / scripts (pull_request) Successful in 24s
test / lint (pull_request) Successful in 3m14s
8c1ae94b56
CI failed "view beads did not stop when it was killed" although the view had
stopped: its EXIT trap had run, and the check that its temporary directory was
gone did not fail. The test started the view inside a subshell that exits at
once, which made the view an orphan, and an orphan is reaped by PID 1. Whatever
PID 1 is on the runner, it evidently does not: in a container whose PID 1 is tail,
where this reproduces, the killed view is a zombie (State: Z, PPid: 1) within a
second of the kill and stays one, and kill -0 answers for a zombie as it does for
a process that runs, so stopped() waited its five seconds and gave up. Nothing
is wrong in the views: they stop on SIGTERM within one cycle, remove their
temporary directory and take the stream they followed with them.

The test now starts a view in the background as a child of its own shell, which
reaps it when it dies, and keeps the pid from $! instead of a file. The job is
disowned so that bash 3.2, the Mac's own, does not print "Terminated" for it;
bash 5 does not. The other way out, counting state Z as stopped, needs /proc or
ps, which a runner image may lack; this needs neither, and does not depend on what
PID 1 does. tests/view-mail.sh started its views the same way in two places, the
stream that drops and gc down, and has never run on Linux.

Checked in Ubuntu 22.04 (jq 1.6) and 24.04 (jq 1.7) containers with tail as PID 1,
with the locale unset, C and C.UTF-8, and on the Mac with the default locale,
LC_ALL=C and bash 3.2: both scripts print ok. With a view that ignores SIGTERM
they still fail, within half a minute and not by hanging: it did not stop, and
its temporary directory is left.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Contributor

Review of 8c1ae94b56

Beads: gascitypacks-w8j (the two commands) and gascitypacks-7nw (its CI failures on Linux). It passes.

What I checked

  • The whole diff, 26 files, +1664 −1: both commands, the five jq programs, view.sh, the two test scripts with their fixtures and golden files, the README, the CHANGELOG and the workflow. Nothing in it is outside the two beads.
  • CI for this head, run 39: lint (gc lint: 2 pack(s) ok), scripts (five ok, the two new scripts among them) and changelog are green, which is what gascitypacks-7nw asks for.
  • Against gascitypacks-w8j: the groups and their order, the step → root → input convoy → tracks → work bead chain, bookkeeping told by type, metadata and label, the mail lines, --once, NO_COLOR, an output that is no terminal, one failure line and a retry. The description gives the two pane command lines, a screen of each, and where the user is read from. The CHANGELOG has one statement for each command under [Unreleased], and the README lists both.
  • Run, read-only, from a scratch clone:
    • both commands with --once against the live city: the screens are right, in 1.0 s and 1.4 s;
    • both on a pty with the bash the city's pane finds first on its PATH, /opt/homebrew/bin/bash 5.3.20: on 12 rows by 50 columns a frame is 11 lines of at most 49 characters, a resize from 30×100 to 12×50 shows in the next frame, and the cursor is back after the kill; view mail on 80 columns prints at most 79, and killed it leaves no gc events --follow and no temporary directory;
    • both test scripts on macOS, under bash 5.3 and 3.2, and on a trial squash onto today's main (5a0731c): ok.
  • Safety: every gc call is a read (config show, agent list, beads list, events, mail peek), there is no secret in the diff, and what a bead or a message says cannot reach the terminal as an escape sequence.

Findings

None of them stops the merge. The first is worth a bead.

  1. roles/assets/scripts/view.sh:27 never reads the terminal. In size="$(stty size <&1 2>/dev/null || true)", fd 1 inside $( ) is the substitution's own pipe, so stty answers "stdin isn't a terminal" every time. The pane's size comes from COLUMNS and LINES alone, and a script has those only under bash 5.0 or later, whose checkwinsize is on by default. The views fit the pane in this city because env bash is 5.3 there. Under bash 3.2, which line 3 of the file names as supported and which is /bin/bash on a Mac, a view on a terminal cuts and caps nothing: on the same 12×50 pty a frame was 26 lines of up to 119 characters. Under bash 5, view mail also learns of a resize one line late. A fix that reads 12 50 under both: keep a copy of stdout (exec 3>&1 in view_term) and run stty size <&3. A test that runs a view on a pty (script) would hold it; CI covers no terminal path today.
  2. roles/commands/view/mail/run.sh:93: gc mail peek "$id" --json takes the id from the event stream. A check that the id does not start with - keeps an odd event subject from being read as a flag.
  3. roles/assets/scripts/view.sh:56: tr -d '\000-\037\177' also deletes the newline that printf wrote, so a failure line that view mail prints through this fallback runs into the next line. It is reached only when jq itself fails.
  4. roles/assets/jq/meta.jq:8: the example in the comment names the user; the fixtures' Alex Example would do.
  5. roles/assets/jq/view.jq:117 and :120: rindex gives byte offsets before jq 1.8 and the slices count characters, so a name with a non-ASCII character before its rig or binding is shortened at the wrong place on jq 1.6 and 1.7. Not run here; the pane's jq is 1.8.2.
  6. For the record: gc events --type bead.closed --since 24h is 2,851 events and 2.4 MB on the city today, 2,828 of them gc's own, and the view reads it every 30 s.

Where the pull request departs from the letter of the bead

All three are stated in the description, and I agree with them: human always counts as a user, being the default assignee of mol-worker-work; more kinds of bead are bookkeeping than the bead lists (mail, wisps, order runs, anything with a gc: label); and each empty group has a line of its own, where the bead's sketch put two on one line.

Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.

## Review of 8c1ae94b569f7107600886e2f5925bd1120b5be6 Beads: gascitypacks-w8j (the two commands) and gascitypacks-7nw (its CI failures on Linux). It passes. ### What I checked - **The whole diff**, 26 files, +1664 −1: both commands, the five jq programs, `view.sh`, the two test scripts with their fixtures and golden files, the README, the CHANGELOG and the workflow. Nothing in it is outside the two beads. - **CI for this head**, run 39: `lint` (`gc lint: 2 pack(s) ok`), `scripts` (five `ok`, the two new scripts among them) and `changelog` are green, which is what gascitypacks-7nw asks for. - **Against gascitypacks-w8j**: the groups and their order, the step → root → input convoy → `tracks` → work bead chain, bookkeeping told by type, metadata and label, the mail lines, `--once`, `NO_COLOR`, an output that is no terminal, one failure line and a retry. The description gives the two pane command lines, a screen of each, and where the user is read from. The CHANGELOG has one statement for each command under `[Unreleased]`, and the README lists both. - **Run, read-only, from a scratch clone**: - both commands with `--once` against the live city: the screens are right, in 1.0 s and 1.4 s; - both on a pty with the bash the city's pane finds first on its `PATH`, `/opt/homebrew/bin/bash` 5.3.20: on 12 rows by 50 columns a frame is 11 lines of at most 49 characters, a resize from 30×100 to 12×50 shows in the next frame, and the cursor is back after the kill; `view mail` on 80 columns prints at most 79, and killed it leaves no `gc events --follow` and no temporary directory; - both test scripts on macOS, under bash 5.3 and 3.2, and on a trial squash onto today's `main` (5a0731c): `ok`. - **Safety**: every gc call is a read (`config show`, `agent list`, `beads list`, `events`, `mail peek`), there is no secret in the diff, and what a bead or a message says cannot reach the terminal as an escape sequence. ### Findings None of them stops the merge. The first is worth a bead. 1. **`roles/assets/scripts/view.sh:27` never reads the terminal.** In `size="$(stty size <&1 2>/dev/null || true)"`, fd 1 inside `$( )` is the substitution's own pipe, so `stty` answers "stdin isn't a terminal" every time. The pane's size comes from `COLUMNS` and `LINES` alone, and a script has those only under bash 5.0 or later, whose `checkwinsize` is on by default. The views fit the pane in this city because `env bash` is 5.3 there. Under bash 3.2, which line 3 of the file names as supported and which is `/bin/bash` on a Mac, a view on a terminal cuts and caps nothing: on the same 12×50 pty a frame was 26 lines of up to 119 characters. Under bash 5, `view mail` also learns of a resize one line late. A fix that reads 12 50 under both: keep a copy of stdout (`exec 3>&1` in `view_term`) and run `stty size <&3`. A test that runs a view on a pty (`script`) would hold it; CI covers no terminal path today. 2. `roles/commands/view/mail/run.sh:93`: `gc mail peek "$id" --json` takes the id from the event stream. A check that the id does not start with `-` keeps an odd event subject from being read as a flag. 3. `roles/assets/scripts/view.sh:56`: `tr -d '\000-\037\177'` also deletes the newline that `printf` wrote, so a failure line that `view mail` prints through this fallback runs into the next line. It is reached only when jq itself fails. 4. `roles/assets/jq/meta.jq:8`: the example in the comment names the user; the fixtures' `Alex Example` would do. 5. `roles/assets/jq/view.jq:117` and `:120`: `rindex` gives byte offsets before jq 1.8 and the slices count characters, so a name with a non-ASCII character before its rig or binding is shortened at the wrong place on jq 1.6 and 1.7. Not run here; the pane's jq is 1.8.2. 6. For the record: `gc events --type bead.closed --since 24h` is 2,851 events and 2.4 MB on the city today, 2,828 of them gc's own, and the view reads it every 30 s. ### Where the pull request departs from the letter of the bead All three are stated in the description, and I agree with them: `human` always counts as a user, being the default assignee of `mol-worker-work`; more kinds of bead are bookkeeping than the bead lists (mail, wisps, order runs, anything with a `gc:` label); and each empty group has a line of its own, where the bead's sketch put two on one line. Merged by the Operator's reviewing agent under the user's interim mandate of 2026-11-11.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/gascitypacks!16
No description provided.