Add Jujutsu repository support for /codex:review - fixes #215#292
Open
masterzen wants to merge 5 commits intoopenai:mainfrom
Open
Add Jujutsu repository support for /codex:review - fixes #215#292masterzen wants to merge 5 commits intoopenai:mainfrom
masterzen wants to merge 5 commits intoopenai:mainfrom
Conversation
Introduce jj.mjs with Jujutsu-native implementations of all VCS operations: detection, workspace root, working tree state, review target resolution, and diff collection (working copy and range modes). Add vcs.mjs as a dispatch layer that auto-detects jj vs git and routes all VCS calls to the appropriate backend. Update codex-companion.mjs and workspace.mjs to import through vcs.mjs so jj repos use jj-native commands throughout. The native Codex reviewer only understands git, so jj repos fall back to the context-collection review path which uses our jj backend for diff gathering. JJ-Change-Id: vqqkyxznqrqn
Test detectVcs for .jj/.git directory detection, colocated repo preference, upward directory walking, caching, and the error case when neither VCS is found. JJ-Change-Id: qvrvvyzosxlu
Cover working copy and range review context collection, ANSI stripping, self-collect fallback for large diffs, custom --base revset support, and review context shape parity with the git backend. JJ-Change-Id: qrqqnnstvsqq
Detect default jj review bases from available bookmarks when trunk() is unavailable, diff branch reviews from the fork point/common ancestor instead of the live base bookmark tip, and keep self-collect guidance sandbox-safe. Add coverage for nested VCS root detection and the new jj review-context cases. JJ-Change-Id: pqrxknwuxups
Route plain /codex:review for jj repositories through the native review/start API using a custom target with jj-specific instructions, instead of falling back to the prompt-built turn/start path. Add runtime coverage for the outgoing native review payload. JJ-Change-Id: knywmwzwwrlt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Add end-to-end support for reviewing changes in Jujutsu (jj) (see https://github.com/jj-vcs/jj) repositories, not just Git repositories. This fixes #215.
This stack teaches the review flow how to:
--basehandling/codex:reviewthrough the native review API for jj repositories by sending Jujutsu-specific review instructionsWhy?
The goal is to make
/codex:reviewand/codex:adversarial-reviewwork as a first-class feature in jj repositories instead of assuming Git semantics.Without this, review support is incomplete in several important ways:
This change closes that gap so users can review jj work with the same command, while getting review targets and context that match Jujutsu concepts.
Notes
There are still some limitations:
/codex:reviewin jj repos uses the native review API, but it does so through a custom review target with Jujutsu-specific instructions rather than Git-specific structured target types.trunk()is unavailable and depends on common bookmark names.