Files
paseo/docs/jujutsu-fork.md
T
jackos1998andClaude Opus 5.5 b9518180f0 docs/jujutsu: Explain the fork and its workflows
Describe the controls, the commands behind them and the source
files to consult. Record the fork update process and the remaining
trial checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:56:42 +00:00

12 KiB

Maintaining the Paseo Jujutsu fork

Start with the workspace guide for the controls you can use in Paseo. This page explains what those controls do behind the scenes, where to look when something breaks and how to carry the changes forward.

Two meanings of workspace

A Paseo workspace is a task with a directory and tabs for agents, terminals and other tools. A Jujutsu workspace is a directory with its own working-copy change, called @, in a shared Jujutsu repository. Several Paseo tasks can use the same directory. Several Jujutsu directories can share the same history and bookmarks while each has its own @.

The daemon expects a colocated checkout with both .jj and .git. Use Jujutsu 0.47.1, the version used in the trial and CI. Paseo uses Git for repository location, worktree discovery and forge integration. It uses jj for changes, diffs and checkout mutations. Git often sees a detached HEAD in these directories. That is expected, and Git's HEAD commonly points at the parent of the change you see in Paseo.

What the fork adds

In Paseo What happens on the daemon host
New jj workspace Runs jj workspace add --colocate and creates a fresh working-copy change on the selected base. Pick @ to include current work. Existing jj workspace opens a directory already registered in the repository.
All changes and Working copy (@) Shows task changes since the fork point or only the current change. Discard in the working-copy view restores the chosen file to its parent content. For a merge, Jujutsu computes the merged parent content.
Changes list and Start new change on… The list shows task history and a slice of base history. The picker searches beyond the active workspace. Selecting a result creates a child of that change and leaves the previous change in the repository.
Describe, New change and Fetch Runs jj describe, jj new and jj git fetch. Fetch follows the base's remote when applicable. The terminal remains the place for rebase, squash and other general Jujutsu operations.
Publish bookmark and Create pull request Pushes the named bookmark through jj and uses the existing forge adapter for the pull request. The app publishes to origin. The CLI can publish to a named remote with --remote.
Archive and Restore Saves the exact change before removing a Paseo-created checkout. Restore reopens that change at the same path. Save any ignored files separately before archiving.

How the pieces fit together

The daemon is the background server on the box with your files. The app and CLI send it requests through a WebSocket. The protocol defines the shape of each request and reply, and the client package provides functions the app and CLI can call. For example, Describe sends the checkout path, the expected change ID and the new description. The daemon checks the change ID, runs jj describe, and schedules a refresh.

Start here What you find there
Checkout provider and Jujutsu commands Detect the VCS and translate checkout reads into Git or Jujutsu commands. Detection stops at a nested repository boundary.
Checkout session, protocol and client Request handling and the data passed between the daemon and its clients. Search the files for checkout.jujutsu.
Actions and publication and CLI commands The daemon's implementation of Describe, New, Fetch and Publish, the hand-off to the forge, and the CLI flags.
Action policy, action forms and change picker The menu rules, text fields and search UI. TypeScript files ending in .tsx contain UI components.
New workspace picker, creation service and worktree utilities How the app picks a base, how the daemon chooses a directory and where it splits into Git worktree or Jujutsu workspace creation.
Archive service and recovery service When a checkout can be removed, what is kept in the persisted workspace record and how it is used on restore.

Bases, diffs and change IDs

A bookmark can move. Paseo saves its name so the comparison follows it, along with the commit it pointed to when the base was selected as a fallback. When starting from @, Paseo records the source change ID, which survives ordinary rewrites. The comparison uses fork_point(base | @). If your base moves forward after a fetch, the diff still starts at the shared history and shows your work without listing the upstream changes as removals.

