Pane views: gc roles view beads and gc roles view mail #16
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-w8j"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
gc roles view beadsandgc roles view mail, the two commands for the panes the city's Rex tab shows to the right of the Operator in place ofgc 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
rolesis the binding of the import in the city'spack.toml. Each runs until it is killed, in a pane of any width, and needsjqon thePATH. gc does not change directory for a pack command, so eachcds toGC_CITY_PATH, which gc sets: the cwd the runtime gives does not matter.--oncedraws 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:view mail: the last three lines are me exercising it, mailing my own session, reading and archiving the message while the view followed.Where "the user" comes from
Nothing is hard-coded. It is
formula_vars.userof each[[rigs]]incity.toml, read withgc config show(its[rigs.formula_vars]tables), andhuman: whatmol-worker-workassigns 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 namedoperatoringc agent list, aspermission-request.shfinds it.What I decided where the bead did not say
message(unread mail is assigned to the Operator and would sit under "with the Operator"),gc.kindbeads (wisps), beads labelledorder-tracking(1,329 of the 1,407 closes in one live day, so "recently closed" would show nothing else), and any bead with agc:label: the runtime's record of each live ACP session, typeop, which put agcg 1into the backlog the first time I ran this on the live city.queued … none). The bead's sketch puts two empty groups on one line; its text says each.bead.closedevents, 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.gc.routed_tonames a Worker pool, any agent namedworker, a rig's or the city's, with nobody holding it. A stale route to another pool (rexcity-h89g,rexcity/gastown.polecat) is backlog.updated_at, queued bycreated_at, being worked by when it was claimed.GC_NO_API=1reads the stores directly, 0.86 s a call against 0.09 s through the cache, so it is not the default;help.mdsays how to ask for it.gc events --followdelivers in batches about every 8 s, so a new mail line can take that long.Verified
… N moreand does not scroll, the cursor is hidden while the view runs and back when it is killed,NO_COLORleaves no escape sequence.gc events --followrunning, 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.--cityon to the script, which both commands accept.gc roles permission denydoes not: gascitypacks-gen.tests/view-beads.shandtests/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 andgc lint .passes.Known limits
gcg-session-…) is not shortened; the name form the bead gives (roles__worker-gcg-session-…) is.--city-url,--context) are not honoured, and are refused.🤖 Generated with Claude Code
Bead: gascitypacks-w8j
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>Review of
8c1ae94b56Beads: gascitypacks-w8j (the two commands) and gascitypacks-7nw (its CI failures on Linux). It passes.
What I checked
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.lint(gc lint: 2 pack(s) ok),scripts(fiveok, the two new scripts among them) andchangelogare green, which is what gascitypacks-7nw asks for.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.--onceagainst the live city: the screens are right, in 1.0 s and 1.4 s;PATH,/opt/homebrew/bin/bash5.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 mailon 80 columns prints at most 79, and killed it leaves nogc events --followand no temporary directory;main(5a0731c):ok.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.
roles/assets/scripts/view.sh:27never reads the terminal. Insize="$(stty size <&1 2>/dev/null || true)", fd 1 inside$( )is the substitution's own pipe, sosttyanswers "stdin isn't a terminal" every time. The pane's size comes fromCOLUMNSandLINESalone, and a script has those only under bash 5.0 or later, whosecheckwinsizeis on by default. The views fit the pane in this city becauseenv bashis 5.3 there. Under bash 3.2, which line 3 of the file names as supported and which is/bin/bashon 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 mailalso learns of a resize one line late. A fix that reads 12 50 under both: keep a copy of stdout (exec 3>&1inview_term) and runstty size <&3. A test that runs a view on a pty (script) would hold it; CI covers no terminal path today.roles/commands/view/mail/run.sh:93:gc mail peek "$id" --jsontakes 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.roles/assets/scripts/view.sh:56:tr -d '\000-\037\177'also deletes the newline thatprintfwrote, so a failure line thatview mailprints through this fallback runs into the next line. It is reached only when jq itself fails.roles/assets/jq/meta.jq:8: the example in the comment names the user; the fixtures'Alex Examplewould do.roles/assets/jq/view.jq:117and:120:rindexgives 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.gc events --type bead.closed --since 24his 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:
humanalways counts as a user, being the default assignee ofmol-worker-work; more kinds of bead are bookkeeping than the bead lists (mail, wisps, order runs, anything with agc: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.