Skip to content

fix(tui,agent,screenshots): a full wordmark; cancellations in one write; cell-exact captures - #1353

Merged
huichen merged 5 commits into
mainfrom
pr/huichen
Oct 25, 2026
Merged

huichen merged 5 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

What and why

Four changes on the integration branch. The TUI workbench header now draws all five rows of its wordmark instead of clipping the last of them. The agent records a session's queued cancellations in a single write, so a reader can no longer observe a half-written receipt list. The screenshot tooling measures a wide (two-column) cell in both directions, which is what the regenerated TUI assets under docs/tui/assets/ depend on. The last commit is documentation: the picker frames are live scenarios now, and the verification record says so.

Commits

  • fix(tui): draw all five rows of the header wordmark
  • fix(agent): record a session's queued cancellations in one write
  • fix(screenshots): measure a wide cell over its two columns, and both directions
  • docs(tui): the picker frames are live scenarios now, and say so

Verification

Run at f82307490 (the branch tip before the docs-only commit; the last commit touches two Markdown files only), with rustc/clippy 1.97.0:

  • cargo fmt --all -- --check — clean
  • cargo clippy -p future-tui -p future-agent --all-targets -- -D warnings — clean
  • cargo test -p future-tui --lib — 1026 passed
  • cargo test -p future-agent --lib -- queued — 26 passed
  • cargo test -p future-agent --lib -- rpc::session — 203 passed
  • python3 -m py_compile scripts/screenshots/capture.py scripts/screenshots/tui_capture.py scripts/screenshots/tui_terminal.py — clean

Notes

The TUI screenshot assets are regenerated by the same cell-measurement change, so they belong with it; the capture docs describe the corrected behaviour.

huichen and others added 5 commits October 25, 2026 20:33
The header's identity block is the 5-row `FUTURE OS` block font beside the 4-row
whale, but the header band was five rows tall *including* the hairline, and the
loop painted `0..4`. So the fifth wordmark row — the bottom stroke of F, U, E and
S — was never drawn: the art read as clipped rather than as a frame, and the
launchpad hero, which iterates all five, disagreed with the chat header about the
same wordmark.

The tall-layout header is now six rows (five identity rows + the hairline), so
`body_y`, `body_h`, the band tiling and the test that pins `header.h` all move by
one. `docs/guide/tui.md` already described the header as "5 rows … ── hairline",
so it needed no change: the code was the one out of step.

A new test asserts every one of `wordmark_rows`' five rows appears in the header
and that row 5 is still the hairline; reverting the loop makes it fail with the
missing row printed.

Also fixed while capturing it: the pty capture ends by killing the child, which
can land mid-character, and decoding that stump with `errors="replace"` drew a
literal U+FFFD into a cell (observed in the wordmark's bottom row). `run` now
drops an incomplete trailing UTF-8 sequence — only the character, never the
partial frame, whose written cells are the newest content — with a self-test.
`cancel_all_queued_runs` called the single-receipt wrapper once per queued
run, so cancelling a busy session's queue cost one write transaction and one
commit per run. The shutdown path calls it inside a fixed stage budget, and
with a session holding several queued runs on a large store that was enough
to overrun the budget and report "Agent shutdown deadline exceeded during
queues and cancellation" - the host then exited with Failed even though the
cancel had already happened in memory.

`cancel_queued_receipts` is already the batch form (one transaction, a row
update per run, all-or-nothing); the loop simply did not use it. Collect the
run ids and pass them in one call, keeping the ephemeral skip, the
`scheduled_snapshots` removal and the flush where they were. A refused batch
now names every run id that was not recorded, since a restart recovers all of
them rather than all but the last.

Measured on the same three-queued-run scenario, counting the write
transactions the cancellation opens: 3 before, 1 after; at twelve queued
runs, 12 before, 1 after.

Tests: every queued receipt is marked cancel_requested by that one write; a
batch the store refuses commits none of its rows (which is what a per-run
loop could not do); an ephemeral session writes no receipt.
…directions

The alignment gate had two defects, one blocking and one silent.

Blocking: it measured every cell as one column wide, so a right-leaning
full-width glyph read as "no ink in its own cell". `(` sits on the right of its
em, and every live frame containing a Chinese parenthesis was refused — the four
P0 fixes could not be re-shot at all.

Silent: "every character cell has ink" cannot see a shift. A row pushed sideways
by a whole cell still leaves each character's box partly inked, so the gate said
"aligned" for a frame with a deliberately shifted row. It now also requires that
a cell the grid leaves blank carries no glyph, with the threshold measured on a
trusted frame (worst blank cell: 11%) and a negative control proving a one-cell
shift is caught.

Both rules are a pure function of the grid and the ink picture, so the self-test
pins them without a browser: the wide-span case, the shift, and a missing glyph.

All 19 frames in docs/tui/assets/ are re-shot with the fixed renderer, live
against an isolated agent; the previous set was rasterized before absolute
placement landed and carried the flowed-text skew. The three picker frames are
now reproducible scenarios (`picker-model`, `picker-theme`, `picker-sessions`)
instead of hand-made captures.
The three picker assets come from shot.sh picker-model|picker-theme|picker-sessions
like every other frame, so the figure index, the note that called them
deterministic captures, and the recipe describe that instead of a separate tool
path. Also records what the re-shoot changed: the sidebar border's longest
unbroken run went from 3 text rows to 24.
@huichen
huichen enabled auto-merge (squash) October 25, 2026 12:37
@huichen
huichen merged commit bb7178b into main Oct 25, 2026
25 checks passed
@huichen
huichen deleted the pr/huichen branch October 25, 2026 12:49
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