Skip to content

Experimental chain workspace builder (scaffold)#1068

Open
tony wants to merge 3 commits into
masterfrom
builder-chain
Open

Experimental chain workspace builder (scaffold)#1068
tony wants to merge 3 commits into
masterfrom
builder-chain

Conversation

@tony

@tony tony commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Add ChainWorkspaceBuilder (workspace_builder: chain), an experimental builder that constructs the session β†’ window β†’ pane tree from a single libtmux ForwardPlan.
  • Gate it cleanly: the module imports without the unreleased libtmux experimental chain API; selecting it without that API raises an actionable WorkspaceBuilderImportError instead of an import crash.

Status

Groundwork toward the parallel/batched builder (roadmap #1058, #1062). Not functional on released libtmux β€” it requires the experimental chain API (libtmux#685). Its API-dependent tests skip until that ships; the unavailable-path test runs and passes today.

Changes

  • workspace/builder/chain.py (new, import-guarded), chain entry point, tests (importorskip + unavailable path), docs, CHANGES.

Supersedes #1054, re-homed onto the #1066 framework; selection is via workspace_builder: chain (the old --builder CLI flag is dropped).

Test plan

  • full suite (chain tests skip on released libtmux; unavailable-path test passes)
  • mypy / ruff / build-docs

tony added 2 commits June 28, 2026 19:55
why: Land the experimental ChainWorkspaceBuilder from #1054 on the new
builder package. It builds the window/pane tree via libtmux's chain API
(libtmux#685), which is unreleased and absent from published libtmux, so
the scaffold must import cleanly and fail with an actionable error rather
than crash on import.

what:
- Add src/tmuxp/workspace/builder/chain.py: ChainWorkspaceBuilder
  subclasses ClassicWorkspaceBuilder; guard the experimental import
  behind _HAVE_CHAIN so the module imports without the API
- build() raises exc.WorkspaceBuilderImportError when the chain API is
  absent; when present, port #1054's single-ForwardPlan build
- Register the `chain` entry point in tmuxp.workspace_builders
- Export ChainWorkspaceBuilder from the builder package
- Add tests: test_builder_chain.py importorskips the chain API; the new
  test_builder_chain_unavailable.py asserts selecting `chain` without the
  API resolves the class yet raises on build()
why: Tell users the chain builder exists, how to select it, and that it
is non-functional until libtmux's unreleased chain API ships.

what:
- Add docs/internals/api/workspace/builder/chain.md autodoc page with an
  unreleased-API warning; add it to the builder index grid and toctree
- Add an "Experimental chain builder" section to the custom-workspace-
  builders topic and list it under Reference
- Add a CHANGES entry under 1.74.0 noting the opt-in builder requires
  libtmux#685 and is non-functional until that ships
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 82.56%. Comparing base (812dcca) to head (9200dc3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1068   +/-   ##
=======================================
  Coverage   82.56%   82.56%           
=======================================
  Files          31       31           
  Lines        2770     2770           
  Branches      518      518           
=======================================
  Hits         2287     2287           
  Misses        346      346           
  Partials      137      137           

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: the chain builder's plan-building methods require the unreleased
libtmux._experimental.chain API (libtmux#685) and cannot execute on
released libtmux, so codecov flagged the unmeasurable lines as a
project-coverage drop.

what:
- Omit src/tmuxp/workspace/builder/chain.py from coverage until the
  experimental API ships and the builder becomes testable
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