Skip to content

[bug] ix map can register duplicate or invalid workspace roots #544

Description

@Hiro-Chiba

Description

ix map derives workspace identity from the invocation path without first selecting and canonicalizing the repository root. Running it from a nested directory can register that directory as a second workspace, while a symlink to the same repository can produce another workspace ID. A nonexistent explicit path is registered before the command fails.

Steps to reproduce

  1. Initialize a Git repository with a src subdirectory.
  2. Run ix map from the repository root.
  3. Change to src and run ix map without a path.
  4. Run ix map through a symlink to the same repository.
  5. Run ix map /tmp/path-that-does-not-exist.

Expected behavior

Without an explicit path, map uses the nearest registered workspace root or Git root. Workspace paths and lock keys use the canonical real path. Missing and non-directory paths fail before workspace registration.

Actual behavior

Nested and symlink paths can become separate workspaces for the same repository. A missing path can remain in configuration after map exits with an error.

CLI output

The workspace configuration contains multiple roots for one physical repository, or a root that does not exist.

Environment

  • OS: macOS
  • Node: 22.x
  • Ix version: 0.10.5 and current main (3baa7dc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions