Skip to content

server(feat) Expose detached observations and scoped recovery - #4

Merged
tony merged 17 commits into
masterfrom
feat/capture-recovery
Nov 10, 2026
Merged

tony merged 17 commits into
masterfrom
feat/capture-recovery

Conversation

@tony

@tony tony commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Observe an existing tmux daemon through a scoped Server, then process a detached Snapshot with ordinary Haskell records and collections. Failed and cancelled captures retain correlated recovery owners without replacing the original exception. The public observation API includes validated offline fixtures, installed examples and a scoped capture baseline. Broader performance qualification remains separate.

Summary

  • Expose LibTmux, LibTmux.Server and LibTmux.Snapshot with sessions, physical windows and panes, attached clients, window links and pane occurrences.
  • Share resource ownership through withRuntime and give each withServerIn adoption its own lifetime and recovery scope. Failed adoption can retain recovery before a Server exists.
  • Keep acquisition in IO and graph navigation pure. Capture intervals, generation-bound references and indexed lookups make identity and observation scope explicit.
  • Preserve primary callback failures and asynchronous cancellation across bounded cleanup. tryTmux returns the typed failure with its exception context and reachable recovery owners.
  • Add receipts for logical, decoder and native read ownership; resume existing cleanup without redispatching commands.
  • Add private per-handle shutdown with selected admission, queued non-dispatch outcomes and isolated physical/logical reports under the shared limits.
  • Build validated offline snapshots through safe fixture references with identities distinct from every adopted endpoint.
  • Provide an optional public-capture benchmark with owned workloads, raw samples and source/binary provenance, outside routine test loops.
  • Add complete capture, offline-fixture and shared Runtime programs, an owned foreground-daemon fixture and isolated source-archive consumers. Pin installation examples to their implemented public APIs.
  • Select cached tmux 3.8 for live documentation checks and retain endpoint-only integration CI.
  • Summarize public snapshots, shared recovery, offline fixtures and the capture benchmark in the Unreleased changelog with the PR reference.

Receipts contain correlation metadata. Recovery annotations retain the owning runtime and server scope explicitly. Detaching logical uncertainty releases no native resources. Later proven completion preserves the original caller outcome.

The supported range remains tmux 3.3a through 3.8, inclusive. Routine CI exercises the two endpoints with GHC 9.14.1. MCP remains excluded.

Before this draft is ready

The public API and its bounded failure cases have independent review. Broader performance measurements remain follow-up work; native browser navigation is handled by #5 in the merge stack.

  • Expose Server, Snapshot, Session, Window, Pane and contextual observations.
  • Qualify the common Server scope's cleanup, cancellation and simultaneous callback/cleanup failures.
  • Provide validated offline fixtures. Record access, qualified/selective imports, patterns and local updates compile.
  • Run an installed capture/navigation example and use it in README and docs.
  • Expose and qualify the advanced caller-owned Runtime scope.
  • Measure capture cost for small, medium and large linked-window graphs on both tmux endpoints.
  • Extend performance qualification to allocations, concurrent callers, active geometry/selection changes, long fields and cancellation latency.
  • Extend the shared exporter to the seven public modules, preserving record owners, module reexports and source links.
  • Resolve native Haddock's hidden-instance origins and repeated-record-label anchors; the shared adapter preserves ownership separately.
  • Exercise fixture interruption during session creation before its pane receipt. Join its command client, observe daemon/pane exit independently and preserve the explicit unestablished-ownership diagnostic.
  • Pass exact-head hosted CI on both tmux endpoints.
  • Complete final public API review for the observation and shared Runtime increment.

Test plan

  • Exercise the complete integration suite on both tmux endpoints with one and two RTS capabilities.
  • Check accepted-read cancellation, timeout conversion and pre-publication request failure.
  • Reject foreign receipts and recover retained native cleanup after decoder retirement.
  • Verify selected-handle closure, supervisor refusal, detached native owners and overlapping global cleanup while keeping healthy peers usable.
  • Preserve callback masking and application exception classes through the public shared Runtime scope; reject adoption after root closure.
  • Demonstrate behavioral failures when recovery annotations, native ownership or generation validation are removed.
  • Run specifications, properties, type contracts and documentation checks.
  • Build Haddock and execute source-archive scalar, capture, offline-fixture and shared Runtime consumers and Haddock examples.
  • Run the pinned capture, offline-fixture and shared Runtime programs from their immutable Git-source dependencies.
  • Review source and archive identity independently.
  • Observe owned daemon and pane exits after example callback failure and cancellation; observe daemon exit after setup fails before session dispatch.
  • Reject an unbounded command cleanup wait and detect a missing join before test fallback cleanup can mask it.

Local unit/spec suites, displayed programs and source-archive consumers pass. Five fixture lifecycle checks pass on each tmux endpoint, including actual SIGINT during held session creation and an injected response/retirement failure. Deliberate regressions fail for the intended ownership and bounded-wait reasons. The fixture correction has independent source review.

Hosted CI for the current public Runtime implementation passes the build, both tmux endpoints and the required aggregate check.

Local endpoint and installed-consumer checks pass, including the shared Runtime program built from its pinned Git revision on both tmux endpoints. Independent source review found no material issue in the public scope, guide or fixture binding. Native Haddock declaration coverage passes; its navigation limits remain listed above. The scoped benchmark retains local evidence and independent review. Shared capacity, retained uncertainty and explicit cleanup waits keep their documented limits.

Companion PR

Shared Haskell registration has landed, and the first production site is published from the frozen scalar API source. The observation documentation follow-up adds native capture, snapshot, fixture and shared Runtime references and guides, with separate library/exporter provenance; it remains a draft awaiting qualification. Native merging does not publish the site: the caller workflow is dispatch-only, and publication from the expanded API waits for the compatible exporter.

tony added 4 commits November 8, 2026 16:30
why: Recovery must locate native cleanup after a decoder retires without
retaining request results or confusing work from another server scope.

what:
- Bind receipts to Runtime identity, connection generation and native job keys
- Report logical responsibility, decoder ownership and native cleanup separately
- Resume registered cleanup without closing admission or redispatching commands
- Preserve ownership when a recovery worker cannot be allocated
…t handoff

why: A failed capture needs a reachable recovery owner even when its caller
is cancelled or its deadline expires before the request handle is returned.

what:
- Attach correlated recovery to the original exception context
- Copy receipts before timeout conversion and force stored metadata
- Preserve the first caller outcome when later completion retires responsibility
- Check readiness against worker completion in accepted-read regression cases
why: Applications need a usable observation API with explicit resource
ownership and pure graph navigation.

what:
- Add scoped Server configuration, capture and context-preserving recovery.
- Expose detached sessions, physical windows and panes, contextual links
  and occurrences, attached clients and indexed navigation.
- Stamp capture intervals, separate lookup and graph validation failures,
  and keep snapshot assembly and targeting references opaque.
- Preserve primary failures across cleanup failure and cancellation.
- Align backend handle names with tmux's observed Client vocabulary.
- Add an owned capture program, source-archive consumers and reader guides.
- Select cached tmux 3.8 for live documentation checks while retaining
  the 3.3a and 3.8 integration matrix.
why: Copyable installation examples must select the reviewed public API
instead of a moving development branch.

what:
- Pin the capture consumer and displayed project to its implementation
  commit.
- Keep the source-dependency example checked against its declared file.
tony added a commit that referenced this pull request Nov 9, 2026
why: Readers need the observation and failure-handling changes grouped
by their effect on applications.

what:
- Record detached capture, contextual graph navigation and scoped recovery
  under PR #4.
- Distinguish the new public facade from private transport and assembly.
@tony tony changed the title capture(feat) Retain recovery after failed observations server(feat) Expose detached observations and scoped recovery Nov 9, 2026
tony added a commit that referenced this pull request Nov 9, 2026
why: Consumers need to discover independent Server scopes and the recovery
contract for failed endpoint adoption.

what:
- Record the public Runtime entry points and selected cleanup behavior for PR #4
tony added 13 commits November 9, 2026 18:16
why: Applications need pure graph fixtures without starting tmux or
constructing unchecked live targeting references.

what:
- Give named fixture origins a distinct identity from endpoint adoptions.
- Expose pure reference builders, ordinary fixture inputs and validated
  snapshot assembly through the existing graph and metadata checks.
- Report acquisition provenance and keep offline capture intervals absent.
- Resolve attached-client context from the same validated graph.
- Add an installed offline example and readable specifications, and reject
  coercion from a connection generation into a fixture origin.
why: Standalone fixture and capture programs need one immutable source
that includes the offline construction API.

what:
- Select the reviewed fixture implementation for both source projects.
- Keep the displayed installation pin and fixture setup links in sync.
why: Capture cost needs reproducible measurements that include decoding,
validation and owned values on realistic tmux graphs.

what:
- Add an optional public-API benchmark and owned graph fixtures outside
  routine test loops.
- Record raw timings, graph cardinalities, binary and source identities,
  and host context for the supported tmux endpoints.
- Observe daemon and pane exits before accepting a result.
- Preserve separate artifacts for repeated version labels and support
  source-archive provenance without Git.
- Publish dated reference samples, reproduction steps and their limits.
why: Record syntax and exception context types belong to the selected
compiler and base documentation, so readers need their owning references.

what:
- Link record-dot, numeric-class and exception context documentation.
- Keep package API mentions distinct from dependency declarations.
why: Cancelling fixture creation could release its command handle before
joining the child. Keep that ownership without obscuring the original failure.
what:
- Retain session-command ownership through bounded termination and waiting.
- Join the command after daemon shutdown when initial retirement fails.
- Cover active creation cancellation and failed retirement with owned fixtures.
- Document the remaining unreceived-pane ownership limit.
why: Contract pages still described public observations as private or absent.
Readers need the current boundary alongside the historical qualification record.
what:
- Link implemented capture, navigation and offline-fixture modules.
- Keep query, cardinality and raw-command interfaces explicitly planned.
- Record the qualified public milestone and the actual remaining gates.
- Correct the test guide's three-program archive inventory.
why: Shared Runtime scopes need to identify their logical and physical work
independently of either kind of retirement.
what:
- Add opaque metadata groups to private operation admission.
- Keep group identity after completion or explicit logical detachment.
- Select retained logical operations without changing shared capacity limits.
- Cover mixed groups, ungrouped work and retirement with the unit scheduler.
why: A token inside Maybe could remain deferred and retain caller data after
operation retirement. Admission must own evaluated metadata.
what:
- Force the enclosed group before reading or changing scheduler state.
- Reject deferred token failure without reserving an operation.
- Verify that valid admission still works after the rejected transaction.
why: Shared Runtime ownership needs handle-specific cleanup while preserving
other adoptions and responsibility for uncertain operations.
what:
- Associate each adopted pool and its reads with a persistent operation group
- Settle queued reads when selected admission closes, before worker allocation
- Share owned shutdown attempts and report physical and logical debt separately
- Preserve retry ownership, cancellation outcomes and shared resource limits
why: Shared Server scopes need identifiable cleanup before a handle exists
and must preserve other handles when adoption or cleanup fails.
what:
- Register opaque Server owners before pin acquisition and guard publication
- Keep one selected target through scope errors, inspection, retry and waiting
- Reject foreign logical detachment and propagate retained read-worker failures
- Preserve callback exceptions and the masked ownership handoff
why: Components need independent Server lifetimes under one resource budget
and an explicit owner for their remaining cleanup responsibility.
what:
- Expose opaque Runtime, withRuntime and withServerIn through the existing API
- Keep failed adoption and handle cleanup tied to the selected owner
- Reject closed Runtime admission and preserve callback errors and masking
- Document generation separation and nested cleanup recovery owners
why: Applications sharing resource ownership need a complete installed
example that preserves each handle's lifetime and recovery boundary.

what:
- Add a shared Runtime program with asserted output and an immutable source pin
- Reuse the owned capture fixture with explicit executable and output bindings
- Document shared capacity, failed adoption and overlapping cleanup ownership
why: Explain the capture and offline-testing APIs callers can adopt.
what:
- Summarize detached observations, graph navigation and shared ownership
- Describe validated fixtures and the optional capture benchmark
- Link the product changes to PR #4 in one changelog commit
@tony
tony force-pushed the feat/capture-recovery branch from b996025 to ee92f05 Compare November 10, 2026 00:18
@tony
tony marked this pull request as ready for review November 10, 2026 00:25
@tony
tony merged commit 1f3f1da into master Nov 10, 2026
4 checks passed
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