Skip to content

fix(daemon): list dot-prefixed user content in managed projects - #6214

Open
mturac wants to merge 2 commits into
nexu-io:mainfrom
mturac:fix/issue-6175
Open

fix(daemon): list dot-prefixed user content in managed projects#6214
mturac wants to merge 2 commits into
nexu-io:mainfrom
mturac:fix/issue-6175

Conversation

@mturac

@mturac mturac commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #6175

Why

Hit this while keeping project notes in a .notes.md file: @-mentioning it from the chat composer silently finds nothing, and the same happens for .github/ or .vscode/ content. The file and folder listing helpers in apps/daemon/src/projects.ts apply a blanket startsWith('.') filter, so every dot-prefixed entry is invisible to mention autocomplete and project search — not just the internal directories the filter was meant to hide.

What users will see

In managed projects, @-mention autocomplete and project search now find dot-prefixed user content such as .github/workflows/ci.yml, .vscode/settings.json, or .notes.md. Internal directories (.git, .od, .live-artifacts, .file-versions, node_modules, …) stay hidden. Imported folders (external baseDir) are unchanged: hidden entries there remain unlisted, consistent with the existing rule that refuses to serve hidden path segments from a user's own directory.

Surface area

  • Default behavior change — dot-prefixed user files become visible in listing/search for managed projects (previously always hidden)

Bug fix verification

  • Test path: apps/daemon/tests/project-hidden-files.test.ts
  • Red on main, green on this branch: yes (2 failed on main — managed listing cases; 9 pass with the fix)

Validation

  • vitest run tests/project-hidden-files.test.ts tests/live-artifacts-store.test.ts tests/project-archive.test.ts tests/folder-import-projects.test.ts tests/projects-list-files.test.ts tests/project-watchers.test.ts tests/project-file-rename.test.ts — 100 passed (100)
  • tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json --noEmit — clean
  • pnpm guard — pass

Open question

Archives intentionally keep the blanket hidden-entry exclusion (project-archive.test.ts locks that contract), so a listed .github/workflows/ci.yml is still rejected by batch download. If you'd rather have archive visibility follow the new listing policy for managed projects, happy to do that as a follow-up.

The file and folder listing helpers skipped every entry whose basename
starts with '.', so legitimate user content such as .github/,
.storybook/, or a .notes.md file never appeared in @-mention
autocomplete or project search.

Replace the blanket filter with the explicit policy: the shared ignore
list (project-ignored-dirs.ts) plus the reserved daemon state
directories (.live-artifacts, .file-versions) stay hidden everywhere;
other dot-prefixed entries are listed for managed projects. Imported
folders (external baseDir) keep hiding hidden entries, consistent with
assertVisibleForImportedProject.

Fixes nexu-io#6175
@lefarcen
lefarcen requested a review from nettee July 29, 2026 06:01
@lefarcen lefarcen added size/M PR changes 100-300 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/bugfix Bug fix labels Jul 29, 2026
@lefarcen lefarcen added the needs-validation Runtime change detected; needs human or /explore agent validation. label Jul 29, 2026
@lefarcen

Copy link
Copy Markdown
Contributor

🧪 Queued for QA validation — this PR changes a user-facing runtime path, so we’ll run a manual QA pass before merge. Nothing needed from you right now; we’ll update here once that pass is done. Thanks for the contribution! 🙏

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one behavior mismatch in the new managed-project hidden-file policy that should be fixed before this lands.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

// serve hidden path segments from a user's own directory. Reserved daemon
// directories (.live-artifacts, .file-versions) stay hidden everywhere.
const skipHidden = hasExternalProjectRoot(metadata);
await collectFiles(dir, '', out, isListingSkippedDirName, dir, skipHidden);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes .github/, .vscode/, .notes.md, etc. visible in managed projects, but buildProjectArchive() still uses collectArchiveEntries()'s unconditional e.name.startsWith('.') filter and its own comment still says the ZIP "matches what the user sees in the file panel". The result is that a managed project can now show a dot-prefixed file in the UI and autocomplete, yet Download as .zip silently drops it from the exported archive. That is a real correctness problem for backups/hand-off because visible user content disappears during export with no warning. Please either update the archive walker/tests to follow the same managed-vs-imported hidden-entry policy as listFiles, or explicitly change the surrounding contract so these newly visible files are not presented as exportable project content.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8827edc.

@lefarcen

Copy link
Copy Markdown
Contributor

Hey @mturac — the current blocker on this head is the mismatch @nettee called out: managed projects can now surface dot-prefixed user content, but project archive export still drops those entries.

Once the archive behavior and the surrounding contract are aligned, this should be in much better shape for the next pass.

@lefarcen
lefarcen requested a review from nettee July 30, 2026 12:32

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mturac I re-checked the archive/listing parity in apps/daemon/src/projects.ts and the follow-up now lines up managed-project dotfile visibility across full archives, batch archives, and imported-folder guards. The added regression coverage around managed vs. imported projects, reserved daemon paths, and archive root handling matches the code paths this change touches. I couldn't rerun Vitest in this prepared checkout because the worktree has no node_modules, but the implementation and new tests are coherent. Nice follow-through on closing the archive mismatch.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen
lefarcen requested a review from ivy-ting July 30, 2026 14:27
@ivy-ting

Copy link
Copy Markdown

@mturac

Thanks for the contribution. I completed QA validation for this PR.

QA Acceptance Record

Scope:

  • Managed-project dotfile listing, search, mention autocomplete, full archives, and batch archives
  • Imported-folder hidden-path boundaries

Verified:

  • 103 targeted daemon tests passed
  • Daemon source/test type checks and repository guard passed
  • On the real Web runtime for head 8827edc0, .notes.md, .github/workflows/ci.yml, and .storybook/main.ts were visible
  • @.notes and @.github returned the expected suggestions, while internal .git/ content remained hidden
  • Managed full and batch ZIP exports included visible dotfiles
  • Imported folders continued to hide and reject hidden listing/archive paths

Not verified:

  • Windows-native UI smoke test

Risks / notes:

  • The PR body should be updated because its archive open question and 100-test count are stale; the current implementation aligns archives with listing behavior and the targeted run passed 103 tests.

Conclusion:

  • Accepted

@ivy-ting ivy-ting added validated Runtime change validated (via /explore Pass or manual QA). and removed needs-validation Runtime change detected; needs human or /explore agent validation. labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/M PR changes 100-300 lines type/bugfix Bug fix validated Runtime change validated (via /explore Pass or manual QA).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: @-mention autocomplete never suggests any file or directory whose name starts with a dot

4 participants