Skip to content

Examples: run the tour on a supervisor-owned tmux server - #9

Open
tony wants to merge 4 commits into
masterfrom
tmux-arena
Open

tony wants to merge 4 commits into
masterfrom
tmux-arena

Conversation

@tony

@tony tony commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary


Added since this PR opened

Three commits. A fix first: three arena test socket namespaces spent most of the ~104-byte socket path budget on the test name. Then the artifact id renamed as the other ports spell it, and every example able to borrow the lent server. Found on the way: 06-streaming sent real keystrokes to panes()->at(0), a pane it does not own on a lent server, and 05-readme indexed sessions()->at(0). ctest --preset cxx-dev 463 of 463.

Verified on the branch before pushing; gates listed in the commit messages.

why: Let the shipped tour demonstrate an externally owned tmux endpoint without risking an ambient server.

what:
- Activate borrowing only for a complete, PATH-bound tour arena contract
- Emit verified UTF-8-safe endpoint evidence after the real tour completes
- Cover fallback, rejection, borrowed ownership, client binding, and evidence with real tmux

Rejected using socket aliases as activation: an ordinary example invocation must stay owned unless the descriptor explicitly opts in.
why: a tmux socket path over about 104 bytes fails to bind, and these
namespaces spent most of the budget on the test name before the run
directory was even prefixed.
why: the arena artifact id was `libtmux_example_01_tour`, which is the CMake
target name rather than a name the documentation site can read alongside the
other seven. Every other port reports `<language>-<example>`:
`typescript-quickstart`, `rust-inspect`, `python-workspace-setup`.

what: report and expect `cpp-tour` as the artifact id, in the example and in
the tests that assert it. The CMake target keeps its own name; the two were
only ever equal by accident.
why: only `01-tour` could run under the documentation arena, and it carried the
evidence plumbing itself. The other examples could only ever run against a
server they started, so the site could prove one example and no more.

what:
- `ScratchServer::print_arena_evidence(artifact)` moves the evidence into the
  shared header, beside `open_or_borrow_arena`, and takes the artifact id.
  `01-tour` loses its private copy.
- `02-workspace`, `05-readme` and `06-streaming` borrow when the arena
  activates, as `cpp-workspace`, `cpp-readme` and `cpp-streaming`.
- Two of them reached for whatever the server already had: `05-readme` indexed
  `sessions->at(0)` and `06-streaming` took `server.panes()->at(0)` and then
  sent real keystrokes to it. On a borrowed server that is the supervisor's own
  session, and typing into a pane this program did not create is exactly what
  borrowing must not do. Each now makes and names its own.
- `06-streaming` also attached its control connection to a session named
  `example`, which does not exist on a borrowed server. It attaches to the one
  it creates.
- The arena tests loop over every capable example rather than naming `01_tour`,
  so a new one is covered by construction.

This branch has not been deployed

No deployments
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