A change ID follows a logical change as it is edited. A commit ID identifies one version of it. The change picker uses an exact ref or commit ID so it can select one result even when a Jujutsu change has diverged into multiple versions. The picker searches mutable changes, bookmarked changes and recent trunk history, with a bounded result list.

To include unrecorded edits, a diff or Changes list asks jj to snapshot in an unintegrated operation. The command can see those edits without advancing the repository's shared operation head. The operation ID on a Changes row lets Paseo reopen the exact snapshot when you click a file. If that command also imports Git refs, Paseo uses the final operation, which sees both the snapshot and the imported commits. Open Changes again if garbage collection has removed the old operation. See daemon architecture for more about checkout observation and protocol compatibility.

Config inheritance and recovery

paseo.json can configure setup commands and terminals. A new checkout keeps its own copy if its selected revision includes one. When that file is absent, a Git worktree tries the original repository first and then the selected checkout. A Jujutsu workspace copies from the selected checkout only. This lets a task based on one Jujutsu workspace inherit the local config from that workspace.

For archive, the daemon integrates a snapshot, saves its commit ID in the Paseo workspace record and creates a Git ref under refs/paseo/kept-commits/ to keep the commit available for recovery. It checks ownership, active references and whether tracked content has changed since the snapshot before asking jj workspace remove to remove the directory and its registrations. It also uses the upstream linked-worktree check to keep the directory if it contains a nested linked Git worktree. User-created checkouts stay on disk. If the saved checkout is missing, restore adds a workspace and edits the exact saved commit. Retention refs accumulate, as they do for Git worktrees.

Carrying the fork forward

The local series has a standalone fix for the detached-HEAD base picker, followed by the Jujutsu daemon and protocol support, the CLI commands, the app controls and the documentation. The daemon commit keeps creation, diff semantics and archive safety together because they share the same checkout and persistence code. The app and CLI both call that interface.

Keep a record of the upstream commit your fork starts from. For a new upstream release, create an update branch and replay the fork on the chosen upstream revision. For example, with full upstream history available:

git branch fork/jujutsu-update fork/jujutsu
git rebase --onto <new-upstream-revision> <old-upstream-base> fork/jujutsu-update
git range-diff <old-upstream-base>..fork/jujutsu <new-upstream-revision>..fork/jujutsu-update

The likely conflict points are the shared workspace lifecycle, checkout status and diff data, and the new-workspace screen. Keep Git's behavior at those boundaries and follow the new upstream call path before resolving a conflict. The worktree manager plugin API introduced in Paseo 0.17 prepares and validates Git targets. Route Jujutsu creation and recovery directly through the built-in Jujutsu paths so a configured Git manager can coexist with checkout from @. Both use the daemon's shared archive and restore coordination.

Build the protocol and client before typechecking the daemon, app or CLI so they all see the new request types. For example:

npm run build:client
npm run typecheck --workspace=@getpaseo/server
npm run typecheck --workspace=@getpaseo/app
npm run typecheck --workspace=@getpaseo/cli
npm exec --workspace=@getpaseo/server -- vitest run --maxWorkers=1 \
  src/server/daemon-e2e/git-operations.e2e.test.ts -t 'Jujutsu'

Review findings and trial checks

  • Open the web UI against a trial daemon with its own Paseo home. Create a Jujutsu workspace, select another change in the picker, open a file diff, discard a disposable edit, then archive and restore the workspace. Repeat creation and archive in a plain Git repository.
  • Test Publish bookmark and Create pull request against a disposable repo on the forge you actually use. The trial's local bare Git remote can exercise pushes. Live forge creation and status still need an interactive pass.
  • Use an origin remote for the app's publication and pull request workflow. Fetch can choose a different base remote, and the CLI can explicitly publish to one. Pull request status looks for a single matching published bookmark on origin.
  • If a long fetch or push repeatedly delays diffs in unrelated repositories, inspect the two-command daemon-wide limit in checkout-jj.ts. Reproduce any contention before changing how the daemon schedules Jujutsu commands.