Skip to content

test(live): stage 2 — full kernel shell in a real desktop window (stacked on #147) - #171

Merged
ccclosed merged 4 commits into
devfrom
feat/term-full-shell-live
Nov 22, 2026
Merged

ccclosed merged 4 commits into
devfrom
feat/term-full-shell-live

Conversation

@ccclosed

@ccclosed ccclosed commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Status: merged up to date with dev (f1453f55), all checks green

git merge origin/dev (not a rebase: dev and the branch had diverged). Two
conflicts, both resolved by keeping dev's tooling and re-adding only what #171
still owns
:

  • tools/e2e.py — dev's file kept (it now carries the termux stage-4 mode);
    the termwindow mode is re-inserted on top of its helpers. _desktop_bins is
    reused, and _desktop_prepare_disk gains an optional size_mb argument
    (default 64 MiB, so desktop/termux are byte-identical in behaviour) because
    ppkg install needs a 256 MiB volume.
  • docs/terminal-session.md — dev's rewritten honest-limits section kept; a short
    §7 documents the live acceptance instead of duplicating dev's text.
  • tools/README.md — dev's text kept, mode table now lists termux and
    termwindow, the bullet matches what the mode does.
  • tools/qemu_shot.py — unchanged addition: dev does not have chord support,
    and the mode needs ctrl-s/ctrl-o/ctrl-x through one HMP sendkey word
    (mixing QMP send-key with HMP left a stuck modifier under TCG).

Diff against dev: only test tooling and docs, 4 files, +473/−5 — nothing in
the kernel or the client, nothing in the ISO.

 docs/terminal-session.md |  29 +++-
 tools/README.md          |  21 ++-
 tools/e2e.py             | 412 ++++++++++++++++++++++++++++++++++++++++++++++-
 tools/qemu_shot.py       |  16 +-

Why it is still needed

dev has e2e.py desktop (compositor ABI + real Files/Terminal windows) and
termux (stage-4 window UX/lifecycle: history, editing, selection, 20
close/reopen cycles, two-window isolation). Neither asserts the kernel command
surface
inside the window — that is what this mode does, and with #172 (PTY/job
control) it now passes end to end.

Live result on f1453f55 — PASS (538 s)

python3 tools/e2e.py termwindow with the shipped pagh-desktop +
pagh-terminal, compositor started through /mnt/etc/autorun (the shipped
desktop-autorun recipe; typing a {socket} command via QMP left a stuck
modifier under TCG). Per command: one PNG + one
[DIAG] window session=1 command=…/done=… serial pair.

PASS list: autorun launch, compositor selfcheck, real pagh-terminal window,
df, ps, ps -ef, id, id -un, groups, ls -la /mnt, disk list,
clear, help, kernel nano (buffer read back from ext2: QTERM-NANO-OK),
ppkg update (68829 pkgs), ppkg install nano fastfetch ncurses-base (real
Debian .debs over verified TLS), bare fastfetch (PATH fallback #158; logo and
fields in termwindow-19b), sync, and lxrun nano -I — the real ncurses
editor now takes the keys
(Ctrl+O prompt, then Ctrl+X) and its file is read back
from ext2: QTERM-LINUX-NANO-OK.

The mode also fails if any kernel-shell command output appears on serial (that
would mean the command ran in the boot shell) — serial stays clean.

-I is needed because Debian's /etc/nanorc includes /usr/share/nano/*.nanorc
by absolute path while the tree lives under /mnt; it is user rc config, not the
editor path under test. If the editor ever stalls again, the mode records that
step as unverified (pointing at terminal-session.md §6.10, the named
alternate-screen limitation) instead of silently passing.

Gates (head a00f0544, dev base f1453f55)

fmt OK · build debug OK (linked) · build release OK (linked) · host tests
881 passed / 0 failed · check_safety OK (7 critical files) · check_agents_md OK ·
CI on this SHA: success. Version not bumped, nothing merged by me.

Evidence: /home/oleg/.cache/pagh-agent-notes/qterm2-live/
(serial_termwindow-devf1453.log, e2e-termwindow-devf1453.log,
termwindow-*.png).

…indow

