Repository navigation
fix(conn-server): new worktrees honour sparse patterns and worktreeSubmodules, as T3 - #313
Merged
Merged
Conversation
…bmodules, as T3 vcs.createWorktree left submodules empty under the recursive default, and thread launch initialized them recursively even with worktreeSubmodules=none. Neither applied t3.json's worktreeSparsePatternsPath. T3 does both in createWorktree (GitVcsDriverCore.ts). conn_vcs::worktree now reads the sparse pattern file named by t3.json at the ref, checks out --no-checkout, sets the non-cone patterns and checks out; a named file that is missing fails the worktree and leaves no branch. submodule_mode resolves worktreeSubmodules as resolveProjectFileBackedSetting does (the project's setting, else t3.json at HEAD, else recursive), and update_submodules runs init, update and T3's partial-clone recovery. vcs.createWorktree, thread launch (with its stage statuses, "disabled in settings|t3.json") and pull request checkout now share them. Launch and delegated worktrees carry the project id for the per-project setting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # apps/conn-server/crates/conn-vcs/tests/repos.rs
…matches the root as given `t3.json` is now lenient JSON (comments, trailing commas) decoded as a whole `T3ProjectFile`, so one invalid field rejects the file as in `parseT3ProjectFile`. The lenient parser moves from conn-provider-claude to conn-support so both use it. `vcs.createWorktree` finds the project by the `cwd` string, as `findActiveByWorkspaceRoot` does. It no longer canonicalizes every root on the runtime thread, and a symlink alias no longer takes another project's override. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Decode t3.json through serde_json::Value, as JSON.parse keeps the last of a repeated key, instead of rejecting the file and falling back to a recursive submodule checkout. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # apps/conn-server/crates/conn-support/src/lib.rs
Owner
Author
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.
Third port audit, items 4 and 5: new worktrees honour sparse patterns and
worktreeSubmodules(conn-vcs).Problem
vcs.createWorktreeleft submodules empty under the recursive default.orchestration.launchThreadfilled them even withworktreeSubmodules=none.t3.json'sworktreeSparsePatternsPath, so an excluded tracked file was checked out.T3
GitVcsDriverCore.ts:5344(readWorktreeSparsePatterns,--no-checkout,sparse-checkout set --no-cone --stdin,checkout) andGitVcsDriverCore.ts:5447:HEAD:.gitmodulesexists.resolveProjectFileBackedSetting: the setting, elset3.jsonatHEAD, else recursive.submodule init, thenupdate, and on failure checks out the submodules that did clone.Fix
create_worktreereads the sparse patterns before it creates the branch. A named file missing from the ref fails the worktree, and nothing is left behind.submodule_modeandupdate_submodulesare shared byvcs.createWorktree, launch and pull request checkout. Launch keeps its stage statuses and reports "disabled in settings|t3.json" as T3 does.WorktreeRequestcarries the project id, so the per-project setting applies.t3.jsonfrom the working tree, and a failed update aborted it. It now readst3.jsonfromHEADand only warns on a failed update, as T3 does. It still reads only the environment-level setting, not a project override.Proof
a_sparse_worktree_leaves_out_what_t3_json_excludes: excluded files are absent, and a missing pattern file fails without leaving a branch.submodule_mode_follows_the_setting_then_t3_json: precedence,t3.jsonread fromHEAD, no.gitmodules, andnoneleaves the module empty.GIT_CONFIG_*, which blocksprotocol.file.allowwithout writing to the decoy HOME.Acceptance
The audit probe (
audit-third.mjs, Rust mode) on this branch now gives T3's results, through the real WebSocket entry points and a real file-protocol submodule clone in a disposable HOME:excludedPresent: false: the sparse-excluded tracked file is absent.moduleAvailable: true:vcs.createWorktreefills the submodule under the recursive default.modulePresentWhenOff: false:orchestration.launchThreadleaves it empty withworktreeSubmodules=none.Checks
These pass locally:
cargo testfor conn-vcs, conn-source-control, conn-engine, conn-mcp, and the conn-server VCS, host and settings tests.cargo clippy -D warningson those crates.Two engine checkpoint tests timed out at 5 s under load and passed when rerun alone. CI runs
tools/check.shon Linux.Review fixes
t3.jsonis now read asparseT3ProjectFilereads it: lenient JSON (comments, trailing commas), decoded as a wholeT3ProjectFile, so one invalid field rejects the whole file. The workspace's lenient parser moved from conn-provider-claude toconn_support::json. Tests: JSONC sparse patterns, JSONCworktreeSubmodules: "none", and an invalid document that now gives a full checkout and recursive submodules.vcs.createWorktreefinds the project by thecwdstring, asfindActiveByWorkspaceRootdoes. There is no canonicalize on the runtime thread, and a symlink alias no longer takes another project's override. Test:create_worktree_takes_the_override_of_the_exact_workspace_root.Round 3 (
af1c7a8594): a repeatedt3.jsonkey takes its last value, asJSON.parsedoes, instead of rejecting the file. Test: a new case insubmodule_mode_follows_the_setting_then_t3_json(fails before, passes after).Follow-ups
🤖 Generated with Claude Code