Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

fix(worktree): set removal keeps to the workspace's repos - #20

Merged
gold-silver-copper merged 19 commits into
mainfrom
fix/meta-stable-dotmeta
Oct 28, 2026
Merged

gold-silver-copper merged 19 commits into
mainfrom
fix/meta-stable-dotmeta

Conversation

@gold-silver-copper

@gold-silver-copper gold-silver-copper commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
  • Workspace: the workspace's repos as git dirs; foreign_members names worktrees from another workspace's repository, or whose record names a project in another workspace (two workspaces can share the root's git dir), with that workspace.
  • New blocker kind missing_records: in a set meta made, a worktree without a record blocks removal (create's rollback is exempt).
  • Names in errors escaped (validate_worktree_name, also for exec/status/diff; lookup_project, nested lookup; durations, --from-pr specs, branch names, fetch errors and git's error text in every worktree message); config read through the shared resolver; workspace, set source and record file name from meta_core.
  • resolve_worktree_root resolves from the checkout a set checkout stands for; place_in_set gives a repo's place in a set (its path from the meta dir).
  • owner_dir: the meta dir whose sets and settings a set's are (inside a set, the checkout it stands for).
  • dest_in_set: a repo is checked out where a link a checkout already holds at its place leads (inside the set).
  • remove's refusal for a set made by a workspace that is gone says so and points to git worktree remove.

Part of the meta stability set: gitkb/meta#128 has the full description and how it was verified. Merge together with it (same branch name, so CI builds them together).

Implements [[tasks/harmony-2793]]

Add worktree::workspace: the workspace a meta dir belongs to climbs only
through parents whose project tree lists the child (an unlisted nested
workspace is its own), and its repos are the root plus every repo in its
.meta tree, as git dirs. Workspace::foreign_members names each worktree
of a set whose repository is not one of them, with the workspace its
record names, so prune and remove can keep to this workspace's sets.

In a set that has a record, a worktree without one is now a blocker of
its own kind (RemovalCheck::missing_records): meta didn't create it, so
it doesn't delete it. Only create's rollback exempts that kind.

[[tasks/harmony-2793]]
…olver

validate_worktree_name, lookup_project and lookup_nested_project show
user-given names (and the valid list) escaped, so a name with a newline
or ESC gives a one-line error with no raw control bytes. The nested
lookup's valid paths are listed on that one line.

read_meta_config_value goes through meta_core::config::find_meta_config_in
and returns errors instead of skipping a config it can't read or parse;
resolve_worktree_root propagates them and hooks warn and don't run.

A duration that isn't a number names the whole value.

[[tasks/harmony-2793]]
Adapt to meta_core's Result-returning config lookups: a config that
can't be read, or two configs in one directory, is an error instead of
"no config".

[[tasks/harmony-2793]]
Plugin discovery reads .meta/plugins next to the nearest meta config
and next to each parent config that lists it (one workspace), and no
further. A legacy .meta config file means no project plugins, without
a warning. workspace_root moves to meta_core so worktree scope and
plugin scope share one definition; the nearest-config lookup is now
nearest_meta_dir.

[[tasks/harmony-2793]]
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: dddd5f87-0d2b-473f-81ba-05e4592b50cc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…red repo

A worktree whose record names a project in another workspace counts as
that workspace's, so a hand-made second workspace sharing the root's
git dir can't prune or remove the first one's root-only sets.

[[tasks/harmony-2793]]
…errors

Workspace keeps only git dirs and resolves its root once.

[[tasks/harmony-2793]]
A record whose project is gone or moved is not this workspace's.
resolve_worktree_root resolves from the checkout a set checkout stands
for. Worktree names are validated for exec/status/diff; --from-pr,
branch and git error text are escaped.

[[tasks/harmony-2793]]
place_in_set puts each repo where it is in the workspace. A refusal for
a set whose workspace is gone points to git worktree remove.

[[tasks/harmony-2793]]
dest_in_set: the repo placed at a link a checkout already holds goes where the link leads, inside the set.

Implements [[tasks/harmony-2793]]
Inside a set, the checkout it stands for, which outlives the set.

Implements [[tasks/harmony-2793]]
… hook warning

Implements [[tasks/harmony-2793]]
@gold-silver-copper
gold-silver-copper merged commit 7b12b59 into main Oct 28, 2026
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant