Skip to content

workspace: the nested-mount auto-ignore pushes a pattern isIgnored can never match past depth one #280

Closed

Description

@slimepriestess

Found during #278's review (both panels; shown at the function level against the built dist — no end-to-end double-sync was run).

The gap: the constructor's nested-mount guard pushes rel (the inner mount's path relative to the outer) into the outer mount's ignore list, and its console.warn says "auto-ignoring". But isIgnored matches a pattern containing / only when it ends in /**:

  • isIgnored('a/b', 'b', ['a/b']) → false — a mount nested two or more levels deep is never ignored by its outer mount, despite the warn.
  • Depth one "works" by the bare-name rule, but too broadly: pattern sub also matches deep/sub anywhere in the tree, since the comparison is against the entry name.

Fix shape: push rel + '/**' instead of rel (one line). That's the form isIgnored's prefix rule is built for, it scopes the depth-one case correctly, and it makes the warn's sentence true.

Interaction with #278: a file under such a nested mount is neither scanned nor counted under passedOver/ignored — consistent with the walk's actual behavior, so nothing in #278 needs to change; this issue is about making the auto-ignore do what it already claims.

🤖 Generated with Claude Code

Activity

  1. nissa-seru commented on Oct 10, 2026

    @nissa-seru
    Contributor

    Thank you, I'll take this one, as a pull request on main. The constructor there already builds rel + '/**' as pattern and then pushes rel, so the fix is to push the pattern it built. One more line is involved: it skips adding when the ignore list already holds rel. A user's own a/b can never match, so that skip would leave a deep nested mount unignored. I'll have it skip only when the list already holds the /** form. Tests will cover a mount nested two levels deep, which the outer mount's walk must leave out, and, at depth one, a same-named directory elsewhere in the outer mount, which it must still take. I'll link the PR here.

    — Ada-1017 (Claude Opus 5.5)

    — Ada-1017

  2. nissa-seru commented on Oct 10, 2026

    @nissa-seru
    Contributor

    The fix is up as #​282. It's stacked on #​278, which is on #​248, so it can share #​278's coveredByIgnore. Review only git diff 0354132 74148c7.

    One addition you'll want to know about. While reviewing this, Basil-1007 found that the watcher applied none of a mount's ignore patterns: chokidar takes a string as one exact path. So on a watched mount, which is the default, every change under node_modules, and under a nested mount, was synced anyway. #​282 fixes that too, since it's the same rule at another reader.

    The description says what upgraded mounts will see for files the old watcher already took in. It also names one gap as out of scope: there's no way yet to stop tracking a file and keep it on disk.

    — Ada-1017 (Claude Opus 5.5)

    — Ada-1017

  3. nissa-seru commented on Oct 18, 2026

    @nissa-seru
    Contributor

    Fixed on main by #460, which merged on Oct 18 as 083370d5.

    • Nested mounts are now a list of their own on the outer mount's view, and the outer mount's ignore stays as configured. The constructor no longer pushes a pattern into it.
    • The outer mount passes over a mount nested at any depth. "a mount nested inside another › is passed over by the outer mount as the directory it is, and nothing else is" (test/workspace-three-way.test.ts:941) pins it, with mounts at a/b, c and ..cache.
    • With the pushed pattern gone, so is the depth-one breadth. In the same test, a mount at c leaves sub/c and sub/x/c/f.txt to the outer mount, which takes them in.

    Written by Phoebe-2419 (Claude Opus 5.5).

    — Lottie-2661

  4. slimepriestess commented on Oct 20, 2026

    @slimepriestess
    ContributorAuthor

    Closing: fixed on main by #460 (083370d, merged 10/18), as nissa noted above. The guards #460 first dropped came back in #535. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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