Skip to content

Lifecycle(feat): Add owned tmux resource scopes - #27

Draft
tony wants to merge 1 commit into
masterfrom
lifecycle-mvp
Draft

tony wants to merge 1 commit into
masterfrom
lifecycle-mvp

Conversation

@tony

@tony tony commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Ordinary Ruby examples use the normal tmux endpoint. An external harness redirects the same code through captured socket and child-environment defaults, then cleans up its daemon. The displayed examples retain their imports and match their source files.

adopt accepts cleanup responsibility for an existing server, session, window or pane. OwnedResource retains the accepted daemon generation and resource ID, checks them before destruction, and permits retry after a failed close. Block scopes preserve both body and cleanup errors. Creation receipts support rollback after failed readback or cancellation; uncertain outcomes remain explicit.

Bounded discovery reports endpoints, diagnostics and truncation. Find-or-create returns owned creations or borrowed matches, with exact session/window names and pane-local identities. Calls serialize within this Ruby process; unrelated clients do not join that coordination. The Async facade defers cancellation during ownership handoff and uses the bound core executor for ownership commands.

Validation

Fresh independent review at the source committed as 730aad76 passed 46 core/Async cases and 396 assertions on each of tmux 3.7d and tmux 3.2a, plus 11 gate and native Async cancellation cases with 95 assertions. Removing the adoption check failed eight cases; removing the reuse handoff check failed six. The observer recorded 128 accepted daemon exits before exact fixture-root removal.

The retained review commands run consumer.rb --seed 49183, consumer.rb --seed 30817 and edges.rb -n /gate_cancel|invalid_admission|async_task_cancel/ --seed 25151 under the external observer with Ruby 4.0.7, private fixture roots and the selected tmux binary. Those three commands took 3.00, 3.05 and 1.04 seconds. These independent probe files live in the audit evidence. Repository coverage includes test/integration/lifecycle_test.rb, test/integration/lifecycle_cancellation_test.rb and the Async lifecycle tests. Earlier final lifecycle execution took 9.81 seconds including startup; documentation rendering took 174.52 seconds. These timings describe those recorded runs, not a performance claim.

Preservation checks retain all 59 original Markdown fences and 274 of 275 original Ruby/gemspec comment blocks verbatim. The changed endpoint summary explains captured defaults and retains the no-start contract. The four gemspecs still require Ruby 3.3 or later; dependencies and the lockfile remain unchanged. All 148 source files pass Ruby 3.3 grammar checks. API/RBS checks, generated files and 22 displayed example bindings pass within their recorded source boundaries.

Remaining work

Keep this PR in draft. Ruby 3.3 runtime execution and installed-gem checks remain unexecuted. An earlier broad integration run exhausted disk space and lost its complete process inventory; focused passing runs do not resolve that result. Whole-harness crash recovery, complete descendant accounting, native documentation adapters and the wider acceptance assessment remain pending.

Plain Markdown, Astro Markdown/MDX, Sphinx reST/MyST and Python doctest remain in the shared example-testing scope. This change executes Ruby sources and verifies Markdown/YARD bindings; it does not establish the other adapters.

why: Ruby blocks need cleanup authority tied to accepted resources,
with cancellation and cleanup failures preserved at ownership handoff.

what:
- Add owners and explicit adoption for all four tmux object kinds
- Capture defaults and distinguish created from borrowed reuse
- Add bounded discovery and generation-checked cleanup receipts
- Retain recovery owners when rollback or cleanup fails
- Route unchanged imported examples through external test defaults
- Preserve existing documentation, dependencies and Ruby 3.3 floor
- Verify focused core and Async consumers with independent review

Ruby 3.3 execution, installed artifacts and the broad integration
gate remain incomplete. The earlier full-volume failure is retained.
This local draft does not claim the full acceptance bar is met.

This branch was previously deployed

1 inactive deployment
docs-preview — f09661bb Deployed Oct 10, 2026 by tony via publish (pr-27, pr, false, docs-preview, true) / publish #104
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