Skip to content

Latest commit

 

History

History
100 lines (86 loc) · 6.47 KB

REVIEW.md

File metadata and controls

100 lines (86 loc) · 6.47 KB

Code and architecture review (libtmux/libtmux-java)

Posture: experimental (pre-1.0 JDK 25 and multi-language JVM modules for tmux; align observable semantics, target resolution, capability contracts, and error taxonomy with the libtmux ports documented at libtmux.org while expressing APIs in native Java, Kotlin, Scala, and Clojure idioms).

Posture defines experimental, stable and private.

Review the complete change against <base>, including untracked files. Report all findings in one pass without editing files. Follow writing rules, MCP rules, and the organization AI policy.

1. Layer ownership

Layer Modules and paths Owns Must not own
Core JPMS module and BOM libtmux/, libtmux-bom/ io.github.libtmux (Server, Session, Window, Pane, batch, catalog, control, exception, format, query, snapshot, transport), @NullMarked contracts, and aligned Maven BOM publications Runtime dependencies, transitive org.jspecify / Error Prone module requirements, exported io.github.libtmux.internal, or CLI/MCP schemas
JVM language and codec modules libtmux-jackson/, libtmux-kotlin/, libtmux-scala/, libtmux-scala-cats/, libtmux-scala-ox/, libtmux-clojure/, libtmux-clojure-core-async/ Jackson codecs and idiomatic Kotlin, Scala 3 (direct, Cats Effect, Ox), and Clojure (core.async) bindings delegating to libtmux Duplicated tmux wire/control-mode parsing or raw tmux subprocess execution
Outer applications libtmux-workspace/, libtmux-workspace-cli/, libtmux-mcp/ Declarative YAML session builder, workspace CLI, and detached-safe MCP server over libtmux Raw tmux subprocess workarounds for missing libtmux APIs or modal interactive client UIs in libtmux-mcp
Quarantine, build-logic, and suites libtmux-junit5/, build-logic/, integration-tests/, module-tests/, docs/, examples/, benchmarks/, tools/mcp-swap/, scripts/ /tmp/libtmux-java-test/ (tmux -L / -S with -f /dev/null) libtmux.tmux-quarantine and TmuxExtension lifecycles, Doclet/codegen plugins, staged JPMS/BOM consumers, executed guide snippets, and CI/release checks Touching ambient TMUX servers, bare /tmp/libtmux-* paths owned by sibling ports, or sockets past the 104-byte sun_path limit

Changing the map

Do not BLOCK against <base>:REVIEW.md's prior owner row when a pull request migrates an invariant cleanly to a single owner, updates callers, libtmux-bom, MIGRATION.md (when public APIs break), tests, and REVIEW.md in the same diff, and states the old and new owner in the pull request description. Weigh any boundary-adapter or ownership-transfer counter-case before blocking on placement.

Rejected here

  • Caller workarounds in libtmux-mcp, libtmux-workspace*, or language wrappers: extend libtmux first when downstream modules need a tmux capability, and check sibling Java, Kotlin, Scala, and Clojure surfaces where applicable.
  • Nullability, module-graph, or suppression shortcuts: keep @NullMarked (NullAway in JSpecify mode), Error Prone, module-info.java, and platformCoversEveryPublishedModule clean without @SuppressWarnings, empty catch blocks, or runtime dependencies in libtmux.
  • Control-mode and subprocess lifecycle hazards: check split-frame reads, octal escape decoding, %begin/%end/%error pairing, child process reaping, and Server.close() / cancellation teardown. Reject fixed Thread.sleep loops where PaneWait / TextWait, format queries, or %end notifications provide deterministic readiness.
  • Unquarantined tmux servers or capability-claim drift: live tests must run under libtmux.tmux-quarantine or TmuxExtension inside /tmp/libtmux-java-test/ (tmux -L / -S with -f /dev/null, TMUX and LIBTMUX_SOCKET* scrubbed) and pass everyTestModuleIsQuarantined. README.md, module READMEs, and capabilities.json may claim only implemented, tested features; reject Python-era instructions (## Python typing).
  • Silent partial multi-step failure: when a CommandChain, workspace build, or batch MCP call spans multiple side effects, verify what state persisted if step N fails and what io.github.libtmux.exception error reaches callers before retry.

2. Regression baseline and decision

  1. For bug fixes and behavioural changes, reproduce the failure on <base> against a real isolated tmux server (integration-tests/ or quarantined module test) rather than a mocked owner. When a follow-up commit fixes a defect introduced earlier in the same open pull request that did not exist on <base>, cite <pre_fix_head> and prove the regression test fails there.
  2. Verify that restoring modified non-test production sources and removing newly added production sources makes the new test fail for the expected reason, then restore production files and pass ./gradlew :libtmux-mcp:test check, ./gradlew :docs:test, and scripts/ (ruff, ty, pytest). Track any temporary upstream workaround in .github/workarounds.toml when introduced.
  3. Emit BLOCK or NO FINDINGS (plus optional non-blocking NOTE items). Every BLOCK must cite the file and broken rule or failing input, and state a concrete test, command, or code observation that would prove the finding wrong.

3. Verdict

These rules decide which findings block.

  • Base run: A finding that code misbehaves shows its check run on <base> and on the change, with one line of output from each.
  • Existing and separate: Behavior <base> already has does not block. Report it as a NOTE, unless the change adds a promise the behavior breaks; then the broken promise is the finding.
  • Unverified: A gate nobody ran is unverified. Name the command that would run it. It holds the merge until someone runs it, and it does not make the verdict BLOCK.
  • Behavior defects: A behavior defect blocks when a caller can reach it in a supported environment, or when it breaks a promise in the pull request description, a docstring, help text or the changelog. Otherwise it is a NOTE.
  • Checks and claims: A weakened check, a rule written in a second place and a behavior claimed as tested with no test that bites block whether or not a caller reaches them.