Adds 'tools/e2e.py termwindow', the stage-2 acceptance that #147/#169 made
possible: the shipped pagh-desktop + pagh-terminal pair runs on the real
fbdev/evdev/PDP path, and the window itself is kernel-shell session 1
(/dev/vtfb1 pixels + /dev/vtinput1 keys), so every command is the kernel
shell's own code, not a userspace imitation.

The compositor is started from /mnt/etc/autorun — the shipped
desktop-autorun recipe. That is not cosmetic: the launch-target spec
contains '{socket}', and typing shifted braces through QMP left a stuck
modifier under TCG, so the next 'c' reached the guest as a real ^C. With
autorun, the only keys on the wire are the commands under test.

Per command the mode records one PNG (what a human sees) and one
'[DIAG] window session=1 command=…/done=…' serial pair (the kernel's own
evidence that the line reached and returned from session-shell). It fails
if any kernel-shell output appears on serial — that would mean the command
executed in the boot shell instead — reads the nano buffers back out of
the ext2 image with debugfs, and uses the kernel's 'stuck in syscall read'
watchdog line to know when the Linux editor is ready for keys.

Covered: df, ps, ps -ef, id, id -un, groups, ls -la /mnt, disk list, clear,
help, kernel nano (edit/Ctrl+S/Ctrl+Q), ppkg update, ppkg install nano
fastfetch ncurses-base, bare fastfetch (PATH fallback without lxrun) and
lxrun nano (Ctrl+O/Enter/Ctrl+X). A 256 MiB volume is created because the
64 MiB desktop image cannot hold ppkg install.

Known gap, reported rather than papered over: the Linux (ncurses) nano
opens and renders, and an earlier run saved its file (read back from ext2),
but in later runs the editor parked in read(2) without receiving the
Ctrl+O/Enter/Ctrl+X chords — termios/raw-mode, i.e. the named stage-3
PTY/job-control work, not window routing.

Docs: tools/README.md bullet + terminal-session.md §7.
@ccclosed
ccclosed force-pushed the feat/term-full-shell-live branch from 89ae604 to e612807 Compare November 22, 2026 06:44
… root)

Live evidence from the rebased branch: Debian nano prints
'Error in /etc/nanorc on line 252: Error reading /usr/share/nano/*.nanorc'
and exits before reading a key — the package's rc files reference absolute
/usr paths, while in this OS the Debian tree lives under /mnt (same prefix
fact as PYTHONHOME/TERMINFO, but there is no env var for nano's rc dir).
The acceptance now starts it with -I (ignore rc files): user rc config is
not the editor path being measured, and without it the TUI never reaches
its input loop at all.

Also keeps the earlier negative control: if the editor dies, the text typed
into the window lands on the shell prompt and the mode fails on the DIAG
line for that text.
…dow acceptance

Resolve the two conflicts by taking dev's versions of the tooling and
re-adding only what #171 still owns on top:

* tools/e2e.py — dev's file (termux stage-4 mode included) + the
  'termwindow' mode re-inserted on top of its helpers. _desktop_bins and
  _desktop_prepare_disk are reused; the latter gains the optional
  size_mb argument (64 MiB default keeps every existing mode unchanged),
  because ppkg install needs a 256 MiB volume.
* docs/terminal-session.md — dev's rewritten §6 kept; a short §7 documents
  the live acceptance and points at §6.10 (no alternate screen/DEC modes)
  instead of claiming ncurses interactivity.
* tools/README.md — dev's text kept, mode table lists termux and
  termwindow, the termwindow bullet matches what the mode now does
  (ncurses-base, -I, unverified ncurses interactivity).
* tools/qemu_shot.py — unchanged addition: dev does not have chord
  support, and the mode needs 'ctrl-s'/'ctrl-o' via HMP.

The Linux (ncurses) nano step is now recorded as info_check (unverified)
when the editor reaches read(2) but never accepts the chords: that is the
named §6.10 limitation of drivers::vt, not a stage-2 window-session claim.
@ccclosed
ccclosed merged commit 8a9583d into dev Nov 22, 2026
8 checks passed
@ccclosed
ccclosed deleted the feat/term-full-shell-live branch November 22, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant