LibTmux — CONTRIBUTING
Contributing
Read AGENTS.md for change discipline and WRITING.md for prose and commit conventions.
Toolchain
.tool-versions pins the Rakudo compiler on MoarVM. The library targets stable Raku 6.d.
Install the pinned Raku plugin for mise before installing the compiler:
$ mise plugins install raku \
https://github.com/m-dango/asdf-raku.git#dd8c1ef91f2b9805f94c4165d6b3029b3fbf2a06Install the compiler outside the validation loops:
$ mise install rakuVerify the selected compiler:
$ mise exec -- raku --versionThe binary includes zef. Install the declared dependencies before validation:
$ mise exec -- zef install --deps-only .Install author-only metadata and TAP tools separately:
$ mise exec -- zef install App::Prove6 Test::METAKeep the compiler's default frontend enabled. Verify upstream releases before advancing the pin.
Checks
Check source hygiene, relative file links and distribution inventory:
$ mise exec -- raku tools/check-source.rakuThis check does not rewrite code, format Raku syntax or perform static analysis.
Run focused unit tests through the distribution mapping:
$ mise exec -- prove6 --jobs=2 -I. t/unitRun the package test path used during installation:
$ mise exec -- zef test .Check the catalogue-derived native accessors:
$ mise exec -- raku -I. tools/catalogue.raku \
--format=raku \
--output=lib/LibTmux/Fields.rakumod \
--checkCheck the generated human reference separately:
$ mise exec -- raku -I. tools/catalogue.raku \
--format=rakudoc \
--output=docs/reference/catalogue.rakudoc \
--checkOmit --check to regenerate either file after editing the runtime catalogue.
Check package metadata with the author tool:
$ mise exec -- raku xt/meta.rakutestCompile the public import. Compilation executes BEGIN/CHECK code and is not an independent style linter:
$ mise exec -- raku -I. -c lib/LibTmux.rakumodInstall into a temporary repository and load it from a fresh process outside the checkout. This outer check removes its temporary installation afterward:
$ mise exec -- raku tools/check-install.rakuThe outer live suite requires an explicit tmux binary. Set LIBTMUX_TEST_TMUX
to its absolute executable path; never point a fixture at an existing socket.
The typed support-policy in LibTmux::Catalogue defines the supported
releases. CI derives the oldest and newest endpoints from that policy and
verifies their source and executable versions. See the
tmux compatibility policy.
| Setting | Owner and meaning | Failure behavior |
|---|---|---|
LIBTMUX_TEST_TMUX | Live fixtures and the example runner select one explicit tmux executable. | Missing, relative or nonexecutable paths fail before fixture setup; no PATH fallback or skipped live tests. |
TMUX_VERSION / TMUX_COMMIT | CI build inputs come from the typed compatibility policy. | Source or reported-version mismatches fail the lane. |
LIBTMUX_TEST_TMUX is test-only. It does not change the production
Server.new executable default or select a borrowed socket. Each fixture owns
its temporary directory and explicit socket and clears inherited TMUX and
TMUX_PANE for its children.
$ mise exec -- prove6 -I. -It/lib xt/liveThe ordinary t/ suite contains pure tests; xt/live/ is an explicit outer
gate. Required CI runs both endpoints and cannot treat skipped live tests as
success. Test helpers under t/lib/ are author code, not installed modules.
The outer suite also requires Python 3 for small standard-library PTY and
process-replacement fixtures. Those helpers use event-driven I/O and pidfds;
Python is not a library runtime dependency or a requirement for pure tests.
Check that the README and native guide quote complete canonical example files. This check requires no tmux process:
$ mise exec -- raku tools/check-examples.raku --check-sourceRun every example against the same explicit LIBTMUX_TEST_TMUX endpoint binary.
The runner checks displayed source, expected output and owned socket cleanup.
It places a tmux symlink to the selected binary in a private temporary directory
first on the child PATH, then removes that directory on exit. Programs other
than the minimal quickstart also receive the binary through --tmux:
$ mise exec -- raku tools/check-examples.rakuLogo exports and their upstream source provenance live in docs/assets. Keep artwork build dependencies in the upstream artwork project.
Check tracked edits for whitespace errors:
$ git diff --checkInspect new files separately. Check the staged diff before committing:
$ git diff --cached --checkVerify relative instruction links and the CLAUDE.md symlink when changing
guides. Whitespace checks do not establish package or tmux compatibility.
Report PASS, FAIL, PARTIAL, and UNVERIFIED distinctly.
Time the entire command, including startup and setup. Retain every required check and investigate runs that exceed these budgets:
| Loop | Scope | Budget | Target |
|---|---|---|---|
| Inner | Changed critical behavior | <5 s | <2 s |
| Mid | Unit suites, lint, generated-file checks | <30 s | <10 s |
| Outer | Builds, package checks, real tmux, full CI matrix | <5 min | <60 s |
Keep network access, installations, builds, browsers, sleeps, and broad scans out of inner and mid loops. Tag slow checks with a reason and run them in the outer loop. Investigate excessive setup before adding tests. Investigate waits over one second; prefer events and subscriptions. Benchmarks are separate: less than ten minutes per run and one hour per sweep.
Raku conventions
Use
META6.jsonfor package metadata,.rakumodfor modules,.rakutestfor tests,.rakufor scripts, and RakuDoc/Pod for API documentation.Declare the language level with
raku, separate runtime, build, and test dependencies, and list installed module paths explicitly inprovides. Use SPDX license identifiers and HTTPS source links.Use core
Testand run suites withApp::Prove6. Use distribution imports (-I.) when checking public imports so an undeclared module cannot hide behind-Ilib.Use zef for dependency and installed-package checks. A GitHub authority does not establish ownership of a
zef:publishing account.Use
Raku/setup-rakuin CI, pin actions to full commits, and read the compiler version from.tool-versions. Keep Linux required and verify additional platforms before claiming them.
Formatting and additional analysis
Follow native documentation authoring for declarator comments, API extraction, coverage checks and shared rendering.
Keep formatter changes opt-in and review their diffs. Run affected behavioral tests after formatting; compiler-backed tools can execute compile-time code.
| Tool | Use | Limit |
|---|---|---|
| Raku Navigator | Optional navigation; set raku.formatting.enable to false. | Formatting can alter quoted strings and Pod indentation. |
| rakufmt | Optional formatting with diff review and affected tests. | No required formatting gate. |
| static | Optional targeted advisory checks. | Rejects valid Instant arithmetic, Blob byte counts and custom BUILD arguments. |
These limits apply to the linked tool revisions. Keep the tools outside runtime dependencies and timed unit loops. Compiler import and behavioral tests remain required.
tmux isolation
The runtime floor is tmux 3.3a on Linux. For tests and probes,
use unique owned sockets and temporary directories. Clear inherited TMUX
and TMUX_PANE. Never use or stop the default server or a borrowed server.
Clean up owned resources on success, failure, and cancellation, and verify
that owned processes exit. Command acknowledgement alone does not establish
operation completion.
Review and publication
Describe the concrete problem and resulting behavior. Include relevant verification and its limits. Keep commits focused and preserve unrelated work. Repository privacy, pushes, and publication follow repository boundaries. See RELEASE.md for Fez account setup and version-tag publication.