Found in review of #16: pane views never read the terminal size, and smaller findings #67
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!67
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-60o"
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?
Fixes the findings of the review of #16 (bead gascitypacks-60o).
1. Terminal size (
view.sh).view_sizeranstty size <&1inside$( ), where stdout is the substitution's pipe, so a terminal was never asked and the size came fromCOLUMNS/LINESalone: under bash 3.2 a view cut and capped nothing, under bash 5 a resize was picked up late.view_termnow keeps the terminal as fd 3 when stdout is one, andview_sizereadsstty size <&3, which is the terminal inside$( )too. Outside a terminalCOLUMNS/LINESstill answer.2.
gc mail peek --json -- "$id": an id starting with-is no option.3. The fallback of
view_notekeeps its newline.4.
meta.jq's comment example namesAlex Example, as the fixtures do;shortinview.jqno longer usesrindex(bytes before jq 1.8) and works in characters.5. The closed beads are read again every
VIEW_CLOSED_INTERVALseconds (default 300, was 30), and at once when a bead leaves the list. I took this as the fix for the 2.4 MB / 30 s read; say if you want it done another way (an incremental read would be new logic, seedocs/shell.md).No new shell logic: the changes are inside existing scripts (
view.sh+4 lines,beads/run.sh+1).Tests.
tests/view/pty.shruns a command on a pseudo-terminal withscript(1)(util-linux's form for the CI, BSD's for the Mac), and both view tests use it: the beads screen at 51 columns withCOLUMNS=200set, a resize between two reads, the size inside$( ), the width of mail lines, plus the newline of the fallback, the--ofmail peek,shorton non-ASCII names and the closed-interval re-read.Verified on the Mac:
tests/view-beads.shandtests/view-mail.shpass under bash 5.3 and/bin/bash3.2, and under jq 1.6, 1.7.1 and 1.8.2; the new pty tests fail on the oldview.shunder bash 3.2.shellcheckandgc lint .are clean. Not verified: the util-linux branch ofptyrun(no Linux container could start here: the init image is not local); the CI'sscriptsjob is its first run.A fragment is in
.changelog/view-review-findings.md.Bead: gascitypacks-60o
Review of
198797675afor gascitypacks-60o. Checks of the head: failure (test / scripts, run 176, job 4554).Verdict
fail
Findings
ptyrunfails in CI, andtest / scriptsstops attests/view-beads.sh(sotests/view-mail.shnever ran there). The job log readsFAIL: the size of a terminal is not read as it is now, in too: _: line 1: $.: command not found … _: line 1: 3n: ambiguous redirect … view_term: command not found. Cause:printf '%q 'quotes the multi-line script of the test at tests/view-beads.sh:183-186 with bash's$'…\n…'form, and util-linuxscript -cruns its command through$SHELL, or/bin/shwhen that is unset. That is dash on the Ubuntu runner, and dash does not know$'…': the$stays literal and\nbecomesn, which is exactly the$.and<&3nof the log. I reproduced the mangling locally withdash -con the same%qoutput. The one-line pty test just before it (tests/view-beads.sh:179) passed in CI, so the rest of the branch works. A fix: runSHELL="$BASH" script -qefc …in that branch, so the quoting is read by the bash that made it, or keep the arguments out of the-cstring. Then let the CI'sscriptsjob prove the util-linux branch, which the PR says was not verified.VIEW_CLOSED_INTERVAL, which this PR adds, and the new 300-second re-read of the closed beads are in the changelog fragment and the script's header, but not in the README section that describesview beads.Verified
view_termandstty size <&3(item 1, with pty tests);gc mail peek --json -- "$id"(2); the fallback's newline (3);Alex Example, andshortwithoutrindex(4);VIEW_CLOSED_INTERVAL, default 300 (5). The changes stay inside existing scripts. main has no REVIEW.md, AGENTS.md or CLAUDE.md, and I read README.md.8a95663). Forge:mergeable.tests/view-beads.shandtests/view-mail.shpass under bash 5.3.20 and/bin/bash3.2, with jq 1.8.2. jq 1.6 and 1.7 were not available to me. Also passing: every other test of the CI'sscriptsandlintjobs (worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, permission-deny, permission-request, formula, reviewer, operator-overlay),go vet ./...,go test ./...,gc lint .(2 packs ok), andshellcheckon the six changed shell files. The changelog check was not rebuilt locally; CI'stest / changelogpassed on this head.shortgives the same output as the one on main for a set of names: rig/agent, a dotted agent, a trailing dot, a leading dot, an empty name, a session suffix, nested/. Its non-ASCII case is covered by tests/view-mail.sh:233.gc mail peek --json -- -abcparses the--as cobra should: the error is "not in a city directory", not an unknown flag.view_termis called once, at the top level of both run.sh files (beads:53, mail:59).198797675ae73176708cReview of
e73176708cfor gascitypacks-60o. Checks of the head: success.Verdict
fail
Findings
62ca905); the forge saysnot_mergeable. The branch is cut from8a95663, and #73 (3316228,view beadsshows a rig's work in flight) has since rewritten the same lines. Merging the head into origin/main conflicts in three files:README.md:641(Pane views): main inserts two paragraphs (--rig, the four signs of a bead in flight) before the paragraph this PR extends. Keep main's two paragraphs, and add this PR'sVIEW_CLOSED_INTERVALsentence to the paragraph after them.roles/assets/jq/meta.jq:8: main's comment example now readsrigs: [{name, prefix, path}]. Keep main'spathand this PR'sAlex Example.roles/commands/view/beads/run.sh:11: main's header adds "The same events give the verdicts of the review beads closed in the last day (assets/jq/reviews.jq)." Keep that sentence with this PR's new interval text. Note that since #73,read_closed(main's run.sh:86-91) also writesreviews.json, soVIEW_CLOSED_INTERVALnow paces the review verdicts too. A closed review bead leaves the list, so the "at once when a bead leaves the list" re-read still picks its verdict up straight away. Say so in the comment (or the README sentence) if you agree.A fix: rebase
worker/gascitypacks-60oonto origin/main (62ca905or later), resolve the three files as above, and runtests/view-beads.shandtests/view-mail.shagain on the rebased tree. #73 changed both test files and their fixtures (tests/view/beads.want,beads.want.50,closed.jsonl). Only the three files above conflict textually, but the new pty test attests/view-beads.sh:192compares againstbeads.want.50, and #73 changed that file.Verified
e731767. The blocking one:tests/view/pty.sh:307runs util-linux'sscriptwithSHELL="$BASH", so bash reads the%qquoting it made. The head'stest / scriptsjob (run 227) passed, which runstests/view-beads.shandtests/view-mail.shon the Ubuntu runner, so the util-linux branch is now proven. The minor one: README.md:561 namesVIEW_CLOSED_INTERVALand the 300-second re-read.8a95663: all five items of the bead are there, inside existing scripts, with a changelog fragment in.changelog/.tests/view-beads.shandtests/view-mail.shpass under bash 5 and/bin/bash3.2.shellcheckis clean on the six changed shell files.test / changelog,test / lintandtest / scriptsall passed.62ca905) stops on the three conflicts above, so I could not test the merged tree.e73176708c87100c0909Review of
87100c0909for gascitypacks-60o. Checks of the head: success.Verdict
pass
Findings
"... in $( ) too: $size"is in double quotes, so bash runs$( )as an empty command substitution and the message reads "in too". It only shows when the test fails. Fix:'$( )'in single quotes, or write "inside a command substitution".Verified
0deb291, and the head fast-forwards it with no conflict. Every resolution is the one review 314 asked for. README.md:660 keeps main's two paragraphs (--rig, the four signs) and adds theVIEW_CLOSED_INTERVALsentence after them, saying that the interval also paces the verdicts of the review beads.meta.jq:8keepspathand hasAlex Example.beads/run.sh:11-16keeps main's reviews.jq sentence and says that a closed review bead leaves the list and is re-read at once.tests/view/pty.sh. The changelog fragment is in.changelog/.tests/view-beads.shandtests/view-mail.shpass under bash 5.3.20 and/bin/bash3.2.57.shellcheckis clean on the six changed shell files.view.shput back,view-beads.shfails under both shells: the pty check at 51 columns (3.2), the size check inside$( ), and the newline of the fallback.view-mail.shfails under 3.2: it draws a line of 142 columns on a 40-column pty.shortin view.jq gives the same output as main'srindexversion under jq 1.8.2 on 16 names. These include the empty name,.,/,a.b.,x/,a.b/c, nested rigs, a session suffix and non-ASCII names. A null input is still the empty name.test / changelog,test / lintandtest / scriptsall passed. The scripts job runs both view tests on the Ubuntu runner, so the util-linux branch ofptyrunis covered there.