Skip to content

Retain immutable pane capture observations - #810

Open
tony wants to merge 2 commits into
masterfrom
rmux-py-pane-observation
Open

tony wants to merge 2 commits into
masterfrom
rmux-py-pane-observation

Conversation

@tony

@tony tony commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

PaneObservation.capture(pane) retains sampled pane text after redraw or removal. It copies lines and the actual command argv into a frozen standalone value, retaining capture selection and the controller's monotonic interval without live pane/server references.

The call uses the supplied pane.cmd route and refuses failed or oversized captures instead of returning a successful empty value. The decoded-text admission limit counts Python Unicode code points and LF, after the existing transport returns. It is not a transport memory cap or an added deadline. Pane lifetime remains explicitly unknown with the legacy handle.

This is the independent pane-value slice of #370 under #629, based on current master with sibling branches absent. PR #568 still retains mutable nested lists/dicts; #587/#590 cover inherited object graphs and #613 covers mutable ASCII rendering and pytest integration. Their wider work remains open. This slice adds no engine classes, object graph, serializer or persistent recording.

Validation:

  • Owned noninteractive producer on tmux 3.2a and local 3.8a; retained Unicode text after pane removal, missing-pane failure and borrowed-server survival.
  • Custom command routing, immutable text/argv aliases, codepoint/LF admission, native errors and unknown lifetime.
  • Deliberately retaining the mutable source list makes the critical regression fail.
  • Actual proposed engine with a deliberately different facade endpoint routes to the selected borrowed engine; that engine remains usable.
  • Disposable composition with PR command(feat[timeout]) Add opt-in per-call deadlines #807; each slice also builds independently.
  • Ruff, full-tree mypy, doctest, Sphinx docs and fresh whole-branch review.
  • Complete suite: 1,439 passed, 3 skipped; the same 18 hooks/popup/floating failures already reproduced on unchanged master remain, without reruns.
  • All eight hosted tmux build lanes (3.2a through master), CodeQL and coverage at the PR head.

Retained values remain readable while referenced, including after server loss; process exit loses the in-memory value. Captures cannot establish omitted-output continuity, hidden terminal state, or arbitrary-shell completion. No macOS work or minimum-version change is included; existing support remains unchanged.

Refs #370. Keep its broader graph, serialization and observation criteria open.

why: Consumers need capture evidence that remains readable after redraw or pane removal.
what:
- Copy decoded text and command provenance into a frozen standalone value
- Preserve backend routing and reject failed or oversized captures
- Document sampled identity limits and verify retained text with an owned producer
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.26531% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.51%. Comparing base (0813d07) to head (d794cc8).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/libtmux/observation.py 63.26% 17 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #810      +/-   ##
==========================================
+ Coverage   52.45%   52.51%   +0.06%     
==========================================
  Files          26       27       +1     
  Lines        3729     3778      +49     
  Branches      747      757      +10     
==========================================
+ Hits         1956     1984      +28     
- Misses       1469     1489      +20     
- Partials      304      305       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: Readers need product notes before adopting this change.

what:
- Describe retained pane observations in the unreleased changelog
- Reference PR #810
@tony
tony force-pushed the rmux-py-pane-observation branch from 041e23d to d794cc8 Compare November 1, 2026 13:51

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

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant