Skip to content

fix(config): one config per directory, duplicate keys, shared workspace root - #13

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

gold-silver-copper merged 23 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
  • Two meta config files in one directory are an error naming them all; the names live in META_CONFIG_NAMES.
  • find_meta_config, find_parent_meta_config and find_root_meta_dir return Result, so an unreadable or ambiguous config is an error, not "no config".
  • nearest_meta_dir (a bare .meta/ folder like ~/.meta/ is not a workspace), workspace_meta_dirs (nearest first; each parent counts only if its own project list names the child; a checkout in a set meta made continues with the workspace the set was made from) and workspace_root, shared by worktree scope and plugin discovery.
  • set_source: the checkout a set checkout stands for (the set's root: the record's project; another checkout: that workspace's project with the same repository, normally the one at its place in the set, which mirrors the workspace layout; followed through sets made inside sets; WORKTREE_RECORD_FILE moved here), so a hand-made git worktree add of the root is a workspace of its own, and a set copy's absolute worktrees_dir is read as that checkout's.
  • recorded_project and recorded_set read meta's worktree record; gitfile_target names the git dir a .git file points to; meta_config_at reads one directory's config (--config name or the default).
  • resolve_inside follows a link whose target doesn't exist yet the way the OS would (each existing part resolved as the OS does, so links are followed before a later .. and Windows paths meet the base in its \\?\ form; .. out of a missing directory refused; at most 40 links; the rest of the path still checked), so a link the root checkout copies into a set leads to where its repo goes and a link out is still refused. Its errors escape the path.
  • Duplicate project keys are an error naming the key and file (JSON and YAML), checked on MetaConfig itself.
  • data_dir tests no longer set the process-global META_DATA_DIR (the macOS CI flake).

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]]

Reject duplicate project keys with their file and key named. Exercise data directory helpers with explicit paths instead of mutating process environment.

[[tasks/harmony-2793]]
Propagate discovery errors and retain the actual parent config for orphan hints.
[[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: ba63e347-deef-46b4-a7b2-6db90e4c58ca
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…pace

workspace_meta_dirs returns the workspace's meta dirs nearest first,
mapping a linked git worktree (a set's root checkout) to its main
checkout, and asks each parent only for its own project list, so a
broken sibling config no longer splits the workspace. Duplicate project
keys are checked on MetaConfig itself.

[[tasks/harmony-2793]]
…space

A hand-made git worktree of the root is a workspace of its own. A set
checkout's own meta dir stays first in workspace_meta_dirs, so its
local plugins still load. The record file name lives here.

[[tasks/harmony-2793]]
Git's shared repository doesn't say which checkout made a set: a
hand-made git worktree of the root is a second workspace sharing the
root's git dir. set_origin reads the record's project instead.

[[tasks/harmony-2793]]
A set checkout's config accepts an absolute worktrees_dir inside the
workspace the set was made from.

[[tasks/harmony-2793]]
set_source maps <set>/<path> to <project>/<path> from meta's record.
workspace_meta_dirs walks the set's own meta dirs, then the source's
chain. A set copy's absolute worktrees_dir is checked against the
source.

[[tasks/harmony-2793]]
A member's alias is looked up by project name in the project's config
(or used as the path for recursive sets), and a set made from inside
another set leads on to that set's source.

[[tasks/harmony-2793]]
Sets lay their repos out as the workspace, so no alias guessing.

[[tasks/harmony-2793]]
resolve_inside checks a dangling link as the path it names, so a link the root checkout copies into a set before its target exists leads to that target; a link out is still refused. meta_config_at reads one directory's config.

Implements [[tasks/harmony-2793]]
Each link part of the target is followed before a later '..'; '..' out of a missing directory is refused; at most 40 links; the rest of the path is still checked after a followed link; resolver errors escape the path.

Implements [[tasks/harmony-2793]]
…s own repo

When the source rebuilt from a checkout's place is another git repository, the source is git's main checkout of the checkout's own.

Implements [[tasks/harmony-2793]]
…kspace

When the place-based source is another repository, the source is the recorded workspace's project that is the checkout's own repository; none means none.

Implements [[tasks/harmony-2793]]
… its repo

A place that holds no repository (missing, or a plain directory) is looked up by identity too.

Implements [[tasks/harmony-2793]]
With no commondir behind a .git file, its target is the common git dir, as repo_git_dir has it. Unit fixtures now write the commondir real linked worktrees have.

Implements [[tasks/harmony-2793]]
A record meta can no longer parse still marks a checkout as meta's.

Implements [[tasks/harmony-2793]]
…S does

canonicalize each existing part, so an absolute target meets the base in its \\?\ form on Windows and links are followed before a later '..'.

Implements [[tasks/harmony-2793]]
…n empty gitdir names nothing

project_with_git_dir passes over configs it can't read. gitfile_target returns nothing for 'gitdir:' with no target; common_git_dir uses it. has_worktree_record is folded into its one caller.

Implements [[tasks/harmony-2793]]
…t just its repository

A non-root checkout stands for the recorded workspace's project with the same repository: the one at its place, else the only one; a second workspace's checkout of that repository is no project.

Implements [[tasks/harmony-2793]]
@gold-silver-copper
gold-silver-copper merged commit b84c0e1 into main Oct 28, 2026
7 checks passed
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