Skip to content

Add native Clojure facade - #20

Draft
tony wants to merge 11 commits into
masterfrom
clojure
Draft

tony wants to merge 11 commits into
masterfrom
clojure

Conversation

@tony

@tony tony commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add native Clojure facade: Publish libtmux-clojure with captured values, explicit tmux effects, local collection processing, bounded tasks, and owned control streams.
  • Add optional core.async support: Provide libtmux-clojure-core-async without adding core.async to the core module.
  • Extend captured Java support: Expose snapshot-backed handles and bounded control byte delivery needed by the Clojure facade.
  • Close runtimes deterministically: Wait for scheduled callback cancellation before deciding whether the completion executor has quiesced.
  • Protect owned tmux fixtures: Identify cleanup targets through the connected tmux server so a concurrent client cannot be mistaken for its daemon.
  • Add executable Clojure examples: The guide and reference cover connecting, captured traversal and filtering, map projections, exact cardinality, effects, resource scopes, bounded async work, byte streams, core.async, and a Manifold CompletionStage recipe.
  • Verify the public boundary: Run the documented examples through isolated real-tmux fixtures and test signed local artifacts with installed core and optional-adapter consumers.

Design decisions

  • Java owns tmux semantics: Clojure values preserve captured Java references for effects and Java FilterExpr interop, while ordinary Clojure maps and collections handle local work.
  • Acquisition stays explicit: Capture and mutation use effectful APIs; relationship traversal stays on the captured graph.
  • Fixture ownership comes from tmux: The fixture records the daemon PID and socket reported by its connected server instead of relying on process command-line matching.
  • Optional integrations stay optional: core.async and Manifold are consumer choices, and the public core artifacts do not depend on either.

Test plan

  • Full repository verification
  • Focused client switch and detach coverage with a live controlled client
  • Async callback-close regression coverage
  • Executable Clojure documentation and Manifold recipe coverage
  • Isolated signed artifacts and installed core and optional-adapter consumers through Tools.deps, Maven, and Gradle
  • Hosted JDK, tmux-version, and macOS matrix

tony added 11 commits September 20, 2026 14:31
why: Provide captured tmux values, explicit effects, bounded async
work, and stream adaptation without duplicating the Java engine.

what:
- Publish core and optional core.async Clojure modules through the BOM.
- Add captured snapshots, bounded tasks, control streams, and byte events.
- Test owned real-tmux fixtures, documentation fences, artifacts, and
  Clojure boundary contracts.
why: Match the repository Java formatter.

what:
- Wrap group failure assertions in the standard layout.
why: Task completion can publish before the virtual worker stops.

what:
- Join the owned fixture worker before asserting its cleanup.
why: macOS resolves fixture socket paths through /private/tmp while tmux
preserves the original /tmp spelling in its command arguments.

what:
- Match sockets by their resolved paths during ownership checks.
- Cover ancestor-link aliases and control-process ownership.
why: Captured values can outlive a client, while capture I/O must finish
within the server's resource scope.

what:
- Add an executable lazy traversal and eager capture example.
- Check the capture count in the documentation test.
why: Window auto-renaming races shell startup on macOS, making the
false-condition test report an unrelated title change as an effect.

what:
- Assert a private option that only the guarded command can change.
- Remove the fixed delay and window-title dependency.
why: Cancellation publishes the terminal outcome asynchronously.

what:
- Observe the cancelled task before resubmission
- Remove the JDK 25 admission timing race
why: Fixture scanning conflated a tmux client with its daemon.

what:
- Read the authenticated daemon PID from tmux
- Cover concurrent client ownership
why: Client operations need live evidence that preserves the captured target.

what:
- Attach an owned control client in the Clojure integration fixture
- Assert switch and detach through refreshed client observations
why: Closing a runtime could test completion-executor quiescence before
its queued callback cancellations ran.

what:
- Snapshot callback stages and await their scheduled cancellation
- Keep the wait within the runtime's existing cleanup deadline
- Record the caller-visible close behavior in the changelog
why: A labeled matrix cannot establish Clojure compatibility unless the
selected runtime and tmux binary are verified by the process under test.

what:
- Add four Clojure/JDK check and package cells
- Add forty Linux and eight macOS Clojure real-tmux cells
- Assert the Clojure runtime selected for each integration run

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