Skip to content

feat(runtime): jjWorkspace — jj/Jujutsu backend for the Workspace port#196

Merged
drewstone merged 1 commit into
mainfrom
feat/workspace-jj
Jun 8, 2026
Merged

feat(runtime): jjWorkspace — jj/Jujutsu backend for the Workspace port#196
drewstone merged 1 commit into
mainfrom
feat/workspace-jj

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Adds jjWorkspace — a Jujutsu (jj) backend for the Workspace port, alongside gitWorkspace. Same port, same Shell, same WorkspaceCommit discriminated union — a drop-in. Exported via /loops.

const ws = jjWorkspace({ ref: bareRepo })   // instead of gitWorkspace(...)
await ws.materialize(dir)                    // jj git clone --colocate
await ws.commit(dir, 'msg')                  // describe + new + jj git push → {ok,rev} | {ok:false,conflict}

Why

This finishes the "support jj and any other agent-friendly lightweight versioning" ask. jj suits accumulating, resumable agent loops: no staging area, a first-class operation log (native resume/undo), and conflicts are recorded rather than aborted — a rejected push surfaces as a typed blocker. The port already abstracted the durable store behind a Shell; jj is genuinely a drop-in.

How this unifies the two in-flight branches

I traced the two stalled cherry-picks (feat/observe-closed-loop deep-clean sequence + feat/cloud-loop workspace port) against current main. 3 of the 4 orphan commits were already merged through other PRs, so cherry-picking them was re-applying landed work (the source of the conflicts):

orphan commit status on main
b3c280c sandbox retry hardenings already landed (main is ahead — renamed LoopSandboxClientSandboxClient)
daba562 shared stats.mts + gate dedup already landed (stats.mts identical; gates ahead via #191 runtimeDecisionPoints)
9838392 steer-firewall dedup + drop analyst-driver-hook already landed (file deleted, dynamic.tsdriver.ts)
0b110ea Workspace port partial — jjWorkspace was the one genuine gap

The orphan 0b110ea also regressed the commit type to a looser CommitResult interface (optional rev?/conflict?, allowing an invalid {ok:true}); this PR keeps main's fail-closed WorkspaceCommit union instead.

Test

  • pnpm run lint / typecheck / build — clean.
  • Full suite: 680 passed, 1 skipped (the jj test skips when the jj binary is absent, e.g. CI; it mirrors the gitWorkspace durable-state-carry contract when jj is present).
  • jjWorkspace confirmed exported through dist/loops.d.ts.

… port

The Workspace port abstracts the durable shared store behind a Shell; this adds
a jj-backed implementation alongside gitWorkspace, returning the same
WorkspaceCommit discriminated union (drop-in). jj suits accumulating agent
loops: no staging area, a first-class operation log (native resume/undo), and
conflicts recorded rather than aborted — a rejected push surfaces as a typed
blocker. Author identity is injected via --config-toml so a throwaway colocated
clone is self-contained (parallels gitWorkspace's -c user.*).

Exported via /loops; covered by a test mirroring the gitWorkspace contract that
skips when the jj binary is absent (CI).
@drewstone drewstone merged commit 7eb60d5 into main Jun 8, 2026
1 check passed
@drewstone drewstone deleted the feat/workspace-jj branch June 8, 2026 14:42
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